All In One Schema Rich Snippets - Version 1.1.7

Version Description

  • Improvement: Added "Test Rich Snippets" menu in admin bar for testing rich snippets in Google Webmasters Tools
  • Fixed: retina.js issue resolved
  • Removed unnecessary code
Download this release

Release Info

Developer brainstormforce
Plugin Icon 128x128 All In One Schema Rich Snippets
Version 1.1.7
Comparing to
See all releases

Code changes from version 1.1.6 to 1.1.7

admin/js/jquery.easytabs.min.js CHANGED
@@ -1,14 +1,12 @@
1
- /*
2
- * jQuery EasyTabs plugin 3.1.1
3
- *
4
- * Copyright (c) 2010-2011 Steve Schwartz (JangoSteve)
5
- *
6
- * Dual licensed under the MIT and GPL licenses:
7
- * http://www.opensource.org/licenses/mit-license.php
8
- * http://www.gnu.org/licenses/gpl.html
9
- *
10
- * Date: Tue Jan 26 16:30:00 2012 -0500
11
- */
12
- (function(a){a.easytabs=function(j,e){var f=this,q=a(j),i={animate:true,panelActiveClass:"active",tabActiveClass:"active",defaultTab:"li:first-child",animationSpeed:"normal",tabs:"> ul > li",updateHash:true,cycle:false,collapsible:false,collapsedClass:"collapsed",collapsedByDefault:true,uiTabs:false,transitionIn:"fadeIn",transitionOut:"fadeOut",transitionInEasing:"swing",transitionOutEasing:"swing",transitionCollapse:"slideUp",transitionUncollapse:"slideDown",transitionCollapseEasing:"swing",transitionUncollapseEasing:"swing",containerClass:"",tabsClass:"",tabClass:"",panelClass:"",cache:true,panelContext:q},h,l,v,m,d,t={fast:200,normal:400,slow:600},r;f.init=function(){f.settings=r=a.extend({},i,e);if(r.uiTabs){r.tabActiveClass="ui-tabs-selected";r.containerClass="ui-tabs ui-widget ui-widget-content ui-corner-all";r.tabsClass="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all";r.tabClass="ui-state-default ui-corner-top";r.panelClass="ui-tabs-panel ui-widget-content ui-corner-bottom"}if(r.collapsible&&e.defaultTab!==undefined&&e.collpasedByDefault===undefined){r.collapsedByDefault=false}if(typeof(r.animationSpeed)==="string"){r.animationSpeed=t[r.animationSpeed]}a("a.anchor").remove().prependTo("body");q.data("easytabs",{});f.setTransitions();f.getTabs();b();g();w();n();c();q.attr("data-easytabs",true)};f.setTransitions=function(){v=(r.animate)?{show:r.transitionIn,hide:r.transitionOut,speed:r.animationSpeed,collapse:r.transitionCollapse,uncollapse:r.transitionUncollapse,halfSpeed:r.animationSpeed/2}:{show:"show",hide:"hide",speed:0,collapse:"hide",uncollapse:"show",halfSpeed:0}};f.getTabs=function(){var x;f.tabs=q.find(r.tabs),f.panels=a(),f.tabs.each(function(){var A=a(this),z=A.children("a"),y=A.children("a").data("target");A.data("easytabs",{});if(y!==undefined&&y!==null){A.data("easytabs").ajax=z.attr("href")}else{y=z.attr("href")}y=y.match(/#([^\?]+)/)[0].substr(1);x=r.panelContext.find("#"+y);if(x.length){x.data("easytabs",{position:x.css("position"),visibility:x.css("visibility")});x.not(r.panelActiveClass).hide();f.panels=f.panels.add(x);A.data("easytabs").panel=x}else{f.tabs=f.tabs.not(A)}})};f.selectTab=function(x,C){var y=window.location,B=y.hash.match(/^[^\?]*/)[0],z=x.parent().data("easytabs").panel,A=x.parent().data("easytabs").ajax;if(r.collapsible&&!d&&(x.hasClass(r.tabActiveClass)||x.hasClass(r.collapsedClass))){f.toggleTabCollapse(x,z,A,C)}else{if(!x.hasClass(r.tabActiveClass)||!z.hasClass(r.panelActiveClass)){o(x,z,A,C)}else{if(!r.cache){o(x,z,A,C)}}}};f.toggleTabCollapse=function(x,y,z,A){f.panels.stop(true,true);if(u(q,"easytabs:before",[x,y,r])){f.tabs.filter("."+r.tabActiveClass).removeClass(r.tabActiveClass).children().removeClass(r.tabActiveClass);if(x.hasClass(r.collapsedClass)){if(z&&(!r.cache||!x.parent().data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[x,y]);y.load(z,function(C,B,D){x.parent().data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[x,y,C,B,D])})}x.parent().removeClass(r.collapsedClass).addClass(r.tabActiveClass).children().removeClass(r.collapsedClass).addClass(r.tabActiveClass);y.addClass(r.panelActiveClass)[v.uncollapse](v.speed,r.transitionUncollapseEasing,function(){q.trigger("easytabs:midTransition",[x,y,r]);if(typeof A=="function"){A()}})}else{x.addClass(r.collapsedClass).parent().addClass(r.collapsedClass);y.removeClass(r.panelActiveClass)[v.collapse](v.speed,r.transitionCollapseEasing,function(){q.trigger("easytabs:midTransition",[x,y,r]);if(typeof A=="function"){A()}})}}};f.matchTab=function(x){return f.tabs.find("[href='"+x+"'],[data-target='"+x+"']").first()};f.matchInPanel=function(x){return(x?f.panels.filter(":has("+x+")").first():[])};f.selectTabFromHashChange=function(){var y=window.location.hash.match(/^[^\?]*/)[0],x=f.matchTab(y),z;if(r.updateHash){if(x.length){d=true;f.selectTab(x)}else{z=f.matchInPanel(y);if(z.length){y="#"+z.attr("id");x=f.matchTab(y);d=true;f.selectTab(x)}else{if(!h.hasClass(r.tabActiveClass)&&!r.cycle){if(y===""||f.matchTab(m).length||q.closest(y).length){d=true;f.selectTab(l)}}}}}};f.cycleTabs=function(x){if(r.cycle){x=x%f.tabs.length;$tab=a(f.tabs[x]).children("a").first();d=true;f.selectTab($tab,function(){setTimeout(function(){f.cycleTabs(x+1)},r.cycle)})}};f.publicMethods={select:function(x){var y;if((y=f.tabs.filter(x)).length===0){if((y=f.tabs.find("a[href='"+x+"']")).length===0){if((y=f.tabs.find("a"+x)).length===0){if((y=f.tabs.find("[data-target='"+x+"']")).length===0){if((y=f.tabs.find("a[href$='"+x+"']")).length===0){a.error("Tab '"+x+"' does not exist in tab set")}}}}}else{y=y.children("a").first()}f.selectTab(y)}};var u=function(A,x,z){var y=a.Event(x);A.trigger(y,z);return y.result!==false};var b=function(){q.addClass(r.containerClass);f.tabs.parent().addClass(r.tabsClass);f.tabs.addClass(r.tabClass);f.panels.addClass(r.panelClass)};var g=function(){var y=window.location.hash.match(/^[^\?]*/)[0],x=f.matchTab(y).parent(),z;if(x.length===1){h=x;r.cycle=false}else{z=f.matchInPanel(y);if(z.length){y="#"+z.attr("id");h=f.matchTab(y).parent()}else{h=f.tabs.parent().find(r.defaultTab);if(h.length===0){a.error("The specified default tab ('"+r.defaultTab+"') could not be found in the tab set.")}}}l=h.children("a").first();p(x)};var p=function(z){var y,x;if(r.collapsible&&z.length===0&&r.collapsedByDefault){h.addClass(r.collapsedClass).children().addClass(r.collapsedClass)}else{y=a(h.data("easytabs").panel);x=h.data("easytabs").ajax;if(x&&(!r.cache||!h.data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[l,y]);y.load(x,function(B,A,C){h.data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[l,y,B,A,C])})}h.data("easytabs").panel.show().addClass(r.panelActiveClass);h.addClass(r.tabActiveClass).children().addClass(r.tabActiveClass)}};var w=function(){f.tabs.children("a").bind("click.easytabs",function(x){r.cycle=false;d=false;f.selectTab(a(this));x.preventDefault()})};var o=function(z,D,E,H){f.panels.stop(true,true);if(u(q,"easytabs:before",[z,D,r])){var A=f.panels.filter(":visible"),y=D.parent(),F,x,C,G,B=window.location.hash.match(/^[^\?]*/)[0];if(r.animate){F=s(D);x=A.length?k(A):0;C=F-x}m=B;G=function(){q.trigger("easytabs:midTransition",[z,D,r]);if(r.animate&&r.transitionIn=="fadeIn"){if(C<0){y.animate({height:y.height()+C},v.halfSpeed).css({"min-height":""})}}if(r.updateHash&&!d){window.location.hash="#"+D.attr("id")}else{d=false}D[v.show](v.speed,r.transitionInEasing,function(){y.css({height:"","min-height":""});q.trigger("easytabs:after",[z,D,r]);if(typeof H=="function"){H()}})};if(E&&(!r.cache||!z.parent().data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[z,D]);D.load(E,function(J,I,K){z.parent().data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[z,D,J,I,K])})}if(r.animate&&r.transitionOut=="fadeOut"){if(C>0){y.animate({height:(y.height()+C)},v.halfSpeed)}else{y.css({"min-height":y.height()})}}f.tabs.filter("."+r.tabActiveClass).removeClass(r.tabActiveClass).children().removeClass(r.tabActiveClass);f.tabs.filter("."+r.collapsedClass).removeClass(r.collapsedClass).children().removeClass(r.collapsedClass);z.parent().addClass(r.tabActiveClass).children().addClass(r.tabActiveClass);f.panels.filter("."+r.panelActiveClass).removeClass(r.panelActiveClass);D.addClass(r.panelActiveClass);if(A.length){A[v.hide](v.speed,r.transitionOutEasing,G)}else{D[v.uncollapse](v.speed,r.transitionUncollapseEasing,G)}}};var s=function(y){if(y.data("easytabs")&&y.data("easytabs").lastHeight){return y.data("easytabs").lastHeight}var z=y.css("display"),x=y.wrap(a("<div>",{position:"absolute",visibility:"hidden",overflow:"hidden"})).css({position:"relative",visibility:"hidden",display:"block"}).outerHeight();y.unwrap();y.css({position:y.data("easytabs").position,visibility:y.data("easytabs").visibility,display:z});y.data("easytabs").lastHeight=x;return x};var k=function(y){var x=y.outerHeight();if(y.data("easytabs")){y.data("easytabs").lastHeight=x}else{y.data("easytabs",{lastHeight:x})}return x};var n=function(){if(typeof a(window).hashchange==="function"){a(window).hashchange(function(){f.selectTabFromHashChange()})}else{if(a.address&&typeof a.address.change==="function"){a.address.change(function(){f.selectTabFromHashChange()})}}};var c=function(){var x;if(r.cycle){x=f.tabs.index(h);setTimeout(function(){f.cycleTabs(x+1)},r.cycle)}};f.init()};a.fn.easytabs=function(c){var b=arguments;return this.each(function(){var e=a(this),d=e.data("easytabs");if(undefined===d){d=new a.easytabs(this,c);e.data("easytabs",d)}if(d.publicMethods[c]){return d.publicMethods[c](Array.prototype.slice.call(b,1))}})}})(jQuery);
13
-
14
-
1
+ /*
2
+ * jQuery EasyTabs plugin 3.1.1
3
+ *
4
+ * Copyright (c) 2010-2011 Steve Schwartz (JangoSteve)
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ *
10
+ * Date: Tue Jan 26 16:30:00 2012 -0500
11
+ */
12
+ (function(a){a.easytabs=function(j,e){var f=this,q=a(j),i={animate:true,panelActiveClass:"active",tabActiveClass:"active",defaultTab:"li:first-child",animationSpeed:"normal",tabs:"> ul > li",updateHash:true,cycle:false,collapsible:false,collapsedClass:"collapsed",collapsedByDefault:true,uiTabs:false,transitionIn:"fadeIn",transitionOut:"fadeOut",transitionInEasing:"swing",transitionOutEasing:"swing",transitionCollapse:"slideUp",transitionUncollapse:"slideDown",transitionCollapseEasing:"swing",transitionUncollapseEasing:"swing",containerClass:"",tabsClass:"",tabClass:"",panelClass:"",cache:true,panelContext:q},h,l,v,m,d,t={fast:200,normal:400,slow:600},r;f.init=function(){f.settings=r=a.extend({},i,e);if(r.uiTabs){r.tabActiveClass="ui-tabs-selected";r.containerClass="ui-tabs ui-widget ui-widget-content ui-corner-all";r.tabsClass="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all";r.tabClass="ui-state-default ui-corner-top";r.panelClass="ui-tabs-panel ui-widget-content ui-corner-bottom"}if(r.collapsible&&e.defaultTab!==undefined&&e.collpasedByDefault===undefined){r.collapsedByDefault=false}if(typeof(r.animationSpeed)==="string"){r.animationSpeed=t[r.animationSpeed]}a("a.anchor").remove().prependTo("body");q.data("easytabs",{});f.setTransitions();f.getTabs();b();g();w();n();c();q.attr("data-easytabs",true)};f.setTransitions=function(){v=(r.animate)?{show:r.transitionIn,hide:r.transitionOut,speed:r.animationSpeed,collapse:r.transitionCollapse,uncollapse:r.transitionUncollapse,halfSpeed:r.animationSpeed/2}:{show:"show",hide:"hide",speed:0,collapse:"hide",uncollapse:"show",halfSpeed:0}};f.getTabs=function(){var x;f.tabs=q.find(r.tabs),f.panels=a(),f.tabs.each(function(){var A=a(this),z=A.children("a"),y=A.children("a").data("target");A.data("easytabs",{});if(y!==undefined&&y!==null){A.data("easytabs").ajax=z.attr("href")}else{y=z.attr("href")}y=y.match(/#([^\?]+)/)[0].substr(1);x=r.panelContext.find("#"+y);if(x.length){x.data("easytabs",{position:x.css("position"),visibility:x.css("visibility")});x.not(r.panelActiveClass).hide();f.panels=f.panels.add(x);A.data("easytabs").panel=x}else{f.tabs=f.tabs.not(A)}})};f.selectTab=function(x,C){var y=window.location,B=y.hash.match(/^[^\?]*/)[0],z=x.parent().data("easytabs").panel,A=x.parent().data("easytabs").ajax;if(r.collapsible&&!d&&(x.hasClass(r.tabActiveClass)||x.hasClass(r.collapsedClass))){f.toggleTabCollapse(x,z,A,C)}else{if(!x.hasClass(r.tabActiveClass)||!z.hasClass(r.panelActiveClass)){o(x,z,A,C)}else{if(!r.cache){o(x,z,A,C)}}}};f.toggleTabCollapse=function(x,y,z,A){f.panels.stop(true,true);if(u(q,"easytabs:before",[x,y,r])){f.tabs.filter("."+r.tabActiveClass).removeClass(r.tabActiveClass).children().removeClass(r.tabActiveClass);if(x.hasClass(r.collapsedClass)){if(z&&(!r.cache||!x.parent().data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[x,y]);y.load(z,function(C,B,D){x.parent().data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[x,y,C,B,D])})}x.parent().removeClass(r.collapsedClass).addClass(r.tabActiveClass).children().removeClass(r.collapsedClass).addClass(r.tabActiveClass);y.addClass(r.panelActiveClass)[v.uncollapse](v.speed,r.transitionUncollapseEasing,function(){q.trigger("easytabs:midTransition",[x,y,r]);if(typeof A=="function"){A()}})}else{x.addClass(r.collapsedClass).parent().addClass(r.collapsedClass);y.removeClass(r.panelActiveClass)[v.collapse](v.speed,r.transitionCollapseEasing,function(){q.trigger("easytabs:midTransition",[x,y,r]);if(typeof A=="function"){A()}})}}};f.matchTab=function(x){return f.tabs.find("[href='"+x+"'],[data-target='"+x+"']").first()};f.matchInPanel=function(x){return(x?f.panels.filter(":has("+x+")").first():[])};f.selectTabFromHashChange=function(){var y=window.location.hash.match(/^[^\?]*/)[0],x=f.matchTab(y),z;if(r.updateHash){if(x.length){d=true;f.selectTab(x)}else{z=f.matchInPanel(y);if(z.length){y="#"+z.attr("id");x=f.matchTab(y);d=true;f.selectTab(x)}else{if(!h.hasClass(r.tabActiveClass)&&!r.cycle){if(y===""||f.matchTab(m).length||q.closest(y).length){d=true;f.selectTab(l)}}}}}};f.cycleTabs=function(x){if(r.cycle){x=x%f.tabs.length;$tab=a(f.tabs[x]).children("a").first();d=true;f.selectTab($tab,function(){setTimeout(function(){f.cycleTabs(x+1)},r.cycle)})}};f.publicMethods={select:function(x){var y;if((y=f.tabs.filter(x)).length===0){if((y=f.tabs.find("a[href='"+x+"']")).length===0){if((y=f.tabs.find("a"+x)).length===0){if((y=f.tabs.find("[data-target='"+x+"']")).length===0){if((y=f.tabs.find("a[href$='"+x+"']")).length===0){a.error("Tab '"+x+"' does not exist in tab set")}}}}}else{y=y.children("a").first()}f.selectTab(y)}};var u=function(A,x,z){var y=a.Event(x);A.trigger(y,z);return y.result!==false};var b=function(){q.addClass(r.containerClass);f.tabs.parent().addClass(r.tabsClass);f.tabs.addClass(r.tabClass);f.panels.addClass(r.panelClass)};var g=function(){var y=window.location.hash.match(/^[^\?]*/)[0],x=f.matchTab(y).parent(),z;if(x.length===1){h=x;r.cycle=false}else{z=f.matchInPanel(y);if(z.length){y="#"+z.attr("id");h=f.matchTab(y).parent()}else{h=f.tabs.parent().find(r.defaultTab);if(h.length===0){a.error("The specified default tab ('"+r.defaultTab+"') could not be found in the tab set.")}}}l=h.children("a").first();p(x)};var p=function(z){var y,x;if(r.collapsible&&z.length===0&&r.collapsedByDefault){h.addClass(r.collapsedClass).children().addClass(r.collapsedClass)}else{y=a(h.data("easytabs").panel);x=h.data("easytabs").ajax;if(x&&(!r.cache||!h.data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[l,y]);y.load(x,function(B,A,C){h.data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[l,y,B,A,C])})}h.data("easytabs").panel.show().addClass(r.panelActiveClass);h.addClass(r.tabActiveClass).children().addClass(r.tabActiveClass)}};var w=function(){f.tabs.children("a").bind("click.easytabs",function(x){r.cycle=false;d=false;f.selectTab(a(this));x.preventDefault()})};var o=function(z,D,E,H){f.panels.stop(true,true);if(u(q,"easytabs:before",[z,D,r])){var A=f.panels.filter(":visible"),y=D.parent(),F,x,C,G,B=window.location.hash.match(/^[^\?]*/)[0];if(r.animate){F=s(D);x=A.length?k(A):0;C=F-x}m=B;G=function(){q.trigger("easytabs:midTransition",[z,D,r]);if(r.animate&&r.transitionIn=="fadeIn"){if(C<0){y.animate({height:y.height()+C},v.halfSpeed).css({"min-height":""})}}if(r.updateHash&&!d){window.location.hash="#"+D.attr("id")}else{d=false}D[v.show](v.speed,r.transitionInEasing,function(){y.css({height:"","min-height":""});q.trigger("easytabs:after",[z,D,r]);if(typeof H=="function"){H()}})};if(E&&(!r.cache||!z.parent().data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[z,D]);D.load(E,function(J,I,K){z.parent().data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[z,D,J,I,K])})}if(r.animate&&r.transitionOut=="fadeOut"){if(C>0){y.animate({height:(y.height()+C)},v.halfSpeed)}else{y.css({"min-height":y.height()})}}f.tabs.filter("."+r.tabActiveClass).removeClass(r.tabActiveClass).children().removeClass(r.tabActiveClass);f.tabs.filter("."+r.collapsedClass).removeClass(r.collapsedClass).children().removeClass(r.collapsedClass);z.parent().addClass(r.tabActiveClass).children().addClass(r.tabActiveClass);f.panels.filter("."+r.panelActiveClass).removeClass(r.panelActiveClass);D.addClass(r.panelActiveClass);if(A.length){A[v.hide](v.speed,r.transitionOutEasing,G)}else{D[v.uncollapse](v.speed,r.transitionUncollapseEasing,G)}}};var s=function(y){if(y.data("easytabs")&&y.data("easytabs").lastHeight){return y.data("easytabs").lastHeight}var z=y.css("display"),x=y.wrap(a("<div>",{position:"absolute",visibility:"hidden",overflow:"hidden"})).css({position:"relative",visibility:"hidden",display:"block"}).outerHeight();y.unwrap();y.css({position:y.data("easytabs").position,visibility:y.data("easytabs").visibility,display:z});y.data("easytabs").lastHeight=x;return x};var k=function(y){var x=y.outerHeight();if(y.data("easytabs")){y.data("easytabs").lastHeight=x}else{y.data("easytabs",{lastHeight:x})}return x};var n=function(){if(typeof a(window).hashchange==="function"){a(window).hashchange(function(){f.selectTabFromHashChange()})}else{if(a.address&&typeof a.address.change==="function"){a.address.change(function(){f.selectTabFromHashChange()})}}};var c=function(){var x;if(r.cycle){x=f.tabs.index(h);setTimeout(function(){f.cycleTabs(x+1)},r.cycle)}};f.init()};a.fn.easytabs=function(c){var b=arguments;return this.each(function(){var e=a(this),d=e.data("easytabs");if(undefined===d){d=new a.easytabs(this,c);e.data("easytabs",d)}if(d.publicMethods[c]){return d.publicMethods[c](Array.prototype.slice.call(b,1))}})}})(jQuery);
 
 
admin/js/jquery.hashchange.min.js CHANGED
@@ -1,11 +1,9 @@
1
- /*
2
- * jQuery hashchange event - v1.3 - 7/21/2010
3
- * http://benalman.com/projects/jquery-hashchange-plugin/
4
- *
5
- * Copyright (c) 2010 "Cowboy" Ben Alman
6
- * Dual licensed under the MIT and GPL licenses.
7
- * http://benalman.com/about/license/
8
- */
9
-
10
-
11
  (function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);
1
+ /*
2
+ * jQuery hashchange event - v1.3 - 7/21/2010
3
+ * http://benalman.com/projects/jquery-hashchange-plugin/
4
+ *
5
+ * Copyright (c) 2010 "Cowboy" Ben Alman
6
+ * Dual licensed under the MIT and GPL licenses.
7
+ * http://benalman.com/about/license/
8
+ */
 
 
9
  (function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);
css/jquery.rating.css CHANGED
@@ -1,18 +1,18 @@
1
- /* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
2
- div.rating-cancel,div.star-rating{float:left;width:17px;height:17px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
3
- div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}
4
- div.star-rating,div.star-rating a{background:url(star.png) no-repeat 0 0px}
5
- div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 -38px;border:0}
6
- div.star-rating-on a{background-position:0 0px!important}
7
- div.star-rating-hover a{background-position:0 -18px}
8
- div.rating-cancel a:hover{background-position:0 -16px}
9
- /* Read Only CSS */
10
- div.star-rating-readonly a{cursor:default !important}
11
- /* Partial Star CSS */
12
- div.star-rating{background:transparent!important;overflow:hidden!important}
13
- /* END jQuery.Rating Plugin CSS */
14
- #tabs {
15
- width:60%;
16
- float:left;
17
- margin-right:10px;
18
- }
1
+ /* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
2
+ div.rating-cancel,div.star-rating{float:left;width:17px;height:17px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
3
+ div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}
4
+ div.star-rating,div.star-rating a{background:url(star.png) no-repeat 0 0px}
5
+ div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 -38px;border:0}
6
+ div.star-rating-on a{background-position:0 0px!important}
7
+ div.star-rating-hover a{background-position:0 -18px}
8
+ div.rating-cancel a:hover{background-position:0 -16px}
9
+ /* Read Only CSS */
10
+ div.star-rating-readonly a{cursor:default !important}
11
+ /* Partial Star CSS */
12
+ div.star-rating{background:transparent!important;overflow:hidden!important}
13
+ /* END jQuery.Rating Plugin CSS */
14
+ #tabs {
15
+ width:60%;
16
+ float:left;
17
+ margin-right:10px;
18
+ }
css/rating.css CHANGED
@@ -1,14 +1,14 @@
1
- /* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
2
- div.rating-cancel,div.star-rating{float:left;width:17px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
3
- div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}
4
- div.star-rating,div.star-rating a{background:url(star.png) no-repeat 0 0px}
5
- div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0}
6
- div.star-rating-on a{background-position:0 -16px!important}
7
- div.star-rating-hover a{background-position:0 -32px}
8
- /* Read Only CSS */
9
- div.star-rating-readonly a{cursor:default !important}
10
- /* Partial Star CSS */
11
- div.star-rating{background:transparent!important;overflow:hidden!important}
12
- div.star-block{float: left; width: 100%; margin-bottom: 15px}
13
- p#star-block{float: left; width: 100%; margin-bottom: 10px}
14
  /* END jQuery.Rating Plugin CSS */
1
+ /* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
2
+ div.rating-cancel,div.star-rating{float:left;width:17px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
3
+ div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}
4
+ div.star-rating,div.star-rating a{background:url(star.png) no-repeat 0 0px}
5
+ div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0}
6
+ div.star-rating-on a{background-position:0 -16px!important}
7
+ div.star-rating-hover a{background-position:0 -32px}
8
+ /* Read Only CSS */
9
+ div.star-rating-readonly a{cursor:default !important}
10
+ /* Partial Star CSS */
11
+ div.star-rating{background:transparent!important;overflow:hidden!important}
12
+ div.star-block{float: left; width: 100%; margin-bottom: 15px}
13
+ p#star-block{float: left; width: 100%; margin-bottom: 10px}
14
  /* END jQuery.Rating Plugin CSS */
css/style.css CHANGED
@@ -1,188 +1,188 @@
1
- @charset "utf-8";
2
- /* CSS Document For Styling the Rich Snippets Data*/
3
- table #tbl-rich-snippet {
4
- width:100%;
5
- }
6
- tr .tbl-bsf-tr{
7
- border:1px dotted #ddd;
8
- }
9
- td .tbl-bdf-td{
10
- padding:5px;
11
- }
12
- .tbl-img{
13
- width:170px;
14
- }
15
- .tbl-addrs-tr{
16
- border:0px;
17
- }
18
- .rating-value {
19
- display:none;
20
- }
21
- .rating-count {
22
- font-weight:bold;
23
- }
24
- #snippet-box {
25
- background: #F0F0F0;
26
- background: linear-gradient(top, #FFF 50%, #E7E7E7 100%);
27
- background: -o-linear-gradient(top, #FFF 50%, #E7E7E7 100%);
28
- background: -moz-linear-gradient(top, #FFF 50%, #E7E7E7 100%);
29
- background: -webkit-linear-gradient(top, #FFF 50%, #E7E7E7 100%);
30
- background: -ms-linear-gradient(top, #FFF 50%, #E7E7E7 100%);
31
- border: 1px solid #ACACAC;
32
- font-family:inherit;
33
- font-size: 13px;
34
- padding: 0;
35
- margin: 0 0 15px 0;
36
- float: left;
37
- width: 600px;
38
- clear: both;
39
- }
40
- .snippet-markup {
41
- float: left;
42
- clear: both;
43
- width: 100%;
44
- }
45
- .snippet-title {
46
- font-family:inherit;
47
- font-size: 14px;
48
- font-weight: bold;
49
- background: #D5D2CA;
50
- background: linear-gradient(top, #D5D2CA 80%, #EBEAE8 100%);
51
- background: -o-linear-gradient(top, #D5D2CA 80%, #EBEAE8 100%);
52
- background: -moz-linear-gradient(top, #D5D2CA 80%, #EBEAE8 100%);
53
- background: -webkit-linear-gradient(top, #D5D2CA 0%, #EBEAE8 100%);
54
- background: -ms-linear-gradient(top, #D5D2CA 80%, #EBEAE8 100%);
55
- border-bottom: 1px solid #ACACAC;
56
- clear: both;
57
- padding: 0.5em 0 0.5em 1%;
58
- width: 99%;
59
- float: left;
60
- }
61
- .snippet-label {
62
- width: 25%;
63
- float: left;
64
- clear: both;
65
- text-align: right;
66
- font-size: 13px;
67
- font-weight: bold;
68
- margin: 0 2% 0 0;
69
- padding: 0.4em 2%;
70
- }
71
- .snippet-data {
72
- width: 65%;
73
- float: left;
74
- padding: 0.4em 2%;
75
- }
76
- .snippet-data-img {
77
- width: 56%;
78
- float: left;
79
- padding: 0.4em 2%;
80
- }
81
- .snippet-image {
82
- float: left;
83
- min-height: 190px;
84
- width: 200px;
85
- }
86
- .snippet-image img {
87
- border: 2px solid #FFF;
88
- box-shadow: 0px 0px 5px #D5D2CA;
89
- -webkit-transition: all 400ms ease-in;
90
- -moz-transition: all 400ms ease-in;
91
- -o-transition: all 400ms ease-in;
92
- transition: all 400ms ease-in;
93
- margin: 10px auto;
94
- display: block;
95
- }
96
- .snippet-map {
97
- width: 100%;
98
- height: 320px;
99
- border: 1px solid #CCC;
100
- }
101
- #snippet-box iframe {
102
- width: 90%;
103
- margin: 0 auto;
104
- display: block;
105
- }
106
- .ratings {
107
- float: right;
108
- margin-right: 10px;
109
- }
110
- .star-blocks {
111
- background:#FFF;
112
- }
113
- #dragContainer {
114
- top: 65px !important;
115
- }
116
- .aio-star
117
- {
118
- float: left;
119
- clear: none;
120
- color: rgb(255, 217, 13);
121
- text-shadow: 1px 1px 1px rgb(138, 127, 64);
122
- letter-spacing: 0.2em;
123
- }
124
- .star-rating-control {
125
- margin-top: 0.3em;
126
- float: left;
127
- }
128
- .star-img img {
129
- box-shadow: none;
130
- margin: -2px 2px;
131
- border: none !important;
132
- padding: 0 !important;
133
- }
134
- .snippet-label-img {
135
- width: 37%;
136
- float: left;
137
- clear: right;
138
- text-align: right;
139
- font-size: 13px;
140
- font-weight: bold;
141
- margin: 0 1% 0 0;
142
- padding: 0.4em 1%;
143
- }
144
- .aio-info {
145
- width: 400px;
146
- float: left;
147
- }
148
- .snippet-clear { clear:both;}
149
- /*********************************************************** Media queries **********************************************/
150
- /* =Responsive Structure
151
- ----------------------------------------------- */
152
- @media (max-width: 855px)
153
- {
154
- #snippet-box {
155
- width:100%;
156
- }
157
- .snippet-title
158
- {
159
- width:96%;
160
- padding: 0.5em 0 0.5em 4%;
161
- }
162
- .snippet-image {
163
- min-height: 50px;
164
- margin: 0 0 15px 0;
165
- width: 100%;
166
- float: left;
167
- clear:both;
168
- }
169
- .aio-info
170
- {
171
- width: 100%;
172
- float:left;
173
- clear: both;
174
- }
175
- }
176
- @media (max-width: 650px)
177
- {
178
-
179
- }
180
- @media (max-width: 480px)
181
- {
182
- }
183
- @media (max-width: 450px)
184
- {
185
- }
186
- @media (max-width: 320px)
187
- {
188
  }
1
+ @charset "utf-8";
2
+ /* CSS Document For Styling the Rich Snippets Data*/
3
+ table #tbl-rich-snippet {
4
+ width:100%;
5
+ }
6
+ tr .tbl-bsf-tr{
7
+ border:1px dotted #ddd;
8
+ }
9
+ td .tbl-bdf-td{
10
+ padding:5px;
11
+ }
12
+ .tbl-img{
13
+ width:170px;
14
+ }
15
+ .tbl-addrs-tr{
16
+ border:0px;
17
+ }
18
+ .rating-value {
19
+ display:none;
20
+ }
21
+ .rating-count {
22
+ font-weight:bold;
23
+ }
24
+ #snippet-box {
25
+ background: #F0F0F0;
26
+ background: linear-gradient(top, #FFF 50%, #E7E7E7 100%);
27
+ background: -o-linear-gradient(top, #FFF 50%, #E7E7E7 100%);
28
+ background: -moz-linear-gradient(top, #FFF 50%, #E7E7E7 100%);
29
+ background: -webkit-linear-gradient(top, #FFF 50%, #E7E7E7 100%);
30
+ background: -ms-linear-gradient(top, #FFF 50%, #E7E7E7 100%);
31
+ border: 1px solid #ACACAC;
32
+ font-family:inherit;
33
+ font-size: 13px;
34
+ padding: 0;
35
+ margin: 0 0 15px 0;
36
+ float: left;
37
+ width: 600px;
38
+ clear: both;
39
+ }
40
+ .snippet-markup {
41
+ float: left;
42
+ clear: both;
43
+ width: 100%;
44
+ }
45
+ .snippet-title {
46
+ font-family:inherit;
47
+ font-size: 14px;
48
+ font-weight: bold;
49
+ background: #D5D2CA;
50
+ background: linear-gradient(top, #D5D2CA 80%, #EBEAE8 100%);
51
+ background: -o-linear-gradient(top, #D5D2CA 80%, #EBEAE8 100%);
52
+ background: -moz-linear-gradient(top, #D5D2CA 80%, #EBEAE8 100%);
53
+ background: -webkit-linear-gradient(top, #D5D2CA 0%, #EBEAE8 100%);
54
+ background: -ms-linear-gradient(top, #D5D2CA 80%, #EBEAE8 100%);
55
+ border-bottom: 1px solid #ACACAC;
56
+ clear: both;
57
+ padding: 0.5em 0 0.5em 1%;
58
+ width: 99%;
59
+ float: left;
60
+ }
61
+ .snippet-label {
62
+ width: 25%;
63
+ float: left;
64
+ clear: both;
65
+ text-align: right;
66
+ font-size: 13px;
67
+ font-weight: bold;
68
+ margin: 0 2% 0 0;
69
+ padding: 0.4em 2%;
70
+ }
71
+ .snippet-data {
72
+ width: 65%;
73
+ float: left;
74
+ padding: 0.4em 2%;
75
+ }
76
+ .snippet-data-img {
77
+ width: 56%;
78
+ float: left;
79
+ padding: 0.4em 2%;
80
+ }
81
+ .snippet-image {
82
+ float: left;
83
+ min-height: 190px;
84
+ width: 200px;
85
+ }
86
+ .snippet-image img {
87
+ border: 2px solid #FFF;
88
+ box-shadow: 0px 0px 5px #D5D2CA;
89
+ -webkit-transition: all 400ms ease-in;
90
+ -moz-transition: all 400ms ease-in;
91
+ -o-transition: all 400ms ease-in;
92
+ transition: all 400ms ease-in;
93
+ margin: 10px auto;
94
+ display: block;
95
+ }
96
+ .snippet-map {
97
+ width: 100%;
98
+ height: 320px;
99
+ border: 1px solid #CCC;
100
+ }
101
+ #snippet-box iframe {
102
+ width: 90%;
103
+ margin: 0 auto;
104
+ display: block;
105
+ }
106
+ .ratings {
107
+ float: right;
108
+ margin-right: 10px;
109
+ }
110
+ .star-blocks {
111
+ background:#FFF;
112
+ }
113
+ #dragContainer {
114
+ top: 65px !important;
115
+ }
116
+ .aio-star
117
+ {
118
+ float: left;
119
+ clear: none;
120
+ color: rgb(255, 217, 13);
121
+ text-shadow: 1px 1px 1px rgb(138, 127, 64);
122
+ letter-spacing: 0.2em;
123
+ }
124
+ .star-rating-control {
125
+ margin-top: 0.3em;
126
+ float: left;
127
+ }
128
+ .star-img img {
129
+ box-shadow: none;
130
+ margin: -2px 2px;
131
+ border: none !important;
132
+ padding: 0 !important;
133
+ }
134
+ .snippet-label-img {
135
+ width: 37%;
136
+ float: left;
137
+ clear: right;
138
+ text-align: right;
139
+ font-size: 13px;
140
+ font-weight: bold;
141
+ margin: 0 1% 0 0;
142
+ padding: 0.4em 1%;
143
+ }
144
+ .aio-info {
145
+ width: 400px;
146
+ float: left;
147
+ }
148
+ .snippet-clear { clear:both;}
149
+ /*********************************************************** Media queries **********************************************/
150
+ /* =Responsive Structure
151
+ ----------------------------------------------- */
152
+ @media (max-width: 855px)
153
+ {
154
+ #snippet-box {
155
+ width:100%;
156
+ }
157
+ .snippet-title
158
+ {
159
+ width:96%;
160
+ padding: 0.5em 0 0.5em 4%;
161
+ }
162
+ .snippet-image {
163
+ min-height: 50px;
164
+ margin: 0 0 15px 0;
165
+ width: 100%;
166
+ float: left;
167
+ clear:both;
168
+ }
169
+ .aio-info
170
+ {
171
+ width: 100%;
172
+ float:left;
173
+ clear: both;
174
+ }
175
+ }
176
+ @media (max-width: 650px)
177
+ {
178
+
179
+ }
180
+ @media (max-width: 480px)
181
+ {
182
+ }
183
+ @media (max-width: 450px)
184
+ {
185
+ }
186
+ @media (max-width: 320px)
187
+ {
188
  }
index.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.brainstormforce.com
5
  Author: Brainstorm Force
6
  Author URI: http://www.brainstormforce.com
7
  Description: The All in One Rich Snippets gives the power to the blog author to control the rich snippets to be shown in the search results by the search engines.
8
- Version: 1.1.6
9
  Text Domain: rich-snippets
10
  License: GPL2
11
  */
@@ -49,7 +49,26 @@ if ( !class_exists( "RichSnippets" ) )
49
  add_action( 'wp_ajax_bsf_submit_request', array( $this, 'submit_request') );
50
 
51
  add_action( 'wp_ajax_bsf_submit_color', array( $this, 'submit_color') );
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  function frontend_style() {
54
  wp_register_style( 'bsf_style', plugins_url('/css/style.css', __FILE__) );
55
  wp_enqueue_style('bsf_style');
5
  Author: Brainstorm Force
6
  Author URI: http://www.brainstormforce.com
7
  Description: The All in One Rich Snippets gives the power to the blog author to control the rich snippets to be shown in the search results by the search engines.
8
+ Version: 1.1.7
9
  Text Domain: rich-snippets
10
  License: GPL2
11
  */
49
  add_action( 'wp_ajax_bsf_submit_request', array( $this, 'submit_request') );
50
 
51
  add_action( 'wp_ajax_bsf_submit_color', array( $this, 'submit_color') );
52
+ // Admin bar menu
53
+ add_action( 'admin_bar_menu', array( $this, "aiosrs_admin_bar" ),100 );
54
+ }
55
+ // admin bar menu
56
+ function aiosrs_admin_bar()
57
+ {
58
+ global $wp_admin_bar;
59
+ $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
60
+ if ( ! is_super_admin() || ! is_admin_bar_showing() )
61
+ return;
62
+ if(!is_admin())
63
+ {
64
+ $wp_admin_bar->add_menu( array(
65
+ 'id' => 'aiosrs',
66
+ 'title' => 'Test Rich Snippets',
67
+ 'href' => 'http://www.google.com/webmasters/tools/richsnippets?q='.$actual_link,
68
+ 'meta' => array('target' => '_blank'),
69
+ ) );
70
+ }
71
+ }
72
  function frontend_style() {
73
  wp_register_style( 'bsf_style', plugins_url('/css/style.css', __FILE__) );
74
  wp_enqueue_style('bsf_style');
js/cp-script.min.js CHANGED
@@ -1,144 +1,141 @@
1
- var $mbas12 = jQuery.noConflict();
2
- // Snippet Box BG Color
3
- (function ($mbas12) {
4
- "use strict";
5
- function pickColor(color) {
6
- $mbas12(".snippet_box_bg").val(color);
7
- }
8
- function toggle_text() {
9
- var BoxBG = $mbas12(".snippet_box_bg");
10
- if ("" === BoxBG.val().replace("#", "")) {
11
- BoxBG.val(default_color);
12
- pickColor(default_color);
13
- } else pickColor(BoxBG.val());
14
- }
15
- var default_color = "F5F5F5";
16
- $mbas12(document).ready(function () {
17
- var BoxBG = $mbas12(".snippet_box_bg");
18
- BoxBG.wpColorPicker({
19
- change: function (event, ui) {
20
- pickColor(BoxBG.wpColorPicker("color"));
21
- },
22
- clear: function () {
23
- pickColor("");
24
- }
25
- });
26
- $mbas12(".snippet_box_bg").click(toggle_text);
27
- toggle_text();
28
- });
29
- })($mbas12);
30
-
31
- // Snippet Title BG color
32
- (function ($mbas12) {
33
- "use strict";
34
- function pickColor(color) {
35
- $mbas12(".snippet_title_bg").val(color);
36
- }
37
- function toggle_text() {
38
- var TitleBG = $mbas12(".snippet_title_bg");
39
- if ("" === TitleBG.val().replace("#", "")) {
40
- TitleBG.val(default_color);
41
- pickColor(default_color);
42
- } else pickColor(TitleBG.val());
43
- }
44
- var default_color = "E4E4E4";
45
- $mbas12(document).ready(function () {
46
- var TitleBG = $mbas12(".snippet_title_bg");
47
- TitleBG.wpColorPicker({
48
- change: function (event, ui) {
49
- pickColor(TitleBG.wpColorPicker("color"));
50
- },
51
- clear: function () {
52
- pickColor("");
53
- }
54
- });
55
- $mbas12(".snippet_title_bg").click(toggle_text);
56
- toggle_text();
57
- });
58
- })($mbas12);
59
-
60
- // Snippet Border color
61
- (function ($mbas12) {
62
- "use strict";
63
- function pickColor(color) {
64
- $mbas12(".snippet_border").val(color);
65
- }
66
- function toggle_text() {
67
- var SnippetBorder = $mbas12(".snippet_border");
68
- if ("" === SnippetBorder.val().replace("#", "")) {
69
- SnippetBorder.val(default_color);
70
- pickColor(default_color);
71
- } else pickColor(SnippetBorder.val());
72
- }
73
- var default_color = "ACACAC";
74
- $mbas12(document).ready(function () {
75
- var SnippetBorder = $mbas12(".snippet_border");
76
- SnippetBorder.wpColorPicker({
77
- change: function (event, ui) {
78
- pickColor(SnippetBorder.wpColorPicker("color"));
79
- },
80
- clear: function () {
81
- pickColor("");
82
- }
83
- });
84
- $mbas12(".snippet_border").click(toggle_text);
85
- toggle_text();
86
- });
87
- })($mbas12);
88
- // Snippet title color
89
- (function ($mbas12) {
90
- "use strict";
91
- function pickColor(color) {
92
- $mbas12(".snippet_title_color").val(color);
93
- }
94
- function toggle_text() {
95
- var TitleColor = $mbas12(".snippet_title_color");
96
- if ("" === TitleColor.val().replace("#", "")) {
97
- TitleColor.val(default_color);
98
- pickColor(default_color);
99
- } else pickColor(TitleColor.val());
100
- }
101
- var default_color = "333333";
102
- $mbas12(document).ready(function () {
103
- var TitleColor = $mbas12(".snippet_title_color");
104
- TitleColor.wpColorPicker({
105
- change: function (event, ui) {
106
- pickColor(TitleColor.wpColorPicker("color"));
107
- },
108
- clear: function () {
109
- pickColor("");
110
- }
111
- });
112
- $mbas12(".snippet_title_color").click(toggle_text);
113
- toggle_text();
114
- });
115
- })($mbas12);
116
-
117
- // Snippet text color
118
- (function ($mbas12) {
119
- "use strict";
120
- function pickColor(color) {
121
- $mbas12(".snippet_box_color").val(color);
122
- }
123
- function toggle_text() {
124
- var BoxColor = $mbas12(".snippet_box_color");
125
- if ("" === BoxColor.val().replace("#", "")) {
126
- BoxColor.val(default_color);
127
- pickColor(default_color);
128
- } else pickColor(BoxColor.val());
129
- }
130
- var default_color = "333333";
131
- $mbas12(document).ready(function () {
132
- var BoxColor = $mbas12(".snippet_box_color");
133
- BoxColor.wpColorPicker({
134
- change: function (event, ui) {
135
- pickColor(BoxColor.wpColorPicker("color"));
136
- },
137
- clear: function () {
138
- pickColor("");
139
- }
140
- });
141
- $mbas12(".snippet_box_color").click(toggle_text);
142
- toggle_text();
143
- });
144
  })($mbas12);
1
+ var $mbas12 = jQuery.noConflict();
2
+ // Snippet Box BG Color
3
+ (function ($mbas12) {
4
+ "use strict";
5
+ function pickColor(color) {
6
+ $mbas12(".snippet_box_bg").val(color);
7
+ }
8
+ function toggle_text() {
9
+ var BoxBG = $mbas12(".snippet_box_bg");
10
+ if ("" === BoxBG.val().replace("#", "")) {
11
+ BoxBG.val(default_color);
12
+ pickColor(default_color);
13
+ } else pickColor(BoxBG.val());
14
+ }
15
+ var default_color = "F5F5F5";
16
+ $mbas12(document).ready(function () {
17
+ var BoxBG = $mbas12(".snippet_box_bg");
18
+ BoxBG.wpColorPicker({
19
+ change: function (event, ui) {
20
+ pickColor(BoxBG.wpColorPicker("color"));
21
+ },
22
+ clear: function () {
23
+ pickColor("");
24
+ }
25
+ });
26
+ $mbas12(".snippet_box_bg").click(toggle_text);
27
+ toggle_text();
28
+ });
29
+ })($mbas12);
30
+ // Snippet Title BG color
31
+ (function ($mbas12) {
32
+ "use strict";
33
+ function pickColor(color) {
34
+ $mbas12(".snippet_title_bg").val(color);
35
+ }
36
+ function toggle_text() {
37
+ var TitleBG = $mbas12(".snippet_title_bg");
38
+ if ("" === TitleBG.val().replace("#", "")) {
39
+ TitleBG.val(default_color);
40
+ pickColor(default_color);
41
+ } else pickColor(TitleBG.val());
42
+ }
43
+ var default_color = "E4E4E4";
44
+ $mbas12(document).ready(function () {
45
+ var TitleBG = $mbas12(".snippet_title_bg");
46
+ TitleBG.wpColorPicker({
47
+ change: function (event, ui) {
48
+ pickColor(TitleBG.wpColorPicker("color"));
49
+ },
50
+ clear: function () {
51
+ pickColor("");
52
+ }
53
+ });
54
+ $mbas12(".snippet_title_bg").click(toggle_text);
55
+ toggle_text();
56
+ });
57
+ })($mbas12);
58
+ // Snippet Border color
59
+ (function ($mbas12) {
60
+ "use strict";
61
+ function pickColor(color) {
62
+ $mbas12(".snippet_border").val(color);
63
+ }
64
+ function toggle_text() {
65
+ var SnippetBorder = $mbas12(".snippet_border");
66
+ if ("" === SnippetBorder.val().replace("#", "")) {
67
+ SnippetBorder.val(default_color);
68
+ pickColor(default_color);
69
+ } else pickColor(SnippetBorder.val());
70
+ }
71
+ var default_color = "ACACAC";
72
+ $mbas12(document).ready(function () {
73
+ var SnippetBorder = $mbas12(".snippet_border");
74
+ SnippetBorder.wpColorPicker({
75
+ change: function (event, ui) {
76
+ pickColor(SnippetBorder.wpColorPicker("color"));
77
+ },
78
+ clear: function () {
79
+ pickColor("");
80
+ }
81
+ });
82
+ $mbas12(".snippet_border").click(toggle_text);
83
+ toggle_text();
84
+ });
85
+ })($mbas12);
86
+ // Snippet title color
87
+ (function ($mbas12) {
88
+ "use strict";
89
+ function pickColor(color) {
90
+ $mbas12(".snippet_title_color").val(color);
91
+ }
92
+ function toggle_text() {
93
+ var TitleColor = $mbas12(".snippet_title_color");
94
+ if ("" === TitleColor.val().replace("#", "")) {
95
+ TitleColor.val(default_color);
96
+ pickColor(default_color);
97
+ } else pickColor(TitleColor.val());
98
+ }
99
+ var default_color = "333333";
100
+ $mbas12(document).ready(function () {
101
+ var TitleColor = $mbas12(".snippet_title_color");
102
+ TitleColor.wpColorPicker({
103
+ change: function (event, ui) {
104
+ pickColor(TitleColor.wpColorPicker("color"));
105
+ },
106
+ clear: function () {
107
+ pickColor("");
108
+ }
109
+ });
110
+ $mbas12(".snippet_title_color").click(toggle_text);
111
+ toggle_text();
112
+ });
113
+ })($mbas12);
114
+ // Snippet text color
115
+ (function ($mbas12) {
116
+ "use strict";
117
+ function pickColor(color) {
118
+ $mbas12(".snippet_box_color").val(color);
119
+ }
120
+ function toggle_text() {
121
+ var BoxColor = $mbas12(".snippet_box_color");
122
+ if ("" === BoxColor.val().replace("#", "")) {
123
+ BoxColor.val(default_color);
124
+ pickColor(default_color);
125
+ } else pickColor(BoxColor.val());
126
+ }
127
+ var default_color = "333333";
128
+ $mbas12(document).ready(function () {
129
+ var BoxColor = $mbas12(".snippet_box_color");
130
+ BoxColor.wpColorPicker({
131
+ change: function (event, ui) {
132
+ pickColor(BoxColor.wpColorPicker("color"));
133
+ },
134
+ clear: function () {
135
+ pickColor("");
136
+ }
137
+ });
138
+ $mbas12(".snippet_box_color").click(toggle_text);
139
+ toggle_text();
140
+ });
 
 
 
141
  })($mbas12);
js/jquery-ui.js CHANGED
@@ -1,7 +1,6 @@
1
- /*! jQuery UI - v1.10.2 - 2013-03-15
2
- * http://jqueryui.com
3
- * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js
4
- * Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
5
-
6
- (function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=!1;return t[s]>0?!0:(t[s]=1,a=t[s]>0,t[s]=0,a)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,m,g,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),x=(e.collision||"flip").split(" "),k={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,m=_.height,g=_.offset,v=t.extend({},g),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=l.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=l.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),k[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=m:"center"===e.at[1]&&(v.top+=m/2),a=i(k.at,p,m),v.left+=a[0],v.top+=a[1],this.each(function(){var n,l,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),D=u+f+s(this,"marginRight")+w.width,T=d+_+s(this,"marginBottom")+w.height,C=t.extend({},v),M=i(k.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?C.left-=u:"center"===e.my[0]&&(C.left-=u/2),"bottom"===e.my[1]?C.top-=d:"center"===e.my[1]&&(C.top-=d/2),C.left+=M[0],C.top+=M[1],t.support.offsetFractions||(C.left=h(C.left),C.top=h(C.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[x[i]]&&t.ui.position[x[i]][s](C,{targetWidth:p,targetHeight:m,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:D,collisionHeight:T,offset:[a[0]+M[0],a[1]+M[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(l=function(t){var i=g.left-C.left,s=i+p-u,n=g.top-C.top,a=n+m-d,h={target:{element:b,left:g.left,top:g.top,width:p,height:m},element:{element:c,left:C.left,top:C.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>m&&m>r(n+a)&&(h.vertical="middle"),h.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(C,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-o-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-o-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-o-a,t.top+p+f+m>c&&(0>s||r(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,t.top+p+f+m>u&&(i>0||u>r(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),i.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i,s=this,n=!1,a=!1;for(e.ui.ddmanager&&!this.options.dropBehaviour&&(a=e.ui.ddmanager.drop(this,t)),this.dropped&&(a=this.dropped,this.dropped=!1),i=this.element[0];i&&(i=i.parentNode);)i===document&&(n=!0);return n||"original"!==this.options.helper?("invalid"===this.options.revert&&!a||"valid"===this.options.revert&&a||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,a)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;if("parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=["document"===n.containment?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"===n.containment?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"===n.containment?0:e(window).scrollLeft())+e("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"===n.containment?0:e(window).scrollTop())+(e("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||n.containment.constructor===Array)n.containment.constructor===Array&&(this.containment=n.containment);else{if(i=e(n.containment),s=i[0],!s)return;t="hidden"!==e(s).css("overflow"),this.containment=[(parseInt(e(s).css("borderLeftWidth"),10)||0)+(parseInt(e(s).css("paddingLeft"),10)||0),(parseInt(e(s).css("borderTopWidth"),10)||0)+(parseInt(e(s).css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(e(s).css("borderRightWidth"),10)||0)-(parseInt(e(s).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(e(s).css("borderBottomWidth"),10)||0)-(parseInt(e(s).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i}},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName),l=t.pageX,u=t.pageY;return this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(u=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(u=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((u-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,u=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:u-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var s=e(this).data("ui-draggable"),n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var s=e(this).data("ui-draggable"),n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i){var s=e(this).data("ui-draggable"),n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-t.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-e(document).scrollTop()<s.scrollSensitivity?n=e(document).scrollTop(e(document).scrollTop()-s.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<s.scrollSensitivity&&(n=e(document).scrollTop(e(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-e(document).scrollLeft()<s.scrollSensitivity?n=e(document).scrollLeft(e(document).scrollLeft()-s.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<s.scrollSensitivity&&(n=e(document).scrollLeft(e(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(i,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),i=t.options;t.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=e(this),s=i.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(t,i){var s,n,a,o,r,h,l,u,c,d,p=e(this).data("ui-draggable"),f=p.options,m=f.snapTolerance,g=i.offset.left,v=g+p.helperProportions.width,y=i.offset.top,b=y+p.helperProportions.height;for(c=p.snapElements.length-1;c>=0;c--)r=p.snapElements[c].left,h=r+p.snapElements[c].width,l=p.snapElements[c].top,u=l+p.snapElements[c].height,g>r-m&&h+m>g&&y>l-m&&u+m>y||g>r-m&&h+m>g&&b>l-m&&u+m>b||v>r-m&&h+m>v&&y>l-m&&u+m>y||v>r-m&&h+m>v&&b>l-m&&u+m>b?("inner"!==f.snapMode&&(s=m>=Math.abs(l-b),n=m>=Math.abs(u-y),a=m>=Math.abs(r-v),o=m>=Math.abs(h-g),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||a||o,"outer"!==f.snapMode&&(s=m>=Math.abs(l-y),n=m>=Math.abs(u-b),a=m>=Math.abs(r-g),o=m>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=s||n||a||o||d):(p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,s=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(t=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(e){function t(e,t,i){return e>t&&t+i>e}e.widget("ui.droppable",{version:"1.10.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];i.length>t;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===s.options.scope&&t.accept.call(t.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,i,s){if(!i.offset)return!1;var n,a,o=(e.positionAbs||e.position.absolute).left,r=o+e.helperProportions.width,h=(e.positionAbs||e.position.absolute).top,l=h+e.helperProportions.height,u=i.offset.left,c=u+i.proportions.width,d=i.offset.top,p=d+i.proportions.height;switch(s){case"fit":return o>=u&&c>=r&&h>=d&&p>=l;case"intersect":return o+e.helperProportions.width/2>u&&c>r-e.helperProportions.width/2&&h+e.helperProportions.height/2>d&&p>l-e.helperProportions.height/2;case"pointer":return n=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,a=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(a,d,i.proportions.height)&&t(n,u,i.proportions.width);case"touch":return(h>=d&&p>=h||l>=d&&p>=l||d>h&&l>p)&&(o>=u&&c>=o||r>=u&&c>=r||u>o&&r>c);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions.height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions={width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight})}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===n}),a.length&&(s=e.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}})(jQuery);(function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=t(this.helper.css("left")),n=t(this.helper.css("top")),o.containment&&(s+=e(o.containment).scrollLeft()||0,n+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-a.left||0,d=t.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==u&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,n=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,n=i(e.width)&&t.maxWidth&&t.maxWidth<e.width,a=i(e.height)&&t.maxHeight&&t.maxHeight<e.height,o=i(e.width)&&t.minWidth&&t.minWidth>e.width,r=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return o&&(e.width=t.minWidth),r&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),o&&u&&(e.left=h-t.minWidth),n&&u&&(e.left=h-t.maxWidth),r&&c&&(e.top=l-t.minHeight),a&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&e.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,n){s[e]=t(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=e.ui.hasScroll(p,"left")?p.scrollWidth:o,h=e.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(t){var i,s,n,a,o=e(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,c={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-c.left),u&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=o.parentData.left),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,c=Math.round((s.height-n.height)/l)*l,d=n.width+u,p=n.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.top=a.top-c):/^(sw)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.left=a.left-u):(t.size.width=d,t.size.height=p,t.position.top=a.top-c,t.position.left=a.left-u)}})})(jQuery);(function(e){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,a.widgetName+"-item")===a?(s=t(this),!1):undefined}),t.data(e.target,a.widgetName+"-item")===a&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=t("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:e.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:e.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(e.pageY-t(document).scrollTop()<o.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-o.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<o.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+o.scrollSpeed)),e.pageX-t(document).scrollLeft()<o.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-o.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<o.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+o.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=t.left,o=a+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u=s+l>r&&h>s+l&&e+c>a&&o>e+c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?u:e+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return n?this.floating?o&&"right"===o||"down"===a?2:1:a&&("down"===a?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&s||"left"===a&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,n,a,o=[],r=[],h=this._connectWith();if(h&&e)for(i=h.length-1;i>=0;i--)for(n=t(h[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&r.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(function(){o.push(this)});return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(u.push([t.isFunction(a.options.items)?a.options.items.call(a.element[0],e,{item:this.currentItem}):t(a.options.items,a.element),a]),this.containers.push(a));for(i=u.length-1;i>=0;i--)for(o=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",o),c.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t(e.document[0].createElement(s)).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?n.append("<td colspan='99'>&#160;</td>"):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,a,o,r,h,l,c,u,d,p,f=null,m=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],m=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],a=this.items.length-1;a>=0;a--)t.contains(this.containers[m].element[0],this.items[a].item[0])&&this.items[a].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[a].top,this.items[a].height))&&(u=this.items[a].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[a][l]-c)&&(d=!0,u+=this.items[a][l]),o>Math.abs(u-c)&&(o=Math.abs(u-c),r=this.items[a],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[m].element,!0),this._trigger("change",s,this._uiHash()),this.containers[m]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,a=e.pageX,o=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)e||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),a=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(t(e.target).attr("tabIndex",-1),t(a).attr("tabIndex",0),a.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),(e.active===!1&&e.collapsible===!0||!this.headers.length)&&(e.active=!1,this.active=t()),e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,a=this.element.parent(),o=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),a=n.attr("id");s||(s=o+"-header-"+e,i.attr("id",s)),a||(a=o+"-panel-"+e,n.attr("id",a)),i.attr("aria-controls",a),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=a.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?t():n,newPanel:r};e.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-expanded":"false","aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,n){var a,o,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(n)};return"number"==typeof d&&(r=d),"string"==typeof d&&(o=d),o=o||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(a=t.show().outerHeight(),e.animate(i,{duration:r,easing:o,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(s,{duration:r,easing:o,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(a-e.outerHeight()-l),l=0)}}),undefined):e.animate(i,r,o,p):t.animate(s,r,o,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}})})(jQuery);(function(e){var t=0;e.widget("ui.autocomplete",{version:"1.10.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({input:e(),role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,i=++t;return function(s){i===t&&e.__response(s),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(t){var e,i,s,n,a="ui-button ui-widget ui-state-default ui-corner-all",o="ui-state-hover ui-state-active ",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",h=function(){var e=t(this).find(":ui-button");setTimeout(function(){e.button("refresh")},1)},l=function(e){var i=e.name,s=e.form,n=t([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.10.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,h),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var o=this,r=this.options,c="checkbox"===this.type||"radio"===this.type,u=c?"":"ui-state-active",d="ui-state-focus";null===r.label&&(r.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(a).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){r.disabled||this===e&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){r.disabled||t(this).removeClass(u)}).bind("click"+this.eventNamespace,function(t){r.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){o.buttonElement.addClass(d)}).bind("blur"+this.eventNamespace,function(){o.buttonElement.removeClass(d)}),c&&(this.element.bind("change"+this.eventNamespace,function(){n||o.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(t){r.disabled||(n=!1,i=t.pageX,s=t.pageY)}).bind("mouseup"+this.eventNamespace,function(t){r.disabled||(i!==t.pageX||s!==t.pageY)&&(n=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return r.disabled||n?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||n)return!1;t(this).addClass("ui-state-active"),o.buttonElement.attr("aria-pressed","true");var e=o.element[0];l(e).not(e).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return r.disabled?!1:(t(this).addClass("ui-state-active"),e=this,o.document.one("mouseup",function(){e=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return r.disabled?!1:(t(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(e){return r.disabled?!1:((e.keyCode===t.ui.keyCode.SPACE||e.keyCode===t.ui.keyCode.ENTER)&&t(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",r.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(a+" "+o+" "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){return this._super(t,e),"disabled"===t?(e?this.element.prop("disabled",!0):this.element.prop("disabled",!1),undefined):(this._resetButton(),undefined)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?l(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var e=this.buttonElement.removeClass(r),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}}),t.widget("ui.buttonset",{version:"1.10.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(a.inline?e.parent()[0]:a.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.2"}});var a,r="datepicker",o=(new Date).getTime();t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,a;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),a=this._newInst(t(e),n),a.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,a):n&&this._inlineDatepicker(e,a)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,r,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,a,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=t("<span class='"+this._appendClass+"'>"+r+"</span>"),e[o?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(a?t("<img/>").attr({src:a,alt:n,title:n}):n)),e[o?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,a=new Date(2009,11,20),r=this._get(t,"dateFormat");r.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},a.setMonth(e(this._get(t,r.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(e(this._get(t,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),t.input.attr("size",this._formatDate(t,a).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,a,o){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],r,p)),n(p.settings,a||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,r);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,r),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,a){var r,o,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(r=s||{},"string"==typeof s&&(r={},r[s]=a),c&&(this._curInst===c&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,r),null!==h&&r.dateFormat!==e&&r.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&r.dateFormat!==e&&r.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,o),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,a=t.datepicker._getInst(e.target),r=!0,o=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),r=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",a.dpDiv),n[0]&&t.datepicker._selectDay(e.target,a.selectedMonth,a.selectedYear,n[0]),i=t.datepicker._get(a,"onSelect"),i?(s=t.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),r=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),r=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?1:-1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),r=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?-1:1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),r=e.ctrlKey||e.metaKey;break;default:r=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):r=!1;r&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,a=t.datepicker._getInst(i.target);return t.datepicker._get(a,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(a,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,a,r,o,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),a=s?s.apply(e,[e,i]):{},a!==!1&&(n(i.settings,a),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),o={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),o=t.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),i.input.is(":visible")&&!i.input.is(":disabled")&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,a=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],r=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",r*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!==document.activeElement&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_getBorders:function(t){var e=function(t){return{thin:1,medium:2,thick:3}[t]||t};return[parseFloat(e(t.css("border-left-width"))),parseFloat(e(t.css("border-top-width")))]},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),a=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-r:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+o?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+o):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,a,o=this._curInst;!o||e&&o!==t.data(e,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){t.datepicker._tidyDialog(o)},t.effects&&(t.effects.effect[i]||t.effects[i])?o.dpDiv.hide(i,t.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(e,i,s,n){var a,r=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(a=this._getInst(r[0]),a.selectedDay=a.currentDay=t("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(e,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,a=this._get(e,"altField");a&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(a).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var a,r,o,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,m=(n?n.monthNames:null)||this._defaults.monthNames,g=-1,v=-1,_=-1,b=-1,y=!1,w=function(t){var e=i.length>a+1&&i.charAt(a+1)===t;return e&&a++,e},k=function(t){var e=w(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),a=s.substring(l).match(n);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},x=function(i,n,a){var r=-1,o=t.map(w(i)?a:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(o,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(r=i[0],l+=n.length,!1):e}),-1!==r)return r+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(a))throw"Unexpected literal at position "+l;l++};for(a=0;i.length>a;a++)if(y)"'"!==i.charAt(a)||w("'")?D():y=!1;else switch(i.charAt(a)){case"d":_=k("d");break;case"D":x("D",d,p);break;case"o":b=k("o");break;case"m":v=k("m");break;case"M":v=x("M",f,m);break;case"y":g=k("y");break;case"@":h=new Date(k("@")),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((k("!")-this._ticksTo1970)/1e4),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":w("'")?D():y=!0;break;default:D()}if(s.length>l&&(o=s.substr(l),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=g?0:-100)),b>-1)for(v=1,_=b;;){if(r=this._getDaysInMonth(g,v-1),r>=_)break;v++,_-=r}if(h=this._daylightSavingAdjust(new Date(g,v-1,_)),h.getFullYear()!==g||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,a);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),r,o);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),a=n,r=this._getFormatConfig(t);try{a=this.parseDate(i,s,r)||n}catch(o){s=e?"":s}t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),t.currentDay=s?a.getDate():0,t.currentMonth=s?a.getMonth():0,t.currentYear=s?a.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},a=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,a=n.getFullYear(),r=n.getMonth(),o=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=7*parseInt(l[1],10);break;case"m":case"M":r+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r));break;case"y":case"Y":a+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r))}l=h.exec(i)}return new Date(a,r,o)},r=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?s:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,r=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=r.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=r.getMonth(),t.drawYear=t.selectedYear=t.currentYear=r.getFullYear(),n===t.selectedMonth&&a===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+o].datepicker._adjustDate(s,-i,"M")},next:function(){window["DP_jQuery_"+o].datepicker._adjustDate(s,+i,"M")},hide:function(){window["DP_jQuery_"+o].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+o].datepicker._gotoToday(s)},selectDay:function(){return window["DP_jQuery_"+o].datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+o].datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+o].datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,a,r,o,h,l,c,u,d,p,f,m,g,v,_,b,y,w,k,x,D,T,C,S,M,N,I,P,A,z,H,E,F,O,W,j,R=new Date,L=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),J=this._get(t,"hideIfNoPrevNext"),Q=this._get(t,"navigationAsDateFormat"),K=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),U=this._get(t,"stepMonths"),q=1!==K[0]||1!==K[1],X=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),$=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),$)for(e=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=Q?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-U,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=Q?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+U,1)),this._getFormatConfig(t)):n,a=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",r=this._get(t,"currentText"),o=this._get(t,"gotoCurrent")&&t.currentDay?X:L,r=Q?this.formatDate(r,o,this._getFormatConfig(t)):r,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),m=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;K[0]>k;k++){for(x="",this.maxRows=4,D=0;K[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),C=" ui-corner-all",S="",q){if(S+="<div class='ui-datepicker-group",K[1]>1)switch(D){case 0:S+=" ui-datepicker-group-first",C=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:S+=" ui-datepicker-group-last",C=" ui-corner-"+(Y?"left":"right");break;default:S+=" ui-datepicker-group-middle",C=""}S+="'>"}for(S+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&0===k?Y?a:s:"")+(/all|right/.test(C)&&0===k?Y?s:a:"")+this._generateMonthYearHeader(t,Z,te,G,$,k>0||D>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)N=(w+c)%7,M+="<th"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[N]+"'>"+p[N]+"</span></th>";for(S+=M+"</tr></thead><tbody>",I=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,I)),P=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((P+I)/7),z=q?this.maxRows>A?this.maxRows:A:A,this.maxRows=z,H=this._daylightSavingAdjust(new Date(te,Z,1-P)),E=0;z>E;E++){for(S+="<tr>",F=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(H)+"</td>":"",w=0;7>w;w++)O=g?g.apply(t.input?t.input[0]:null,[H]):[!0,""],W=H.getMonth()!==Z,j=W&&!_||!O[0]||G&&G>H||$&&H>$,F+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(W?" ui-datepicker-other-month":"")+(H.getTime()===T.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===H.getTime()&&b.getTime()===T.getTime()?" "+this._dayOverClass:"")+(j?" "+this._unselectableClass+" ui-state-disabled":"")+(W&&!v?"":" "+O[1]+(H.getTime()===X.getTime()?" "+this._currentClass:"")+(H.getTime()===L.getTime()?" ui-datepicker-today":""))+"'"+(W&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(j?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(W&&!v?"&#xa0;":j?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===L.getTime()?" ui-state-highlight":"")+(H.getTime()===X.getTime()?" ui-state-active":"")+(W?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);S+=F+"</tr>"}Z++,Z>11&&(Z=0,te++),S+="</tbody></table>"+(q?"</div>"+(K[0]>0&&D===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=S}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,a,r,o){var h,l,c,u,d,p,f,m,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(a||!g)y+="<span class='ui-datepicker-month'>"+r[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+o[c]+"</option>");
7
  y+="</select>"}if(_||(b+=y+(!a&&g&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),m=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!a&&g&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),a=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),r=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,a)));t.selectedDay=r.getDate(),t.drawMonth=t.selectedMonth=r.getMonth(),t.drawYear=t.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),a=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(t,a)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),a=this._getMinMaxDate(t,"max"),r=null,o=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=s),i[1].match(/[+\-].*/)&&(o+=s)),(!n||e.getTime()>=n.getTime())&&(!a||e.getTime()<=a.getTime())&&(!r||e.getFullYear()>=r)&&(!o||o>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.2",window["DP_jQuery_"+o]=t})(jQuery);(function(t){var e={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.10.2",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||t(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html("&#160;"),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,a;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("<button></button>",s).button(a).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,a){s.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(a))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,a){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(a))}}).css("position",a)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,a=!1,o={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(a=!0),t in i&&(o[t]=s)}),a&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.2",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):this.range=t([])},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-a.width()/2,top:e.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i,!0))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),u=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),u&&l.data("ui-tabs-aria-controls",u),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),u={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,u))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.2",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,a=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=a),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function a(t){l.of=t,o.is(":hidden")||o.position(l)}var o,r,h,l=t.extend({},this.options.position);if(n){if(o=this._find(s),o.length)return o.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),o=this._tooltip(s),e(s,o.attr("id")),o.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:a}),a(i)):o.position(t.extend({of:s},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){o.is(":visible")&&(a(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:o}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(o)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),a=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),a.stop(!0),this._hide(a,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:a}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[c[l].cache]=o[c[l].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,o,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,h],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),a=c[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],l=s[a],c=u[n.type]||{};null!==l&&(null===o?h[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),h[a]=i((l-o)*e+o,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[o]=d,n):l(d)},f(a,function(e,i){l.fn[e]||(l.fn[e]=function(n){var a,o=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=l(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var h=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.2",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",m=i.test(u),g={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),a=t.effects.createWrapper(h).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,g[p]=v?o:0,m||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),g[f]=v?r:o+r),v&&(a.css(p,0),m||a.css(f,r+o)),a.animate(g,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),m=e.duration/f,g=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,m,g)),l&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g).animate(a,m,g),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),l&&(n.css(d,0),n.css(p,a/2)),f[d]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),m||p.hide(),i()}var a,o,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(h=g.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=g.left+o*v,l=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(m?l*v:0),top:h+(m?c*_:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:c*_),opacity:m?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],m=e.duration/2,g={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),g[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(g,m,e.easing).animate(v,m,e.easing,function(){l&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,m=e.scale||"both",g=e.origin||["middle","center"],v=o.css("position"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(l),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=t.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),l=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,m[d]=(p?"+=":"-=")+2*h,g[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(m,u,e.easing).animate(g,u,e.easing);n.animate(m,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery);
1
+ /*! jQuery UI - v1.10.2 - 2013-03-15
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js
4
+ * Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
5
+ (function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=!1;return t[s]>0?!0:(t[s]=1,a=t[s]>0,t[s]=0,a)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,m,g,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),x=(e.collision||"flip").split(" "),k={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,m=_.height,g=_.offset,v=t.extend({},g),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=l.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=l.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),k[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=m:"center"===e.at[1]&&(v.top+=m/2),a=i(k.at,p,m),v.left+=a[0],v.top+=a[1],this.each(function(){var n,l,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),D=u+f+s(this,"marginRight")+w.width,T=d+_+s(this,"marginBottom")+w.height,C=t.extend({},v),M=i(k.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?C.left-=u:"center"===e.my[0]&&(C.left-=u/2),"bottom"===e.my[1]?C.top-=d:"center"===e.my[1]&&(C.top-=d/2),C.left+=M[0],C.top+=M[1],t.support.offsetFractions||(C.left=h(C.left),C.top=h(C.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[x[i]]&&t.ui.position[x[i]][s](C,{targetWidth:p,targetHeight:m,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:D,collisionHeight:T,offset:[a[0]+M[0],a[1]+M[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(l=function(t){var i=g.left-C.left,s=i+p-u,n=g.top-C.top,a=n+m-d,h={target:{element:b,left:g.left,top:g.top,width:p,height:m},element:{element:c,left:C.left,top:C.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>m&&m>r(n+a)&&(h.vertical="middle"),h.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(C,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-o-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-o-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-o-a,t.top+p+f+m>c&&(0>s||r(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,t.top+p+f+m>u&&(i>0||u>r(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),i.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i,s=this,n=!1,a=!1;for(e.ui.ddmanager&&!this.options.dropBehaviour&&(a=e.ui.ddmanager.drop(this,t)),this.dropped&&(a=this.dropped,this.dropped=!1),i=this.element[0];i&&(i=i.parentNode);)i===document&&(n=!0);return n||"original"!==this.options.helper?("invalid"===this.options.revert&&!a||"valid"===this.options.revert&&a||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,a)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;if("parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=["document"===n.containment?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"===n.containment?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"===n.containment?0:e(window).scrollLeft())+e("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"===n.containment?0:e(window).scrollTop())+(e("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||n.containment.constructor===Array)n.containment.constructor===Array&&(this.containment=n.containment);else{if(i=e(n.containment),s=i[0],!s)return;t="hidden"!==e(s).css("overflow"),this.containment=[(parseInt(e(s).css("borderLeftWidth"),10)||0)+(parseInt(e(s).css("paddingLeft"),10)||0),(parseInt(e(s).css("borderTopWidth"),10)||0)+(parseInt(e(s).css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(e(s).css("borderRightWidth"),10)||0)-(parseInt(e(s).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(e(s).css("borderBottomWidth"),10)||0)-(parseInt(e(s).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i}},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName),l=t.pageX,u=t.pageY;return this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(u=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(u=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((u-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,u=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:u-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var s=e(this).data("ui-draggable"),n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var s=e(this).data("ui-draggable"),n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i){var s=e(this).data("ui-draggable"),n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-t.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-e(document).scrollTop()<s.scrollSensitivity?n=e(document).scrollTop(e(document).scrollTop()-s.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<s.scrollSensitivity&&(n=e(document).scrollTop(e(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-e(document).scrollLeft()<s.scrollSensitivity?n=e(document).scrollLeft(e(document).scrollLeft()-s.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<s.scrollSensitivity&&(n=e(document).scrollLeft(e(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(i,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),i=t.options;t.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=e(this),s=i.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(t,i){var s,n,a,o,r,h,l,u,c,d,p=e(this).data("ui-draggable"),f=p.options,m=f.snapTolerance,g=i.offset.left,v=g+p.helperProportions.width,y=i.offset.top,b=y+p.helperProportions.height;for(c=p.snapElements.length-1;c>=0;c--)r=p.snapElements[c].left,h=r+p.snapElements[c].width,l=p.snapElements[c].top,u=l+p.snapElements[c].height,g>r-m&&h+m>g&&y>l-m&&u+m>y||g>r-m&&h+m>g&&b>l-m&&u+m>b||v>r-m&&h+m>v&&y>l-m&&u+m>y||v>r-m&&h+m>v&&b>l-m&&u+m>b?("inner"!==f.snapMode&&(s=m>=Math.abs(l-b),n=m>=Math.abs(u-y),a=m>=Math.abs(r-v),o=m>=Math.abs(h-g),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||a||o,"outer"!==f.snapMode&&(s=m>=Math.abs(l-y),n=m>=Math.abs(u-b),a=m>=Math.abs(r-g),o=m>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=s||n||a||o||d):(p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,s=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(t=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(e){function t(e,t,i){return e>t&&t+i>e}e.widget("ui.droppable",{version:"1.10.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];i.length>t;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===s.options.scope&&t.accept.call(t.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,i,s){if(!i.offset)return!1;var n,a,o=(e.positionAbs||e.position.absolute).left,r=o+e.helperProportions.width,h=(e.positionAbs||e.position.absolute).top,l=h+e.helperProportions.height,u=i.offset.left,c=u+i.proportions.width,d=i.offset.top,p=d+i.proportions.height;switch(s){case"fit":return o>=u&&c>=r&&h>=d&&p>=l;case"intersect":return o+e.helperProportions.width/2>u&&c>r-e.helperProportions.width/2&&h+e.helperProportions.height/2>d&&p>l-e.helperProportions.height/2;case"pointer":return n=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,a=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(a,d,i.proportions.height)&&t(n,u,i.proportions.width);case"touch":return(h>=d&&p>=h||l>=d&&p>=l||d>h&&l>p)&&(o>=u&&c>=o||r>=u&&c>=r||u>o&&r>c);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions.height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions={width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight})}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===n}),a.length&&(s=e.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}})(jQuery);(function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=t(this.helper.css("left")),n=t(this.helper.css("top")),o.containment&&(s+=e(o.containment).scrollLeft()||0,n+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-a.left||0,d=t.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==u&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,n=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,n=i(e.width)&&t.maxWidth&&t.maxWidth<e.width,a=i(e.height)&&t.maxHeight&&t.maxHeight<e.height,o=i(e.width)&&t.minWidth&&t.minWidth>e.width,r=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return o&&(e.width=t.minWidth),r&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),o&&u&&(e.left=h-t.minWidth),n&&u&&(e.left=h-t.maxWidth),r&&c&&(e.top=l-t.minHeight),a&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&e.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,n){s[e]=t(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=e.ui.hasScroll(p,"left")?p.scrollWidth:o,h=e.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(t){var i,s,n,a,o=e(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,c={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-c.left),u&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=o.parentData.left),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,c=Math.round((s.height-n.height)/l)*l,d=n.width+u,p=n.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.top=a.top-c):/^(sw)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.left=a.left-u):(t.size.width=d,t.size.height=p,t.position.top=a.top-c,t.position.left=a.left-u)}})})(jQuery);(function(e){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,a.widgetName+"-item")===a?(s=t(this),!1):undefined}),t.data(e.target,a.widgetName+"-item")===a&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=t("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:e.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:e.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(e.pageY-t(document).scrollTop()<o.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-o.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<o.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+o.scrollSpeed)),e.pageX-t(document).scrollLeft()<o.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-o.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<o.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+o.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=t.left,o=a+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u=s+l>r&&h>s+l&&e+c>a&&o>e+c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?u:e+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return n?this.floating?o&&"right"===o||"down"===a?2:1:a&&("down"===a?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&s||"left"===a&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,n,a,o=[],r=[],h=this._connectWith();if(h&&e)for(i=h.length-1;i>=0;i--)for(n=t(h[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&r.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(function(){o.push(this)});return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(u.push([t.isFunction(a.options.items)?a.options.items.call(a.element[0],e,{item:this.currentItem}):t(a.options.items,a.element),a]),this.containers.push(a));for(i=u.length-1;i>=0;i--)for(o=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",o),c.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t(e.document[0].createElement(s)).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?n.append("<td colspan='99'>&#160;</td>"):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,a,o,r,h,l,c,u,d,p,f=null,m=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],m=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],a=this.items.length-1;a>=0;a--)t.contains(this.containers[m].element[0],this.items[a].item[0])&&this.items[a].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[a].top,this.items[a].height))&&(u=this.items[a].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[a][l]-c)&&(d=!0,u+=this.items[a][l]),o>Math.abs(u-c)&&(o=Math.abs(u-c),r=this.items[a],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[m].element,!0),this._trigger("change",s,this._uiHash()),this.containers[m]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,a=e.pageX,o=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)e||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),a=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(t(e.target).attr("tabIndex",-1),t(a).attr("tabIndex",0),a.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),(e.active===!1&&e.collapsible===!0||!this.headers.length)&&(e.active=!1,this.active=t()),e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,a=this.element.parent(),o=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),a=n.attr("id");s||(s=o+"-header-"+e,i.attr("id",s)),a||(a=o+"-panel-"+e,n.attr("id",a)),i.attr("aria-controls",a),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=a.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?t():n,newPanel:r};e.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-expanded":"false","aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,n){var a,o,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(n)};return"number"==typeof d&&(r=d),"string"==typeof d&&(o=d),o=o||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(a=t.show().outerHeight(),e.animate(i,{duration:r,easing:o,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(s,{duration:r,easing:o,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(a-e.outerHeight()-l),l=0)}}),undefined):e.animate(i,r,o,p):t.animate(s,r,o,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}})})(jQuery);(function(e){var t=0;e.widget("ui.autocomplete",{version:"1.10.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({input:e(),role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,i=++t;return function(s){i===t&&e.__response(s),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(t){var e,i,s,n,a="ui-button ui-widget ui-state-default ui-corner-all",o="ui-state-hover ui-state-active ",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",h=function(){var e=t(this).find(":ui-button");setTimeout(function(){e.button("refresh")},1)},l=function(e){var i=e.name,s=e.form,n=t([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.10.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,h),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var o=this,r=this.options,c="checkbox"===this.type||"radio"===this.type,u=c?"":"ui-state-active",d="ui-state-focus";null===r.label&&(r.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(a).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){r.disabled||this===e&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){r.disabled||t(this).removeClass(u)}).bind("click"+this.eventNamespace,function(t){r.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){o.buttonElement.addClass(d)}).bind("blur"+this.eventNamespace,function(){o.buttonElement.removeClass(d)}),c&&(this.element.bind("change"+this.eventNamespace,function(){n||o.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(t){r.disabled||(n=!1,i=t.pageX,s=t.pageY)}).bind("mouseup"+this.eventNamespace,function(t){r.disabled||(i!==t.pageX||s!==t.pageY)&&(n=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return r.disabled||n?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||n)return!1;t(this).addClass("ui-state-active"),o.buttonElement.attr("aria-pressed","true");var e=o.element[0];l(e).not(e).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return r.disabled?!1:(t(this).addClass("ui-state-active"),e=this,o.document.one("mouseup",function(){e=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return r.disabled?!1:(t(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(e){return r.disabled?!1:((e.keyCode===t.ui.keyCode.SPACE||e.keyCode===t.ui.keyCode.ENTER)&&t(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",r.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(a+" "+o+" "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){return this._super(t,e),"disabled"===t?(e?this.element.prop("disabled",!0):this.element.prop("disabled",!1),undefined):(this._resetButton(),undefined)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?l(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var e=this.buttonElement.removeClass(r),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}}),t.widget("ui.buttonset",{version:"1.10.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(a.inline?e.parent()[0]:a.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.2"}});var a,r="datepicker",o=(new Date).getTime();t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,a;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),a=this._newInst(t(e),n),a.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,a):n&&this._inlineDatepicker(e,a)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,r,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,a,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=t("<span class='"+this._appendClass+"'>"+r+"</span>"),e[o?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(a?t("<img/>").attr({src:a,alt:n,title:n}):n)),e[o?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,a=new Date(2009,11,20),r=this._get(t,"dateFormat");r.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},a.setMonth(e(this._get(t,r.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(e(this._get(t,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),t.input.attr("size",this._formatDate(t,a).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,a,o){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],r,p)),n(p.settings,a||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,r);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,r),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,a){var r,o,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(r=s||{},"string"==typeof s&&(r={},r[s]=a),c&&(this._curInst===c&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,r),null!==h&&r.dateFormat!==e&&r.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&r.dateFormat!==e&&r.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,o),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,a=t.datepicker._getInst(e.target),r=!0,o=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),r=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",a.dpDiv),n[0]&&t.datepicker._selectDay(e.target,a.selectedMonth,a.selectedYear,n[0]),i=t.datepicker._get(a,"onSelect"),i?(s=t.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),r=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),r=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?1:-1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),r=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?-1:1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),r=e.ctrlKey||e.metaKey;break;default:r=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):r=!1;r&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,a=t.datepicker._getInst(i.target);return t.datepicker._get(a,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(a,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,a,r,o,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),a=s?s.apply(e,[e,i]):{},a!==!1&&(n(i.settings,a),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),o={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),o=t.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),i.input.is(":visible")&&!i.input.is(":disabled")&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,a=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],r=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",r*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!==document.activeElement&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_getBorders:function(t){var e=function(t){return{thin:1,medium:2,thick:3}[t]||t};return[parseFloat(e(t.css("border-left-width"))),parseFloat(e(t.css("border-top-width")))]},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),a=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-r:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+o?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+o):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,a,o=this._curInst;!o||e&&o!==t.data(e,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){t.datepicker._tidyDialog(o)},t.effects&&(t.effects.effect[i]||t.effects[i])?o.dpDiv.hide(i,t.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(e,i,s,n){var a,r=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(a=this._getInst(r[0]),a.selectedDay=a.currentDay=t("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(e,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,a=this._get(e,"altField");a&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(a).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var a,r,o,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,m=(n?n.monthNames:null)||this._defaults.monthNames,g=-1,v=-1,_=-1,b=-1,y=!1,w=function(t){var e=i.length>a+1&&i.charAt(a+1)===t;return e&&a++,e},k=function(t){var e=w(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),a=s.substring(l).match(n);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},x=function(i,n,a){var r=-1,o=t.map(w(i)?a:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(o,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(r=i[0],l+=n.length,!1):e}),-1!==r)return r+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(a))throw"Unexpected literal at position "+l;l++};for(a=0;i.length>a;a++)if(y)"'"!==i.charAt(a)||w("'")?D():y=!1;else switch(i.charAt(a)){case"d":_=k("d");break;case"D":x("D",d,p);break;case"o":b=k("o");break;case"m":v=k("m");break;case"M":v=x("M",f,m);break;case"y":g=k("y");break;case"@":h=new Date(k("@")),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((k("!")-this._ticksTo1970)/1e4),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":w("'")?D():y=!0;break;default:D()}if(s.length>l&&(o=s.substr(l),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=g?0:-100)),b>-1)for(v=1,_=b;;){if(r=this._getDaysInMonth(g,v-1),r>=_)break;v++,_-=r}if(h=this._daylightSavingAdjust(new Date(g,v-1,_)),h.getFullYear()!==g||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,a);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),r,o);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),a=n,r=this._getFormatConfig(t);try{a=this.parseDate(i,s,r)||n}catch(o){s=e?"":s}t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),t.currentDay=s?a.getDate():0,t.currentMonth=s?a.getMonth():0,t.currentYear=s?a.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},a=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,a=n.getFullYear(),r=n.getMonth(),o=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=7*parseInt(l[1],10);break;case"m":case"M":r+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r));break;case"y":case"Y":a+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r))}l=h.exec(i)}return new Date(a,r,o)},r=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?s:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,r=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=r.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=r.getMonth(),t.drawYear=t.selectedYear=t.currentYear=r.getFullYear(),n===t.selectedMonth&&a===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+o].datepicker._adjustDate(s,-i,"M")},next:function(){window["DP_jQuery_"+o].datepicker._adjustDate(s,+i,"M")},hide:function(){window["DP_jQuery_"+o].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+o].datepicker._gotoToday(s)},selectDay:function(){return window["DP_jQuery_"+o].datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+o].datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+o].datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,a,r,o,h,l,c,u,d,p,f,m,g,v,_,b,y,w,k,x,D,T,C,S,M,N,I,P,A,z,H,E,F,O,W,j,R=new Date,L=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),J=this._get(t,"hideIfNoPrevNext"),Q=this._get(t,"navigationAsDateFormat"),K=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),U=this._get(t,"stepMonths"),q=1!==K[0]||1!==K[1],X=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),$=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),$)for(e=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=Q?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-U,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=Q?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+U,1)),this._getFormatConfig(t)):n,a=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",r=this._get(t,"currentText"),o=this._get(t,"gotoCurrent")&&t.currentDay?X:L,r=Q?this.formatDate(r,o,this._getFormatConfig(t)):r,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),m=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;K[0]>k;k++){for(x="",this.maxRows=4,D=0;K[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),C=" ui-corner-all",S="",q){if(S+="<div class='ui-datepicker-group",K[1]>1)switch(D){case 0:S+=" ui-datepicker-group-first",C=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:S+=" ui-datepicker-group-last",C=" ui-corner-"+(Y?"left":"right");break;default:S+=" ui-datepicker-group-middle",C=""}S+="'>"}for(S+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&0===k?Y?a:s:"")+(/all|right/.test(C)&&0===k?Y?s:a:"")+this._generateMonthYearHeader(t,Z,te,G,$,k>0||D>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)N=(w+c)%7,M+="<th"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[N]+"'>"+p[N]+"</span></th>";for(S+=M+"</tr></thead><tbody>",I=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,I)),P=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((P+I)/7),z=q?this.maxRows>A?this.maxRows:A:A,this.maxRows=z,H=this._daylightSavingAdjust(new Date(te,Z,1-P)),E=0;z>E;E++){for(S+="<tr>",F=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(H)+"</td>":"",w=0;7>w;w++)O=g?g.apply(t.input?t.input[0]:null,[H]):[!0,""],W=H.getMonth()!==Z,j=W&&!_||!O[0]||G&&G>H||$&&H>$,F+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(W?" ui-datepicker-other-month":"")+(H.getTime()===T.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===H.getTime()&&b.getTime()===T.getTime()?" "+this._dayOverClass:"")+(j?" "+this._unselectableClass+" ui-state-disabled":"")+(W&&!v?"":" "+O[1]+(H.getTime()===X.getTime()?" "+this._currentClass:"")+(H.getTime()===L.getTime()?" ui-datepicker-today":""))+"'"+(W&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(j?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(W&&!v?"&#xa0;":j?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===L.getTime()?" ui-state-highlight":"")+(H.getTime()===X.getTime()?" ui-state-active":"")+(W?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);S+=F+"</tr>"}Z++,Z>11&&(Z=0,te++),S+="</tbody></table>"+(q?"</div>"+(K[0]>0&&D===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=S}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,a,r,o){var h,l,c,u,d,p,f,m,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(a||!g)y+="<span class='ui-datepicker-month'>"+r[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+o[c]+"</option>");
 
6
  y+="</select>"}if(_||(b+=y+(!a&&g&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),m=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!a&&g&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),a=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),r=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,a)));t.selectedDay=r.getDate(),t.drawMonth=t.selectedMonth=r.getMonth(),t.drawYear=t.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),a=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(t,a)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),a=this._getMinMaxDate(t,"max"),r=null,o=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=s),i[1].match(/[+\-].*/)&&(o+=s)),(!n||e.getTime()>=n.getTime())&&(!a||e.getTime()<=a.getTime())&&(!r||e.getFullYear()>=r)&&(!o||o>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.2",window["DP_jQuery_"+o]=t})(jQuery);(function(t){var e={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.10.2",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||t(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html("&#160;"),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,a;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("<button></button>",s).button(a).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,a){s.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(a))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,a){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(a))}}).css("position",a)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,a=!1,o={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(a=!0),t in i&&(o[t]=s)}),a&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.2",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):this.range=t([])},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-a.width()/2,top:e.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i,!0))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),u=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),u&&l.data("ui-tabs-aria-controls",u),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),u={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,u))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.2",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,a=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=a),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function a(t){l.of=t,o.is(":hidden")||o.position(l)}var o,r,h,l=t.extend({},this.options.position);if(n){if(o=this._find(s),o.length)return o.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),o=this._tooltip(s),e(s,o.attr("id")),o.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:a}),a(i)):o.position(t.extend({of:s},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){o.is(":visible")&&(a(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:o}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(o)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),a=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),a.stop(!0),this._hide(a,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:a}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[c[l].cache]=o[c[l].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,o,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,h],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),a=c[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],l=s[a],c=u[n.type]||{};null!==l&&(null===o?h[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),h[a]=i((l-o)*e+o,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[o]=d,n):l(d)},f(a,function(e,i){l.fn[e]||(l.fn[e]=function(n){var a,o=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=l(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var h=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.2",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",m=i.test(u),g={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),a=t.effects.createWrapper(h).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,g[p]=v?o:0,m||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),g[f]=v?r:o+r),v&&(a.css(p,0),m||a.css(f,r+o)),a.animate(g,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),m=e.duration/f,g=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,m,g)),l&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g).animate(a,m,g),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),l&&(n.css(d,0),n.css(p,a/2)),f[d]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),m||p.hide(),i()}var a,o,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(h=g.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=g.left+o*v,l=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(m?l*v:0),top:h+(m?c*_:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:c*_),opacity:m?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],m=e.duration/2,g={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),g[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(g,m,e.easing).animate(v,m,e.easing,function(){l&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,m=e.scale||"both",g=e.origin||["middle","center"],v=o.css("position"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(l),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=t.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),l=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,m[d]=(p?"+=":"-=")+2*h,g[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(m,u,e.easing).animate(g,u,e.easing);n.animate(m,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery);
js/jquery.js CHANGED
@@ -1,9605 +1,8082 @@
1
- /*!
2
- * jQuery JavaScript Library v1.9.1
3
- * http://jquery.com/
4
- *
5
- * Includes Sizzle.js
6
- * http://sizzlejs.com/
7
- *
8
- * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
9
- * Released under the MIT license
10
- * http://jquery.org/license
11
- *
12
- * Date: 2013-2-4
13
- */
14
- (function( window, undefined ) {
15
-
16
- // Can't do this because several apps including ASP.NET trace
17
- // the stack via arguments.caller.callee and Firefox dies if
18
- // you try to trace through "use strict" call chains. (#13335)
19
- // Support: Firefox 18+
20
- //"use strict";
21
- var
22
- // The deferred used on DOM ready
23
- readyList,
24
-
25
- // A central reference to the root jQuery(document)
26
- rootjQuery,
27
-
28
- // Support: IE<9
29
- // For `typeof node.method` instead of `node.method !== undefined`
30
- core_strundefined = typeof undefined,
31
-
32
- // Use the correct document accordingly with window argument (sandbox)
33
- document = window.document,
34
- location = window.location,
35
-
36
- // Map over jQuery in case of overwrite
37
- _jQuery = window.jQuery,
38
-
39
- // Map over the $ in case of overwrite
40
- _$ = window.$,
41
-
42
- // [[Class]] -> type pairs
43
- class2type = {},
44
-
45
- // List of deleted data cache ids, so we can reuse them
46
- core_deletedIds = [],
47
-
48
- core_version = "1.9.1",
49
-
50
- // Save a reference to some core methods
51
- core_concat = core_deletedIds.concat,
52
- core_push = core_deletedIds.push,
53
- core_slice = core_deletedIds.slice,
54
- core_indexOf = core_deletedIds.indexOf,
55
- core_toString = class2type.toString,
56
- core_hasOwn = class2type.hasOwnProperty,
57
- core_trim = core_version.trim,
58
-
59
- // Define a local copy of jQuery
60
- jQuery = function( selector, context ) {
61
- // The jQuery object is actually just the init constructor 'enhanced'
62
- return new jQuery.fn.init( selector, context, rootjQuery );
63
- },
64
-
65
- // Used for matching numbers
66
- core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
67
-
68
- // Used for splitting on whitespace
69
- core_rnotwhite = /\S+/g,
70
-
71
- // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
72
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
73
-
74
- // A simple way to check for HTML strings
75
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
76
- // Strict HTML recognition (#11290: must start with <)
77
- rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
78
-
79
- // Match a standalone tag
80
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
81
-
82
- // JSON RegExp
83
- rvalidchars = /^[\],:{}\s]*$/,
84
- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
85
- rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
86
- rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
87
-
88
- // Matches dashed string for camelizing
89
- rmsPrefix = /^-ms-/,
90
- rdashAlpha = /-([\da-z])/gi,
91
-
92
- // Used by jQuery.camelCase as callback to replace()
93
- fcamelCase = function( all, letter ) {
94
- return letter.toUpperCase();
95
- },
96
-
97
- // The ready event handler
98
- completed = function( event ) {
99
-
100
- // readyState === "complete" is good enough for us to call the dom ready in oldIE
101
- if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
102
- detach();
103
- jQuery.ready();
104
- }
105
- },
106
- // Clean-up method for dom ready events
107
- detach = function() {
108
- if ( document.addEventListener ) {
109
- document.removeEventListener( "DOMContentLoaded", completed, false );
110
- window.removeEventListener( "load", completed, false );
111
-
112
- } else {
113
- document.detachEvent( "onreadystatechange", completed );
114
- window.detachEvent( "onload", completed );
115
- }
116
- };
117
-
118
- jQuery.fn = jQuery.prototype = {
119
- // The current version of jQuery being used
120
- jquery: core_version,
121
-
122
- constructor: jQuery,
123
- init: function( selector, context, rootjQuery ) {
124
- var match, elem;
125
-
126
- // HANDLE: $(""), $(null), $(undefined), $(false)
127
- if ( !selector ) {
128
- return this;
129
- }
130
-
131
- // Handle HTML strings
132
- if ( typeof selector === "string" ) {
133
- if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
134
- // Assume that strings that start and end with <> are HTML and skip the regex check
135
- match = [ null, selector, null ];
136
-
137
- } else {
138
- match = rquickExpr.exec( selector );
139
- }
140
-
141
- // Match html or make sure no context is specified for #id
142
- if ( match && (match[1] || !context) ) {
143
-
144
- // HANDLE: $(html) -> $(array)
145
- if ( match[1] ) {
146
- context = context instanceof jQuery ? context[0] : context;
147
-
148
- // scripts is true for back-compat
149
- jQuery.merge( this, jQuery.parseHTML(
150
- match[1],
151
- context && context.nodeType ? context.ownerDocument || context : document,
152
- true
153
- ) );
154
-
155
- // HANDLE: $(html, props)
156
- if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
157
- for ( match in context ) {
158
- // Properties of context are called as methods if possible
159
- if ( jQuery.isFunction( this[ match ] ) ) {
160
- this[ match ]( context[ match ] );
161
-
162
- // ...and otherwise set as attributes
163
- } else {
164
- this.attr( match, context[ match ] );
165
- }
166
- }
167
- }
168
-
169
- return this;
170
-
171
- // HANDLE: $(#id)
172
- } else {
173
- elem = document.getElementById( match[2] );
174
-
175
- // Check parentNode to catch when Blackberry 4.6 returns
176
- // nodes that are no longer in the document #6963
177
- if ( elem && elem.parentNode ) {
178
- // Handle the case where IE and Opera return items
179
- // by name instead of ID
180
- if ( elem.id !== match[2] ) {
181
- return rootjQuery.find( selector );
182
- }
183
-
184
- // Otherwise, we inject the element directly into the jQuery object
185
- this.length = 1;
186
- this[0] = elem;
187
- }
188
-
189
- this.context = document;
190
- this.selector = selector;
191
- return this;
192
- }
193
-
194
- // HANDLE: $(expr, $(...))
195
- } else if ( !context || context.jquery ) {
196
- return ( context || rootjQuery ).find( selector );
197
-
198
- // HANDLE: $(expr, context)
199
- // (which is just equivalent to: $(context).find(expr)
200
- } else {
201
- return this.constructor( context ).find( selector );
202
- }
203
-
204
- // HANDLE: $(DOMElement)
205
- } else if ( selector.nodeType ) {
206
- this.context = this[0] = selector;
207
- this.length = 1;
208
- return this;
209
-
210
- // HANDLE: $(function)
211
- // Shortcut for document ready
212
- } else if ( jQuery.isFunction( selector ) ) {
213
- return rootjQuery.ready( selector );
214
- }
215
-
216
- if ( selector.selector !== undefined ) {
217
- this.selector = selector.selector;
218
- this.context = selector.context;
219
- }
220
-
221
- return jQuery.makeArray( selector, this );
222
- },
223
-
224
- // Start with an empty selector
225
- selector: "",
226
-
227
- // The default length of a jQuery object is 0
228
- length: 0,
229
-
230
- // The number of elements contained in the matched element set
231
- size: function() {
232
- return this.length;
233
- },
234
-
235
- toArray: function() {
236
- return core_slice.call( this );
237
- },
238
-
239
- // Get the Nth element in the matched element set OR
240
- // Get the whole matched element set as a clean array
241
- get: function( num ) {
242
- return num == null ?
243
-
244
- // Return a 'clean' array
245
- this.toArray() :
246
-
247
- // Return just the object
248
- ( num < 0 ? this[ this.length + num ] : this[ num ] );
249
- },
250
-
251
- // Take an array of elements and push it onto the stack
252
- // (returning the new matched element set)
253
- pushStack: function( elems ) {
254
-
255
- // Build a new jQuery matched element set
256
- var ret = jQuery.merge( this.constructor(), elems );
257
-
258
- // Add the old object onto the stack (as a reference)
259
- ret.prevObject = this;
260
- ret.context = this.context;
261
-
262
- // Return the newly-formed element set
263
- return ret;
264
- },
265
-
266
- // Execute a callback for every element in the matched set.
267
- // (You can seed the arguments with an array of args, but this is
268
- // only used internally.)
269
- each: function( callback, args ) {
270
- return jQuery.each( this, callback, args );
271
- },
272
-
273
- ready: function( fn ) {
274
- // Add the callback
275
- jQuery.ready.promise().done( fn );
276
-
277
- return this;
278
- },
279
-
280
- slice: function() {
281
- return this.pushStack( core_slice.apply( this, arguments ) );
282
- },
283
-
284
- first: function() {
285
- return this.eq( 0 );
286
- },
287
-
288
- last: function() {
289
- return this.eq( -1 );
290
- },
291
-
292
- eq: function( i ) {
293
- var len = this.length,
294
- j = +i + ( i < 0 ? len : 0 );
295
- return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
296
- },
297
-
298
- map: function( callback ) {
299
- return this.pushStack( jQuery.map(this, function( elem, i ) {
300
- return callback.call( elem, i, elem );
301
- }));
302
- },
303
-
304
- end: function() {
305
- return this.prevObject || this.constructor(null);
306
- },
307
-
308
- // For internal use only.
309
- // Behaves like an Array's method, not like a jQuery method.
310
- push: core_push,
311
- sort: [].sort,
312
- splice: [].splice
313
- };
314
-
315
- // Give the init function the jQuery prototype for later instantiation
316
- jQuery.fn.init.prototype = jQuery.fn;
317
-
318
- jQuery.extend = jQuery.fn.extend = function() {
319
- var src, copyIsArray, copy, name, options, clone,
320
- target = arguments[0] || {},
321
- i = 1,
322
- length = arguments.length,
323
- deep = false;
324
-
325
- // Handle a deep copy situation
326
- if ( typeof target === "boolean" ) {
327
- deep = target;
328
- target = arguments[1] || {};
329
- // skip the boolean and the target
330
- i = 2;
331
- }
332
-
333
- // Handle case when target is a string or something (possible in deep copy)
334
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
335
- target = {};
336
- }
337
-
338
- // extend jQuery itself if only one argument is passed
339
- if ( length === i ) {
340
- target = this;
341
- --i;
342
- }
343
-
344
- for ( ; i < length; i++ ) {
345
- // Only deal with non-null/undefined values
346
- if ( (options = arguments[ i ]) != null ) {
347
- // Extend the base object
348
- for ( name in options ) {
349
- src = target[ name ];
350
- copy = options[ name ];
351
-
352
- // Prevent never-ending loop
353
- if ( target === copy ) {
354
- continue;
355
- }
356
-
357
- // Recurse if we're merging plain objects or arrays
358
- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
359
- if ( copyIsArray ) {
360
- copyIsArray = false;
361
- clone = src && jQuery.isArray(src) ? src : [];
362
-
363
- } else {
364
- clone = src && jQuery.isPlainObject(src) ? src : {};
365
- }
366
-
367
- // Never move original objects, clone them
368
- target[ name ] = jQuery.extend( deep, clone, copy );
369
-
370
- // Don't bring in undefined values
371
- } else if ( copy !== undefined ) {
372
- target[ name ] = copy;
373
- }
374
- }
375
- }
376
- }
377
-
378
- // Return the modified object
379
- return target;
380
- };
381
-
382
- jQuery.extend({
383
- noConflict: function( deep ) {
384
- if ( window.$ === jQuery ) {
385
- window.$ = _$;
386
- }
387
-
388
- if ( deep && window.jQuery === jQuery ) {
389
- window.jQuery = _jQuery;
390
- }
391
-
392
- return jQuery;
393
- },
394
-
395
- // Is the DOM ready to be used? Set to true once it occurs.
396
- isReady: false,
397
-
398
- // A counter to track how many items to wait for before
399
- // the ready event fires. See #6781
400
- readyWait: 1,
401
-
402
- // Hold (or release) the ready event
403
- holdReady: function( hold ) {
404
- if ( hold ) {
405
- jQuery.readyWait++;
406
- } else {
407
- jQuery.ready( true );
408
- }
409
- },
410
-
411
- // Handle when the DOM is ready
412
- ready: function( wait ) {
413
-
414
- // Abort if there are pending holds or we're already ready
415
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
416
- return;
417
- }
418
-
419
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
420
- if ( !document.body ) {
421
- return setTimeout( jQuery.ready );
422
- }
423
-
424
- // Remember that the DOM is ready
425
- jQuery.isReady = true;
426
-
427
- // If a normal DOM Ready event fired, decrement, and wait if need be
428
- if ( wait !== true && --jQuery.readyWait > 0 ) {
429
- return;
430
- }
431
-
432
- // If there are functions bound, to execute
433
- readyList.resolveWith( document, [ jQuery ] );
434
-
435
- // Trigger any bound ready events
436
- if ( jQuery.fn.trigger ) {
437
- jQuery( document ).trigger("ready").off("ready");
438
- }
439
- },
440
-
441
- // See test/unit/core.js for details concerning isFunction.
442
- // Since version 1.3, DOM methods and functions like alert
443
- // aren't supported. They return false on IE (#2968).
444
- isFunction: function( obj ) {
445
- return jQuery.type(obj) === "function";
446
- },
447
-
448
- isArray: Array.isArray || function( obj ) {
449
- return jQuery.type(obj) === "array";
450
- },
451
-
452
- isWindow: function( obj ) {
453
- return obj != null && obj == obj.window;
454
- },
455
-
456
- isNumeric: function( obj ) {
457
- return !isNaN( parseFloat(obj) ) && isFinite( obj );
458
- },
459
-
460
- type: function( obj ) {
461
- if ( obj == null ) {
462
- return String( obj );
463
- }
464
- return typeof obj === "object" || typeof obj === "function" ?
465
- class2type[ core_toString.call(obj) ] || "object" :
466
- typeof obj;
467
- },
468
-
469
- isPlainObject: function( obj ) {
470
- // Must be an Object.
471
- // Because of IE, we also have to check the presence of the constructor property.
472
- // Make sure that DOM nodes and window objects don't pass through, as well
473
- if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
474
- return false;
475
- }
476
-
477
- try {
478
- // Not own constructor property must be Object
479
- if ( obj.constructor &&
480
- !core_hasOwn.call(obj, "constructor") &&
481
- !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
482
- return false;
483
- }
484
- } catch ( e ) {
485
- // IE8,9 Will throw exceptions on certain host objects #9897
486
- return false;
487
- }
488
-
489
- // Own properties are enumerated firstly, so to speed up,
490
- // if last one is own, then all properties are own.
491
-
492
- var key;
493
- for ( key in obj ) {}
494
-
495
- return key === undefined || core_hasOwn.call( obj, key );
496
- },
497
-
498
- isEmptyObject: function( obj ) {
499
- var name;
500
- for ( name in obj ) {
501
- return false;
502
- }
503
- return true;
504
- },
505
-
506
- error: function( msg ) {
507
- throw new Error( msg );
508
- },
509
-
510
- // data: string of html
511
- // context (optional): If specified, the fragment will be created in this context, defaults to document
512
- // keepScripts (optional): If true, will include scripts passed in the html string
513
- parseHTML: function( data, context, keepScripts ) {
514
- if ( !data || typeof data !== "string" ) {
515
- return null;
516
- }
517
- if ( typeof context === "boolean" ) {
518
- keepScripts = context;
519
- context = false;
520
- }
521
- context = context || document;
522
-
523
- var parsed = rsingleTag.exec( data ),
524
- scripts = !keepScripts && [];
525
-
526
- // Single tag
527
- if ( parsed ) {
528
- return [ context.createElement( parsed[1] ) ];
529
- }
530
-
531
- parsed = jQuery.buildFragment( [ data ], context, scripts );
532
- if ( scripts ) {
533
- jQuery( scripts ).remove();
534
- }
535
- return jQuery.merge( [], parsed.childNodes );
536
- },
537
-
538
- parseJSON: function( data ) {
539
- // Attempt to parse using the native JSON parser first
540
- if ( window.JSON && window.JSON.parse ) {
541
- return window.JSON.parse( data );
542
- }
543
-
544
- if ( data === null ) {
545
- return data;
546
- }
547
-
548
- if ( typeof data === "string" ) {
549
-
550
- // Make sure leading/trailing whitespace is removed (IE can't handle it)
551
- data = jQuery.trim( data );
552
-
553
- if ( data ) {
554
- // Make sure the incoming data is actual JSON
555
- // Logic borrowed from http://json.org/json2.js
556
- if ( rvalidchars.test( data.replace( rvalidescape, "@" )
557
- .replace( rvalidtokens, "]" )
558
- .replace( rvalidbraces, "")) ) {
559
-
560
- return ( new Function( "return " + data ) )();
561
- }
562
- }
563
- }
564
-
565
- jQuery.error( "Invalid JSON: " + data );
566
- },
567
-
568
- // Cross-browser xml parsing
569
- parseXML: function( data ) {
570
- var xml, tmp;
571
- if ( !data || typeof data !== "string" ) {
572
- return null;
573
- }
574
- try {
575
- if ( window.DOMParser ) { // Standard
576
- tmp = new DOMParser();
577
- xml = tmp.parseFromString( data , "text/xml" );
578
- } else { // IE
579
- xml = new ActiveXObject( "Microsoft.XMLDOM" );
580
- xml.async = "false";
581
- xml.loadXML( data );
582
- }
583
- } catch( e ) {
584
- xml = undefined;
585
- }
586
- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
587
- jQuery.error( "Invalid XML: " + data );
588
- }
589
- return xml;
590
- },
591
-
592
- noop: function() {},
593
-
594
- // Evaluates a script in a global context
595
- // Workarounds based on findings by Jim Driscoll
596
- // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
597
- globalEval: function( data ) {
598
- if ( data && jQuery.trim( data ) ) {
599
- // We use execScript on Internet Explorer
600
- // We use an anonymous function so that context is window
601
- // rather than jQuery in Firefox
602
- ( window.execScript || function( data ) {
603
- window[ "eval" ].call( window, data );
604
- } )( data );
605
- }
606
- },
607
-
608
- // Convert dashed to camelCase; used by the css and data modules
609
- // Microsoft forgot to hump their vendor prefix (#9572)
610
- camelCase: function( string ) {
611
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
612
- },
613
-
614
- nodeName: function( elem, name ) {
615
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
616
- },
617
-
618
- // args is for internal usage only
619
- each: function( obj, callback, args ) {
620
- var value,
621
- i = 0,
622
- length = obj.length,
623
- isArray = isArraylike( obj );
624
-
625
- if ( args ) {
626
- if ( isArray ) {
627
- for ( ; i < length; i++ ) {
628
- value = callback.apply( obj[ i ], args );
629
-
630
- if ( value === false ) {
631
- break;
632
- }
633
- }
634
- } else {
635
- for ( i in obj ) {
636
- value = callback.apply( obj[ i ], args );
637
-
638
- if ( value === false ) {
639
- break;
640
- }
641
- }
642
- }
643
-
644
- // A special, fast, case for the most common use of each
645
- } else {
646
- if ( isArray ) {
647
- for ( ; i < length; i++ ) {
648
- value = callback.call( obj[ i ], i, obj[ i ] );
649
-
650
- if ( value === false ) {
651
- break;
652
- }
653
- }
654
- } else {
655
- for ( i in obj ) {
656
- value = callback.call( obj[ i ], i, obj[ i ] );
657
-
658
- if ( value === false ) {
659
- break;
660
- }
661
- }
662
- }
663
- }
664
-
665
- return obj;
666
- },
667
-
668
- // Use native String.trim function wherever possible
669
- trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
670
- function( text ) {
671
- return text == null ?
672
- "" :
673
- core_trim.call( text );
674
- } :
675
-
676
- // Otherwise use our own trimming functionality
677
- function( text ) {
678
- return text == null ?
679
- "" :
680
- ( text + "" ).replace( rtrim, "" );
681
- },
682
-
683
- // results is for internal usage only
684
- makeArray: function( arr, results ) {
685
- var ret = results || [];
686
-
687
- if ( arr != null ) {
688
- if ( isArraylike( Object(arr) ) ) {
689
- jQuery.merge( ret,
690
- typeof arr === "string" ?
691
- [ arr ] : arr
692
- );
693
- } else {
694
- core_push.call( ret, arr );
695
- }
696
- }
697
-
698
- return ret;
699
- },
700
-
701
- inArray: function( elem, arr, i ) {
702
- var len;
703
-
704
- if ( arr ) {
705
- if ( core_indexOf ) {
706
- return core_indexOf.call( arr, elem, i );
707
- }
708
-
709
- len = arr.length;
710
- i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
711
-
712
- for ( ; i < len; i++ ) {
713
- // Skip accessing in sparse arrays
714
- if ( i in arr && arr[ i ] === elem ) {
715
- return i;
716
- }
717
- }
718
- }
719
-
720
- return -1;
721
- },
722
-
723
- merge: function( first, second ) {
724
- var l = second.length,
725
- i = first.length,
726
- j = 0;
727
-
728
- if ( typeof l === "number" ) {
729
- for ( ; j < l; j++ ) {
730
- first[ i++ ] = second[ j ];
731
- }
732
- } else {
733
- while ( second[j] !== undefined ) {
734
- first[ i++ ] = second[ j++ ];
735
- }
736
- }
737
-
738
- first.length = i;
739
-
740
- return first;
741
- },
742
-
743
- grep: function( elems, callback, inv ) {
744
- var retVal,
745
- ret = [],
746
- i = 0,
747
- length = elems.length;
748
- inv = !!inv;
749
-
750
- // Go through the array, only saving the items
751
- // that pass the validator function
752
- for ( ; i < length; i++ ) {
753
- retVal = !!callback( elems[ i ], i );
754
- if ( inv !== retVal ) {
755
- ret.push( elems[ i ] );
756
- }
757
- }
758
-
759
- return ret;
760
- },
761
-
762
- // arg is for internal usage only
763
- map: function( elems, callback, arg ) {
764
- var value,
765
- i = 0,
766
- length = elems.length,
767
- isArray = isArraylike( elems ),
768
- ret = [];
769
-
770
- // Go through the array, translating each of the items to their
771
- if ( isArray ) {
772
- for ( ; i < length; i++ ) {
773
- value = callback( elems[ i ], i, arg );
774
-
775
- if ( value != null ) {
776
- ret[ ret.length ] = value;
777
- }
778
- }
779
-
780
- // Go through every key on the object,
781
- } else {
782
- for ( i in elems ) {
783
- value = callback( elems[ i ], i, arg );
784
-
785
- if ( value != null ) {
786
- ret[ ret.length ] = value;
787
- }
788
- }
789
- }
790
-
791
- // Flatten any nested arrays
792
- return core_concat.apply( [], ret );
793
- },
794
-
795
- // A global GUID counter for objects
796
- guid: 1,
797
-
798
- // Bind a function to a context, optionally partially applying any
799
- // arguments.
800
- proxy: function( fn, context ) {
801
- var args, proxy, tmp;
802
-
803
- if ( typeof context === "string" ) {
804
- tmp = fn[ context ];
805
- context = fn;
806
- fn = tmp;
807
- }
808
-
809
- // Quick check to determine if target is callable, in the spec
810
- // this throws a TypeError, but we will just return undefined.
811
- if ( !jQuery.isFunction( fn ) ) {
812
- return undefined;
813
- }
814
-
815
- // Simulated bind
816
- args = core_slice.call( arguments, 2 );
817
- proxy = function() {
818
- return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
819
- };
820
-
821
- // Set the guid of unique handler to the same of original handler, so it can be removed
822
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
823
-
824
- return proxy;
825
- },
826
-
827
- // Multifunctional method to get and set values of a collection
828
- // The value/s can optionally be executed if it's a function
829
- access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
830
- var i = 0,
831
- length = elems.length,
832
- bulk = key == null;
833
-
834
- // Sets many values
835
- if ( jQuery.type( key ) === "object" ) {
836
- chainable = true;
837
- for ( i in key ) {
838
- jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
839
- }
840
-
841
- // Sets one value
842
- } else if ( value !== undefined ) {
843
- chainable = true;
844
-
845
- if ( !jQuery.isFunction( value ) ) {
846
- raw = true;
847
- }
848
-
849
- if ( bulk ) {
850
- // Bulk operations run against the entire set
851
- if ( raw ) {
852
- fn.call( elems, value );
853
- fn = null;
854
-
855
- // ...except when executing function values
856
- } else {
857
- bulk = fn;
858
- fn = function( elem, key, value ) {
859
- return bulk.call( jQuery( elem ), value );
860
- };
861
- }
862
- }
863
-
864
- if ( fn ) {
865
- for ( ; i < length; i++ ) {
866
- fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
867
- }
868
- }
869
- }
870
-
871
- return chainable ?
872
- elems :
873
-
874
- // Gets
875
- bulk ?
876
- fn.call( elems ) :
877
- length ? fn( elems[0], key ) : emptyGet;
878
- },
879
-
880
- now: function() {
881
- return ( new Date() ).getTime();
882
- }
883
- });
884
-
885
- jQuery.ready.promise = function( obj ) {
886
- if ( !readyList ) {
887
-
888
- readyList = jQuery.Deferred();
889
-
890
- // Catch cases where $(document).ready() is called after the browser event has already occurred.
891
- // we once tried to use readyState "interactive" here, but it caused issues like the one
892
- // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
893
- if ( document.readyState === "complete" ) {
894
- // Handle it asynchronously to allow scripts the opportunity to delay ready
895
- setTimeout( jQuery.ready );
896
-
897
- // Standards-based browsers support DOMContentLoaded
898
- } else if ( document.addEventListener ) {
899
- // Use the handy event callback
900
- document.addEventListener( "DOMContentLoaded", completed, false );
901
-
902
- // A fallback to window.onload, that will always work
903
- window.addEventListener( "load", completed, false );
904
-
905
- // If IE event model is used
906
- } else {
907
- // Ensure firing before onload, maybe late but safe also for iframes
908
- document.attachEvent( "onreadystatechange", completed );
909
-
910
- // A fallback to window.onload, that will always work
911
- window.attachEvent( "onload", completed );
912
-
913
- // If IE and not a frame
914
- // continually check to see if the document is ready
915
- var top = false;
916
-
917
- try {
918
- top = window.frameElement == null && document.documentElement;
919
- } catch(e) {}
920
-
921
- if ( top && top.doScroll ) {
922
- (function doScrollCheck() {
923
- if ( !jQuery.isReady ) {
924
-
925
- try {
926
- // Use the trick by Diego Perini
927
- // http://javascript.nwbox.com/IEContentLoaded/
928
- top.doScroll("left");
929
- } catch(e) {
930
- return setTimeout( doScrollCheck, 50 );
931
- }
932
-
933
- // detach all dom ready events
934
- detach();
935
-
936
- // and execute any waiting functions
937
- jQuery.ready();
938
- }
939
- })();
940
- }
941
- }
942
- }
943
- return readyList.promise( obj );
944
- };
945
-
946
- // Populate the class2type map
947
- jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
948
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
949
- });
950
-
951
- function isArraylike( obj ) {
952
- var length = obj.length,
953
- type = jQuery.type( obj );
954
-
955
- if ( jQuery.isWindow( obj ) ) {
956
- return false;
957
- }
958
-
959
- if ( obj.nodeType === 1 && length ) {
960
- return true;
961
- }
962
-
963
- return type === "array" || type !== "function" &&
964
- ( length === 0 ||
965
- typeof length === "number" && length > 0 && ( length - 1 ) in obj );
966
- }
967
-
968
- // All jQuery objects should point back to these
969
- rootjQuery = jQuery(document);
970
- // String to Object options format cache
971
- var optionsCache = {};
972
-
973
- // Convert String-formatted options into Object-formatted ones and store in cache
974
- function createOptions( options ) {
975
- var object = optionsCache[ options ] = {};
976
- jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
977
- object[ flag ] = true;
978
- });
979
- return object;
980
- }
981
-
982
- /*
983
- * Create a callback list using the following parameters:
984
- *
985
- * options: an optional list of space-separated options that will change how
986
- * the callback list behaves or a more traditional option object
987
- *
988
- * By default a callback list will act like an event callback list and can be
989
- * "fired" multiple times.
990
- *
991
- * Possible options:
992
- *
993
- * once: will ensure the callback list can only be fired once (like a Deferred)
994
- *
995
- * memory: will keep track of previous values and will call any callback added
996
- * after the list has been fired right away with the latest "memorized"
997
- * values (like a Deferred)
998
- *
999
- * unique: will ensure a callback can only be added once (no duplicate in the list)
1000
- *
1001
- * stopOnFalse: interrupt callings when a callback returns false
1002
- *
1003
- */
1004
- jQuery.Callbacks = function( options ) {
1005
-
1006
- // Convert options from String-formatted to Object-formatted if needed
1007
- // (we check in cache first)
1008
- options = typeof options === "string" ?
1009
- ( optionsCache[ options ] || createOptions( options ) ) :
1010
- jQuery.extend( {}, options );
1011
-
1012
- var // Flag to know if list is currently firing
1013
- firing,
1014
- // Last fire value (for non-forgettable lists)
1015
- memory,
1016
- // Flag to know if list was already fired
1017
- fired,
1018
- // End of the loop when firing
1019
- firingLength,
1020
- // Index of currently firing callback (modified by remove if needed)
1021
- firingIndex,
1022
- // First callback to fire (used internally by add and fireWith)
1023
- firingStart,
1024
- // Actual callback list
1025
- list = [],
1026
- // Stack of fire calls for repeatable lists
1027
- stack = !options.once && [],
1028
- // Fire callbacks
1029
- fire = function( data ) {
1030
- memory = options.memory && data;
1031
- fired = true;
1032
- firingIndex = firingStart || 0;
1033
- firingStart = 0;
1034
- firingLength = list.length;
1035
- firing = true;
1036
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
1037
- if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
1038
- memory = false; // To prevent further calls using add
1039
- break;
1040
- }
1041
- }
1042
- firing = false;
1043
- if ( list ) {
1044
- if ( stack ) {
1045
- if ( stack.length ) {
1046
- fire( stack.shift() );
1047
- }
1048
- } else if ( memory ) {
1049
- list = [];
1050
- } else {
1051
- self.disable();
1052
- }
1053
- }
1054
- },
1055
- // Actual Callbacks object
1056
- self = {
1057
- // Add a callback or a collection of callbacks to the list
1058
- add: function() {
1059
- if ( list ) {
1060
- // First, we save the current length
1061
- var start = list.length;
1062
- (function add( args ) {
1063
- jQuery.each( args, function( _, arg ) {
1064
- var type = jQuery.type( arg );
1065
- if ( type === "function" ) {
1066
- if ( !options.unique || !self.has( arg ) ) {
1067
- list.push( arg );
1068
- }
1069
- } else if ( arg && arg.length && type !== "string" ) {
1070
- // Inspect recursively
1071
- add( arg );
1072
- }
1073
- });
1074
- })( arguments );
1075
- // Do we need to add the callbacks to the
1076
- // current firing batch?
1077
- if ( firing ) {
1078
- firingLength = list.length;
1079
- // With memory, if we're not firing then
1080
- // we should call right away
1081
- } else if ( memory ) {
1082
- firingStart = start;
1083
- fire( memory );
1084
- }
1085
- }
1086
- return this;
1087
- },
1088
- // Remove a callback from the list
1089
- remove: function() {
1090
- if ( list ) {
1091
- jQuery.each( arguments, function( _, arg ) {
1092
- var index;
1093
- while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
1094
- list.splice( index, 1 );
1095
- // Handle firing indexes
1096
- if ( firing ) {
1097
- if ( index <= firingLength ) {
1098
- firingLength--;
1099
- }
1100
- if ( index <= firingIndex ) {
1101
- firingIndex--;
1102
- }
1103
- }
1104
- }
1105
- });
1106
- }
1107
- return this;
1108
- },
1109
- // Check if a given callback is in the list.
1110
- // If no argument is given, return whether or not list has callbacks attached.
1111
- has: function( fn ) {
1112
- return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
1113
- },
1114
- // Remove all callbacks from the list
1115
- empty: function() {
1116
- list = [];
1117
- return this;
1118
- },
1119
- // Have the list do nothing anymore
1120
- disable: function() {
1121
- list = stack = memory = undefined;
1122
- return this;
1123
- },
1124
- // Is it disabled?
1125
- disabled: function() {
1126
- return !list;
1127
- },
1128
- // Lock the list in its current state
1129
- lock: function() {
1130
- stack = undefined;
1131
- if ( !memory ) {
1132
- self.disable();
1133
- }
1134
- return this;
1135
- },
1136
- // Is it locked?
1137
- locked: function() {
1138
- return !stack;
1139
- },
1140
- // Call all callbacks with the given context and arguments
1141
- fireWith: function( context, args ) {
1142
- args = args || [];
1143
- args = [ context, args.slice ? args.slice() : args ];
1144
- if ( list && ( !fired || stack ) ) {
1145
- if ( firing ) {
1146
- stack.push( args );
1147
- } else {
1148
- fire( args );
1149
- }
1150
- }
1151
- return this;
1152
- },
1153
- // Call all the callbacks with the given arguments
1154
- fire: function() {
1155
- self.fireWith( this, arguments );
1156
- return this;
1157
- },
1158
- // To know if the callbacks have already been called at least once
1159
- fired: function() {
1160
- return !!fired;
1161
- }
1162
- };
1163
-
1164
- return self;
1165
- };
1166
- jQuery.extend({
1167
-
1168
- Deferred: function( func ) {
1169
- var tuples = [
1170
- // action, add listener, listener list, final state
1171
- [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
1172
- [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
1173
- [ "notify", "progress", jQuery.Callbacks("memory") ]
1174
- ],
1175
- state = "pending",
1176
- promise = {
1177
- state: function() {
1178
- return state;
1179
- },
1180
- always: function() {
1181
- deferred.done( arguments ).fail( arguments );
1182
- return this;
1183
- },
1184
- then: function( /* fnDone, fnFail, fnProgress */ ) {
1185
- var fns = arguments;
1186
- return jQuery.Deferred(function( newDefer ) {
1187
- jQuery.each( tuples, function( i, tuple ) {
1188
- var action = tuple[ 0 ],
1189
- fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
1190
- // deferred[ done | fail | progress ] for forwarding actions to newDefer
1191
- deferred[ tuple[1] ](function() {
1192
- var returned = fn && fn.apply( this, arguments );
1193
- if ( returned && jQuery.isFunction( returned.promise ) ) {
1194
- returned.promise()
1195
- .done( newDefer.resolve )
1196
- .fail( newDefer.reject )
1197
- .progress( newDefer.notify );
1198
- } else {
1199
- newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
1200
- }
1201
- });
1202
- });
1203
- fns = null;
1204
- }).promise();
1205
- },
1206
- // Get a promise for this deferred
1207
- // If obj is provided, the promise aspect is added to the object
1208
- promise: function( obj ) {
1209
- return obj != null ? jQuery.extend( obj, promise ) : promise;
1210
- }
1211
- },
1212
- deferred = {};
1213
-
1214
- // Keep pipe for back-compat
1215
- promise.pipe = promise.then;
1216
-
1217
- // Add list-specific methods
1218
- jQuery.each( tuples, function( i, tuple ) {
1219
- var list = tuple[ 2 ],
1220
- stateString = tuple[ 3 ];
1221
-
1222
- // promise[ done | fail | progress ] = list.add
1223
- promise[ tuple[1] ] = list.add;
1224
-
1225
- // Handle state
1226
- if ( stateString ) {
1227
- list.add(function() {
1228
- // state = [ resolved | rejected ]
1229
- state = stateString;
1230
-
1231
- // [ reject_list | resolve_list ].disable; progress_list.lock
1232
- }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
1233
- }
1234
-
1235
- // deferred[ resolve | reject | notify ]
1236
- deferred[ tuple[0] ] = function() {
1237
- deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
1238
- return this;
1239
- };
1240
- deferred[ tuple[0] + "With" ] = list.fireWith;
1241
- });
1242
-
1243
- // Make the deferred a promise
1244
- promise.promise( deferred );
1245
-
1246
- // Call given func if any
1247
- if ( func ) {
1248
- func.call( deferred, deferred );
1249
- }
1250
-
1251
- // All done!
1252
- return deferred;
1253
- },
1254
-
1255
- // Deferred helper
1256
- when: function( subordinate /* , ..., subordinateN */ ) {
1257
- var i = 0,
1258
- resolveValues = core_slice.call( arguments ),
1259
- length = resolveValues.length,
1260
-
1261
- // the count of uncompleted subordinates
1262
- remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
1263
-
1264
- // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
1265
- deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
1266
-
1267
- // Update function for both resolve and progress values
1268
- updateFunc = function( i, contexts, values ) {
1269
- return function( value ) {
1270
- contexts[ i ] = this;
1271
- values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
1272
- if( values === progressValues ) {
1273
- deferred.notifyWith( contexts, values );
1274
- } else if ( !( --remaining ) ) {
1275
- deferred.resolveWith( contexts, values );
1276
- }
1277
- };
1278
- },
1279
-
1280
- progressValues, progressContexts, resolveContexts;
1281
-
1282
- // add listeners to Deferred subordinates; treat others as resolved
1283
- if ( length > 1 ) {
1284
- progressValues = new Array( length );
1285
- progressContexts = new Array( length );
1286
- resolveContexts = new Array( length );
1287
- for ( ; i < length; i++ ) {
1288
- if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
1289
- resolveValues[ i ].promise()
1290
- .done( updateFunc( i, resolveContexts, resolveValues ) )
1291
- .fail( deferred.reject )
1292
- .progress( updateFunc( i, progressContexts, progressValues ) );
1293
- } else {
1294
- --remaining;
1295
- }
1296
- }
1297
- }
1298
-
1299
- // if we're not waiting on anything, resolve the master
1300
- if ( !remaining ) {
1301
- deferred.resolveWith( resolveContexts, resolveValues );
1302
- }
1303
-
1304
- return deferred.promise();
1305
- }
1306
- });
1307
- jQuery.support = (function() {
1308
-
1309
- var support, all, a,
1310
- input, select, fragment,
1311
- opt, eventName, isSupported, i,
1312
- div = document.createElement("div");
1313
-
1314
- // Setup
1315
- div.setAttribute( "className", "t" );
1316
- div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
1317
-
1318
- // Support tests won't run in some limited or non-browser environments
1319
- all = div.getElementsByTagName("*");
1320
- a = div.getElementsByTagName("a")[ 0 ];
1321
- if ( !all || !a || !all.length ) {
1322
- return {};
1323
- }
1324
-
1325
- // First batch of tests
1326
- select = document.createElement("select");
1327
- opt = select.appendChild( document.createElement("option") );
1328
- input = div.getElementsByTagName("input")[ 0 ];
1329
-
1330
- a.style.cssText = "top:1px;float:left;opacity:.5";
1331
- support = {
1332
- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
1333
- getSetAttribute: div.className !== "t",
1334
-
1335
- // IE strips leading whitespace when .innerHTML is used
1336
- leadingWhitespace: div.firstChild.nodeType === 3,
1337
-
1338
- // Make sure that tbody elements aren't automatically inserted
1339
- // IE will insert them into empty tables
1340
- tbody: !div.getElementsByTagName("tbody").length,
1341
-
1342
- // Make sure that link elements get serialized correctly by innerHTML
1343
- // This requires a wrapper element in IE
1344
- htmlSerialize: !!div.getElementsByTagName("link").length,
1345
-
1346
- // Get the style information from getAttribute
1347
- // (IE uses .cssText instead)
1348
- style: /top/.test( a.getAttribute("style") ),
1349
-
1350
- // Make sure that URLs aren't manipulated
1351
- // (IE normalizes it by default)
1352
- hrefNormalized: a.getAttribute("href") === "/a",
1353
-
1354
- // Make sure that element opacity exists
1355
- // (IE uses filter instead)
1356
- // Use a regex to work around a WebKit issue. See #5145
1357
- opacity: /^0.5/.test( a.style.opacity ),
1358
-
1359
- // Verify style float existence
1360
- // (IE uses styleFloat instead of cssFloat)
1361
-
1362
-
1363
- cssFloat: !!a.style.cssFloat,
1364
-
1365
- // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
1366
- checkOn: !!input.value,
1367
-
1368
- // Make sure that a selected-by-default option has a working selected property.
1369
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1370
- optSelected: opt.selected,
1371
-
1372
- // Tests for enctype support on a form (#6743)
1373
- enctype: !!document.createElement("form").enctype,
1374
-
1375
- // Makes sure cloning an html5 element does not cause problems
1376
- // Where outerHTML is undefined, this still works
1377
- html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
1378
-
1379
- // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
1380
- boxModel: document.compatMode === "CSS1Compat",
1381
-
1382
- // Will be defined later
1383
- deleteExpando: true,
1384
- noCloneEvent: true,
1385
- inlineBlockNeedsLayout: false,
1386
- shrinkWrapBlocks: false,
1387
- reliableMarginRight: true,
1388
- boxSizingReliable: true,
1389
- pixelPosition: false
1390
- };
1391
-
1392
- // Make sure checked status is properly cloned
1393
- input.checked = true;
1394
- support.noCloneChecked = input.cloneNode( true ).checked;
1395
-
1396
- // Make sure that the options inside disabled selects aren't marked as disabled
1397
- // (WebKit marks them as disabled)
1398
- select.disabled = true;
1399
- support.optDisabled = !opt.disabled;
1400
-
1401
- // Support: IE<9
1402
- try {
1403
- delete div.test;
1404
- } catch( e ) {
1405
- support.deleteExpando = false;
1406
- }
1407
-
1408
- // Check if we can trust getAttribute("value")
1409
- input = document.createElement("input");
1410
- input.setAttribute( "value", "" );
1411
- support.input = input.getAttribute( "value" ) === "";
1412
-
1413
- // Check if an input maintains its value after becoming a radio
1414
- input.value = "t";
1415
- input.setAttribute( "type", "radio" );
1416
- support.radioValue = input.value === "t";
1417
-
1418
- // #11217 - WebKit loses check when the name is after the checked attribute
1419
- input.setAttribute( "checked", "t" );
1420
- input.setAttribute( "name", "t" );
1421
-
1422
- fragment = document.createDocumentFragment();
1423
- fragment.appendChild( input );
1424
-
1425
- // Check if a disconnected checkbox will retain its checked
1426
- // value of true after appended to the DOM (IE6/7)
1427
- support.appendChecked = input.checked;
1428
-
1429
- // WebKit doesn't clone checked state correctly in fragments
1430
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
1431
-
1432
- // Support: IE<9
1433
- // Opera does not clone events (and typeof div.attachEvent === undefined).
1434
- // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
1435
- if ( div.attachEvent ) {
1436
- div.attachEvent( "onclick", function() {
1437
- support.noCloneEvent = false;
1438
- });
1439
-
1440
- div.cloneNode( true ).click();
1441
- }
1442
-
1443
- // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
1444
- // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
1445
- for ( i in { submit: true, change: true, focusin: true }) {
1446
- div.setAttribute( eventName = "on" + i, "t" );
1447
-
1448
- support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
1449
- }
1450
-
1451
- div.style.backgroundClip = "content-box";
1452
- div.cloneNode( true ).style.backgroundClip = "";
1453
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
1454
-
1455
- // Run tests that need a body at doc ready
1456
- jQuery(function() {
1457
- var container, marginDiv, tds,
1458
- divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
1459
- body = document.getElementsByTagName("body")[0];
1460
-
1461
- if ( !body ) {
1462
- // Return for frameset docs that don't have a body
1463
- return;
1464
- }
1465
-
1466
- container = document.createElement("div");
1467
- container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
1468
-
1469
- body.appendChild( container ).appendChild( div );
1470
-
1471
- // Support: IE8
1472
- // Check if table cells still have offsetWidth/Height when they are set
1473
- // to display:none and there are still other visible table cells in a
1474
- // table row; if so, offsetWidth/Height are not reliable for use when
1475
- // determining if an element has been hidden directly using
1476
- // display:none (it is still safe to use offsets if a parent element is
1477
- // hidden; don safety goggles and see bug #4512 for more information).
1478
- div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
1479
- tds = div.getElementsByTagName("td");
1480
- tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
1481
- isSupported = ( tds[ 0 ].offsetHeight === 0 );
1482
-
1483
- tds[ 0 ].style.display = "";
1484
- tds[ 1 ].style.display = "none";
1485
-
1486
- // Support: IE8
1487
- // Check if empty table cells still have offsetWidth/Height
1488
- support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
1489
-
1490
- // Check box-sizing and margin behavior
1491
- div.innerHTML = "";
1492
- div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
1493
- support.boxSizing = ( div.offsetWidth === 4 );
1494
- support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
1495
-
1496
- // Use window.getComputedStyle because jsdom on node.js will break without it.
1497
- if ( window.getComputedStyle ) {
1498
- support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
1499
- support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
1500
-
1501
- // Check if div with explicit width and no margin-right incorrectly
1502
- // gets computed margin-right based on width of container. (#3333)
1503
- // Fails in WebKit before Feb 2011 nightlies
1504
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1505
- marginDiv = div.appendChild( document.createElement("div") );
1506
- marginDiv.style.cssText = div.style.cssText = divReset;
1507
- marginDiv.style.marginRight = marginDiv.style.width = "0";
1508
- div.style.width = "1px";
1509
-
1510
- support.reliableMarginRight =
1511
- !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
1512
- }
1513
-
1514
- if ( typeof div.style.zoom !== core_strundefined ) {
1515
- // Support: IE<8
1516
- // Check if natively block-level elements act like inline-block
1517
- // elements when setting their display to 'inline' and giving
1518
- // them layout
1519
- div.innerHTML = "";
1520
- div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
1521
- support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
1522
-
1523
- // Support: IE6
1524
- // Check if elements with layout shrink-wrap their children
1525
- div.style.display = "block";
1526
- div.innerHTML = "<div></div>";
1527
- div.firstChild.style.width = "5px";
1528
- support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
1529
-
1530
- if ( support.inlineBlockNeedsLayout ) {
1531
- // Prevent IE 6 from affecting layout for positioned elements #11048
1532
- // Prevent IE from shrinking the body in IE 7 mode #12869
1533
- // Support: IE<8
1534
- body.style.zoom = 1;
1535
- }
1536
- }
1537
-
1538
- body.removeChild( container );
1539
-
1540
- // Null elements to avoid leaks in IE
1541
- container = div = tds = marginDiv = null;
1542
- });
1543
-
1544
- // Null elements to avoid leaks in IE
1545
- all = select = fragment = opt = a = input = null;
1546
-
1547
- return support;
1548
- })();
1549
-
1550
- var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
1551
- rmultiDash = /([A-Z])/g;
1552
-
1553
- function internalData( elem, name, data, pvt /* Internal Use Only */ ){
1554
- if ( !jQuery.acceptData( elem ) ) {
1555
- return;
1556
- }
1557
-
1558
- var thisCache, ret,
1559
- internalKey = jQuery.expando,
1560
- getByName = typeof name === "string",
1561
-
1562
- // We have to handle DOM nodes and JS objects differently because IE6-7
1563
- // can't GC object references properly across the DOM-JS boundary
1564
- isNode = elem.nodeType,
1565
-
1566
- // Only DOM nodes need the global jQuery cache; JS object data is
1567
- // attached directly to the object so GC can occur automatically
1568
- cache = isNode ? jQuery.cache : elem,
1569
-
1570
- // Only defining an ID for JS objects if its cache already exists allows
1571
- // the code to shortcut on the same path as a DOM node with no cache
1572
- id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
1573
-
1574
- // Avoid doing any more work than we need to when trying to get data on an
1575
- // object that has no data at all
1576
- if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
1577
- return;
1578
- }
1579
-
1580
- if ( !id ) {
1581
- // Only DOM nodes need a new unique ID for each element since their data
1582
- // ends up in the global cache
1583
- if ( isNode ) {
1584
- elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
1585
- } else {
1586
- id = internalKey;
1587
- }
1588
- }
1589
-
1590
- if ( !cache[ id ] ) {
1591
- cache[ id ] = {};
1592
-
1593
- // Avoids exposing jQuery metadata on plain JS objects when the object
1594
- // is serialized using JSON.stringify
1595
- if ( !isNode ) {
1596
- cache[ id ].toJSON = jQuery.noop;
1597
- }
1598
- }
1599
-
1600
- // An object can be passed to jQuery.data instead of a key/value pair; this gets
1601
- // shallow copied over onto the existing cache
1602
- if ( typeof name === "object" || typeof name === "function" ) {
1603
- if ( pvt ) {
1604
- cache[ id ] = jQuery.extend( cache[ id ], name );
1605
- } else {
1606
- cache[ id ].data = jQuery.extend( cache[ id ].data, name );
1607
- }
1608
- }
1609
-
1610
- thisCache = cache[ id ];
1611
-
1612
- // jQuery data() is stored in a separate object inside the object's internal data
1613
- // cache in order to avoid key collisions between internal data and user-defined
1614
- // data.
1615
- if ( !pvt ) {
1616
- if ( !thisCache.data ) {
1617
- thisCache.data = {};
1618
- }
1619
-
1620
- thisCache = thisCache.data;
1621
- }
1622
-
1623
- if ( data !== undefined ) {
1624
- thisCache[ jQuery.camelCase( name ) ] = data;
1625
- }
1626
-
1627
- // Check for both converted-to-camel and non-converted data property names
1628
- // If a data property was specified
1629
- if ( getByName ) {
1630
-
1631
- // First Try to find as-is property data
1632
- ret = thisCache[ name ];
1633
-
1634
- // Test for null|undefined property data
1635
- if ( ret == null ) {
1636
-
1637
- // Try to find the camelCased property
1638
- ret = thisCache[ jQuery.camelCase( name ) ];
1639
- }
1640
- } else {
1641
- ret = thisCache;
1642
- }
1643
-
1644
- return ret;
1645
- }
1646
-
1647
- function internalRemoveData( elem, name, pvt ) {
1648
- if ( !jQuery.acceptData( elem ) ) {
1649
- return;
1650
- }
1651
-
1652
- var i, l, thisCache,
1653
- isNode = elem.nodeType,
1654
-
1655
- // See jQuery.data for more information
1656
- cache = isNode ? jQuery.cache : elem,
1657
- id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
1658
-
1659
- // If there is already no cache entry for this object, there is no
1660
- // purpose in continuing
1661
- if ( !cache[ id ] ) {
1662
- return;
1663
- }
1664
-
1665
- if ( name ) {
1666
-
1667
- thisCache = pvt ? cache[ id ] : cache[ id ].data;
1668
-
1669
- if ( thisCache ) {
1670
-
1671
- // Support array or space separated string names for data keys
1672
- if ( !jQuery.isArray( name ) ) {
1673
-
1674
- // try the string as a key before any manipulation
1675
- if ( name in thisCache ) {
1676
- name = [ name ];
1677
- } else {
1678
-
1679
- // split the camel cased version by spaces unless a key with the spaces exists
1680
- name = jQuery.camelCase( name );
1681
- if ( name in thisCache ) {
1682
- name = [ name ];
1683
- } else {
1684
- name = name.split(" ");
1685
- }
1686
- }
1687
- } else {
1688
- // If "name" is an array of keys...
1689
- // When data is initially created, via ("key", "val") signature,
1690
- // keys will be converted to camelCase.
1691
- // Since there is no way to tell _how_ a key was added, remove
1692
- // both plain key and camelCase key. #12786
1693
- // This will only penalize the array argument path.
1694
- name = name.concat( jQuery.map( name, jQuery.camelCase ) );
1695
- }
1696
-
1697
- for ( i = 0, l = name.length; i < l; i++ ) {
1698
- delete thisCache[ name[i] ];
1699
- }
1700
-
1701
- // If there is no data left in the cache, we want to continue
1702
- // and let the cache object itself get destroyed
1703
- if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
1704
- return;
1705
- }
1706
- }
1707
- }
1708
-
1709
- // See jQuery.data for more information
1710
- if ( !pvt ) {
1711
- delete cache[ id ].data;
1712
-
1713
- // Don't destroy the parent cache unless the internal data object
1714
- // had been the only thing left in it
1715
- if ( !isEmptyDataObject( cache[ id ] ) ) {
1716
- return;
1717
- }
1718
- }
1719
-
1720
- // Destroy the cache
1721
- if ( isNode ) {
1722
- jQuery.cleanData( [ elem ], true );
1723
-
1724
- // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
1725
- } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
1726
- delete cache[ id ];
1727
-
1728
- // When all else fails, null
1729
- } else {
1730
- cache[ id ] = null;
1731
- }
1732
- }
1733
-
1734
- jQuery.extend({
1735
- cache: {},
1736
-
1737
- // Unique for each copy of jQuery on the page
1738
- // Non-digits removed to match rinlinejQuery
1739
- expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
1740
-
1741
- // The following elements throw uncatchable exceptions if you
1742
- // attempt to add expando properties to them.
1743
- noData: {
1744
- "embed": true,
1745
- // Ban all objects except for Flash (which handle expandos)
1746
- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
1747
- "applet": true
1748
- },
1749
-
1750
- hasData: function( elem ) {
1751
- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1752
- return !!elem && !isEmptyDataObject( elem );
1753
- },
1754
-
1755
- data: function( elem, name, data ) {
1756
- return internalData( elem, name, data );
1757
- },
1758
-
1759
- removeData: function( elem, name ) {
1760
- return internalRemoveData( elem, name );
1761
- },
1762
-
1763
- // For internal use only.
1764
- _data: function( elem, name, data ) {
1765
- return internalData( elem, name, data, true );
1766
- },
1767
-
1768
- _removeData: function( elem, name ) {
1769
- return internalRemoveData( elem, name, true );
1770
- },
1771
-
1772
- // A method for determining if a DOM node can handle the data expando
1773
- acceptData: function( elem ) {
1774
- // Do not set data on non-element because it will not be cleared (#8335).
1775
- if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
1776
- return false;
1777
- }
1778
-
1779
- var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
1780
-
1781
- // nodes accept data unless otherwise specified; rejection can be conditional
1782
- return !noData || noData !== true && elem.getAttribute("classid") === noData;
1783
- }
1784
- });
1785
-
1786
- jQuery.fn.extend({
1787
- data: function( key, value ) {
1788
- var attrs, name,
1789
- elem = this[0],
1790
- i = 0,
1791
- data = null;
1792
-
1793
- // Gets all values
1794
- if ( key === undefined ) {
1795
- if ( this.length ) {
1796
- data = jQuery.data( elem );
1797
-
1798
- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
1799
- attrs = elem.attributes;
1800
- for ( ; i < attrs.length; i++ ) {
1801
- name = attrs[i].name;
1802
-
1803
- if ( !name.indexOf( "data-" ) ) {
1804
- name = jQuery.camelCase( name.slice(5) );
1805
-
1806
- dataAttr( elem, name, data[ name ] );
1807
- }
1808
- }
1809
- jQuery._data( elem, "parsedAttrs", true );
1810
- }
1811
- }
1812
-
1813
- return data;
1814
- }
1815
-
1816
- // Sets multiple values
1817
- if ( typeof key === "object" ) {
1818
- return this.each(function() {
1819
- jQuery.data( this, key );
1820
- });
1821
- }
1822
-
1823
- return jQuery.access( this, function( value ) {
1824
-
1825
- if ( value === undefined ) {
1826
- // Try to fetch any internally stored data first
1827
- return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
1828
- }
1829
-
1830
- this.each(function() {
1831
- jQuery.data( this, key, value );
1832
- });
1833
- }, null, value, arguments.length > 1, null, true );
1834
- },
1835
-
1836
- removeData: function( key ) {
1837
- return this.each(function() {
1838
- jQuery.removeData( this, key );
1839
- });
1840
- }
1841
- });
1842
-
1843
- function dataAttr( elem, key, data ) {
1844
- // If nothing was found internally, try to fetch any
1845
- // data from the HTML5 data-* attribute
1846
- if ( data === undefined && elem.nodeType === 1 ) {
1847
-
1848
- var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
1849
-
1850
- data = elem.getAttribute( name );
1851
-
1852
- if ( typeof data === "string" ) {
1853
- try {
1854
- data = data === "true" ? true :
1855
- data === "false" ? false :
1856
- data === "null" ? null :
1857
- // Only convert to a number if it doesn't change the string
1858
- +data + "" === data ? +data :
1859
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
1860
- data;
1861
- } catch( e ) {}
1862
-
1863
- // Make sure we set the data so it isn't changed later
1864
- jQuery.data( elem, key, data );
1865
-
1866
- } else {
1867
- data = undefined;
1868
- }
1869
- }
1870
-
1871
- return data;
1872
- }
1873
-
1874
- // checks a cache object for emptiness
1875
- function isEmptyDataObject( obj ) {
1876
- var name;
1877
- for ( name in obj ) {
1878
-
1879
- // if the public data object is empty, the private is still empty
1880
- if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
1881
- continue;
1882
- }
1883
- if ( name !== "toJSON" ) {
1884
- return false;
1885
- }
1886
- }
1887
-
1888
- return true;
1889
- }
1890
- jQuery.extend({
1891
- queue: function( elem, type, data ) {
1892
- var queue;
1893
-
1894
- if ( elem ) {
1895
- type = ( type || "fx" ) + "queue";
1896
- queue = jQuery._data( elem, type );
1897
-
1898
- // Speed up dequeue by getting out quickly if this is just a lookup
1899
- if ( data ) {
1900
- if ( !queue || jQuery.isArray(data) ) {
1901
- queue = jQuery._data( elem, type, jQuery.makeArray(data) );
1902
- } else {
1903
- queue.push( data );
1904
- }
1905
- }
1906
- return queue || [];
1907
- }
1908
- },
1909
-
1910
- dequeue: function( elem, type ) {
1911
- type = type || "fx";
1912
-
1913
- var queue = jQuery.queue( elem, type ),
1914
- startLength = queue.length,
1915
- fn = queue.shift(),
1916
- hooks = jQuery._queueHooks( elem, type ),
1917
- next = function() {
1918
- jQuery.dequeue( elem, type );
1919
- };
1920
-
1921
- // If the fx queue is dequeued, always remove the progress sentinel
1922
- if ( fn === "inprogress" ) {
1923
- fn = queue.shift();
1924
- startLength--;
1925
- }
1926
-
1927
- hooks.cur = fn;
1928
- if ( fn ) {
1929
-
1930
- // Add a progress sentinel to prevent the fx queue from being
1931
- // automatically dequeued
1932
- if ( type === "fx" ) {
1933
- queue.unshift( "inprogress" );
1934
- }
1935
-
1936
- // clear up the last queue stop function
1937
- delete hooks.stop;
1938
- fn.call( elem, next, hooks );
1939
- }
1940
-
1941
- if ( !startLength && hooks ) {
1942
- hooks.empty.fire();
1943
- }
1944
- },
1945
-
1946
- // not intended for public consumption - generates a queueHooks object, or returns the current one
1947
- _queueHooks: function( elem, type ) {
1948
- var key = type + "queueHooks";
1949
- return jQuery._data( elem, key ) || jQuery._data( elem, key, {
1950
- empty: jQuery.Callbacks("once memory").add(function() {
1951
- jQuery._removeData( elem, type + "queue" );
1952
- jQuery._removeData( elem, key );
1953
- })
1954
- });
1955
- }
1956
- });
1957
-
1958
- jQuery.fn.extend({
1959
- queue: function( type, data ) {
1960
- var setter = 2;
1961
-
1962
- if ( typeof type !== "string" ) {
1963
- data = type;
1964
- type = "fx";
1965
- setter--;
1966
- }
1967
-
1968
- if ( arguments.length < setter ) {
1969
- return jQuery.queue( this[0], type );
1970
- }
1971
-
1972
- return data === undefined ?
1973
- this :
1974
- this.each(function() {
1975
- var queue = jQuery.queue( this, type, data );
1976
-
1977
- // ensure a hooks for this queue
1978
- jQuery._queueHooks( this, type );
1979
-
1980
- if ( type === "fx" && queue[0] !== "inprogress" ) {
1981
- jQuery.dequeue( this, type );
1982
- }
1983
- });
1984
- },
1985
- dequeue: function( type ) {
1986
- return this.each(function() {
1987
- jQuery.dequeue( this, type );
1988
- });
1989
- },
1990
- // Based off of the plugin by Clint Helfers, with permission.
1991
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
1992
- delay: function( time, type ) {
1993
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
1994
- type = type || "fx";
1995
-
1996
- return this.queue( type, function( next, hooks ) {
1997
- var timeout = setTimeout( next, time );
1998
- hooks.stop = function() {
1999
- clearTimeout( timeout );
2000
- };
2001
- });
2002
- },
2003
- clearQueue: function( type ) {
2004
- return this.queue( type || "fx", [] );
2005
- },
2006
- // Get a promise resolved when queues of a certain type
2007
- // are emptied (fx is the type by default)
2008
- promise: function( type, obj ) {
2009
- var tmp,
2010
- count = 1,
2011
- defer = jQuery.Deferred(),
2012
- elements = this,
2013
- i = this.length,
2014
- resolve = function() {
2015
- if ( !( --count ) ) {
2016
- defer.resolveWith( elements, [ elements ] );
2017
- }
2018
- };
2019
-
2020
- if ( typeof type !== "string" ) {
2021
- obj = type;
2022
- type = undefined;
2023
- }
2024
- type = type || "fx";
2025
-
2026
- while( i-- ) {
2027
- tmp = jQuery._data( elements[ i ], type + "queueHooks" );
2028
- if ( tmp && tmp.empty ) {
2029
- count++;
2030
- tmp.empty.add( resolve );
2031
- }
2032
- }
2033
- resolve();
2034
- return defer.promise( obj );
2035
- }
2036
- });
2037
- var nodeHook, boolHook,
2038
- rclass = /[\t\r\n]/g,
2039
- rreturn = /\r/g,
2040
- rfocusable = /^(?:input|select|textarea|button|object)$/i,
2041
- rclickable = /^(?:a|area)$/i,
2042
- rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
2043
- ruseDefault = /^(?:checked|selected)$/i,
2044
- getSetAttribute = jQuery.support.getSetAttribute,
2045
- getSetInput = jQuery.support.input;
2046
-
2047
- jQuery.fn.extend({
2048
- attr: function( name, value ) {
2049
- return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
2050
- },
2051
-
2052
- removeAttr: function( name ) {
2053
- return this.each(function() {
2054
- jQuery.removeAttr( this, name );
2055
- });
2056
- },
2057
-
2058
- prop: function( name, value ) {
2059
- return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
2060
- },
2061
-
2062
- removeProp: function( name ) {
2063
- name = jQuery.propFix[ name ] || name;
2064
- return this.each(function() {
2065
- // try/catch handles cases where IE balks (such as removing a property on window)
2066
- try {
2067
- this[ name ] = undefined;
2068
- delete this[ name ];
2069
- } catch( e ) {}
2070
- });
2071
- },
2072
-
2073
- addClass: function( value ) {
2074
- var classes, elem, cur, clazz, j,
2075
- i = 0,
2076
- len = this.length,
2077
- proceed = typeof value === "string" && value;
2078
-
2079
- if ( jQuery.isFunction( value ) ) {
2080
- return this.each(function( j ) {
2081
- jQuery( this ).addClass( value.call( this, j, this.className ) );
2082
- });
2083
- }
2084
-
2085
- if ( proceed ) {
2086
- // The disjunction here is for better compressibility (see removeClass)
2087
- classes = ( value || "" ).match( core_rnotwhite ) || [];
2088
-
2089
- for ( ; i < len; i++ ) {
2090
- elem = this[ i ];
2091
- cur = elem.nodeType === 1 && ( elem.className ?
2092
- ( " " + elem.className + " " ).replace( rclass, " " ) :
2093
- " "
2094
- );
2095
-
2096
- if ( cur ) {
2097
- j = 0;
2098
- while ( (clazz = classes[j++]) ) {
2099
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
2100
- cur += clazz + " ";
2101
- }
2102
- }
2103
- elem.className = jQuery.trim( cur );
2104
-
2105
- }
2106
- }
2107
- }
2108
-
2109
- return this;
2110
- },
2111
-
2112
- removeClass: function( value ) {
2113
- var classes, elem, cur, clazz, j,
2114
- i = 0,
2115
- len = this.length,
2116
- proceed = arguments.length === 0 || typeof value === "string" && value;
2117
-
2118
- if ( jQuery.isFunction( value ) ) {
2119
- return this.each(function( j ) {
2120
- jQuery( this ).removeClass( value.call( this, j, this.className ) );
2121
- });
2122
- }
2123
- if ( proceed ) {
2124
- classes = ( value || "" ).match( core_rnotwhite ) || [];
2125
-
2126
- for ( ; i < len; i++ ) {
2127
- elem = this[ i ];
2128
- // This expression is here for better compressibility (see addClass)
2129
- cur = elem.nodeType === 1 && ( elem.className ?
2130
- ( " " + elem.className + " " ).replace( rclass, " " ) :
2131
- ""
2132
- );
2133
-
2134
- if ( cur ) {
2135
- j = 0;
2136
- while ( (clazz = classes[j++]) ) {
2137
- // Remove *all* instances
2138
- while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
2139
- cur = cur.replace( " " + clazz + " ", " " );
2140
- }
2141
- }
2142
- elem.className = value ? jQuery.trim( cur ) : "";
2143
- }
2144
- }
2145
- }
2146
-
2147
- return this;
2148
- },
2149
-
2150
- toggleClass: function( value, stateVal ) {
2151
- var type = typeof value,
2152
- isBool = typeof stateVal === "boolean";
2153
-
2154
- if ( jQuery.isFunction( value ) ) {
2155
- return this.each(function( i ) {
2156
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
2157
- });
2158
- }
2159
-
2160
- return this.each(function() {
2161
- if ( type === "string" ) {
2162
- // toggle individual class names
2163
- var className,
2164
- i = 0,
2165
- self = jQuery( this ),
2166
- state = stateVal,
2167
- classNames = value.match( core_rnotwhite ) || [];
2168
-
2169
- while ( (className = classNames[ i++ ]) ) {
2170
- // check each className given, space separated list
2171
- state = isBool ? state : !self.hasClass( className );
2172
- self[ state ? "addClass" : "removeClass" ]( className );
2173
- }
2174
-
2175
- // Toggle whole class name
2176
- } else if ( type === core_strundefined || type === "boolean" ) {
2177
- if ( this.className ) {
2178
- // store className if set
2179
- jQuery._data( this, "__className__", this.className );
2180
- }
2181
-
2182
- // If the element has a class name or if we're passed "false",
2183
- // then remove the whole classname (if there was one, the above saved it).
2184
- // Otherwise bring back whatever was previously saved (if anything),
2185
- // falling back to the empty string if nothing was stored.
2186
- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
2187
- }
2188
- });
2189
- },
2190
-
2191
- hasClass: function( selector ) {
2192
- var className = " " + selector + " ",
2193
- i = 0,
2194
- l = this.length;
2195
- for ( ; i < l; i++ ) {
2196
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
2197
- return true;
2198
- }
2199
- }
2200
-
2201
- return false;
2202
- },
2203
-
2204
- val: function( value ) {
2205
- var ret, hooks, isFunction,
2206
- elem = this[0];
2207
-
2208
- if ( !arguments.length ) {
2209
- if ( elem ) {
2210
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
2211
-
2212
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
2213
- return ret;
2214
- }
2215
-
2216
- ret = elem.value;
2217
-
2218
- return typeof ret === "string" ?
2219
- // handle most common string cases
2220
- ret.replace(rreturn, "") :
2221
- // handle cases where value is null/undef or number
2222
- ret == null ? "" : ret;
2223
- }
2224
-
2225
- return;
2226
- }
2227
-
2228
- isFunction = jQuery.isFunction( value );
2229
-
2230
- return this.each(function( i ) {
2231
- var val,
2232
- self = jQuery(this);
2233
-
2234
- if ( this.nodeType !== 1 ) {
2235
- return;
2236
- }
2237
-
2238
- if ( isFunction ) {
2239
- val = value.call( this, i, self.val() );
2240
- } else {
2241
- val = value;
2242
- }
2243
-
2244
- // Treat null/undefined as ""; convert numbers to string
2245
- if ( val == null ) {
2246
- val = "";
2247
- } else if ( typeof val === "number" ) {
2248
- val += "";
2249
- } else if ( jQuery.isArray( val ) ) {
2250
- val = jQuery.map(val, function ( value ) {
2251
- return value == null ? "" : value + "";
2252
- });
2253
- }
2254
-
2255
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
2256
-
2257
- // If set returns undefined, fall back to normal setting
2258
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
2259
- this.value = val;
2260
- }
2261
- });
2262
- }
2263
- });
2264
-
2265
- jQuery.extend({
2266
- valHooks: {
2267
- option: {
2268
- get: function( elem ) {
2269
- // attributes.value is undefined in Blackberry 4.7 but
2270
- // uses .value. See #6932
2271
- var val = elem.attributes.value;
2272
- return !val || val.specified ? elem.value : elem.text;
2273
- }
2274
- },
2275
- select: {
2276
- get: function( elem ) {
2277
- var value, option,
2278
- options = elem.options,
2279
- index = elem.selectedIndex,
2280
- one = elem.type === "select-one" || index < 0,
2281
- values = one ? null : [],
2282
- max = one ? index + 1 : options.length,
2283
- i = index < 0 ?
2284
- max :
2285
- one ? index : 0;
2286
-
2287
- // Loop through all the selected options
2288
- for ( ; i < max; i++ ) {
2289
- option = options[ i ];
2290
-
2291
- // oldIE doesn't update selected after form reset (#2551)
2292
- if ( ( option.selected || i === index ) &&
2293
- // Don't return options that are disabled or in a disabled optgroup
2294
- ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
2295
- ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
2296
-
2297
- // Get the specific value for the option
2298
- value = jQuery( option ).val();
2299
-
2300
- // We don't need an array for one selects
2301
- if ( one ) {
2302
- return value;
2303
- }
2304
-
2305
- // Multi-Selects return an array
2306
- values.push( value );
2307
- }
2308
- }
2309
-
2310
- return values;
2311
- },
2312
-
2313
- set: function( elem, value ) {
2314
- var values = jQuery.makeArray( value );
2315
-
2316
- jQuery(elem).find("option").each(function() {
2317
- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
2318
- });
2319
-
2320
- if ( !values.length ) {
2321
- elem.selectedIndex = -1;
2322
- }
2323
- return values;
2324
- }
2325
- }
2326
- },
2327
-
2328
- attr: function( elem, name, value ) {
2329
- var hooks, notxml, ret,
2330
- nType = elem.nodeType;
2331
-
2332
- // don't get/set attributes on text, comment and attribute nodes
2333
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2334
- return;
2335
- }
2336
-
2337
- // Fallback to prop when attributes are not supported
2338
- if ( typeof elem.getAttribute === core_strundefined ) {
2339
- return jQuery.prop( elem, name, value );
2340
- }
2341
-
2342
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2343
-
2344
- // All attributes are lowercase
2345
- // Grab necessary hook if one is defined
2346
- if ( notxml ) {
2347
- name = name.toLowerCase();
2348
- hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
2349
- }
2350
-
2351
- if ( value !== undefined ) {
2352
-
2353
- if ( value === null ) {
2354
- jQuery.removeAttr( elem, name );
2355
-
2356
- } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
2357
- return ret;
2358
-
2359
- } else {
2360
- elem.setAttribute( name, value + "" );
2361
- return value;
2362
- }
2363
-
2364
- } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
2365
- return ret;
2366
-
2367
- } else {
2368
-
2369
- // In IE9+, Flash objects don't have .getAttribute (#12945)
2370
- // Support: IE9+
2371
- if ( typeof elem.getAttribute !== core_strundefined ) {
2372
- ret = elem.getAttribute( name );
2373
- }
2374
-
2375
- // Non-existent attributes return null, we normalize to undefined
2376
- return ret == null ?
2377
- undefined :
2378
- ret;
2379
- }
2380
- },
2381
-
2382
- removeAttr: function( elem, value ) {
2383
- var name, propName,
2384
- i = 0,
2385
- attrNames = value && value.match( core_rnotwhite );
2386
-
2387
- if ( attrNames && elem.nodeType === 1 ) {
2388
- while ( (name = attrNames[i++]) ) {
2389
- propName = jQuery.propFix[ name ] || name;
2390
-
2391
- // Boolean attributes get special treatment (#10870)
2392
- if ( rboolean.test( name ) ) {
2393
- // Set corresponding property to false for boolean attributes
2394
- // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
2395
- if ( !getSetAttribute && ruseDefault.test( name ) ) {
2396
- elem[ jQuery.camelCase( "default-" + name ) ] =
2397
- elem[ propName ] = false;
2398
- } else {
2399
- elem[ propName ] = false;
2400
- }
2401
-
2402
- // See #9699 for explanation of this approach (setting first, then removal)
2403
- } else {
2404
- jQuery.attr( elem, name, "" );
2405
- }
2406
-
2407
- elem.removeAttribute( getSetAttribute ? name : propName );
2408
- }
2409
- }
2410
- },
2411
-
2412
- attrHooks: {
2413
- type: {
2414
- set: function( elem, value ) {
2415
- if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
2416
- // Setting the type on a radio button after the value resets the value in IE6-9
2417
- // Reset value to default in case type is set after value during creation
2418
- var val = elem.value;
2419
- elem.setAttribute( "type", value );
2420
- if ( val ) {
2421
- elem.value = val;
2422
- }
2423
- return value;
2424
- }
2425
- }
2426
- }
2427
- },
2428
-
2429
- propFix: {
2430
- tabindex: "tabIndex",
2431
- readonly: "readOnly",
2432
- "for": "htmlFor",
2433
- "class": "className",
2434
- maxlength: "maxLength",
2435
- cellspacing: "cellSpacing",
2436
- cellpadding: "cellPadding",
2437
- rowspan: "rowSpan",
2438
- colspan: "colSpan",
2439
- usemap: "useMap",
2440
- frameborder: "frameBorder",
2441
- contenteditable: "contentEditable"
2442
- },
2443
-
2444
- prop: function( elem, name, value ) {
2445
- var ret, hooks, notxml,
2446
- nType = elem.nodeType;
2447
-
2448
- // don't get/set properties on text, comment and attribute nodes
2449
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2450
- return;
2451
- }
2452
-
2453
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2454
-
2455
- if ( notxml ) {
2456
- // Fix name and attach hooks
2457
- name = jQuery.propFix[ name ] || name;
2458
- hooks = jQuery.propHooks[ name ];
2459
- }
2460
-
2461
- if ( value !== undefined ) {
2462
- if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
2463
- return ret;
2464
-
2465
- } else {
2466
- return ( elem[ name ] = value );
2467
- }
2468
-
2469
- } else {
2470
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
2471
- return ret;
2472
-
2473
- } else {
2474
- return elem[ name ];
2475
- }
2476
- }
2477
- },
2478
-
2479
- propHooks: {
2480
- tabIndex: {
2481
- get: function( elem ) {
2482
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2483
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2484
- var attributeNode = elem.getAttributeNode("tabindex");
2485
-
2486
- return attributeNode && attributeNode.specified ?
2487
- parseInt( attributeNode.value, 10 ) :
2488
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2489
- 0 :
2490
- undefined;
2491
- }
2492
- }
2493
- }
2494
- });
2495
-
2496
- // Hook for boolean attributes
2497
- boolHook = {
2498
- get: function( elem, name ) {
2499
- var
2500
- // Use .prop to determine if this attribute is understood as boolean
2501
- prop = jQuery.prop( elem, name ),
2502
-
2503
- // Fetch it accordingly
2504
- attr = typeof prop === "boolean" && elem.getAttribute( name ),
2505
- detail = typeof prop === "boolean" ?
2506
-
2507
- getSetInput && getSetAttribute ?
2508
- attr != null :
2509
- // oldIE fabricates an empty string for missing boolean attributes
2510
- // and conflates checked/selected into attroperties
2511
- ruseDefault.test( name ) ?
2512
- elem[ jQuery.camelCase( "default-" + name ) ] :
2513
- !!attr :
2514
-
2515
- // fetch an attribute node for properties not recognized as boolean
2516
- elem.getAttributeNode( name );
2517
-
2518
- return detail && detail.value !== false ?
2519
- name.toLowerCase() :
2520
- undefined;
2521
- },
2522
- set: function( elem, value, name ) {
2523
- if ( value === false ) {
2524
- // Remove boolean attributes when set to false
2525
- jQuery.removeAttr( elem, name );
2526
- } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
2527
- // IE<8 needs the *property* name
2528
- elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
2529
-
2530
- // Use defaultChecked and defaultSelected for oldIE
2531
- } else {
2532
- elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
2533
- }
2534
-
2535
- return name;
2536
- }
2537
- };
2538
-
2539
- // fix oldIE value attroperty
2540
- if ( !getSetInput || !getSetAttribute ) {
2541
- jQuery.attrHooks.value = {
2542
- get: function( elem, name ) {
2543
- var ret = elem.getAttributeNode( name );
2544
- return jQuery.nodeName( elem, "input" ) ?
2545
-
2546
- // Ignore the value *property* by using defaultValue
2547
- elem.defaultValue :
2548
-
2549
- ret && ret.specified ? ret.value : undefined;
2550
- },
2551
- set: function( elem, value, name ) {
2552
- if ( jQuery.nodeName( elem, "input" ) ) {
2553
- // Does not return so that setAttribute is also used
2554
- elem.defaultValue = value;
2555
- } else {
2556
- // Use nodeHook if defined (#1954); otherwise setAttribute is fine
2557
- return nodeHook && nodeHook.set( elem, value, name );
2558
- }
2559
- }
2560
- };
2561
- }
2562
-
2563
- // IE6/7 do not support getting/setting some attributes with get/setAttribute
2564
- if ( !getSetAttribute ) {
2565
-
2566
- // Use this for any attribute in IE6/7
2567
- // This fixes almost every IE6/7 issue
2568
- nodeHook = jQuery.valHooks.button = {
2569
- get: function( elem, name ) {
2570
- var ret = elem.getAttributeNode( name );
2571
- return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
2572
- ret.value :
2573
- undefined;
2574
- },
2575
- set: function( elem, value, name ) {
2576
- // Set the existing or create a new attribute node
2577
- var ret = elem.getAttributeNode( name );
2578
- if ( !ret ) {
2579
- elem.setAttributeNode(
2580
- (ret = elem.ownerDocument.createAttribute( name ))
2581
- );
2582
- }
2583
-
2584
- ret.value = value += "";
2585
-
2586
- // Break association with cloned elements by also using setAttribute (#9646)
2587
- return name === "value" || value === elem.getAttribute( name ) ?
2588
- value :
2589
- undefined;
2590
- }
2591
- };
2592
-
2593
- // Set contenteditable to false on removals(#10429)
2594
- // Setting to empty string throws an error as an invalid value
2595
- jQuery.attrHooks.contenteditable = {
2596
- get: nodeHook.get,
2597
- set: function( elem, value, name ) {
2598
- nodeHook.set( elem, value === "" ? false : value, name );
2599
- }
2600
- };
2601
-
2602
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
2603
- // This is for removals
2604
- jQuery.each([ "width", "height" ], function( i, name ) {
2605
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2606
- set: function( elem, value ) {
2607
- if ( value === "" ) {
2608
- elem.setAttribute( name, "auto" );
2609
- return value;
2610
- }
2611
- }
2612
- });
2613
- });
2614
- }
2615
-
2616
-
2617
- // Some attributes require a special call on IE
2618
- // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2619
- if ( !jQuery.support.hrefNormalized ) {
2620
- jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
2621
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2622
- get: function( elem ) {
2623
- var ret = elem.getAttribute( name, 2 );
2624
- return ret == null ? undefined : ret;
2625
- }
2626
- });
2627
- });
2628
-
2629
- // href/src property should get the full normalized URL (#10299/#12915)
2630
- jQuery.each([ "href", "src" ], function( i, name ) {
2631
- jQuery.propHooks[ name ] = {
2632
- get: function( elem ) {
2633
- return elem.getAttribute( name, 4 );
2634
- }
2635
- };
2636
- });
2637
- }
2638
-
2639
- if ( !jQuery.support.style ) {
2640
- jQuery.attrHooks.style = {
2641
- get: function( elem ) {
2642
- // Return undefined in the case of empty string
2643
- // Note: IE uppercases css property names, but if we were to .toLowerCase()
2644
- // .cssText, that would destroy case senstitivity in URL's, like in "background"
2645
- return elem.style.cssText || undefined;
2646
- },
2647
- set: function( elem, value ) {
2648
- return ( elem.style.cssText = value + "" );
2649
- }
2650
- };
2651
- }
2652
-
2653
- // Safari mis-reports the default selected property of an option
2654
- // Accessing the parent's selectedIndex property fixes it
2655
- if ( !jQuery.support.optSelected ) {
2656
- jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
2657
- get: function( elem ) {
2658
- var parent = elem.parentNode;
2659
-
2660
- if ( parent ) {
2661
- parent.selectedIndex;
2662
-
2663
- // Make sure that it also works with optgroups, see #5701
2664
- if ( parent.parentNode ) {
2665
- parent.parentNode.selectedIndex;
2666
- }
2667
- }
2668
- return null;
2669
- }
2670
- });
2671
- }
2672
-
2673
- // IE6/7 call enctype encoding
2674
- if ( !jQuery.support.enctype ) {
2675
- jQuery.propFix.enctype = "encoding";
2676
- }
2677
-
2678
- // Radios and checkboxes getter/setter
2679
- if ( !jQuery.support.checkOn ) {
2680
- jQuery.each([ "radio", "checkbox" ], function() {
2681
- jQuery.valHooks[ this ] = {
2682
- get: function( elem ) {
2683
- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
2684
- return elem.getAttribute("value") === null ? "on" : elem.value;
2685
- }
2686
- };
2687
- });
2688
- }
2689
- jQuery.each([ "radio", "checkbox" ], function() {
2690
- jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
2691
- set: function( elem, value ) {
2692
- if ( jQuery.isArray( value ) ) {
2693
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
2694
- }
2695
- }
2696
- });
2697
- });
2698
- var rformElems = /^(?:input|select|textarea)$/i,
2699
- rkeyEvent = /^key/,
2700
- rmouseEvent = /^(?:mouse|contextmenu)|click/,
2701
- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
2702
- rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
2703
-
2704
- function returnTrue() {
2705
- return true;
2706
- }
2707
-
2708
- function returnFalse() {
2709
- return false;
2710
- }
2711
-
2712
- /*
2713
- * Helper functions for managing events -- not part of the public interface.
2714
- * Props to Dean Edwards' addEvent library for many of the ideas.
2715
- */
2716
- jQuery.event = {
2717
-
2718
- global: {},
2719
-
2720
- add: function( elem, types, handler, data, selector ) {
2721
- var tmp, events, t, handleObjIn,
2722
- special, eventHandle, handleObj,
2723
- handlers, type, namespaces, origType,
2724
- elemData = jQuery._data( elem );
2725
-
2726
- // Don't attach events to noData or text/comment nodes (but allow plain objects)
2727
- if ( !elemData ) {
2728
- return;
2729
- }
2730
-
2731
- // Caller can pass in an object of custom data in lieu of the handler
2732
- if ( handler.handler ) {
2733
- handleObjIn = handler;
2734
- handler = handleObjIn.handler;
2735
- selector = handleObjIn.selector;
2736
- }
2737
-
2738
- // Make sure that the handler has a unique ID, used to find/remove it later
2739
- if ( !handler.guid ) {
2740
- handler.guid = jQuery.guid++;
2741
- }
2742
-
2743
- // Init the element's event structure and main handler, if this is the first
2744
- if ( !(events = elemData.events) ) {
2745
- events = elemData.events = {};
2746
- }
2747
- if ( !(eventHandle = elemData.handle) ) {
2748
- eventHandle = elemData.handle = function( e ) {
2749
- // Discard the second event of a jQuery.event.trigger() and
2750
- // when an event is called after a page has unloaded
2751
- return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
2752
- jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
2753
- undefined;
2754
- };
2755
- // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
2756
- eventHandle.elem = elem;
2757
- }
2758
-
2759
- // Handle multiple events separated by a space
2760
- // jQuery(...).bind("mouseover mouseout", fn);
2761
- types = ( types || "" ).match( core_rnotwhite ) || [""];
2762
- t = types.length;
2763
- while ( t-- ) {
2764
- tmp = rtypenamespace.exec( types[t] ) || [];
2765
- type = origType = tmp[1];
2766
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
2767
-
2768
- // If event changes its type, use the special event handlers for the changed type
2769
- special = jQuery.event.special[ type ] || {};
2770
-
2771
- // If selector defined, determine special event api type, otherwise given type
2772
- type = ( selector ? special.delegateType : special.bindType ) || type;
2773
-
2774
- // Update special based on newly reset type
2775
- special = jQuery.event.special[ type ] || {};
2776
-
2777
- // handleObj is passed to all event handlers
2778
- handleObj = jQuery.extend({
2779
- type: type,
2780
- origType: origType,
2781
- data: data,
2782
- handler: handler,
2783
- guid: handler.guid,
2784
- selector: selector,
2785
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
2786
- namespace: namespaces.join(".")
2787
- }, handleObjIn );
2788
-
2789
- // Init the event handler queue if we're the first
2790
- if ( !(handlers = events[ type ]) ) {
2791
- handlers = events[ type ] = [];
2792
- handlers.delegateCount = 0;
2793
-
2794
- // Only use addEventListener/attachEvent if the special events handler returns false
2795
- if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
2796
- // Bind the global event handler to the element
2797
- if ( elem.addEventListener ) {
2798
- elem.addEventListener( type, eventHandle, false );
2799
-
2800
- } else if ( elem.attachEvent ) {
2801
- elem.attachEvent( "on" + type, eventHandle );
2802
- }
2803
- }
2804
- }
2805
-
2806
- if ( special.add ) {
2807
- special.add.call( elem, handleObj );
2808
-
2809
- if ( !handleObj.handler.guid ) {
2810
- handleObj.handler.guid = handler.guid;
2811
- }
2812
- }
2813
-
2814
- // Add to the element's handler list, delegates in front
2815
- if ( selector ) {
2816
- handlers.splice( handlers.delegateCount++, 0, handleObj );
2817
- } else {
2818
- handlers.push( handleObj );
2819
- }
2820
-
2821
- // Keep track of which events have ever been used, for event optimization
2822
- jQuery.event.global[ type ] = true;
2823
- }
2824
-
2825
- // Nullify elem to prevent memory leaks in IE
2826
- elem = null;
2827
- },
2828
-
2829
- // Detach an event or set of events from an element
2830
- remove: function( elem, types, handler, selector, mappedTypes ) {
2831
- var j, handleObj, tmp,
2832
- origCount, t, events,
2833
- special, handlers, type,
2834
- namespaces, origType,
2835
- elemData = jQuery.hasData( elem ) && jQuery._data( elem );
2836
-
2837
- if ( !elemData || !(events = elemData.events) ) {
2838
- return;
2839
- }
2840
-
2841
- // Once for each type.namespace in types; type may be omitted
2842
- types = ( types || "" ).match( core_rnotwhite ) || [""];
2843
- t = types.length;
2844
- while ( t-- ) {
2845
- tmp = rtypenamespace.exec( types[t] ) || [];
2846
- type = origType = tmp[1];
2847
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
2848
-
2849
- // Unbind all events (on this namespace, if provided) for the element
2850
- if ( !type ) {
2851
- for ( type in events ) {
2852
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
2853
- }
2854
- continue;
2855
- }
2856
-
2857
- special = jQuery.event.special[ type ] || {};
2858
- type = ( selector ? special.delegateType : special.bindType ) || type;
2859
- handlers = events[ type ] || [];
2860
- tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
2861
-
2862
- // Remove matching events
2863
- origCount = j = handlers.length;
2864
- while ( j-- ) {
2865
- handleObj = handlers[ j ];
2866
-
2867
- if ( ( mappedTypes || origType === handleObj.origType ) &&
2868
- ( !handler || handler.guid === handleObj.guid ) &&
2869
- ( !tmp || tmp.test( handleObj.namespace ) ) &&
2870
- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
2871
- handlers.splice( j, 1 );
2872
-
2873
- if ( handleObj.selector ) {
2874
- handlers.delegateCount--;
2875
- }
2876
- if ( special.remove ) {
2877
- special.remove.call( elem, handleObj );
2878
- }
2879
- }
2880
- }
2881
-
2882
- // Remove generic event handler if we removed something and no more handlers exist
2883
- // (avoids potential for endless recursion during removal of special event handlers)
2884
- if ( origCount && !handlers.length ) {
2885
- if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
2886
- jQuery.removeEvent( elem, type, elemData.handle );
2887
- }
2888
-
2889
-
2890
-
2891
- delete events[ type ];
2892
- }
2893
- }
2894
-
2895
- // Remove the expando if it's no longer used
2896
- if ( jQuery.isEmptyObject( events ) ) {
2897
- delete elemData.handle;
2898
-
2899
- // removeData also checks for emptiness and clears the expando if empty
2900
- // so use it instead of delete
2901
- jQuery._removeData( elem, "events" );
2902
- }
2903
- },
2904
-
2905
- trigger: function( event, data, elem, onlyHandlers ) {
2906
- var handle, ontype, cur,
2907
- bubbleType, special, tmp, i,
2908
- eventPath = [ elem || document ],
2909
- type = core_hasOwn.call( event, "type" ) ? event.type : event,
2910
- namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
2911
-
2912
- cur = tmp = elem = elem || document;
2913
-
2914
- // Don't do events on text and comment nodes
2915
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
2916
- return;
2917
- }
2918
-
2919
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
2920
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
2921
- return;
2922
- }
2923
-
2924
- if ( type.indexOf(".") >= 0 ) {
2925
- // Namespaced trigger; create a regexp to match event type in handle()
2926
- namespaces = type.split(".");
2927
- type = namespaces.shift();
2928
- namespaces.sort();
2929
- }
2930
- ontype = type.indexOf(":") < 0 && "on" + type;
2931
-
2932
- // Caller can pass in a jQuery.Event object, Object, or just an event type string
2933
- event = event[ jQuery.expando ] ?
2934
- event :
2935
- new jQuery.Event( type, typeof event === "object" && event );
2936
-
2937
- event.isTrigger = true;
2938
- event.namespace = namespaces.join(".");
2939
- event.namespace_re = event.namespace ?
2940
- new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
2941
- null;
2942
-
2943
- // Clean up the event in case it is being reused
2944
- event.result = undefined;
2945
- if ( !event.target ) {
2946
- event.target = elem;
2947
- }
2948
-
2949
- // Clone any incoming data and prepend the event, creating the handler arg list
2950
- data = data == null ?
2951
- [ event ] :
2952
- jQuery.makeArray( data, [ event ] );
2953
-
2954
- // Allow special events to draw outside the lines
2955
- special = jQuery.event.special[ type ] || {};
2956
- if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
2957
- return;
2958
- }
2959
-
2960
- // Determine event propagation path in advance, per W3C events spec (#9951)
2961
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
2962
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
2963
-
2964
- bubbleType = special.delegateType || type;
2965
- if ( !rfocusMorph.test( bubbleType + type ) ) {
2966
- cur = cur.parentNode;
2967
- }
2968
- for ( ; cur; cur = cur.parentNode ) {
2969
- eventPath.push( cur );
2970
- tmp = cur;
2971
- }
2972
-
2973
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
2974
- if ( tmp === (elem.ownerDocument || document) ) {
2975
- eventPath.push( tmp.defaultView || tmp.parentWindow || window );
2976
- }
2977
- }
2978
-
2979
- // Fire handlers on the event path
2980
- i = 0;
2981
- while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
2982
-
2983
- event.type = i > 1 ?
2984
- bubbleType :
2985
- special.bindType || type;
2986
-
2987
- // jQuery handler
2988
- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
2989
- if ( handle ) {
2990
- handle.apply( cur, data );
2991
- }
2992
-
2993
- // Native handler
2994
- handle = ontype && cur[ ontype ];
2995
- if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
2996
- event.preventDefault();
2997
- }
2998
- }
2999
- event.type = type;
3000
-
3001
- // If nobody prevented the default action, do it now
3002
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
3003
-
3004
- if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
3005
- !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
3006
-
3007
- // Call a native DOM method on the target with the same name name as the event.
3008
- // Can't use an .isFunction() check here because IE6/7 fails that test.
3009
- // Don't do default actions on window, that's where global variables be (#6170)
3010
- if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
3011
-
3012
- // Don't re-trigger an onFOO event when we call its FOO() method
3013
- tmp = elem[ ontype ];
3014
-
3015
- if ( tmp ) {
3016
- elem[ ontype ] = null;
3017
- }
3018
-
3019
- // Prevent re-triggering of the same event, since we already bubbled it above
3020
- jQuery.event.triggered = type;
3021
- try {
3022
- elem[ type ]();
3023
- } catch ( e ) {
3024
- // IE<9 dies on focus/blur to hidden element (#1486,#12518)
3025
- // only reproducible on winXP IE8 native, not IE9 in IE8 mode
3026
- }
3027
- jQuery.event.triggered = undefined;
3028
-
3029
- if ( tmp ) {
3030
- elem[ ontype ] = tmp;
3031
- }
3032
- }
3033
- }
3034
- }
3035
-
3036
- return event.result;
3037
- },
3038
-
3039
- dispatch: function( event ) {
3040
-
3041
- // Make a writable jQuery.Event from the native event object
3042
- event = jQuery.event.fix( event );
3043
-
3044
- var i, ret, handleObj, matched, j,
3045
- handlerQueue = [],
3046
- args = core_slice.call( arguments ),
3047
- handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
3048
- special = jQuery.event.special[ event.type ] || {};
3049
-
3050
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
3051
- args[0] = event;
3052
- event.delegateTarget = this;
3053
-
3054
- // Call the preDispatch hook for the mapped type, and let it bail if desired
3055
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
3056
- return;
3057
- }
3058
-
3059
- // Determine handlers
3060
- handlerQueue = jQuery.event.handlers.call( this, event, handlers );
3061
-
3062
- // Run delegates first; they may want to stop propagation beneath us
3063
- i = 0;
3064
- while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
3065
- event.currentTarget = matched.elem;
3066
-
3067
- j = 0;
3068
- while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
3069
-
3070
- // Triggered event must either 1) have no namespace, or
3071
- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
3072
- if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
3073
-
3074
- event.handleObj = handleObj;
3075
- event.data = handleObj.data;
3076
-
3077
- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
3078
- .apply( matched.elem, args );
3079
-
3080
- if ( ret !== undefined ) {
3081
- if ( (event.result = ret) === false ) {
3082
- event.preventDefault();
3083
- event.stopPropagation();
3084
- }
3085
- }
3086
- }
3087
- }
3088
- }
3089
-
3090
- // Call the postDispatch hook for the mapped type
3091
- if ( special.postDispatch ) {
3092
- special.postDispatch.call( this, event );
3093
- }
3094
-
3095
- return event.result;
3096
- },
3097
-
3098
- handlers: function( event, handlers ) {
3099
- var sel, handleObj, matches, i,
3100
- handlerQueue = [],
3101
- delegateCount = handlers.delegateCount,
3102
- cur = event.target;
3103
-
3104
- // Find delegate handlers
3105
- // Black-hole SVG <use> instance trees (#13180)
3106
- // Avoid non-left-click bubbling in Firefox (#3861)
3107
- if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
3108
-
3109
- for ( ; cur != this; cur = cur.parentNode || this ) {
3110
-
3111
- // Don't check non-elements (#13208)
3112
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
3113
- if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
3114
- matches = [];
3115
- for ( i = 0; i < delegateCount; i++ ) {
3116
- handleObj = handlers[ i ];
3117
-
3118
- // Don't conflict with Object.prototype properties (#13203)
3119
- sel = handleObj.selector + " ";
3120
-
3121
- if ( matches[ sel ] === undefined ) {
3122
- matches[ sel ] = handleObj.needsContext ?
3123
- jQuery( sel, this ).index( cur ) >= 0 :
3124
- jQuery.find( sel, this, null, [ cur ] ).length;
3125
- }
3126
- if ( matches[ sel ] ) {
3127
- matches.push( handleObj );
3128
- }
3129
- }
3130
- if ( matches.length ) {
3131
- handlerQueue.push({ elem: cur, handlers: matches });
3132
- }
3133
- }
3134
- }
3135
- }
3136
-
3137
- // Add the remaining (directly-bound) handlers
3138
- if ( delegateCount < handlers.length ) {
3139
- handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
3140
- }
3141
-
3142
- return handlerQueue;
3143
- },
3144
-
3145
- fix: function( event ) {
3146
- if ( event[ jQuery.expando ] ) {
3147
- return event;
3148
- }
3149
-
3150
- // Create a writable copy of the event object and normalize some properties
3151
- var i, prop, copy,
3152
- type = event.type,
3153
- originalEvent = event,
3154
- fixHook = this.fixHooks[ type ];
3155
-
3156
- if ( !fixHook ) {
3157
- this.fixHooks[ type ] = fixHook =
3158
- rmouseEvent.test( type ) ? this.mouseHooks :
3159
- rkeyEvent.test( type ) ? this.keyHooks :
3160
- {};
3161
- }
3162
- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
3163
-
3164
- event = new jQuery.Event( originalEvent );
3165
-
3166
- i = copy.length;
3167
- while ( i-- ) {
3168
- prop = copy[ i ];
3169
- event[ prop ] = originalEvent[ prop ];
3170
- }
3171
-
3172
- // Support: IE<9
3173
- // Fix target property (#1925)
3174
- if ( !event.target ) {
3175
- event.target = originalEvent.srcElement || document;
3176
- }
3177
-
3178
- // Support: Chrome 23+, Safari?
3179
- // Target should not be a text node (#504, #13143)
3180
- if ( event.target.nodeType === 3 ) {
3181
- event.target = event.target.parentNode;
3182
- }
3183
-
3184
- // Support: IE<9
3185
- // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
3186
- event.metaKey = !!event.metaKey;
3187
-
3188
- return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
3189
- },
3190
-
3191
- // Includes some event props shared by KeyEvent and MouseEvent
3192
- props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
3193
-
3194
- fixHooks: {},
3195
-
3196
- keyHooks: {
3197
- props: "char charCode key keyCode".split(" "),
3198
- filter: function( event, original ) {
3199
-
3200
- // Add which for key events
3201
- if ( event.which == null ) {
3202
- event.which = original.charCode != null ? original.charCode : original.keyCode;
3203
- }
3204
-
3205
- return event;
3206
- }
3207
- },
3208
-
3209
- mouseHooks: {
3210
- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
3211
- filter: function( event, original ) {
3212
- var body, eventDoc, doc,
3213
- button = original.button,
3214
- fromElement = original.fromElement;
3215
-
3216
- // Calculate pageX/Y if missing and clientX/Y available
3217
- if ( event.pageX == null && original.clientX != null ) {
3218
- eventDoc = event.target.ownerDocument || document;
3219
- doc = eventDoc.documentElement;
3220
- body = eventDoc.body;
3221
-
3222
- event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
3223
- event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
3224
- }
3225
-
3226
- // Add relatedTarget, if necessary
3227
- if ( !event.relatedTarget && fromElement ) {
3228
- event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
3229
- }
3230
-
3231
- // Add which for click: 1 === left; 2 === middle; 3 === right
3232
- // Note: button is not normalized, so don't use it
3233
- if ( !event.which && button !== undefined ) {
3234
- event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
3235
- }
3236
-
3237
- return event;
3238
- }
3239
- },
3240
-
3241
- special: {
3242
- load: {
3243
- // Prevent triggered image.load events from bubbling to window.load
3244
- noBubble: true
3245
- },
3246
- click: {
3247
- // For checkbox, fire native event so checked state will be right
3248
- trigger: function() {
3249
- if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
3250
- this.click();
3251
- return false;
3252
- }
3253
- }
3254
- },
3255
- focus: {
3256
- // Fire native event if possible so blur/focus sequence is correct
3257
- trigger: function() {
3258
- if ( this !== document.activeElement && this.focus ) {
3259
- try {
3260
- this.focus();
3261
- return false;
3262
- } catch ( e ) {
3263
- // Support: IE<9
3264
- // If we error on focus to hidden element (#1486, #12518),
3265
- // let .trigger() run the handlers
3266
- }
3267
- }
3268
- },
3269
- delegateType: "focusin"
3270
- },
3271
- blur: {
3272
- trigger: function() {
3273
- if ( this === document.activeElement && this.blur ) {
3274
- this.blur();
3275
- return false;
3276
- }
3277
- },
3278
- delegateType: "focusout"
3279
- },
3280
-
3281
- beforeunload: {
3282
- postDispatch: function( event ) {
3283
-
3284
- // Even when returnValue equals to undefined Firefox will still show alert
3285
- if ( event.result !== undefined ) {
3286
- event.originalEvent.returnValue = event.result;
3287
- }
3288
- }
3289
- }
3290
- },
3291
-
3292
- simulate: function( type, elem, event, bubble ) {
3293
- // Piggyback on a donor event to simulate a different one.
3294
- // Fake originalEvent to avoid donor's stopPropagation, but if the
3295
- // simulated event prevents default then we do the same on the donor.
3296
- var e = jQuery.extend(
3297
- new jQuery.Event(),
3298
- event,
3299
- { type: type,
3300
- isSimulated: true,
3301
- originalEvent: {}
3302
- }
3303
- );
3304
- if ( bubble ) {
3305
- jQuery.event.trigger( e, null, elem );
3306
- } else {
3307
- jQuery.event.dispatch.call( elem, e );
3308
- }
3309
- if ( e.isDefaultPrevented() ) {
3310
- event.preventDefault();
3311
- }
3312
- }
3313
- };
3314
-
3315
- jQuery.removeEvent = document.removeEventListener ?
3316
- function( elem, type, handle ) {
3317
- if ( elem.removeEventListener ) {
3318
- elem.removeEventListener( type, handle, false );
3319
- }
3320
- } :
3321
- function( elem, type, handle ) {
3322
- var name = "on" + type;
3323
-
3324
- if ( elem.detachEvent ) {
3325
-
3326
- // #8545, #7054, preventing memory leaks for custom events in IE6-8
3327
- // detachEvent needed property on element, by name of that event, to properly expose it to GC
3328
- if ( typeof elem[ name ] === core_strundefined ) {
3329
- elem[ name ] = null;
3330
- }
3331
-
3332
- elem.detachEvent( name, handle );
3333
- }
3334
- };
3335
-
3336
- jQuery.Event = function( src, props ) {
3337
- // Allow instantiation without the 'new' keyword
3338
- if ( !(this instanceof jQuery.Event) ) {
3339
- return new jQuery.Event( src, props );
3340
- }
3341
-
3342
- // Event object
3343
- if ( src && src.type ) {
3344
- this.originalEvent = src;
3345
- this.type = src.type;
3346
-
3347
- // Events bubbling up the document may have been marked as prevented
3348
- // by a handler lower down the tree; reflect the correct value.
3349
- this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
3350
- src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
3351
-
3352
- // Event type
3353
- } else {
3354
- this.type = src;
3355
- }
3356
-
3357
- // Put explicitly provided properties onto the event object
3358
- if ( props ) {
3359
- jQuery.extend( this, props );
3360
- }
3361
-
3362
- // Create a timestamp if incoming event doesn't have one
3363
- this.timeStamp = src && src.timeStamp || jQuery.now();
3364
-
3365
- // Mark it as fixed
3366
- this[ jQuery.expando ] = true;
3367
- };
3368
-
3369
- // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
3370
- // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
3371
- jQuery.Event.prototype = {
3372
- isDefaultPrevented: returnFalse,
3373
- isPropagationStopped: returnFalse,
3374
- isImmediatePropagationStopped: returnFalse,
3375
-
3376
- preventDefault: function() {
3377
- var e = this.originalEvent;
3378
-
3379
- this.isDefaultPrevented = returnTrue;
3380
- if ( !e ) {
3381
- return;
3382
- }
3383
-
3384
- // If preventDefault exists, run it on the original event
3385
- if ( e.preventDefault ) {
3386
- e.preventDefault();
3387
-
3388
- // Support: IE
3389
- // Otherwise set the returnValue property of the original event to false
3390
- } else {
3391
- e.returnValue = false;
3392
- }
3393
- },
3394
- stopPropagation: function() {
3395
- var e = this.originalEvent;
3396
-
3397
- this.isPropagationStopped = returnTrue;
3398
- if ( !e ) {
3399
- return;
3400
- }
3401
- // If stopPropagation exists, run it on the original event
3402
- if ( e.stopPropagation ) {
3403
- e.stopPropagation();
3404
- }
3405
-
3406
- // Support: IE
3407
- // Set the cancelBubble property of the original event to true
3408
- e.cancelBubble = true;
3409
- },
3410
- stopImmediatePropagation: function() {
3411
- this.isImmediatePropagationStopped = returnTrue;
3412
- this.stopPropagation();
3413
- }
3414
- };
3415
-
3416
- // Create mouseenter/leave events using mouseover/out and event-time checks
3417
- jQuery.each({
3418
- mouseenter: "mouseover",
3419
- mouseleave: "mouseout"
3420
- }, function( orig, fix ) {
3421
- jQuery.event.special[ orig ] = {
3422
- delegateType: fix,
3423
- bindType: fix,
3424
-
3425
- handle: function( event ) {
3426
- var ret,
3427
- target = this,
3428
- related = event.relatedTarget,
3429
- handleObj = event.handleObj;
3430
-
3431
- // For mousenter/leave call the handler if related is outside the target.
3432
- // NB: No relatedTarget if the mouse left/entered the browser window
3433
- if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
3434
- event.type = handleObj.origType;
3435
- ret = handleObj.handler.apply( this, arguments );
3436
- event.type = fix;
3437
- }
3438
- return ret;
3439
- }
3440
- };
3441
- });
3442
-
3443
- // IE submit delegation
3444
- if ( !jQuery.support.submitBubbles ) {
3445
-
3446
- jQuery.event.special.submit = {
3447
- setup: function() {
3448
- // Only need this for delegated form submit events
3449
- if ( jQuery.nodeName( this, "form" ) ) {
3450
- return false;
3451
- }
3452
-
3453
- // Lazy-add a submit handler when a descendant form may potentially be submitted
3454
- jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
3455
- // Node name check avoids a VML-related crash in IE (#9807)
3456
- var elem = e.target,
3457
- form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
3458
- if ( form && !jQuery._data( form, "submitBubbles" ) ) {
3459
- jQuery.event.add( form, "submit._submit", function( event ) {
3460
- event._submit_bubble = true;
3461
- });
3462
- jQuery._data( form, "submitBubbles", true );
3463
- }
3464
- });
3465
- // return undefined since we don't need an event listener
3466
- },
3467
-
3468
- postDispatch: function( event ) {
3469
- // If form was submitted by the user, bubble the event up the tree
3470
- if ( event._submit_bubble ) {
3471
- delete event._submit_bubble;
3472
- if ( this.parentNode && !event.isTrigger ) {
3473
- jQuery.event.simulate( "submit", this.parentNode, event, true );
3474
- }
3475
- }
3476
- },
3477
-
3478
- teardown: function() {
3479
- // Only need this for delegated form submit events
3480
- if ( jQuery.nodeName( this, "form" ) ) {
3481
- return false;
3482
- }
3483
-
3484
- // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
3485
- jQuery.event.remove( this, "._submit" );
3486
- }
3487
- };
3488
- }
3489
-
3490
- // IE change delegation and checkbox/radio fix
3491
- if ( !jQuery.support.changeBubbles ) {
3492
-
3493
- jQuery.event.special.change = {
3494
-
3495
- setup: function() {
3496
-
3497
- if ( rformElems.test( this.nodeName ) ) {
3498
- // IE doesn't fire change on a check/radio until blur; trigger it on click
3499
- // after a propertychange. Eat the blur-change in special.change.handle.
3500
- // This still fires onchange a second time for check/radio after blur.
3501
- if ( this.type === "checkbox" || this.type === "radio" ) {
3502
- jQuery.event.add( this, "propertychange._change", function( event ) {
3503
- if ( event.originalEvent.propertyName === "checked" ) {
3504
- this._just_changed = true;
3505
- }
3506
- });
3507
- jQuery.event.add( this, "click._change", function( event ) {
3508
- if ( this._just_changed && !event.isTrigger ) {
3509
- this._just_changed = false;
3510
- }
3511
- // Allow triggered, simulated change events (#11500)
3512
- jQuery.event.simulate( "change", this, event, true );
3513
- });
3514
- }
3515
- return false;
3516
- }
3517
- // Delegated event; lazy-add a change handler on descendant inputs
3518
- jQuery.event.add( this, "beforeactivate._change", function( e ) {
3519
- var elem = e.target;
3520
-
3521
- if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
3522
- jQuery.event.add( elem, "change._change", function( event ) {
3523
- if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
3524
- jQuery.event.simulate( "change", this.parentNode, event, true );
3525
- }
3526
- });
3527
- jQuery._data( elem, "changeBubbles", true );
3528
- }
3529
- });
3530
- },
3531
-
3532
- handle: function( event ) {
3533
- var elem = event.target;
3534
-
3535
- // Swallow native change events from checkbox/radio, we already triggered them above
3536
- if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
3537
- return event.handleObj.handler.apply( this, arguments );
3538
- }
3539
- },
3540
-
3541
- teardown: function() {
3542
- jQuery.event.remove( this, "._change" );
3543
-
3544
- return !rformElems.test( this.nodeName );
3545
- }
3546
- };
3547
- }
3548
-
3549
- // Create "bubbling" focus and blur events
3550
- if ( !jQuery.support.focusinBubbles ) {
3551
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
3552
-
3553
- // Attach a single capturing handler while someone wants focusin/focusout
3554
- var attaches = 0,
3555
- handler = function( event ) {
3556
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
3557
- };
3558
-
3559
- jQuery.event.special[ fix ] = {
3560
- setup: function() {
3561
- if ( attaches++ === 0 ) {
3562
- document.addEventListener( orig, handler, true );
3563
- }
3564
- },
3565
- teardown: function() {
3566
- if ( --attaches === 0 ) {
3567
- document.removeEventListener( orig, handler, true );
3568
- }
3569
- }
3570
- };
3571
- });
3572
- }
3573
-
3574
- jQuery.fn.extend({
3575
-
3576
- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
3577
- var type, origFn;
3578
-
3579
- // Types can be a map of types/handlers
3580
- if ( typeof types === "object" ) {
3581
- // ( types-Object, selector, data )
3582
- if ( typeof selector !== "string" ) {
3583
- // ( types-Object, data )
3584
- data = data || selector;
3585
- selector = undefined;
3586
- }
3587
- for ( type in types ) {
3588
- this.on( type, selector, data, types[ type ], one );
3589
- }
3590
- return this;
3591
- }
3592
-
3593
- if ( data == null && fn == null ) {
3594
- // ( types, fn )
3595
- fn = selector;
3596
- data = selector = undefined;
3597
- } else if ( fn == null ) {
3598
- if ( typeof selector === "string" ) {
3599
- // ( types, selector, fn )
3600
- fn = data;
3601
- data = undefined;
3602
- } else {
3603
- // ( types, data, fn )
3604
- fn = data;
3605
- data = selector;
3606
- selector = undefined;
3607
- }
3608
- }
3609
- if ( fn === false ) {
3610
- fn = returnFalse;
3611
- } else if ( !fn ) {
3612
- return this;
3613
- }
3614
-
3615
- if ( one === 1 ) {
3616
- origFn = fn;
3617
- fn = function( event ) {
3618
- // Can use an empty set, since event contains the info
3619
- jQuery().off( event );
3620
- return origFn.apply( this, arguments );
3621
- };
3622
- // Use same guid so caller can remove using origFn
3623
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
3624
- }
3625
- return this.each( function() {
3626
- jQuery.event.add( this, types, fn, data, selector );
3627
- });
3628
- },
3629
- one: function( types, selector, data, fn ) {
3630
- return this.on( types, selector, data, fn, 1 );
3631
- },
3632
- off: function( types, selector, fn ) {
3633
- var handleObj, type;
3634
- if ( types && types.preventDefault && types.handleObj ) {
3635
- // ( event ) dispatched jQuery.Event
3636
- handleObj = types.handleObj;
3637
- jQuery( types.delegateTarget ).off(
3638
- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
3639
- handleObj.selector,
3640
- handleObj.handler
3641
- );
3642
- return this;
3643
- }
3644
- if ( typeof types === "object" ) {
3645
- // ( types-object [, selector] )
3646
- for ( type in types ) {
3647
- this.off( type, selector, types[ type ] );
3648
- }
3649
- return this;
3650
- }
3651
- if ( selector === false || typeof selector === "function" ) {
3652
- // ( types [, fn] )
3653
- fn = selector;
3654
- selector = undefined;
3655
- }
3656
- if ( fn === false ) {
3657
- fn = returnFalse;
3658
- }
3659
- return this.each(function() {
3660
- jQuery.event.remove( this, types, fn, selector );
3661
- });
3662
- },
3663
-
3664
- bind: function( types, data, fn ) {
3665
- return this.on( types, null, data, fn );
3666
- },
3667
- unbind: function( types, fn ) {
3668
- return this.off( types, null, fn );
3669
- },
3670
-
3671
- delegate: function( selector, types, data, fn ) {
3672
- return this.on( types, selector, data, fn );
3673
- },
3674
- undelegate: function( selector, types, fn ) {
3675
- // ( namespace ) or ( selector, types [, fn] )
3676
- return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
3677
- },
3678
-
3679
- trigger: function( type, data ) {
3680
- return this.each(function() {
3681
- jQuery.event.trigger( type, data, this );
3682
- });
3683
- },
3684
- triggerHandler: function( type, data ) {
3685
- var elem = this[0];
3686
- if ( elem ) {
3687
- return jQuery.event.trigger( type, data, elem, true );
3688
- }
3689
- }
3690
- });
3691
- /*!
3692
- * Sizzle CSS Selector Engine
3693
- * Copyright 2012 jQuery Foundation and other contributors
3694
- * Released under the MIT license
3695
- * http://sizzlejs.com/
3696
- */
3697
- (function( window, undefined ) {
3698
-
3699
- var i,
3700
- cachedruns,
3701
- Expr,
3702
- getText,
3703
- isXML,
3704
- compile,
3705
- hasDuplicate,
3706
- outermostContext,
3707
-
3708
- // Local document vars
3709
- setDocument,
3710
- document,
3711
- docElem,
3712
- documentIsXML,
3713
- rbuggyQSA,
3714
- rbuggyMatches,
3715
- matches,
3716
- contains,
3717
- sortOrder,
3718
-
3719
- // Instance-specific data
3720
- expando = "sizzle" + -(new Date()),
3721
- preferredDoc = window.document,
3722
- support = {},
3723
- dirruns = 0,
3724
- done = 0,
3725
- classCache = createCache(),
3726
- tokenCache = createCache(),
3727
- compilerCache = createCache(),
3728
-
3729
- // General-purpose constants
3730
- strundefined = typeof undefined,
3731
- MAX_NEGATIVE = 1 << 31,
3732
-
3733
- // Array methods
3734
- arr = [],
3735
- pop = arr.pop,
3736
- push = arr.push,
3737
- slice = arr.slice,
3738
- // Use a stripped-down indexOf if we can't use a native one
3739
- indexOf = arr.indexOf || function( elem ) {
3740
- var i = 0,
3741
- len = this.length;
3742
- for ( ; i < len; i++ ) {
3743
- if ( this[i] === elem ) {
3744
- return i;
3745
- }
3746
- }
3747
- return -1;
3748
- },
3749
-
3750
-
3751
- // Regular expressions
3752
-
3753
- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
3754
- whitespace = "[\\x20\\t\\r\\n\\f]",
3755
- // http://www.w3.org/TR/css3-syntax/#characters
3756
- characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
3757
-
3758
- // Loosely modeled on CSS identifier characters
3759
- // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
3760
- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
3761
- identifier = characterEncoding.replace( "w", "w#" ),
3762
-
3763
- // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
3764
- operators = "([*^$|!~]?=)",
3765
- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
3766
- "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
3767
-
3768
- // Prefer arguments quoted,
3769
- // then not containing pseudos/brackets,
3770
- // then attribute selectors/non-parenthetical expressions,
3771
- // then anything else
3772
- // These preferences are here to reduce the number of selectors
3773
- // needing tokenize in the PSEUDO preFilter
3774
- pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
3775
-
3776
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
3777
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
3778
-
3779
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
3780
- rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
3781
- rpseudo = new RegExp( pseudos ),
3782
- ridentifier = new RegExp( "^" + identifier + "$" ),
3783
-
3784
- matchExpr = {
3785
- "ID": new RegExp( "^#(" + characterEncoding + ")" ),
3786
- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
3787
- "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
3788
- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
3789
- "ATTR": new RegExp( "^" + attributes ),
3790
- "PSEUDO": new RegExp( "^" + pseudos ),
3791
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
3792
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
3793
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
3794
- // For use in libraries implementing .is()
3795
- // We use this for POS matching in `select`
3796
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
3797
- whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
3798
- },
3799
-
3800
- rsibling = /[\x20\t\r\n\f]*[+~]/,
3801
-
3802
- rnative = /^[^{]+\{\s*\[native code/,
3803
-
3804
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
3805
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
3806
-
3807
- rinputs = /^(?:input|select|textarea|button)$/i,
3808
- rheader = /^h\d$/i,
3809
-
3810
- rescape = /'|\\/g,
3811
- rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
3812
-
3813
- // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
3814
- runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
3815
- funescape = function( _, escaped ) {
3816
- var high = "0x" + escaped - 0x10000;
3817
- // NaN means non-codepoint
3818
- return high !== high ?
3819
- escaped :
3820
- // BMP codepoint
3821
- high < 0 ?
3822
- String.fromCharCode( high + 0x10000 ) :
3823
- // Supplemental Plane codepoint (surrogate pair)
3824
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
3825
- };
3826
-
3827
- // Use a stripped-down slice if we can't use a native one
3828
- try {
3829
- slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
3830
- } catch ( e ) {
3831
- slice = function( i ) {
3832
- var elem,
3833
- results = [];
3834
- while ( (elem = this[i++]) ) {
3835
- results.push( elem );
3836
- }
3837
- return results;
3838
- };
3839
- }
3840
-
3841
- /**
3842
- * For feature detection
3843
- * @param {Function} fn The function to test for native support
3844
- */
3845
- function isNative( fn ) {
3846
- return rnative.test( fn + "" );
3847
- }
3848
-
3849
- /**
3850
- * Create key-value caches of limited size
3851
- * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
3852
- * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
3853
- * deleting the oldest entry
3854
- */
3855
- function createCache() {
3856
- var cache,
3857
- keys = [];
3858
-
3859
- return (cache = function( key, value ) {
3860
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
3861
- if ( keys.push( key += " " ) > Expr.cacheLength ) {
3862
- // Only keep the most recent entries
3863
- delete cache[ keys.shift() ];
3864
- }
3865
- return (cache[ key ] = value);
3866
- });
3867
- }
3868
-
3869
- /**
3870
- * Mark a function for special use by Sizzle
3871
- * @param {Function} fn The function to mark
3872
- */
3873
- function markFunction( fn ) {
3874
- fn[ expando ] = true;
3875
- return fn;
3876
- }
3877
-
3878
- /**
3879
- * Support testing using an element
3880
- * @param {Function} fn Passed the created div and expects a boolean result
3881
- */
3882
- function assert( fn ) {
3883
- var div = document.createElement("div");
3884
-
3885
- try {
3886
- return fn( div );
3887
- } catch (e) {
3888
- return false;
3889
- } finally {
3890
- // release memory in IE
3891
- div = null;
3892
- }
3893
- }
3894
-
3895
- function Sizzle( selector, context, results, seed ) {
3896
- var match, elem, m, nodeType,
3897
- // QSA vars
3898
- i, groups, old, nid, newContext, newSelector;
3899
-
3900
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
3901
- setDocument( context );
3902
- }
3903
-
3904
- context = context || document;
3905
- results = results || [];
3906
-
3907
- if ( !selector || typeof selector !== "string" ) {
3908
- return results;
3909
- }
3910
-
3911
- if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
3912
- return [];
3913
- }
3914
-
3915
- if ( !documentIsXML && !seed ) {
3916
-
3917
- // Shortcuts
3918
- if ( (match = rquickExpr.exec( selector )) ) {
3919
- // Speed-up: Sizzle("#ID")
3920
- if ( (m = match[1]) ) {
3921
- if ( nodeType === 9 ) {
3922
- elem = context.getElementById( m );
3923
- // Check parentNode to catch when Blackberry 4.6 returns
3924
- // nodes that are no longer in the document #6963
3925
- if ( elem && elem.parentNode ) {
3926
- // Handle the case where IE, Opera, and Webkit return items
3927
- // by name instead of ID
3928
- if ( elem.id === m ) {
3929
- results.push( elem );
3930
- return results;
3931
- }
3932
- } else {
3933
- return results;
3934
- }
3935
- } else {
3936
- // Context is not a document
3937
- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
3938
- contains( context, elem ) && elem.id === m ) {
3939
- results.push( elem );
3940
- return results;
3941
- }
3942
- }
3943
-
3944
- // Speed-up: Sizzle("TAG")
3945
- } else if ( match[2] ) {
3946
- push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
3947
- return results;
3948
-
3949
- // Speed-up: Sizzle(".CLASS")
3950
- } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
3951
- push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
3952
- return results;
3953
- }
3954
- }
3955
-
3956
- // QSA path
3957
- if ( support.qsa && !rbuggyQSA.test(selector) ) {
3958
- old = true;
3959
- nid = expando;
3960
- newContext = context;
3961
- newSelector = nodeType === 9 && selector;
3962
-
3963
- // qSA works strangely on Element-rooted queries
3964
- // We can work around this by specifying an extra ID on the root
3965
- // and working up from there (Thanks to Andrew Dupont for the technique)
3966
- // IE 8 doesn't work on object elements
3967
- if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
3968
- groups = tokenize( selector );
3969
-
3970
- if ( (old = context.getAttribute("id")) ) {
3971
- nid = old.replace( rescape, "\\$&" );
3972
- } else {
3973
- context.setAttribute( "id", nid );
3974
- }
3975
- nid = "[id='" + nid + "'] ";
3976
-
3977
- i = groups.length;
3978
- while ( i-- ) {
3979
- groups[i] = nid + toSelector( groups[i] );
3980
- }
3981
- newContext = rsibling.test( selector ) && context.parentNode || context;
3982
- newSelector = groups.join(",");
3983
- }
3984
-
3985
- if ( newSelector ) {
3986
- try {
3987
- push.apply( results, slice.call( newContext.querySelectorAll(
3988
- newSelector
3989
- ), 0 ) );
3990
- return results;
3991
- } catch(qsaError) {
3992
- } finally {
3993
- if ( !old ) {
3994
- context.removeAttribute("id");
3995
- }
3996
- }
3997
- }
3998
- }
3999
- }
4000
-
4001
- // All others
4002
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
4003
- }
4004
-
4005
- /**
4006
- * Detect xml
4007
- * @param {Element|Object} elem An element or a document
4008
- */
4009
- isXML = Sizzle.isXML = function( elem ) {
4010
- // documentElement is verified for cases where it doesn't yet exist
4011
- // (such as loading iframes in IE - #4833)
4012
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
4013
- return documentElement ? documentElement.nodeName !== "HTML" : false;
4014
- };
4015
-
4016
- /**
4017
- * Sets document-related variables once based on the current document
4018
- * @param {Element|Object} [doc] An element or document object to use to set the document
4019
- * @returns {Object} Returns the current document
4020
- */
4021
- setDocument = Sizzle.setDocument = function( node ) {
4022
- var doc = node ? node.ownerDocument || node : preferredDoc;
4023
-
4024
- // If no document and documentElement is available, return
4025
- if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
4026
- return document;
4027
- }
4028
-
4029
- // Set our document
4030
- document = doc;
4031
- docElem = doc.documentElement;
4032
-
4033
- // Support tests
4034
- documentIsXML = isXML( doc );
4035
-
4036
- // Check if getElementsByTagName("*") returns only elements
4037
- support.tagNameNoComments = assert(function( div ) {
4038
- div.appendChild( doc.createComment("") );
4039
- return !div.getElementsByTagName("*").length;
4040
- });
4041
-
4042
- // Check if attributes should be retrieved by attribute nodes
4043
- support.attributes = assert(function( div ) {
4044
- div.innerHTML = "<select></select>";
4045
- var type = typeof div.lastChild.getAttribute("multiple");
4046
- // IE8 returns a string for some attributes even when not present
4047
- return type !== "boolean" && type !== "string";
4048
- });
4049
-
4050
- // Check if getElementsByClassName can be trusted
4051
- support.getByClassName = assert(function( div ) {
4052
- // Opera can't find a second classname (in 9.6)
4053
- div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
4054
- if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
4055
- return false;
4056
- }
4057
-
4058
- // Safari 3.2 caches class attributes and doesn't catch changes
4059
- div.lastChild.className = "e";
4060
- return div.getElementsByClassName("e").length === 2;
4061
- });
4062
-
4063
- // Check if getElementById returns elements by name
4064
- // Check if getElementsByName privileges form controls or returns elements by ID
4065
- support.getByName = assert(function( div ) {
4066
- // Inject content
4067
- div.id = expando + 0;
4068
- div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
4069
- docElem.insertBefore( div, docElem.firstChild );
4070
-
4071
- // Test
4072
- var pass = doc.getElementsByName &&
4073
- // buggy browsers will return fewer than the correct 2
4074
- doc.getElementsByName( expando ).length === 2 +
4075
- // buggy browsers will return more than the correct 0
4076
- doc.getElementsByName( expando + 0 ).length;
4077
- support.getIdNotName = !doc.getElementById( expando );
4078
-
4079
- // Cleanup
4080
- docElem.removeChild( div );
4081
-
4082
- return pass;
4083
- });
4084
-
4085
- // IE6/7 return modified attributes
4086
- Expr.attrHandle = assert(function( div ) {
4087
- div.innerHTML = "<a href='#'></a>";
4088
- return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
4089
- div.firstChild.getAttribute("href") === "#";
4090
- }) ?
4091
- {} :
4092
- {
4093
- "href": function( elem ) {
4094
- return elem.getAttribute( "href", 2 );
4095
- },
4096
- "type": function( elem ) {
4097
- return elem.getAttribute("type");
4098
- }
4099
- };
4100
-
4101
- // ID find and filter
4102
- if ( support.getIdNotName ) {
4103
- Expr.find["ID"] = function( id, context ) {
4104
- if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
4105
- var m = context.getElementById( id );
4106
- // Check parentNode to catch when Blackberry 4.6 returns
4107
- // nodes that are no longer in the document #6963
4108
- return m && m.parentNode ? [m] : [];
4109
- }
4110
- };
4111
- Expr.filter["ID"] = function( id ) {
4112
- var attrId = id.replace( runescape, funescape );
4113
- return function( elem ) {
4114
- return elem.getAttribute("id") === attrId;
4115
- };
4116
- };
4117
- } else {
4118
- Expr.find["ID"] = function( id, context ) {
4119
- if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
4120
- var m = context.getElementById( id );
4121
-
4122
- return m ?
4123
- m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
4124
- [m] :
4125
- undefined :
4126
- [];
4127
- }
4128
- };
4129
- Expr.filter["ID"] = function( id ) {
4130
- var attrId = id.replace( runescape, funescape );
4131
- return function( elem ) {
4132
- var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
4133
- return node && node.value === attrId;
4134
- };
4135
- };
4136
- }
4137
-
4138
- // Tag
4139
- Expr.find["TAG"] = support.tagNameNoComments ?
4140
- function( tag, context ) {
4141
- if ( typeof context.getElementsByTagName !== strundefined ) {
4142
- return context.getElementsByTagName( tag );
4143
- }
4144
- } :
4145
- function( tag, context ) {
4146
- var elem,
4147
- tmp = [],
4148
- i = 0,
4149
- results = context.getElementsByTagName( tag );
4150
-
4151
- // Filter out possible comments
4152
- if ( tag === "*" ) {
4153
- while ( (elem = results[i++]) ) {
4154
- if ( elem.nodeType === 1 ) {
4155
- tmp.push( elem );
4156
- }
4157
- }
4158
-
4159
- return tmp;
4160
- }
4161
- return results;
4162
- };
4163
-
4164
- // Name
4165
- Expr.find["NAME"] = support.getByName && function( tag, context ) {
4166
- if ( typeof context.getElementsByName !== strundefined ) {
4167
- return context.getElementsByName( name );
4168
- }
4169
- };
4170
-
4171
- // Class
4172
- Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
4173
- if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
4174
- return context.getElementsByClassName( className );
4175
- }
4176
- };
4177
-
4178
- // QSA and matchesSelector support
4179
-
4180
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
4181
- rbuggyMatches = [];
4182
-
4183
- // qSa(:focus) reports false when true (Chrome 21),
4184
- // no need to also add to buggyMatches since matches checks buggyQSA
4185
- // A support test would require too much code (would include document ready)
4186
- rbuggyQSA = [ ":focus" ];
4187
-
4188
- if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
4189
- // Build QSA regex
4190
- // Regex strategy adopted from Diego Perini
4191
- assert(function( div ) {
4192
- // Select is set to empty string on purpose
4193
- // This is to test IE's treatment of not explictly
4194
- // setting a boolean content attribute,
4195
- // since its presence should be enough
4196
- // http://bugs.jquery.com/ticket/12359
4197
- div.innerHTML = "<select><option selected=''></option></select>";
4198
-
4199
- // IE8 - Some boolean attributes are not treated correctly
4200
- if ( !div.querySelectorAll("[selected]").length ) {
4201
- rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
4202
- }
4203
-
4204
- // Webkit/Opera - :checked should return selected option elements
4205
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
4206
- // IE8 throws error here and will not see later tests
4207
- if ( !div.querySelectorAll(":checked").length ) {
4208
- rbuggyQSA.push(":checked");
4209
- }
4210
- });
4211
-
4212
- assert(function( div ) {
4213
-
4214
- // Opera 10-12/IE8 - ^= $= *= and empty values
4215
- // Should not select anything
4216
- div.innerHTML = "<input type='hidden' i=''/>";
4217
- if ( div.querySelectorAll("[i^='']").length ) {
4218
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
4219
- }
4220
-
4221
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
4222
- // IE8 throws error here and will not see later tests
4223
- if ( !div.querySelectorAll(":enabled").length ) {
4224
- rbuggyQSA.push( ":enabled", ":disabled" );
4225
- }
4226
-
4227
- // Opera 10-11 does not throw on post-comma invalid pseudos
4228
- div.querySelectorAll("*,:x");
4229
- rbuggyQSA.push(",.*:");
4230
- });
4231
- }
4232
-
4233
- if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
4234
- docElem.mozMatchesSelector ||
4235
- docElem.webkitMatchesSelector ||
4236
- docElem.oMatchesSelector ||
4237
- docElem.msMatchesSelector) )) ) {
4238
-
4239
- assert(function( div ) {
4240
- // Check to see if it's possible to do matchesSelector
4241
- // on a disconnected node (IE 9)
4242
- support.disconnectedMatch = matches.call( div, "div" );
4243
-
4244
- // This should fail with an exception
4245
- // Gecko does not error, returns false instead
4246
- matches.call( div, "[s!='']:x" );
4247
- rbuggyMatches.push( "!=", pseudos );
4248
- });
4249
- }
4250
-
4251
- rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
4252
- rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
4253
-
4254
- // Element contains another
4255
- // Purposefully does not implement inclusive descendent
4256
- // As in, an element does not contain itself
4257
- contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
4258
- function( a, b ) {
4259
- var adown = a.nodeType === 9 ? a.documentElement : a,
4260
- bup = b && b.parentNode;
4261
- return a === bup || !!( bup && bup.nodeType === 1 && (
4262
- adown.contains ?
4263
- adown.contains( bup ) :
4264
- a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
4265
- ));
4266
- } :
4267
- function( a, b ) {
4268
- if ( b ) {
4269
- while ( (b = b.parentNode) ) {
4270
- if ( b === a ) {
4271
- return true;
4272
- }
4273
- }
4274
- }
4275
- return false;
4276
- };
4277
-
4278
- // Document order sorting
4279
- sortOrder = docElem.compareDocumentPosition ?
4280
- function( a, b ) {
4281
- var compare;
4282
-
4283
- if ( a === b ) {
4284
- hasDuplicate = true;
4285
- return 0;
4286
- }
4287
-
4288
- if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
4289
- if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
4290
- if ( a === doc || contains( preferredDoc, a ) ) {
4291
- return -1;
4292
- }
4293
- if ( b === doc || contains( preferredDoc, b ) ) {
4294
- return 1;
4295
- }
4296
- return 0;
4297
- }
4298
- return compare & 4 ? -1 : 1;
4299
- }
4300
-
4301
- return a.compareDocumentPosition ? -1 : 1;
4302
- } :
4303
- function( a, b ) {
4304
- var cur,
4305
- i = 0,
4306
- aup = a.parentNode,
4307
- bup = b.parentNode,
4308
- ap = [ a ],
4309
- bp = [ b ];
4310
-
4311
- // Exit early if the nodes are identical
4312
- if ( a === b ) {
4313
- hasDuplicate = true;
4314
- return 0;
4315
-
4316
- // Parentless nodes are either documents or disconnected
4317
- } else if ( !aup || !bup ) {
4318
- return a === doc ? -1 :
4319
- b === doc ? 1 :
4320
- aup ? -1 :
4321
- bup ? 1 :
4322
- 0;
4323
-
4324
- // If the nodes are siblings, we can do a quick check
4325
- } else if ( aup === bup ) {
4326
- return siblingCheck( a, b );
4327
- }
4328
-
4329
- // Otherwise we need full lists of their ancestors for comparison
4330
- cur = a;
4331
- while ( (cur = cur.parentNode) ) {
4332
- ap.unshift( cur );
4333
- }
4334
- cur = b;
4335
- while ( (cur = cur.parentNode) ) {
4336
- bp.unshift( cur );
4337
- }
4338
-
4339
- // Walk down the tree looking for a discrepancy
4340
- while ( ap[i] === bp[i] ) {
4341
- i++;
4342
- }
4343
-
4344
- return i ?
4345
- // Do a sibling check if the nodes have a common ancestor
4346
- siblingCheck( ap[i], bp[i] ) :
4347
-
4348
- // Otherwise nodes in our document sort first
4349
- ap[i] === preferredDoc ? -1 :
4350
- bp[i] === preferredDoc ? 1 :
4351
- 0;
4352
- };
4353
-
4354
- // Always assume the presence of duplicates if sort doesn't
4355
- // pass them to our comparison function (as in Google Chrome).
4356
- hasDuplicate = false;
4357
- [0, 0].sort( sortOrder );
4358
- support.detectDuplicates = hasDuplicate;
4359
-
4360
- return document;
4361
- };
4362
-
4363
- Sizzle.matches = function( expr, elements ) {
4364
- return Sizzle( expr, null, null, elements );
4365
- };
4366
-
4367
- Sizzle.matchesSelector = function( elem, expr ) {
4368
- // Set document vars if needed
4369
- if ( ( elem.ownerDocument || elem ) !== document ) {
4370
- setDocument( elem );
4371
- }
4372
-
4373
- // Make sure that attribute selectors are quoted
4374
- expr = expr.replace( rattributeQuotes, "='$1']" );
4375
-
4376
- // rbuggyQSA always contains :focus, so no need for an existence check
4377
- if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
4378
- try {
4379
- var ret = matches.call( elem, expr );
4380
-
4381
- // IE 9's matchesSelector returns false on disconnected nodes
4382
- if ( ret || support.disconnectedMatch ||
4383
- // As well, disconnected nodes are said to be in a document
4384
- // fragment in IE 9
4385
- elem.document && elem.document.nodeType !== 11 ) {
4386
- return ret;
4387
- }
4388
- } catch(e) {}
4389
- }
4390
-
4391
- return Sizzle( expr, document, null, [elem] ).length > 0;
4392
- };
4393
-
4394
- Sizzle.contains = function( context, elem ) {
4395
- // Set document vars if needed
4396
- if ( ( context.ownerDocument || context ) !== document ) {
4397
- setDocument( context );
4398
- }
4399
- return contains( context, elem );
4400
- };
4401
-
4402
- Sizzle.attr = function( elem, name ) {
4403
- var val;
4404
-
4405
- // Set document vars if needed
4406
- if ( ( elem.ownerDocument || elem ) !== document ) {
4407
- setDocument( elem );
4408
- }
4409
-
4410
- if ( !documentIsXML ) {
4411
- name = name.toLowerCase();
4412
- }
4413
- if ( (val = Expr.attrHandle[ name ]) ) {
4414
- return val( elem );
4415
- }
4416
- if ( documentIsXML || support.attributes ) {
4417
- return elem.getAttribute( name );
4418
- }
4419
- return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
4420
- name :
4421
- val && val.specified ? val.value : null;
4422
- };
4423
-
4424
- Sizzle.error = function( msg ) {
4425
- throw new Error( "Syntax error, unrecognized expression: " + msg );
4426
- };
4427
-
4428
- // Document sorting and removing duplicates
4429
- Sizzle.uniqueSort = function( results ) {
4430
- var elem,
4431
- duplicates = [],
4432
- i = 1,
4433
- j = 0;
4434
-
4435
- // Unless we *know* we can detect duplicates, assume their presence
4436
- hasDuplicate = !support.detectDuplicates;
4437
- results.sort( sortOrder );
4438
-
4439
- if ( hasDuplicate ) {
4440
- for ( ; (elem = results[i]); i++ ) {
4441
- if ( elem === results[ i - 1 ] ) {
4442
- j = duplicates.push( i );
4443
- }
4444
- }
4445
- while ( j-- ) {
4446
- results.splice( duplicates[ j ], 1 );
4447
- }
4448
- }
4449
-
4450
- return results;
4451
- };
4452
-
4453
- function siblingCheck( a, b ) {
4454
- var cur = b && a,
4455
- diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
4456
-
4457
- // Use IE sourceIndex if available on both nodes
4458
- if ( diff ) {
4459
- return diff;
4460
- }
4461
-
4462
- // Check if b follows a
4463
- if ( cur ) {
4464
- while ( (cur = cur.nextSibling) ) {
4465
- if ( cur === b ) {
4466
- return -1;
4467
- }
4468
- }
4469
- }
4470
-
4471
- return a ? 1 : -1;
4472
- }
4473
-
4474
- // Returns a function to use in pseudos for input types
4475
- function createInputPseudo( type ) {
4476
- return function( elem ) {
4477
- var name = elem.nodeName.toLowerCase();
4478
- return name === "input" && elem.type === type;
4479
- };
4480
- }
4481
-
4482
- // Returns a function to use in pseudos for buttons
4483
- function createButtonPseudo( type ) {
4484
- return function( elem ) {
4485
- var name = elem.nodeName.toLowerCase();
4486
- return (name === "input" || name === "button") && elem.type === type;
4487
- };
4488
- }
4489
-
4490
- // Returns a function to use in pseudos for positionals
4491
- function createPositionalPseudo( fn ) {
4492
- return markFunction(function( argument ) {
4493
- argument = +argument;
4494
- return markFunction(function( seed, matches ) {
4495
- var j,
4496
- matchIndexes = fn( [], seed.length, argument ),
4497
- i = matchIndexes.length;
4498
-
4499
- // Match elements found at the specified indexes
4500
- while ( i-- ) {
4501
- if ( seed[ (j = matchIndexes[i]) ] ) {
4502
- seed[j] = !(matches[j] = seed[j]);
4503
- }
4504
- }
4505
- });
4506
- });
4507
- }
4508
-
4509
- /**
4510
- * Utility function for retrieving the text value of an array of DOM nodes
4511
- * @param {Array|Element} elem
4512
- */
4513
- getText = Sizzle.getText = function( elem ) {
4514
- var node,
4515
- ret = "",
4516
- i = 0,
4517
- nodeType = elem.nodeType;
4518
-
4519
- if ( !nodeType ) {
4520
- // If no nodeType, this is expected to be an array
4521
- for ( ; (node = elem[i]); i++ ) {
4522
- // Do not traverse comment nodes
4523
- ret += getText( node );
4524
- }
4525
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
4526
- // Use textContent for elements
4527
- // innerText usage removed for consistency of new lines (see #11153)
4528
- if ( typeof elem.textContent === "string" ) {
4529
- return elem.textContent;
4530
- } else {
4531
- // Traverse its children
4532
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
4533
- ret += getText( elem );
4534
- }
4535
- }
4536
- } else if ( nodeType === 3 || nodeType === 4 ) {
4537
- return elem.nodeValue;
4538
- }
4539
- // Do not include comment or processing instruction nodes
4540
-
4541
- return ret;
4542
- };
4543
-
4544
- Expr = Sizzle.selectors = {
4545
-
4546
- // Can be adjusted by the user
4547
- cacheLength: 50,
4548
-
4549
- createPseudo: markFunction,
4550
-
4551
- match: matchExpr,
4552
-
4553
- find: {},
4554
-
4555
- relative: {
4556
- ">": { dir: "parentNode", first: true },
4557
- " ": { dir: "parentNode" },
4558
- "+": { dir: "previousSibling", first: true },
4559
- "~": { dir: "previousSibling" }
4560
- },
4561
-
4562
- preFilter: {
4563
- "ATTR": function( match ) {
4564
- match[1] = match[1].replace( runescape, funescape );
4565
-
4566
- // Move the given value to match[3] whether quoted or unquoted
4567
- match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
4568
-
4569
- if ( match[2] === "~=" ) {
4570
- match[3] = " " + match[3] + " ";
4571
- }
4572
-
4573
- return match.slice( 0, 4 );
4574
- },
4575
-
4576
- "CHILD": function( match ) {
4577
- /* matches from matchExpr["CHILD"]
4578
- 1 type (only|nth|...)
4579
- 2 what (child|of-type)
4580
- 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
4581
- 4 xn-component of xn+y argument ([+-]?\d*n|)
4582
- 5 sign of xn-component
4583
- 6 x of xn-component
4584
- 7 sign of y-component
4585
- 8 y of y-component
4586
- */
4587
- match[1] = match[1].toLowerCase();
4588
-
4589
- if ( match[1].slice( 0, 3 ) === "nth" ) {
4590
- // nth-* requires argument
4591
- if ( !match[3] ) {
4592
- Sizzle.error( match[0] );
4593
- }
4594
-
4595
- // numeric x and y parameters for Expr.filter.CHILD
4596
- // remember that false/true cast respectively to 0/1
4597
- match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
4598
- match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
4599
-
4600
- // other types prohibit arguments
4601
- } else if ( match[3] ) {
4602
- Sizzle.error( match[0] );
4603
- }
4604
-
4605
- return match;
4606
- },
4607
-
4608
- "PSEUDO": function( match ) {
4609
- var excess,
4610
- unquoted = !match[5] && match[2];
4611
-
4612
- if ( matchExpr["CHILD"].test( match[0] ) ) {
4613
- return null;
4614
- }
4615
-
4616
- // Accept quoted arguments as-is
4617
- if ( match[4] ) {
4618
- match[2] = match[4];
4619
-
4620
- // Strip excess characters from unquoted arguments
4621
- } else if ( unquoted && rpseudo.test( unquoted ) &&
4622
- // Get excess from tokenize (recursively)
4623
- (excess = tokenize( unquoted, true )) &&
4624
- // advance to the next closing parenthesis
4625
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
4626
-
4627
- // excess is a negative index
4628
- match[0] = match[0].slice( 0, excess );
4629
- match[2] = unquoted.slice( 0, excess );
4630
- }
4631
-
4632
- // Return only captures needed by the pseudo filter method (type and argument)
4633
- return match.slice( 0, 3 );
4634
- }
4635
- },
4636
-
4637
- filter: {
4638
-
4639
- "TAG": function( nodeName ) {
4640
- if ( nodeName === "*" ) {
4641
- return function() { return true; };
4642
- }
4643
-
4644
- nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
4645
- return function( elem ) {
4646
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
4647
- };
4648
- },
4649
-
4650
- "CLASS": function( className ) {
4651
- var pattern = classCache[ className + " " ];
4652
-
4653
- return pattern ||
4654
- (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
4655
- classCache( className, function( elem ) {
4656
- return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
4657
- });
4658
- },
4659
-
4660
- "ATTR": function( name, operator, check ) {
4661
- return function( elem ) {
4662
- var result = Sizzle.attr( elem, name );
4663
-
4664
- if ( result == null ) {
4665
- return operator === "!=";
4666
- }
4667
- if ( !operator ) {
4668
- return true;
4669
- }
4670
-
4671
- result += "";
4672
-
4673
- return operator === "=" ? result === check :
4674
- operator === "!=" ? result !== check :
4675
- operator === "^=" ? check && result.indexOf( check ) === 0 :
4676
- operator === "*=" ? check && result.indexOf( check ) > -1 :
4677
- operator === "$=" ? check && result.slice( -check.length ) === check :
4678
- operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
4679
- operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
4680
- false;
4681
- };
4682
- },
4683
-
4684
- "CHILD": function( type, what, argument, first, last ) {
4685
- var simple = type.slice( 0, 3 ) !== "nth",
4686
- forward = type.slice( -4 ) !== "last",
4687
- ofType = what === "of-type";
4688
-
4689
- return first === 1 && last === 0 ?
4690
-
4691
- // Shortcut for :nth-*(n)
4692
- function( elem ) {
4693
- return !!elem.parentNode;
4694
- } :
4695
-
4696
- function( elem, context, xml ) {
4697
- var cache, outerCache, node, diff, nodeIndex, start,
4698
- dir = simple !== forward ? "nextSibling" : "previousSibling",
4699
- parent = elem.parentNode,
4700
- name = ofType && elem.nodeName.toLowerCase(),
4701
- useCache = !xml && !ofType;
4702
-
4703
- if ( parent ) {
4704
-
4705
- // :(first|last|only)-(child|of-type)
4706
- if ( simple ) {
4707
- while ( dir ) {
4708
- node = elem;
4709
- while ( (node = node[ dir ]) ) {
4710
- if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
4711
- return false;
4712
- }
4713
- }
4714
- // Reverse direction for :only-* (if we haven't yet done so)
4715
- start = dir = type === "only" && !start && "nextSibling";
4716
- }
4717
- return true;
4718
- }
4719
-
4720
- start = [ forward ? parent.firstChild : parent.lastChild ];
4721
-
4722
- // non-xml :nth-child(...) stores cache data on `parent`
4723
- if ( forward && useCache ) {
4724
- // Seek `elem` from a previously-cached index
4725
- outerCache = parent[ expando ] || (parent[ expando ] = {});
4726
- cache = outerCache[ type ] || [];
4727
- nodeIndex = cache[0] === dirruns && cache[1];
4728
- diff = cache[0] === dirruns && cache[2];
4729
- node = nodeIndex && parent.childNodes[ nodeIndex ];
4730
-
4731
- while ( (node = ++nodeIndex && node && node[ dir ] ||
4732
-
4733
- // Fallback to seeking `elem` from the start
4734
- (diff = nodeIndex = 0) || start.pop()) ) {
4735
-
4736
- // When found, cache indexes on `parent` and break
4737
- if ( node.nodeType === 1 && ++diff && node === elem ) {
4738
- outerCache[ type ] = [ dirruns, nodeIndex, diff ];
4739
- break;
4740
- }
4741
- }
4742
-
4743
- // Use previously-cached element index if available
4744
- } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
4745
- diff = cache[1];
4746
-
4747
- // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
4748
- } else {
4749
- // Use the same loop as above to seek `elem` from the start
4750
- while ( (node = ++nodeIndex && node && node[ dir ] ||
4751
- (diff = nodeIndex = 0) || start.pop()) ) {
4752
-
4753
- if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
4754
- // Cache the index of each encountered element
4755
- if ( useCache ) {
4756
- (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
4757
- }
4758
-
4759
- if ( node === elem ) {
4760
- break;
4761
- }
4762
- }
4763
- }
4764
- }
4765
-
4766
- // Incorporate the offset, then check against cycle size
4767
- diff -= last;
4768
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
4769
- }
4770
- };
4771
- },
4772
-
4773
- "PSEUDO": function( pseudo, argument ) {
4774
- // pseudo-class names are case-insensitive
4775
- // http://www.w3.org/TR/selectors/#pseudo-classes
4776
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
4777
- // Remember that setFilters inherits from pseudos
4778
- var args,
4779
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
4780
- Sizzle.error( "unsupported pseudo: " + pseudo );
4781
-
4782
- // The user may use createPseudo to indicate that
4783
- // arguments are needed to create the filter function
4784
- // just as Sizzle does
4785
- if ( fn[ expando ] ) {
4786
- return fn( argument );
4787
- }
4788
-
4789
- // But maintain support for old signatures
4790
- if ( fn.length > 1 ) {
4791
- args = [ pseudo, pseudo, "", argument ];
4792
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
4793
- markFunction(function( seed, matches ) {
4794
- var idx,
4795
- matched = fn( seed, argument ),
4796
- i = matched.length;
4797
- while ( i-- ) {
4798
- idx = indexOf.call( seed, matched[i] );
4799
- seed[ idx ] = !( matches[ idx ] = matched[i] );
4800
- }
4801
- }) :
4802
- function( elem ) {
4803
- return fn( elem, 0, args );
4804
- };
4805
- }
4806
-
4807
-
4808
- return fn;
4809
- }
4810
- },
4811
-
4812
- pseudos: {
4813
- // Potentially complex pseudos
4814
- "not": markFunction(function( selector ) {
4815
- // Trim the selector passed to compile
4816
- // to avoid treating leading and trailing
4817
- // spaces as combinators
4818
- var input = [],
4819
- results = [],
4820
- matcher = compile( selector.replace( rtrim, "$1" ) );
4821
-
4822
- return matcher[ expando ] ?
4823
- markFunction(function( seed, matches, context, xml ) {
4824
- var elem,
4825
- unmatched = matcher( seed, null, xml, [] ),
4826
- i = seed.length;
4827
-
4828
- // Match elements unmatched by `matcher`
4829
- while ( i-- ) {
4830
- if ( (elem = unmatched[i]) ) {
4831
- seed[i] = !(matches[i] = elem);
4832
- }
4833
- }
4834
- }) :
4835
- function( elem, context, xml ) {
4836
- input[0] = elem;
4837
- matcher( input, null, xml, results );
4838
- return !results.pop();
4839
- };
4840
- }),
4841
-
4842
- "has": markFunction(function( selector ) {
4843
- return function( elem ) {
4844
- return Sizzle( selector, elem ).length > 0;
4845
- };
4846
- }),
4847
-
4848
- "contains": markFunction(function( text ) {
4849
- return function( elem ) {
4850
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
4851
- };
4852
- }),
4853
-
4854
- // "Whether an element is represented by a :lang() selector
4855
- // is based solely on the element's language value
4856
- // being equal to the identifier C,
4857
- // or beginning with the identifier C immediately followed by "-".
4858
- // The matching of C against the element's language value is performed case-insensitively.
4859
- // The identifier C does not have to be a valid language name."
4860
- // http://www.w3.org/TR/selectors/#lang-pseudo
4861
- "lang": markFunction( function( lang ) {
4862
- // lang value must be a valid identifider
4863
- if ( !ridentifier.test(lang || "") ) {
4864
- Sizzle.error( "unsupported lang: " + lang );
4865
- }
4866
- lang = lang.replace( runescape, funescape ).toLowerCase();
4867
- return function( elem ) {
4868
- var elemLang;
4869
- do {
4870
- if ( (elemLang = documentIsXML ?
4871
- elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
4872
- elem.lang) ) {
4873
-
4874
- elemLang = elemLang.toLowerCase();
4875
- return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
4876
- }
4877
- } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
4878
- return false;
4879
- };
4880
- }),
4881
-
4882
- // Miscellaneous
4883
- "target": function( elem ) {
4884
- var hash = window.location && window.location.hash;
4885
- return hash && hash.slice( 1 ) === elem.id;
4886
- },
4887
-
4888
- "root": function( elem ) {
4889
- return elem === docElem;
4890
- },
4891
-
4892
- "focus": function( elem ) {
4893
- return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
4894
- },
4895
-
4896
- // Boolean properties
4897
- "enabled": function( elem ) {
4898
- return elem.disabled === false;
4899
- },
4900
-
4901
- "disabled": function( elem ) {
4902
- return elem.disabled === true;
4903
- },
4904
-
4905
- "checked": function( elem ) {
4906
- // In CSS3, :checked should return both checked and selected elements
4907
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
4908
- var nodeName = elem.nodeName.toLowerCase();
4909
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
4910
- },
4911
-
4912
- "selected": function( elem ) {
4913
- // Accessing this property makes selected-by-default
4914
- // options in Safari work properly
4915
- if ( elem.parentNode ) {
4916
- elem.parentNode.selectedIndex;
4917
- }
4918
-
4919
- return elem.selected === true;
4920
- },
4921
-
4922
- // Contents
4923
- "empty": function( elem ) {
4924
- // http://www.w3.org/TR/selectors/#empty-pseudo
4925
- // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
4926
- // not comment, processing instructions, or others
4927
- // Thanks to Diego Perini for the nodeName shortcut
4928
- // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
4929
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
4930
- if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
4931
- return false;
4932
- }
4933
- }
4934
- return true;
4935
- },
4936
-
4937
- "parent": function( elem ) {
4938
- return !Expr.pseudos["empty"]( elem );
4939
- },
4940
-
4941
- // Element/input types
4942
- "header": function( elem ) {
4943
- return rheader.test( elem.nodeName );
4944
- },
4945
-
4946
- "input": function( elem ) {
4947
- return rinputs.test( elem.nodeName );
4948
- },
4949
-
4950
- "button": function( elem ) {
4951
- var name = elem.nodeName.toLowerCase();
4952
- return name === "input" && elem.type === "button" || name === "button";
4953
- },
4954
-
4955
- "text": function( elem ) {
4956
- var attr;
4957
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
4958
- // use getAttribute instead to test this case
4959
- return elem.nodeName.toLowerCase() === "input" &&
4960
- elem.type === "text" &&
4961
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
4962
- },
4963
-
4964
- // Position-in-collection
4965
- "first": createPositionalPseudo(function() {
4966
- return [ 0 ];
4967
- }),
4968
-
4969
- "last": createPositionalPseudo(function( matchIndexes, length ) {
4970
- return [ length - 1 ];
4971
- }),
4972
-
4973
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
4974
- return [ argument < 0 ? argument + length : argument ];
4975
- }),
4976
-
4977
- "even": createPositionalPseudo(function( matchIndexes, length ) {
4978
- var i = 0;
4979
- for ( ; i < length; i += 2 ) {
4980
- matchIndexes.push( i );
4981
- }
4982
- return matchIndexes;
4983
- }),
4984
-
4985
- "odd": createPositionalPseudo(function( matchIndexes, length ) {
4986
- var i = 1;
4987
- for ( ; i < length; i += 2 ) {
4988
- matchIndexes.push( i );
4989
- }
4990
- return matchIndexes;
4991
- }),
4992
-
4993
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
4994
- var i = argument < 0 ? argument + length : argument;
4995
- for ( ; --i >= 0; ) {
4996
- matchIndexes.push( i );
4997
- }
4998
- return matchIndexes;
4999
- }),
5000
-
5001
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
5002
- var i = argument < 0 ? argument + length : argument;
5003
- for ( ; ++i < length; ) {
5004
- matchIndexes.push( i );
5005
- }
5006
- return matchIndexes;
5007
- })
5008
- }
5009
- };
5010
-
5011
- // Add button/input type pseudos
5012
- for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
5013
- Expr.pseudos[ i ] = createInputPseudo( i );
5014
- }
5015
- for ( i in { submit: true, reset: true } ) {
5016
- Expr.pseudos[ i ] = createButtonPseudo( i );
5017
- }
5018
-
5019
- function tokenize( selector, parseOnly ) {
5020
- var matched, match, tokens, type,
5021
- soFar, groups, preFilters,
5022
- cached = tokenCache[ selector + " " ];
5023
-
5024
- if ( cached ) {
5025
- return parseOnly ? 0 : cached.slice( 0 );
5026
- }
5027
-
5028
- soFar = selector;
5029
- groups = [];
5030
- preFilters = Expr.preFilter;
5031
-
5032
- while ( soFar ) {
5033
-
5034
- // Comma and first run
5035
- if ( !matched || (match = rcomma.exec( soFar )) ) {
5036
- if ( match ) {
5037
- // Don't consume trailing commas as valid
5038
- soFar = soFar.slice( match[0].length ) || soFar;
5039
- }
5040
- groups.push( tokens = [] );
5041
- }
5042
-
5043
- matched = false;
5044
-
5045
- // Combinators
5046
- if ( (match = rcombinators.exec( soFar )) ) {
5047
- matched = match.shift();
5048
- tokens.push( {
5049
- value: matched,
5050
- // Cast descendant combinators to space
5051
- type: match[0].replace( rtrim, " " )
5052
- } );
5053
- soFar = soFar.slice( matched.length );
5054
- }
5055
-
5056
- // Filters
5057
- for ( type in Expr.filter ) {
5058
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
5059
- (match = preFilters[ type ]( match ))) ) {
5060
- matched = match.shift();
5061
- tokens.push( {
5062
- value: matched,
5063
- type: type,
5064
- matches: match
5065
- } );
5066
- soFar = soFar.slice( matched.length );
5067
- }
5068
- }
5069
-
5070
- if ( !matched ) {
5071
- break;
5072
- }
5073
- }
5074
-
5075
- // Return the length of the invalid excess
5076
- // if we're just parsing
5077
- // Otherwise, throw an error or return tokens
5078
- return parseOnly ?
5079
- soFar.length :
5080
- soFar ?
5081
- Sizzle.error( selector ) :
5082
- // Cache the tokens
5083
- tokenCache( selector, groups ).slice( 0 );
5084
- }
5085
-
5086
- function toSelector( tokens ) {
5087
- var i = 0,
5088
- len = tokens.length,
5089
- selector = "";
5090
- for ( ; i < len; i++ ) {
5091
- selector += tokens[i].value;
5092
- }
5093
- return selector;
5094
- }
5095
-
5096
- function addCombinator( matcher, combinator, base ) {
5097
- var dir = combinator.dir,
5098
- checkNonElements = base && dir === "parentNode",
5099
- doneName = done++;
5100
-
5101
- return combinator.first ?
5102
- // Check against closest ancestor/preceding element
5103
- function( elem, context, xml ) {
5104
- while ( (elem = elem[ dir ]) ) {
5105
- if ( elem.nodeType === 1 || checkNonElements ) {
5106
- return matcher( elem, context, xml );
5107
- }
5108
- }
5109
- } :
5110
-
5111
- // Check against all ancestor/preceding elements
5112
- function( elem, context, xml ) {
5113
- var data, cache, outerCache,
5114
- dirkey = dirruns + " " + doneName;
5115
-
5116
- // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
5117
- if ( xml ) {
5118
- while ( (elem = elem[ dir ]) ) {
5119
- if ( elem.nodeType === 1 || checkNonElements ) {
5120
- if ( matcher( elem, context, xml ) ) {
5121
- return true;
5122
- }
5123
- }
5124
- }
5125
- } else {
5126
- while ( (elem = elem[ dir ]) ) {
5127
- if ( elem.nodeType === 1 || checkNonElements ) {
5128
- outerCache = elem[ expando ] || (elem[ expando ] = {});
5129
- if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
5130
- if ( (data = cache[1]) === true || data === cachedruns ) {
5131
- return data === true;
5132
- }
5133
- } else {
5134
- cache = outerCache[ dir ] = [ dirkey ];
5135
- cache[1] = matcher( elem, context, xml ) || cachedruns;
5136
- if ( cache[1] === true ) {
5137
- return true;
5138
- }
5139
- }
5140
- }
5141
- }
5142
- }
5143
- };
5144
- }
5145
-
5146
- function elementMatcher( matchers ) {
5147
- return matchers.length > 1 ?
5148
- function( elem, context, xml ) {
5149
- var i = matchers.length;
5150
- while ( i-- ) {
5151
- if ( !matchers[i]( elem, context, xml ) ) {
5152
- return false;
5153
- }
5154
- }
5155
- return true;
5156
- } :
5157
- matchers[0];
5158
- }
5159
-
5160
- function condense( unmatched, map, filter, context, xml ) {
5161
- var elem,
5162
- newUnmatched = [],
5163
- i = 0,
5164
- len = unmatched.length,
5165
- mapped = map != null;
5166
-
5167
- for ( ; i < len; i++ ) {
5168
- if ( (elem = unmatched[i]) ) {
5169
- if ( !filter || filter( elem, context, xml ) ) {
5170
- newUnmatched.push( elem );
5171
- if ( mapped ) {
5172
- map.push( i );
5173
- }
5174
- }
5175
- }
5176
- }
5177
-
5178
- return newUnmatched;
5179
- }
5180
-
5181
- function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
5182
- if ( postFilter && !postFilter[ expando ] ) {
5183
- postFilter = setMatcher( postFilter );
5184
- }
5185
- if ( postFinder && !postFinder[ expando ] ) {
5186
- postFinder = setMatcher( postFinder, postSelector );
5187
- }
5188
- return markFunction(function( seed, results, context, xml ) {
5189
- var temp, i, elem,
5190
- preMap = [],
5191
- postMap = [],
5192
- preexisting = results.length,
5193
-
5194
- // Get initial elements from seed or context
5195
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
5196
-
5197
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
5198
- matcherIn = preFilter && ( seed || !selector ) ?
5199
- condense( elems, preMap, preFilter, context, xml ) :
5200
- elems,
5201
-
5202
- matcherOut = matcher ?
5203
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
5204
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
5205
-
5206
- // ...intermediate processing is necessary
5207
- [] :
5208
-
5209
- // ...otherwise use results directly
5210
- results :
5211
- matcherIn;
5212
-
5213
- // Find primary matches
5214
- if ( matcher ) {
5215
- matcher( matcherIn, matcherOut, context, xml );
5216
- }
5217
-
5218
- // Apply postFilter
5219
- if ( postFilter ) {
5220
- temp = condense( matcherOut, postMap );
5221
- postFilter( temp, [], context, xml );
5222
-
5223
- // Un-match failing elements by moving them back to matcherIn
5224
- i = temp.length;
5225
- while ( i-- ) {
5226
- if ( (elem = temp[i]) ) {
5227
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
5228
- }
5229
- }
5230
- }
5231
-
5232
- if ( seed ) {
5233
- if ( postFinder || preFilter ) {
5234
- if ( postFinder ) {
5235
- // Get the final matcherOut by condensing this intermediate into postFinder contexts
5236
- temp = [];
5237
- i = matcherOut.length;
5238
- while ( i-- ) {
5239
- if ( (elem = matcherOut[i]) ) {
5240
- // Restore matcherIn since elem is not yet a final match
5241
- temp.push( (matcherIn[i] = elem) );
5242
- }
5243
- }
5244
- postFinder( null, (matcherOut = []), temp, xml );
5245
- }
5246
-
5247
- // Move matched elements from seed to results to keep them synchronized
5248
- i = matcherOut.length;
5249
- while ( i-- ) {
5250
- if ( (elem = matcherOut[i]) &&
5251
- (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
5252
-
5253
- seed[temp] = !(results[temp] = elem);
5254
- }
5255
- }
5256
- }
5257
-
5258
- // Add elements to results, through postFinder if defined
5259
- } else {
5260
- matcherOut = condense(
5261
- matcherOut === results ?
5262
- matcherOut.splice( preexisting, matcherOut.length ) :
5263
- matcherOut
5264
- );
5265
- if ( postFinder ) {
5266
- postFinder( null, results, matcherOut, xml );
5267
- } else {
5268
- push.apply( results, matcherOut );
5269
- }
5270
- }
5271
- });
5272
- }
5273
-
5274
- function matcherFromTokens( tokens ) {
5275
- var checkContext, matcher, j,
5276
- len = tokens.length,
5277
- leadingRelative = Expr.relative[ tokens[0].type ],
5278
- implicitRelative = leadingRelative || Expr.relative[" "],
5279
- i = leadingRelative ? 1 : 0,
5280
-
5281
- // The foundational matcher ensures that elements are reachable from top-level context(s)
5282
- matchContext = addCombinator( function( elem ) {
5283
- return elem === checkContext;
5284
- }, implicitRelative, true ),
5285
- matchAnyContext = addCombinator( function( elem ) {
5286
- return indexOf.call( checkContext, elem ) > -1;
5287
- }, implicitRelative, true ),
5288
- matchers = [ function( elem, context, xml ) {
5289
- return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
5290
- (checkContext = context).nodeType ?
5291
- matchContext( elem, context, xml ) :
5292
- matchAnyContext( elem, context, xml ) );
5293
- } ];
5294
-
5295
- for ( ; i < len; i++ ) {
5296
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
5297
- matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
5298
- } else {
5299
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
5300
-
5301
- // Return special upon seeing a positional matcher
5302
- if ( matcher[ expando ] ) {
5303
- // Find the next relative operator (if any) for proper handling
5304
- j = ++i;
5305
- for ( ; j < len; j++ ) {
5306
- if ( Expr.relative[ tokens[j].type ] ) {
5307
- break;
5308
- }
5309
- }
5310
- return setMatcher(
5311
- i > 1 && elementMatcher( matchers ),
5312
- i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
5313
- matcher,
5314
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
5315
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
5316
- j < len && toSelector( tokens )
5317
- );
5318
- }
5319
- matchers.push( matcher );
5320
- }
5321
- }
5322
-
5323
- return elementMatcher( matchers );
5324
- }
5325
-
5326
- function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
5327
- // A counter to specify which element is currently being matched
5328
- var matcherCachedRuns = 0,
5329
- bySet = setMatchers.length > 0,
5330
- byElement = elementMatchers.length > 0,
5331
- superMatcher = function( seed, context, xml, results, expandContext ) {
5332
- var elem, j, matcher,
5333
- setMatched = [],
5334
- matchedCount = 0,
5335
- i = "0",
5336
- unmatched = seed && [],
5337
- outermost = expandContext != null,
5338
- contextBackup = outermostContext,
5339
- // We must always have either seed elements or context
5340
- elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
5341
- // Use integer dirruns iff this is the outermost matcher
5342
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
5343
-
5344
- if ( outermost ) {
5345
- outermostContext = context !== document && context;
5346
- cachedruns = matcherCachedRuns;
5347
- }
5348
-
5349
- // Add elements passing elementMatchers directly to results
5350
- // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
5351
- for ( ; (elem = elems[i]) != null; i++ ) {
5352
- if ( byElement && elem ) {
5353
- j = 0;
5354
- while ( (matcher = elementMatchers[j++]) ) {
5355
- if ( matcher( elem, context, xml ) ) {
5356
- results.push( elem );
5357
- break;
5358
- }
5359
- }
5360
- if ( outermost ) {
5361
- dirruns = dirrunsUnique;
5362
- cachedruns = ++matcherCachedRuns;
5363
- }
5364
- }
5365
-
5366
- // Track unmatched elements for set filters
5367
- if ( bySet ) {
5368
- // They will have gone through all possible matchers
5369
- if ( (elem = !matcher && elem) ) {
5370
- matchedCount--;
5371
- }
5372
-
5373
- // Lengthen the array for every element, matched or not
5374
- if ( seed ) {
5375
- unmatched.push( elem );
5376
- }
5377
- }
5378
- }
5379
-
5380
- // Apply set filters to unmatched elements
5381
- matchedCount += i;
5382
- if ( bySet && i !== matchedCount ) {
5383
- j = 0;
5384
- while ( (matcher = setMatchers[j++]) ) {
5385
- matcher( unmatched, setMatched, context, xml );
5386
- }
5387
-
5388
- if ( seed ) {
5389
- // Reintegrate element matches to eliminate the need for sorting
5390
- if ( matchedCount > 0 ) {
5391
- while ( i-- ) {
5392
- if ( !(unmatched[i] || setMatched[i]) ) {
5393
- setMatched[i] = pop.call( results );
5394
- }
5395
- }
5396
- }
5397
-
5398
- // Discard index placeholder values to get only actual matches
5399
- setMatched = condense( setMatched );
5400
- }
5401
-
5402
- // Add matches to results
5403
- push.apply( results, setMatched );
5404
-
5405
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
5406
- if ( outermost && !seed && setMatched.length > 0 &&
5407
- ( matchedCount + setMatchers.length ) > 1 ) {
5408
-
5409
- Sizzle.uniqueSort( results );
5410
- }
5411
- }
5412
-
5413
- // Override manipulation of globals by nested matchers
5414
- if ( outermost ) {
5415
- dirruns = dirrunsUnique;
5416
- outermostContext = contextBackup;
5417
- }
5418
-
5419
- return unmatched;
5420
- };
5421
-
5422
- return bySet ?
5423
- markFunction( superMatcher ) :
5424
- superMatcher;
5425
- }
5426
-
5427
- compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
5428
- var i,
5429
- setMatchers = [],
5430
- elementMatchers = [],
5431
- cached = compilerCache[ selector + " " ];
5432
-
5433
- if ( !cached ) {
5434
- // Generate a function of recursive functions that can be used to check each element
5435
- if ( !group ) {
5436
- group = tokenize( selector );
5437
- }
5438
- i = group.length;
5439
- while ( i-- ) {
5440
- cached = matcherFromTokens( group[i] );
5441
- if ( cached[ expando ] ) {
5442
- setMatchers.push( cached );
5443
- } else {
5444
- elementMatchers.push( cached );
5445
- }
5446
- }
5447
-
5448
- // Cache the compiled function
5449
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
5450
- }
5451
- return cached;
5452
- };
5453
-
5454
- function multipleContexts( selector, contexts, results ) {
5455
- var i = 0,
5456
- len = contexts.length;
5457
- for ( ; i < len; i++ ) {
5458
- Sizzle( selector, contexts[i], results );
5459
- }
5460
- return results;
5461
- }
5462
-
5463
- function select( selector, context, results, seed ) {
5464
- var i, tokens, token, type, find,
5465
- match = tokenize( selector );
5466
-
5467
- if ( !seed ) {
5468
- // Try to minimize operations if there is only one group
5469
- if ( match.length === 1 ) {
5470
-
5471
- // Take a shortcut and set the context if the root selector is an ID
5472
- tokens = match[0] = match[0].slice( 0 );
5473
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
5474
- context.nodeType === 9 && !documentIsXML &&
5475
- Expr.relative[ tokens[1].type ] ) {
5476
-
5477
- context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
5478
- if ( !context ) {
5479
- return results;
5480
- }
5481
-
5482
- selector = selector.slice( tokens.shift().value.length );
5483
- }
5484
-
5485
- // Fetch a seed set for right-to-left matching
5486
- i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
5487
- while ( i-- ) {
5488
- token = tokens[i];
5489
-
5490
- // Abort if we hit a combinator
5491
- if ( Expr.relative[ (type = token.type) ] ) {
5492
- break;
5493
- }
5494
- if ( (find = Expr.find[ type ]) ) {
5495
- // Search, expanding context for leading sibling combinators
5496
- if ( (seed = find(
5497
- token.matches[0].replace( runescape, funescape ),
5498
- rsibling.test( tokens[0].type ) && context.parentNode || context
5499
- )) ) {
5500
-
5501
- // If seed is empty or no tokens remain, we can return early
5502
- tokens.splice( i, 1 );
5503
- selector = seed.length && toSelector( tokens );
5504
- if ( !selector ) {
5505
- push.apply( results, slice.call( seed, 0 ) );
5506
- return results;
5507
- }
5508
-
5509
- break;
5510
- }
5511
- }
5512
- }
5513
- }
5514
- }
5515
-
5516
- // Compile and execute a filtering function
5517
- // Provide `match` to avoid retokenization if we modified the selector above
5518
- compile( selector, match )(
5519
- seed,
5520
- context,
5521
- documentIsXML,
5522
- results,
5523
- rsibling.test( selector )
5524
- );
5525
- return results;
5526
- }
5527
-
5528
- // Deprecated
5529
- Expr.pseudos["nth"] = Expr.pseudos["eq"];
5530
-
5531
- // Easy API for creating new setFilters
5532
- function setFilters() {}
5533
- Expr.filters = setFilters.prototype = Expr.pseudos;
5534
- Expr.setFilters = new setFilters();
5535
-
5536
- // Initialize with the default document
5537
- setDocument();
5538
-
5539
- // Override sizzle attribute retrieval
5540
- Sizzle.attr = jQuery.attr;
5541
- jQuery.find = Sizzle;
5542
- jQuery.expr = Sizzle.selectors;
5543
- jQuery.expr[":"] = jQuery.expr.pseudos;
5544
- jQuery.unique = Sizzle.uniqueSort;
5545
- jQuery.text = Sizzle.getText;
5546
- jQuery.isXMLDoc = Sizzle.isXML;
5547
- jQuery.contains = Sizzle.contains;
5548
-
5549
-
5550
- })( window );
5551
- var runtil = /Until$/,
5552
- rparentsprev = /^(?:parents|prev(?:Until|All))/,
5553
- isSimple = /^.[^:#\[\.,]*$/,
5554
- rneedsContext = jQuery.expr.match.needsContext,
5555
- // methods guaranteed to produce a unique set when starting from a unique set
5556
- guaranteedUnique = {
5557
- children: true,
5558
- contents: true,
5559
- next: true,
5560
- prev: true
5561
- };
5562
-
5563
- jQuery.fn.extend({
5564
- find: function( selector ) {
5565
- var i, ret, self,
5566
- len = this.length;
5567
-
5568
- if ( typeof selector !== "string" ) {
5569
- self = this;
5570
- return this.pushStack( jQuery( selector ).filter(function() {
5571
- for ( i = 0; i < len; i++ ) {
5572
- if ( jQuery.contains( self[ i ], this ) ) {
5573
- return true;
5574
- }
5575
- }
5576
- }) );
5577
- }
5578
-
5579
- ret = [];
5580
- for ( i = 0; i < len; i++ ) {
5581
- jQuery.find( selector, this[ i ], ret );
5582
- }
5583
-
5584
- // Needed because $( selector, context ) becomes $( context ).find( selector )
5585
- ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
5586
- ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
5587
- return ret;
5588
- },
5589
-
5590
- has: function( target ) {
5591
- var i,
5592
- targets = jQuery( target, this ),
5593
- len = targets.length;
5594
-
5595
- return this.filter(function() {
5596
- for ( i = 0; i < len; i++ ) {
5597
- if ( jQuery.contains( this, targets[i] ) ) {
5598
- return true;
5599
- }
5600
- }
5601
- });
5602
- },
5603
-
5604
- not: function( selector ) {
5605
- return this.pushStack( winnow(this, selector, false) );
5606
- },
5607
-
5608
- filter: function( selector ) {
5609
- return this.pushStack( winnow(this, selector, true) );
5610
- },
5611
-
5612
- is: function( selector ) {
5613
- return !!selector && (
5614
- typeof selector === "string" ?
5615
- // If this is a positional/relative selector, check membership in the returned set
5616
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
5617
- rneedsContext.test( selector ) ?
5618
- jQuery( selector, this.context ).index( this[0] ) >= 0 :
5619
- jQuery.filter( selector, this ).length > 0 :
5620
- this.filter( selector ).length > 0 );
5621
- },
5622
-
5623
- closest: function( selectors, context ) {
5624
- var cur,
5625
- i = 0,
5626
- l = this.length,
5627
- ret = [],
5628
- pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
5629
- jQuery( selectors, context || this.context ) :
5630
- 0;
5631
-
5632
- for ( ; i < l; i++ ) {
5633
- cur = this[i];
5634
-
5635
- while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
5636
- if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
5637
- ret.push( cur );
5638
- break;
5639
- }
5640
- cur = cur.parentNode;
5641
- }
5642
- }
5643
-
5644
- return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
5645
- },
5646
-
5647
- // Determine the position of an element within
5648
- // the matched set of elements
5649
- index: function( elem ) {
5650
-
5651
- // No argument, return index in parent
5652
- if ( !elem ) {
5653
- return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
5654
- }
5655
-
5656
- // index in selector
5657
- if ( typeof elem === "string" ) {
5658
- return jQuery.inArray( this[0], jQuery( elem ) );
5659
- }
5660
-
5661
- // Locate the position of the desired element
5662
- return jQuery.inArray(
5663
- // If it receives a jQuery object, the first element is used
5664
- elem.jquery ? elem[0] : elem, this );
5665
- },
5666
-
5667
- add: function( selector, context ) {
5668
- var set = typeof selector === "string" ?
5669
- jQuery( selector, context ) :
5670
- jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
5671
- all = jQuery.merge( this.get(), set );
5672
-
5673
- return this.pushStack( jQuery.unique(all) );
5674
- },
5675
-
5676
- addBack: function( selector ) {
5677
- return this.add( selector == null ?
5678
- this.prevObject : this.prevObject.filter(selector)
5679
- );
5680
- }
5681
- });
5682
-
5683
- jQuery.fn.andSelf = jQuery.fn.addBack;
5684
-
5685
- function sibling( cur, dir ) {
5686
- do {
5687
- cur = cur[ dir ];
5688
- } while ( cur && cur.nodeType !== 1 );
5689
-
5690
- return cur;
5691
- }
5692
-
5693
- jQuery.each({
5694
- parent: function( elem ) {
5695
- var parent = elem.parentNode;
5696
- return parent && parent.nodeType !== 11 ? parent : null;
5697
- },
5698
- parents: function( elem ) {
5699
- return jQuery.dir( elem, "parentNode" );
5700
- },
5701
- parentsUntil: function( elem, i, until ) {
5702
- return jQuery.dir( elem, "parentNode", until );
5703
- },
5704
- next: function( elem ) {
5705
- return sibling( elem, "nextSibling" );
5706
- },
5707
- prev: function( elem ) {
5708
- return sibling( elem, "previousSibling" );
5709
- },
5710
- nextAll: function( elem ) {
5711
- return jQuery.dir( elem, "nextSibling" );
5712
- },
5713
- prevAll: function( elem ) {
5714
- return jQuery.dir( elem, "previousSibling" );
5715
- },
5716
- nextUntil: function( elem, i, until ) {
5717
- return jQuery.dir( elem, "nextSibling", until );
5718
- },
5719
- prevUntil: function( elem, i, until ) {
5720
- return jQuery.dir( elem, "previousSibling", until );
5721
- },
5722
- siblings: function( elem ) {
5723
- return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
5724
- },
5725
- children: function( elem ) {
5726
- return jQuery.sibling( elem.firstChild );
5727
- },
5728
- contents: function( elem ) {
5729
- return jQuery.nodeName( elem, "iframe" ) ?
5730
- elem.contentDocument || elem.contentWindow.document :
5731
- jQuery.merge( [], elem.childNodes );
5732
- }
5733
- }, function( name, fn ) {
5734
- jQuery.fn[ name ] = function( until, selector ) {
5735
- var ret = jQuery.map( this, fn, until );
5736
-
5737
- if ( !runtil.test( name ) ) {
5738
- selector = until;
5739
- }
5740
-
5741
- if ( selector && typeof selector === "string" ) {
5742
- ret = jQuery.filter( selector, ret );
5743
- }
5744
-
5745
- ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
5746
-
5747
- if ( this.length > 1 && rparentsprev.test( name ) ) {
5748
- ret = ret.reverse();
5749
- }
5750
-
5751
- return this.pushStack( ret );
5752
- };
5753
- });
5754
-
5755
- jQuery.extend({
5756
- filter: function( expr, elems, not ) {
5757
- if ( not ) {
5758
- expr = ":not(" + expr + ")";
5759
- }
5760
-
5761
- return elems.length === 1 ?
5762
- jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
5763
- jQuery.find.matches(expr, elems);
5764
- },
5765
-
5766
- dir: function( elem, dir, until ) {
5767
- var matched = [],
5768
- cur = elem[ dir ];
5769
-
5770
- while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
5771
- if ( cur.nodeType === 1 ) {
5772
- matched.push( cur );
5773
- }
5774
- cur = cur[dir];
5775
- }
5776
- return matched;
5777
- },
5778
-
5779
- sibling: function( n, elem ) {
5780
- var r = [];
5781
-
5782
- for ( ; n; n = n.nextSibling ) {
5783
- if ( n.nodeType === 1 && n !== elem ) {
5784
- r.push( n );
5785
- }
5786
- }
5787
-
5788
- return r;
5789
- }
5790
- });
5791
-
5792
- // Implement the identical functionality for filter and not
5793
- function winnow( elements, qualifier, keep ) {
5794
-
5795
- // Can't pass null or undefined to indexOf in Firefox 4
5796
- // Set to 0 to skip string check
5797
- qualifier = qualifier || 0;
5798
-
5799
- if ( jQuery.isFunction( qualifier ) ) {
5800
- return jQuery.grep(elements, function( elem, i ) {
5801
- var retVal = !!qualifier.call( elem, i, elem );
5802
- return retVal === keep;
5803
- });
5804
-
5805
- } else if ( qualifier.nodeType ) {
5806
- return jQuery.grep(elements, function( elem ) {
5807
- return ( elem === qualifier ) === keep;
5808
- });
5809
-
5810
- } else if ( typeof qualifier === "string" ) {
5811
- var filtered = jQuery.grep(elements, function( elem ) {
5812
- return elem.nodeType === 1;
5813
- });
5814
-
5815
- if ( isSimple.test( qualifier ) ) {
5816
- return jQuery.filter(qualifier, filtered, !keep);
5817
- } else {
5818
- qualifier = jQuery.filter( qualifier, filtered );
5819
- }
5820
- }
5821
-
5822
- return jQuery.grep(elements, function( elem ) {
5823
- return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
5824
- });
5825
- }
5826
- function createSafeFragment( document ) {
5827
- var list = nodeNames.split( "|" ),
5828
- safeFrag = document.createDocumentFragment();
5829
-
5830
- if ( safeFrag.createElement ) {
5831
- while ( list.length ) {
5832
- safeFrag.createElement(
5833
- list.pop()
5834
- );
5835
- }
5836
- }
5837
- return safeFrag;
5838
- }
5839
-
5840
- var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5841
- "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
5842
- rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
5843
- rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
5844
- rleadingWhitespace = /^\s+/,
5845
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
5846
- rtagName = /<([\w:]+)/,
5847
- rtbody = /<tbody/i,
5848
- rhtml = /<|&#?\w+;/,
5849
- rnoInnerhtml = /<(?:script|style|link)/i,
5850
- manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
5851
- // checked="checked" or checked
5852
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5853
- rscriptType = /^$|\/(?:java|ecma)script/i,
5854
- rscriptTypeMasked = /^true\/(.*)/,
5855
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
5856
-
5857
- // We have to close these tags to support XHTML (#13200)
5858
- wrapMap = {
5859
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
5860
- legend: [ 1, "<fieldset>", "</fieldset>" ],
5861
- area: [ 1, "<map>", "</map>" ],
5862
- param: [ 1, "<object>", "</object>" ],
5863
- thead: [ 1, "<table>", "</table>" ],
5864
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5865
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5866
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5867
-
5868
- // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
5869
- // unless wrapped in a div with non-breaking characters in front of it.
5870
- _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
5871
- },
5872
- safeFragment = createSafeFragment( document ),
5873
- fragmentDiv = safeFragment.appendChild( document.createElement("div") );
5874
-
5875
- wrapMap.optgroup = wrapMap.option;
5876
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5877
- wrapMap.th = wrapMap.td;
5878
-
5879
- jQuery.fn.extend({
5880
- text: function( value ) {
5881
- return jQuery.access( this, function( value ) {
5882
- return value === undefined ?
5883
- jQuery.text( this ) :
5884
- this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
5885
- }, null, value, arguments.length );
5886
- },
5887
-
5888
- wrapAll: function( html ) {
5889
- if ( jQuery.isFunction( html ) ) {
5890
- return this.each(function(i) {
5891
- jQuery(this).wrapAll( html.call(this, i) );
5892
- });
5893
- }
5894
-
5895
- if ( this[0] ) {
5896
- // The elements to wrap the target around
5897
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
5898
-
5899
- if ( this[0].parentNode ) {
5900
- wrap.insertBefore( this[0] );
5901
- }
5902
-
5903
- wrap.map(function() {
5904
- var elem = this;
5905
-
5906
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
5907
- elem = elem.firstChild;
5908
- }
5909
-
5910
- return elem;
5911
- }).append( this );
5912
- }
5913
-
5914
- return this;
5915
- },
5916
-
5917
- wrapInner: function( html ) {
5918
- if ( jQuery.isFunction( html ) ) {
5919
- return this.each(function(i) {
5920
- jQuery(this).wrapInner( html.call(this, i) );
5921
- });
5922
- }
5923
-
5924
- return this.each(function() {
5925
- var self = jQuery( this ),
5926
- contents = self.contents();
5927
-
5928
- if ( contents.length ) {
5929
- contents.wrapAll( html );
5930
-
5931
- } else {
5932
- self.append( html );
5933
- }
5934
- });
5935
- },
5936
-
5937
- wrap: function( html ) {
5938
- var isFunction = jQuery.isFunction( html );
5939
-
5940
- return this.each(function(i) {
5941
- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
5942
- });
5943
- },
5944
-
5945
- unwrap: function() {
5946
- return this.parent().each(function() {
5947
- if ( !jQuery.nodeName( this, "body" ) ) {
5948
- jQuery( this ).replaceWith( this.childNodes );
5949
- }
5950
- }).end();
5951
- },
5952
-
5953
- append: function() {
5954
- return this.domManip(arguments, true, function( elem ) {
5955
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5956
- this.appendChild( elem );
5957
- }
5958
- });
5959
- },
5960
-
5961
- prepend: function() {
5962
- return this.domManip(arguments, true, function( elem ) {
5963
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5964
- this.insertBefore( elem, this.firstChild );
5965
- }
5966
- });
5967
- },
5968
-
5969
- before: function() {
5970
- return this.domManip( arguments, false, function( elem ) {
5971
- if ( this.parentNode ) {
5972
- this.parentNode.insertBefore( elem, this );
5973
-
5974
- }
5975
- });
5976
- },
5977
-
5978
- after: function() {
5979
- return this.domManip( arguments, false, function( elem ) {
5980
- if ( this.parentNode ) {
5981
- this.parentNode.insertBefore( elem, this.nextSibling );
5982
- }
5983
- });
5984
- },
5985
-
5986
- // keepData is for internal use only--do not document
5987
- remove: function( selector, keepData ) {
5988
- var elem,
5989
- i = 0;
5990
-
5991
- for ( ; (elem = this[i]) != null; i++ ) {
5992
- if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
5993
- if ( !keepData && elem.nodeType === 1 ) {
5994
- jQuery.cleanData( getAll( elem ) );
5995
- }
5996
-
5997
- if ( elem.parentNode ) {
5998
- if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
5999
- setGlobalEval( getAll( elem, "script" ) );
6000
- }
6001
- elem.parentNode.removeChild( elem );
6002
- }
6003
- }
6004
- }
6005
-
6006
- return this;
6007
- },
6008
-
6009
- empty: function() {
6010
- var elem,
6011
- i = 0;
6012
-
6013
- for ( ; (elem = this[i]) != null; i++ ) {
6014
- // Remove element nodes and prevent memory leaks
6015
- if ( elem.nodeType === 1 ) {
6016
- jQuery.cleanData( getAll( elem, false ) );
6017
- }
6018
-
6019
- // Remove any remaining nodes
6020
- while ( elem.firstChild ) {
6021
- elem.removeChild( elem.firstChild );
6022
- }
6023
-
6024
- // If this is a select, ensure that it displays empty (#12336)
6025
- // Support: IE<9
6026
- if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
6027
- elem.options.length = 0;
6028
- }
6029
- }
6030
-
6031
- return this;
6032
- },
6033
-
6034
- clone: function( dataAndEvents, deepDataAndEvents ) {
6035
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
6036
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
6037
-
6038
- return this.map( function () {
6039
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
6040
- });
6041
- },
6042
-
6043
- html: function( value ) {
6044
- return jQuery.access( this, function( value ) {
6045
- var elem = this[0] || {},
6046
- i = 0,
6047
- l = this.length;
6048
-
6049
- if ( value === undefined ) {
6050
- return elem.nodeType === 1 ?
6051
- elem.innerHTML.replace( rinlinejQuery, "" ) :
6052
- undefined;
6053
- }
6054
-
6055
- // See if we can take a shortcut and just use innerHTML
6056
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
6057
- ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
6058
- ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
6059
- !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
6060
-
6061
- value = value.replace( rxhtmlTag, "<$1></$2>" );
6062
-
6063
- try {
6064
- for (; i < l; i++ ) {
6065
- // Remove element nodes and prevent memory leaks
6066
- elem = this[i] || {};
6067
- if ( elem.nodeType === 1 ) {
6068
- jQuery.cleanData( getAll( elem, false ) );
6069
- elem.innerHTML = value;
6070
- }
6071
- }
6072
-
6073
- elem = 0;
6074
-
6075
- // If using innerHTML throws an exception, use the fallback method
6076
- } catch(e) {}
6077
- }
6078
-
6079
- if ( elem ) {
6080
- this.empty().append( value );
6081
- }
6082
- }, null, value, arguments.length );
6083
- },
6084
-
6085
- replaceWith: function( value ) {
6086
- var isFunc = jQuery.isFunction( value );
6087
-
6088
- // Make sure that the elements are removed from the DOM before they are inserted
6089
- // this can help fix replacing a parent with child elements
6090
- if ( !isFunc && typeof value !== "string" ) {
6091
- value = jQuery( value ).not( this ).detach();
6092
- }
6093
-
6094
- return this.domManip( [ value ], true, function( elem ) {
6095
- var next = this.nextSibling,
6096
- parent = this.parentNode;
6097
-
6098
- if ( parent ) {
6099
- jQuery( this ).remove();
6100
- parent.insertBefore( elem, next );
6101
- }
6102
- });
6103
- },
6104
-
6105
- detach: function( selector ) {
6106
- return this.remove( selector, true );
6107
- },
6108
-
6109
- domManip: function( args, table, callback ) {
6110
-
6111
- // Flatten any nested arrays
6112
- args = core_concat.apply( [], args );
6113
-
6114
- var first, node, hasScripts,
6115
- scripts, doc, fragment,
6116
- i = 0,
6117
- l = this.length,
6118
- set = this,
6119
- iNoClone = l - 1,
6120
- value = args[0],
6121
- isFunction = jQuery.isFunction( value );
6122
-
6123
- // We can't cloneNode fragments that contain checked, in WebKit
6124
- if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
6125
- return this.each(function( index ) {
6126
- var self = set.eq( index );
6127
- if ( isFunction ) {
6128
- args[0] = value.call( this, index, table ? self.html() : undefined );
6129
- }
6130
- self.domManip( args, table, callback );
6131
- });
6132
- }
6133
-
6134
- if ( l ) {
6135
- fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
6136
- first = fragment.firstChild;
6137
-
6138
- if ( fragment.childNodes.length === 1 ) {
6139
- fragment = first;
6140
- }
6141
-
6142
- if ( first ) {
6143
- table = table && jQuery.nodeName( first, "tr" );
6144
- scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
6145
- hasScripts = scripts.length;
6146
-
6147
- // Use the original fragment for the last item instead of the first because it can end up
6148
- // being emptied incorrectly in certain situations (#8070).
6149
- for ( ; i < l; i++ ) {
6150
- node = fragment;
6151
-
6152
- if ( i !== iNoClone ) {
6153
- node = jQuery.clone( node, true, true );
6154
-
6155
- // Keep references to cloned scripts for later restoration
6156
- if ( hasScripts ) {
6157
- jQuery.merge( scripts, getAll( node, "script" ) );
6158
- }
6159
- }
6160
-
6161
- callback.call(
6162
- table && jQuery.nodeName( this[i], "table" ) ?
6163
- findOrAppend( this[i], "tbody" ) :
6164
- this[i],
6165
- node,
6166
- i
6167
- );
6168
- }
6169
-
6170
- if ( hasScripts ) {
6171
- doc = scripts[ scripts.length - 1 ].ownerDocument;
6172
-
6173
- // Reenable scripts
6174
- jQuery.map( scripts, restoreScript );
6175
-
6176
- // Evaluate executable scripts on first document insertion
6177
- for ( i = 0; i < hasScripts; i++ ) {
6178
- node = scripts[ i ];
6179
- if ( rscriptType.test( node.type || "" ) &&
6180
- !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
6181
-
6182
- if ( node.src ) {
6183
- // Hope ajax is available...
6184
- jQuery.ajax({
6185
- url: node.src,
6186
- type: "GET",
6187
- dataType: "script",
6188
- async: false,
6189
- global: false,
6190
- "throws": true
6191
- });
6192
- } else {
6193
- jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
6194
- }
6195
- }
6196
- }
6197
- }
6198
-
6199
- // Fix #11809: Avoid leaking memory
6200
- fragment = first = null;
6201
- }
6202
- }
6203
-
6204
- return this;
6205
- }
6206
- });
6207
-
6208
- function findOrAppend( elem, tag ) {
6209
- return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
6210
- }
6211
-
6212
- // Replace/restore the type attribute of script elements for safe DOM manipulation
6213
- function disableScript( elem ) {
6214
- var attr = elem.getAttributeNode("type");
6215
- elem.type = ( attr && attr.specified ) + "/" + elem.type;
6216
- return elem;
6217
- }
6218
- function restoreScript( elem ) {
6219
- var match = rscriptTypeMasked.exec( elem.type );
6220
- if ( match ) {
6221
- elem.type = match[1];
6222
- } else {
6223
- elem.removeAttribute("type");
6224
- }
6225
- return elem;
6226
- }
6227
-
6228
- // Mark scripts as having already been evaluated
6229
- function setGlobalEval( elems, refElements ) {
6230
- var elem,
6231
- i = 0;
6232
- for ( ; (elem = elems[i]) != null; i++ ) {
6233
- jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
6234
- }
6235
- }
6236
-
6237
- function cloneCopyEvent( src, dest ) {
6238
-
6239
- if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
6240
- return;
6241
- }
6242
-
6243
- var type, i, l,
6244
- oldData = jQuery._data( src ),
6245
- curData = jQuery._data( dest, oldData ),
6246
- events = oldData.events;
6247
-
6248
- if ( events ) {
6249
- delete curData.handle;
6250
- curData.events = {};
6251
-
6252
- for ( type in events ) {
6253
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
6254
- jQuery.event.add( dest, type, events[ type ][ i ] );
6255
- }
6256
- }
6257
- }
6258
-
6259
- // make the cloned public data object a copy from the original
6260
- if ( curData.data ) {
6261
- curData.data = jQuery.extend( {}, curData.data );
6262
- }
6263
- }
6264
-
6265
- function fixCloneNodeIssues( src, dest ) {
6266
- var nodeName, e, data;
6267
-
6268
- // We do not need to do anything for non-Elements
6269
- if ( dest.nodeType !== 1 ) {
6270
- return;
6271
- }
6272
-
6273
- nodeName = dest.nodeName.toLowerCase();
6274
-
6275
- // IE6-8 copies events bound via attachEvent when using cloneNode.
6276
- if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
6277
- data = jQuery._data( dest );
6278
-
6279
- for ( e in data.events ) {
6280
- jQuery.removeEvent( dest, e, data.handle );
6281
- }
6282
-
6283
- // Event data gets referenced instead of copied if the expando gets copied too
6284
- dest.removeAttribute( jQuery.expando );
6285
- }
6286
-
6287
- // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
6288
- if ( nodeName === "script" && dest.text !== src.text ) {
6289
- disableScript( dest ).text = src.text;
6290
- restoreScript( dest );
6291
-
6292
- // IE6-10 improperly clones children of object elements using classid.
6293
- // IE10 throws NoModificationAllowedError if parent is null, #12132.
6294
- } else if ( nodeName === "object" ) {
6295
- if ( dest.parentNode ) {
6296
- dest.outerHTML = src.outerHTML;
6297
- }
6298
-
6299
- // This path appears unavoidable for IE9. When cloning an object
6300
- // element in IE9, the outerHTML strategy above is not sufficient.
6301
- // If the src has innerHTML and the destination does not,
6302
- // copy the src.innerHTML into the dest.innerHTML. #10324
6303
- if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
6304
- dest.innerHTML = src.innerHTML;
6305
- }
6306
-
6307
- } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
6308
- // IE6-8 fails to persist the checked state of a cloned checkbox
6309
- // or radio button. Worse, IE6-7 fail to give the cloned element
6310
- // a checked appearance if the defaultChecked value isn't also set
6311
-
6312
- dest.defaultChecked = dest.checked = src.checked;
6313
-
6314
- // IE6-7 get confused and end up setting the value of a cloned
6315
- // checkbox/radio button to an empty string instead of "on"
6316
- if ( dest.value !== src.value ) {
6317
- dest.value = src.value;
6318
- }
6319
-
6320
- // IE6-8 fails to return the selected option to the default selected
6321
- // state when cloning options
6322
- } else if ( nodeName === "option" ) {
6323
- dest.defaultSelected = dest.selected = src.defaultSelected;
6324
-
6325
- // IE6-8 fails to set the defaultValue to the correct value when
6326
- // cloning other types of input fields
6327
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
6328
- dest.defaultValue = src.defaultValue;
6329
- }
6330
- }
6331
-
6332
- jQuery.each({
6333
- appendTo: "append",
6334
- prependTo: "prepend",
6335
- insertBefore: "before",
6336
- insertAfter: "after",
6337
- replaceAll: "replaceWith"
6338
- }, function( name, original ) {
6339
- jQuery.fn[ name ] = function( selector ) {
6340
- var elems,
6341
- i = 0,
6342
- ret = [],
6343
- insert = jQuery( selector ),
6344
- last = insert.length - 1;
6345
-
6346
- for ( ; i <= last; i++ ) {
6347
- elems = i === last ? this : this.clone(true);
6348
- jQuery( insert[i] )[ original ]( elems );
6349
-
6350
- // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
6351
- core_push.apply( ret, elems.get() );
6352
- }
6353
-
6354
- return this.pushStack( ret );
6355
- };
6356
- });
6357
-
6358
- function getAll( context, tag ) {
6359
- var elems, elem,
6360
- i = 0,
6361
- found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
6362
- typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
6363
- undefined;
6364
-
6365
- if ( !found ) {
6366
- for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
6367
- if ( !tag || jQuery.nodeName( elem, tag ) ) {
6368
- found.push( elem );
6369
- } else {
6370
- jQuery.merge( found, getAll( elem, tag ) );
6371
- }
6372
- }
6373
- }
6374
-
6375
- return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
6376
- jQuery.merge( [ context ], found ) :
6377
- found;
6378
- }
6379
-
6380
- // Used in buildFragment, fixes the defaultChecked property
6381
- function fixDefaultChecked( elem ) {
6382
- if ( manipulation_rcheckableType.test( elem.type ) ) {
6383
- elem.defaultChecked = elem.checked;
6384
- }
6385
- }
6386
-
6387
- jQuery.extend({
6388
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6389
- var destElements, node, clone, i, srcElements,
6390
- inPage = jQuery.contains( elem.ownerDocument, elem );
6391
-
6392
- if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
6393
- clone = elem.cloneNode( true );
6394
-
6395
- // IE<=8 does not properly clone detached, unknown element nodes
6396
- } else {
6397
- fragmentDiv.innerHTML = elem.outerHTML;
6398
- fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
6399
- }
6400
-
6401
- if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
6402
- (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
6403
-
6404
- // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
6405
- destElements = getAll( clone );
6406
- srcElements = getAll( elem );
6407
-
6408
- // Fix all IE cloning issues
6409
- for ( i = 0; (node = srcElements[i]) != null; ++i ) {
6410
- // Ensure that the destination node is not null; Fixes #9587
6411
- if ( destElements[i] ) {
6412
- fixCloneNodeIssues( node, destElements[i] );
6413
- }
6414
- }
6415
- }
6416
-
6417
- // Copy the events from the original to the clone
6418
- if ( dataAndEvents ) {
6419
- if ( deepDataAndEvents ) {
6420
- srcElements = srcElements || getAll( elem );
6421
- destElements = destElements || getAll( clone );
6422
-
6423
- for ( i = 0; (node = srcElements[i]) != null; i++ ) {
6424
- cloneCopyEvent( node, destElements[i] );
6425
- }
6426
- } else {
6427
- cloneCopyEvent( elem, clone );
6428
- }
6429
- }
6430
-
6431
- // Preserve script evaluation history
6432
- destElements = getAll( clone, "script" );
6433
- if ( destElements.length > 0 ) {
6434
- setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
6435
- }
6436
-
6437
- destElements = srcElements = node = null;
6438
-
6439
- // Return the cloned set
6440
- return clone;
6441
- },
6442
-
6443
- buildFragment: function( elems, context, scripts, selection ) {
6444
- var j, elem, contains,
6445
- tmp, tag, tbody, wrap,
6446
- l = elems.length,
6447
-
6448
- // Ensure a safe fragment
6449
- safe = createSafeFragment( context ),
6450
-
6451
- nodes = [],
6452
- i = 0;
6453
-
6454
- for ( ; i < l; i++ ) {
6455
- elem = elems[ i ];
6456
-
6457
- if ( elem || elem === 0 ) {
6458
-
6459
- // Add nodes directly
6460
- if ( jQuery.type( elem ) === "object" ) {
6461
- jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
6462
-
6463
- // Convert non-html into a text node
6464
- } else if ( !rhtml.test( elem ) ) {
6465
- nodes.push( context.createTextNode( elem ) );
6466
-
6467
- // Convert html into DOM nodes
6468
- } else {
6469
- tmp = tmp || safe.appendChild( context.createElement("div") );
6470
-
6471
- // Deserialize a standard representation
6472
- tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
6473
- wrap = wrapMap[ tag ] || wrapMap._default;
6474
-
6475
- tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
6476
-
6477
- // Descend through wrappers to the right content
6478
- j = wrap[0];
6479
- while ( j-- ) {
6480
- tmp = tmp.lastChild;
6481
- }
6482
-
6483
- // Manually add leading whitespace removed by IE
6484
- if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
6485
- nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
6486
- }
6487
-
6488
- // Remove IE's autoinserted <tbody> from table fragments
6489
- if ( !jQuery.support.tbody ) {
6490
-
6491
- // String was a <table>, *may* have spurious <tbody>
6492
- elem = tag === "table" && !rtbody.test( elem ) ?
6493
- tmp.firstChild :
6494
-
6495
- // String was a bare <thead> or <tfoot>
6496
- wrap[1] === "<table>" && !rtbody.test( elem ) ?
6497
- tmp :
6498
- 0;
6499
-
6500
- j = elem && elem.childNodes.length;
6501
- while ( j-- ) {
6502
- if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
6503
- elem.removeChild( tbody );
6504
- }
6505
- }
6506
- }
6507
-
6508
- jQuery.merge( nodes, tmp.childNodes );
6509
-
6510
- // Fix #12392 for WebKit and IE > 9
6511
- tmp.textContent = "";
6512
-
6513
- // Fix #12392 for oldIE
6514
- while ( tmp.firstChild ) {
6515
- tmp.removeChild( tmp.firstChild );
6516
- }
6517
-
6518
- // Remember the top-level container for proper cleanup
6519
- tmp = safe.lastChild;
6520
- }
6521
- }
6522
- }
6523
-
6524
- // Fix #11356: Clear elements from fragment
6525
- if ( tmp ) {
6526
- safe.removeChild( tmp );
6527
- }
6528
-
6529
- // Reset defaultChecked for any radios and checkboxes
6530
- // about to be appended to the DOM in IE 6/7 (#8060)
6531
- if ( !jQuery.support.appendChecked ) {
6532
- jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
6533
- }
6534
-
6535
- i = 0;
6536
- while ( (elem = nodes[ i++ ]) ) {
6537
-
6538
- // #4087 - If origin and destination elements are the same, and this is
6539
- // that element, do not do anything
6540
- if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
6541
- continue;
6542
- }
6543
-
6544
- contains = jQuery.contains( elem.ownerDocument, elem );
6545
-
6546
- // Append to fragment
6547
- tmp = getAll( safe.appendChild( elem ), "script" );
6548
-
6549
- // Preserve script evaluation history
6550
- if ( contains ) {
6551
- setGlobalEval( tmp );
6552
- }
6553
-
6554
- // Capture executables
6555
- if ( scripts ) {
6556
- j = 0;
6557
- while ( (elem = tmp[ j++ ]) ) {
6558
- if ( rscriptType.test( elem.type || "" ) ) {
6559
- scripts.push( elem );
6560
- }
6561
- }
6562
- }
6563
- }
6564
-
6565
- tmp = null;
6566
-
6567
- return safe;
6568
- },
6569
-
6570
- cleanData: function( elems, /* internal */ acceptData ) {
6571
- var elem, type, id, data,
6572
- i = 0,
6573
- internalKey = jQuery.expando,
6574
- cache = jQuery.cache,
6575
- deleteExpando = jQuery.support.deleteExpando,
6576
- special = jQuery.event.special;
6577
-
6578
- for ( ; (elem = elems[i]) != null; i++ ) {
6579
-
6580
- if ( acceptData || jQuery.acceptData( elem ) ) {
6581
-
6582
- id = elem[ internalKey ];
6583
- data = id && cache[ id ];
6584
-
6585
- if ( data ) {
6586
- if ( data.events ) {
6587
- for ( type in data.events ) {
6588
- if ( special[ type ] ) {
6589
- jQuery.event.remove( elem, type );
6590
-
6591
- // This is a shortcut to avoid jQuery.event.remove's overhead
6592
- } else {
6593
- jQuery.removeEvent( elem, type, data.handle );
6594
- }
6595
- }
6596
- }
6597
-
6598
- // Remove cache only if it was not already removed by jQuery.event.remove
6599
- if ( cache[ id ] ) {
6600
-
6601
- delete cache[ id ];
6602
-
6603
- // IE does not allow us to delete expando properties from nodes,
6604
- // nor does it have a removeAttribute function on Document nodes;
6605
- // we must handle all of these cases
6606
- if ( deleteExpando ) {
6607
- delete elem[ internalKey ];
6608
-
6609
- } else if ( typeof elem.removeAttribute !== core_strundefined ) {
6610
- elem.removeAttribute( internalKey );
6611
-
6612
- } else {
6613
- elem[ internalKey ] = null;
6614
- }
6615
-
6616
- core_deletedIds.push( id );
6617
- }
6618
- }
6619
- }
6620
- }
6621
- }
6622
- });
6623
- var iframe, getStyles, curCSS,
6624
- ralpha = /alpha\([^)]*\)/i,
6625
- ropacity = /opacity\s*=\s*([^)]*)/,
6626
- rposition = /^(top|right|bottom|left)$/,
6627
- // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
6628
- // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6629
- rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6630
- rmargin = /^margin/,
6631
- rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
6632
- rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
6633
- rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
6634
- elemdisplay = { BODY: "block" },
6635
-
6636
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6637
- cssNormalTransform = {
6638
- letterSpacing: 0,
6639
- fontWeight: 400
6640
- },
6641
-
6642
- cssExpand = [ "Top", "Right", "Bottom", "Left" ],
6643
- cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
6644
-
6645
- // return a css property mapped to a potentially vendor prefixed property
6646
- function vendorPropName( style, name ) {
6647
-
6648
- // shortcut for names that are not vendor prefixed
6649
- if ( name in style ) {
6650
- return name;
6651
- }
6652
-
6653
- // check for vendor prefixed names
6654
- var capName = name.charAt(0).toUpperCase() + name.slice(1),
6655
- origName = name,
6656
- i = cssPrefixes.length;
6657
-
6658
- while ( i-- ) {
6659
- name = cssPrefixes[ i ] + capName;
6660
- if ( name in style ) {
6661
- return name;
6662
- }
6663
- }
6664
-
6665
- return origName;
6666
- }
6667
-
6668
- function isHidden( elem, el ) {
6669
- // isHidden might be called from jQuery#filter function;
6670
- // in that case, element will be second argument
6671
- elem = el || elem;
6672
- return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
6673
- }
6674
-
6675
- function showHide( elements, show ) {
6676
- var display, elem, hidden,
6677
- values = [],
6678
- index = 0,
6679
- length = elements.length;
6680
-
6681
- for ( ; index < length; index++ ) {
6682
- elem = elements[ index ];
6683
- if ( !elem.style ) {
6684
- continue;
6685
- }
6686
-
6687
- values[ index ] = jQuery._data( elem, "olddisplay" );
6688
- display = elem.style.display;
6689
- if ( show ) {
6690
- // Reset the inline display of this element to learn if it is
6691
- // being hidden by cascaded rules or not
6692
- if ( !values[ index ] && display === "none" ) {
6693
- elem.style.display = "";
6694
- }
6695
-
6696
- // Set elements which have been overridden with display: none
6697
- // in a stylesheet to whatever the default browser style is
6698
- // for such an element
6699
- if ( elem.style.display === "" && isHidden( elem ) ) {
6700
- values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
6701
- }
6702
- } else {
6703
-
6704
- if ( !values[ index ] ) {
6705
- hidden = isHidden( elem );
6706
-
6707
- if ( display && display !== "none" || !hidden ) {
6708
- jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
6709
- }
6710
- }
6711
- }
6712
- }
6713
-
6714
- // Set the display of most of the elements in a second loop
6715
- // to avoid the constant reflow
6716
- for ( index = 0; index < length; index++ ) {
6717
- elem = elements[ index ];
6718
- if ( !elem.style ) {
6719
- continue;
6720
- }
6721
- if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6722
- elem.style.display = show ? values[ index ] || "" : "none";
6723
- }
6724
- }
6725
-
6726
- return elements;
6727
- }
6728
-
6729
- jQuery.fn.extend({
6730
- css: function( name, value ) {
6731
- return jQuery.access( this, function( elem, name, value ) {
6732
- var len, styles,
6733
- map = {},
6734
- i = 0;
6735
-
6736
- if ( jQuery.isArray( name ) ) {
6737
- styles = getStyles( elem );
6738
- len = name.length;
6739
-
6740
- for ( ; i < len; i++ ) {
6741
- map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6742
- }
6743
-
6744
- return map;
6745
- }
6746
-
6747
- return value !== undefined ?
6748
- jQuery.style( elem, name, value ) :
6749
- jQuery.css( elem, name );
6750
- }, name, value, arguments.length > 1 );
6751
- },
6752
- show: function() {
6753
- return showHide( this, true );
6754
- },
6755
- hide: function() {
6756
- return showHide( this );
6757
- },
6758
- toggle: function( state ) {
6759
- var bool = typeof state === "boolean";
6760
-
6761
- return this.each(function() {
6762
- if ( bool ? state : isHidden( this ) ) {
6763
- jQuery( this ).show();
6764
- } else {
6765
- jQuery( this ).hide();
6766
- }
6767
- });
6768
- }
6769
- });
6770
-
6771
- jQuery.extend({
6772
- // Add in style property hooks for overriding the default
6773
- // behavior of getting and setting a style property
6774
- cssHooks: {
6775
- opacity: {
6776
- get: function( elem, computed ) {
6777
- if ( computed ) {
6778
- // We should always get a number back from opacity
6779
- var ret = curCSS( elem, "opacity" );
6780
- return ret === "" ? "1" : ret;
6781
- }
6782
- }
6783
- }
6784
- },
6785
-
6786
- // Exclude the following css properties to add px
6787
- cssNumber: {
6788
- "columnCount": true,
6789
- "fillOpacity": true,
6790
- "fontWeight": true,
6791
- "lineHeight": true,
6792
- "opacity": true,
6793
- "orphans": true,
6794
- "widows": true,
6795
- "zIndex": true,
6796
- "zoom": true
6797
- },
6798
-
6799
- // Add in properties whose names you wish to fix before
6800
- // setting or getting the value
6801
- cssProps: {
6802
- // normalize float css property
6803
- "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
6804
- },
6805
-
6806
- // Get and set the style property on a DOM Node
6807
- style: function( elem, name, value, extra ) {
6808
- // Don't set styles on text and comment nodes
6809
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6810
- return;
6811
- }
6812
-
6813
- // Make sure that we're working with the right name
6814
- var ret, type, hooks,
6815
- origName = jQuery.camelCase( name ),
6816
- style = elem.style;
6817
-
6818
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
6819
-
6820
- // gets hook for the prefixed version
6821
- // followed by the unprefixed version
6822
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6823
-
6824
- // Check if we're setting a value
6825
- if ( value !== undefined ) {
6826
- type = typeof value;
6827
-
6828
- // convert relative number strings (+= or -=) to relative numbers. #7345
6829
- if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6830
- value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
6831
- // Fixes bug #9237
6832
- type = "number";
6833
- }
6834
-
6835
- // Make sure that NaN and null values aren't set. See: #7116
6836
- if ( value == null || type === "number" && isNaN( value ) ) {
6837
- return;
6838
- }
6839
-
6840
- // If a number was passed in, add 'px' to the (except for certain CSS properties)
6841
- if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6842
- value += "px";
6843
- }
6844
-
6845
- // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
6846
- // but it would mean to define eight (for every problematic property) identical functions
6847
- if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
6848
- style[ name ] = "inherit";
6849
- }
6850
-
6851
- // If a hook was provided, use that value, otherwise just set the specified value
6852
- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
6853
-
6854
- // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
6855
- // Fixes bug #5509
6856
- try {
6857
- style[ name ] = value;
6858
- } catch(e) {}
6859
- }
6860
-
6861
- } else {
6862
- // If a hook was provided get the non-computed value from there
6863
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
6864
- return ret;
6865
- }
6866
-
6867
- // Otherwise just get the value from the style object
6868
- return style[ name ];
6869
- }
6870
- },
6871
-
6872
- css: function( elem, name, extra, styles ) {
6873
- var num, val, hooks,
6874
- origName = jQuery.camelCase( name );
6875
-
6876
- // Make sure that we're working with the right name
6877
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
6878
-
6879
- // gets hook for the prefixed version
6880
- // followed by the unprefixed version
6881
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6882
-
6883
- // If a hook was provided get the computed value from there
6884
- if ( hooks && "get" in hooks ) {
6885
- val = hooks.get( elem, true, extra );
6886
- }
6887
-
6888
- // Otherwise, if a way to get the computed value exists, use that
6889
- if ( val === undefined ) {
6890
- val = curCSS( elem, name, styles );
6891
- }
6892
-
6893
- //convert "normal" to computed value
6894
- if ( val === "normal" && name in cssNormalTransform ) {
6895
- val = cssNormalTransform[ name ];
6896
- }
6897
-
6898
- // Return, converting to number if forced or a qualifier was provided and val looks numeric
6899
- if ( extra === "" || extra ) {
6900
- num = parseFloat( val );
6901
- return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
6902
- }
6903
- return val;
6904
- },
6905
-
6906
- // A method for quickly swapping in/out CSS properties to get correct calculations
6907
- swap: function( elem, options, callback, args ) {
6908
- var ret, name,
6909
- old = {};
6910
-
6911
- // Remember the old values, and insert the new ones
6912
- for ( name in options ) {
6913
- old[ name ] = elem.style[ name ];
6914
- elem.style[ name ] = options[ name ];
6915
- }
6916
-
6917
- ret = callback.apply( elem, args || [] );
6918
-
6919
- // Revert the old values
6920
- for ( name in options ) {
6921
- elem.style[ name ] = old[ name ];
6922
- }
6923
-
6924
- return ret;
6925
- }
6926
- });
6927
-
6928
- // NOTE: we've included the "window" in window.getComputedStyle
6929
- // because jsdom on node.js will break without it.
6930
- if ( window.getComputedStyle ) {
6931
- getStyles = function( elem ) {
6932
- return window.getComputedStyle( elem, null );
6933
- };
6934
-
6935
- curCSS = function( elem, name, _computed ) {
6936
- var width, minWidth, maxWidth,
6937
- computed = _computed || getStyles( elem ),
6938
-
6939
- // getPropertyValue is only needed for .css('filter') in IE9, see #12537
6940
- ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
6941
- style = elem.style;
6942
-
6943
- if ( computed ) {
6944
-
6945
- if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6946
- ret = jQuery.style( elem, name );
6947
- }
6948
-
6949
- // A tribute to the "awesome hack by Dean Edwards"
6950
- // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
6951
- // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
6952
- // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
6953
- if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6954
-
6955
- // Remember the original values
6956
- width = style.width;
6957
- minWidth = style.minWidth;
6958
- maxWidth = style.maxWidth;
6959
-
6960
- // Put in the new values to get a computed value out
6961
- style.minWidth = style.maxWidth = style.width = ret;
6962
- ret = computed.width;
6963
-
6964
- // Revert the changed values
6965
- style.width = width;
6966
- style.minWidth = minWidth;
6967
- style.maxWidth = maxWidth;
6968
- }
6969
- }
6970
-
6971
- return ret;
6972
- };
6973
- } else if ( document.documentElement.currentStyle ) {
6974
- getStyles = function( elem ) {
6975
- return elem.currentStyle;
6976
- };
6977
-
6978
- curCSS = function( elem, name, _computed ) {
6979
- var left, rs, rsLeft,
6980
- computed = _computed || getStyles( elem ),
6981
- ret = computed ? computed[ name ] : undefined,
6982
- style = elem.style;
6983
-
6984
- // Avoid setting ret to empty string here
6985
- // so we don't default to auto
6986
- if ( ret == null && style && style[ name ] ) {
6987
- ret = style[ name ];
6988
- }
6989
-
6990
- // From the awesome hack by Dean Edwards
6991
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6992
-
6993
- // If we're not dealing with a regular pixel number
6994
- // but a number that has a weird ending, we need to convert it to pixels
6995
- // but not position css attributes, as those are proportional to the parent element instead
6996
- // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
6997
- if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
6998
-
6999
- // Remember the original values
7000
- left = style.left;
7001
- rs = elem.runtimeStyle;
7002
- rsLeft = rs && rs.left;
7003
-
7004
- // Put in the new values to get a computed value out
7005
- if ( rsLeft ) {
7006
- rs.left = elem.currentStyle.left;
7007
- }
7008
- style.left = name === "fontSize" ? "1em" : ret;
7009
- ret = style.pixelLeft + "px";
7010
-
7011
- // Revert the changed values
7012
- style.left = left;
7013
- if ( rsLeft ) {
7014
- rs.left = rsLeft;
7015
- }
7016
- }
7017
-
7018
- return ret === "" ? "auto" : ret;
7019
- };
7020
- }
7021
-
7022
- function setPositiveNumber( elem, value, subtract ) {
7023
- var matches = rnumsplit.exec( value );
7024
- return matches ?
7025
- // Guard against undefined "subtract", e.g., when used as in cssHooks
7026
- Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
7027
- value;
7028
- }
7029
-
7030
- function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
7031
- var i = extra === ( isBorderBox ? "border" : "content" ) ?
7032
- // If we already have the right measurement, avoid augmentation
7033
- 4 :
7034
- // Otherwise initialize for horizontal or vertical properties
7035
- name === "width" ? 1 : 0,
7036
-
7037
- val = 0;
7038
-
7039
- for ( ; i < 4; i += 2 ) {
7040
- // both box models exclude margin, so add it if we want it
7041
- if ( extra === "margin" ) {
7042
- val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
7043
- }
7044
-
7045
- if ( isBorderBox ) {
7046
- // border-box includes padding, so remove it if we want content
7047
- if ( extra === "content" ) {
7048
- val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
7049
- }
7050
-
7051
- // at this point, extra isn't border nor margin, so remove border
7052
- if ( extra !== "margin" ) {
7053
- val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
7054
- }
7055
- } else {
7056
- // at this point, extra isn't content, so add padding
7057
- val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
7058
-
7059
- // at this point, extra isn't content nor padding, so add border
7060
- if ( extra !== "padding" ) {
7061
- val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
7062
- }
7063
- }
7064
- }
7065
-
7066
- return val;
7067
- }
7068
-
7069
- function getWidthOrHeight( elem, name, extra ) {
7070
-
7071
- // Start with offset property, which is equivalent to the border-box value
7072
- var valueIsBorderBox = true,
7073
- val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
7074
- styles = getStyles( elem ),
7075
- isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
7076
-
7077
- // some non-html elements return undefined for offsetWidth, so check for null/undefined
7078
- // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
7079
- // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
7080
- if ( val <= 0 || val == null ) {
7081
- // Fall back to computed then uncomputed css if necessary
7082
- val = curCSS( elem, name, styles );
7083
- if ( val < 0 || val == null ) {
7084
- val = elem.style[ name ];
7085
- }
7086
-
7087
- // Computed unit is not pixels. Stop here and return.
7088
- if ( rnumnonpx.test(val) ) {
7089
- return val;
7090
- }
7091
-
7092
- // we need the check for style in case a browser which returns unreliable values
7093
- // for getComputedStyle silently falls back to the reliable elem.style
7094
- valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
7095
-
7096
- // Normalize "", auto, and prepare for extra
7097
- val = parseFloat( val ) || 0;
7098
- }
7099
-
7100
- // use the active box-sizing model to add/subtract irrelevant styles
7101
- return ( val +
7102
- augmentWidthOrHeight(
7103
- elem,
7104
- name,
7105
- extra || ( isBorderBox ? "border" : "content" ),
7106
- valueIsBorderBox,
7107
- styles
7108
- )
7109
- ) + "px";
7110
- }
7111
-
7112
- // Try to determine the default display value of an element
7113
- function css_defaultDisplay( nodeName ) {
7114
- var doc = document,
7115
- display = elemdisplay[ nodeName ];
7116
-
7117
- if ( !display ) {
7118
- display = actualDisplay( nodeName, doc );
7119
-
7120
- // If the simple way fails, read from inside an iframe
7121
- if ( display === "none" || !display ) {
7122
- // Use the already-created iframe if possible
7123
- iframe = ( iframe ||
7124
- jQuery("<iframe frameborder='0' width='0' height='0'/>")
7125
- .css( "cssText", "display:block !important" )
7126
- ).appendTo( doc.documentElement );
7127
-
7128
- // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
7129
- doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
7130
- doc.write("<!doctype html><html><body>");
7131
- doc.close();
7132
-
7133
- display = actualDisplay( nodeName, doc );
7134
- iframe.detach();
7135
- }
7136
-
7137
- // Store the correct default display
7138
- elemdisplay[ nodeName ] = display;
7139
- }
7140
-
7141
- return display;
7142
- }
7143
-
7144
- // Called ONLY from within css_defaultDisplay
7145
- function actualDisplay( name, doc ) {
7146
- var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
7147
- display = jQuery.css( elem[0], "display" );
7148
- elem.remove();
7149
- return display;
7150
- }
7151
-
7152
- jQuery.each([ "height", "width" ], function( i, name ) {
7153
- jQuery.cssHooks[ name ] = {
7154
- get: function( elem, computed, extra ) {
7155
- if ( computed ) {
7156
- // certain elements can have dimension info if we invisibly show them
7157
- // however, it must have a current display style that would benefit from this
7158
- return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
7159
- jQuery.swap( elem, cssShow, function() {
7160
- return getWidthOrHeight( elem, name, extra );
7161
- }) :
7162
- getWidthOrHeight( elem, name, extra );
7163
- }
7164
- },
7165
-
7166
- set: function( elem, value, extra ) {
7167
- var styles = extra && getStyles( elem );
7168
- return setPositiveNumber( elem, value, extra ?
7169
- augmentWidthOrHeight(
7170
- elem,
7171
- name,
7172
- extra,
7173
- jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
7174
- styles
7175
- ) : 0
7176
- );
7177
- }
7178
- };
7179
- });
7180
-
7181
- if ( !jQuery.support.opacity ) {
7182
- jQuery.cssHooks.opacity = {
7183
- get: function( elem, computed ) {
7184
- // IE uses filters for opacity
7185
- return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
7186
- ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
7187
- computed ? "1" : "";
7188
- },
7189
-
7190
- set: function( elem, value ) {
7191
- var style = elem.style,
7192
- currentStyle = elem.currentStyle,
7193
- opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
7194
- filter = currentStyle && currentStyle.filter || style.filter || "";
7195
-
7196
- // IE has trouble with opacity if it does not have layout
7197
- // Force it by setting the zoom level
7198
- style.zoom = 1;
7199
-
7200
- // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
7201
- // if value === "", then remove inline opacity #12685
7202
- if ( ( value >= 1 || value === "" ) &&
7203
- jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
7204
- style.removeAttribute ) {
7205
-
7206
- // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
7207
- // if "filter:" is present at all, clearType is disabled, we want to avoid this
7208
- // style.removeAttribute is IE Only, but so apparently is this code path...
7209
- style.removeAttribute( "filter" );
7210
-
7211
- // if there is no filter style applied in a css rule or unset inline opacity, we are done
7212
- if ( value === "" || currentStyle && !currentStyle.filter ) {
7213
- return;
7214
- }
7215
- }
7216
-
7217
- // otherwise, set new filter values
7218
- style.filter = ralpha.test( filter ) ?
7219
- filter.replace( ralpha, opacity ) :
7220
- filter + " " + opacity;
7221
- }
7222
- };
7223
- }
7224
-
7225
- // These hooks cannot be added until DOM ready because the support test
7226
- // for it is not run until after DOM ready
7227
- jQuery(function() {
7228
- if ( !jQuery.support.reliableMarginRight ) {
7229
- jQuery.cssHooks.marginRight = {
7230
- get: function( elem, computed ) {
7231
- if ( computed ) {
7232
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
7233
- // Work around by temporarily setting element display to inline-block
7234
- return jQuery.swap( elem, { "display": "inline-block" },
7235
- curCSS, [ elem, "marginRight" ] );
7236
- }
7237
- }
7238
- };
7239
- }
7240
-
7241
- // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
7242
- // getComputedStyle returns percent when specified for top/left/bottom/right
7243
- // rather than make the css module depend on the offset module, we just check for it here
7244
- if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
7245
- jQuery.each( [ "top", "left" ], function( i, prop ) {
7246
- jQuery.cssHooks[ prop ] = {
7247
- get: function( elem, computed ) {
7248
- if ( computed ) {
7249
- computed = curCSS( elem, prop );
7250
- // if curCSS returns percentage, fallback to offset
7251
- return rnumnonpx.test( computed ) ?
7252
- jQuery( elem ).position()[ prop ] + "px" :
7253
- computed;
7254
- }
7255
- }
7256
- };
7257
- });
7258
- }
7259
-
7260
- });
7261
-
7262
- if ( jQuery.expr && jQuery.expr.filters ) {
7263
- jQuery.expr.filters.hidden = function( elem ) {
7264
- // Support: Opera <= 12.12
7265
- // Opera reports offsetWidths and offsetHeights less than zero on some elements
7266
- return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
7267
- (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
7268
- };
7269
-
7270
- jQuery.expr.filters.visible = function( elem ) {
7271
- return !jQuery.expr.filters.hidden( elem );
7272
- };
7273
- }
7274
-
7275
- // These hooks are used by animate to expand properties
7276
- jQuery.each({
7277
- margin: "",
7278
- padding: "",
7279
- border: "Width"
7280
- }, function( prefix, suffix ) {
7281
- jQuery.cssHooks[ prefix + suffix ] = {
7282
- expand: function( value ) {
7283
- var i = 0,
7284
- expanded = {},
7285
-
7286
- // assumes a single number if not a string
7287
- parts = typeof value === "string" ? value.split(" ") : [ value ];
7288
-
7289
- for ( ; i < 4; i++ ) {
7290
- expanded[ prefix + cssExpand[ i ] + suffix ] =
7291
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
7292
- }
7293
-
7294
- return expanded;
7295
- }
7296
- };
7297
-
7298
- if ( !rmargin.test( prefix ) ) {
7299
- jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
7300
- }
7301
- });
7302
- var r20 = /%20/g,
7303
- rbracket = /\[\]$/,
7304
- rCRLF = /\r?\n/g,
7305
- rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
7306
- rsubmittable = /^(?:input|select|textarea|keygen)/i;
7307
-
7308
- jQuery.fn.extend({
7309
- serialize: function() {
7310
- return jQuery.param( this.serializeArray() );
7311
- },
7312
- serializeArray: function() {
7313
- return this.map(function(){
7314
- // Can add propHook for "elements" to filter or add form elements
7315
- var elements = jQuery.prop( this, "elements" );
7316
- return elements ? jQuery.makeArray( elements ) : this;
7317
- })
7318
- .filter(function(){
7319
- var type = this.type;
7320
- // Use .is(":disabled") so that fieldset[disabled] works
7321
- return this.name && !jQuery( this ).is( ":disabled" ) &&
7322
- rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
7323
- ( this.checked || !manipulation_rcheckableType.test( type ) );
7324
- })
7325
- .map(function( i, elem ){
7326
- var val = jQuery( this ).val();
7327
-
7328
- return val == null ?
7329
- null :
7330
- jQuery.isArray( val ) ?
7331
- jQuery.map( val, function( val ){
7332
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7333
- }) :
7334
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7335
- }).get();
7336
- }
7337
- });
7338
-
7339
- //Serialize an array of form elements or a set of
7340
- //key/values into a query string
7341
- jQuery.param = function( a, traditional ) {
7342
- var prefix,
7343
- s = [],
7344
- add = function( key, value ) {
7345
- // If value is a function, invoke it and return its value
7346
- value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
7347
- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
7348
- };
7349
-
7350
- // Set traditional to true for jQuery <= 1.3.2 behavior.
7351
- if ( traditional === undefined ) {
7352
- traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
7353
- }
7354
-
7355
- // If an array was passed in, assume that it is an array of form elements.
7356
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
7357
- // Serialize the form elements
7358
- jQuery.each( a, function() {
7359
- add( this.name, this.value );
7360
- });
7361
-
7362
- } else {
7363
- // If traditional, encode the "old" way (the way 1.3.2 or older
7364
- // did it), otherwise encode params recursively.
7365
- for ( prefix in a ) {
7366
- buildParams( prefix, a[ prefix ], traditional, add );
7367
- }
7368
- }
7369
-
7370
- // Return the resulting serialization
7371
- return s.join( "&" ).replace( r20, "+" );
7372
- };
7373
-
7374
- function buildParams( prefix, obj, traditional, add ) {
7375
- var name;
7376
-
7377
- if ( jQuery.isArray( obj ) ) {
7378
- // Serialize array item.
7379
- jQuery.each( obj, function( i, v ) {
7380
- if ( traditional || rbracket.test( prefix ) ) {
7381
- // Treat each array item as a scalar.
7382
- add( prefix, v );
7383
-
7384
- } else {
7385
- // Item is non-scalar (array or object), encode its numeric index.
7386
- buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
7387
- }
7388
- });
7389
-
7390
- } else if ( !traditional && jQuery.type( obj ) === "object" ) {
7391
- // Serialize object item.
7392
- for ( name in obj ) {
7393
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
7394
- }
7395
-
7396
- } else {
7397
- // Serialize scalar item.
7398
- add( prefix, obj );
7399
- }
7400
- }
7401
- jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
7402
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
7403
- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
7404
-
7405
- // Handle event binding
7406
- jQuery.fn[ name ] = function( data, fn ) {
7407
- return arguments.length > 0 ?
7408
- this.on( name, null, data, fn ) :
7409
- this.trigger( name );
7410
- };
7411
- });
7412
-
7413
- jQuery.fn.hover = function( fnOver, fnOut ) {
7414
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
7415
- };
7416
- var
7417
- // Document location
7418
- ajaxLocParts,
7419
- ajaxLocation,
7420
- ajax_nonce = jQuery.now(),
7421
-
7422
- ajax_rquery = /\?/,
7423
- rhash = /#.*$/,
7424
- rts = /([?&])_=[^&]*/,
7425
- rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
7426
- // #7653, #8125, #8152: local protocol detection
7427
- rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
7428
- rnoContent = /^(?:GET|HEAD)$/,
7429
- rprotocol = /^\/\//,
7430
- rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
7431
-
7432
- // Keep a copy of the old load method
7433
- _load = jQuery.fn.load,
7434
-
7435
- /* Prefilters
7436
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
7437
- * 2) These are called:
7438
- * - BEFORE asking for a transport
7439
- * - AFTER param serialization (s.data is a string if s.processData is true)
7440
- * 3) key is the dataType
7441
- * 4) the catchall symbol "*" can be used
7442
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
7443
- */
7444
- prefilters = {},
7445
-
7446
- /* Transports bindings
7447
- * 1) key is the dataType
7448
- * 2) the catchall symbol "*" can be used
7449
- * 3) selection will start with transport dataType and THEN go to "*" if needed
7450
- */
7451
- transports = {},
7452
-
7453
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
7454
- allTypes = "*/".concat("*");
7455
-
7456
- // #8138, IE may throw an exception when accessing
7457
- // a field from window.location if document.domain has been set
7458
- try {
7459
- ajaxLocation = location.href;
7460
- } catch( e ) {
7461
- // Use the href attribute of an A element
7462
- // since IE will modify it given document.location
7463
- ajaxLocation = document.createElement( "a" );
7464
- ajaxLocation.href = "";
7465
- ajaxLocation = ajaxLocation.href;
7466
- }
7467
-
7468
- // Segment location into parts
7469
- ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
7470
-
7471
-
7472
- // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
7473
- function addToPrefiltersOrTransports( structure ) {
7474
-
7475
- // dataTypeExpression is optional and defaults to "*"
7476
- return function( dataTypeExpression, func ) {
7477
-
7478
- if ( typeof dataTypeExpression !== "string" ) {
7479
- func = dataTypeExpression;
7480
- dataTypeExpression = "*";
7481
- }
7482
-
7483
- var dataType,
7484
- i = 0,
7485
- dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
7486
-
7487
- if ( jQuery.isFunction( func ) ) {
7488
- // For each dataType in the dataTypeExpression
7489
- while ( (dataType = dataTypes[i++]) ) {
7490
- // Prepend if requested
7491
- if ( dataType[0] === "+" ) {
7492
- dataType = dataType.slice( 1 ) || "*";
7493
- (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
7494
-
7495
- // Otherwise append
7496
- } else {
7497
- (structure[ dataType ] = structure[ dataType ] || []).push( func );
7498
- }
7499
- }
7500
- }
7501
- };
7502
- }
7503
-
7504
- // Base inspection function for prefilters and transports
7505
- function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
7506
-
7507
- var inspected = {},
7508
- seekingTransport = ( structure === transports );
7509
-
7510
- function inspect( dataType ) {
7511
- var selected;
7512
- inspected[ dataType ] = true;
7513
- jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
7514
- var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
7515
- if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
7516
- options.dataTypes.unshift( dataTypeOrTransport );
7517
- inspect( dataTypeOrTransport );
7518
- return false;
7519
- } else if ( seekingTransport ) {
7520
- return !( selected = dataTypeOrTransport );
7521
- }
7522
- });
7523
- return selected;
7524
- }
7525
-
7526
- return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
7527
- }
7528
-
7529
- // A special extend for ajax options
7530
- // that takes "flat" options (not to be deep extended)
7531
- // Fixes #9887
7532
- function ajaxExtend( target, src ) {
7533
- var deep, key,
7534
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
7535
-
7536
- for ( key in src ) {
7537
- if ( src[ key ] !== undefined ) {
7538
- ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
7539
- }
7540
- }
7541
- if ( deep ) {
7542
- jQuery.extend( true, target, deep );
7543
- }
7544
-
7545
- return target;
7546
- }
7547
-
7548
- jQuery.fn.load = function( url, params, callback ) {
7549
- if ( typeof url !== "string" && _load ) {
7550
- return _load.apply( this, arguments );
7551
- }
7552
-
7553
- var selector, response, type,
7554
- self = this,
7555
- off = url.indexOf(" ");
7556
-
7557
- if ( off >= 0 ) {
7558
- selector = url.slice( off, url.length );
7559
- url = url.slice( 0, off );
7560
- }
7561
-
7562
- // If it's a function
7563
- if ( jQuery.isFunction( params ) ) {
7564
-
7565
- // We assume that it's the callback
7566
- callback = params;
7567
- params = undefined;
7568
-
7569
- // Otherwise, build a param string
7570
- } else if ( params && typeof params === "object" ) {
7571
- type = "POST";
7572
- }
7573
-
7574
- // If we have elements to modify, make the request
7575
- if ( self.length > 0 ) {
7576
- jQuery.ajax({
7577
- url: url,
7578
-
7579
- // if "type" variable is undefined, then "GET" method will be used
7580
- type: type,
7581
- dataType: "html",
7582
- data: params
7583
- }).done(function( responseText ) {
7584
-
7585
- // Save response for use in complete callback
7586
- response = arguments;
7587
-
7588
- self.html( selector ?
7589
-
7590
- // If a selector was specified, locate the right elements in a dummy div
7591
- // Exclude scripts to avoid IE 'Permission Denied' errors
7592
- jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
7593
-
7594
- // Otherwise use the full result
7595
- responseText );
7596
-
7597
- }).complete( callback && function( jqXHR, status ) {
7598
- self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
7599
- });
7600
- }
7601
-
7602
- return this;
7603
- };
7604
-
7605
- // Attach a bunch of functions for handling common AJAX events
7606
- jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
7607
- jQuery.fn[ type ] = function( fn ){
7608
- return this.on( type, fn );
7609
- };
7610
- });
7611
-
7612
- jQuery.each( [ "get", "post" ], function( i, method ) {
7613
- jQuery[ method ] = function( url, data, callback, type ) {
7614
- // shift arguments if data argument was omitted
7615
- if ( jQuery.isFunction( data ) ) {
7616
- type = type || callback;
7617
- callback = data;
7618
- data = undefined;
7619
- }
7620
-
7621
- return jQuery.ajax({
7622
- url: url,
7623
- type: method,
7624
- dataType: type,
7625
- data: data,
7626
- success: callback
7627
- });
7628
- };
7629
- });
7630
-
7631
- jQuery.extend({
7632
-
7633
- // Counter for holding the number of active queries
7634
- active: 0,
7635
-
7636
- // Last-Modified header cache for next request
7637
- lastModified: {},
7638
- etag: {},
7639
-
7640
- ajaxSettings: {
7641
- url: ajaxLocation,
7642
- type: "GET",
7643
- isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
7644
- global: true,
7645
- processData: true,
7646
- async: true,
7647
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
7648
- /*
7649
- timeout: 0,
7650
- data: null,
7651
- dataType: null,
7652
- username: null,
7653
- password: null,
7654
- cache: null,
7655
- throws: false,
7656
- traditional: false,
7657
- headers: {},
7658
- */
7659
-
7660
- accepts: {
7661
- "*": allTypes,
7662
- text: "text/plain",
7663
- html: "text/html",
7664
- xml: "application/xml, text/xml",
7665
- json: "application/json, text/javascript"
7666
- },
7667
-
7668
- contents: {
7669
- xml: /xml/,
7670
- html: /html/,
7671
- json: /json/
7672
- },
7673
-
7674
- responseFields: {
7675
- xml: "responseXML",
7676
- text: "responseText"
7677
- },
7678
-
7679
- // Data converters
7680
- // Keys separate source (or catchall "*") and destination types with a single space
7681
- converters: {
7682
-
7683
- // Convert anything to text
7684
- "* text": window.String,
7685
-
7686
- // Text to html (true = no transformation)
7687
- "text html": true,
7688
-
7689
- // Evaluate text as a json expression
7690
- "text json": jQuery.parseJSON,
7691
-
7692
- // Parse text as xml
7693
- "text xml": jQuery.parseXML
7694
- },
7695
-
7696
- // For options that shouldn't be deep extended:
7697
- // you can add your own custom options here if
7698
- // and when you create one that shouldn't be
7699
- // deep extended (see ajaxExtend)
7700
- flatOptions: {
7701
- url: true,
7702
- context: true
7703
- }
7704
- },
7705
-
7706
- // Creates a full fledged settings object into target
7707
- // with both ajaxSettings and settings fields.
7708
- // If target is omitted, writes into ajaxSettings.
7709
- ajaxSetup: function( target, settings ) {
7710
- return settings ?
7711
-
7712
- // Building a settings object
7713
- ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
7714
-
7715
- // Extending ajaxSettings
7716
- ajaxExtend( jQuery.ajaxSettings, target );
7717
- },
7718
-
7719
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
7720
- ajaxTransport: addToPrefiltersOrTransports( transports ),
7721
-
7722
- // Main method
7723
- ajax: function( url, options ) {
7724
-
7725
- // If url is an object, simulate pre-1.5 signature
7726
- if ( typeof url === "object" ) {
7727
- options = url;
7728
- url = undefined;
7729
- }
7730
-
7731
- // Force options to be an object
7732
- options = options || {};
7733
-
7734
- var // Cross-domain detection vars
7735
- parts,
7736
- // Loop variable
7737
- i,
7738
- // URL without anti-cache param
7739
- cacheURL,
7740
- // Response headers as string
7741
- responseHeadersString,
7742
- // timeout handle
7743
- timeoutTimer,
7744
-
7745
- // To know if global events are to be dispatched
7746
- fireGlobals,
7747
-
7748
- transport,
7749
- // Response headers
7750
- responseHeaders,
7751
- // Create the final options object
7752
- s = jQuery.ajaxSetup( {}, options ),
7753
- // Callbacks context
7754
- callbackContext = s.context || s,
7755
- // Context for global events is callbackContext if it is a DOM node or jQuery collection
7756
- globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
7757
- jQuery( callbackContext ) :
7758
- jQuery.event,
7759
- // Deferreds
7760
- deferred = jQuery.Deferred(),
7761
- completeDeferred = jQuery.Callbacks("once memory"),
7762
- // Status-dependent callbacks
7763
- statusCode = s.statusCode || {},
7764
- // Headers (they are sent all at once)
7765
- requestHeaders = {},
7766
- requestHeadersNames = {},
7767
- // The jqXHR state
7768
- state = 0,
7769
- // Default abort message
7770
- strAbort = "canceled",
7771
- // Fake xhr
7772
- jqXHR = {
7773
- readyState: 0,
7774
-
7775
- // Builds headers hashtable if needed
7776
- getResponseHeader: function( key ) {
7777
- var match;
7778
- if ( state === 2 ) {
7779
- if ( !responseHeaders ) {
7780
- responseHeaders = {};
7781
- while ( (match = rheaders.exec( responseHeadersString )) ) {
7782
- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
7783
- }
7784
- }
7785
- match = responseHeaders[ key.toLowerCase() ];
7786
- }
7787
- return match == null ? null : match;
7788
- },
7789
-
7790
- // Raw string
7791
- getAllResponseHeaders: function() {
7792
- return state === 2 ? responseHeadersString : null;
7793
- },
7794
-
7795
- // Caches the header
7796
- setRequestHeader: function( name, value ) {
7797
- var lname = name.toLowerCase();
7798
- if ( !state ) {
7799
- name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
7800
- requestHeaders[ name ] = value;
7801
- }
7802
- return this;
7803
- },
7804
-
7805
- // Overrides response content-type header
7806
- overrideMimeType: function( type ) {
7807
- if ( !state ) {
7808
- s.mimeType = type;
7809
- }
7810
- return this;
7811
- },
7812
-
7813
- // Status-dependent callbacks
7814
- statusCode: function( map ) {
7815
- var code;
7816
- if ( map ) {
7817
- if ( state < 2 ) {
7818
- for ( code in map ) {
7819
- // Lazy-add the new callback in a way that preserves old ones
7820
- statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
7821
- }
7822
- } else {
7823
- // Execute the appropriate callbacks
7824
- jqXHR.always( map[ jqXHR.status ] );
7825
- }
7826
- }
7827
- return this;
7828
- },
7829
-
7830
- // Cancel the request
7831
- abort: function( statusText ) {
7832
- var finalText = statusText || strAbort;
7833
- if ( transport ) {
7834
- transport.abort( finalText );
7835
- }
7836
- done( 0, finalText );
7837
- return this;
7838
- }
7839
- };
7840
-
7841
- // Attach deferreds
7842
- deferred.promise( jqXHR ).complete = completeDeferred.add;
7843
- jqXHR.success = jqXHR.done;
7844
- jqXHR.error = jqXHR.fail;
7845
-
7846
- // Remove hash character (#7531: and string promotion)
7847
- // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
7848
- // Handle falsy url in the settings object (#10093: consistency with old signature)
7849
- // We also use the url parameter if available
7850
- s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
7851
-
7852
- // Alias method option to type as per ticket #12004
7853
- s.type = options.method || options.type || s.method || s.type;
7854
-
7855
- // Extract dataTypes list
7856
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
7857
-
7858
- // A cross-domain request is in order when we have a protocol:host:port mismatch
7859
- if ( s.crossDomain == null ) {
7860
- parts = rurl.exec( s.url.toLowerCase() );
7861
- s.crossDomain = !!( parts &&
7862
- ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
7863
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
7864
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
7865
- );
7866
- }
7867
-
7868
- // Convert data if not already a string
7869
- if ( s.data && s.processData && typeof s.data !== "string" ) {
7870
- s.data = jQuery.param( s.data, s.traditional );
7871
- }
7872
-
7873
- // Apply prefilters
7874
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
7875
-
7876
- // If request was aborted inside a prefilter, stop there
7877
- if ( state === 2 ) {
7878
- return jqXHR;
7879
- }
7880
-
7881
- // We can fire global events as of now if asked to
7882
- fireGlobals = s.global;
7883
-
7884
- // Watch for a new set of requests
7885
- if ( fireGlobals && jQuery.active++ === 0 ) {
7886
- jQuery.event.trigger("ajaxStart");
7887
- }
7888
-
7889
- // Uppercase the type
7890
- s.type = s.type.toUpperCase();
7891
-
7892
- // Determine if request has content
7893
- s.hasContent = !rnoContent.test( s.type );
7894
-
7895
- // Save the URL in case we're toying with the If-Modified-Since
7896
- // and/or If-None-Match header later on
7897
- cacheURL = s.url;
7898
-
7899
- // More options handling for requests with no content
7900
- if ( !s.hasContent ) {
7901
-
7902
- // If data is available, append data to url
7903
- if ( s.data ) {
7904
- cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
7905
- // #9682: remove data so that it's not used in an eventual retry
7906
- delete s.data;
7907
- }
7908
-
7909
- // Add anti-cache in url if needed
7910
- if ( s.cache === false ) {
7911
- s.url = rts.test( cacheURL ) ?
7912
-
7913
- // If there is already a '_' parameter, set its value
7914
- cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
7915
-
7916
- // Otherwise add one to the end
7917
- cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
7918
- }
7919
- }
7920
-
7921
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
7922
- if ( s.ifModified ) {
7923
- if ( jQuery.lastModified[ cacheURL ] ) {
7924
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
7925
- }
7926
- if ( jQuery.etag[ cacheURL ] ) {
7927
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
7928
- }
7929
- }
7930
-
7931
- // Set the correct header, if data is being sent
7932
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
7933
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
7934
- }
7935
-
7936
- // Set the Accepts header for the server, depending on the dataType
7937
- jqXHR.setRequestHeader(
7938
- "Accept",
7939
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
7940
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
7941
- s.accepts[ "*" ]
7942
- );
7943
-
7944
- // Check for headers option
7945
- for ( i in s.headers ) {
7946
- jqXHR.setRequestHeader( i, s.headers[ i ] );
7947
- }
7948
-
7949
- // Allow custom headers/mimetypes and early abort
7950
- if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
7951
- // Abort if not done already and return
7952
- return jqXHR.abort();
7953
- }
7954
-
7955
- // aborting is no longer a cancellation
7956
- strAbort = "abort";
7957
-
7958
- // Install callbacks on deferreds
7959
- for ( i in { success: 1, error: 1, complete: 1 } ) {
7960
- jqXHR[ i ]( s[ i ] );
7961
- }
7962
-
7963
- // Get transport
7964
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
7965
-
7966
- // If no transport, we auto-abort
7967
- if ( !transport ) {
7968
- done( -1, "No Transport" );
7969
- } else {
7970
- jqXHR.readyState = 1;
7971
-
7972
- // Send global event
7973
- if ( fireGlobals ) {
7974
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
7975
- }
7976
- // Timeout
7977
- if ( s.async && s.timeout > 0 ) {
7978
- timeoutTimer = setTimeout(function() {
7979
- jqXHR.abort("timeout");
7980
- }, s.timeout );
7981
- }
7982
-
7983
- try {
7984
- state = 1;
7985
- transport.send( requestHeaders, done );
7986
- } catch ( e ) {
7987
- // Propagate exception as error if not done
7988
- if ( state < 2 ) {
7989
- done( -1, e );
7990
- // Simply rethrow otherwise
7991
- } else {
7992
- throw e;
7993
- }
7994
- }
7995
- }
7996
-
7997
- // Callback for when everything is done
7998
- function done( status, nativeStatusText, responses, headers ) {
7999
- var isSuccess, success, error, response, modified,
8000
- statusText = nativeStatusText;
8001
-
8002
- // Called once
8003
- if ( state === 2 ) {
8004
- return;
8005
- }
8006
-
8007
- // State is "done" now
8008
- state = 2;
8009
-
8010
- // Clear timeout if it exists
8011
- if ( timeoutTimer ) {
8012
- clearTimeout( timeoutTimer );
8013
- }
8014
-
8015
- // Dereference transport for early garbage collection
8016
- // (no matter how long the jqXHR object will be used)
8017
- transport = undefined;
8018
-
8019
- // Cache response headers
8020
- responseHeadersString = headers || "";
8021
-
8022
- // Set readyState
8023
- jqXHR.readyState = status > 0 ? 4 : 0;
8024
-
8025
- // Get response data
8026
- if ( responses ) {
8027
- response = ajaxHandleResponses( s, jqXHR, responses );
8028
- }
8029
-
8030
- // If successful, handle type chaining
8031
- if ( status >= 200 && status < 300 || status === 304 ) {
8032
-
8033
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8034
- if ( s.ifModified ) {
8035
- modified = jqXHR.getResponseHeader("Last-Modified");
8036
- if ( modified ) {
8037
- jQuery.lastModified[ cacheURL ] = modified;
8038
- }
8039
- modified = jqXHR.getResponseHeader("etag");
8040
- if ( modified ) {
8041
- jQuery.etag[ cacheURL ] = modified;
8042
- }
8043
- }
8044
-
8045
- // if no content
8046
- if ( status === 204 ) {
8047
- isSuccess = true;
8048
- statusText = "nocontent";
8049
-
8050
- // if not modified
8051
- } else if ( status === 304 ) {
8052
- isSuccess = true;
8053
- statusText = "notmodified";
8054
-
8055
- // If we have data, let's convert it
8056
- } else {
8057
- isSuccess = ajaxConvert( s, response );
8058
- statusText = isSuccess.state;
8059
- success = isSuccess.data;
8060
- error = isSuccess.error;
8061
- isSuccess = !error;
8062
- }
8063
- } else {
8064
- // We extract error from statusText
8065
- // then normalize statusText and status for non-aborts
8066
- error = statusText;
8067
- if ( status || !statusText ) {
8068
- statusText = "error";
8069
- if ( status < 0 ) {
8070
- status = 0;
8071
- }
8072
- }
8073
- }
8074
-
8075
- // Set data for the fake xhr object
8076
- jqXHR.status = status;
8077
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
8078
-
8079
- // Success/Error
8080
- if ( isSuccess ) {
8081
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
8082
- } else {
8083
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
8084
- }
8085
-
8086
- // Status-dependent callbacks
8087
- jqXHR.statusCode( statusCode );
8088
- statusCode = undefined;
8089
-
8090
- if ( fireGlobals ) {
8091
- globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
8092
- [ jqXHR, s, isSuccess ? success : error ] );
8093
- }
8094
-
8095
- // Complete
8096
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
8097
-
8098
- if ( fireGlobals ) {
8099
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
8100
- // Handle the global AJAX counter
8101
- if ( !( --jQuery.active ) ) {
8102
- jQuery.event.trigger("ajaxStop");
8103
- }
8104
- }
8105
- }
8106
-
8107
- return jqXHR;
8108
- },
8109
-
8110
- getScript: function( url, callback ) {
8111
- return jQuery.get( url, undefined, callback, "script" );
8112
- },
8113
-
8114
- getJSON: function( url, data, callback ) {
8115
- return jQuery.get( url, data, callback, "json" );
8116
- }
8117
- });
8118
-
8119
- /* Handles responses to an ajax request:
8120
- * - sets all responseXXX fields accordingly
8121
- * - finds the right dataType (mediates between content-type and expected dataType)
8122
- * - returns the corresponding response
8123
- */
8124
- function ajaxHandleResponses( s, jqXHR, responses ) {
8125
- var firstDataType, ct, finalDataType, type,
8126
- contents = s.contents,
8127
- dataTypes = s.dataTypes,
8128
- responseFields = s.responseFields;
8129
-
8130
- // Fill responseXXX fields
8131
- for ( type in responseFields ) {
8132
- if ( type in responses ) {
8133
- jqXHR[ responseFields[type] ] = responses[ type ];
8134
- }
8135
- }
8136
-
8137
- // Remove auto dataType and get content-type in the process
8138
- while( dataTypes[ 0 ] === "*" ) {
8139
- dataTypes.shift();
8140
- if ( ct === undefined ) {
8141
- ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
8142
- }
8143
- }
8144
-
8145
- // Check if we're dealing with a known content-type
8146
- if ( ct ) {
8147
- for ( type in contents ) {
8148
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
8149
- dataTypes.unshift( type );
8150
- break;
8151
- }
8152
- }
8153
- }
8154
-
8155
- // Check to see if we have a response for the expected dataType
8156
- if ( dataTypes[ 0 ] in responses ) {
8157
- finalDataType = dataTypes[ 0 ];
8158
- } else {
8159
- // Try convertible dataTypes
8160
- for ( type in responses ) {
8161
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
8162
- finalDataType = type;
8163
- break;
8164
- }
8165
- if ( !firstDataType ) {
8166
- firstDataType = type;
8167
- }
8168
- }
8169
- // Or just use first one
8170
- finalDataType = finalDataType || firstDataType;
8171
- }
8172
-
8173
- // If we found a dataType
8174
- // We add the dataType to the list if needed
8175
- // and return the corresponding response
8176
- if ( finalDataType ) {
8177
- if ( finalDataType !== dataTypes[ 0 ] ) {
8178
- dataTypes.unshift( finalDataType );
8179
- }
8180
- return responses[ finalDataType ];
8181
- }
8182
- }
8183
-
8184
- // Chain conversions given the request and the original response
8185
- function ajaxConvert( s, response ) {
8186
- var conv2, current, conv, tmp,
8187
- converters = {},
8188
- i = 0,
8189
- // Work with a copy of dataTypes in case we need to modify it for conversion
8190
- dataTypes = s.dataTypes.slice(),
8191
- prev = dataTypes[ 0 ];
8192
-
8193
- // Apply the dataFilter if provided
8194
- if ( s.dataFilter ) {
8195
- response = s.dataFilter( response, s.dataType );
8196
- }
8197
-
8198
- // Create converters map with lowercased keys
8199
- if ( dataTypes[ 1 ] ) {
8200
- for ( conv in s.converters ) {
8201
- converters[ conv.toLowerCase() ] = s.converters[ conv ];
8202
- }
8203
- }
8204
-
8205
- // Convert to each sequential dataType, tolerating list modification
8206
- for ( ; (current = dataTypes[++i]); ) {
8207
-
8208
- // There's only work to do if current dataType is non-auto
8209
- if ( current !== "*" ) {
8210
-
8211
- // Convert response if prev dataType is non-auto and differs from current
8212
- if ( prev !== "*" && prev !== current ) {
8213
-
8214
- // Seek a direct converter
8215
- conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8216
-
8217
- // If none found, seek a pair
8218
- if ( !conv ) {
8219
- for ( conv2 in converters ) {
8220
-
8221
- // If conv2 outputs current
8222
- tmp = conv2.split(" ");
8223
- if ( tmp[ 1 ] === current ) {
8224
-
8225
- // If prev can be converted to accepted input
8226
- conv = converters[ prev + " " + tmp[ 0 ] ] ||
8227
- converters[ "* " + tmp[ 0 ] ];
8228
- if ( conv ) {
8229
- // Condense equivalence converters
8230
- if ( conv === true ) {
8231
- conv = converters[ conv2 ];
8232
-
8233
- // Otherwise, insert the intermediate dataType
8234
- } else if ( converters[ conv2 ] !== true ) {
8235
- current = tmp[ 0 ];
8236
- dataTypes.splice( i--, 0, current );
8237
- }
8238
-
8239
- break;
8240
- }
8241
- }
8242
- }
8243
- }
8244
-
8245
- // Apply converter (if not an equivalence)
8246
- if ( conv !== true ) {
8247
-
8248
- // Unless errors are allowed to bubble, catch and return them
8249
- if ( conv && s["throws"] ) {
8250
- response = conv( response );
8251
- } else {
8252
- try {
8253
- response = conv( response );
8254
- } catch ( e ) {
8255
- return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
8256
- }
8257
- }
8258
- }
8259
- }
8260
-
8261
- // Update prev for next iteration
8262
- prev = current;
8263
- }
8264
- }
8265
-
8266
- return { state: "success", data: response };
8267
- }
8268
- // Install script dataType
8269
- jQuery.ajaxSetup({
8270
- accepts: {
8271
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
8272
- },
8273
- contents: {
8274
- script: /(?:java|ecma)script/
8275
- },
8276
- converters: {
8277
- "text script": function( text ) {
8278
- jQuery.globalEval( text );
8279
- return text;
8280
- }
8281
- }
8282
- });
8283
-
8284
- // Handle cache's special case and global
8285
- jQuery.ajaxPrefilter( "script", function( s ) {
8286
- if ( s.cache === undefined ) {
8287
- s.cache = false;
8288
- }
8289
- if ( s.crossDomain ) {
8290
- s.type = "GET";
8291
- s.global = false;
8292
- }
8293
- });
8294
-
8295
- // Bind script tag hack transport
8296
- jQuery.ajaxTransport( "script", function(s) {
8297
-
8298
- // This transport only deals with cross domain requests
8299
- if ( s.crossDomain ) {
8300
-
8301
- var script,
8302
- head = document.head || jQuery("head")[0] || document.documentElement;
8303
-
8304
- return {
8305
-
8306
- send: function( _, callback ) {
8307
-
8308
- script = document.createElement("script");
8309
-
8310
- script.async = true;
8311
-
8312
- if ( s.scriptCharset ) {
8313
- script.charset = s.scriptCharset;
8314
- }
8315
-
8316
- script.src = s.url;
8317
-
8318
- // Attach handlers for all browsers
8319
- script.onload = script.onreadystatechange = function( _, isAbort ) {
8320
-
8321
- if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
8322
-
8323
- // Handle memory leak in IE
8324
- script.onload = script.onreadystatechange = null;
8325
-
8326
- // Remove the script
8327
- if ( script.parentNode ) {
8328
- script.parentNode.removeChild( script );
8329
- }
8330
-
8331
- // Dereference the script
8332
- script = null;
8333
-
8334
- // Callback if not abort
8335
- if ( !isAbort ) {
8336
- callback( 200, "success" );
8337
- }
8338
- }
8339
- };
8340
-
8341
- // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
8342
- // Use native DOM manipulation to avoid our domManip AJAX trickery
8343
- head.insertBefore( script, head.firstChild );
8344
- },
8345
-
8346
- abort: function() {
8347
- if ( script ) {
8348
- script.onload( undefined, true );
8349
- }
8350
- }
8351
- };
8352
- }
8353
- });
8354
- var oldCallbacks = [],
8355
- rjsonp = /(=)\?(?=&|$)|\?\?/;
8356
-
8357
- // Default jsonp settings
8358
- jQuery.ajaxSetup({
8359
- jsonp: "callback",
8360
- jsonpCallback: function() {
8361
- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
8362
- this[ callback ] = true;
8363
- return callback;
8364
- }
8365
- });
8366
-
8367
- // Detect, normalize options and install callbacks for jsonp requests
8368
- jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
8369
-
8370
- var callbackName, overwritten, responseContainer,
8371
- jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
8372
- "url" :
8373
- typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
8374
- );
8375
-
8376
- // Handle iff the expected data type is "jsonp" or we have a parameter to set
8377
- if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
8378
-
8379
- // Get callback name, remembering preexisting value associated with it
8380
- callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
8381
- s.jsonpCallback() :
8382
- s.jsonpCallback;
8383
-
8384
- // Insert callback into url or form data
8385
- if ( jsonProp ) {
8386
- s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
8387
- } else if ( s.jsonp !== false ) {
8388
- s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
8389
- }
8390
-
8391
- // Use data converter to retrieve json after script execution
8392
- s.converters["script json"] = function() {
8393
- if ( !responseContainer ) {
8394
- jQuery.error( callbackName + " was not called" );
8395
- }
8396
- return responseContainer[ 0 ];
8397
- };
8398
-
8399
- // force json dataType
8400
- s.dataTypes[ 0 ] = "json";
8401
-
8402
- // Install callback
8403
- overwritten = window[ callbackName ];
8404
- window[ callbackName ] = function() {
8405
- responseContainer = arguments;
8406
- };
8407
-
8408
- // Clean-up function (fires after converters)
8409
- jqXHR.always(function() {
8410
- // Restore preexisting value
8411
- window[ callbackName ] = overwritten;
8412
-
8413
- // Save back as free
8414
- if ( s[ callbackName ] ) {
8415
- // make sure that re-using the options doesn't screw things around
8416
- s.jsonpCallback = originalSettings.jsonpCallback;
8417
-
8418
- // save the callback name for future use
8419
- oldCallbacks.push( callbackName );
8420
- }
8421
-
8422
- // Call if it was a function and we have a response
8423
- if ( responseContainer && jQuery.isFunction( overwritten ) ) {
8424
- overwritten( responseContainer[ 0 ] );
8425
- }
8426
-
8427
- responseContainer = overwritten = undefined;
8428
- });
8429
-
8430
- // Delegate to script
8431
- return "script";
8432
- }
8433
- });
8434
- var xhrCallbacks, xhrSupported,
8435
- xhrId = 0,
8436
- // #5280: Internet Explorer will keep connections alive if we don't abort on unload
8437
- xhrOnUnloadAbort = window.ActiveXObject && function() {
8438
- // Abort all pending requests
8439
- var key;
8440
- for ( key in xhrCallbacks ) {
8441
- xhrCallbacks[ key ]( undefined, true );
8442
- }
8443
- };
8444
-
8445
- // Functions to create xhrs
8446
- function createStandardXHR() {
8447
- try {
8448
- return new window.XMLHttpRequest();
8449
- } catch( e ) {}
8450
- }
8451
-
8452
- function createActiveXHR() {
8453
- try {
8454
- return new window.ActiveXObject("Microsoft.XMLHTTP");
8455
- } catch( e ) {}
8456
- }
8457
-
8458
- // Create the request object
8459
- // (This is still attached to ajaxSettings for backward compatibility)
8460
- jQuery.ajaxSettings.xhr = window.ActiveXObject ?
8461
- /* Microsoft failed to properly
8462
- * implement the XMLHttpRequest in IE7 (can't request local files),
8463
- * so we use the ActiveXObject when it is available
8464
- * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
8465
- * we need a fallback.
8466
- */
8467
- function() {
8468
- return !this.isLocal && createStandardXHR() || createActiveXHR();
8469
- } :
8470
- // For all other browsers, use the standard XMLHttpRequest object
8471
- createStandardXHR;
8472
-
8473
- // Determine support properties
8474
- xhrSupported = jQuery.ajaxSettings.xhr();
8475
- jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
8476
- xhrSupported = jQuery.support.ajax = !!xhrSupported;
8477
-
8478
- // Create transport if the browser can provide an xhr
8479
- if ( xhrSupported ) {
8480
-
8481
- jQuery.ajaxTransport(function( s ) {
8482
- // Cross domain only allowed if supported through XMLHttpRequest
8483
- if ( !s.crossDomain || jQuery.support.cors ) {
8484
-
8485
- var callback;
8486
-
8487
- return {
8488
- send: function( headers, complete ) {
8489
-
8490
- // Get a new xhr
8491
- var handle, i,
8492
- xhr = s.xhr();
8493
-
8494
- // Open the socket
8495
- // Passing null username, generates a login popup on Opera (#2865)
8496
- if ( s.username ) {
8497
- xhr.open( s.type, s.url, s.async, s.username, s.password );
8498
- } else {
8499
- xhr.open( s.type, s.url, s.async );
8500
- }
8501
-
8502
- // Apply custom fields if provided
8503
- if ( s.xhrFields ) {
8504
- for ( i in s.xhrFields ) {
8505
- xhr[ i ] = s.xhrFields[ i ];
8506
- }
8507
- }
8508
-
8509
-
8510
- // Override mime type if needed
8511
- if ( s.mimeType && xhr.overrideMimeType ) {
8512
- xhr.overrideMimeType( s.mimeType );
8513
- }
8514
-
8515
- // X-Requested-With header
8516
- // For cross-domain requests, seeing as conditions for a preflight are
8517
- // akin to a jigsaw puzzle, we simply never set it to be sure.
8518
- // (it can always be set on a per-request basis or even using ajaxSetup)
8519
- // For same-domain requests, won't change header if already provided.
8520
- if ( !s.crossDomain && !headers["X-Requested-With"] ) {
8521
- headers["X-Requested-With"] = "XMLHttpRequest";
8522
- }
8523
-
8524
- // Need an extra try/catch for cross domain requests in Firefox 3
8525
- try {
8526
- for ( i in headers ) {
8527
- xhr.setRequestHeader( i, headers[ i ] );
8528
- }
8529
- } catch( err ) {}
8530
-
8531
- // Do send the request
8532
- // This may raise an exception which is actually
8533
- // handled in jQuery.ajax (so no try/catch here)
8534
- xhr.send( ( s.hasContent && s.data ) || null );
8535
-
8536
- // Listener
8537
- callback = function( _, isAbort ) {
8538
- var status, responseHeaders, statusText, responses;
8539
-
8540
- // Firefox throws exceptions when accessing properties
8541
- // of an xhr when a network error occurred
8542
- // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
8543
- try {
8544
-
8545
- // Was never called and is aborted or complete
8546
- if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
8547
-
8548
- // Only called once
8549
- callback = undefined;
8550
-
8551
- // Do not keep as active anymore
8552
- if ( handle ) {
8553
- xhr.onreadystatechange = jQuery.noop;
8554
- if ( xhrOnUnloadAbort ) {
8555
- delete xhrCallbacks[ handle ];
8556
- }
8557
- }
8558
-
8559
- // If it's an abort
8560
- if ( isAbort ) {
8561
- // Abort it manually if needed
8562
- if ( xhr.readyState !== 4 ) {
8563
- xhr.abort();
8564
- }
8565
- } else {
8566
- responses = {};
8567
- status = xhr.status;
8568
- responseHeaders = xhr.getAllResponseHeaders();
8569
-
8570
- // When requesting binary data, IE6-9 will throw an exception
8571
- // on any attempt to access responseText (#11426)
8572
- if ( typeof xhr.responseText === "string" ) {
8573
- responses.text = xhr.responseText;
8574
- }
8575
-
8576
- // Firefox throws an exception when accessing
8577
- // statusText for faulty cross-domain requests
8578
- try {
8579
- statusText = xhr.statusText;
8580
- } catch( e ) {
8581
- // We normalize with Webkit giving an empty statusText
8582
- statusText = "";
8583
- }
8584
-
8585
- // Filter status for non standard behaviors
8586
-
8587
- // If the request is local and we have data: assume a success
8588
- // (success with no data won't get notified, that's the best we
8589
- // can do given current implementations)
8590
- if ( !status && s.isLocal && !s.crossDomain ) {
8591
- status = responses.text ? 200 : 404;
8592
- // IE - #1450: sometimes returns 1223 when it should be 204
8593
- } else if ( status === 1223 ) {
8594
- status = 204;
8595
- }
8596
- }
8597
- }
8598
- } catch( firefoxAccessException ) {
8599
- if ( !isAbort ) {
8600
- complete( -1, firefoxAccessException );
8601
- }
8602
- }
8603
-
8604
- // Call complete if needed
8605
- if ( responses ) {
8606
- complete( status, statusText, responses, responseHeaders );
8607
- }
8608
- };
8609
-
8610
- if ( !s.async ) {
8611
- // if we're in sync mode we fire the callback
8612
- callback();
8613
- } else if ( xhr.readyState === 4 ) {
8614
- // (IE6 & IE7) if it's in cache and has been
8615
- // retrieved directly we need to fire the callback
8616
- setTimeout( callback );
8617
- } else {
8618
- handle = ++xhrId;
8619
- if ( xhrOnUnloadAbort ) {
8620
- // Create the active xhrs callbacks list if needed
8621
- // and attach the unload handler
8622
- if ( !xhrCallbacks ) {
8623
- xhrCallbacks = {};
8624
- jQuery( window ).unload( xhrOnUnloadAbort );
8625
- }
8626
- // Add to list of active xhrs callbacks
8627
- xhrCallbacks[ handle ] = callback;
8628
- }
8629
- xhr.onreadystatechange = callback;
8630
- }
8631
- },
8632
-
8633
- abort: function() {
8634
- if ( callback ) {
8635
- callback( undefined, true );
8636
- }
8637
- }
8638
- };
8639
- }
8640
- });
8641
- }
8642
- var fxNow, timerId,
8643
- rfxtypes = /^(?:toggle|show|hide)$/,
8644
- rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
8645
- rrun = /queueHooks$/,
8646
- animationPrefilters = [ defaultPrefilter ],
8647
- tweeners = {
8648
- "*": [function( prop, value ) {
8649
- var end, unit,
8650
- tween = this.createTween( prop, value ),
8651
- parts = rfxnum.exec( value ),
8652
- target = tween.cur(),
8653
- start = +target || 0,
8654
- scale = 1,
8655
- maxIterations = 20;
8656
-
8657
- if ( parts ) {
8658
- end = +parts[2];
8659
- unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
8660
-
8661
- // We need to compute starting value
8662
- if ( unit !== "px" && start ) {
8663
- // Iteratively approximate from a nonzero starting point
8664
- // Prefer the current property, because this process will be trivial if it uses the same units
8665
- // Fallback to end or a simple constant
8666
- start = jQuery.css( tween.elem, prop, true ) || end || 1;
8667
-
8668
- do {
8669
- // If previous iteration zeroed out, double until we get *something*
8670
- // Use a string for doubling factor so we don't accidentally see scale as unchanged below
8671
- scale = scale || ".5";
8672
-
8673
- // Adjust and apply
8674
- start = start / scale;
8675
- jQuery.style( tween.elem, prop, start + unit );
8676
-
8677
- // Update scale, tolerating zero or NaN from tween.cur()
8678
- // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
8679
- } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
8680
- }
8681
-
8682
- tween.unit = unit;
8683
- tween.start = start;
8684
- // If a +=/-= token was provided, we're doing a relative animation
8685
- tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
8686
- }
8687
- return tween;
8688
- }]
8689
- };
8690
-
8691
- // Animations created synchronously will run synchronously
8692
- function createFxNow() {
8693
- setTimeout(function() {
8694
- fxNow = undefined;
8695
- });
8696
- return ( fxNow = jQuery.now() );
8697
- }
8698
-
8699
- function createTweens( animation, props ) {
8700
- jQuery.each( props, function( prop, value ) {
8701
- var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
8702
- index = 0,
8703
- length = collection.length;
8704
- for ( ; index < length; index++ ) {
8705
- if ( collection[ index ].call( animation, prop, value ) ) {
8706
-
8707
- // we're done with this property
8708
- return;
8709
- }
8710
- }
8711
- });
8712
- }
8713
-
8714
- function Animation( elem, properties, options ) {
8715
- var result,
8716
- stopped,
8717
- index = 0,
8718
- length = animationPrefilters.length,
8719
- deferred = jQuery.Deferred().always( function() {
8720
- // don't match elem in the :animated selector
8721
- delete tick.elem;
8722
- }),
8723
- tick = function() {
8724
- if ( stopped ) {
8725
- return false;
8726
- }
8727
- var currentTime = fxNow || createFxNow(),
8728
- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
8729
- // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
8730
- temp = remaining / animation.duration || 0,
8731
- percent = 1 - temp,
8732
- index = 0,
8733
- length = animation.tweens.length;
8734
-
8735
- for ( ; index < length ; index++ ) {
8736
- animation.tweens[ index ].run( percent );
8737
- }
8738
-
8739
- deferred.notifyWith( elem, [ animation, percent, remaining ]);
8740
-
8741
- if ( percent < 1 && length ) {
8742
- return remaining;
8743
- } else {
8744
- deferred.resolveWith( elem, [ animation ] );
8745
- return false;
8746
- }
8747
- },
8748
- animation = deferred.promise({
8749
- elem: elem,
8750
- props: jQuery.extend( {}, properties ),
8751
- opts: jQuery.extend( true, { specialEasing: {} }, options ),
8752
- originalProperties: properties,
8753
- originalOptions: options,
8754
- startTime: fxNow || createFxNow(),
8755
- duration: options.duration,
8756
- tweens: [],
8757
- createTween: function( prop, end ) {
8758
- var tween = jQuery.Tween( elem, animation.opts, prop, end,
8759
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
8760
- animation.tweens.push( tween );
8761
- return tween;
8762
- },
8763
- stop: function( gotoEnd ) {
8764
- var index = 0,
8765
- // if we are going to the end, we want to run all the tweens
8766
- // otherwise we skip this part
8767
- length = gotoEnd ? animation.tweens.length : 0;
8768
- if ( stopped ) {
8769
- return this;
8770
- }
8771
- stopped = true;
8772
- for ( ; index < length ; index++ ) {
8773
- animation.tweens[ index ].run( 1 );
8774
- }
8775
-
8776
- // resolve when we played the last frame
8777
- // otherwise, reject
8778
- if ( gotoEnd ) {
8779
- deferred.resolveWith( elem, [ animation, gotoEnd ] );
8780
- } else {
8781
- deferred.rejectWith( elem, [ animation, gotoEnd ] );
8782
- }
8783
- return this;
8784
- }
8785
- }),
8786
- props = animation.props;
8787
-
8788
- propFilter( props, animation.opts.specialEasing );
8789
-
8790
- for ( ; index < length ; index++ ) {
8791
- result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
8792
- if ( result ) {
8793
- return result;
8794
- }
8795
- }
8796
-
8797
- createTweens( animation, props );
8798
-
8799
- if ( jQuery.isFunction( animation.opts.start ) ) {
8800
- animation.opts.start.call( elem, animation );
8801
- }
8802
-
8803
- jQuery.fx.timer(
8804
- jQuery.extend( tick, {
8805
- elem: elem,
8806
- anim: animation,
8807
- queue: animation.opts.queue
8808
- })
8809
- );
8810
-
8811
- // attach callbacks from options
8812
- return animation.progress( animation.opts.progress )
8813
- .done( animation.opts.done, animation.opts.complete )
8814
- .fail( animation.opts.fail )
8815
- .always( animation.opts.always );
8816
- }
8817
-
8818
- function propFilter( props, specialEasing ) {
8819
- var value, name, index, easing, hooks;
8820
-
8821
- // camelCase, specialEasing and expand cssHook pass
8822
- for ( index in props ) {
8823
- name = jQuery.camelCase( index );
8824
- easing = specialEasing[ name ];
8825
- value = props[ index ];
8826
- if ( jQuery.isArray( value ) ) {
8827
- easing = value[ 1 ];
8828
- value = props[ index ] = value[ 0 ];
8829
- }
8830
-
8831
- if ( index !== name ) {
8832
- props[ name ] = value;
8833
- delete props[ index ];
8834
- }
8835
-
8836
- hooks = jQuery.cssHooks[ name ];
8837
- if ( hooks && "expand" in hooks ) {
8838
- value = hooks.expand( value );
8839
- delete props[ name ];
8840
-
8841
- // not quite $.extend, this wont overwrite keys already present.
8842
- // also - reusing 'index' from above because we have the correct "name"
8843
- for ( index in value ) {
8844
- if ( !( index in props ) ) {
8845
- props[ index ] = value[ index ];
8846
- specialEasing[ index ] = easing;
8847
- }
8848
- }
8849
- } else {
8850
- specialEasing[ name ] = easing;
8851
- }
8852
- }
8853
- }
8854
-
8855
- jQuery.Animation = jQuery.extend( Animation, {
8856
-
8857
- tweener: function( props, callback ) {
8858
- if ( jQuery.isFunction( props ) ) {
8859
- callback = props;
8860
- props = [ "*" ];
8861
- } else {
8862
- props = props.split(" ");
8863
- }
8864
-
8865
- var prop,
8866
- index = 0,
8867
- length = props.length;
8868
-
8869
- for ( ; index < length ; index++ ) {
8870
- prop = props[ index ];
8871
- tweeners[ prop ] = tweeners[ prop ] || [];
8872
- tweeners[ prop ].unshift( callback );
8873
- }
8874
- },
8875
-
8876
- prefilter: function( callback, prepend ) {
8877
- if ( prepend ) {
8878
- animationPrefilters.unshift( callback );
8879
- } else {
8880
- animationPrefilters.push( callback );
8881
- }
8882
- }
8883
- });
8884
-
8885
- function defaultPrefilter( elem, props, opts ) {
8886
- /*jshint validthis:true */
8887
- var prop, index, length,
8888
- value, dataShow, toggle,
8889
- tween, hooks, oldfire,
8890
- anim = this,
8891
- style = elem.style,
8892
- orig = {},
8893
- handled = [],
8894
- hidden = elem.nodeType && isHidden( elem );
8895
-
8896
- // handle queue: false promises
8897
- if ( !opts.queue ) {
8898
- hooks = jQuery._queueHooks( elem, "fx" );
8899
- if ( hooks.unqueued == null ) {
8900
- hooks.unqueued = 0;
8901
- oldfire = hooks.empty.fire;
8902
- hooks.empty.fire = function() {
8903
- if ( !hooks.unqueued ) {
8904
- oldfire();
8905
- }
8906
- };
8907
- }
8908
- hooks.unqueued++;
8909
-
8910
- anim.always(function() {
8911
- // doing this makes sure that the complete handler will be called
8912
- // before this completes
8913
- anim.always(function() {
8914
- hooks.unqueued--;
8915
- if ( !jQuery.queue( elem, "fx" ).length ) {
8916
- hooks.empty.fire();
8917
- }
8918
- });
8919
- });
8920
- }
8921
-
8922
- // height/width overflow pass
8923
- if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
8924
- // Make sure that nothing sneaks out
8925
- // Record all 3 overflow attributes because IE does not
8926
- // change the overflow attribute when overflowX and
8927
- // overflowY are set to the same value
8928
- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
8929
-
8930
- // Set display property to inline-block for height/width
8931
- // animations on inline elements that are having width/height animated
8932
- if ( jQuery.css( elem, "display" ) === "inline" &&
8933
- jQuery.css( elem, "float" ) === "none" ) {
8934
-
8935
- // inline-level elements accept inline-block;
8936
- // block-level elements need to be inline with layout
8937
- if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
8938
- style.display = "inline-block";
8939
-
8940
- } else {
8941
- style.zoom = 1;
8942
- }
8943
- }
8944
- }
8945
-
8946
- if ( opts.overflow ) {
8947
- style.overflow = "hidden";
8948
- if ( !jQuery.support.shrinkWrapBlocks ) {
8949
- anim.always(function() {
8950
- style.overflow = opts.overflow[ 0 ];
8951
- style.overflowX = opts.overflow[ 1 ];
8952
- style.overflowY = opts.overflow[ 2 ];
8953
- });
8954
- }
8955
- }
8956
-
8957
-
8958
- // show/hide pass
8959
- for ( index in props ) {
8960
- value = props[ index ];
8961
- if ( rfxtypes.exec( value ) ) {
8962
- delete props[ index ];
8963
- toggle = toggle || value === "toggle";
8964
- if ( value === ( hidden ? "hide" : "show" ) ) {
8965
- continue;
8966
- }
8967
- handled.push( index );
8968
- }
8969
- }
8970
-
8971
- length = handled.length;
8972
- if ( length ) {
8973
- dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
8974
- if ( "hidden" in dataShow ) {
8975
- hidden = dataShow.hidden;
8976
- }
8977
-
8978
- // store state if its toggle - enables .stop().toggle() to "reverse"
8979
- if ( toggle ) {
8980
- dataShow.hidden = !hidden;
8981
- }
8982
- if ( hidden ) {
8983
- jQuery( elem ).show();
8984
- } else {
8985
- anim.done(function() {
8986
- jQuery( elem ).hide();
8987
- });
8988
- }
8989
- anim.done(function() {
8990
- var prop;
8991
- jQuery._removeData( elem, "fxshow" );
8992
- for ( prop in orig ) {
8993
- jQuery.style( elem, prop, orig[ prop ] );
8994
- }
8995
- });
8996
- for ( index = 0 ; index < length ; index++ ) {
8997
- prop = handled[ index ];
8998
- tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
8999
- orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
9000
-
9001
- if ( !( prop in dataShow ) ) {
9002
- dataShow[ prop ] = tween.start;
9003
- if ( hidden ) {
9004
- tween.end = tween.start;
9005
- tween.start = prop === "width" || prop === "height" ? 1 : 0;
9006
- }
9007
- }
9008
- }
9009
- }
9010
- }
9011
-
9012
- function Tween( elem, options, prop, end, easing ) {
9013
- return new Tween.prototype.init( elem, options, prop, end, easing );
9014
- }
9015
- jQuery.Tween = Tween;
9016
-
9017
- Tween.prototype = {
9018
- constructor: Tween,
9019
- init: function( elem, options, prop, end, easing, unit ) {
9020
- this.elem = elem;
9021
- this.prop = prop;
9022
- this.easing = easing || "swing";
9023
- this.options = options;
9024
- this.start = this.now = this.cur();
9025
- this.end = end;
9026
- this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
9027
- },
9028
- cur: function() {
9029
- var hooks = Tween.propHooks[ this.prop ];
9030
-
9031
- return hooks && hooks.get ?
9032
- hooks.get( this ) :
9033
- Tween.propHooks._default.get( this );
9034
- },
9035
- run: function( percent ) {
9036
- var eased,
9037
- hooks = Tween.propHooks[ this.prop ];
9038
-
9039
- if ( this.options.duration ) {
9040
- this.pos = eased = jQuery.easing[ this.easing ](
9041
- percent, this.options.duration * percent, 0, 1, this.options.duration
9042
- );
9043
- } else {
9044
- this.pos = eased = percent;
9045
- }
9046
- this.now = ( this.end - this.start ) * eased + this.start;
9047
-
9048
- if ( this.options.step ) {
9049
- this.options.step.call( this.elem, this.now, this );
9050
- }
9051
-
9052
- if ( hooks && hooks.set ) {
9053
- hooks.set( this );
9054
- } else {
9055
- Tween.propHooks._default.set( this );
9056
- }
9057
- return this;
9058
- }
9059
- };
9060
-
9061
- Tween.prototype.init.prototype = Tween.prototype;
9062
-
9063
- Tween.propHooks = {
9064
- _default: {
9065
- get: function( tween ) {
9066
- var result;
9067
-
9068
- if ( tween.elem[ tween.prop ] != null &&
9069
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
9070
- return tween.elem[ tween.prop ];
9071
- }
9072
-
9073
- // passing an empty string as a 3rd parameter to .css will automatically
9074
- // attempt a parseFloat and fallback to a string if the parse fails
9075
- // so, simple values such as "10px" are parsed to Float.
9076
- // complex values such as "rotate(1rad)" are returned as is.
9077
- result = jQuery.css( tween.elem, tween.prop, "" );
9078
- // Empty strings, null, undefined and "auto" are converted to 0.
9079
- return !result || result === "auto" ? 0 : result;
9080
- },
9081
- set: function( tween ) {
9082
- // use step hook for back compat - use cssHook if its there - use .style if its
9083
- // available and use plain properties where available
9084
- if ( jQuery.fx.step[ tween.prop ] ) {
9085
- jQuery.fx.step[ tween.prop ]( tween );
9086
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
9087
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
9088
- } else {
9089
- tween.elem[ tween.prop ] = tween.now;
9090
- }
9091
- }
9092
- }
9093
- };
9094
-
9095
- // Remove in 2.0 - this supports IE8's panic based approach
9096
- // to setting things on disconnected nodes
9097
-
9098
- Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
9099
- set: function( tween ) {
9100
- if ( tween.elem.nodeType && tween.elem.parentNode ) {
9101
- tween.elem[ tween.prop ] = tween.now;
9102
- }
9103
- }
9104
- };
9105
-
9106
- jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
9107
- var cssFn = jQuery.fn[ name ];
9108
- jQuery.fn[ name ] = function( speed, easing, callback ) {
9109
- return speed == null || typeof speed === "boolean" ?
9110
- cssFn.apply( this, arguments ) :
9111
- this.animate( genFx( name, true ), speed, easing, callback );
9112
- };
9113
- });
9114
-
9115
- jQuery.fn.extend({
9116
- fadeTo: function( speed, to, easing, callback ) {
9117
-
9118
- // show any hidden elements after setting opacity to 0
9119
- return this.filter( isHidden ).css( "opacity", 0 ).show()
9120
-
9121
- // animate to the value specified
9122
- .end().animate({ opacity: to }, speed, easing, callback );
9123
- },
9124
- animate: function( prop, speed, easing, callback ) {
9125
- var empty = jQuery.isEmptyObject( prop ),
9126
- optall = jQuery.speed( speed, easing, callback ),
9127
- doAnimation = function() {
9128
- // Operate on a copy of prop so per-property easing won't be lost
9129
- var anim = Animation( this, jQuery.extend( {}, prop ), optall );
9130
- doAnimation.finish = function() {
9131
- anim.stop( true );
9132
- };
9133
- // Empty animations, or finishing resolves immediately
9134
- if ( empty || jQuery._data( this, "finish" ) ) {
9135
- anim.stop( true );
9136
- }
9137
- };
9138
- doAnimation.finish = doAnimation;
9139
-
9140
- return empty || optall.queue === false ?
9141
- this.each( doAnimation ) :
9142
- this.queue( optall.queue, doAnimation );
9143
- },
9144
- stop: function( type, clearQueue, gotoEnd ) {
9145
- var stopQueue = function( hooks ) {
9146
- var stop = hooks.stop;
9147
- delete hooks.stop;
9148
- stop( gotoEnd );
9149
- };
9150
-
9151
- if ( typeof type !== "string" ) {
9152
- gotoEnd = clearQueue;
9153
- clearQueue = type;
9154
- type = undefined;
9155
- }
9156
- if ( clearQueue && type !== false ) {
9157
- this.queue( type || "fx", [] );
9158
- }
9159
-
9160
- return this.each(function() {
9161
- var dequeue = true,
9162
- index = type != null && type + "queueHooks",
9163
- timers = jQuery.timers,
9164
- data = jQuery._data( this );
9165
-
9166
- if ( index ) {
9167
- if ( data[ index ] && data[ index ].stop ) {
9168
- stopQueue( data[ index ] );
9169
- }
9170
- } else {
9171
- for ( index in data ) {
9172
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
9173
- stopQueue( data[ index ] );
9174
- }
9175
- }
9176
- }
9177
-
9178
- for ( index = timers.length; index--; ) {
9179
- if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
9180
- timers[ index ].anim.stop( gotoEnd );
9181
- dequeue = false;
9182
- timers.splice( index, 1 );
9183
- }
9184
- }
9185
-
9186
- // start the next in the queue if the last step wasn't forced
9187
- // timers currently will call their complete callbacks, which will dequeue
9188
- // but only if they were gotoEnd
9189
- if ( dequeue || !gotoEnd ) {
9190
- jQuery.dequeue( this, type );
9191
- }
9192
- });
9193
- },
9194
- finish: function( type ) {
9195
- if ( type !== false ) {
9196
- type = type || "fx";
9197
- }
9198
- return this.each(function() {
9199
- var index,
9200
- data = jQuery._data( this ),
9201
- queue = data[ type + "queue" ],
9202
- hooks = data[ type + "queueHooks" ],
9203
- timers = jQuery.timers,
9204
- length = queue ? queue.length : 0;
9205
-
9206
- // enable finishing flag on private data
9207
- data.finish = true;
9208
-
9209
- // empty the queue first
9210
- jQuery.queue( this, type, [] );
9211
-
9212
- if ( hooks && hooks.cur && hooks.cur.finish ) {
9213
- hooks.cur.finish.call( this );
9214
- }
9215
-
9216
- // look for any active animations, and finish them
9217
- for ( index = timers.length; index--; ) {
9218
- if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
9219
- timers[ index ].anim.stop( true );
9220
- timers.splice( index, 1 );
9221
- }
9222
- }
9223
-
9224
- // look for any animations in the old queue and finish them
9225
- for ( index = 0; index < length; index++ ) {
9226
- if ( queue[ index ] && queue[ index ].finish ) {
9227
- queue[ index ].finish.call( this );
9228
- }
9229
- }
9230
-
9231
- // turn off finishing flag
9232
- delete data.finish;
9233
- });
9234
- }
9235
- });
9236
-
9237
- // Generate parameters to create a standard animation
9238
- function genFx( type, includeWidth ) {
9239
- var which,
9240
- attrs = { height: type },
9241
- i = 0;
9242
-
9243
- // if we include width, step value is 1 to do all cssExpand values,
9244
- // if we don't include width, step value is 2 to skip over Left and Right
9245
- includeWidth = includeWidth? 1 : 0;
9246
- for( ; i < 4 ; i += 2 - includeWidth ) {
9247
- which = cssExpand[ i ];
9248
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
9249
- }
9250
-
9251
- if ( includeWidth ) {
9252
- attrs.opacity = attrs.width = type;
9253
- }
9254
-
9255
- return attrs;
9256
- }
9257
-
9258
- // Generate shortcuts for custom animations
9259
- jQuery.each({
9260
- slideDown: genFx("show"),
9261
- slideUp: genFx("hide"),
9262
- slideToggle: genFx("toggle"),
9263
- fadeIn: { opacity: "show" },
9264
- fadeOut: { opacity: "hide" },
9265
- fadeToggle: { opacity: "toggle" }
9266
- }, function( name, props ) {
9267
- jQuery.fn[ name ] = function( speed, easing, callback ) {
9268
- return this.animate( props, speed, easing, callback );
9269
- };
9270
- });
9271
-
9272
- jQuery.speed = function( speed, easing, fn ) {
9273
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
9274
- complete: fn || !fn && easing ||
9275
- jQuery.isFunction( speed ) && speed,
9276
- duration: speed,
9277
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
9278
- };
9279
-
9280
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
9281
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
9282
-
9283
- // normalize opt.queue - true/undefined/null -> "fx"
9284
- if ( opt.queue == null || opt.queue === true ) {
9285
- opt.queue = "fx";
9286
- }
9287
-
9288
- // Queueing
9289
- opt.old = opt.complete;
9290
-
9291
- opt.complete = function() {
9292
- if ( jQuery.isFunction( opt.old ) ) {
9293
- opt.old.call( this );
9294
- }
9295
-
9296
- if ( opt.queue ) {
9297
- jQuery.dequeue( this, opt.queue );
9298
- }
9299
- };
9300
-
9301
- return opt;
9302
- };
9303
-
9304
- jQuery.easing = {
9305
- linear: function( p ) {
9306
- return p;
9307
- },
9308
- swing: function( p ) {
9309
- return 0.5 - Math.cos( p*Math.PI ) / 2;
9310
- }
9311
- };
9312
-
9313
- jQuery.timers = [];
9314
- jQuery.fx = Tween.prototype.init;
9315
- jQuery.fx.tick = function() {
9316
- var timer,
9317
- timers = jQuery.timers,
9318
- i = 0;
9319
-
9320
- fxNow = jQuery.now();
9321
-
9322
- for ( ; i < timers.length; i++ ) {
9323
- timer = timers[ i ];
9324
- // Checks the timer has not already been removed
9325
- if ( !timer() && timers[ i ] === timer ) {
9326
- timers.splice( i--, 1 );
9327
- }
9328
- }
9329
-
9330
- if ( !timers.length ) {
9331
- jQuery.fx.stop();
9332
- }
9333
- fxNow = undefined;
9334
- };
9335
-
9336
- jQuery.fx.timer = function( timer ) {
9337
- if ( timer() && jQuery.timers.push( timer ) ) {
9338
- jQuery.fx.start();
9339
- }
9340
- };
9341
-
9342
- jQuery.fx.interval = 13;
9343
-
9344
- jQuery.fx.start = function() {
9345
- if ( !timerId ) {
9346
- timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
9347
- }
9348
- };
9349
-
9350
- jQuery.fx.stop = function() {
9351
- clearInterval( timerId );
9352
- timerId = null;
9353
- };
9354
-
9355
- jQuery.fx.speeds = {
9356
- slow: 600,
9357
- fast: 200,
9358
- // Default speed
9359
- _default: 400
9360
- };
9361
-
9362
- // Back Compat <1.8 extension point
9363
- jQuery.fx.step = {};
9364
-
9365
- if ( jQuery.expr && jQuery.expr.filters ) {
9366
- jQuery.expr.filters.animated = function( elem ) {
9367
- return jQuery.grep(jQuery.timers, function( fn ) {
9368
- return elem === fn.elem;
9369
- }).length;
9370
- };
9371
- }
9372
- jQuery.fn.offset = function( options ) {
9373
- if ( arguments.length ) {
9374
- return options === undefined ?
9375
- this :
9376
- this.each(function( i ) {
9377
- jQuery.offset.setOffset( this, options, i );
9378
- });
9379
- }
9380
-
9381
- var docElem, win,
9382
- box = { top: 0, left: 0 },
9383
- elem = this[ 0 ],
9384
- doc = elem && elem.ownerDocument;
9385
-
9386
- if ( !doc ) {
9387
- return;
9388
- }
9389
-
9390
- docElem = doc.documentElement;
9391
-
9392
- // Make sure it's not a disconnected DOM node
9393
- if ( !jQuery.contains( docElem, elem ) ) {
9394
- return box;
9395
- }
9396
-
9397
- // If we don't have gBCR, just use 0,0 rather than error
9398
- // BlackBerry 5, iOS 3 (original iPhone)
9399
- if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
9400
- box = elem.getBoundingClientRect();
9401
- }
9402
- win = getWindow( doc );
9403
- return {
9404
- top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
9405
- left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
9406
- };
9407
- };
9408
-
9409
- jQuery.offset = {
9410
-
9411
- setOffset: function( elem, options, i ) {
9412
- var position = jQuery.css( elem, "position" );
9413
-
9414
- // set position first, in-case top/left are set even on static elem
9415
- if ( position === "static" ) {
9416
- elem.style.position = "relative";
9417
- }
9418
-
9419
- var curElem = jQuery( elem ),
9420
- curOffset = curElem.offset(),
9421
- curCSSTop = jQuery.css( elem, "top" ),
9422
- curCSSLeft = jQuery.css( elem, "left" ),
9423
- calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
9424
- props = {}, curPosition = {}, curTop, curLeft;
9425
-
9426
- // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
9427
- if ( calculatePosition ) {
9428
- curPosition = curElem.position();
9429
- curTop = curPosition.top;
9430
- curLeft = curPosition.left;
9431
- } else {
9432
- curTop = parseFloat( curCSSTop ) || 0;
9433
- curLeft = parseFloat( curCSSLeft ) || 0;
9434
- }
9435
-
9436
- if ( jQuery.isFunction( options ) ) {
9437
- options = options.call( elem, i, curOffset );
9438
- }
9439
-
9440
- if ( options.top != null ) {
9441
- props.top = ( options.top - curOffset.top ) + curTop;
9442
- }
9443
- if ( options.left != null ) {
9444
- props.left = ( options.left - curOffset.left ) + curLeft;
9445
- }
9446
-
9447
- if ( "using" in options ) {
9448
- options.using.call( elem, props );
9449
- } else {
9450
- curElem.css( props );
9451
- }
9452
- }
9453
- };
9454
-
9455
-
9456
- jQuery.fn.extend({
9457
-
9458
- position: function() {
9459
- if ( !this[ 0 ] ) {
9460
- return;
9461
- }
9462
-
9463
- var offsetParent, offset,
9464
- parentOffset = { top: 0, left: 0 },
9465
- elem = this[ 0 ];
9466
-
9467
- // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
9468
- if ( jQuery.css( elem, "position" ) === "fixed" ) {
9469
- // we assume that getBoundingClientRect is available when computed position is fixed
9470
- offset = elem.getBoundingClientRect();
9471
- } else {
9472
- // Get *real* offsetParent
9473
- offsetParent = this.offsetParent();
9474
-
9475
- // Get correct offsets
9476
- offset = this.offset();
9477
- if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
9478
- parentOffset = offsetParent.offset();
9479
- }
9480
-
9481
- // Add offsetParent borders
9482
- parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
9483
- parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
9484
- }
9485
-
9486
- // Subtract parent offsets and element margins
9487
- // note: when an element has margin: auto the offsetLeft and marginLeft
9488
- // are the same in Safari causing offset.left to incorrectly be 0
9489
- return {
9490
- top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
9491
- left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
9492
- };
9493
- },
9494
-
9495
- offsetParent: function() {
9496
- return this.map(function() {
9497
- var offsetParent = this.offsetParent || document.documentElement;
9498
- while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
9499
- offsetParent = offsetParent.offsetParent;
9500
- }
9501
- return offsetParent || document.documentElement;
9502
- });
9503
- }
9504
- });
9505
-
9506
-
9507
- // Create scrollLeft and scrollTop methods
9508
- jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
9509
- var top = /Y/.test( prop );
9510
-
9511
- jQuery.fn[ method ] = function( val ) {
9512
- return jQuery.access( this, function( elem, method, val ) {
9513
- var win = getWindow( elem );
9514
-
9515
- if ( val === undefined ) {
9516
- return win ? (prop in win) ? win[ prop ] :
9517
- win.document.documentElement[ method ] :
9518
- elem[ method ];
9519
- }
9520
-
9521
- if ( win ) {
9522
- win.scrollTo(
9523
- !top ? val : jQuery( win ).scrollLeft(),
9524
- top ? val : jQuery( win ).scrollTop()
9525
- );
9526
-
9527
- } else {
9528
- elem[ method ] = val;
9529
- }
9530
- }, method, val, arguments.length, null );
9531
- };
9532
- });
9533
-
9534
- function getWindow( elem ) {
9535
- return jQuery.isWindow( elem ) ?
9536
- elem :
9537
- elem.nodeType === 9 ?
9538
- elem.defaultView || elem.parentWindow :
9539
- false;
9540
- }
9541
- // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
9542
- jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
9543
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
9544
- // margin is only for outerHeight, outerWidth
9545
- jQuery.fn[ funcName ] = function( margin, value ) {
9546
- var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
9547
- extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
9548
-
9549
- return jQuery.access( this, function( elem, type, value ) {
9550
- var doc;
9551
-
9552
- if ( jQuery.isWindow( elem ) ) {
9553
- // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
9554
- // isn't a whole lot we can do. See pull request at this URL for discussion:
9555
- // https://github.com/jquery/jquery/pull/764
9556
- return elem.document.documentElement[ "client" + name ];
9557
- }
9558
-
9559
- // Get document width or height
9560
- if ( elem.nodeType === 9 ) {
9561
- doc = elem.documentElement;
9562
-
9563
- // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
9564
- // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
9565
- return Math.max(
9566
- elem.body[ "scroll" + name ], doc[ "scroll" + name ],
9567
- elem.body[ "offset" + name ], doc[ "offset" + name ],
9568
- doc[ "client" + name ]
9569
- );
9570
- }
9571
-
9572
- return value === undefined ?
9573
- // Get width or height on the element, requesting but not forcing parseFloat
9574
- jQuery.css( elem, type, extra ) :
9575
-
9576
- // Set width or height on the element
9577
- jQuery.style( elem, type, value, extra );
9578
- }, type, chainable ? margin : undefined, chainable, null );
9579
- };
9580
- });
9581
- });
9582
- // Limit scope pollution from any deprecated API
9583
- // (function() {
9584
-
9585
- // })();
9586
- // Expose jQuery to the global object
9587
- window.jQuery = window.$ = jQuery;
9588
-
9589
- // Expose jQuery as an AMD module, but only for AMD loaders that
9590
- // understand the issues with loading multiple versions of jQuery
9591
- // in a page that all might call define(). The loader will indicate
9592
- // they have special allowances for multiple jQuery versions by
9593
- // specifying define.amd.jQuery = true. Register as a named module,
9594
- // since jQuery can be concatenated with other files that may use define,
9595
- // but not use a proper concatenation script that understands anonymous
9596
- // AMD modules. A named AMD is safest and most robust way to register.
9597
- // Lowercase jquery is used because AMD module names are derived from
9598
- // file names, and jQuery is normally delivered in a lowercase file name.
9599
- // Do this after creating the global so that if an AMD module wants to call
9600
- // noConflict to hide this version of jQuery, it will work.
9601
- if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
9602
- define( "jquery", [], function () { return jQuery; } );
9603
- }
9604
-
9605
  })( window );
1
+ /*!
2
+ * jQuery JavaScript Library v1.9.1
3
+ * http://jquery.com/
4
+ *
5
+ * Includes Sizzle.js
6
+ * http://sizzlejs.com/
7
+ *
8
+ * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
9
+ * Released under the MIT license
10
+ * http://jquery.org/license
11
+ *
12
+ * Date: 2013-2-4
13
+ */
14
+ (function( window, undefined ) {
15
+ // Can't do this because several apps including ASP.NET trace
16
+ // the stack via arguments.caller.callee and Firefox dies if
17
+ // you try to trace through "use strict" call chains. (#13335)
18
+ // Support: Firefox 18+
19
+ //"use strict";
20
+ var
21
+ // The deferred used on DOM ready
22
+ readyList,
23
+ // A central reference to the root jQuery(document)
24
+ rootjQuery,
25
+ // Support: IE<9
26
+ // For `typeof node.method` instead of `node.method !== undefined`
27
+ core_strundefined = typeof undefined,
28
+ // Use the correct document accordingly with window argument (sandbox)
29
+ document = window.document,
30
+ location = window.location,
31
+ // Map over jQuery in case of overwrite
32
+ _jQuery = window.jQuery,
33
+ // Map over the $ in case of overwrite
34
+ _$ = window.$,
35
+ // [[Class]] -> type pairs
36
+ class2type = {},
37
+ // List of deleted data cache ids, so we can reuse them
38
+ core_deletedIds = [],
39
+ core_version = "1.9.1",
40
+ // Save a reference to some core methods
41
+ core_concat = core_deletedIds.concat,
42
+ core_push = core_deletedIds.push,
43
+ core_slice = core_deletedIds.slice,
44
+ core_indexOf = core_deletedIds.indexOf,
45
+ core_toString = class2type.toString,
46
+ core_hasOwn = class2type.hasOwnProperty,
47
+ core_trim = core_version.trim,
48
+ // Define a local copy of jQuery
49
+ jQuery = function( selector, context ) {
50
+ // The jQuery object is actually just the init constructor 'enhanced'
51
+ return new jQuery.fn.init( selector, context, rootjQuery );
52
+ },
53
+ // Used for matching numbers
54
+ core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
55
+ // Used for splitting on whitespace
56
+ core_rnotwhite = /\S+/g,
57
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
58
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
59
+ // A simple way to check for HTML strings
60
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
61
+ // Strict HTML recognition (#11290: must start with <)
62
+ rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
63
+ // Match a standalone tag
64
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
65
+ // JSON RegExp
66
+ rvalidchars = /^[\],:{}\s]*$/,
67
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
68
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
69
+ rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
70
+ // Matches dashed string for camelizing
71
+ rmsPrefix = /^-ms-/,
72
+ rdashAlpha = /-([\da-z])/gi,
73
+ // Used by jQuery.camelCase as callback to replace()
74
+ fcamelCase = function( all, letter ) {
75
+ return letter.toUpperCase();
76
+ },
77
+ // The ready event handler
78
+ completed = function( event ) {
79
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
80
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
81
+ detach();
82
+ jQuery.ready();
83
+ }
84
+ },
85
+ // Clean-up method for dom ready events
86
+ detach = function() {
87
+ if ( document.addEventListener ) {
88
+ document.removeEventListener( "DOMContentLoaded", completed, false );
89
+ window.removeEventListener( "load", completed, false );
90
+ } else {
91
+ document.detachEvent( "onreadystatechange", completed );
92
+ window.detachEvent( "onload", completed );
93
+ }
94
+ };
95
+ jQuery.fn = jQuery.prototype = {
96
+ // The current version of jQuery being used
97
+ jquery: core_version,
98
+ constructor: jQuery,
99
+ init: function( selector, context, rootjQuery ) {
100
+ var match, elem;
101
+ // HANDLE: $(""), $(null), $(undefined), $(false)
102
+ if ( !selector ) {
103
+ return this;
104
+ }
105
+ // Handle HTML strings
106
+ if ( typeof selector === "string" ) {
107
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
108
+ // Assume that strings that start and end with <> are HTML and skip the regex check
109
+ match = [ null, selector, null ];
110
+ } else {
111
+ match = rquickExpr.exec( selector );
112
+ }
113
+ // Match html or make sure no context is specified for #id
114
+ if ( match && (match[1] || !context) ) {
115
+ // HANDLE: $(html) -> $(array)
116
+ if ( match[1] ) {
117
+ context = context instanceof jQuery ? context[0] : context;
118
+ // scripts is true for back-compat
119
+ jQuery.merge( this, jQuery.parseHTML(
120
+ match[1],
121
+ context && context.nodeType ? context.ownerDocument || context : document,
122
+ true
123
+ ) );
124
+ // HANDLE: $(html, props)
125
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
126
+ for ( match in context ) {
127
+ // Properties of context are called as methods if possible
128
+ if ( jQuery.isFunction( this[ match ] ) ) {
129
+ this[ match ]( context[ match ] );
130
+ // ...and otherwise set as attributes
131
+ } else {
132
+ this.attr( match, context[ match ] );
133
+ }
134
+ }
135
+ }
136
+ return this;
137
+ // HANDLE: $(#id)
138
+ } else {
139
+ elem = document.getElementById( match[2] );
140
+ // Check parentNode to catch when Blackberry 4.6 returns
141
+ // nodes that are no longer in the document #6963
142
+ if ( elem && elem.parentNode ) {
143
+ // Handle the case where IE and Opera return items
144
+ // by name instead of ID
145
+ if ( elem.id !== match[2] ) {
146
+ return rootjQuery.find( selector );
147
+ }
148
+ // Otherwise, we inject the element directly into the jQuery object
149
+ this.length = 1;
150
+ this[0] = elem;
151
+ }
152
+ this.context = document;
153
+ this.selector = selector;
154
+ return this;
155
+ }
156
+ // HANDLE: $(expr, $(...))
157
+ } else if ( !context || context.jquery ) {
158
+ return ( context || rootjQuery ).find( selector );
159
+ // HANDLE: $(expr, context)
160
+ // (which is just equivalent to: $(context).find(expr)
161
+ } else {
162
+ return this.constructor( context ).find( selector );
163
+ }
164
+ // HANDLE: $(DOMElement)
165
+ } else if ( selector.nodeType ) {
166
+ this.context = this[0] = selector;
167
+ this.length = 1;
168
+ return this;
169
+ // HANDLE: $(function)
170
+ // Shortcut for document ready
171
+ } else if ( jQuery.isFunction( selector ) ) {
172
+ return rootjQuery.ready( selector );
173
+ }
174
+ if ( selector.selector !== undefined ) {
175
+ this.selector = selector.selector;
176
+ this.context = selector.context;
177
+ }
178
+ return jQuery.makeArray( selector, this );
179
+ },
180
+ // Start with an empty selector
181
+ selector: "",
182
+ // The default length of a jQuery object is 0
183
+ length: 0,
184
+ // The number of elements contained in the matched element set
185
+ size: function() {
186
+ return this.length;
187
+ },
188
+ toArray: function() {
189
+ return core_slice.call( this );
190
+ },
191
+ // Get the Nth element in the matched element set OR
192
+ // Get the whole matched element set as a clean array
193
+ get: function( num ) {
194
+ return num == null ?
195
+ // Return a 'clean' array
196
+ this.toArray() :
197
+ // Return just the object
198
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
199
+ },
200
+ // Take an array of elements and push it onto the stack
201
+ // (returning the new matched element set)
202
+ pushStack: function( elems ) {
203
+ // Build a new jQuery matched element set
204
+ var ret = jQuery.merge( this.constructor(), elems );
205
+ // Add the old object onto the stack (as a reference)
206
+ ret.prevObject = this;
207
+ ret.context = this.context;
208
+ // Return the newly-formed element set
209
+ return ret;
210
+ },
211
+ // Execute a callback for every element in the matched set.
212
+ // (You can seed the arguments with an array of args, but this is
213
+ // only used internally.)
214
+ each: function( callback, args ) {
215
+ return jQuery.each( this, callback, args );
216
+ },
217
+ ready: function( fn ) {
218
+ // Add the callback
219
+ jQuery.ready.promise().done( fn );
220
+ return this;
221
+ },
222
+ slice: function() {
223
+ return this.pushStack( core_slice.apply( this, arguments ) );
224
+ },
225
+ first: function() {
226
+ return this.eq( 0 );
227
+ },
228
+ last: function() {
229
+ return this.eq( -1 );
230
+ },
231
+ eq: function( i ) {
232
+ var len = this.length,
233
+ j = +i + ( i < 0 ? len : 0 );
234
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
235
+ },
236
+ map: function( callback ) {
237
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
238
+ return callback.call( elem, i, elem );
239
+ }));
240
+ },
241
+ end: function() {
242
+ return this.prevObject || this.constructor(null);
243
+ },
244
+ // For internal use only.
245
+ // Behaves like an Array's method, not like a jQuery method.
246
+ push: core_push,
247
+ sort: [].sort,
248
+ splice: [].splice
249
+ };
250
+ // Give the init function the jQuery prototype for later instantiation
251
+ jQuery.fn.init.prototype = jQuery.fn;
252
+ jQuery.extend = jQuery.fn.extend = function() {
253
+ var src, copyIsArray, copy, name, options, clone,
254
+ target = arguments[0] || {},
255
+ i = 1,
256
+ length = arguments.length,
257
+ deep = false;
258
+ // Handle a deep copy situation
259
+ if ( typeof target === "boolean" ) {
260
+ deep = target;
261
+ target = arguments[1] || {};
262
+ // skip the boolean and the target
263
+ i = 2;
264
+ }
265
+ // Handle case when target is a string or something (possible in deep copy)
266
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
267
+ target = {};
268
+ }
269
+ // extend jQuery itself if only one argument is passed
270
+ if ( length === i ) {
271
+ target = this;
272
+ --i;
273
+ }
274
+ for ( ; i < length; i++ ) {
275
+ // Only deal with non-null/undefined values
276
+ if ( (options = arguments[ i ]) != null ) {
277
+ // Extend the base object
278
+ for ( name in options ) {
279
+ src = target[ name ];
280
+ copy = options[ name ];
281
+ // Prevent never-ending loop
282
+ if ( target === copy ) {
283
+ continue;
284
+ }
285
+ // Recurse if we're merging plain objects or arrays
286
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
287
+ if ( copyIsArray ) {
288
+ copyIsArray = false;
289
+ clone = src && jQuery.isArray(src) ? src : [];
290
+ } else {
291
+ clone = src && jQuery.isPlainObject(src) ? src : {};
292
+ }
293
+ // Never move original objects, clone them
294
+ target[ name ] = jQuery.extend( deep, clone, copy );
295
+ // Don't bring in undefined values
296
+ } else if ( copy !== undefined ) {
297
+ target[ name ] = copy;
298
+ }
299
+ }
300
+ }
301
+ }
302
+ // Return the modified object
303
+ return target;
304
+ };
305
+ jQuery.extend({
306
+ noConflict: function( deep ) {
307
+ if ( window.$ === jQuery ) {
308
+ window.$ = _$;
309
+ }
310
+ if ( deep && window.jQuery === jQuery ) {
311
+ window.jQuery = _jQuery;
312
+ }
313
+ return jQuery;
314
+ },
315
+ // Is the DOM ready to be used? Set to true once it occurs.
316
+ isReady: false,
317
+ // A counter to track how many items to wait for before
318
+ // the ready event fires. See #6781
319
+ readyWait: 1,
320
+ // Hold (or release) the ready event
321
+ holdReady: function( hold ) {
322
+ if ( hold ) {
323
+ jQuery.readyWait++;
324
+ } else {
325
+ jQuery.ready( true );
326
+ }
327
+ },
328
+ // Handle when the DOM is ready
329
+ ready: function( wait ) {
330
+ // Abort if there are pending holds or we're already ready
331
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
332
+ return;
333
+ }
334
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
335
+ if ( !document.body ) {
336
+ return setTimeout( jQuery.ready );
337
+ }
338
+ // Remember that the DOM is ready
339
+ jQuery.isReady = true;
340
+ // If a normal DOM Ready event fired, decrement, and wait if need be
341
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
342
+ return;
343
+ }
344
+ // If there are functions bound, to execute
345
+ readyList.resolveWith( document, [ jQuery ] );
346
+ // Trigger any bound ready events
347
+ if ( jQuery.fn.trigger ) {
348
+ jQuery( document ).trigger("ready").off("ready");
349
+ }
350
+ },
351
+ // See test/unit/core.js for details concerning isFunction.
352
+ // Since version 1.3, DOM methods and functions like alert
353
+ // aren't supported. They return false on IE (#2968).
354
+ isFunction: function( obj ) {
355
+ return jQuery.type(obj) === "function";
356
+ },
357
+ isArray: Array.isArray || function( obj ) {
358
+ return jQuery.type(obj) === "array";
359
+ },
360
+ isWindow: function( obj ) {
361
+ return obj != null && obj == obj.window;
362
+ },
363
+ isNumeric: function( obj ) {
364
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
365
+ },
366
+ type: function( obj ) {
367
+ if ( obj == null ) {
368
+ return String( obj );
369
+ }
370
+ return typeof obj === "object" || typeof obj === "function" ?
371
+ class2type[ core_toString.call(obj) ] || "object" :
372
+ typeof obj;
373
+ },
374
+ isPlainObject: function( obj ) {
375
+ // Must be an Object.
376
+ // Because of IE, we also have to check the presence of the constructor property.
377
+ // Make sure that DOM nodes and window objects don't pass through, as well
378
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
379
+ return false;
380
+ }
381
+ try {
382
+ // Not own constructor property must be Object
383
+ if ( obj.constructor &&
384
+ !core_hasOwn.call(obj, "constructor") &&
385
+ !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
386
+ return false;
387
+ }
388
+ } catch ( e ) {
389
+ // IE8,9 Will throw exceptions on certain host objects #9897
390
+ return false;
391
+ }
392
+ // Own properties are enumerated firstly, so to speed up,
393
+ // if last one is own, then all properties are own.
394
+ var key;
395
+ for ( key in obj ) {}
396
+ return key === undefined || core_hasOwn.call( obj, key );
397
+ },
398
+ isEmptyObject: function( obj ) {
399
+ var name;
400
+ for ( name in obj ) {
401
+ return false;
402
+ }
403
+ return true;
404
+ },
405
+ error: function( msg ) {
406
+ throw new Error( msg );
407
+ },
408
+ // data: string of html
409
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
410
+ // keepScripts (optional): If true, will include scripts passed in the html string
411
+ parseHTML: function( data, context, keepScripts ) {
412
+ if ( !data || typeof data !== "string" ) {
413
+ return null;
414
+ }
415
+ if ( typeof context === "boolean" ) {
416
+ keepScripts = context;
417
+ context = false;
418
+ }
419
+ context = context || document;
420
+ var parsed = rsingleTag.exec( data ),
421
+ scripts = !keepScripts && [];
422
+ // Single tag
423
+ if ( parsed ) {
424
+ return [ context.createElement( parsed[1] ) ];
425
+ }
426
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
427
+ if ( scripts ) {
428
+ jQuery( scripts ).remove();
429
+ }
430
+ return jQuery.merge( [], parsed.childNodes );
431
+ },
432
+ parseJSON: function( data ) {
433
+ // Attempt to parse using the native JSON parser first
434
+ if ( window.JSON && window.JSON.parse ) {
435
+ return window.JSON.parse( data );
436
+ }
437
+ if ( data === null ) {
438
+ return data;
439
+ }
440
+ if ( typeof data === "string" ) {
441
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
442
+ data = jQuery.trim( data );
443
+ if ( data ) {
444
+ // Make sure the incoming data is actual JSON
445
+ // Logic borrowed from http://json.org/json2.js
446
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
447
+ .replace( rvalidtokens, "]" )
448
+ .replace( rvalidbraces, "")) ) {
449
+ return ( new Function( "return " + data ) )();
450
+ }
451
+ }
452
+ }
453
+ jQuery.error( "Invalid JSON: " + data );
454
+ },
455
+ // Cross-browser xml parsing
456
+ parseXML: function( data ) {
457
+ var xml, tmp;
458
+ if ( !data || typeof data !== "string" ) {
459
+ return null;
460
+ }
461
+ try {
462
+ if ( window.DOMParser ) { // Standard
463
+ tmp = new DOMParser();
464
+ xml = tmp.parseFromString( data , "text/xml" );
465
+ } else { // IE
466
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
467
+ xml.async = "false";
468
+ xml.loadXML( data );
469
+ }
470
+ } catch( e ) {
471
+ xml = undefined;
472
+ }
473
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
474
+ jQuery.error( "Invalid XML: " + data );
475
+ }
476
+ return xml;
477
+ },
478
+ noop: function() {},
479
+ // Evaluates a script in a global context
480
+ // Workarounds based on findings by Jim Driscoll
481
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
482
+ globalEval: function( data ) {
483
+ if ( data && jQuery.trim( data ) ) {
484
+ // We use execScript on Internet Explorer
485
+ // We use an anonymous function so that context is window
486
+ // rather than jQuery in Firefox
487
+ ( window.execScript || function( data ) {
488
+ window[ "eval" ].call( window, data );
489
+ } )( data );
490
+ }
491
+ },
492
+ // Convert dashed to camelCase; used by the css and data modules
493
+ // Microsoft forgot to hump their vendor prefix (#9572)
494
+ camelCase: function( string ) {
495
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
496
+ },
497
+ nodeName: function( elem, name ) {
498
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
499
+ },
500
+ // args is for internal usage only
501
+ each: function( obj, callback, args ) {
502
+ var value,
503
+ i = 0,
504
+ length = obj.length,
505
+ isArray = isArraylike( obj );
506
+ if ( args ) {
507
+ if ( isArray ) {
508
+ for ( ; i < length; i++ ) {
509
+ value = callback.apply( obj[ i ], args );
510
+ if ( value === false ) {
511
+ break;
512
+ }
513
+ }
514
+ } else {
515
+ for ( i in obj ) {
516
+ value = callback.apply( obj[ i ], args );
517
+ if ( value === false ) {
518
+ break;
519
+ }
520
+ }
521
+ }
522
+ // A special, fast, case for the most common use of each
523
+ } else {
524
+ if ( isArray ) {
525
+ for ( ; i < length; i++ ) {
526
+ value = callback.call( obj[ i ], i, obj[ i ] );
527
+ if ( value === false ) {
528
+ break;
529
+ }
530
+ }
531
+ } else {
532
+ for ( i in obj ) {
533
+ value = callback.call( obj[ i ], i, obj[ i ] );
534
+ if ( value === false ) {
535
+ break;
536
+ }
537
+ }
538
+ }
539
+ }
540
+ return obj;
541
+ },
542
+ // Use native String.trim function wherever possible
543
+ trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
544
+ function( text ) {
545
+ return text == null ?
546
+ "" :
547
+ core_trim.call( text );
548
+ } :
549
+ // Otherwise use our own trimming functionality
550
+ function( text ) {
551
+ return text == null ?
552
+ "" :
553
+ ( text + "" ).replace( rtrim, "" );
554
+ },
555
+ // results is for internal usage only
556
+ makeArray: function( arr, results ) {
557
+ var ret = results || [];
558
+ if ( arr != null ) {
559
+ if ( isArraylike( Object(arr) ) ) {
560
+ jQuery.merge( ret,
561
+ typeof arr === "string" ?
562
+ [ arr ] : arr
563
+ );
564
+ } else {
565
+ core_push.call( ret, arr );
566
+ }
567
+ }
568
+ return ret;
569
+ },
570
+ inArray: function( elem, arr, i ) {
571
+ var len;
572
+ if ( arr ) {
573
+ if ( core_indexOf ) {
574
+ return core_indexOf.call( arr, elem, i );
575
+ }
576
+ len = arr.length;
577
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
578
+ for ( ; i < len; i++ ) {
579
+ // Skip accessing in sparse arrays
580
+ if ( i in arr && arr[ i ] === elem ) {
581
+ return i;
582
+ }
583
+ }
584
+ }
585
+ return -1;
586
+ },
587
+ merge: function( first, second ) {
588
+ var l = second.length,
589
+ i = first.length,
590
+ j = 0;
591
+ if ( typeof l === "number" ) {
592
+ for ( ; j < l; j++ ) {
593
+ first[ i++ ] = second[ j ];
594
+ }
595
+ } else {
596
+ while ( second[j] !== undefined ) {
597
+ first[ i++ ] = second[ j++ ];
598
+ }
599
+ }
600
+ first.length = i;
601
+ return first;
602
+ },
603
+ grep: function( elems, callback, inv ) {
604
+ var retVal,
605
+ ret = [],
606
+ i = 0,
607
+ length = elems.length;
608
+ inv = !!inv;
609
+ // Go through the array, only saving the items
610
+ // that pass the validator function
611
+ for ( ; i < length; i++ ) {
612
+ retVal = !!callback( elems[ i ], i );
613
+ if ( inv !== retVal ) {
614
+ ret.push( elems[ i ] );
615
+ }
616
+ }
617
+ return ret;
618
+ },
619
+ // arg is for internal usage only
620
+ map: function( elems, callback, arg ) {
621
+ var value,
622
+ i = 0,
623
+ length = elems.length,
624
+ isArray = isArraylike( elems ),
625
+ ret = [];
626
+ // Go through the array, translating each of the items to their
627
+ if ( isArray ) {
628
+ for ( ; i < length; i++ ) {
629
+ value = callback( elems[ i ], i, arg );
630
+ if ( value != null ) {
631
+ ret[ ret.length ] = value;
632
+ }
633
+ }
634
+ // Go through every key on the object,
635
+ } else {
636
+ for ( i in elems ) {
637
+ value = callback( elems[ i ], i, arg );
638
+ if ( value != null ) {
639
+ ret[ ret.length ] = value;
640
+ }
641
+ }
642
+ }
643
+ // Flatten any nested arrays
644
+ return core_concat.apply( [], ret );
645
+ },
646
+ // A global GUID counter for objects
647
+ guid: 1,
648
+ // Bind a function to a context, optionally partially applying any
649
+ // arguments.
650
+ proxy: function( fn, context ) {
651
+ var args, proxy, tmp;
652
+ if ( typeof context === "string" ) {
653
+ tmp = fn[ context ];
654
+ context = fn;
655
+ fn = tmp;
656
+ }
657
+ // Quick check to determine if target is callable, in the spec
658
+ // this throws a TypeError, but we will just return undefined.
659
+ if ( !jQuery.isFunction( fn ) ) {
660
+ return undefined;
661
+ }
662
+ // Simulated bind
663
+ args = core_slice.call( arguments, 2 );
664
+ proxy = function() {
665
+ return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
666
+ };
667
+ // Set the guid of unique handler to the same of original handler, so it can be removed
668
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
669
+ return proxy;
670
+ },
671
+ // Multifunctional method to get and set values of a collection
672
+ // The value/s can optionally be executed if it's a function
673
+ access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
674
+ var i = 0,
675
+ length = elems.length,
676
+ bulk = key == null;
677
+ // Sets many values
678
+ if ( jQuery.type( key ) === "object" ) {
679
+ chainable = true;
680
+ for ( i in key ) {
681
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
682
+ }
683
+ // Sets one value
684
+ } else if ( value !== undefined ) {
685
+ chainable = true;
686
+ if ( !jQuery.isFunction( value ) ) {
687
+ raw = true;
688
+ }
689
+ if ( bulk ) {
690
+ // Bulk operations run against the entire set
691
+ if ( raw ) {
692
+ fn.call( elems, value );
693
+ fn = null;
694
+ // ...except when executing function values
695
+ } else {
696
+ bulk = fn;
697
+ fn = function( elem, key, value ) {
698
+ return bulk.call( jQuery( elem ), value );
699
+ };
700
+ }
701
+ }
702
+ if ( fn ) {
703
+ for ( ; i < length; i++ ) {
704
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
705
+ }
706
+ }
707
+ }
708
+ return chainable ?
709
+ elems :
710
+ // Gets
711
+ bulk ?
712
+ fn.call( elems ) :
713
+ length ? fn( elems[0], key ) : emptyGet;
714
+ },
715
+ now: function() {
716
+ return ( new Date() ).getTime();
717
+ }
718
+ });
719
+ jQuery.ready.promise = function( obj ) {
720
+ if ( !readyList ) {
721
+ readyList = jQuery.Deferred();
722
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
723
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
724
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
725
+ if ( document.readyState === "complete" ) {
726
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
727
+ setTimeout( jQuery.ready );
728
+ // Standards-based browsers support DOMContentLoaded
729
+ } else if ( document.addEventListener ) {
730
+ // Use the handy event callback
731
+ document.addEventListener( "DOMContentLoaded", completed, false );
732
+ // A fallback to window.onload, that will always work
733
+ window.addEventListener( "load", completed, false );
734
+ // If IE event model is used
735
+ } else {
736
+ // Ensure firing before onload, maybe late but safe also for iframes
737
+ document.attachEvent( "onreadystatechange", completed );
738
+ // A fallback to window.onload, that will always work
739
+ window.attachEvent( "onload", completed );
740
+ // If IE and not a frame
741
+ // continually check to see if the document is ready
742
+ var top = false;
743
+ try {
744
+ top = window.frameElement == null && document.documentElement;
745
+ } catch(e) {}
746
+ if ( top && top.doScroll ) {
747
+ (function doScrollCheck() {
748
+ if ( !jQuery.isReady ) {
749
+ try {
750
+ // Use the trick by Diego Perini
751
+ // http://javascript.nwbox.com/IEContentLoaded/
752
+ top.doScroll("left");
753
+ } catch(e) {
754
+ return setTimeout( doScrollCheck, 50 );
755
+ }
756
+ // detach all dom ready events
757
+ detach();
758
+ // and execute any waiting functions
759
+ jQuery.ready();
760
+ }
761
+ })();
762
+ }
763
+ }
764
+ }
765
+ return readyList.promise( obj );
766
+ };
767
+ // Populate the class2type map
768
+ jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
769
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
770
+ });
771
+ function isArraylike( obj ) {
772
+ var length = obj.length,
773
+ type = jQuery.type( obj );
774
+ if ( jQuery.isWindow( obj ) ) {
775
+ return false;
776
+ }
777
+ if ( obj.nodeType === 1 && length ) {
778
+ return true;
779
+ }
780
+ return type === "array" || type !== "function" &&
781
+ ( length === 0 ||
782
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj );
783
+ }
784
+ // All jQuery objects should point back to these
785
+ rootjQuery = jQuery(document);
786
+ // String to Object options format cache
787
+ var optionsCache = {};
788
+ // Convert String-formatted options into Object-formatted ones and store in cache
789
+ function createOptions( options ) {
790
+ var object = optionsCache[ options ] = {};
791
+ jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
792
+ object[ flag ] = true;
793
+ });
794
+ return object;
795
+ }
796
+ /*
797
+ * Create a callback list using the following parameters:
798
+ *
799
+ * options: an optional list of space-separated options that will change how
800
+ * the callback list behaves or a more traditional option object
801
+ *
802
+ * By default a callback list will act like an event callback list and can be
803
+ * "fired" multiple times.
804
+ *
805
+ * Possible options:
806
+ *
807
+ * once: will ensure the callback list can only be fired once (like a Deferred)
808
+ *
809
+ * memory: will keep track of previous values and will call any callback added
810
+ * after the list has been fired right away with the latest "memorized"
811
+ * values (like a Deferred)
812
+ *
813
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
814
+ *
815
+ * stopOnFalse: interrupt callings when a callback returns false
816
+ *
817
+ */
818
+ jQuery.Callbacks = function( options ) {
819
+ // Convert options from String-formatted to Object-formatted if needed
820
+ // (we check in cache first)
821
+ options = typeof options === "string" ?
822
+ ( optionsCache[ options ] || createOptions( options ) ) :
823
+ jQuery.extend( {}, options );
824
+ var // Flag to know if list is currently firing
825
+ firing,
826
+ // Last fire value (for non-forgettable lists)
827
+ memory,
828
+ // Flag to know if list was already fired
829
+ fired,
830
+ // End of the loop when firing
831
+ firingLength,
832
+ // Index of currently firing callback (modified by remove if needed)
833
+ firingIndex,
834
+ // First callback to fire (used internally by add and fireWith)
835
+ firingStart,
836
+ // Actual callback list
837
+ list = [],
838
+ // Stack of fire calls for repeatable lists
839
+ stack = !options.once && [],
840
+ // Fire callbacks
841
+ fire = function( data ) {
842
+ memory = options.memory && data;
843
+ fired = true;
844
+ firingIndex = firingStart || 0;
845
+ firingStart = 0;
846
+ firingLength = list.length;
847
+ firing = true;
848
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
849
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
850
+ memory = false; // To prevent further calls using add
851
+ break;
852
+ }
853
+ }
854
+ firing = false;
855
+ if ( list ) {
856
+ if ( stack ) {
857
+ if ( stack.length ) {
858
+ fire( stack.shift() );
859
+ }
860
+ } else if ( memory ) {
861
+ list = [];
862
+ } else {
863
+ self.disable();
864
+ }
865
+ }
866
+ },
867
+ // Actual Callbacks object
868
+ self = {
869
+ // Add a callback or a collection of callbacks to the list
870
+ add: function() {
871
+ if ( list ) {
872
+ // First, we save the current length
873
+ var start = list.length;
874
+ (function add( args ) {
875
+ jQuery.each( args, function( _, arg ) {
876
+ var type = jQuery.type( arg );
877
+ if ( type === "function" ) {
878
+ if ( !options.unique || !self.has( arg ) ) {
879
+ list.push( arg );
880
+ }
881
+ } else if ( arg && arg.length && type !== "string" ) {
882
+ // Inspect recursively
883
+ add( arg );
884
+ }
885
+ });
886
+ })( arguments );
887
+ // Do we need to add the callbacks to the
888
+ // current firing batch?
889
+ if ( firing ) {
890
+ firingLength = list.length;
891
+ // With memory, if we're not firing then
892
+ // we should call right away
893
+ } else if ( memory ) {
894
+ firingStart = start;
895
+ fire( memory );
896
+ }
897
+ }
898
+ return this;
899
+ },
900
+ // Remove a callback from the list
901
+ remove: function() {
902
+ if ( list ) {
903
+ jQuery.each( arguments, function( _, arg ) {
904
+ var index;
905
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
906
+ list.splice( index, 1 );
907
+ // Handle firing indexes
908
+ if ( firing ) {
909
+ if ( index <= firingLength ) {
910
+ firingLength--;
911
+ }
912
+ if ( index <= firingIndex ) {
913
+ firingIndex--;
914
+ }
915
+ }
916
+ }
917
+ });
918
+ }
919
+ return this;
920
+ },
921
+ // Check if a given callback is in the list.
922
+ // If no argument is given, return whether or not list has callbacks attached.
923
+ has: function( fn ) {
924
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
925
+ },
926
+ // Remove all callbacks from the list
927
+ empty: function() {
928
+ list = [];
929
+ return this;
930
+ },
931
+ // Have the list do nothing anymore
932
+ disable: function() {
933
+ list = stack = memory = undefined;
934
+ return this;
935
+ },
936
+ // Is it disabled?
937
+ disabled: function() {
938
+ return !list;
939
+ },
940
+ // Lock the list in its current state
941
+ lock: function() {
942
+ stack = undefined;
943
+ if ( !memory ) {
944
+ self.disable();
945
+ }
946
+ return this;
947
+ },
948
+ // Is it locked?
949
+ locked: function() {
950
+ return !stack;
951
+ },
952
+ // Call all callbacks with the given context and arguments
953
+ fireWith: function( context, args ) {
954
+ args = args || [];
955
+ args = [ context, args.slice ? args.slice() : args ];
956
+ if ( list && ( !fired || stack ) ) {
957
+ if ( firing ) {
958
+ stack.push( args );
959
+ } else {
960
+ fire( args );
961
+ }
962
+ }
963
+ return this;
964
+ },
965
+ // Call all the callbacks with the given arguments
966
+ fire: function() {
967
+ self.fireWith( this, arguments );
968
+ return this;
969
+ },
970
+ // To know if the callbacks have already been called at least once
971
+ fired: function() {
972
+ return !!fired;
973
+ }
974
+ };
975
+ return self;
976
+ };
977
+ jQuery.extend({
978
+ Deferred: function( func ) {
979
+ var tuples = [
980
+ // action, add listener, listener list, final state
981
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
982
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
983
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
984
+ ],
985
+ state = "pending",
986
+ promise = {
987
+ state: function() {
988
+ return state;
989
+ },
990
+ always: function() {
991
+ deferred.done( arguments ).fail( arguments );
992
+ return this;
993
+ },
994
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
995
+ var fns = arguments;
996
+ return jQuery.Deferred(function( newDefer ) {
997
+ jQuery.each( tuples, function( i, tuple ) {
998
+ var action = tuple[ 0 ],
999
+ fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
1000
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
1001
+ deferred[ tuple[1] ](function() {
1002
+ var returned = fn && fn.apply( this, arguments );
1003
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
1004
+ returned.promise()
1005
+ .done( newDefer.resolve )
1006
+ .fail( newDefer.reject )
1007
+ .progress( newDefer.notify );
1008
+ } else {
1009
+ newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
1010
+ }
1011
+ });
1012
+ });
1013
+ fns = null;
1014
+ }).promise();
1015
+ },
1016
+ // Get a promise for this deferred
1017
+ // If obj is provided, the promise aspect is added to the object
1018
+ promise: function( obj ) {
1019
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
1020
+ }
1021
+ },
1022
+ deferred = {};
1023
+ // Keep pipe for back-compat
1024
+ promise.pipe = promise.then;
1025
+ // Add list-specific methods
1026
+ jQuery.each( tuples, function( i, tuple ) {
1027
+ var list = tuple[ 2 ],
1028
+ stateString = tuple[ 3 ];
1029
+ // promise[ done | fail | progress ] = list.add
1030
+ promise[ tuple[1] ] = list.add;
1031
+ // Handle state
1032
+ if ( stateString ) {
1033
+ list.add(function() {
1034
+ // state = [ resolved | rejected ]
1035
+ state = stateString;
1036
+ // [ reject_list | resolve_list ].disable; progress_list.lock
1037
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
1038
+ }
1039
+ // deferred[ resolve | reject | notify ]
1040
+ deferred[ tuple[0] ] = function() {
1041
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
1042
+ return this;
1043
+ };
1044
+ deferred[ tuple[0] + "With" ] = list.fireWith;
1045
+ });
1046
+ // Make the deferred a promise
1047
+ promise.promise( deferred );
1048
+ // Call given func if any
1049
+ if ( func ) {
1050
+ func.call( deferred, deferred );
1051
+ }
1052
+ // All done!
1053
+ return deferred;
1054
+ },
1055
+ // Deferred helper
1056
+ when: function( subordinate /* , ..., subordinateN */ ) {
1057
+ var i = 0,
1058
+ resolveValues = core_slice.call( arguments ),
1059
+ length = resolveValues.length,
1060
+ // the count of uncompleted subordinates
1061
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
1062
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
1063
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
1064
+ // Update function for both resolve and progress values
1065
+ updateFunc = function( i, contexts, values ) {
1066
+ return function( value ) {
1067
+ contexts[ i ] = this;
1068
+ values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
1069
+ if( values === progressValues ) {
1070
+ deferred.notifyWith( contexts, values );
1071
+ } else if ( !( --remaining ) ) {
1072
+ deferred.resolveWith( contexts, values );
1073
+ }
1074
+ };
1075
+ },
1076
+ progressValues, progressContexts, resolveContexts;
1077
+ // add listeners to Deferred subordinates; treat others as resolved
1078
+ if ( length > 1 ) {
1079
+ progressValues = new Array( length );
1080
+ progressContexts = new Array( length );
1081
+ resolveContexts = new Array( length );
1082
+ for ( ; i < length; i++ ) {
1083
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
1084
+ resolveValues[ i ].promise()
1085
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
1086
+ .fail( deferred.reject )
1087
+ .progress( updateFunc( i, progressContexts, progressValues ) );
1088
+ } else {
1089
+ --remaining;
1090
+ }
1091
+ }
1092
+ }
1093
+ // if we're not waiting on anything, resolve the master
1094
+ if ( !remaining ) {
1095
+ deferred.resolveWith( resolveContexts, resolveValues );
1096
+ }
1097
+ return deferred.promise();
1098
+ }
1099
+ });
1100
+ jQuery.support = (function() {
1101
+ var support, all, a,
1102
+ input, select, fragment,
1103
+ opt, eventName, isSupported, i,
1104
+ div = document.createElement("div");
1105
+ // Setup
1106
+ div.setAttribute( "className", "t" );
1107
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
1108
+ // Support tests won't run in some limited or non-browser environments
1109
+ all = div.getElementsByTagName("*");
1110
+ a = div.getElementsByTagName("a")[ 0 ];
1111
+ if ( !all || !a || !all.length ) {
1112
+ return {};
1113
+ }
1114
+ // First batch of tests
1115
+ select = document.createElement("select");
1116
+ opt = select.appendChild( document.createElement("option") );
1117
+ input = div.getElementsByTagName("input")[ 0 ];
1118
+ a.style.cssText = "top:1px;float:left;opacity:.5";
1119
+ support = {
1120
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
1121
+ getSetAttribute: div.className !== "t",
1122
+ // IE strips leading whitespace when .innerHTML is used
1123
+ leadingWhitespace: div.firstChild.nodeType === 3,
1124
+ // Make sure that tbody elements aren't automatically inserted
1125
+ // IE will insert them into empty tables
1126
+ tbody: !div.getElementsByTagName("tbody").length,
1127
+ // Make sure that link elements get serialized correctly by innerHTML
1128
+ // This requires a wrapper element in IE
1129
+ htmlSerialize: !!div.getElementsByTagName("link").length,
1130
+ // Get the style information from getAttribute
1131
+ // (IE uses .cssText instead)
1132
+ style: /top/.test( a.getAttribute("style") ),
1133
+ // Make sure that URLs aren't manipulated
1134
+ // (IE normalizes it by default)
1135
+ hrefNormalized: a.getAttribute("href") === "/a",
1136
+ // Make sure that element opacity exists
1137
+ // (IE uses filter instead)
1138
+ // Use a regex to work around a WebKit issue. See #5145
1139
+ opacity: /^0.5/.test( a.style.opacity ),
1140
+ // Verify style float existence
1141
+ // (IE uses styleFloat instead of cssFloat)
1142
+ cssFloat: !!a.style.cssFloat,
1143
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
1144
+ checkOn: !!input.value,
1145
+ // Make sure that a selected-by-default option has a working selected property.
1146
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1147
+ optSelected: opt.selected,
1148
+ // Tests for enctype support on a form (#6743)
1149
+ enctype: !!document.createElement("form").enctype,
1150
+ // Makes sure cloning an html5 element does not cause problems
1151
+ // Where outerHTML is undefined, this still works
1152
+ html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
1153
+ // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
1154
+ boxModel: document.compatMode === "CSS1Compat",
1155
+ // Will be defined later
1156
+ deleteExpando: true,
1157
+ noCloneEvent: true,
1158
+ inlineBlockNeedsLayout: false,
1159
+ shrinkWrapBlocks: false,
1160
+ reliableMarginRight: true,
1161
+ boxSizingReliable: true,
1162
+ pixelPosition: false
1163
+ };
1164
+ // Make sure checked status is properly cloned
1165
+ input.checked = true;
1166
+ support.noCloneChecked = input.cloneNode( true ).checked;
1167
+ // Make sure that the options inside disabled selects aren't marked as disabled
1168
+ // (WebKit marks them as disabled)
1169
+ select.disabled = true;
1170
+ support.optDisabled = !opt.disabled;
1171
+ // Support: IE<9
1172
+ try {
1173
+ delete div.test;
1174
+ } catch( e ) {
1175
+ support.deleteExpando = false;
1176
+ }
1177
+ // Check if we can trust getAttribute("value")
1178
+ input = document.createElement("input");
1179
+ input.setAttribute( "value", "" );
1180
+ support.input = input.getAttribute( "value" ) === "";
1181
+ // Check if an input maintains its value after becoming a radio
1182
+ input.value = "t";
1183
+ input.setAttribute( "type", "radio" );
1184
+ support.radioValue = input.value === "t";
1185
+ // #11217 - WebKit loses check when the name is after the checked attribute
1186
+ input.setAttribute( "checked", "t" );
1187
+ input.setAttribute( "name", "t" );
1188
+ fragment = document.createDocumentFragment();
1189
+ fragment.appendChild( input );
1190
+ // Check if a disconnected checkbox will retain its checked
1191
+ // value of true after appended to the DOM (IE6/7)
1192
+ support.appendChecked = input.checked;
1193
+ // WebKit doesn't clone checked state correctly in fragments
1194
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
1195
+ // Support: IE<9
1196
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
1197
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
1198
+ if ( div.attachEvent ) {
1199
+ div.attachEvent( "onclick", function() {
1200
+ support.noCloneEvent = false;
1201
+ });
1202
+ div.cloneNode( true ).click();
1203
+ }
1204
+ // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
1205
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
1206
+ for ( i in { submit: true, change: true, focusin: true }) {
1207
+ div.setAttribute( eventName = "on" + i, "t" );
1208
+ support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
1209
+ }
1210
+ div.style.backgroundClip = "content-box";
1211
+ div.cloneNode( true ).style.backgroundClip = "";
1212
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
1213
+ // Run tests that need a body at doc ready
1214
+ jQuery(function() {
1215
+ var container, marginDiv, tds,
1216
+ divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
1217
+ body = document.getElementsByTagName("body")[0];
1218
+ if ( !body ) {
1219
+ // Return for frameset docs that don't have a body
1220
+ return;
1221
+ }
1222
+ container = document.createElement("div");
1223
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
1224
+ body.appendChild( container ).appendChild( div );
1225
+ // Support: IE8
1226
+ // Check if table cells still have offsetWidth/Height when they are set
1227
+ // to display:none and there are still other visible table cells in a
1228
+ // table row; if so, offsetWidth/Height are not reliable for use when
1229
+ // determining if an element has been hidden directly using
1230
+ // display:none (it is still safe to use offsets if a parent element is
1231
+ // hidden; don safety goggles and see bug #4512 for more information).
1232
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
1233
+ tds = div.getElementsByTagName("td");
1234
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
1235
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
1236
+ tds[ 0 ].style.display = "";
1237
+ tds[ 1 ].style.display = "none";
1238
+ // Support: IE8
1239
+ // Check if empty table cells still have offsetWidth/Height
1240
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
1241
+ // Check box-sizing and margin behavior
1242
+ div.innerHTML = "";
1243
+ div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
1244
+ support.boxSizing = ( div.offsetWidth === 4 );
1245
+ support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
1246
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
1247
+ if ( window.getComputedStyle ) {
1248
+ support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
1249
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
1250
+ // Check if div with explicit width and no margin-right incorrectly
1251
+ // gets computed margin-right based on width of container. (#3333)
1252
+ // Fails in WebKit before Feb 2011 nightlies
1253
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1254
+ marginDiv = div.appendChild( document.createElement("div") );
1255
+ marginDiv.style.cssText = div.style.cssText = divReset;
1256
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
1257
+ div.style.width = "1px";
1258
+ support.reliableMarginRight =
1259
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
1260
+ }
1261
+ if ( typeof div.style.zoom !== core_strundefined ) {
1262
+ // Support: IE<8
1263
+ // Check if natively block-level elements act like inline-block
1264
+ // elements when setting their display to 'inline' and giving
1265
+ // them layout
1266
+ div.innerHTML = "";
1267
+ div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
1268
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
1269
+ // Support: IE6
1270
+ // Check if elements with layout shrink-wrap their children
1271
+ div.style.display = "block";
1272
+ div.innerHTML = "<div></div>";
1273
+ div.firstChild.style.width = "5px";
1274
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
1275
+ if ( support.inlineBlockNeedsLayout ) {
1276
+ // Prevent IE 6 from affecting layout for positioned elements #11048
1277
+ // Prevent IE from shrinking the body in IE 7 mode #12869
1278
+ // Support: IE<8
1279
+ body.style.zoom = 1;
1280
+ }
1281
+ }
1282
+ body.removeChild( container );
1283
+ // Null elements to avoid leaks in IE
1284
+ container = div = tds = marginDiv = null;
1285
+ });
1286
+ // Null elements to avoid leaks in IE
1287
+ all = select = fragment = opt = a = input = null;
1288
+ return support;
1289
+ })();
1290
+ var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
1291
+ rmultiDash = /([A-Z])/g;
1292
+ function internalData( elem, name, data, pvt /* Internal Use Only */ ){
1293
+ if ( !jQuery.acceptData( elem ) ) {
1294
+ return;
1295
+ }
1296
+ var thisCache, ret,
1297
+ internalKey = jQuery.expando,
1298
+ getByName = typeof name === "string",
1299
+ // We have to handle DOM nodes and JS objects differently because IE6-7
1300
+ // can't GC object references properly across the DOM-JS boundary
1301
+ isNode = elem.nodeType,
1302
+ // Only DOM nodes need the global jQuery cache; JS object data is
1303
+ // attached directly to the object so GC can occur automatically
1304
+ cache = isNode ? jQuery.cache : elem,
1305
+ // Only defining an ID for JS objects if its cache already exists allows
1306
+ // the code to shortcut on the same path as a DOM node with no cache
1307
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
1308
+ // Avoid doing any more work than we need to when trying to get data on an
1309
+ // object that has no data at all
1310
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
1311
+ return;
1312
+ }
1313
+ if ( !id ) {
1314
+ // Only DOM nodes need a new unique ID for each element since their data
1315
+ // ends up in the global cache
1316
+ if ( isNode ) {
1317
+ elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
1318
+ } else {
1319
+ id = internalKey;
1320
+ }
1321
+ }
1322
+ if ( !cache[ id ] ) {
1323
+ cache[ id ] = {};
1324
+ // Avoids exposing jQuery metadata on plain JS objects when the object
1325
+ // is serialized using JSON.stringify
1326
+ if ( !isNode ) {
1327
+ cache[ id ].toJSON = jQuery.noop;
1328
+ }
1329
+ }
1330
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
1331
+ // shallow copied over onto the existing cache
1332
+ if ( typeof name === "object" || typeof name === "function" ) {
1333
+ if ( pvt ) {
1334
+ cache[ id ] = jQuery.extend( cache[ id ], name );
1335
+ } else {
1336
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
1337
+ }
1338
+ }
1339
+ thisCache = cache[ id ];
1340
+ // jQuery data() is stored in a separate object inside the object's internal data
1341
+ // cache in order to avoid key collisions between internal data and user-defined
1342
+ // data.
1343
+ if ( !pvt ) {
1344
+ if ( !thisCache.data ) {
1345
+ thisCache.data = {};
1346
+ }
1347
+ thisCache = thisCache.data;
1348
+ }
1349
+ if ( data !== undefined ) {
1350
+ thisCache[ jQuery.camelCase( name ) ] = data;
1351
+ }
1352
+ // Check for both converted-to-camel and non-converted data property names
1353
+ // If a data property was specified
1354
+ if ( getByName ) {
1355
+ // First Try to find as-is property data
1356
+ ret = thisCache[ name ];
1357
+ // Test for null|undefined property data
1358
+ if ( ret == null ) {
1359
+ // Try to find the camelCased property
1360
+ ret = thisCache[ jQuery.camelCase( name ) ];
1361
+ }
1362
+ } else {
1363
+ ret = thisCache;
1364
+ }
1365
+ return ret;
1366
+ }
1367
+ function internalRemoveData( elem, name, pvt ) {
1368
+ if ( !jQuery.acceptData( elem ) ) {
1369
+ return;
1370
+ }
1371
+ var i, l, thisCache,
1372
+ isNode = elem.nodeType,
1373
+ // See jQuery.data for more information
1374
+ cache = isNode ? jQuery.cache : elem,
1375
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
1376
+ // If there is already no cache entry for this object, there is no
1377
+ // purpose in continuing
1378
+ if ( !cache[ id ] ) {
1379
+ return;
1380
+ }
1381
+ if ( name ) {
1382
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
1383
+ if ( thisCache ) {
1384
+ // Support array or space separated string names for data keys
1385
+ if ( !jQuery.isArray( name ) ) {
1386
+ // try the string as a key before any manipulation
1387
+ if ( name in thisCache ) {
1388
+ name = [ name ];
1389
+ } else {
1390
+ // split the camel cased version by spaces unless a key with the spaces exists
1391
+ name = jQuery.camelCase( name );
1392
+ if ( name in thisCache ) {
1393
+ name = [ name ];
1394
+ } else {
1395
+ name = name.split(" ");
1396
+ }
1397
+ }
1398
+ } else {
1399
+ // If "name" is an array of keys...
1400
+ // When data is initially created, via ("key", "val") signature,
1401
+ // keys will be converted to camelCase.
1402
+ // Since there is no way to tell _how_ a key was added, remove
1403
+ // both plain key and camelCase key. #12786
1404
+ // This will only penalize the array argument path.
1405
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
1406
+ }
1407
+ for ( i = 0, l = name.length; i < l; i++ ) {
1408
+ delete thisCache[ name[i] ];
1409
+ }
1410
+ // If there is no data left in the cache, we want to continue
1411
+ // and let the cache object itself get destroyed
1412
+ if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
1413
+ return;
1414
+ }
1415
+ }
1416
+ }
1417
+ // See jQuery.data for more information
1418
+ if ( !pvt ) {
1419
+ delete cache[ id ].data;
1420
+ // Don't destroy the parent cache unless the internal data object
1421
+ // had been the only thing left in it
1422
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
1423
+ return;
1424
+ }
1425
+ }
1426
+ // Destroy the cache
1427
+ if ( isNode ) {
1428
+ jQuery.cleanData( [ elem ], true );
1429
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
1430
+ } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
1431
+ delete cache[ id ];
1432
+ // When all else fails, null
1433
+ } else {
1434
+ cache[ id ] = null;
1435
+ }
1436
+ }
1437
+ jQuery.extend({
1438
+ cache: {},
1439
+ // Unique for each copy of jQuery on the page
1440
+ // Non-digits removed to match rinlinejQuery
1441
+ expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
1442
+ // The following elements throw uncatchable exceptions if you
1443
+ // attempt to add expando properties to them.
1444
+ noData: {
1445
+ "embed": true,
1446
+ // Ban all objects except for Flash (which handle expandos)
1447
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
1448
+ "applet": true
1449
+ },
1450
+ hasData: function( elem ) {
1451
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1452
+ return !!elem && !isEmptyDataObject( elem );
1453
+ },
1454
+ data: function( elem, name, data ) {
1455
+ return internalData( elem, name, data );
1456
+ },
1457
+ removeData: function( elem, name ) {
1458
+ return internalRemoveData( elem, name );
1459
+ },
1460
+ // For internal use only.
1461
+ _data: function( elem, name, data ) {
1462
+ return internalData( elem, name, data, true );
1463
+ },
1464
+ _removeData: function( elem, name ) {
1465
+ return internalRemoveData( elem, name, true );
1466
+ },
1467
+ // A method for determining if a DOM node can handle the data expando
1468
+ acceptData: function( elem ) {
1469
+ // Do not set data on non-element because it will not be cleared (#8335).
1470
+ if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
1471
+ return false;
1472
+ }
1473
+ var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
1474
+ // nodes accept data unless otherwise specified; rejection can be conditional
1475
+ return !noData || noData !== true && elem.getAttribute("classid") === noData;
1476
+ }
1477
+ });
1478
+ jQuery.fn.extend({
1479
+ data: function( key, value ) {
1480
+ var attrs, name,
1481
+ elem = this[0],
1482
+ i = 0,
1483
+ data = null;
1484
+ // Gets all values
1485
+ if ( key === undefined ) {
1486
+ if ( this.length ) {
1487
+ data = jQuery.data( elem );
1488
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
1489
+ attrs = elem.attributes;
1490
+ for ( ; i < attrs.length; i++ ) {
1491
+ name = attrs[i].name;
1492
+ if ( !name.indexOf( "data-" ) ) {
1493
+ name = jQuery.camelCase( name.slice(5) );
1494
+ dataAttr( elem, name, data[ name ] );
1495
+ }
1496
+ }
1497
+ jQuery._data( elem, "parsedAttrs", true );
1498
+ }
1499
+ }
1500
+ return data;
1501
+ }
1502
+ // Sets multiple values
1503
+ if ( typeof key === "object" ) {
1504
+ return this.each(function() {
1505
+ jQuery.data( this, key );
1506
+ });
1507
+ }
1508
+ return jQuery.access( this, function( value ) {
1509
+ if ( value === undefined ) {
1510
+ // Try to fetch any internally stored data first
1511
+ return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
1512
+ }
1513
+ this.each(function() {
1514
+ jQuery.data( this, key, value );
1515
+ });
1516
+ }, null, value, arguments.length > 1, null, true );
1517
+ },
1518
+ removeData: function( key ) {
1519
+ return this.each(function() {
1520
+ jQuery.removeData( this, key );
1521
+ });
1522
+ }
1523
+ });
1524
+ function dataAttr( elem, key, data ) {
1525
+ // If nothing was found internally, try to fetch any
1526
+ // data from the HTML5 data-* attribute
1527
+ if ( data === undefined && elem.nodeType === 1 ) {
1528
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
1529
+ data = elem.getAttribute( name );
1530
+ if ( typeof data === "string" ) {
1531
+ try {
1532
+ data = data === "true" ? true :
1533
+ data === "false" ? false :
1534
+ data === "null" ? null :
1535
+ // Only convert to a number if it doesn't change the string
1536
+ +data + "" === data ? +data :
1537
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
1538
+ data;
1539
+ } catch( e ) {}
1540
+ // Make sure we set the data so it isn't changed later
1541
+ jQuery.data( elem, key, data );
1542
+ } else {
1543
+ data = undefined;
1544
+ }
1545
+ }
1546
+ return data;
1547
+ }
1548
+ // checks a cache object for emptiness
1549
+ function isEmptyDataObject( obj ) {
1550
+ var name;
1551
+ for ( name in obj ) {
1552
+ // if the public data object is empty, the private is still empty
1553
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
1554
+ continue;
1555
+ }
1556
+ if ( name !== "toJSON" ) {
1557
+ return false;
1558
+ }
1559
+ }
1560
+ return true;
1561
+ }
1562
+ jQuery.extend({
1563
+ queue: function( elem, type, data ) {
1564
+ var queue;
1565
+ if ( elem ) {
1566
+ type = ( type || "fx" ) + "queue";
1567
+ queue = jQuery._data( elem, type );
1568
+ // Speed up dequeue by getting out quickly if this is just a lookup
1569
+ if ( data ) {
1570
+ if ( !queue || jQuery.isArray(data) ) {
1571
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
1572
+ } else {
1573
+ queue.push( data );
1574
+ }
1575
+ }
1576
+ return queue || [];
1577
+ }
1578
+ },
1579
+ dequeue: function( elem, type ) {
1580
+ type = type || "fx";
1581
+ var queue = jQuery.queue( elem, type ),
1582
+ startLength = queue.length,
1583
+ fn = queue.shift(),
1584
+ hooks = jQuery._queueHooks( elem, type ),
1585
+ next = function() {
1586
+ jQuery.dequeue( elem, type );
1587
+ };
1588
+ // If the fx queue is dequeued, always remove the progress sentinel
1589
+ if ( fn === "inprogress" ) {
1590
+ fn = queue.shift();
1591
+ startLength--;
1592
+ }
1593
+ hooks.cur = fn;
1594
+ if ( fn ) {
1595
+ // Add a progress sentinel to prevent the fx queue from being
1596
+ // automatically dequeued
1597
+ if ( type === "fx" ) {
1598
+ queue.unshift( "inprogress" );
1599
+ }
1600
+ // clear up the last queue stop function
1601
+ delete hooks.stop;
1602
+ fn.call( elem, next, hooks );
1603
+ }
1604
+ if ( !startLength && hooks ) {
1605
+ hooks.empty.fire();
1606
+ }
1607
+ },
1608
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
1609
+ _queueHooks: function( elem, type ) {
1610
+ var key = type + "queueHooks";
1611
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
1612
+ empty: jQuery.Callbacks("once memory").add(function() {
1613
+ jQuery._removeData( elem, type + "queue" );
1614
+ jQuery._removeData( elem, key );
1615
+ })
1616
+ });
1617
+ }
1618
+ });
1619
+ jQuery.fn.extend({
1620
+ queue: function( type, data ) {
1621
+ var setter = 2;
1622
+ if ( typeof type !== "string" ) {
1623
+ data = type;
1624
+ type = "fx";
1625
+ setter--;
1626
+ }
1627
+ if ( arguments.length < setter ) {
1628
+ return jQuery.queue( this[0], type );
1629
+ }
1630
+ return data === undefined ?
1631
+ this :
1632
+ this.each(function() {
1633
+ var queue = jQuery.queue( this, type, data );
1634
+ // ensure a hooks for this queue
1635
+ jQuery._queueHooks( this, type );
1636
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
1637
+ jQuery.dequeue( this, type );
1638
+ }
1639
+ });
1640
+ },
1641
+ dequeue: function( type ) {
1642
+ return this.each(function() {
1643
+ jQuery.dequeue( this, type );
1644
+ });
1645
+ },
1646
+ // Based off of the plugin by Clint Helfers, with permission.
1647
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
1648
+ delay: function( time, type ) {
1649
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
1650
+ type = type || "fx";
1651
+ return this.queue( type, function( next, hooks ) {
1652
+ var timeout = setTimeout( next, time );
1653
+ hooks.stop = function() {
1654
+ clearTimeout( timeout );
1655
+ };
1656
+ });
1657
+ },
1658
+ clearQueue: function( type ) {
1659
+ return this.queue( type || "fx", [] );
1660
+ },
1661
+ // Get a promise resolved when queues of a certain type
1662
+ // are emptied (fx is the type by default)
1663
+ promise: function( type, obj ) {
1664
+ var tmp,
1665
+ count = 1,
1666
+ defer = jQuery.Deferred(),
1667
+ elements = this,
1668
+ i = this.length,
1669
+ resolve = function() {
1670
+ if ( !( --count ) ) {
1671
+ defer.resolveWith( elements, [ elements ] );
1672
+ }
1673
+ };
1674
+ if ( typeof type !== "string" ) {
1675
+ obj = type;
1676
+ type = undefined;
1677
+ }
1678
+ type = type || "fx";
1679
+ while( i-- ) {
1680
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
1681
+ if ( tmp && tmp.empty ) {
1682
+ count++;
1683
+ tmp.empty.add( resolve );
1684
+ }
1685
+ }
1686
+ resolve();
1687
+ return defer.promise( obj );
1688
+ }
1689
+ });
1690
+ var nodeHook, boolHook,
1691
+ rclass = /[\t\r\n]/g,
1692
+ rreturn = /\r/g,
1693
+ rfocusable = /^(?:input|select|textarea|button|object)$/i,
1694
+ rclickable = /^(?:a|area)$/i,
1695
+ rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
1696
+ ruseDefault = /^(?:checked|selected)$/i,
1697
+ getSetAttribute = jQuery.support.getSetAttribute,
1698
+ getSetInput = jQuery.support.input;
1699
+ jQuery.fn.extend({
1700
+ attr: function( name, value ) {
1701
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
1702
+ },
1703
+ removeAttr: function( name ) {
1704
+ return this.each(function() {
1705
+ jQuery.removeAttr( this, name );
1706
+ });
1707
+ },
1708
+ prop: function( name, value ) {
1709
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
1710
+ },
1711
+ removeProp: function( name ) {
1712
+ name = jQuery.propFix[ name ] || name;
1713
+ return this.each(function() {
1714
+ // try/catch handles cases where IE balks (such as removing a property on window)
1715
+ try {
1716
+ this[ name ] = undefined;
1717
+ delete this[ name ];
1718
+ } catch( e ) {}
1719
+ });
1720
+ },
1721
+ addClass: function( value ) {
1722
+ var classes, elem, cur, clazz, j,
1723
+ i = 0,
1724
+ len = this.length,
1725
+ proceed = typeof value === "string" && value;
1726
+ if ( jQuery.isFunction( value ) ) {
1727
+ return this.each(function( j ) {
1728
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
1729
+ });
1730
+ }
1731
+ if ( proceed ) {
1732
+ // The disjunction here is for better compressibility (see removeClass)
1733
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
1734
+ for ( ; i < len; i++ ) {
1735
+ elem = this[ i ];
1736
+ cur = elem.nodeType === 1 && ( elem.className ?
1737
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
1738
+ " "
1739
+ );
1740
+ if ( cur ) {
1741
+ j = 0;
1742
+ while ( (clazz = classes[j++]) ) {
1743
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
1744
+ cur += clazz + " ";
1745
+ }
1746
+ }
1747
+ elem.className = jQuery.trim( cur );
1748
+ }
1749
+ }
1750
+ }
1751
+ return this;
1752
+ },
1753
+ removeClass: function( value ) {
1754
+ var classes, elem, cur, clazz, j,
1755
+ i = 0,
1756
+ len = this.length,
1757
+ proceed = arguments.length === 0 || typeof value === "string" && value;
1758
+ if ( jQuery.isFunction( value ) ) {
1759
+ return this.each(function( j ) {
1760
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
1761
+ });
1762
+ }
1763
+ if ( proceed ) {
1764
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
1765
+ for ( ; i < len; i++ ) {
1766
+ elem = this[ i ];
1767
+ // This expression is here for better compressibility (see addClass)
1768
+ cur = elem.nodeType === 1 && ( elem.className ?
1769
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
1770
+ ""
1771
+ );
1772
+ if ( cur ) {
1773
+ j = 0;
1774
+ while ( (clazz = classes[j++]) ) {
1775
+ // Remove *all* instances
1776
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
1777
+ cur = cur.replace( " " + clazz + " ", " " );
1778
+ }
1779
+ }
1780
+ elem.className = value ? jQuery.trim( cur ) : "";
1781
+ }
1782
+ }
1783
+ }
1784
+ return this;
1785
+ },
1786
+ toggleClass: function( value, stateVal ) {
1787
+ var type = typeof value,
1788
+ isBool = typeof stateVal === "boolean";
1789
+ if ( jQuery.isFunction( value ) ) {
1790
+ return this.each(function( i ) {
1791
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
1792
+ });
1793
+ }
1794
+ return this.each(function() {
1795
+ if ( type === "string" ) {
1796
+ // toggle individual class names
1797
+ var className,
1798
+ i = 0,
1799
+ self = jQuery( this ),
1800
+ state = stateVal,
1801
+ classNames = value.match( core_rnotwhite ) || [];
1802
+ while ( (className = classNames[ i++ ]) ) {
1803
+ // check each className given, space separated list
1804
+ state = isBool ? state : !self.hasClass( className );
1805
+ self[ state ? "addClass" : "removeClass" ]( className );
1806
+ }
1807
+ // Toggle whole class name
1808
+ } else if ( type === core_strundefined || type === "boolean" ) {
1809
+ if ( this.className ) {
1810
+ // store className if set
1811
+ jQuery._data( this, "__className__", this.className );
1812
+ }
1813
+ // If the element has a class name or if we're passed "false",
1814
+ // then remove the whole classname (if there was one, the above saved it).
1815
+ // Otherwise bring back whatever was previously saved (if anything),
1816
+ // falling back to the empty string if nothing was stored.
1817
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
1818
+ }
1819
+ });
1820
+ },
1821
+ hasClass: function( selector ) {
1822
+ var className = " " + selector + " ",
1823
+ i = 0,
1824
+ l = this.length;
1825
+ for ( ; i < l; i++ ) {
1826
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
1827
+ return true;
1828
+ }
1829
+ }
1830
+ return false;
1831
+ },
1832
+ val: function( value ) {
1833
+ var ret, hooks, isFunction,
1834
+ elem = this[0];
1835
+ if ( !arguments.length ) {
1836
+ if ( elem ) {
1837
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
1838
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
1839
+ return ret;
1840
+ }
1841
+ ret = elem.value;
1842
+ return typeof ret === "string" ?
1843
+ // handle most common string cases
1844
+ ret.replace(rreturn, "") :
1845
+ // handle cases where value is null/undef or number
1846
+ ret == null ? "" : ret;
1847
+ }
1848
+ return;
1849
+ }
1850
+ isFunction = jQuery.isFunction( value );
1851
+ return this.each(function( i ) {
1852
+ var val,
1853
+ self = jQuery(this);
1854
+ if ( this.nodeType !== 1 ) {
1855
+ return;
1856
+ }
1857
+ if ( isFunction ) {
1858
+ val = value.call( this, i, self.val() );
1859
+ } else {
1860
+ val = value;
1861
+ }
1862
+ // Treat null/undefined as ""; convert numbers to string
1863
+ if ( val == null ) {
1864
+ val = "";
1865
+ } else if ( typeof val === "number" ) {
1866
+ val += "";
1867
+ } else if ( jQuery.isArray( val ) ) {
1868
+ val = jQuery.map(val, function ( value ) {
1869
+ return value == null ? "" : value + "";
1870
+ });
1871
+ }
1872
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
1873
+ // If set returns undefined, fall back to normal setting
1874
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
1875
+ this.value = val;
1876
+ }
1877
+ });
1878
+ }
1879
+ });
1880
+ jQuery.extend({
1881
+ valHooks: {
1882
+ option: {
1883
+ get: function( elem ) {
1884
+ // attributes.value is undefined in Blackberry 4.7 but
1885
+ // uses .value. See #6932
1886
+ var val = elem.attributes.value;
1887
+ return !val || val.specified ? elem.value : elem.text;
1888
+ }
1889
+ },
1890
+ select: {
1891
+ get: function( elem ) {
1892
+ var value, option,
1893
+ options = elem.options,
1894
+ index = elem.selectedIndex,
1895
+ one = elem.type === "select-one" || index < 0,
1896
+ values = one ? null : [],
1897
+ max = one ? index + 1 : options.length,
1898
+ i = index < 0 ?
1899
+ max :
1900
+ one ? index : 0;
1901
+ // Loop through all the selected options
1902
+ for ( ; i < max; i++ ) {
1903
+ option = options[ i ];
1904
+ // oldIE doesn't update selected after form reset (#2551)
1905
+ if ( ( option.selected || i === index ) &&
1906
+ // Don't return options that are disabled or in a disabled optgroup
1907
+ ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
1908
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
1909
+ // Get the specific value for the option
1910
+ value = jQuery( option ).val();
1911
+ // We don't need an array for one selects
1912
+ if ( one ) {
1913
+ return value;
1914
+ }
1915
+ // Multi-Selects return an array
1916
+ values.push( value );
1917
+ }
1918
+ }
1919
+ return values;
1920
+ },
1921
+ set: function( elem, value ) {
1922
+ var values = jQuery.makeArray( value );
1923
+ jQuery(elem).find("option").each(function() {
1924
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
1925
+ });
1926
+ if ( !values.length ) {
1927
+ elem.selectedIndex = -1;
1928
+ }
1929
+ return values;
1930
+ }
1931
+ }
1932
+ },
1933
+ attr: function( elem, name, value ) {
1934
+ var hooks, notxml, ret,
1935
+ nType = elem.nodeType;
1936
+ // don't get/set attributes on text, comment and attribute nodes
1937
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
1938
+ return;
1939
+ }
1940
+ // Fallback to prop when attributes are not supported
1941
+ if ( typeof elem.getAttribute === core_strundefined ) {
1942
+ return jQuery.prop( elem, name, value );
1943
+ }
1944
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
1945
+ // All attributes are lowercase
1946
+ // Grab necessary hook if one is defined
1947
+ if ( notxml ) {
1948
+ name = name.toLowerCase();
1949
+ hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
1950
+ }
1951
+ if ( value !== undefined ) {
1952
+ if ( value === null ) {
1953
+ jQuery.removeAttr( elem, name );
1954
+ } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
1955
+ return ret;
1956
+ } else {
1957
+ elem.setAttribute( name, value + "" );
1958
+ return value;
1959
+ }
1960
+ } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
1961
+ return ret;
1962
+ } else {
1963
+ // In IE9+, Flash objects don't have .getAttribute (#12945)
1964
+ // Support: IE9+
1965
+ if ( typeof elem.getAttribute !== core_strundefined ) {
1966
+ ret = elem.getAttribute( name );
1967
+ }
1968
+ // Non-existent attributes return null, we normalize to undefined
1969
+ return ret == null ?
1970
+ undefined :
1971
+ ret;
1972
+ }
1973
+ },
1974
+ removeAttr: function( elem, value ) {
1975
+ var name, propName,
1976
+ i = 0,
1977
+ attrNames = value && value.match( core_rnotwhite );
1978
+ if ( attrNames && elem.nodeType === 1 ) {
1979
+ while ( (name = attrNames[i++]) ) {
1980
+ propName = jQuery.propFix[ name ] || name;
1981
+ // Boolean attributes get special treatment (#10870)
1982
+ if ( rboolean.test( name ) ) {
1983
+ // Set corresponding property to false for boolean attributes
1984
+ // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
1985
+ if ( !getSetAttribute && ruseDefault.test( name ) ) {
1986
+ elem[ jQuery.camelCase( "default-" + name ) ] =
1987
+ elem[ propName ] = false;
1988
+ } else {
1989
+ elem[ propName ] = false;
1990
+ }
1991
+ // See #9699 for explanation of this approach (setting first, then removal)
1992
+ } else {
1993
+ jQuery.attr( elem, name, "" );
1994
+ }
1995
+ elem.removeAttribute( getSetAttribute ? name : propName );
1996
+ }
1997
+ }
1998
+ },
1999
+ attrHooks: {
2000
+ type: {
2001
+ set: function( elem, value ) {
2002
+ if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
2003
+ // Setting the type on a radio button after the value resets the value in IE6-9
2004
+ // Reset value to default in case type is set after value during creation
2005
+ var val = elem.value;
2006
+ elem.setAttribute( "type", value );
2007
+ if ( val ) {
2008
+ elem.value = val;
2009
+ }
2010
+ return value;
2011
+ }
2012
+ }
2013
+ }
2014
+ },
2015
+ propFix: {
2016
+ tabindex: "tabIndex",
2017
+ readonly: "readOnly",
2018
+ "for": "htmlFor",
2019
+ "class": "className",
2020
+ maxlength: "maxLength",
2021
+ cellspacing: "cellSpacing",
2022
+ cellpadding: "cellPadding",
2023
+ rowspan: "rowSpan",
2024
+ colspan: "colSpan",
2025
+ usemap: "useMap",
2026
+ frameborder: "frameBorder",
2027
+ contenteditable: "contentEditable"
2028
+ },
2029
+ prop: function( elem, name, value ) {
2030
+ var ret, hooks, notxml,
2031
+ nType = elem.nodeType;
2032
+ // don't get/set properties on text, comment and attribute nodes
2033
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2034
+ return;
2035
+ }
2036
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2037
+ if ( notxml ) {
2038
+ // Fix name and attach hooks
2039
+ name = jQuery.propFix[ name ] || name;
2040
+ hooks = jQuery.propHooks[ name ];
2041
+ }
2042
+ if ( value !== undefined ) {
2043
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
2044
+ return ret;
2045
+ } else {
2046
+ return ( elem[ name ] = value );
2047
+ }
2048
+ } else {
2049
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
2050
+ return ret;
2051
+ } else {
2052
+ return elem[ name ];
2053
+ }
2054
+ }
2055
+ },
2056
+ propHooks: {
2057
+ tabIndex: {
2058
+ get: function( elem ) {
2059
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2060
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2061
+ var attributeNode = elem.getAttributeNode("tabindex");
2062
+ return attributeNode && attributeNode.specified ?
2063
+ parseInt( attributeNode.value, 10 ) :
2064
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2065
+ 0 :
2066
+ undefined;
2067
+ }
2068
+ }
2069
+ }
2070
+ });
2071
+ // Hook for boolean attributes
2072
+ boolHook = {
2073
+ get: function( elem, name ) {
2074
+ var
2075
+ // Use .prop to determine if this attribute is understood as boolean
2076
+ prop = jQuery.prop( elem, name ),
2077
+ // Fetch it accordingly
2078
+ attr = typeof prop === "boolean" && elem.getAttribute( name ),
2079
+ detail = typeof prop === "boolean" ?
2080
+ getSetInput && getSetAttribute ?
2081
+ attr != null :
2082
+ // oldIE fabricates an empty string for missing boolean attributes
2083
+ // and conflates checked/selected into attroperties
2084
+ ruseDefault.test( name ) ?
2085
+ elem[ jQuery.camelCase( "default-" + name ) ] :
2086
+ !!attr :
2087
+ // fetch an attribute node for properties not recognized as boolean
2088
+ elem.getAttributeNode( name );
2089
+ return detail && detail.value !== false ?
2090
+ name.toLowerCase() :
2091
+ undefined;
2092
+ },
2093
+ set: function( elem, value, name ) {
2094
+ if ( value === false ) {
2095
+ // Remove boolean attributes when set to false
2096
+ jQuery.removeAttr( elem, name );
2097
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
2098
+ // IE<8 needs the *property* name
2099
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
2100
+ // Use defaultChecked and defaultSelected for oldIE
2101
+ } else {
2102
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
2103
+ }
2104
+ return name;
2105
+ }
2106
+ };
2107
+ // fix oldIE value attroperty
2108
+ if ( !getSetInput || !getSetAttribute ) {
2109
+ jQuery.attrHooks.value = {
2110
+ get: function( elem, name ) {
2111
+ var ret = elem.getAttributeNode( name );
2112
+ return jQuery.nodeName( elem, "input" ) ?
2113
+ // Ignore the value *property* by using defaultValue
2114
+ elem.defaultValue :
2115
+ ret && ret.specified ? ret.value : undefined;
2116
+ },
2117
+ set: function( elem, value, name ) {
2118
+ if ( jQuery.nodeName( elem, "input" ) ) {
2119
+ // Does not return so that setAttribute is also used
2120
+ elem.defaultValue = value;
2121
+ } else {
2122
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
2123
+ return nodeHook && nodeHook.set( elem, value, name );
2124
+ }
2125
+ }
2126
+ };
2127
+ }
2128
+ // IE6/7 do not support getting/setting some attributes with get/setAttribute
2129
+ if ( !getSetAttribute ) {
2130
+ // Use this for any attribute in IE6/7
2131
+ // This fixes almost every IE6/7 issue
2132
+ nodeHook = jQuery.valHooks.button = {
2133
+ get: function( elem, name ) {
2134
+ var ret = elem.getAttributeNode( name );
2135
+ return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
2136
+ ret.value :
2137
+ undefined;
2138
+ },
2139
+ set: function( elem, value, name ) {
2140
+ // Set the existing or create a new attribute node
2141
+ var ret = elem.getAttributeNode( name );
2142
+ if ( !ret ) {
2143
+ elem.setAttributeNode(
2144
+ (ret = elem.ownerDocument.createAttribute( name ))
2145
+ );
2146
+ }
2147
+ ret.value = value += "";
2148
+ // Break association with cloned elements by also using setAttribute (#9646)
2149
+ return name === "value" || value === elem.getAttribute( name ) ?
2150
+ value :
2151
+ undefined;
2152
+ }
2153
+ };
2154
+ // Set contenteditable to false on removals(#10429)
2155
+ // Setting to empty string throws an error as an invalid value
2156
+ jQuery.attrHooks.contenteditable = {
2157
+ get: nodeHook.get,
2158
+ set: function( elem, value, name ) {
2159
+ nodeHook.set( elem, value === "" ? false : value, name );
2160
+ }
2161
+ };
2162
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
2163
+ // This is for removals
2164
+ jQuery.each([ "width", "height" ], function( i, name ) {
2165
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2166
+ set: function( elem, value ) {
2167
+ if ( value === "" ) {
2168
+ elem.setAttribute( name, "auto" );
2169
+ return value;
2170
+ }
2171
+ }
2172
+ });
2173
+ });
2174
+ }
2175
+ // Some attributes require a special call on IE
2176
+ // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2177
+ if ( !jQuery.support.hrefNormalized ) {
2178
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
2179
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2180
+ get: function( elem ) {
2181
+ var ret = elem.getAttribute( name, 2 );
2182
+ return ret == null ? undefined : ret;
2183
+ }
2184
+ });
2185
+ });
2186
+ // href/src property should get the full normalized URL (#10299/#12915)
2187
+ jQuery.each([ "href", "src" ], function( i, name ) {
2188
+ jQuery.propHooks[ name ] = {
2189
+ get: function( elem ) {
2190
+ return elem.getAttribute( name, 4 );
2191
+ }
2192
+ };
2193
+ });
2194
+ }
2195
+ if ( !jQuery.support.style ) {
2196
+ jQuery.attrHooks.style = {
2197
+ get: function( elem ) {
2198
+ // Return undefined in the case of empty string
2199
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
2200
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
2201
+ return elem.style.cssText || undefined;
2202
+ },
2203
+ set: function( elem, value ) {
2204
+ return ( elem.style.cssText = value + "" );
2205
+ }
2206
+ };
2207
+ }
2208
+ // Safari mis-reports the default selected property of an option
2209
+ // Accessing the parent's selectedIndex property fixes it
2210
+ if ( !jQuery.support.optSelected ) {
2211
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
2212
+ get: function( elem ) {
2213
+ var parent = elem.parentNode;
2214
+ if ( parent ) {
2215
+ parent.selectedIndex;
2216
+ // Make sure that it also works with optgroups, see #5701
2217
+ if ( parent.parentNode ) {
2218
+ parent.parentNode.selectedIndex;
2219
+ }
2220
+ }
2221
+ return null;
2222
+ }
2223
+ });
2224
+ }
2225
+ // IE6/7 call enctype encoding
2226
+ if ( !jQuery.support.enctype ) {
2227
+ jQuery.propFix.enctype = "encoding";
2228
+ }
2229
+ // Radios and checkboxes getter/setter
2230
+ if ( !jQuery.support.checkOn ) {
2231
+ jQuery.each([ "radio", "checkbox" ], function() {
2232
+ jQuery.valHooks[ this ] = {
2233
+ get: function( elem ) {
2234
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
2235
+ return elem.getAttribute("value") === null ? "on" : elem.value;
2236
+ }
2237
+ };
2238
+ });
2239
+ }
2240
+ jQuery.each([ "radio", "checkbox" ], function() {
2241
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
2242
+ set: function( elem, value ) {
2243
+ if ( jQuery.isArray( value ) ) {
2244
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
2245
+ }
2246
+ }
2247
+ });
2248
+ });
2249
+ var rformElems = /^(?:input|select|textarea)$/i,
2250
+ rkeyEvent = /^key/,
2251
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
2252
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
2253
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
2254
+ function returnTrue() {
2255
+ return true;
2256
+ }
2257
+ function returnFalse() {
2258
+ return false;
2259
+ }
2260
+ /*
2261
+ * Helper functions for managing events -- not part of the public interface.
2262
+ * Props to Dean Edwards' addEvent library for many of the ideas.
2263
+ */
2264
+ jQuery.event = {
2265
+ global: {},
2266
+ add: function( elem, types, handler, data, selector ) {
2267
+ var tmp, events, t, handleObjIn,
2268
+ special, eventHandle, handleObj,
2269
+ handlers, type, namespaces, origType,
2270
+ elemData = jQuery._data( elem );
2271
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
2272
+ if ( !elemData ) {
2273
+ return;
2274
+ }
2275
+ // Caller can pass in an object of custom data in lieu of the handler
2276
+ if ( handler.handler ) {
2277
+ handleObjIn = handler;
2278
+ handler = handleObjIn.handler;
2279
+ selector = handleObjIn.selector;
2280
+ }
2281
+ // Make sure that the handler has a unique ID, used to find/remove it later
2282
+ if ( !handler.guid ) {
2283
+ handler.guid = jQuery.guid++;
2284
+ }
2285
+ // Init the element's event structure and main handler, if this is the first
2286
+ if ( !(events = elemData.events) ) {
2287
+ events = elemData.events = {};
2288
+ }
2289
+ if ( !(eventHandle = elemData.handle) ) {
2290
+ eventHandle = elemData.handle = function( e ) {
2291
+ // Discard the second event of a jQuery.event.trigger() and
2292
+ // when an event is called after a page has unloaded
2293
+ return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
2294
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
2295
+ undefined;
2296
+ };
2297
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
2298
+ eventHandle.elem = elem;
2299
+ }
2300
+ // Handle multiple events separated by a space
2301
+ // jQuery(...).bind("mouseover mouseout", fn);
2302
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
2303
+ t = types.length;
2304
+ while ( t-- ) {
2305
+ tmp = rtypenamespace.exec( types[t] ) || [];
2306
+ type = origType = tmp[1];
2307
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
2308
+ // If event changes its type, use the special event handlers for the changed type
2309
+ special = jQuery.event.special[ type ] || {};
2310
+ // If selector defined, determine special event api type, otherwise given type
2311
+ type = ( selector ? special.delegateType : special.bindType ) || type;
2312
+ // Update special based on newly reset type
2313
+ special = jQuery.event.special[ type ] || {};
2314
+ // handleObj is passed to all event handlers
2315
+ handleObj = jQuery.extend({
2316
+ type: type,
2317
+ origType: origType,
2318
+ data: data,
2319
+ handler: handler,
2320
+ guid: handler.guid,
2321
+ selector: selector,
2322
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
2323
+ namespace: namespaces.join(".")
2324
+ }, handleObjIn );
2325
+ // Init the event handler queue if we're the first
2326
+ if ( !(handlers = events[ type ]) ) {
2327
+ handlers = events[ type ] = [];
2328
+ handlers.delegateCount = 0;
2329
+ // Only use addEventListener/attachEvent if the special events handler returns false
2330
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
2331
+ // Bind the global event handler to the element
2332
+ if ( elem.addEventListener ) {
2333
+ elem.addEventListener( type, eventHandle, false );
2334
+ } else if ( elem.attachEvent ) {
2335
+ elem.attachEvent( "on" + type, eventHandle );
2336
+ }
2337
+ }
2338
+ }
2339
+ if ( special.add ) {
2340
+ special.add.call( elem, handleObj );
2341
+ if ( !handleObj.handler.guid ) {
2342
+ handleObj.handler.guid = handler.guid;
2343
+ }
2344
+ }
2345
+ // Add to the element's handler list, delegates in front
2346
+ if ( selector ) {
2347
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
2348
+ } else {
2349
+ handlers.push( handleObj );
2350
+ }
2351
+ // Keep track of which events have ever been used, for event optimization
2352
+ jQuery.event.global[ type ] = true;
2353
+ }
2354
+ // Nullify elem to prevent memory leaks in IE
2355
+ elem = null;
2356
+ },
2357
+ // Detach an event or set of events from an element
2358
+ remove: function( elem, types, handler, selector, mappedTypes ) {
2359
+ var j, handleObj, tmp,
2360
+ origCount, t, events,
2361
+ special, handlers, type,
2362
+ namespaces, origType,
2363
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
2364
+ if ( !elemData || !(events = elemData.events) ) {
2365
+ return;
2366
+ }
2367
+ // Once for each type.namespace in types; type may be omitted
2368
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
2369
+ t = types.length;
2370
+ while ( t-- ) {
2371
+ tmp = rtypenamespace.exec( types[t] ) || [];
2372
+ type = origType = tmp[1];
2373
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
2374
+ // Unbind all events (on this namespace, if provided) for the element
2375
+ if ( !type ) {
2376
+ for ( type in events ) {
2377
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
2378
+ }
2379
+ continue;
2380
+ }
2381
+ special = jQuery.event.special[ type ] || {};
2382
+ type = ( selector ? special.delegateType : special.bindType ) || type;
2383
+ handlers = events[ type ] || [];
2384
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
2385
+ // Remove matching events
2386
+ origCount = j = handlers.length;
2387
+ while ( j-- ) {
2388
+ handleObj = handlers[ j ];
2389
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
2390
+ ( !handler || handler.guid === handleObj.guid ) &&
2391
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
2392
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
2393
+ handlers.splice( j, 1 );
2394
+ if ( handleObj.selector ) {
2395
+ handlers.delegateCount--;
2396
+ }
2397
+ if ( special.remove ) {
2398
+ special.remove.call( elem, handleObj );
2399
+ }
2400
+ }
2401
+ }
2402
+ // Remove generic event handler if we removed something and no more handlers exist
2403
+ // (avoids potential for endless recursion during removal of special event handlers)
2404
+ if ( origCount && !handlers.length ) {
2405
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
2406
+ jQuery.removeEvent( elem, type, elemData.handle );
2407
+ }
2408
+ delete events[ type ];
2409
+ }
2410
+ }
2411
+ // Remove the expando if it's no longer used
2412
+ if ( jQuery.isEmptyObject( events ) ) {
2413
+ delete elemData.handle;
2414
+ // removeData also checks for emptiness and clears the expando if empty
2415
+ // so use it instead of delete
2416
+ jQuery._removeData( elem, "events" );
2417
+ }
2418
+ },
2419
+ trigger: function( event, data, elem, onlyHandlers ) {
2420
+ var handle, ontype, cur,
2421
+ bubbleType, special, tmp, i,
2422
+ eventPath = [ elem || document ],
2423
+ type = core_hasOwn.call( event, "type" ) ? event.type : event,
2424
+ namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
2425
+ cur = tmp = elem = elem || document;
2426
+ // Don't do events on text and comment nodes
2427
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
2428
+ return;
2429
+ }
2430
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
2431
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
2432
+ return;
2433
+ }
2434
+ if ( type.indexOf(".") >= 0 ) {
2435
+ // Namespaced trigger; create a regexp to match event type in handle()
2436
+ namespaces = type.split(".");
2437
+ type = namespaces.shift();
2438
+ namespaces.sort();
2439
+ }
2440
+ ontype = type.indexOf(":") < 0 && "on" + type;
2441
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
2442
+ event = event[ jQuery.expando ] ?
2443
+ event :
2444
+ new jQuery.Event( type, typeof event === "object" && event );
2445
+ event.isTrigger = true;
2446
+ event.namespace = namespaces.join(".");
2447
+ event.namespace_re = event.namespace ?
2448
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
2449
+ null;
2450
+ // Clean up the event in case it is being reused
2451
+ event.result = undefined;
2452
+ if ( !event.target ) {
2453
+ event.target = elem;
2454
+ }
2455
+ // Clone any incoming data and prepend the event, creating the handler arg list
2456
+ data = data == null ?
2457
+ [ event ] :
2458
+ jQuery.makeArray( data, [ event ] );
2459
+ // Allow special events to draw outside the lines
2460
+ special = jQuery.event.special[ type ] || {};
2461
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
2462
+ return;
2463
+ }
2464
+ // Determine event propagation path in advance, per W3C events spec (#9951)
2465
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
2466
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
2467
+ bubbleType = special.delegateType || type;
2468
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
2469
+ cur = cur.parentNode;
2470
+ }
2471
+ for ( ; cur; cur = cur.parentNode ) {
2472
+ eventPath.push( cur );
2473
+ tmp = cur;
2474
+ }
2475
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
2476
+ if ( tmp === (elem.ownerDocument || document) ) {
2477
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
2478
+ }
2479
+ }
2480
+ // Fire handlers on the event path
2481
+ i = 0;
2482
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
2483
+ event.type = i > 1 ?
2484
+ bubbleType :
2485
+ special.bindType || type;
2486
+ // jQuery handler
2487
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
2488
+ if ( handle ) {
2489
+ handle.apply( cur, data );
2490
+ }
2491
+ // Native handler
2492
+ handle = ontype && cur[ ontype ];
2493
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
2494
+ event.preventDefault();
2495
+ }
2496
+ }
2497
+ event.type = type;
2498
+ // If nobody prevented the default action, do it now
2499
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
2500
+ if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
2501
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
2502
+ // Call a native DOM method on the target with the same name name as the event.
2503
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
2504
+ // Don't do default actions on window, that's where global variables be (#6170)
2505
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
2506
+ // Don't re-trigger an onFOO event when we call its FOO() method
2507
+ tmp = elem[ ontype ];
2508
+ if ( tmp ) {
2509
+ elem[ ontype ] = null;
2510
+ }
2511
+ // Prevent re-triggering of the same event, since we already bubbled it above
2512
+ jQuery.event.triggered = type;
2513
+ try {
2514
+ elem[ type ]();
2515
+ } catch ( e ) {
2516
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
2517
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
2518
+ }
2519
+ jQuery.event.triggered = undefined;
2520
+ if ( tmp ) {
2521
+ elem[ ontype ] = tmp;
2522
+ }
2523
+ }
2524
+ }
2525
+ }
2526
+ return event.result;
2527
+ },
2528
+ dispatch: function( event ) {
2529
+ // Make a writable jQuery.Event from the native event object
2530
+ event = jQuery.event.fix( event );
2531
+ var i, ret, handleObj, matched, j,
2532
+ handlerQueue = [],
2533
+ args = core_slice.call( arguments ),
2534
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
2535
+ special = jQuery.event.special[ event.type ] || {};
2536
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
2537
+ args[0] = event;
2538
+ event.delegateTarget = this;
2539
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
2540
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
2541
+ return;
2542
+ }
2543
+ // Determine handlers
2544
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
2545
+ // Run delegates first; they may want to stop propagation beneath us
2546
+ i = 0;
2547
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
2548
+ event.currentTarget = matched.elem;
2549
+ j = 0;
2550
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
2551
+ // Triggered event must either 1) have no namespace, or
2552
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
2553
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
2554
+ event.handleObj = handleObj;
2555
+ event.data = handleObj.data;
2556
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
2557
+ .apply( matched.elem, args );
2558
+ if ( ret !== undefined ) {
2559
+ if ( (event.result = ret) === false ) {
2560
+ event.preventDefault();
2561
+ event.stopPropagation();
2562
+ }
2563
+ }
2564
+ }
2565
+ }
2566
+ }
2567
+ // Call the postDispatch hook for the mapped type
2568
+ if ( special.postDispatch ) {
2569
+ special.postDispatch.call( this, event );
2570
+ }
2571
+ return event.result;
2572
+ },
2573
+ handlers: function( event, handlers ) {
2574
+ var sel, handleObj, matches, i,
2575
+ handlerQueue = [],
2576
+ delegateCount = handlers.delegateCount,
2577
+ cur = event.target;
2578
+ // Find delegate handlers
2579
+ // Black-hole SVG <use> instance trees (#13180)
2580
+ // Avoid non-left-click bubbling in Firefox (#3861)
2581
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
2582
+ for ( ; cur != this; cur = cur.parentNode || this ) {
2583
+ // Don't check non-elements (#13208)
2584
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
2585
+ if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
2586
+ matches = [];
2587
+ for ( i = 0; i < delegateCount; i++ ) {
2588
+ handleObj = handlers[ i ];
2589
+ // Don't conflict with Object.prototype properties (#13203)
2590
+ sel = handleObj.selector + " ";
2591
+ if ( matches[ sel ] === undefined ) {
2592
+ matches[ sel ] = handleObj.needsContext ?
2593
+ jQuery( sel, this ).index( cur ) >= 0 :
2594
+ jQuery.find( sel, this, null, [ cur ] ).length;
2595
+ }
2596
+ if ( matches[ sel ] ) {
2597
+ matches.push( handleObj );
2598
+ }
2599
+ }
2600
+ if ( matches.length ) {
2601
+ handlerQueue.push({ elem: cur, handlers: matches });
2602
+ }
2603
+ }
2604
+ }
2605
+ }
2606
+ // Add the remaining (directly-bound) handlers
2607
+ if ( delegateCount < handlers.length ) {
2608
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
2609
+ }
2610
+ return handlerQueue;
2611
+ },
2612
+ fix: function( event ) {
2613
+ if ( event[ jQuery.expando ] ) {
2614
+ return event;
2615
+ }
2616
+ // Create a writable copy of the event object and normalize some properties
2617
+ var i, prop, copy,
2618
+ type = event.type,
2619
+ originalEvent = event,
2620
+ fixHook = this.fixHooks[ type ];
2621
+ if ( !fixHook ) {
2622
+ this.fixHooks[ type ] = fixHook =
2623
+ rmouseEvent.test( type ) ? this.mouseHooks :
2624
+ rkeyEvent.test( type ) ? this.keyHooks :
2625
+ {};
2626
+ }
2627
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
2628
+ event = new jQuery.Event( originalEvent );
2629
+ i = copy.length;
2630
+ while ( i-- ) {
2631
+ prop = copy[ i ];
2632
+ event[ prop ] = originalEvent[ prop ];
2633
+ }
2634
+ // Support: IE<9
2635
+ // Fix target property (#1925)
2636
+ if ( !event.target ) {
2637
+ event.target = originalEvent.srcElement || document;
2638
+ }
2639
+ // Support: Chrome 23+, Safari?
2640
+ // Target should not be a text node (#504, #13143)
2641
+ if ( event.target.nodeType === 3 ) {
2642
+ event.target = event.target.parentNode;
2643
+ }
2644
+ // Support: IE<9
2645
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
2646
+ event.metaKey = !!event.metaKey;
2647
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
2648
+ },
2649
+ // Includes some event props shared by KeyEvent and MouseEvent
2650
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
2651
+ fixHooks: {},
2652
+ keyHooks: {
2653
+ props: "char charCode key keyCode".split(" "),
2654
+ filter: function( event, original ) {
2655
+ // Add which for key events
2656
+ if ( event.which == null ) {
2657
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
2658
+ }
2659
+ return event;
2660
+ }
2661
+ },
2662
+ mouseHooks: {
2663
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
2664
+ filter: function( event, original ) {
2665
+ var body, eventDoc, doc,
2666
+ button = original.button,
2667
+ fromElement = original.fromElement;
2668
+ // Calculate pageX/Y if missing and clientX/Y available
2669
+ if ( event.pageX == null && original.clientX != null ) {
2670
+ eventDoc = event.target.ownerDocument || document;
2671
+ doc = eventDoc.documentElement;
2672
+ body = eventDoc.body;
2673
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
2674
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
2675
+ }
2676
+ // Add relatedTarget, if necessary
2677
+ if ( !event.relatedTarget && fromElement ) {
2678
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
2679
+ }
2680
+ // Add which for click: 1 === left; 2 === middle; 3 === right
2681
+ // Note: button is not normalized, so don't use it
2682
+ if ( !event.which && button !== undefined ) {
2683
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
2684
+ }
2685
+ return event;
2686
+ }
2687
+ },
2688
+ special: {
2689
+ load: {
2690
+ // Prevent triggered image.load events from bubbling to window.load
2691
+ noBubble: true
2692
+ },
2693
+ click: {
2694
+ // For checkbox, fire native event so checked state will be right
2695
+ trigger: function() {
2696
+ if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
2697
+ this.click();
2698
+ return false;
2699
+ }
2700
+ }
2701
+ },
2702
+ focus: {
2703
+ // Fire native event if possible so blur/focus sequence is correct
2704
+ trigger: function() {
2705
+ if ( this !== document.activeElement && this.focus ) {
2706
+ try {
2707
+ this.focus();
2708
+ return false;
2709
+ } catch ( e ) {
2710
+ // Support: IE<9
2711
+ // If we error on focus to hidden element (#1486, #12518),
2712
+ // let .trigger() run the handlers
2713
+ }
2714
+ }
2715
+ },
2716
+ delegateType: "focusin"
2717
+ },
2718
+ blur: {
2719
+ trigger: function() {
2720
+ if ( this === document.activeElement && this.blur ) {
2721
+ this.blur();
2722
+ return false;
2723
+ }
2724
+ },
2725
+ delegateType: "focusout"
2726
+ },
2727
+ beforeunload: {
2728
+ postDispatch: function( event ) {
2729
+ // Even when returnValue equals to undefined Firefox will still show alert
2730
+ if ( event.result !== undefined ) {
2731
+ event.originalEvent.returnValue = event.result;
2732
+ }
2733
+ }
2734
+ }
2735
+ },
2736
+ simulate: function( type, elem, event, bubble ) {
2737
+ // Piggyback on a donor event to simulate a different one.
2738
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
2739
+ // simulated event prevents default then we do the same on the donor.
2740
+ var e = jQuery.extend(
2741
+ new jQuery.Event(),
2742
+ event,
2743
+ { type: type,
2744
+ isSimulated: true,
2745
+ originalEvent: {}
2746
+ }
2747
+ );
2748
+ if ( bubble ) {
2749
+ jQuery.event.trigger( e, null, elem );
2750
+ } else {
2751
+ jQuery.event.dispatch.call( elem, e );
2752
+ }
2753
+ if ( e.isDefaultPrevented() ) {
2754
+ event.preventDefault();
2755
+ }
2756
+ }
2757
+ };
2758
+ jQuery.removeEvent = document.removeEventListener ?
2759
+ function( elem, type, handle ) {
2760
+ if ( elem.removeEventListener ) {
2761
+ elem.removeEventListener( type, handle, false );
2762
+ }
2763
+ } :
2764
+ function( elem, type, handle ) {
2765
+ var name = "on" + type;
2766
+ if ( elem.detachEvent ) {
2767
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
2768
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
2769
+ if ( typeof elem[ name ] === core_strundefined ) {
2770
+ elem[ name ] = null;
2771
+ }
2772
+ elem.detachEvent( name, handle );
2773
+ }
2774
+ };
2775
+ jQuery.Event = function( src, props ) {
2776
+ // Allow instantiation without the 'new' keyword
2777
+ if ( !(this instanceof jQuery.Event) ) {
2778
+ return new jQuery.Event( src, props );
2779
+ }
2780
+ // Event object
2781
+ if ( src && src.type ) {
2782
+ this.originalEvent = src;
2783
+ this.type = src.type;
2784
+ // Events bubbling up the document may have been marked as prevented
2785
+ // by a handler lower down the tree; reflect the correct value.
2786
+ this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
2787
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
2788
+ // Event type
2789
+ } else {
2790
+ this.type = src;
2791
+ }
2792
+ // Put explicitly provided properties onto the event object
2793
+ if ( props ) {
2794
+ jQuery.extend( this, props );
2795
+ }
2796
+ // Create a timestamp if incoming event doesn't have one
2797
+ this.timeStamp = src && src.timeStamp || jQuery.now();
2798
+ // Mark it as fixed
2799
+ this[ jQuery.expando ] = true;
2800
+ };
2801
+ // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
2802
+ // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
2803
+ jQuery.Event.prototype = {
2804
+ isDefaultPrevented: returnFalse,
2805
+ isPropagationStopped: returnFalse,
2806
+ isImmediatePropagationStopped: returnFalse,
2807
+ preventDefault: function() {
2808
+ var e = this.originalEvent;
2809
+ this.isDefaultPrevented = returnTrue;
2810
+ if ( !e ) {
2811
+ return;
2812
+ }
2813
+ // If preventDefault exists, run it on the original event
2814
+ if ( e.preventDefault ) {
2815
+ e.preventDefault();
2816
+ // Support: IE
2817
+ // Otherwise set the returnValue property of the original event to false
2818
+ } else {
2819
+ e.returnValue = false;
2820
+ }
2821
+ },
2822
+ stopPropagation: function() {
2823
+ var e = this.originalEvent;
2824
+ this.isPropagationStopped = returnTrue;
2825
+ if ( !e ) {
2826
+ return;
2827
+ }
2828
+ // If stopPropagation exists, run it on the original event
2829
+ if ( e.stopPropagation ) {
2830
+ e.stopPropagation();
2831
+ }
2832
+ // Support: IE
2833
+ // Set the cancelBubble property of the original event to true
2834
+ e.cancelBubble = true;
2835
+ },
2836
+ stopImmediatePropagation: function() {
2837
+ this.isImmediatePropagationStopped = returnTrue;
2838
+ this.stopPropagation();
2839
+ }
2840
+ };
2841
+ // Create mouseenter/leave events using mouseover/out and event-time checks
2842
+ jQuery.each({
2843
+ mouseenter: "mouseover",
2844
+ mouseleave: "mouseout"
2845
+ }, function( orig, fix ) {
2846
+ jQuery.event.special[ orig ] = {
2847
+ delegateType: fix,
2848
+ bindType: fix,
2849
+ handle: function( event ) {
2850
+ var ret,
2851
+ target = this,
2852
+ related = event.relatedTarget,
2853
+ handleObj = event.handleObj;
2854
+ // For mousenter/leave call the handler if related is outside the target.
2855
+ // NB: No relatedTarget if the mouse left/entered the browser window
2856
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
2857
+ event.type = handleObj.origType;
2858
+ ret = handleObj.handler.apply( this, arguments );
2859
+ event.type = fix;
2860
+ }
2861
+ return ret;
2862
+ }
2863
+ };
2864
+ });
2865
+ // IE submit delegation
2866
+ if ( !jQuery.support.submitBubbles ) {
2867
+ jQuery.event.special.submit = {
2868
+ setup: function() {
2869
+ // Only need this for delegated form submit events
2870
+ if ( jQuery.nodeName( this, "form" ) ) {
2871
+ return false;
2872
+ }
2873
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
2874
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
2875
+ // Node name check avoids a VML-related crash in IE (#9807)
2876
+ var elem = e.target,
2877
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
2878
+ if ( form && !jQuery._data( form, "submitBubbles" ) ) {
2879
+ jQuery.event.add( form, "submit._submit", function( event ) {
2880
+ event._submit_bubble = true;
2881
+ });
2882
+ jQuery._data( form, "submitBubbles", true );
2883
+ }
2884
+ });
2885
+ // return undefined since we don't need an event listener
2886
+ },
2887
+ postDispatch: function( event ) {
2888
+ // If form was submitted by the user, bubble the event up the tree
2889
+ if ( event._submit_bubble ) {
2890
+ delete event._submit_bubble;
2891
+ if ( this.parentNode && !event.isTrigger ) {
2892
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
2893
+ }
2894
+ }
2895
+ },
2896
+ teardown: function() {
2897
+ // Only need this for delegated form submit events
2898
+ if ( jQuery.nodeName( this, "form" ) ) {
2899
+ return false;
2900
+ }
2901
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
2902
+ jQuery.event.remove( this, "._submit" );
2903
+ }
2904
+ };
2905
+ }
2906
+ // IE change delegation and checkbox/radio fix
2907
+ if ( !jQuery.support.changeBubbles ) {
2908
+ jQuery.event.special.change = {
2909
+ setup: function() {
2910
+ if ( rformElems.test( this.nodeName ) ) {
2911
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
2912
+ // after a propertychange. Eat the blur-change in special.change.handle.
2913
+ // This still fires onchange a second time for check/radio after blur.
2914
+ if ( this.type === "checkbox" || this.type === "radio" ) {
2915
+ jQuery.event.add( this, "propertychange._change", function( event ) {
2916
+ if ( event.originalEvent.propertyName === "checked" ) {
2917
+ this._just_changed = true;
2918
+ }
2919
+ });
2920
+ jQuery.event.add( this, "click._change", function( event ) {
2921
+ if ( this._just_changed && !event.isTrigger ) {
2922
+ this._just_changed = false;
2923
+ }
2924
+ // Allow triggered, simulated change events (#11500)
2925
+ jQuery.event.simulate( "change", this, event, true );
2926
+ });
2927
+ }
2928
+ return false;
2929
+ }
2930
+ // Delegated event; lazy-add a change handler on descendant inputs
2931
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
2932
+ var elem = e.target;
2933
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
2934
+ jQuery.event.add( elem, "change._change", function( event ) {
2935
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
2936
+ jQuery.event.simulate( "change", this.parentNode, event, true );
2937
+ }
2938
+ });
2939
+ jQuery._data( elem, "changeBubbles", true );
2940
+ }
2941
+ });
2942
+ },
2943
+ handle: function( event ) {
2944
+ var elem = event.target;
2945
+ // Swallow native change events from checkbox/radio, we already triggered them above
2946
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
2947
+ return event.handleObj.handler.apply( this, arguments );
2948
+ }
2949
+ },
2950
+ teardown: function() {
2951
+ jQuery.event.remove( this, "._change" );
2952
+ return !rformElems.test( this.nodeName );
2953
+ }
2954
+ };
2955
+ }
2956
+ // Create "bubbling" focus and blur events
2957
+ if ( !jQuery.support.focusinBubbles ) {
2958
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
2959
+ // Attach a single capturing handler while someone wants focusin/focusout
2960
+ var attaches = 0,
2961
+ handler = function( event ) {
2962
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
2963
+ };
2964
+ jQuery.event.special[ fix ] = {
2965
+ setup: function() {
2966
+ if ( attaches++ === 0 ) {
2967
+ document.addEventListener( orig, handler, true );
2968
+ }
2969
+ },
2970
+ teardown: function() {
2971
+ if ( --attaches === 0 ) {
2972
+ document.removeEventListener( orig, handler, true );
2973
+ }
2974
+ }
2975
+ };
2976
+ });
2977
+ }
2978
+ jQuery.fn.extend({
2979
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
2980
+ var type, origFn;
2981
+ // Types can be a map of types/handlers
2982
+ if ( typeof types === "object" ) {
2983
+ // ( types-Object, selector, data )
2984
+ if ( typeof selector !== "string" ) {
2985
+ // ( types-Object, data )
2986
+ data = data || selector;
2987
+ selector = undefined;
2988
+ }
2989
+ for ( type in types ) {
2990
+ this.on( type, selector, data, types[ type ], one );
2991
+ }
2992
+ return this;
2993
+ }
2994
+ if ( data == null && fn == null ) {
2995
+ // ( types, fn )
2996
+ fn = selector;
2997
+ data = selector = undefined;
2998
+ } else if ( fn == null ) {
2999
+ if ( typeof selector === "string" ) {
3000
+ // ( types, selector, fn )
3001
+ fn = data;
3002
+ data = undefined;
3003
+ } else {
3004
+ // ( types, data, fn )
3005
+ fn = data;
3006
+ data = selector;
3007
+ selector = undefined;
3008
+ }
3009
+ }
3010
+ if ( fn === false ) {
3011
+ fn = returnFalse;
3012
+ } else if ( !fn ) {
3013
+ return this;
3014
+ }
3015
+ if ( one === 1 ) {
3016
+ origFn = fn;
3017
+ fn = function( event ) {
3018
+ // Can use an empty set, since event contains the info
3019
+ jQuery().off( event );
3020
+ return origFn.apply( this, arguments );
3021
+ };
3022
+ // Use same guid so caller can remove using origFn
3023
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
3024
+ }
3025
+ return this.each( function() {
3026
+ jQuery.event.add( this, types, fn, data, selector );
3027
+ });
3028
+ },
3029
+ one: function( types, selector, data, fn ) {
3030
+ return this.on( types, selector, data, fn, 1 );
3031
+ },
3032
+ off: function( types, selector, fn ) {
3033
+ var handleObj, type;
3034
+ if ( types && types.preventDefault && types.handleObj ) {
3035
+ // ( event ) dispatched jQuery.Event
3036
+ handleObj = types.handleObj;
3037
+ jQuery( types.delegateTarget ).off(
3038
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
3039
+ handleObj.selector,
3040
+ handleObj.handler
3041
+ );
3042
+ return this;
3043
+ }
3044
+ if ( typeof types === "object" ) {
3045
+ // ( types-object [, selector] )
3046
+ for ( type in types ) {
3047
+ this.off( type, selector, types[ type ] );
3048
+ }
3049
+ return this;
3050
+ }
3051
+ if ( selector === false || typeof selector === "function" ) {
3052
+ // ( types [, fn] )
3053
+ fn = selector;
3054
+ selector = undefined;
3055
+ }
3056
+ if ( fn === false ) {
3057
+ fn = returnFalse;
3058
+ }
3059
+ return this.each(function() {
3060
+ jQuery.event.remove( this, types, fn, selector );
3061
+ });
3062
+ },
3063
+ bind: function( types, data, fn ) {
3064
+ return this.on( types, null, data, fn );
3065
+ },
3066
+ unbind: function( types, fn ) {
3067
+ return this.off( types, null, fn );
3068
+ },
3069
+ delegate: function( selector, types, data, fn ) {
3070
+ return this.on( types, selector, data, fn );
3071
+ },
3072
+ undelegate: function( selector, types, fn ) {
3073
+ // ( namespace ) or ( selector, types [, fn] )
3074
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
3075
+ },
3076
+ trigger: function( type, data ) {
3077
+ return this.each(function() {
3078
+ jQuery.event.trigger( type, data, this );
3079
+ });
3080
+ },
3081
+ triggerHandler: function( type, data ) {
3082
+ var elem = this[0];
3083
+ if ( elem ) {
3084
+ return jQuery.event.trigger( type, data, elem, true );
3085
+ }
3086
+ }
3087
+ });
3088
+ /*!
3089
+ * Sizzle CSS Selector Engine
3090
+ * Copyright 2012 jQuery Foundation and other contributors
3091
+ * Released under the MIT license
3092
+ * http://sizzlejs.com/
3093
+ */
3094
+ (function( window, undefined ) {
3095
+ var i,
3096
+ cachedruns,
3097
+ Expr,
3098
+ getText,
3099
+ isXML,
3100
+ compile,
3101
+ hasDuplicate,
3102
+ outermostContext,
3103
+ // Local document vars
3104
+ setDocument,
3105
+ document,
3106
+ docElem,
3107
+ documentIsXML,
3108
+ rbuggyQSA,
3109
+ rbuggyMatches,
3110
+ matches,
3111
+ contains,
3112
+ sortOrder,
3113
+ // Instance-specific data
3114
+ expando = "sizzle" + -(new Date()),
3115
+ preferredDoc = window.document,
3116
+ support = {},
3117
+ dirruns = 0,
3118
+ done = 0,
3119
+ classCache = createCache(),
3120
+ tokenCache = createCache(),
3121
+ compilerCache = createCache(),
3122
+ // General-purpose constants
3123
+ strundefined = typeof undefined,
3124
+ MAX_NEGATIVE = 1 << 31,
3125
+ // Array methods
3126
+ arr = [],
3127
+ pop = arr.pop,
3128
+ push = arr.push,
3129
+ slice = arr.slice,
3130
+ // Use a stripped-down indexOf if we can't use a native one
3131
+ indexOf = arr.indexOf || function( elem ) {
3132
+ var i = 0,
3133
+ len = this.length;
3134
+ for ( ; i < len; i++ ) {
3135
+ if ( this[i] === elem ) {
3136
+ return i;
3137
+ }
3138
+ }
3139
+ return -1;
3140
+ },
3141
+ // Regular expressions
3142
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
3143
+ whitespace = "[\\x20\\t\\r\\n\\f]",
3144
+ // http://www.w3.org/TR/css3-syntax/#characters
3145
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
3146
+ // Loosely modeled on CSS identifier characters
3147
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
3148
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
3149
+ identifier = characterEncoding.replace( "w", "w#" ),
3150
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
3151
+ operators = "([*^$|!~]?=)",
3152
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
3153
+ "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
3154
+ // Prefer arguments quoted,
3155
+ // then not containing pseudos/brackets,
3156
+ // then attribute selectors/non-parenthetical expressions,
3157
+ // then anything else
3158
+ // These preferences are here to reduce the number of selectors
3159
+ // needing tokenize in the PSEUDO preFilter
3160
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
3161
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
3162
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
3163
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
3164
+ rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
3165
+ rpseudo = new RegExp( pseudos ),
3166
+ ridentifier = new RegExp( "^" + identifier + "$" ),
3167
+ matchExpr = {
3168
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
3169
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
3170
+ "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
3171
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
3172
+ "ATTR": new RegExp( "^" + attributes ),
3173
+ "PSEUDO": new RegExp( "^" + pseudos ),
3174
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
3175
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
3176
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
3177
+ // For use in libraries implementing .is()
3178
+ // We use this for POS matching in `select`
3179
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
3180
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
3181
+ },
3182
+ rsibling = /[\x20\t\r\n\f]*[+~]/,
3183
+ rnative = /^[^{]+\{\s*\[native code/,
3184
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
3185
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
3186
+ rinputs = /^(?:input|select|textarea|button)$/i,
3187
+ rheader = /^h\d$/i,
3188
+ rescape = /'|\\/g,
3189
+ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
3190
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
3191
+ runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
3192
+ funescape = function( _, escaped ) {
3193
+ var high = "0x" + escaped - 0x10000;
3194
+ // NaN means non-codepoint
3195
+ return high !== high ?
3196
+ escaped :
3197
+ // BMP codepoint
3198
+ high < 0 ?
3199
+ String.fromCharCode( high + 0x10000 ) :
3200
+ // Supplemental Plane codepoint (surrogate pair)
3201
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
3202
+ };
3203
+ // Use a stripped-down slice if we can't use a native one
3204
+ try {
3205
+ slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
3206
+ } catch ( e ) {
3207
+ slice = function( i ) {
3208
+ var elem,
3209
+ results = [];
3210
+ while ( (elem = this[i++]) ) {
3211
+ results.push( elem );
3212
+ }
3213
+ return results;
3214
+ };
3215
+ }
3216
+ /**
3217
+ * For feature detection
3218
+ * @param {Function} fn The function to test for native support
3219
+ */
3220
+ function isNative( fn ) {
3221
+ return rnative.test( fn + "" );
3222
+ }
3223
+ /**
3224
+ * Create key-value caches of limited size
3225
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
3226
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
3227
+ * deleting the oldest entry
3228
+ */
3229
+ function createCache() {
3230
+ var cache,
3231
+ keys = [];
3232
+ return (cache = function( key, value ) {
3233
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
3234
+ if ( keys.push( key += " " ) > Expr.cacheLength ) {
3235
+ // Only keep the most recent entries
3236
+ delete cache[ keys.shift() ];
3237
+ }
3238
+ return (cache[ key ] = value);
3239
+ });
3240
+ }
3241
+ /**
3242
+ * Mark a function for special use by Sizzle
3243
+ * @param {Function} fn The function to mark
3244
+ */
3245
+ function markFunction( fn ) {
3246
+ fn[ expando ] = true;
3247
+ return fn;
3248
+ }
3249
+ /**
3250
+ * Support testing using an element
3251
+ * @param {Function} fn Passed the created div and expects a boolean result
3252
+ */
3253
+ function assert( fn ) {
3254
+ var div = document.createElement("div");
3255
+ try {
3256
+ return fn( div );
3257
+ } catch (e) {
3258
+ return false;
3259
+ } finally {
3260
+ // release memory in IE
3261
+ div = null;
3262
+ }
3263
+ }
3264
+ function Sizzle( selector, context, results, seed ) {
3265
+ var match, elem, m, nodeType,
3266
+ // QSA vars
3267
+ i, groups, old, nid, newContext, newSelector;
3268
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
3269
+ setDocument( context );
3270
+ }
3271
+ context = context || document;
3272
+ results = results || [];
3273
+ if ( !selector || typeof selector !== "string" ) {
3274
+ return results;
3275
+ }
3276
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
3277
+ return [];
3278
+ }
3279
+ if ( !documentIsXML && !seed ) {
3280
+ // Shortcuts
3281
+ if ( (match = rquickExpr.exec( selector )) ) {
3282
+ // Speed-up: Sizzle("#ID")
3283
+ if ( (m = match[1]) ) {
3284
+ if ( nodeType === 9 ) {
3285
+ elem = context.getElementById( m );
3286
+ // Check parentNode to catch when Blackberry 4.6 returns
3287
+ // nodes that are no longer in the document #6963
3288
+ if ( elem && elem.parentNode ) {
3289
+ // Handle the case where IE, Opera, and Webkit return items
3290
+ // by name instead of ID
3291
+ if ( elem.id === m ) {
3292
+ results.push( elem );
3293
+ return results;
3294
+ }
3295
+ } else {
3296
+ return results;
3297
+ }
3298
+ } else {
3299
+ // Context is not a document
3300
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
3301
+ contains( context, elem ) && elem.id === m ) {
3302
+ results.push( elem );
3303
+ return results;
3304
+ }
3305
+ }
3306
+ // Speed-up: Sizzle("TAG")
3307
+ } else if ( match[2] ) {
3308
+ push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
3309
+ return results;
3310
+ // Speed-up: Sizzle(".CLASS")
3311
+ } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
3312
+ push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
3313
+ return results;
3314
+ }
3315
+ }
3316
+ // QSA path
3317
+ if ( support.qsa && !rbuggyQSA.test(selector) ) {
3318
+ old = true;
3319
+ nid = expando;
3320
+ newContext = context;
3321
+ newSelector = nodeType === 9 && selector;
3322
+ // qSA works strangely on Element-rooted queries
3323
+ // We can work around this by specifying an extra ID on the root
3324
+ // and working up from there (Thanks to Andrew Dupont for the technique)
3325
+ // IE 8 doesn't work on object elements
3326
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
3327
+ groups = tokenize( selector );
3328
+ if ( (old = context.getAttribute("id")) ) {
3329
+ nid = old.replace( rescape, "\\$&" );
3330
+ } else {
3331
+ context.setAttribute( "id", nid );
3332
+ }
3333
+ nid = "[id='" + nid + "'] ";
3334
+ i = groups.length;
3335
+ while ( i-- ) {
3336
+ groups[i] = nid + toSelector( groups[i] );
3337
+ }
3338
+ newContext = rsibling.test( selector ) && context.parentNode || context;
3339
+ newSelector = groups.join(",");
3340
+ }
3341
+ if ( newSelector ) {
3342
+ try {
3343
+ push.apply( results, slice.call( newContext.querySelectorAll(
3344
+ newSelector
3345
+ ), 0 ) );
3346
+ return results;
3347
+ } catch(qsaError) {
3348
+ } finally {
3349
+ if ( !old ) {
3350
+ context.removeAttribute("id");
3351
+ }
3352
+ }
3353
+ }
3354
+ }
3355
+ }
3356
+ // All others
3357
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
3358
+ }
3359
+ /**
3360
+ * Detect xml
3361
+ * @param {Element|Object} elem An element or a document
3362
+ */
3363
+ isXML = Sizzle.isXML = function( elem ) {
3364
+ // documentElement is verified for cases where it doesn't yet exist
3365
+ // (such as loading iframes in IE - #4833)
3366
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
3367
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
3368
+ };
3369
+ /**
3370
+ * Sets document-related variables once based on the current document
3371
+ * @param {Element|Object} [doc] An element or document object to use to set the document
3372
+ * @returns {Object} Returns the current document
3373
+ */
3374
+ setDocument = Sizzle.setDocument = function( node ) {
3375
+ var doc = node ? node.ownerDocument || node : preferredDoc;
3376
+ // If no document and documentElement is available, return
3377
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
3378
+ return document;
3379
+ }
3380
+ // Set our document
3381
+ document = doc;
3382
+ docElem = doc.documentElement;
3383
+ // Support tests
3384
+ documentIsXML = isXML( doc );
3385
+ // Check if getElementsByTagName("*") returns only elements
3386
+ support.tagNameNoComments = assert(function( div ) {
3387
+ div.appendChild( doc.createComment("") );
3388
+ return !div.getElementsByTagName("*").length;
3389
+ });
3390
+ // Check if attributes should be retrieved by attribute nodes
3391
+ support.attributes = assert(function( div ) {
3392
+ div.innerHTML = "<select></select>";
3393
+ var type = typeof div.lastChild.getAttribute("multiple");
3394
+ // IE8 returns a string for some attributes even when not present
3395
+ return type !== "boolean" && type !== "string";
3396
+ });
3397
+ // Check if getElementsByClassName can be trusted
3398
+ support.getByClassName = assert(function( div ) {
3399
+ // Opera can't find a second classname (in 9.6)
3400
+ div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
3401
+ if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
3402
+ return false;
3403
+ }
3404
+ // Safari 3.2 caches class attributes and doesn't catch changes
3405
+ div.lastChild.className = "e";
3406
+ return div.getElementsByClassName("e").length === 2;
3407
+ });
3408
+ // Check if getElementById returns elements by name
3409
+ // Check if getElementsByName privileges form controls or returns elements by ID
3410
+ support.getByName = assert(function( div ) {
3411
+ // Inject content
3412
+ div.id = expando + 0;
3413
+ div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
3414
+ docElem.insertBefore( div, docElem.firstChild );
3415
+ // Test
3416
+ var pass = doc.getElementsByName &&
3417
+ // buggy browsers will return fewer than the correct 2
3418
+ doc.getElementsByName( expando ).length === 2 +
3419
+ // buggy browsers will return more than the correct 0
3420
+ doc.getElementsByName( expando + 0 ).length;
3421
+ support.getIdNotName = !doc.getElementById( expando );
3422
+ // Cleanup
3423
+ docElem.removeChild( div );
3424
+ return pass;
3425
+ });
3426
+ // IE6/7 return modified attributes
3427
+ Expr.attrHandle = assert(function( div ) {
3428
+ div.innerHTML = "<a href='#'></a>";
3429
+ return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
3430
+ div.firstChild.getAttribute("href") === "#";
3431
+ }) ?
3432
+ {} :
3433
+ {
3434
+ "href": function( elem ) {
3435
+ return elem.getAttribute( "href", 2 );
3436
+ },
3437
+ "type": function( elem ) {
3438
+ return elem.getAttribute("type");
3439
+ }
3440
+ };
3441
+ // ID find and filter
3442
+ if ( support.getIdNotName ) {
3443
+ Expr.find["ID"] = function( id, context ) {
3444
+ if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
3445
+ var m = context.getElementById( id );
3446
+ // Check parentNode to catch when Blackberry 4.6 returns
3447
+ // nodes that are no longer in the document #6963
3448
+ return m && m.parentNode ? [m] : [];
3449
+ }
3450
+ };
3451
+ Expr.filter["ID"] = function( id ) {
3452
+ var attrId = id.replace( runescape, funescape );
3453
+ return function( elem ) {
3454
+ return elem.getAttribute("id") === attrId;
3455
+ };
3456
+ };
3457
+ } else {
3458
+ Expr.find["ID"] = function( id, context ) {
3459
+ if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
3460
+ var m = context.getElementById( id );
3461
+ return m ?
3462
+ m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
3463
+ [m] :
3464
+ undefined :
3465
+ [];
3466
+ }
3467
+ };
3468
+ Expr.filter["ID"] = function( id ) {
3469
+ var attrId = id.replace( runescape, funescape );
3470
+ return function( elem ) {
3471
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
3472
+ return node && node.value === attrId;
3473
+ };
3474
+ };
3475
+ }
3476
+ // Tag
3477
+ Expr.find["TAG"] = support.tagNameNoComments ?
3478
+ function( tag, context ) {
3479
+ if ( typeof context.getElementsByTagName !== strundefined ) {
3480
+ return context.getElementsByTagName( tag );
3481
+ }
3482
+ } :
3483
+ function( tag, context ) {
3484
+ var elem,
3485
+ tmp = [],
3486
+ i = 0,
3487
+ results = context.getElementsByTagName( tag );
3488
+ // Filter out possible comments
3489
+ if ( tag === "*" ) {
3490
+ while ( (elem = results[i++]) ) {
3491
+ if ( elem.nodeType === 1 ) {
3492
+ tmp.push( elem );
3493
+ }
3494
+ }
3495
+ return tmp;
3496
+ }
3497
+ return results;
3498
+ };
3499
+ // Name
3500
+ Expr.find["NAME"] = support.getByName && function( tag, context ) {
3501
+ if ( typeof context.getElementsByName !== strundefined ) {
3502
+ return context.getElementsByName( name );
3503
+ }
3504
+ };
3505
+ // Class
3506
+ Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
3507
+ if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
3508
+ return context.getElementsByClassName( className );
3509
+ }
3510
+ };
3511
+ // QSA and matchesSelector support
3512
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
3513
+ rbuggyMatches = [];
3514
+ // qSa(:focus) reports false when true (Chrome 21),
3515
+ // no need to also add to buggyMatches since matches checks buggyQSA
3516
+ // A support test would require too much code (would include document ready)
3517
+ rbuggyQSA = [ ":focus" ];
3518
+ if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
3519
+ // Build QSA regex
3520
+ // Regex strategy adopted from Diego Perini
3521
+ assert(function( div ) {
3522
+ // Select is set to empty string on purpose
3523
+ // This is to test IE's treatment of not explictly
3524
+ // setting a boolean content attribute,
3525
+ // since its presence should be enough
3526
+ // http://bugs.jquery.com/ticket/12359
3527
+ div.innerHTML = "<select><option selected=''></option></select>";
3528
+ // IE8 - Some boolean attributes are not treated correctly
3529
+ if ( !div.querySelectorAll("[selected]").length ) {
3530
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
3531
+ }
3532
+ // Webkit/Opera - :checked should return selected option elements
3533
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
3534
+ // IE8 throws error here and will not see later tests
3535
+ if ( !div.querySelectorAll(":checked").length ) {
3536
+ rbuggyQSA.push(":checked");
3537
+ }
3538
+ });
3539
+ assert(function( div ) {
3540
+ // Opera 10-12/IE8 - ^= $= *= and empty values
3541
+ // Should not select anything
3542
+ div.innerHTML = "<input type='hidden' i=''/>";
3543
+ if ( div.querySelectorAll("[i^='']").length ) {
3544
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
3545
+ }
3546
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
3547
+ // IE8 throws error here and will not see later tests
3548
+ if ( !div.querySelectorAll(":enabled").length ) {
3549
+ rbuggyQSA.push( ":enabled", ":disabled" );
3550
+ }
3551
+ // Opera 10-11 does not throw on post-comma invalid pseudos
3552
+ div.querySelectorAll("*,:x");
3553
+ rbuggyQSA.push(",.*:");
3554
+ });
3555
+ }
3556
+ if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
3557
+ docElem.mozMatchesSelector ||
3558
+ docElem.webkitMatchesSelector ||
3559
+ docElem.oMatchesSelector ||
3560
+ docElem.msMatchesSelector) )) ) {
3561
+ assert(function( div ) {
3562
+ // Check to see if it's possible to do matchesSelector
3563
+ // on a disconnected node (IE 9)
3564
+ support.disconnectedMatch = matches.call( div, "div" );
3565
+ // This should fail with an exception
3566
+ // Gecko does not error, returns false instead
3567
+ matches.call( div, "[s!='']:x" );
3568
+ rbuggyMatches.push( "!=", pseudos );
3569
+ });
3570
+ }
3571
+ rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
3572
+ rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
3573
+ // Element contains another
3574
+ // Purposefully does not implement inclusive descendent
3575
+ // As in, an element does not contain itself
3576
+ contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
3577
+ function( a, b ) {
3578
+ var adown = a.nodeType === 9 ? a.documentElement : a,
3579
+ bup = b && b.parentNode;
3580
+ return a === bup || !!( bup && bup.nodeType === 1 && (
3581
+ adown.contains ?
3582
+ adown.contains( bup ) :
3583
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
3584
+ ));
3585
+ } :
3586
+ function( a, b ) {
3587
+ if ( b ) {
3588
+ while ( (b = b.parentNode) ) {
3589
+ if ( b === a ) {
3590
+ return true;
3591
+ }
3592
+ }
3593
+ }
3594
+ return false;
3595
+ };
3596
+ // Document order sorting
3597
+ sortOrder = docElem.compareDocumentPosition ?
3598
+ function( a, b ) {
3599
+ var compare;
3600
+ if ( a === b ) {
3601
+ hasDuplicate = true;
3602
+ return 0;
3603
+ }
3604
+ if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
3605
+ if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
3606
+ if ( a === doc || contains( preferredDoc, a ) ) {
3607
+ return -1;
3608
+ }
3609
+ if ( b === doc || contains( preferredDoc, b ) ) {
3610
+ return 1;
3611
+ }
3612
+ return 0;
3613
+ }
3614
+ return compare & 4 ? -1 : 1;
3615
+ }
3616
+ return a.compareDocumentPosition ? -1 : 1;
3617
+ } :
3618
+ function( a, b ) {
3619
+ var cur,
3620
+ i = 0,
3621
+ aup = a.parentNode,
3622
+ bup = b.parentNode,
3623
+ ap = [ a ],
3624
+ bp = [ b ];
3625
+ // Exit early if the nodes are identical
3626
+ if ( a === b ) {
3627
+ hasDuplicate = true;
3628
+ return 0;
3629
+ // Parentless nodes are either documents or disconnected
3630
+ } else if ( !aup || !bup ) {
3631
+ return a === doc ? -1 :
3632
+ b === doc ? 1 :
3633
+ aup ? -1 :
3634
+ bup ? 1 :
3635
+ 0;
3636
+ // If the nodes are siblings, we can do a quick check
3637
+ } else if ( aup === bup ) {
3638
+ return siblingCheck( a, b );
3639
+ }
3640
+ // Otherwise we need full lists of their ancestors for comparison
3641
+ cur = a;
3642
+ while ( (cur = cur.parentNode) ) {
3643
+ ap.unshift( cur );
3644
+ }
3645
+ cur = b;
3646
+ while ( (cur = cur.parentNode) ) {
3647
+ bp.unshift( cur );
3648
+ }
3649
+ // Walk down the tree looking for a discrepancy
3650
+ while ( ap[i] === bp[i] ) {
3651
+ i++;
3652
+ }
3653
+ return i ?
3654
+ // Do a sibling check if the nodes have a common ancestor
3655
+ siblingCheck( ap[i], bp[i] ) :
3656
+ // Otherwise nodes in our document sort first
3657
+ ap[i] === preferredDoc ? -1 :
3658
+ bp[i] === preferredDoc ? 1 :
3659
+ 0;
3660
+ };
3661
+ // Always assume the presence of duplicates if sort doesn't
3662
+ // pass them to our comparison function (as in Google Chrome).
3663
+ hasDuplicate = false;
3664
+ [0, 0].sort( sortOrder );
3665
+ support.detectDuplicates = hasDuplicate;
3666
+ return document;
3667
+ };
3668
+ Sizzle.matches = function( expr, elements ) {
3669
+ return Sizzle( expr, null, null, elements );
3670
+ };
3671
+ Sizzle.matchesSelector = function( elem, expr ) {
3672
+ // Set document vars if needed
3673
+ if ( ( elem.ownerDocument || elem ) !== document ) {
3674
+ setDocument( elem );
3675
+ }
3676
+ // Make sure that attribute selectors are quoted
3677
+ expr = expr.replace( rattributeQuotes, "='$1']" );
3678
+ // rbuggyQSA always contains :focus, so no need for an existence check
3679
+ if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
3680
+ try {
3681
+ var ret = matches.call( elem, expr );
3682
+ // IE 9's matchesSelector returns false on disconnected nodes
3683
+ if ( ret || support.disconnectedMatch ||
3684
+ // As well, disconnected nodes are said to be in a document
3685
+ // fragment in IE 9
3686
+ elem.document && elem.document.nodeType !== 11 ) {
3687
+ return ret;
3688
+ }
3689
+ } catch(e) {}
3690
+ }
3691
+ return Sizzle( expr, document, null, [elem] ).length > 0;
3692
+ };
3693
+ Sizzle.contains = function( context, elem ) {
3694
+ // Set document vars if needed
3695
+ if ( ( context.ownerDocument || context ) !== document ) {
3696
+ setDocument( context );
3697
+ }
3698
+ return contains( context, elem );
3699
+ };
3700
+ Sizzle.attr = function( elem, name ) {
3701
+ var val;
3702
+ // Set document vars if needed
3703
+ if ( ( elem.ownerDocument || elem ) !== document ) {
3704
+ setDocument( elem );
3705
+ }
3706
+ if ( !documentIsXML ) {
3707
+ name = name.toLowerCase();
3708
+ }
3709
+ if ( (val = Expr.attrHandle[ name ]) ) {
3710
+ return val( elem );
3711
+ }
3712
+ if ( documentIsXML || support.attributes ) {
3713
+ return elem.getAttribute( name );
3714
+ }
3715
+ return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
3716
+ name :
3717
+ val && val.specified ? val.value : null;
3718
+ };
3719
+ Sizzle.error = function( msg ) {
3720
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
3721
+ };
3722
+ // Document sorting and removing duplicates
3723
+ Sizzle.uniqueSort = function( results ) {
3724
+ var elem,
3725
+ duplicates = [],
3726
+ i = 1,
3727
+ j = 0;
3728
+ // Unless we *know* we can detect duplicates, assume their presence
3729
+ hasDuplicate = !support.detectDuplicates;
3730
+ results.sort( sortOrder );
3731
+ if ( hasDuplicate ) {
3732
+ for ( ; (elem = results[i]); i++ ) {
3733
+ if ( elem === results[ i - 1 ] ) {
3734
+ j = duplicates.push( i );
3735
+ }
3736
+ }
3737
+ while ( j-- ) {
3738
+ results.splice( duplicates[ j ], 1 );
3739
+ }
3740
+ }
3741
+ return results;
3742
+ };
3743
+ function siblingCheck( a, b ) {
3744
+ var cur = b && a,
3745
+ diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
3746
+ // Use IE sourceIndex if available on both nodes
3747
+ if ( diff ) {
3748
+ return diff;
3749
+ }
3750
+ // Check if b follows a
3751
+ if ( cur ) {
3752
+ while ( (cur = cur.nextSibling) ) {
3753
+ if ( cur === b ) {
3754
+ return -1;
3755
+ }
3756
+ }
3757
+ }
3758
+ return a ? 1 : -1;
3759
+ }
3760
+ // Returns a function to use in pseudos for input types
3761
+ function createInputPseudo( type ) {
3762
+ return function( elem ) {
3763
+ var name = elem.nodeName.toLowerCase();
3764
+ return name === "input" && elem.type === type;
3765
+ };
3766
+ }
3767
+ // Returns a function to use in pseudos for buttons
3768
+ function createButtonPseudo( type ) {
3769
+ return function( elem ) {
3770
+ var name = elem.nodeName.toLowerCase();
3771
+ return (name === "input" || name === "button") && elem.type === type;
3772
+ };
3773
+ }
3774
+ // Returns a function to use in pseudos for positionals
3775
+ function createPositionalPseudo( fn ) {
3776
+ return markFunction(function( argument ) {
3777
+ argument = +argument;
3778
+ return markFunction(function( seed, matches ) {
3779
+ var j,
3780
+ matchIndexes = fn( [], seed.length, argument ),
3781
+ i = matchIndexes.length;
3782
+ // Match elements found at the specified indexes
3783
+ while ( i-- ) {
3784
+ if ( seed[ (j = matchIndexes[i]) ] ) {
3785
+ seed[j] = !(matches[j] = seed[j]);
3786
+ }
3787
+ }
3788
+ });
3789
+ });
3790
+ }
3791
+ /**
3792
+ * Utility function for retrieving the text value of an array of DOM nodes
3793
+ * @param {Array|Element} elem
3794
+ */
3795
+ getText = Sizzle.getText = function( elem ) {
3796
+ var node,
3797
+ ret = "",
3798
+ i = 0,
3799
+ nodeType = elem.nodeType;
3800
+ if ( !nodeType ) {
3801
+ // If no nodeType, this is expected to be an array
3802
+ for ( ; (node = elem[i]); i++ ) {
3803
+ // Do not traverse comment nodes
3804
+ ret += getText( node );
3805
+ }
3806
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
3807
+ // Use textContent for elements
3808
+ // innerText usage removed for consistency of new lines (see #11153)
3809
+ if ( typeof elem.textContent === "string" ) {
3810
+ return elem.textContent;
3811
+ } else {
3812
+ // Traverse its children
3813
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
3814
+ ret += getText( elem );
3815
+ }
3816
+ }
3817
+ } else if ( nodeType === 3 || nodeType === 4 ) {
3818
+ return elem.nodeValue;
3819
+ }
3820
+ // Do not include comment or processing instruction nodes
3821
+ return ret;
3822
+ };
3823
+ Expr = Sizzle.selectors = {
3824
+ // Can be adjusted by the user
3825
+ cacheLength: 50,
3826
+ createPseudo: markFunction,
3827
+ match: matchExpr,
3828
+ find: {},
3829
+ relative: {
3830
+ ">": { dir: "parentNode", first: true },
3831
+ " ": { dir: "parentNode" },
3832
+ "+": { dir: "previousSibling", first: true },
3833
+ "~": { dir: "previousSibling" }
3834
+ },
3835
+ preFilter: {
3836
+ "ATTR": function( match ) {
3837
+ match[1] = match[1].replace( runescape, funescape );
3838
+ // Move the given value to match[3] whether quoted or unquoted
3839
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
3840
+ if ( match[2] === "~=" ) {
3841
+ match[3] = " " + match[3] + " ";
3842
+ }
3843
+ return match.slice( 0, 4 );
3844
+ },
3845
+ "CHILD": function( match ) {
3846
+ /* matches from matchExpr["CHILD"]
3847
+ 1 type (only|nth|...)
3848
+ 2 what (child|of-type)
3849
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
3850
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
3851
+ 5 sign of xn-component
3852
+ 6 x of xn-component
3853
+ 7 sign of y-component
3854
+ 8 y of y-component
3855
+ */
3856
+ match[1] = match[1].toLowerCase();
3857
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
3858
+ // nth-* requires argument
3859
+ if ( !match[3] ) {
3860
+ Sizzle.error( match[0] );
3861
+ }
3862
+ // numeric x and y parameters for Expr.filter.CHILD
3863
+ // remember that false/true cast respectively to 0/1
3864
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
3865
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
3866
+ // other types prohibit arguments
3867
+ } else if ( match[3] ) {
3868
+ Sizzle.error( match[0] );
3869
+ }
3870
+ return match;
3871
+ },
3872
+ "PSEUDO": function( match ) {
3873
+ var excess,
3874
+ unquoted = !match[5] && match[2];
3875
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
3876
+ return null;
3877
+ }
3878
+ // Accept quoted arguments as-is
3879
+ if ( match[4] ) {
3880
+ match[2] = match[4];
3881
+ // Strip excess characters from unquoted arguments
3882
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
3883
+ // Get excess from tokenize (recursively)
3884
+ (excess = tokenize( unquoted, true )) &&
3885
+ // advance to the next closing parenthesis
3886
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
3887
+ // excess is a negative index
3888
+ match[0] = match[0].slice( 0, excess );
3889
+ match[2] = unquoted.slice( 0, excess );
3890
+ }
3891
+ // Return only captures needed by the pseudo filter method (type and argument)
3892
+ return match.slice( 0, 3 );
3893
+ }
3894
+ },
3895
+ filter: {
3896
+ "TAG": function( nodeName ) {
3897
+ if ( nodeName === "*" ) {
3898
+ return function() { return true; };
3899
+ }
3900
+ nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
3901
+ return function( elem ) {
3902
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
3903
+ };
3904
+ },
3905
+ "CLASS": function( className ) {
3906
+ var pattern = classCache[ className + " " ];
3907
+ return pattern ||
3908
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
3909
+ classCache( className, function( elem ) {
3910
+ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
3911
+ });
3912
+ },
3913
+ "ATTR": function( name, operator, check ) {
3914
+ return function( elem ) {
3915
+ var result = Sizzle.attr( elem, name );
3916
+ if ( result == null ) {
3917
+ return operator === "!=";
3918
+ }
3919
+ if ( !operator ) {
3920
+ return true;
3921
+ }
3922
+ result += "";
3923
+ return operator === "=" ? result === check :
3924
+ operator === "!=" ? result !== check :
3925
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
3926
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
3927
+ operator === "$=" ? check && result.slice( -check.length ) === check :
3928
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
3929
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
3930
+ false;
3931
+ };
3932
+ },
3933
+ "CHILD": function( type, what, argument, first, last ) {
3934
+ var simple = type.slice( 0, 3 ) !== "nth",
3935
+ forward = type.slice( -4 ) !== "last",
3936
+ ofType = what === "of-type";
3937
+ return first === 1 && last === 0 ?
3938
+ // Shortcut for :nth-*(n)
3939
+ function( elem ) {
3940
+ return !!elem.parentNode;
3941
+ } :
3942
+ function( elem, context, xml ) {
3943
+ var cache, outerCache, node, diff, nodeIndex, start,
3944
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
3945
+ parent = elem.parentNode,
3946
+ name = ofType && elem.nodeName.toLowerCase(),
3947
+ useCache = !xml && !ofType;
3948
+ if ( parent ) {
3949
+ // :(first|last|only)-(child|of-type)
3950
+ if ( simple ) {
3951
+ while ( dir ) {
3952
+ node = elem;
3953
+ while ( (node = node[ dir ]) ) {
3954
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
3955
+ return false;
3956
+ }
3957
+ }
3958
+ // Reverse direction for :only-* (if we haven't yet done so)
3959
+ start = dir = type === "only" && !start && "nextSibling";
3960
+ }
3961
+ return true;
3962
+ }
3963
+ start = [ forward ? parent.firstChild : parent.lastChild ];
3964
+ // non-xml :nth-child(...) stores cache data on `parent`
3965
+ if ( forward && useCache ) {
3966
+ // Seek `elem` from a previously-cached index
3967
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
3968
+ cache = outerCache[ type ] || [];
3969
+ nodeIndex = cache[0] === dirruns && cache[1];
3970
+ diff = cache[0] === dirruns && cache[2];
3971
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
3972
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
3973
+ // Fallback to seeking `elem` from the start
3974
+ (diff = nodeIndex = 0) || start.pop()) ) {
3975
+ // When found, cache indexes on `parent` and break
3976
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
3977
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
3978
+ break;
3979
+ }
3980
+ }
3981
+ // Use previously-cached element index if available
3982
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
3983
+ diff = cache[1];
3984
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
3985
+ } else {
3986
+ // Use the same loop as above to seek `elem` from the start
3987
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
3988
+ (diff = nodeIndex = 0) || start.pop()) ) {
3989
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
3990
+ // Cache the index of each encountered element
3991
+ if ( useCache ) {
3992
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
3993
+ }
3994
+ if ( node === elem ) {
3995
+ break;
3996
+ }
3997
+ }
3998
+ }
3999
+ }
4000
+ // Incorporate the offset, then check against cycle size
4001
+ diff -= last;
4002
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
4003
+ }
4004
+ };
4005
+ },
4006
+ "PSEUDO": function( pseudo, argument ) {
4007
+ // pseudo-class names are case-insensitive
4008
+ // http://www.w3.org/TR/selectors/#pseudo-classes
4009
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
4010
+ // Remember that setFilters inherits from pseudos
4011
+ var args,
4012
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
4013
+ Sizzle.error( "unsupported pseudo: " + pseudo );
4014
+ // The user may use createPseudo to indicate that
4015
+ // arguments are needed to create the filter function
4016
+ // just as Sizzle does
4017
+ if ( fn[ expando ] ) {
4018
+ return fn( argument );
4019
+ }
4020
+ // But maintain support for old signatures
4021
+ if ( fn.length > 1 ) {
4022
+ args = [ pseudo, pseudo, "", argument ];
4023
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
4024
+ markFunction(function( seed, matches ) {
4025
+ var idx,
4026
+ matched = fn( seed, argument ),
4027
+ i = matched.length;
4028
+ while ( i-- ) {
4029
+ idx = indexOf.call( seed, matched[i] );
4030
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
4031
+ }
4032
+ }) :
4033
+ function( elem ) {
4034
+ return fn( elem, 0, args );
4035
+ };
4036
+ }
4037
+ return fn;
4038
+ }
4039
+ },
4040
+ pseudos: {
4041
+ // Potentially complex pseudos
4042
+ "not": markFunction(function( selector ) {
4043
+ // Trim the selector passed to compile
4044
+ // to avoid treating leading and trailing
4045
+ // spaces as combinators
4046
+ var input = [],
4047
+ results = [],
4048
+ matcher = compile( selector.replace( rtrim, "$1" ) );
4049
+ return matcher[ expando ] ?
4050
+ markFunction(function( seed, matches, context, xml ) {
4051
+ var elem,
4052
+ unmatched = matcher( seed, null, xml, [] ),
4053
+ i = seed.length;
4054
+ // Match elements unmatched by `matcher`
4055
+ while ( i-- ) {
4056
+ if ( (elem = unmatched[i]) ) {
4057
+ seed[i] = !(matches[i] = elem);
4058
+ }
4059
+ }
4060
+ }) :
4061
+ function( elem, context, xml ) {
4062
+ input[0] = elem;
4063
+ matcher( input, null, xml, results );
4064
+ return !results.pop();
4065
+ };
4066
+ }),
4067
+ "has": markFunction(function( selector ) {
4068
+ return function( elem ) {
4069
+ return Sizzle( selector, elem ).length > 0;
4070
+ };
4071
+ }),
4072
+ "contains": markFunction(function( text ) {
4073
+ return function( elem ) {
4074
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
4075
+ };
4076
+ }),
4077
+ // "Whether an element is represented by a :lang() selector
4078
+ // is based solely on the element's language value
4079
+ // being equal to the identifier C,
4080
+ // or beginning with the identifier C immediately followed by "-".
4081
+ // The matching of C against the element's language value is performed case-insensitively.
4082
+ // The identifier C does not have to be a valid language name."
4083
+ // http://www.w3.org/TR/selectors/#lang-pseudo
4084
+ "lang": markFunction( function( lang ) {
4085
+ // lang value must be a valid identifider
4086
+ if ( !ridentifier.test(lang || "") ) {
4087
+ Sizzle.error( "unsupported lang: " + lang );
4088
+ }
4089
+ lang = lang.replace( runescape, funescape ).toLowerCase();
4090
+ return function( elem ) {
4091
+ var elemLang;
4092
+ do {
4093
+ if ( (elemLang = documentIsXML ?
4094
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
4095
+ elem.lang) ) {
4096
+ elemLang = elemLang.toLowerCase();
4097
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
4098
+ }
4099
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
4100
+ return false;
4101
+ };
4102
+ }),
4103
+ // Miscellaneous
4104
+ "target": function( elem ) {
4105
+ var hash = window.location && window.location.hash;
4106
+ return hash && hash.slice( 1 ) === elem.id;
4107
+ },
4108
+ "root": function( elem ) {
4109
+ return elem === docElem;
4110
+ },
4111
+ "focus": function( elem ) {
4112
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
4113
+ },
4114
+ // Boolean properties
4115
+ "enabled": function( elem ) {
4116
+ return elem.disabled === false;
4117
+ },
4118
+ "disabled": function( elem ) {
4119
+ return elem.disabled === true;
4120
+ },
4121
+ "checked": function( elem ) {
4122
+ // In CSS3, :checked should return both checked and selected elements
4123
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
4124
+ var nodeName = elem.nodeName.toLowerCase();
4125
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
4126
+ },
4127
+ "selected": function( elem ) {
4128
+ // Accessing this property makes selected-by-default
4129
+ // options in Safari work properly
4130
+ if ( elem.parentNode ) {
4131
+ elem.parentNode.selectedIndex;
4132
+ }
4133
+ return elem.selected === true;
4134
+ },
4135
+ // Contents
4136
+ "empty": function( elem ) {
4137
+ // http://www.w3.org/TR/selectors/#empty-pseudo
4138
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
4139
+ // not comment, processing instructions, or others
4140
+ // Thanks to Diego Perini for the nodeName shortcut
4141
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
4142
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
4143
+ if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
4144
+ return false;
4145
+ }
4146
+ }
4147
+ return true;
4148
+ },
4149
+ "parent": function( elem ) {
4150
+ return !Expr.pseudos["empty"]( elem );
4151
+ },
4152
+ // Element/input types
4153
+ "header": function( elem ) {
4154
+ return rheader.test( elem.nodeName );
4155
+ },
4156
+ "input": function( elem ) {
4157
+ return rinputs.test( elem.nodeName );
4158
+ },
4159
+ "button": function( elem ) {
4160
+ var name = elem.nodeName.toLowerCase();
4161
+ return name === "input" && elem.type === "button" || name === "button";
4162
+ },
4163
+ "text": function( elem ) {
4164
+ var attr;
4165
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
4166
+ // use getAttribute instead to test this case
4167
+ return elem.nodeName.toLowerCase() === "input" &&
4168
+ elem.type === "text" &&
4169
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
4170
+ },
4171
+ // Position-in-collection
4172
+ "first": createPositionalPseudo(function() {
4173
+ return [ 0 ];
4174
+ }),
4175
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
4176
+ return [ length - 1 ];
4177
+ }),
4178
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
4179
+ return [ argument < 0 ? argument + length : argument ];
4180
+ }),
4181
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
4182
+ var i = 0;
4183
+ for ( ; i < length; i += 2 ) {
4184
+ matchIndexes.push( i );
4185
+ }
4186
+ return matchIndexes;
4187
+ }),
4188
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
4189
+ var i = 1;
4190
+ for ( ; i < length; i += 2 ) {
4191
+ matchIndexes.push( i );
4192
+ }
4193
+ return matchIndexes;
4194
+ }),
4195
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
4196
+ var i = argument < 0 ? argument + length : argument;
4197
+ for ( ; --i >= 0; ) {
4198
+ matchIndexes.push( i );
4199
+ }
4200
+ return matchIndexes;
4201
+ }),
4202
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
4203
+ var i = argument < 0 ? argument + length : argument;
4204
+ for ( ; ++i < length; ) {
4205
+ matchIndexes.push( i );
4206
+ }
4207
+ return matchIndexes;
4208
+ })
4209
+ }
4210
+ };
4211
+ // Add button/input type pseudos
4212
+ for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
4213
+ Expr.pseudos[ i ] = createInputPseudo( i );
4214
+ }
4215
+ for ( i in { submit: true, reset: true } ) {
4216
+ Expr.pseudos[ i ] = createButtonPseudo( i );
4217
+ }
4218
+ function tokenize( selector, parseOnly ) {
4219
+ var matched, match, tokens, type,
4220
+ soFar, groups, preFilters,
4221
+ cached = tokenCache[ selector + " " ];
4222
+ if ( cached ) {
4223
+ return parseOnly ? 0 : cached.slice( 0 );
4224
+ }
4225
+ soFar = selector;
4226
+ groups = [];
4227
+ preFilters = Expr.preFilter;
4228
+ while ( soFar ) {
4229
+ // Comma and first run
4230
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
4231
+ if ( match ) {
4232
+ // Don't consume trailing commas as valid
4233
+ soFar = soFar.slice( match[0].length ) || soFar;
4234
+ }
4235
+ groups.push( tokens = [] );
4236
+ }
4237
+ matched = false;
4238
+ // Combinators
4239
+ if ( (match = rcombinators.exec( soFar )) ) {
4240
+ matched = match.shift();
4241
+ tokens.push( {
4242
+ value: matched,
4243
+ // Cast descendant combinators to space
4244
+ type: match[0].replace( rtrim, " " )
4245
+ } );
4246
+ soFar = soFar.slice( matched.length );
4247
+ }
4248
+ // Filters
4249
+ for ( type in Expr.filter ) {
4250
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
4251
+ (match = preFilters[ type ]( match ))) ) {
4252
+ matched = match.shift();
4253
+ tokens.push( {
4254
+ value: matched,
4255
+ type: type,
4256
+ matches: match
4257
+ } );
4258
+ soFar = soFar.slice( matched.length );
4259
+ }
4260
+ }
4261
+ if ( !matched ) {
4262
+ break;
4263
+ }
4264
+ }
4265
+ // Return the length of the invalid excess
4266
+ // if we're just parsing
4267
+ // Otherwise, throw an error or return tokens
4268
+ return parseOnly ?
4269
+ soFar.length :
4270
+ soFar ?
4271
+ Sizzle.error( selector ) :
4272
+ // Cache the tokens
4273
+ tokenCache( selector, groups ).slice( 0 );
4274
+ }
4275
+ function toSelector( tokens ) {
4276
+ var i = 0,
4277
+ len = tokens.length,
4278
+ selector = "";
4279
+ for ( ; i < len; i++ ) {
4280
+ selector += tokens[i].value;
4281
+ }
4282
+ return selector;
4283
+ }
4284
+ function addCombinator( matcher, combinator, base ) {
4285
+ var dir = combinator.dir,
4286
+ checkNonElements = base && dir === "parentNode",
4287
+ doneName = done++;
4288
+ return combinator.first ?
4289
+ // Check against closest ancestor/preceding element
4290
+ function( elem, context, xml ) {
4291
+ while ( (elem = elem[ dir ]) ) {
4292
+ if ( elem.nodeType === 1 || checkNonElements ) {
4293
+ return matcher( elem, context, xml );
4294
+ }
4295
+ }
4296
+ } :
4297
+ // Check against all ancestor/preceding elements
4298
+ function( elem, context, xml ) {
4299
+ var data, cache, outerCache,
4300
+ dirkey = dirruns + " " + doneName;
4301
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
4302
+ if ( xml ) {
4303
+ while ( (elem = elem[ dir ]) ) {
4304
+ if ( elem.nodeType === 1 || checkNonElements ) {
4305
+ if ( matcher( elem, context, xml ) ) {
4306
+ return true;
4307
+ }
4308
+ }
4309
+ }
4310
+ } else {
4311
+ while ( (elem = elem[ dir ]) ) {
4312
+ if ( elem.nodeType === 1 || checkNonElements ) {
4313
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
4314
+ if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
4315
+ if ( (data = cache[1]) === true || data === cachedruns ) {
4316
+ return data === true;
4317
+ }
4318
+ } else {
4319
+ cache = outerCache[ dir ] = [ dirkey ];
4320
+ cache[1] = matcher( elem, context, xml ) || cachedruns;
4321
+ if ( cache[1] === true ) {
4322
+ return true;
4323
+ }
4324
+ }
4325
+ }
4326
+ }
4327
+ }
4328
+ };
4329
+ }
4330
+ function elementMatcher( matchers ) {
4331
+ return matchers.length > 1 ?
4332
+ function( elem, context, xml ) {
4333
+ var i = matchers.length;
4334
+ while ( i-- ) {
4335
+ if ( !matchers[i]( elem, context, xml ) ) {
4336
+ return false;
4337
+ }
4338
+ }
4339
+ return true;
4340
+ } :
4341
+ matchers[0];
4342
+ }
4343
+ function condense( unmatched, map, filter, context, xml ) {
4344
+ var elem,
4345
+ newUnmatched = [],
4346
+ i = 0,
4347
+ len = unmatched.length,
4348
+ mapped = map != null;
4349
+ for ( ; i < len; i++ ) {
4350
+ if ( (elem = unmatched[i]) ) {
4351
+ if ( !filter || filter( elem, context, xml ) ) {
4352
+ newUnmatched.push( elem );
4353
+ if ( mapped ) {
4354
+ map.push( i );
4355
+ }
4356
+ }
4357
+ }
4358
+ }
4359
+ return newUnmatched;
4360
+ }
4361
+ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
4362
+ if ( postFilter && !postFilter[ expando ] ) {
4363
+ postFilter = setMatcher( postFilter );
4364
+ }
4365
+ if ( postFinder && !postFinder[ expando ] ) {
4366
+ postFinder = setMatcher( postFinder, postSelector );
4367
+ }
4368
+ return markFunction(function( seed, results, context, xml ) {
4369
+ var temp, i, elem,
4370
+ preMap = [],
4371
+ postMap = [],
4372
+ preexisting = results.length,
4373
+ // Get initial elements from seed or context
4374
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
4375
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
4376
+ matcherIn = preFilter && ( seed || !selector ) ?
4377
+ condense( elems, preMap, preFilter, context, xml ) :
4378
+ elems,
4379
+ matcherOut = matcher ?
4380
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
4381
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
4382
+ // ...intermediate processing is necessary
4383
+ [] :
4384
+ // ...otherwise use results directly
4385
+ results :
4386
+ matcherIn;
4387
+ // Find primary matches
4388
+ if ( matcher ) {
4389
+ matcher( matcherIn, matcherOut, context, xml );
4390
+ }
4391
+ // Apply postFilter
4392
+ if ( postFilter ) {
4393
+ temp = condense( matcherOut, postMap );
4394
+ postFilter( temp, [], context, xml );
4395
+ // Un-match failing elements by moving them back to matcherIn
4396
+ i = temp.length;
4397
+ while ( i-- ) {
4398
+ if ( (elem = temp[i]) ) {
4399
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
4400
+ }
4401
+ }
4402
+ }
4403
+ if ( seed ) {
4404
+ if ( postFinder || preFilter ) {
4405
+ if ( postFinder ) {
4406
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
4407
+ temp = [];
4408
+ i = matcherOut.length;
4409
+ while ( i-- ) {
4410
+ if ( (elem = matcherOut[i]) ) {
4411
+ // Restore matcherIn since elem is not yet a final match
4412
+ temp.push( (matcherIn[i] = elem) );
4413
+ }
4414
+ }
4415
+ postFinder( null, (matcherOut = []), temp, xml );
4416
+ }
4417
+ // Move matched elements from seed to results to keep them synchronized
4418
+ i = matcherOut.length;
4419
+ while ( i-- ) {
4420
+ if ( (elem = matcherOut[i]) &&
4421
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
4422
+ seed[temp] = !(results[temp] = elem);
4423
+ }
4424
+ }
4425
+ }
4426
+ // Add elements to results, through postFinder if defined
4427
+ } else {
4428
+ matcherOut = condense(
4429
+ matcherOut === results ?
4430
+ matcherOut.splice( preexisting, matcherOut.length ) :
4431
+ matcherOut
4432
+ );
4433
+ if ( postFinder ) {
4434
+ postFinder( null, results, matcherOut, xml );
4435
+ } else {
4436
+ push.apply( results, matcherOut );
4437
+ }
4438
+ }
4439
+ });
4440
+ }
4441
+ function matcherFromTokens( tokens ) {
4442
+ var checkContext, matcher, j,
4443
+ len = tokens.length,
4444
+ leadingRelative = Expr.relative[ tokens[0].type ],
4445
+ implicitRelative = leadingRelative || Expr.relative[" "],
4446
+ i = leadingRelative ? 1 : 0,
4447
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
4448
+ matchContext = addCombinator( function( elem ) {
4449
+ return elem === checkContext;
4450
+ }, implicitRelative, true ),
4451
+ matchAnyContext = addCombinator( function( elem ) {
4452
+ return indexOf.call( checkContext, elem ) > -1;
4453
+ }, implicitRelative, true ),
4454
+ matchers = [ function( elem, context, xml ) {
4455
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
4456
+ (checkContext = context).nodeType ?
4457
+ matchContext( elem, context, xml ) :
4458
+ matchAnyContext( elem, context, xml ) );
4459
+ } ];
4460
+ for ( ; i < len; i++ ) {
4461
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
4462
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
4463
+ } else {
4464
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
4465
+ // Return special upon seeing a positional matcher
4466
+ if ( matcher[ expando ] ) {
4467
+ // Find the next relative operator (if any) for proper handling
4468
+ j = ++i;
4469
+ for ( ; j < len; j++ ) {
4470
+ if ( Expr.relative[ tokens[j].type ] ) {
4471
+ break;
4472
+ }
4473
+ }
4474
+ return setMatcher(
4475
+ i > 1 && elementMatcher( matchers ),
4476
+ i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
4477
+ matcher,
4478
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
4479
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
4480
+ j < len && toSelector( tokens )
4481
+ );
4482
+ }
4483
+ matchers.push( matcher );
4484
+ }
4485
+ }
4486
+ return elementMatcher( matchers );
4487
+ }
4488
+ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
4489
+ // A counter to specify which element is currently being matched
4490
+ var matcherCachedRuns = 0,
4491
+ bySet = setMatchers.length > 0,
4492
+ byElement = elementMatchers.length > 0,
4493
+ superMatcher = function( seed, context, xml, results, expandContext ) {
4494
+ var elem, j, matcher,
4495
+ setMatched = [],
4496
+ matchedCount = 0,
4497
+ i = "0",
4498
+ unmatched = seed && [],
4499
+ outermost = expandContext != null,
4500
+ contextBackup = outermostContext,
4501
+ // We must always have either seed elements or context
4502
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
4503
+ // Use integer dirruns iff this is the outermost matcher
4504
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
4505
+ if ( outermost ) {
4506
+ outermostContext = context !== document && context;
4507
+ cachedruns = matcherCachedRuns;
4508
+ }
4509
+ // Add elements passing elementMatchers directly to results
4510
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
4511
+ for ( ; (elem = elems[i]) != null; i++ ) {
4512
+ if ( byElement && elem ) {
4513
+ j = 0;
4514
+ while ( (matcher = elementMatchers[j++]) ) {
4515
+ if ( matcher( elem, context, xml ) ) {
4516
+ results.push( elem );
4517
+ break;
4518
+ }
4519
+ }
4520
+ if ( outermost ) {
4521
+ dirruns = dirrunsUnique;
4522
+ cachedruns = ++matcherCachedRuns;
4523
+ }
4524
+ }
4525
+ // Track unmatched elements for set filters
4526
+ if ( bySet ) {
4527
+ // They will have gone through all possible matchers
4528
+ if ( (elem = !matcher && elem) ) {
4529
+ matchedCount--;
4530
+ }
4531
+ // Lengthen the array for every element, matched or not
4532
+ if ( seed ) {
4533
+ unmatched.push( elem );
4534
+ }
4535
+ }
4536
+ }
4537
+ // Apply set filters to unmatched elements
4538
+ matchedCount += i;
4539
+ if ( bySet && i !== matchedCount ) {
4540
+ j = 0;
4541
+ while ( (matcher = setMatchers[j++]) ) {
4542
+ matcher( unmatched, setMatched, context, xml );
4543
+ }
4544
+ if ( seed ) {
4545
+ // Reintegrate element matches to eliminate the need for sorting
4546
+ if ( matchedCount > 0 ) {
4547
+ while ( i-- ) {
4548
+ if ( !(unmatched[i] || setMatched[i]) ) {
4549
+ setMatched[i] = pop.call( results );
4550
+ }
4551
+ }
4552
+ }
4553
+ // Discard index placeholder values to get only actual matches
4554
+ setMatched = condense( setMatched );
4555
+ }
4556
+ // Add matches to results
4557
+ push.apply( results, setMatched );
4558
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
4559
+ if ( outermost && !seed && setMatched.length > 0 &&
4560
+ ( matchedCount + setMatchers.length ) > 1 ) {
4561
+ Sizzle.uniqueSort( results );
4562
+ }
4563
+ }
4564
+ // Override manipulation of globals by nested matchers
4565
+ if ( outermost ) {
4566
+ dirruns = dirrunsUnique;
4567
+ outermostContext = contextBackup;
4568
+ }
4569
+ return unmatched;
4570
+ };
4571
+ return bySet ?
4572
+ markFunction( superMatcher ) :
4573
+ superMatcher;
4574
+ }
4575
+ compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
4576
+ var i,
4577
+ setMatchers = [],
4578
+ elementMatchers = [],
4579
+ cached = compilerCache[ selector + " " ];
4580
+ if ( !cached ) {
4581
+ // Generate a function of recursive functions that can be used to check each element
4582
+ if ( !group ) {
4583
+ group = tokenize( selector );
4584
+ }
4585
+ i = group.length;
4586
+ while ( i-- ) {
4587
+ cached = matcherFromTokens( group[i] );
4588
+ if ( cached[ expando ] ) {
4589
+ setMatchers.push( cached );
4590
+ } else {
4591
+ elementMatchers.push( cached );
4592
+ }
4593
+ }
4594
+ // Cache the compiled function
4595
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
4596
+ }
4597
+ return cached;
4598
+ };
4599
+ function multipleContexts( selector, contexts, results ) {
4600
+ var i = 0,
4601
+ len = contexts.length;
4602
+ for ( ; i < len; i++ ) {
4603
+ Sizzle( selector, contexts[i], results );
4604
+ }
4605
+ return results;
4606
+ }
4607
+ function select( selector, context, results, seed ) {
4608
+ var i, tokens, token, type, find,
4609
+ match = tokenize( selector );
4610
+ if ( !seed ) {
4611
+ // Try to minimize operations if there is only one group
4612
+ if ( match.length === 1 ) {
4613
+ // Take a shortcut and set the context if the root selector is an ID
4614
+ tokens = match[0] = match[0].slice( 0 );
4615
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
4616
+ context.nodeType === 9 && !documentIsXML &&
4617
+ Expr.relative[ tokens[1].type ] ) {
4618
+ context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
4619
+ if ( !context ) {
4620
+ return results;
4621
+ }
4622
+ selector = selector.slice( tokens.shift().value.length );
4623
+ }
4624
+ // Fetch a seed set for right-to-left matching
4625
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
4626
+ while ( i-- ) {
4627
+ token = tokens[i];
4628
+ // Abort if we hit a combinator
4629
+ if ( Expr.relative[ (type = token.type) ] ) {
4630
+ break;
4631
+ }
4632
+ if ( (find = Expr.find[ type ]) ) {
4633
+ // Search, expanding context for leading sibling combinators
4634
+ if ( (seed = find(
4635
+ token.matches[0].replace( runescape, funescape ),
4636
+ rsibling.test( tokens[0].type ) && context.parentNode || context
4637
+ )) ) {
4638
+ // If seed is empty or no tokens remain, we can return early
4639
+ tokens.splice( i, 1 );
4640
+ selector = seed.length && toSelector( tokens );
4641
+ if ( !selector ) {
4642
+ push.apply( results, slice.call( seed, 0 ) );
4643
+ return results;
4644
+ }
4645
+ break;
4646
+ }
4647
+ }
4648
+ }
4649
+ }
4650
+ }
4651
+ // Compile and execute a filtering function
4652
+ // Provide `match` to avoid retokenization if we modified the selector above
4653
+ compile( selector, match )(
4654
+ seed,
4655
+ context,
4656
+ documentIsXML,
4657
+ results,
4658
+ rsibling.test( selector )
4659
+ );
4660
+ return results;
4661
+ }
4662
+ // Deprecated
4663
+ Expr.pseudos["nth"] = Expr.pseudos["eq"];
4664
+ // Easy API for creating new setFilters
4665
+ function setFilters() {}
4666
+ Expr.filters = setFilters.prototype = Expr.pseudos;
4667
+ Expr.setFilters = new setFilters();
4668
+ // Initialize with the default document
4669
+ setDocument();
4670
+ // Override sizzle attribute retrieval
4671
+ Sizzle.attr = jQuery.attr;
4672
+ jQuery.find = Sizzle;
4673
+ jQuery.expr = Sizzle.selectors;
4674
+ jQuery.expr[":"] = jQuery.expr.pseudos;
4675
+ jQuery.unique = Sizzle.uniqueSort;
4676
+ jQuery.text = Sizzle.getText;
4677
+ jQuery.isXMLDoc = Sizzle.isXML;
4678
+ jQuery.contains = Sizzle.contains;
4679
+ })( window );
4680
+ var runtil = /Until$/,
4681
+ rparentsprev = /^(?:parents|prev(?:Until|All))/,
4682
+ isSimple = /^.[^:#\[\.,]*$/,
4683
+ rneedsContext = jQuery.expr.match.needsContext,
4684
+ // methods guaranteed to produce a unique set when starting from a unique set
4685
+ guaranteedUnique = {
4686
+ children: true,
4687
+ contents: true,
4688
+ next: true,
4689
+ prev: true
4690
+ };
4691
+ jQuery.fn.extend({
4692
+ find: function( selector ) {
4693
+ var i, ret, self,
4694
+ len = this.length;
4695
+ if ( typeof selector !== "string" ) {
4696
+ self = this;
4697
+ return this.pushStack( jQuery( selector ).filter(function() {
4698
+ for ( i = 0; i < len; i++ ) {
4699
+ if ( jQuery.contains( self[ i ], this ) ) {
4700
+ return true;
4701
+ }
4702
+ }
4703
+ }) );
4704
+ }
4705
+ ret = [];
4706
+ for ( i = 0; i < len; i++ ) {
4707
+ jQuery.find( selector, this[ i ], ret );
4708
+ }
4709
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
4710
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
4711
+ ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
4712
+ return ret;
4713
+ },
4714
+ has: function( target ) {
4715
+ var i,
4716
+ targets = jQuery( target, this ),
4717
+ len = targets.length;
4718
+ return this.filter(function() {
4719
+ for ( i = 0; i < len; i++ ) {
4720
+ if ( jQuery.contains( this, targets[i] ) ) {
4721
+ return true;
4722
+ }
4723
+ }
4724
+ });
4725
+ },
4726
+ not: function( selector ) {
4727
+ return this.pushStack( winnow(this, selector, false) );
4728
+ },
4729
+ filter: function( selector ) {
4730
+ return this.pushStack( winnow(this, selector, true) );
4731
+ },
4732
+ is: function( selector ) {
4733
+ return !!selector && (
4734
+ typeof selector === "string" ?
4735
+ // If this is a positional/relative selector, check membership in the returned set
4736
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
4737
+ rneedsContext.test( selector ) ?
4738
+ jQuery( selector, this.context ).index( this[0] ) >= 0 :
4739
+ jQuery.filter( selector, this ).length > 0 :
4740
+ this.filter( selector ).length > 0 );
4741
+ },
4742
+ closest: function( selectors, context ) {
4743
+ var cur,
4744
+ i = 0,
4745
+ l = this.length,
4746
+ ret = [],
4747
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
4748
+ jQuery( selectors, context || this.context ) :
4749
+ 0;
4750
+ for ( ; i < l; i++ ) {
4751
+ cur = this[i];
4752
+ while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
4753
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
4754
+ ret.push( cur );
4755
+ break;
4756
+ }
4757
+ cur = cur.parentNode;
4758
+ }
4759
+ }
4760
+ return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
4761
+ },
4762
+ // Determine the position of an element within
4763
+ // the matched set of elements
4764
+ index: function( elem ) {
4765
+ // No argument, return index in parent
4766
+ if ( !elem ) {
4767
+ return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
4768
+ }
4769
+ // index in selector
4770
+ if ( typeof elem === "string" ) {
4771
+ return jQuery.inArray( this[0], jQuery( elem ) );
4772
+ }
4773
+ // Locate the position of the desired element
4774
+ return jQuery.inArray(
4775
+ // If it receives a jQuery object, the first element is used
4776
+ elem.jquery ? elem[0] : elem, this );
4777
+ },
4778
+ add: function( selector, context ) {
4779
+ var set = typeof selector === "string" ?
4780
+ jQuery( selector, context ) :
4781
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
4782
+ all = jQuery.merge( this.get(), set );
4783
+ return this.pushStack( jQuery.unique(all) );
4784
+ },
4785
+ addBack: function( selector ) {
4786
+ return this.add( selector == null ?
4787
+ this.prevObject : this.prevObject.filter(selector)
4788
+ );
4789
+ }
4790
+ });
4791
+ jQuery.fn.andSelf = jQuery.fn.addBack;
4792
+ function sibling( cur, dir ) {
4793
+ do {
4794
+ cur = cur[ dir ];
4795
+ } while ( cur && cur.nodeType !== 1 );
4796
+ return cur;
4797
+ }
4798
+ jQuery.each({
4799
+ parent: function( elem ) {
4800
+ var parent = elem.parentNode;
4801
+ return parent && parent.nodeType !== 11 ? parent : null;
4802
+ },
4803
+ parents: function( elem ) {
4804
+ return jQuery.dir( elem, "parentNode" );
4805
+ },
4806
+ parentsUntil: function( elem, i, until ) {
4807
+ return jQuery.dir( elem, "parentNode", until );
4808
+ },
4809
+ next: function( elem ) {
4810
+ return sibling( elem, "nextSibling" );
4811
+ },
4812
+ prev: function( elem ) {
4813
+ return sibling( elem, "previousSibling" );
4814
+ },
4815
+ nextAll: function( elem ) {
4816
+ return jQuery.dir( elem, "nextSibling" );
4817
+ },
4818
+ prevAll: function( elem ) {
4819
+ return jQuery.dir( elem, "previousSibling" );
4820
+ },
4821
+ nextUntil: function( elem, i, until ) {
4822
+ return jQuery.dir( elem, "nextSibling", until );
4823
+ },
4824
+ prevUntil: function( elem, i, until ) {
4825
+ return jQuery.dir( elem, "previousSibling", until );
4826
+ },
4827
+ siblings: function( elem ) {
4828
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
4829
+ },
4830
+ children: function( elem ) {
4831
+ return jQuery.sibling( elem.firstChild );
4832
+ },
4833
+ contents: function( elem ) {
4834
+ return jQuery.nodeName( elem, "iframe" ) ?
4835
+ elem.contentDocument || elem.contentWindow.document :
4836
+ jQuery.merge( [], elem.childNodes );
4837
+ }
4838
+ }, function( name, fn ) {
4839
+ jQuery.fn[ name ] = function( until, selector ) {
4840
+ var ret = jQuery.map( this, fn, until );
4841
+ if ( !runtil.test( name ) ) {
4842
+ selector = until;
4843
+ }
4844
+ if ( selector && typeof selector === "string" ) {
4845
+ ret = jQuery.filter( selector, ret );
4846
+ }
4847
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
4848
+ if ( this.length > 1 && rparentsprev.test( name ) ) {
4849
+ ret = ret.reverse();
4850
+ }
4851
+ return this.pushStack( ret );
4852
+ };
4853
+ });
4854
+ jQuery.extend({
4855
+ filter: function( expr, elems, not ) {
4856
+ if ( not ) {
4857
+ expr = ":not(" + expr + ")";
4858
+ }
4859
+ return elems.length === 1 ?
4860
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
4861
+ jQuery.find.matches(expr, elems);
4862
+ },
4863
+ dir: function( elem, dir, until ) {
4864
+ var matched = [],
4865
+ cur = elem[ dir ];
4866
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
4867
+ if ( cur.nodeType === 1 ) {
4868
+ matched.push( cur );
4869
+ }
4870
+ cur = cur[dir];
4871
+ }
4872
+ return matched;
4873
+ },
4874
+ sibling: function( n, elem ) {
4875
+ var r = [];
4876
+ for ( ; n; n = n.nextSibling ) {
4877
+ if ( n.nodeType === 1 && n !== elem ) {
4878
+ r.push( n );
4879
+ }
4880
+ }
4881
+ return r;
4882
+ }
4883
+ });
4884
+ // Implement the identical functionality for filter and not
4885
+ function winnow( elements, qualifier, keep ) {
4886
+ // Can't pass null or undefined to indexOf in Firefox 4
4887
+ // Set to 0 to skip string check
4888
+ qualifier = qualifier || 0;
4889
+ if ( jQuery.isFunction( qualifier ) ) {
4890
+ return jQuery.grep(elements, function( elem, i ) {
4891
+ var retVal = !!qualifier.call( elem, i, elem );
4892
+ return retVal === keep;
4893
+ });
4894
+ } else if ( qualifier.nodeType ) {
4895
+ return jQuery.grep(elements, function( elem ) {
4896
+ return ( elem === qualifier ) === keep;
4897
+ });
4898
+ } else if ( typeof qualifier === "string" ) {
4899
+ var filtered = jQuery.grep(elements, function( elem ) {
4900
+ return elem.nodeType === 1;
4901
+ });
4902
+ if ( isSimple.test( qualifier ) ) {
4903
+ return jQuery.filter(qualifier, filtered, !keep);
4904
+ } else {
4905
+ qualifier = jQuery.filter( qualifier, filtered );
4906
+ }
4907
+ }
4908
+ return jQuery.grep(elements, function( elem ) {
4909
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
4910
+ });
4911
+ }
4912
+ function createSafeFragment( document ) {
4913
+ var list = nodeNames.split( "|" ),
4914
+ safeFrag = document.createDocumentFragment();
4915
+ if ( safeFrag.createElement ) {
4916
+ while ( list.length ) {
4917
+ safeFrag.createElement(
4918
+ list.pop()
4919
+ );
4920
+ }
4921
+ }
4922
+ return safeFrag;
4923
+ }
4924
+ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
4925
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
4926
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
4927
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
4928
+ rleadingWhitespace = /^\s+/,
4929
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
4930
+ rtagName = /<([\w:]+)/,
4931
+ rtbody = /<tbody/i,
4932
+ rhtml = /<|&#?\w+;/,
4933
+ rnoInnerhtml = /<(?:script|style|link)/i,
4934
+ manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
4935
+ // checked="checked" or checked
4936
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
4937
+ rscriptType = /^$|\/(?:java|ecma)script/i,
4938
+ rscriptTypeMasked = /^true\/(.*)/,
4939
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
4940
+ // We have to close these tags to support XHTML (#13200)
4941
+ wrapMap = {
4942
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
4943
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
4944
+ area: [ 1, "<map>", "</map>" ],
4945
+ param: [ 1, "<object>", "</object>" ],
4946
+ thead: [ 1, "<table>", "</table>" ],
4947
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4948
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
4949
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4950
+ // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
4951
+ // unless wrapped in a div with non-breaking characters in front of it.
4952
+ _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
4953
+ },
4954
+ safeFragment = createSafeFragment( document ),
4955
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
4956
+ wrapMap.optgroup = wrapMap.option;
4957
+ wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4958
+ wrapMap.th = wrapMap.td;
4959
+ jQuery.fn.extend({
4960
+ text: function( value ) {
4961
+ return jQuery.access( this, function( value ) {
4962
+ return value === undefined ?
4963
+ jQuery.text( this ) :
4964
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
4965
+ }, null, value, arguments.length );
4966
+ },
4967
+ wrapAll: function( html ) {
4968
+ if ( jQuery.isFunction( html ) ) {
4969
+ return this.each(function(i) {
4970
+ jQuery(this).wrapAll( html.call(this, i) );
4971
+ });
4972
+ }
4973
+ if ( this[0] ) {
4974
+ // The elements to wrap the target around
4975
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
4976
+ if ( this[0].parentNode ) {
4977
+ wrap.insertBefore( this[0] );
4978
+ }
4979
+ wrap.map(function() {
4980
+ var elem = this;
4981
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
4982
+ elem = elem.firstChild;
4983
+ }
4984
+ return elem;
4985
+ }).append( this );
4986
+ }
4987
+ return this;
4988
+ },
4989
+ wrapInner: function( html ) {
4990
+ if ( jQuery.isFunction( html ) ) {
4991
+ return this.each(function(i) {
4992
+ jQuery(this).wrapInner( html.call(this, i) );
4993
+ });
4994
+ }
4995
+ return this.each(function() {
4996
+ var self = jQuery( this ),
4997
+ contents = self.contents();
4998
+ if ( contents.length ) {
4999
+ contents.wrapAll( html );
5000
+ } else {
5001
+ self.append( html );
5002
+ }
5003
+ });
5004
+ },
5005
+ wrap: function( html ) {
5006
+ var isFunction = jQuery.isFunction( html );
5007
+ return this.each(function(i) {
5008
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
5009
+ });
5010
+ },
5011
+ unwrap: function() {
5012
+ return this.parent().each(function() {
5013
+ if ( !jQuery.nodeName( this, "body" ) ) {
5014
+ jQuery( this ).replaceWith( this.childNodes );
5015
+ }
5016
+ }).end();
5017
+ },
5018
+ append: function() {
5019
+ return this.domManip(arguments, true, function( elem ) {
5020
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5021
+ this.appendChild( elem );
5022
+ }
5023
+ });
5024
+ },
5025
+ prepend: function() {
5026
+ return this.domManip(arguments, true, function( elem ) {
5027
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5028
+ this.insertBefore( elem, this.firstChild );
5029
+ }
5030
+ });
5031
+ },
5032
+ before: function() {
5033
+ return this.domManip( arguments, false, function( elem ) {
5034
+ if ( this.parentNode ) {
5035
+ this.parentNode.insertBefore( elem, this );
5036
+ }
5037
+ });
5038
+ },
5039
+ after: function() {
5040
+ return this.domManip( arguments, false, function( elem ) {
5041
+ if ( this.parentNode ) {
5042
+ this.parentNode.insertBefore( elem, this.nextSibling );
5043
+ }
5044
+ });
5045
+ },
5046
+ // keepData is for internal use only--do not document
5047
+ remove: function( selector, keepData ) {
5048
+ var elem,
5049
+ i = 0;
5050
+ for ( ; (elem = this[i]) != null; i++ ) {
5051
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
5052
+ if ( !keepData && elem.nodeType === 1 ) {
5053
+ jQuery.cleanData( getAll( elem ) );
5054
+ }
5055
+ if ( elem.parentNode ) {
5056
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
5057
+ setGlobalEval( getAll( elem, "script" ) );
5058
+ }
5059
+ elem.parentNode.removeChild( elem );
5060
+ }
5061
+ }
5062
+ }
5063
+ return this;
5064
+ },
5065
+ empty: function() {
5066
+ var elem,
5067
+ i = 0;
5068
+ for ( ; (elem = this[i]) != null; i++ ) {
5069
+ // Remove element nodes and prevent memory leaks
5070
+ if ( elem.nodeType === 1 ) {
5071
+ jQuery.cleanData( getAll( elem, false ) );
5072
+ }
5073
+ // Remove any remaining nodes
5074
+ while ( elem.firstChild ) {
5075
+ elem.removeChild( elem.firstChild );
5076
+ }
5077
+ // If this is a select, ensure that it displays empty (#12336)
5078
+ // Support: IE<9
5079
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
5080
+ elem.options.length = 0;
5081
+ }
5082
+ }
5083
+ return this;
5084
+ },
5085
+ clone: function( dataAndEvents, deepDataAndEvents ) {
5086
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5087
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5088
+ return this.map( function () {
5089
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5090
+ });
5091
+ },
5092
+ html: function( value ) {
5093
+ return jQuery.access( this, function( value ) {
5094
+ var elem = this[0] || {},
5095
+ i = 0,
5096
+ l = this.length;
5097
+ if ( value === undefined ) {
5098
+ return elem.nodeType === 1 ?
5099
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
5100
+ undefined;
5101
+ }
5102
+ // See if we can take a shortcut and just use innerHTML
5103
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5104
+ ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
5105
+ ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
5106
+ !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
5107
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
5108
+ try {
5109
+ for (; i < l; i++ ) {
5110
+ // Remove element nodes and prevent memory leaks
5111
+ elem = this[i] || {};
5112
+ if ( elem.nodeType === 1 ) {
5113
+ jQuery.cleanData( getAll( elem, false ) );
5114
+ elem.innerHTML = value;
5115
+ }
5116
+ }
5117
+ elem = 0;
5118
+ // If using innerHTML throws an exception, use the fallback method
5119
+ } catch(e) {}
5120
+ }
5121
+ if ( elem ) {
5122
+ this.empty().append( value );
5123
+ }
5124
+ }, null, value, arguments.length );
5125
+ },
5126
+ replaceWith: function( value ) {
5127
+ var isFunc = jQuery.isFunction( value );
5128
+ // Make sure that the elements are removed from the DOM before they are inserted
5129
+ // this can help fix replacing a parent with child elements
5130
+ if ( !isFunc && typeof value !== "string" ) {
5131
+ value = jQuery( value ).not( this ).detach();
5132
+ }
5133
+ return this.domManip( [ value ], true, function( elem ) {
5134
+ var next = this.nextSibling,
5135
+ parent = this.parentNode;
5136
+ if ( parent ) {
5137
+ jQuery( this ).remove();
5138
+ parent.insertBefore( elem, next );
5139
+ }
5140
+ });
5141
+ },
5142
+ detach: function( selector ) {
5143
+ return this.remove( selector, true );
5144
+ },
5145
+ domManip: function( args, table, callback ) {
5146
+ // Flatten any nested arrays
5147
+ args = core_concat.apply( [], args );
5148
+ var first, node, hasScripts,
5149
+ scripts, doc, fragment,
5150
+ i = 0,
5151
+ l = this.length,
5152
+ set = this,
5153
+ iNoClone = l - 1,
5154
+ value = args[0],
5155
+ isFunction = jQuery.isFunction( value );
5156
+ // We can't cloneNode fragments that contain checked, in WebKit
5157
+ if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
5158
+ return this.each(function( index ) {
5159
+ var self = set.eq( index );
5160
+ if ( isFunction ) {
5161
+ args[0] = value.call( this, index, table ? self.html() : undefined );
5162
+ }
5163
+ self.domManip( args, table, callback );
5164
+ });
5165
+ }
5166
+ if ( l ) {
5167
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
5168
+ first = fragment.firstChild;
5169
+ if ( fragment.childNodes.length === 1 ) {
5170
+ fragment = first;
5171
+ }
5172
+ if ( first ) {
5173
+ table = table && jQuery.nodeName( first, "tr" );
5174
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5175
+ hasScripts = scripts.length;
5176
+ // Use the original fragment for the last item instead of the first because it can end up
5177
+ // being emptied incorrectly in certain situations (#8070).
5178
+ for ( ; i < l; i++ ) {
5179
+ node = fragment;
5180
+ if ( i !== iNoClone ) {
5181
+ node = jQuery.clone( node, true, true );
5182
+ // Keep references to cloned scripts for later restoration
5183
+ if ( hasScripts ) {
5184
+ jQuery.merge( scripts, getAll( node, "script" ) );
5185
+ }
5186
+ }
5187
+ callback.call(
5188
+ table && jQuery.nodeName( this[i], "table" ) ?
5189
+ findOrAppend( this[i], "tbody" ) :
5190
+ this[i],
5191
+ node,
5192
+ i
5193
+ );
5194
+ }
5195
+ if ( hasScripts ) {
5196
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
5197
+ // Reenable scripts
5198
+ jQuery.map( scripts, restoreScript );
5199
+ // Evaluate executable scripts on first document insertion
5200
+ for ( i = 0; i < hasScripts; i++ ) {
5201
+ node = scripts[ i ];
5202
+ if ( rscriptType.test( node.type || "" ) &&
5203
+ !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
5204
+ if ( node.src ) {
5205
+ // Hope ajax is available...
5206
+ jQuery.ajax({
5207
+ url: node.src,
5208
+ type: "GET",
5209
+ dataType: "script",
5210
+ async: false,
5211
+ global: false,
5212
+ "throws": true
5213
+ });
5214
+ } else {
5215
+ jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
5216
+ }
5217
+ }
5218
+ }
5219
+ }
5220
+ // Fix #11809: Avoid leaking memory
5221
+ fragment = first = null;
5222
+ }
5223
+ }
5224
+ return this;
5225
+ }
5226
+ });
5227
+ function findOrAppend( elem, tag ) {
5228
+ return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
5229
+ }
5230
+ // Replace/restore the type attribute of script elements for safe DOM manipulation
5231
+ function disableScript( elem ) {
5232
+ var attr = elem.getAttributeNode("type");
5233
+ elem.type = ( attr && attr.specified ) + "/" + elem.type;
5234
+ return elem;
5235
+ }
5236
+ function restoreScript( elem ) {
5237
+ var match = rscriptTypeMasked.exec( elem.type );
5238
+ if ( match ) {
5239
+ elem.type = match[1];
5240
+ } else {
5241
+ elem.removeAttribute("type");
5242
+ }
5243
+ return elem;
5244
+ }
5245
+ // Mark scripts as having already been evaluated
5246
+ function setGlobalEval( elems, refElements ) {
5247
+ var elem,
5248
+ i = 0;
5249
+ for ( ; (elem = elems[i]) != null; i++ ) {
5250
+ jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
5251
+ }
5252
+ }
5253
+ function cloneCopyEvent( src, dest ) {
5254
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
5255
+ return;
5256
+ }
5257
+ var type, i, l,
5258
+ oldData = jQuery._data( src ),
5259
+ curData = jQuery._data( dest, oldData ),
5260
+ events = oldData.events;
5261
+ if ( events ) {
5262
+ delete curData.handle;
5263
+ curData.events = {};
5264
+ for ( type in events ) {
5265
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5266
+ jQuery.event.add( dest, type, events[ type ][ i ] );
5267
+ }
5268
+ }
5269
+ }
5270
+ // make the cloned public data object a copy from the original
5271
+ if ( curData.data ) {
5272
+ curData.data = jQuery.extend( {}, curData.data );
5273
+ }
5274
+ }
5275
+ function fixCloneNodeIssues( src, dest ) {
5276
+ var nodeName, e, data;
5277
+ // We do not need to do anything for non-Elements
5278
+ if ( dest.nodeType !== 1 ) {
5279
+ return;
5280
+ }
5281
+ nodeName = dest.nodeName.toLowerCase();
5282
+ // IE6-8 copies events bound via attachEvent when using cloneNode.
5283
+ if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
5284
+ data = jQuery._data( dest );
5285
+ for ( e in data.events ) {
5286
+ jQuery.removeEvent( dest, e, data.handle );
5287
+ }
5288
+ // Event data gets referenced instead of copied if the expando gets copied too
5289
+ dest.removeAttribute( jQuery.expando );
5290
+ }
5291
+ // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
5292
+ if ( nodeName === "script" && dest.text !== src.text ) {
5293
+ disableScript( dest ).text = src.text;
5294
+ restoreScript( dest );
5295
+ // IE6-10 improperly clones children of object elements using classid.
5296
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
5297
+ } else if ( nodeName === "object" ) {
5298
+ if ( dest.parentNode ) {
5299
+ dest.outerHTML = src.outerHTML;
5300
+ }
5301
+ // This path appears unavoidable for IE9. When cloning an object
5302
+ // element in IE9, the outerHTML strategy above is not sufficient.
5303
+ // If the src has innerHTML and the destination does not,
5304
+ // copy the src.innerHTML into the dest.innerHTML. #10324
5305
+ if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
5306
+ dest.innerHTML = src.innerHTML;
5307
+ }
5308
+ } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
5309
+ // IE6-8 fails to persist the checked state of a cloned checkbox
5310
+ // or radio button. Worse, IE6-7 fail to give the cloned element
5311
+ // a checked appearance if the defaultChecked value isn't also set
5312
+ dest.defaultChecked = dest.checked = src.checked;
5313
+ // IE6-7 get confused and end up setting the value of a cloned
5314
+ // checkbox/radio button to an empty string instead of "on"
5315
+ if ( dest.value !== src.value ) {
5316
+ dest.value = src.value;
5317
+ }
5318
+ // IE6-8 fails to return the selected option to the default selected
5319
+ // state when cloning options
5320
+ } else if ( nodeName === "option" ) {
5321
+ dest.defaultSelected = dest.selected = src.defaultSelected;
5322
+ // IE6-8 fails to set the defaultValue to the correct value when
5323
+ // cloning other types of input fields
5324
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
5325
+ dest.defaultValue = src.defaultValue;
5326
+ }
5327
+ }
5328
+ jQuery.each({
5329
+ appendTo: "append",
5330
+ prependTo: "prepend",
5331
+ insertBefore: "before",
5332
+ insertAfter: "after",
5333
+ replaceAll: "replaceWith"
5334
+ }, function( name, original ) {
5335
+ jQuery.fn[ name ] = function( selector ) {
5336
+ var elems,
5337
+ i = 0,
5338
+ ret = [],
5339
+ insert = jQuery( selector ),
5340
+ last = insert.length - 1;
5341
+ for ( ; i <= last; i++ ) {
5342
+ elems = i === last ? this : this.clone(true);
5343
+ jQuery( insert[i] )[ original ]( elems );
5344
+ // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
5345
+ core_push.apply( ret, elems.get() );
5346
+ }
5347
+ return this.pushStack( ret );
5348
+ };
5349
+ });
5350
+ function getAll( context, tag ) {
5351
+ var elems, elem,
5352
+ i = 0,
5353
+ found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
5354
+ typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
5355
+ undefined;
5356
+ if ( !found ) {
5357
+ for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
5358
+ if ( !tag || jQuery.nodeName( elem, tag ) ) {
5359
+ found.push( elem );
5360
+ } else {
5361
+ jQuery.merge( found, getAll( elem, tag ) );
5362
+ }
5363
+ }
5364
+ }
5365
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
5366
+ jQuery.merge( [ context ], found ) :
5367
+ found;
5368
+ }
5369
+ // Used in buildFragment, fixes the defaultChecked property
5370
+ function fixDefaultChecked( elem ) {
5371
+ if ( manipulation_rcheckableType.test( elem.type ) ) {
5372
+ elem.defaultChecked = elem.checked;
5373
+ }
5374
+ }
5375
+ jQuery.extend({
5376
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5377
+ var destElements, node, clone, i, srcElements,
5378
+ inPage = jQuery.contains( elem.ownerDocument, elem );
5379
+ if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
5380
+ clone = elem.cloneNode( true );
5381
+ // IE<=8 does not properly clone detached, unknown element nodes
5382
+ } else {
5383
+ fragmentDiv.innerHTML = elem.outerHTML;
5384
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
5385
+ }
5386
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
5387
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
5388
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
5389
+ destElements = getAll( clone );
5390
+ srcElements = getAll( elem );
5391
+ // Fix all IE cloning issues
5392
+ for ( i = 0; (node = srcElements[i]) != null; ++i ) {
5393
+ // Ensure that the destination node is not null; Fixes #9587
5394
+ if ( destElements[i] ) {
5395
+ fixCloneNodeIssues( node, destElements[i] );
5396
+ }
5397
+ }
5398
+ }
5399
+ // Copy the events from the original to the clone
5400
+ if ( dataAndEvents ) {
5401
+ if ( deepDataAndEvents ) {
5402
+ srcElements = srcElements || getAll( elem );
5403
+ destElements = destElements || getAll( clone );
5404
+ for ( i = 0; (node = srcElements[i]) != null; i++ ) {
5405
+ cloneCopyEvent( node, destElements[i] );
5406
+ }
5407
+ } else {
5408
+ cloneCopyEvent( elem, clone );
5409
+ }
5410
+ }
5411
+ // Preserve script evaluation history
5412
+ destElements = getAll( clone, "script" );
5413
+ if ( destElements.length > 0 ) {
5414
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5415
+ }
5416
+ destElements = srcElements = node = null;
5417
+ // Return the cloned set
5418
+ return clone;
5419
+ },
5420
+ buildFragment: function( elems, context, scripts, selection ) {
5421
+ var j, elem, contains,
5422
+ tmp, tag, tbody, wrap,
5423
+ l = elems.length,
5424
+ // Ensure a safe fragment
5425
+ safe = createSafeFragment( context ),
5426
+ nodes = [],
5427
+ i = 0;
5428
+ for ( ; i < l; i++ ) {
5429
+ elem = elems[ i ];
5430
+ if ( elem || elem === 0 ) {
5431
+ // Add nodes directly
5432
+ if ( jQuery.type( elem ) === "object" ) {
5433
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
5434
+ // Convert non-html into a text node
5435
+ } else if ( !rhtml.test( elem ) ) {
5436
+ nodes.push( context.createTextNode( elem ) );
5437
+ // Convert html into DOM nodes
5438
+ } else {
5439
+ tmp = tmp || safe.appendChild( context.createElement("div") );
5440
+ // Deserialize a standard representation
5441
+ tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
5442
+ wrap = wrapMap[ tag ] || wrapMap._default;
5443
+ tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
5444
+ // Descend through wrappers to the right content
5445
+ j = wrap[0];
5446
+ while ( j-- ) {
5447
+ tmp = tmp.lastChild;
5448
+ }
5449
+ // Manually add leading whitespace removed by IE
5450
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
5451
+ nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
5452
+ }
5453
+ // Remove IE's autoinserted <tbody> from table fragments
5454
+ if ( !jQuery.support.tbody ) {
5455
+ // String was a <table>, *may* have spurious <tbody>
5456
+ elem = tag === "table" && !rtbody.test( elem ) ?
5457
+ tmp.firstChild :
5458
+ // String was a bare <thead> or <tfoot>
5459
+ wrap[1] === "<table>" && !rtbody.test( elem ) ?
5460
+ tmp :
5461
+ 0;
5462
+ j = elem && elem.childNodes.length;
5463
+ while ( j-- ) {
5464
+ if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
5465
+ elem.removeChild( tbody );
5466
+ }
5467
+ }
5468
+ }
5469
+ jQuery.merge( nodes, tmp.childNodes );
5470
+ // Fix #12392 for WebKit and IE > 9
5471
+ tmp.textContent = "";
5472
+ // Fix #12392 for oldIE
5473
+ while ( tmp.firstChild ) {
5474
+ tmp.removeChild( tmp.firstChild );
5475
+ }
5476
+ // Remember the top-level container for proper cleanup
5477
+ tmp = safe.lastChild;
5478
+ }
5479
+ }
5480
+ }
5481
+ // Fix #11356: Clear elements from fragment
5482
+ if ( tmp ) {
5483
+ safe.removeChild( tmp );
5484
+ }
5485
+ // Reset defaultChecked for any radios and checkboxes
5486
+ // about to be appended to the DOM in IE 6/7 (#8060)
5487
+ if ( !jQuery.support.appendChecked ) {
5488
+ jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
5489
+ }
5490
+ i = 0;
5491
+ while ( (elem = nodes[ i++ ]) ) {
5492
+ // #4087 - If origin and destination elements are the same, and this is
5493
+ // that element, do not do anything
5494
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
5495
+ continue;
5496
+ }
5497
+ contains = jQuery.contains( elem.ownerDocument, elem );
5498
+ // Append to fragment
5499
+ tmp = getAll( safe.appendChild( elem ), "script" );
5500
+ // Preserve script evaluation history
5501
+ if ( contains ) {
5502
+ setGlobalEval( tmp );
5503
+ }
5504
+ // Capture executables
5505
+ if ( scripts ) {
5506
+ j = 0;
5507
+ while ( (elem = tmp[ j++ ]) ) {
5508
+ if ( rscriptType.test( elem.type || "" ) ) {
5509
+ scripts.push( elem );
5510
+ }
5511
+ }
5512
+ }
5513
+ }
5514
+ tmp = null;
5515
+ return safe;
5516
+ },
5517
+ cleanData: function( elems, /* internal */ acceptData ) {
5518
+ var elem, type, id, data,
5519
+ i = 0,
5520
+ internalKey = jQuery.expando,
5521
+ cache = jQuery.cache,
5522
+ deleteExpando = jQuery.support.deleteExpando,
5523
+ special = jQuery.event.special;
5524
+ for ( ; (elem = elems[i]) != null; i++ ) {
5525
+ if ( acceptData || jQuery.acceptData( elem ) ) {
5526
+ id = elem[ internalKey ];
5527
+ data = id && cache[ id ];
5528
+ if ( data ) {
5529
+ if ( data.events ) {
5530
+ for ( type in data.events ) {
5531
+ if ( special[ type ] ) {
5532
+ jQuery.event.remove( elem, type );
5533
+ // This is a shortcut to avoid jQuery.event.remove's overhead
5534
+ } else {
5535
+ jQuery.removeEvent( elem, type, data.handle );
5536
+ }
5537
+ }
5538
+ }
5539
+ // Remove cache only if it was not already removed by jQuery.event.remove
5540
+ if ( cache[ id ] ) {
5541
+ delete cache[ id ];
5542
+ // IE does not allow us to delete expando properties from nodes,
5543
+ // nor does it have a removeAttribute function on Document nodes;
5544
+ // we must handle all of these cases
5545
+ if ( deleteExpando ) {
5546
+ delete elem[ internalKey ];
5547
+ } else if ( typeof elem.removeAttribute !== core_strundefined ) {
5548
+ elem.removeAttribute( internalKey );
5549
+ } else {
5550
+ elem[ internalKey ] = null;
5551
+ }
5552
+ core_deletedIds.push( id );
5553
+ }
5554
+ }
5555
+ }
5556
+ }
5557
+ }
5558
+ });
5559
+ var iframe, getStyles, curCSS,
5560
+ ralpha = /alpha\([^)]*\)/i,
5561
+ ropacity = /opacity\s*=\s*([^)]*)/,
5562
+ rposition = /^(top|right|bottom|left)$/,
5563
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
5564
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
5565
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
5566
+ rmargin = /^margin/,
5567
+ rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
5568
+ rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
5569
+ rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
5570
+ elemdisplay = { BODY: "block" },
5571
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
5572
+ cssNormalTransform = {
5573
+ letterSpacing: 0,
5574
+ fontWeight: 400
5575
+ },
5576
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
5577
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
5578
+ // return a css property mapped to a potentially vendor prefixed property
5579
+ function vendorPropName( style, name ) {
5580
+ // shortcut for names that are not vendor prefixed
5581
+ if ( name in style ) {
5582
+ return name;
5583
+ }
5584
+ // check for vendor prefixed names
5585
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
5586
+ origName = name,
5587
+ i = cssPrefixes.length;
5588
+ while ( i-- ) {
5589
+ name = cssPrefixes[ i ] + capName;
5590
+ if ( name in style ) {
5591
+ return name;
5592
+ }
5593
+ }
5594
+ return origName;
5595
+ }
5596
+ function isHidden( elem, el ) {
5597
+ // isHidden might be called from jQuery#filter function;
5598
+ // in that case, element will be second argument
5599
+ elem = el || elem;
5600
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
5601
+ }
5602
+ function showHide( elements, show ) {
5603
+ var display, elem, hidden,
5604
+ values = [],
5605
+ index = 0,
5606
+ length = elements.length;
5607
+ for ( ; index < length; index++ ) {
5608
+ elem = elements[ index ];
5609
+ if ( !elem.style ) {
5610
+ continue;
5611
+ }
5612
+ values[ index ] = jQuery._data( elem, "olddisplay" );
5613
+ display = elem.style.display;
5614
+ if ( show ) {
5615
+ // Reset the inline display of this element to learn if it is
5616
+ // being hidden by cascaded rules or not
5617
+ if ( !values[ index ] && display === "none" ) {
5618
+ elem.style.display = "";
5619
+ }
5620
+ // Set elements which have been overridden with display: none
5621
+ // in a stylesheet to whatever the default browser style is
5622
+ // for such an element
5623
+ if ( elem.style.display === "" && isHidden( elem ) ) {
5624
+ values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
5625
+ }
5626
+ } else {
5627
+ if ( !values[ index ] ) {
5628
+ hidden = isHidden( elem );
5629
+ if ( display && display !== "none" || !hidden ) {
5630
+ jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
5631
+ }
5632
+ }
5633
+ }
5634
+ }
5635
+ // Set the display of most of the elements in a second loop
5636
+ // to avoid the constant reflow
5637
+ for ( index = 0; index < length; index++ ) {
5638
+ elem = elements[ index ];
5639
+ if ( !elem.style ) {
5640
+ continue;
5641
+ }
5642
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
5643
+ elem.style.display = show ? values[ index ] || "" : "none";
5644
+ }
5645
+ }
5646
+ return elements;
5647
+ }
5648
+ jQuery.fn.extend({
5649
+ css: function( name, value ) {
5650
+ return jQuery.access( this, function( elem, name, value ) {
5651
+ var len, styles,
5652
+ map = {},
5653
+ i = 0;
5654
+ if ( jQuery.isArray( name ) ) {
5655
+ styles = getStyles( elem );
5656
+ len = name.length;
5657
+ for ( ; i < len; i++ ) {
5658
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
5659
+ }
5660
+ return map;
5661
+ }
5662
+ return value !== undefined ?
5663
+ jQuery.style( elem, name, value ) :
5664
+ jQuery.css( elem, name );
5665
+ }, name, value, arguments.length > 1 );
5666
+ },
5667
+ show: function() {
5668
+ return showHide( this, true );
5669
+ },
5670
+ hide: function() {
5671
+ return showHide( this );
5672
+ },
5673
+ toggle: function( state ) {
5674
+ var bool = typeof state === "boolean";
5675
+ return this.each(function() {
5676
+ if ( bool ? state : isHidden( this ) ) {
5677
+ jQuery( this ).show();
5678
+ } else {
5679
+ jQuery( this ).hide();
5680
+ }
5681
+ });
5682
+ }
5683
+ });
5684
+ jQuery.extend({
5685
+ // Add in style property hooks for overriding the default
5686
+ // behavior of getting and setting a style property
5687
+ cssHooks: {
5688
+ opacity: {
5689
+ get: function( elem, computed ) {
5690
+ if ( computed ) {
5691
+ // We should always get a number back from opacity
5692
+ var ret = curCSS( elem, "opacity" );
5693
+ return ret === "" ? "1" : ret;
5694
+ }
5695
+ }
5696
+ }
5697
+ },
5698
+ // Exclude the following css properties to add px
5699
+ cssNumber: {
5700
+ "columnCount": true,
5701
+ "fillOpacity": true,
5702
+ "fontWeight": true,
5703
+ "lineHeight": true,
5704
+ "opacity": true,
5705
+ "orphans": true,
5706
+ "widows": true,
5707
+ "zIndex": true,
5708
+ "zoom": true
5709
+ },
5710
+ // Add in properties whose names you wish to fix before
5711
+ // setting or getting the value
5712
+ cssProps: {
5713
+ // normalize float css property
5714
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
5715
+ },
5716
+ // Get and set the style property on a DOM Node
5717
+ style: function( elem, name, value, extra ) {
5718
+ // Don't set styles on text and comment nodes
5719
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
5720
+ return;
5721
+ }
5722
+ // Make sure that we're working with the right name
5723
+ var ret, type, hooks,
5724
+ origName = jQuery.camelCase( name ),
5725
+ style = elem.style;
5726
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
5727
+ // gets hook for the prefixed version
5728
+ // followed by the unprefixed version
5729
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
5730
+ // Check if we're setting a value
5731
+ if ( value !== undefined ) {
5732
+ type = typeof value;
5733
+ // convert relative number strings (+= or -=) to relative numbers. #7345
5734
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
5735
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
5736
+ // Fixes bug #9237
5737
+ type = "number";
5738
+ }
5739
+ // Make sure that NaN and null values aren't set. See: #7116
5740
+ if ( value == null || type === "number" && isNaN( value ) ) {
5741
+ return;
5742
+ }
5743
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
5744
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
5745
+ value += "px";
5746
+ }
5747
+ // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
5748
+ // but it would mean to define eight (for every problematic property) identical functions
5749
+ if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
5750
+ style[ name ] = "inherit";
5751
+ }
5752
+ // If a hook was provided, use that value, otherwise just set the specified value
5753
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
5754
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
5755
+ // Fixes bug #5509
5756
+ try {
5757
+ style[ name ] = value;
5758
+ } catch(e) {}
5759
+ }
5760
+ } else {
5761
+ // If a hook was provided get the non-computed value from there
5762
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
5763
+ return ret;
5764
+ }
5765
+ // Otherwise just get the value from the style object
5766
+ return style[ name ];
5767
+ }
5768
+ },
5769
+ css: function( elem, name, extra, styles ) {
5770
+ var num, val, hooks,
5771
+ origName = jQuery.camelCase( name );
5772
+ // Make sure that we're working with the right name
5773
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
5774
+ // gets hook for the prefixed version
5775
+ // followed by the unprefixed version
5776
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
5777
+ // If a hook was provided get the computed value from there
5778
+ if ( hooks && "get" in hooks ) {
5779
+ val = hooks.get( elem, true, extra );
5780
+ }
5781
+ // Otherwise, if a way to get the computed value exists, use that
5782
+ if ( val === undefined ) {
5783
+ val = curCSS( elem, name, styles );
5784
+ }
5785
+ //convert "normal" to computed value
5786
+ if ( val === "normal" && name in cssNormalTransform ) {
5787
+ val = cssNormalTransform[ name ];
5788
+ }
5789
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
5790
+ if ( extra === "" || extra ) {
5791
+ num = parseFloat( val );
5792
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
5793
+ }
5794
+ return val;
5795
+ },
5796
+ // A method for quickly swapping in/out CSS properties to get correct calculations
5797
+ swap: function( elem, options, callback, args ) {
5798
+ var ret, name,
5799
+ old = {};
5800
+ // Remember the old values, and insert the new ones
5801
+ for ( name in options ) {
5802
+ old[ name ] = elem.style[ name ];
5803
+ elem.style[ name ] = options[ name ];
5804
+ }
5805
+ ret = callback.apply( elem, args || [] );
5806
+ // Revert the old values
5807
+ for ( name in options ) {
5808
+ elem.style[ name ] = old[ name ];
5809
+ }
5810
+ return ret;
5811
+ }
5812
+ });
5813
+ // NOTE: we've included the "window" in window.getComputedStyle
5814
+ // because jsdom on node.js will break without it.
5815
+ if ( window.getComputedStyle ) {
5816
+ getStyles = function( elem ) {
5817
+ return window.getComputedStyle( elem, null );
5818
+ };
5819
+ curCSS = function( elem, name, _computed ) {
5820
+ var width, minWidth, maxWidth,
5821
+ computed = _computed || getStyles( elem ),
5822
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
5823
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
5824
+ style = elem.style;
5825
+ if ( computed ) {
5826
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
5827
+ ret = jQuery.style( elem, name );
5828
+ }
5829
+ // A tribute to the "awesome hack by Dean Edwards"
5830
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
5831
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
5832
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
5833
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
5834
+ // Remember the original values
5835
+ width = style.width;
5836
+ minWidth = style.minWidth;
5837
+ maxWidth = style.maxWidth;
5838
+ // Put in the new values to get a computed value out
5839
+ style.minWidth = style.maxWidth = style.width = ret;
5840
+ ret = computed.width;
5841
+ // Revert the changed values
5842
+ style.width = width;
5843
+ style.minWidth = minWidth;
5844
+ style.maxWidth = maxWidth;
5845
+ }
5846
+ }
5847
+ return ret;
5848
+ };
5849
+ } else if ( document.documentElement.currentStyle ) {
5850
+ getStyles = function( elem ) {
5851
+ return elem.currentStyle;
5852
+ };
5853
+ curCSS = function( elem, name, _computed ) {
5854
+ var left, rs, rsLeft,
5855
+ computed = _computed || getStyles( elem ),
5856
+ ret = computed ? computed[ name ] : undefined,
5857
+ style = elem.style;
5858
+ // Avoid setting ret to empty string here
5859
+ // so we don't default to auto
5860
+ if ( ret == null && style && style[ name ] ) {
5861
+ ret = style[ name ];
5862
+ }
5863
+ // From the awesome hack by Dean Edwards
5864
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
5865
+ // If we're not dealing with a regular pixel number
5866
+ // but a number that has a weird ending, we need to convert it to pixels
5867
+ // but not position css attributes, as those are proportional to the parent element instead
5868
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
5869
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
5870
+ // Remember the original values
5871
+ left = style.left;
5872
+ rs = elem.runtimeStyle;
5873
+ rsLeft = rs && rs.left;
5874
+ // Put in the new values to get a computed value out
5875
+ if ( rsLeft ) {
5876
+ rs.left = elem.currentStyle.left;
5877
+ }
5878
+ style.left = name === "fontSize" ? "1em" : ret;
5879
+ ret = style.pixelLeft + "px";
5880
+ // Revert the changed values
5881
+ style.left = left;
5882
+ if ( rsLeft ) {
5883
+ rs.left = rsLeft;
5884
+ }
5885
+ }
5886
+ return ret === "" ? "auto" : ret;
5887
+ };
5888
+ }
5889
+ function setPositiveNumber( elem, value, subtract ) {
5890
+ var matches = rnumsplit.exec( value );
5891
+ return matches ?
5892
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
5893
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
5894
+ value;
5895
+ }
5896
+ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
5897
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
5898
+ // If we already have the right measurement, avoid augmentation
5899
+ 4 :
5900
+ // Otherwise initialize for horizontal or vertical properties
5901
+ name === "width" ? 1 : 0,
5902
+ val = 0;
5903
+ for ( ; i < 4; i += 2 ) {
5904
+ // both box models exclude margin, so add it if we want it
5905
+ if ( extra === "margin" ) {
5906
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
5907
+ }
5908
+ if ( isBorderBox ) {
5909
+ // border-box includes padding, so remove it if we want content
5910
+ if ( extra === "content" ) {
5911
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
5912
+ }
5913
+ // at this point, extra isn't border nor margin, so remove border
5914
+ if ( extra !== "margin" ) {
5915
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
5916
+ }
5917
+ } else {
5918
+ // at this point, extra isn't content, so add padding
5919
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
5920
+ // at this point, extra isn't content nor padding, so add border
5921
+ if ( extra !== "padding" ) {
5922
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
5923
+ }
5924
+ }
5925
+ }
5926
+ return val;
5927
+ }
5928
+ function getWidthOrHeight( elem, name, extra ) {
5929
+ // Start with offset property, which is equivalent to the border-box value
5930
+ var valueIsBorderBox = true,
5931
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
5932
+ styles = getStyles( elem ),
5933
+ isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
5934
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
5935
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
5936
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
5937
+ if ( val <= 0 || val == null ) {
5938
+ // Fall back to computed then uncomputed css if necessary
5939
+ val = curCSS( elem, name, styles );
5940
+ if ( val < 0 || val == null ) {
5941
+ val = elem.style[ name ];
5942
+ }
5943
+ // Computed unit is not pixels. Stop here and return.
5944
+ if ( rnumnonpx.test(val) ) {
5945
+ return val;
5946
+ }
5947
+ // we need the check for style in case a browser which returns unreliable values
5948
+ // for getComputedStyle silently falls back to the reliable elem.style
5949
+ valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
5950
+ // Normalize "", auto, and prepare for extra
5951
+ val = parseFloat( val ) || 0;
5952
+ }
5953
+ // use the active box-sizing model to add/subtract irrelevant styles
5954
+ return ( val +
5955
+ augmentWidthOrHeight(
5956
+ elem,
5957
+ name,
5958
+ extra || ( isBorderBox ? "border" : "content" ),
5959
+ valueIsBorderBox,
5960
+ styles
5961
+ )
5962
+ ) + "px";
5963
+ }
5964
+ // Try to determine the default display value of an element
5965
+ function css_defaultDisplay( nodeName ) {
5966
+ var doc = document,
5967
+ display = elemdisplay[ nodeName ];
5968
+ if ( !display ) {
5969
+ display = actualDisplay( nodeName, doc );
5970
+ // If the simple way fails, read from inside an iframe
5971
+ if ( display === "none" || !display ) {
5972
+ // Use the already-created iframe if possible
5973
+ iframe = ( iframe ||
5974
+ jQuery("<iframe frameborder='0' width='0' height='0'/>")
5975
+ .css( "cssText", "display:block !important" )
5976
+ ).appendTo( doc.documentElement );
5977
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
5978
+ doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
5979
+ doc.write("<!doctype html><html><body>");
5980
+ doc.close();
5981
+ display = actualDisplay( nodeName, doc );
5982
+ iframe.detach();
5983
+ }
5984
+ // Store the correct default display
5985
+ elemdisplay[ nodeName ] = display;
5986
+ }
5987
+ return display;
5988
+ }
5989
+ // Called ONLY from within css_defaultDisplay
5990
+ function actualDisplay( name, doc ) {
5991
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
5992
+ display = jQuery.css( elem[0], "display" );
5993
+ elem.remove();
5994
+ return display;
5995
+ }
5996
+ jQuery.each([ "height", "width" ], function( i, name ) {
5997
+ jQuery.cssHooks[ name ] = {
5998
+ get: function( elem, computed, extra ) {
5999
+ if ( computed ) {
6000
+ // certain elements can have dimension info if we invisibly show them
6001
+ // however, it must have a current display style that would benefit from this
6002
+ return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
6003
+ jQuery.swap( elem, cssShow, function() {
6004
+ return getWidthOrHeight( elem, name, extra );
6005
+ }) :
6006
+ getWidthOrHeight( elem, name, extra );
6007
+ }
6008
+ },
6009
+ set: function( elem, value, extra ) {
6010
+ var styles = extra && getStyles( elem );
6011
+ return setPositiveNumber( elem, value, extra ?
6012
+ augmentWidthOrHeight(
6013
+ elem,
6014
+ name,
6015
+ extra,
6016
+ jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6017
+ styles
6018
+ ) : 0
6019
+ );
6020
+ }
6021
+ };
6022
+ });
6023
+ if ( !jQuery.support.opacity ) {
6024
+ jQuery.cssHooks.opacity = {
6025
+ get: function( elem, computed ) {
6026
+ // IE uses filters for opacity
6027
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
6028
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
6029
+ computed ? "1" : "";
6030
+ },
6031
+ set: function( elem, value ) {
6032
+ var style = elem.style,
6033
+ currentStyle = elem.currentStyle,
6034
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
6035
+ filter = currentStyle && currentStyle.filter || style.filter || "";
6036
+ // IE has trouble with opacity if it does not have layout
6037
+ // Force it by setting the zoom level
6038
+ style.zoom = 1;
6039
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
6040
+ // if value === "", then remove inline opacity #12685
6041
+ if ( ( value >= 1 || value === "" ) &&
6042
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
6043
+ style.removeAttribute ) {
6044
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
6045
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
6046
+ // style.removeAttribute is IE Only, but so apparently is this code path...
6047
+ style.removeAttribute( "filter" );
6048
+ // if there is no filter style applied in a css rule or unset inline opacity, we are done
6049
+ if ( value === "" || currentStyle && !currentStyle.filter ) {
6050
+ return;
6051
+ }
6052
+ }
6053
+ // otherwise, set new filter values
6054
+ style.filter = ralpha.test( filter ) ?
6055
+ filter.replace( ralpha, opacity ) :
6056
+ filter + " " + opacity;
6057
+ }
6058
+ };
6059
+ }
6060
+ // These hooks cannot be added until DOM ready because the support test
6061
+ // for it is not run until after DOM ready
6062
+ jQuery(function() {
6063
+ if ( !jQuery.support.reliableMarginRight ) {
6064
+ jQuery.cssHooks.marginRight = {
6065
+ get: function( elem, computed ) {
6066
+ if ( computed ) {
6067
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6068
+ // Work around by temporarily setting element display to inline-block
6069
+ return jQuery.swap( elem, { "display": "inline-block" },
6070
+ curCSS, [ elem, "marginRight" ] );
6071
+ }
6072
+ }
6073
+ };
6074
+ }
6075
+ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
6076
+ // getComputedStyle returns percent when specified for top/left/bottom/right
6077
+ // rather than make the css module depend on the offset module, we just check for it here
6078
+ if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
6079
+ jQuery.each( [ "top", "left" ], function( i, prop ) {
6080
+ jQuery.cssHooks[ prop ] = {
6081
+ get: function( elem, computed ) {
6082
+ if ( computed ) {
6083
+ computed = curCSS( elem, prop );
6084
+ // if curCSS returns percentage, fallback to offset
6085
+ return rnumnonpx.test( computed ) ?
6086
+ jQuery( elem ).position()[ prop ] + "px" :
6087
+ computed;
6088
+ }
6089
+ }
6090
+ };
6091
+ });
6092
+ }
6093
+ });
6094
+ if ( jQuery.expr && jQuery.expr.filters ) {
6095
+ jQuery.expr.filters.hidden = function( elem ) {
6096
+ // Support: Opera <= 12.12
6097
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
6098
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
6099
+ (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
6100
+ };
6101
+ jQuery.expr.filters.visible = function( elem ) {
6102
+ return !jQuery.expr.filters.hidden( elem );
6103
+ };
6104
+ }
6105
+ // These hooks are used by animate to expand properties
6106
+ jQuery.each({
6107
+ margin: "",
6108
+ padding: "",
6109
+ border: "Width"
6110
+ }, function( prefix, suffix ) {
6111
+ jQuery.cssHooks[ prefix + suffix ] = {
6112
+ expand: function( value ) {
6113
+ var i = 0,
6114
+ expanded = {},
6115
+ // assumes a single number if not a string
6116
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
6117
+ for ( ; i < 4; i++ ) {
6118
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
6119
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6120
+ }
6121
+ return expanded;
6122
+ }
6123
+ };
6124
+ if ( !rmargin.test( prefix ) ) {
6125
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6126
+ }
6127
+ });
6128
+ var r20 = /%20/g,
6129
+ rbracket = /\[\]$/,
6130
+ rCRLF = /\r?\n/g,
6131
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
6132
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
6133
+ jQuery.fn.extend({
6134
+ serialize: function() {
6135
+ return jQuery.param( this.serializeArray() );
6136
+ },
6137
+ serializeArray: function() {
6138
+ return this.map(function(){
6139
+ // Can add propHook for "elements" to filter or add form elements
6140
+ var elements = jQuery.prop( this, "elements" );
6141
+ return elements ? jQuery.makeArray( elements ) : this;
6142
+ })
6143
+ .filter(function(){
6144
+ var type = this.type;
6145
+ // Use .is(":disabled") so that fieldset[disabled] works
6146
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
6147
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
6148
+ ( this.checked || !manipulation_rcheckableType.test( type ) );
6149
+ })
6150
+ .map(function( i, elem ){
6151
+ var val = jQuery( this ).val();
6152
+ return val == null ?
6153
+ null :
6154
+ jQuery.isArray( val ) ?
6155
+ jQuery.map( val, function( val ){
6156
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
6157
+ }) :
6158
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
6159
+ }).get();
6160
+ }
6161
+ });
6162
+ //Serialize an array of form elements or a set of
6163
+ //key/values into a query string
6164
+ jQuery.param = function( a, traditional ) {
6165
+ var prefix,
6166
+ s = [],
6167
+ add = function( key, value ) {
6168
+ // If value is a function, invoke it and return its value
6169
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
6170
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
6171
+ };
6172
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
6173
+ if ( traditional === undefined ) {
6174
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
6175
+ }
6176
+ // If an array was passed in, assume that it is an array of form elements.
6177
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
6178
+ // Serialize the form elements
6179
+ jQuery.each( a, function() {
6180
+ add( this.name, this.value );
6181
+ });
6182
+ } else {
6183
+ // If traditional, encode the "old" way (the way 1.3.2 or older
6184
+ // did it), otherwise encode params recursively.
6185
+ for ( prefix in a ) {
6186
+ buildParams( prefix, a[ prefix ], traditional, add );
6187
+ }
6188
+ }
6189
+ // Return the resulting serialization
6190
+ return s.join( "&" ).replace( r20, "+" );
6191
+ };
6192
+ function buildParams( prefix, obj, traditional, add ) {
6193
+ var name;
6194
+ if ( jQuery.isArray( obj ) ) {
6195
+ // Serialize array item.
6196
+ jQuery.each( obj, function( i, v ) {
6197
+ if ( traditional || rbracket.test( prefix ) ) {
6198
+ // Treat each array item as a scalar.
6199
+ add( prefix, v );
6200
+ } else {
6201
+ // Item is non-scalar (array or object), encode its numeric index.
6202
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
6203
+ }
6204
+ });
6205
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
6206
+ // Serialize object item.
6207
+ for ( name in obj ) {
6208
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
6209
+ }
6210
+ } else {
6211
+ // Serialize scalar item.
6212
+ add( prefix, obj );
6213
+ }
6214
+ }
6215
+ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
6216
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
6217
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
6218
+ // Handle event binding
6219
+ jQuery.fn[ name ] = function( data, fn ) {
6220
+ return arguments.length > 0 ?
6221
+ this.on( name, null, data, fn ) :
6222
+ this.trigger( name );
6223
+ };
6224
+ });
6225
+ jQuery.fn.hover = function( fnOver, fnOut ) {
6226
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
6227
+ };
6228
+ var
6229
+ // Document location
6230
+ ajaxLocParts,
6231
+ ajaxLocation,
6232
+ ajax_nonce = jQuery.now(),
6233
+ ajax_rquery = /\?/,
6234
+ rhash = /#.*$/,
6235
+ rts = /([?&])_=[^&]*/,
6236
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
6237
+ // #7653, #8125, #8152: local protocol detection
6238
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
6239
+ rnoContent = /^(?:GET|HEAD)$/,
6240
+ rprotocol = /^\/\//,
6241
+ rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
6242
+ // Keep a copy of the old load method
6243
+ _load = jQuery.fn.load,
6244
+ /* Prefilters
6245
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
6246
+ * 2) These are called:
6247
+ * - BEFORE asking for a transport
6248
+ * - AFTER param serialization (s.data is a string if s.processData is true)
6249
+ * 3) key is the dataType
6250
+ * 4) the catchall symbol "*" can be used
6251
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
6252
+ */
6253
+ prefilters = {},
6254
+ /* Transports bindings
6255
+ * 1) key is the dataType
6256
+ * 2) the catchall symbol "*" can be used
6257
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
6258
+ */
6259
+ transports = {},
6260
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
6261
+ allTypes = "*/".concat("*");
6262
+ // #8138, IE may throw an exception when accessing
6263
+ // a field from window.location if document.domain has been set
6264
+ try {
6265
+ ajaxLocation = location.href;
6266
+ } catch( e ) {
6267
+ // Use the href attribute of an A element
6268
+ // since IE will modify it given document.location
6269
+ ajaxLocation = document.createElement( "a" );
6270
+ ajaxLocation.href = "";
6271
+ ajaxLocation = ajaxLocation.href;
6272
+ }
6273
+ // Segment location into parts
6274
+ ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
6275
+ // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
6276
+ function addToPrefiltersOrTransports( structure ) {
6277
+ // dataTypeExpression is optional and defaults to "*"
6278
+ return function( dataTypeExpression, func ) {
6279
+ if ( typeof dataTypeExpression !== "string" ) {
6280
+ func = dataTypeExpression;
6281
+ dataTypeExpression = "*";
6282
+ }
6283
+ var dataType,
6284
+ i = 0,
6285
+ dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
6286
+ if ( jQuery.isFunction( func ) ) {
6287
+ // For each dataType in the dataTypeExpression
6288
+ while ( (dataType = dataTypes[i++]) ) {
6289
+ // Prepend if requested
6290
+ if ( dataType[0] === "+" ) {
6291
+ dataType = dataType.slice( 1 ) || "*";
6292
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
6293
+ // Otherwise append
6294
+ } else {
6295
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
6296
+ }
6297
+ }
6298
+ }
6299
+ };
6300
+ }
6301
+ // Base inspection function for prefilters and transports
6302
+ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
6303
+ var inspected = {},
6304
+ seekingTransport = ( structure === transports );
6305
+ function inspect( dataType ) {
6306
+ var selected;
6307
+ inspected[ dataType ] = true;
6308
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
6309
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
6310
+ if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
6311
+ options.dataTypes.unshift( dataTypeOrTransport );
6312
+ inspect( dataTypeOrTransport );
6313
+ return false;
6314
+ } else if ( seekingTransport ) {
6315
+ return !( selected = dataTypeOrTransport );
6316
+ }
6317
+ });
6318
+ return selected;
6319
+ }
6320
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
6321
+ }
6322
+ // A special extend for ajax options
6323
+ // that takes "flat" options (not to be deep extended)
6324
+ // Fixes #9887
6325
+ function ajaxExtend( target, src ) {
6326
+ var deep, key,
6327
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
6328
+ for ( key in src ) {
6329
+ if ( src[ key ] !== undefined ) {
6330
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
6331
+ }
6332
+ }
6333
+ if ( deep ) {
6334
+ jQuery.extend( true, target, deep );
6335
+ }
6336
+ return target;
6337
+ }
6338
+ jQuery.fn.load = function( url, params, callback ) {
6339
+ if ( typeof url !== "string" && _load ) {
6340
+ return _load.apply( this, arguments );
6341
+ }
6342
+ var selector, response, type,
6343
+ self = this,
6344
+ off = url.indexOf(" ");
6345
+ if ( off >= 0 ) {
6346
+ selector = url.slice( off, url.length );
6347
+ url = url.slice( 0, off );
6348
+ }
6349
+ // If it's a function
6350
+ if ( jQuery.isFunction( params ) ) {
6351
+ // We assume that it's the callback
6352
+ callback = params;
6353
+ params = undefined;
6354
+ // Otherwise, build a param string
6355
+ } else if ( params && typeof params === "object" ) {
6356
+ type = "POST";
6357
+ }
6358
+ // If we have elements to modify, make the request
6359
+ if ( self.length > 0 ) {
6360
+ jQuery.ajax({
6361
+ url: url,
6362
+ // if "type" variable is undefined, then "GET" method will be used
6363
+ type: type,
6364
+ dataType: "html",
6365
+ data: params
6366
+ }).done(function( responseText ) {
6367
+ // Save response for use in complete callback
6368
+ response = arguments;
6369
+ self.html( selector ?
6370
+ // If a selector was specified, locate the right elements in a dummy div
6371
+ // Exclude scripts to avoid IE 'Permission Denied' errors
6372
+ jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
6373
+ // Otherwise use the full result
6374
+ responseText );
6375
+ }).complete( callback && function( jqXHR, status ) {
6376
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
6377
+ });
6378
+ }
6379
+ return this;
6380
+ };
6381
+ // Attach a bunch of functions for handling common AJAX events
6382
+ jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
6383
+ jQuery.fn[ type ] = function( fn ){
6384
+ return this.on( type, fn );
6385
+ };
6386
+ });
6387
+ jQuery.each( [ "get", "post" ], function( i, method ) {
6388
+ jQuery[ method ] = function( url, data, callback, type ) {
6389
+ // shift arguments if data argument was omitted
6390
+ if ( jQuery.isFunction( data ) ) {
6391
+ type = type || callback;
6392
+ callback = data;
6393
+ data = undefined;
6394
+ }
6395
+ return jQuery.ajax({
6396
+ url: url,
6397
+ type: method,
6398
+ dataType: type,
6399
+ data: data,
6400
+ success: callback
6401
+ });
6402
+ };
6403
+ });
6404
+ jQuery.extend({
6405
+ // Counter for holding the number of active queries
6406
+ active: 0,
6407
+ // Last-Modified header cache for next request
6408
+ lastModified: {},
6409
+ etag: {},
6410
+ ajaxSettings: {
6411
+ url: ajaxLocation,
6412
+ type: "GET",
6413
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
6414
+ global: true,
6415
+ processData: true,
6416
+ async: true,
6417
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
6418
+ /*
6419
+ timeout: 0,
6420
+ data: null,
6421
+ dataType: null,
6422
+ username: null,
6423
+ password: null,
6424
+ cache: null,
6425
+ throws: false,
6426
+ traditional: false,
6427
+ headers: {},
6428
+ */
6429
+ accepts: {
6430
+ "*": allTypes,
6431
+ text: "text/plain",
6432
+ html: "text/html",
6433
+ xml: "application/xml, text/xml",
6434
+ json: "application/json, text/javascript"
6435
+ },
6436
+ contents: {
6437
+ xml: /xml/,
6438
+ html: /html/,
6439
+ json: /json/
6440
+ },
6441
+ responseFields: {
6442
+ xml: "responseXML",
6443
+ text: "responseText"
6444
+ },
6445
+ // Data converters
6446
+ // Keys separate source (or catchall "*") and destination types with a single space
6447
+ converters: {
6448
+ // Convert anything to text
6449
+ "* text": window.String,
6450
+ // Text to html (true = no transformation)
6451
+ "text html": true,
6452
+ // Evaluate text as a json expression
6453
+ "text json": jQuery.parseJSON,
6454
+ // Parse text as xml
6455
+ "text xml": jQuery.parseXML
6456
+ },
6457
+ // For options that shouldn't be deep extended:
6458
+ // you can add your own custom options here if
6459
+ // and when you create one that shouldn't be
6460
+ // deep extended (see ajaxExtend)
6461
+ flatOptions: {
6462
+ url: true,
6463
+ context: true
6464
+ }
6465
+ },
6466
+ // Creates a full fledged settings object into target
6467
+ // with both ajaxSettings and settings fields.
6468
+ // If target is omitted, writes into ajaxSettings.
6469
+ ajaxSetup: function( target, settings ) {
6470
+ return settings ?
6471
+ // Building a settings object
6472
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
6473
+ // Extending ajaxSettings
6474
+ ajaxExtend( jQuery.ajaxSettings, target );
6475
+ },
6476
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
6477
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
6478
+ // Main method
6479
+ ajax: function( url, options ) {
6480
+ // If url is an object, simulate pre-1.5 signature
6481
+ if ( typeof url === "object" ) {
6482
+ options = url;
6483
+ url = undefined;
6484
+ }
6485
+ // Force options to be an object
6486
+ options = options || {};
6487
+ var // Cross-domain detection vars
6488
+ parts,
6489
+ // Loop variable
6490
+ i,
6491
+ // URL without anti-cache param
6492
+ cacheURL,
6493
+ // Response headers as string
6494
+ responseHeadersString,
6495
+ // timeout handle
6496
+ timeoutTimer,
6497
+ // To know if global events are to be dispatched
6498
+ fireGlobals,
6499
+ transport,
6500
+ // Response headers
6501
+ responseHeaders,
6502
+ // Create the final options object
6503
+ s = jQuery.ajaxSetup( {}, options ),
6504
+ // Callbacks context
6505
+ callbackContext = s.context || s,
6506
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
6507
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
6508
+ jQuery( callbackContext ) :
6509
+ jQuery.event,
6510
+ // Deferreds
6511
+ deferred = jQuery.Deferred(),
6512
+ completeDeferred = jQuery.Callbacks("once memory"),
6513
+ // Status-dependent callbacks
6514
+ statusCode = s.statusCode || {},
6515
+ // Headers (they are sent all at once)
6516
+ requestHeaders = {},
6517
+ requestHeadersNames = {},
6518
+ // The jqXHR state
6519
+ state = 0,
6520
+ // Default abort message
6521
+ strAbort = "canceled",
6522
+ // Fake xhr
6523
+ jqXHR = {
6524
+ readyState: 0,
6525
+ // Builds headers hashtable if needed
6526
+ getResponseHeader: function( key ) {
6527
+ var match;
6528
+ if ( state === 2 ) {
6529
+ if ( !responseHeaders ) {
6530
+ responseHeaders = {};
6531
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
6532
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
6533
+ }
6534
+ }
6535
+ match = responseHeaders[ key.toLowerCase() ];
6536
+ }
6537
+ return match == null ? null : match;
6538
+ },
6539
+ // Raw string
6540
+ getAllResponseHeaders: function() {
6541
+ return state === 2 ? responseHeadersString : null;
6542
+ },
6543
+ // Caches the header
6544
+ setRequestHeader: function( name, value ) {
6545
+ var lname = name.toLowerCase();
6546
+ if ( !state ) {
6547
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
6548
+ requestHeaders[ name ] = value;
6549
+ }
6550
+ return this;
6551
+ },
6552
+ // Overrides response content-type header
6553
+ overrideMimeType: function( type ) {
6554
+ if ( !state ) {
6555
+ s.mimeType = type;
6556
+ }
6557
+ return this;
6558
+ },
6559
+ // Status-dependent callbacks
6560
+ statusCode: function( map ) {
6561
+ var code;
6562
+ if ( map ) {
6563
+ if ( state < 2 ) {
6564
+ for ( code in map ) {
6565
+ // Lazy-add the new callback in a way that preserves old ones
6566
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
6567
+ }
6568
+ } else {
6569
+ // Execute the appropriate callbacks
6570
+ jqXHR.always( map[ jqXHR.status ] );
6571
+ }
6572
+ }
6573
+ return this;
6574
+ },
6575
+ // Cancel the request
6576
+ abort: function( statusText ) {
6577
+ var finalText = statusText || strAbort;
6578
+ if ( transport ) {
6579
+ transport.abort( finalText );
6580
+ }
6581
+ done( 0, finalText );
6582
+ return this;
6583
+ }
6584
+ };
6585
+ // Attach deferreds
6586
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
6587
+ jqXHR.success = jqXHR.done;
6588
+ jqXHR.error = jqXHR.fail;
6589
+ // Remove hash character (#7531: and string promotion)
6590
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
6591
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
6592
+ // We also use the url parameter if available
6593
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
6594
+ // Alias method option to type as per ticket #12004
6595
+ s.type = options.method || options.type || s.method || s.type;
6596
+ // Extract dataTypes list
6597
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
6598
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
6599
+ if ( s.crossDomain == null ) {
6600
+ parts = rurl.exec( s.url.toLowerCase() );
6601
+ s.crossDomain = !!( parts &&
6602
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
6603
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
6604
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
6605
+ );
6606
+ }
6607
+ // Convert data if not already a string
6608
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
6609
+ s.data = jQuery.param( s.data, s.traditional );
6610
+ }
6611
+ // Apply prefilters
6612
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
6613
+ // If request was aborted inside a prefilter, stop there
6614
+ if ( state === 2 ) {
6615
+ return jqXHR;
6616
+ }
6617
+ // We can fire global events as of now if asked to
6618
+ fireGlobals = s.global;
6619
+ // Watch for a new set of requests
6620
+ if ( fireGlobals && jQuery.active++ === 0 ) {
6621
+ jQuery.event.trigger("ajaxStart");
6622
+ }
6623
+ // Uppercase the type
6624
+ s.type = s.type.toUpperCase();
6625
+ // Determine if request has content
6626
+ s.hasContent = !rnoContent.test( s.type );
6627
+ // Save the URL in case we're toying with the If-Modified-Since
6628
+ // and/or If-None-Match header later on
6629
+ cacheURL = s.url;
6630
+ // More options handling for requests with no content
6631
+ if ( !s.hasContent ) {
6632
+ // If data is available, append data to url
6633
+ if ( s.data ) {
6634
+ cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
6635
+ // #9682: remove data so that it's not used in an eventual retry
6636
+ delete s.data;
6637
+ }
6638
+ // Add anti-cache in url if needed
6639
+ if ( s.cache === false ) {
6640
+ s.url = rts.test( cacheURL ) ?
6641
+ // If there is already a '_' parameter, set its value
6642
+ cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
6643
+ // Otherwise add one to the end
6644
+ cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
6645
+ }
6646
+ }
6647
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
6648
+ if ( s.ifModified ) {
6649
+ if ( jQuery.lastModified[ cacheURL ] ) {
6650
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
6651
+ }
6652
+ if ( jQuery.etag[ cacheURL ] ) {
6653
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
6654
+ }
6655
+ }
6656
+ // Set the correct header, if data is being sent
6657
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
6658
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
6659
+ }
6660
+ // Set the Accepts header for the server, depending on the dataType
6661
+ jqXHR.setRequestHeader(
6662
+ "Accept",
6663
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
6664
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
6665
+ s.accepts[ "*" ]
6666
+ );
6667
+ // Check for headers option
6668
+ for ( i in s.headers ) {
6669
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
6670
+ }
6671
+ // Allow custom headers/mimetypes and early abort
6672
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
6673
+ // Abort if not done already and return
6674
+ return jqXHR.abort();
6675
+ }
6676
+ // aborting is no longer a cancellation
6677
+ strAbort = "abort";
6678
+ // Install callbacks on deferreds
6679
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
6680
+ jqXHR[ i ]( s[ i ] );
6681
+ }
6682
+ // Get transport
6683
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
6684
+ // If no transport, we auto-abort
6685
+ if ( !transport ) {
6686
+ done( -1, "No Transport" );
6687
+ } else {
6688
+ jqXHR.readyState = 1;
6689
+ // Send global event
6690
+ if ( fireGlobals ) {
6691
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
6692
+ }
6693
+ // Timeout
6694
+ if ( s.async && s.timeout > 0 ) {
6695
+ timeoutTimer = setTimeout(function() {
6696
+ jqXHR.abort("timeout");
6697
+ }, s.timeout );
6698
+ }
6699
+ try {
6700
+ state = 1;
6701
+ transport.send( requestHeaders, done );
6702
+ } catch ( e ) {
6703
+ // Propagate exception as error if not done
6704
+ if ( state < 2 ) {
6705
+ done( -1, e );
6706
+ // Simply rethrow otherwise
6707
+ } else {
6708
+ throw e;
6709
+ }
6710
+ }
6711
+ }
6712
+ // Callback for when everything is done
6713
+ function done( status, nativeStatusText, responses, headers ) {
6714
+ var isSuccess, success, error, response, modified,
6715
+ statusText = nativeStatusText;
6716
+ // Called once
6717
+ if ( state === 2 ) {
6718
+ return;
6719
+ }
6720
+ // State is "done" now
6721
+ state = 2;
6722
+ // Clear timeout if it exists
6723
+ if ( timeoutTimer ) {
6724
+ clearTimeout( timeoutTimer );
6725
+ }
6726
+ // Dereference transport for early garbage collection
6727
+ // (no matter how long the jqXHR object will be used)
6728
+ transport = undefined;
6729
+ // Cache response headers
6730
+ responseHeadersString = headers || "";
6731
+ // Set readyState
6732
+ jqXHR.readyState = status > 0 ? 4 : 0;
6733
+ // Get response data
6734
+ if ( responses ) {
6735
+ response = ajaxHandleResponses( s, jqXHR, responses );
6736
+ }
6737
+ // If successful, handle type chaining
6738
+ if ( status >= 200 && status < 300 || status === 304 ) {
6739
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
6740
+ if ( s.ifModified ) {
6741
+ modified = jqXHR.getResponseHeader("Last-Modified");
6742
+ if ( modified ) {
6743
+ jQuery.lastModified[ cacheURL ] = modified;
6744
+ }
6745
+ modified = jqXHR.getResponseHeader("etag");
6746
+ if ( modified ) {
6747
+ jQuery.etag[ cacheURL ] = modified;
6748
+ }
6749
+ }
6750
+ // if no content
6751
+ if ( status === 204 ) {
6752
+ isSuccess = true;
6753
+ statusText = "nocontent";
6754
+ // if not modified
6755
+ } else if ( status === 304 ) {
6756
+ isSuccess = true;
6757
+ statusText = "notmodified";
6758
+ // If we have data, let's convert it
6759
+ } else {
6760
+ isSuccess = ajaxConvert( s, response );
6761
+ statusText = isSuccess.state;
6762
+ success = isSuccess.data;
6763
+ error = isSuccess.error;
6764
+ isSuccess = !error;
6765
+ }
6766
+ } else {
6767
+ // We extract error from statusText
6768
+ // then normalize statusText and status for non-aborts
6769
+ error = statusText;
6770
+ if ( status || !statusText ) {
6771
+ statusText = "error";
6772
+ if ( status < 0 ) {
6773
+ status = 0;
6774
+ }
6775
+ }
6776
+ }
6777
+ // Set data for the fake xhr object
6778
+ jqXHR.status = status;
6779
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
6780
+ // Success/Error
6781
+ if ( isSuccess ) {
6782
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
6783
+ } else {
6784
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
6785
+ }
6786
+ // Status-dependent callbacks
6787
+ jqXHR.statusCode( statusCode );
6788
+ statusCode = undefined;
6789
+ if ( fireGlobals ) {
6790
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
6791
+ [ jqXHR, s, isSuccess ? success : error ] );
6792
+ }
6793
+ // Complete
6794
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
6795
+ if ( fireGlobals ) {
6796
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
6797
+ // Handle the global AJAX counter
6798
+ if ( !( --jQuery.active ) ) {
6799
+ jQuery.event.trigger("ajaxStop");
6800
+ }
6801
+ }
6802
+ }
6803
+ return jqXHR;
6804
+ },
6805
+ getScript: function( url, callback ) {
6806
+ return jQuery.get( url, undefined, callback, "script" );
6807
+ },
6808
+ getJSON: function( url, data, callback ) {
6809
+ return jQuery.get( url, data, callback, "json" );
6810
+ }
6811
+ });
6812
+ /* Handles responses to an ajax request:
6813
+ * - sets all responseXXX fields accordingly
6814
+ * - finds the right dataType (mediates between content-type and expected dataType)
6815
+ * - returns the corresponding response
6816
+ */
6817
+ function ajaxHandleResponses( s, jqXHR, responses ) {
6818
+ var firstDataType, ct, finalDataType, type,
6819
+ contents = s.contents,
6820
+ dataTypes = s.dataTypes,
6821
+ responseFields = s.responseFields;
6822
+ // Fill responseXXX fields
6823
+ for ( type in responseFields ) {
6824
+ if ( type in responses ) {
6825
+ jqXHR[ responseFields[type] ] = responses[ type ];
6826
+ }
6827
+ }
6828
+ // Remove auto dataType and get content-type in the process
6829
+ while( dataTypes[ 0 ] === "*" ) {
6830
+ dataTypes.shift();
6831
+ if ( ct === undefined ) {
6832
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
6833
+ }
6834
+ }
6835
+ // Check if we're dealing with a known content-type
6836
+ if ( ct ) {
6837
+ for ( type in contents ) {
6838
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
6839
+ dataTypes.unshift( type );
6840
+ break;
6841
+ }
6842
+ }
6843
+ }
6844
+ // Check to see if we have a response for the expected dataType
6845
+ if ( dataTypes[ 0 ] in responses ) {
6846
+ finalDataType = dataTypes[ 0 ];
6847
+ } else {
6848
+ // Try convertible dataTypes
6849
+ for ( type in responses ) {
6850
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
6851
+ finalDataType = type;
6852
+ break;
6853
+ }
6854
+ if ( !firstDataType ) {
6855
+ firstDataType = type;
6856
+ }
6857
+ }
6858
+ // Or just use first one
6859
+ finalDataType = finalDataType || firstDataType;
6860
+ }
6861
+ // If we found a dataType
6862
+ // We add the dataType to the list if needed
6863
+ // and return the corresponding response
6864
+ if ( finalDataType ) {
6865
+ if ( finalDataType !== dataTypes[ 0 ] ) {
6866
+ dataTypes.unshift( finalDataType );
6867
+ }
6868
+ return responses[ finalDataType ];
6869
+ }
6870
+ }
6871
+ // Chain conversions given the request and the original response
6872
+ function ajaxConvert( s, response ) {
6873
+ var conv2, current, conv, tmp,
6874
+ converters = {},
6875
+ i = 0,
6876
+ // Work with a copy of dataTypes in case we need to modify it for conversion
6877
+ dataTypes = s.dataTypes.slice(),
6878
+ prev = dataTypes[ 0 ];
6879
+ // Apply the dataFilter if provided
6880
+ if ( s.dataFilter ) {
6881
+ response = s.dataFilter( response, s.dataType );
6882
+ }
6883
+ // Create converters map with lowercased keys
6884
+ if ( dataTypes[ 1 ] ) {
6885
+ for ( conv in s.converters ) {
6886
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
6887
+ }
6888
+ }
6889
+ // Convert to each sequential dataType, tolerating list modification
6890
+ for ( ; (current = dataTypes[++i]); ) {
6891
+ // There's only work to do if current dataType is non-auto
6892
+ if ( current !== "*" ) {
6893
+ // Convert response if prev dataType is non-auto and differs from current
6894
+ if ( prev !== "*" && prev !== current ) {
6895
+ // Seek a direct converter
6896
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
6897
+ // If none found, seek a pair
6898
+ if ( !conv ) {
6899
+ for ( conv2 in converters ) {
6900
+ // If conv2 outputs current
6901
+ tmp = conv2.split(" ");
6902
+ if ( tmp[ 1 ] === current ) {
6903
+ // If prev can be converted to accepted input
6904
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
6905
+ converters[ "* " + tmp[ 0 ] ];
6906
+ if ( conv ) {
6907
+ // Condense equivalence converters
6908
+ if ( conv === true ) {
6909
+ conv = converters[ conv2 ];
6910
+ // Otherwise, insert the intermediate dataType
6911
+ } else if ( converters[ conv2 ] !== true ) {
6912
+ current = tmp[ 0 ];
6913
+ dataTypes.splice( i--, 0, current );
6914
+ }
6915
+ break;
6916
+ }
6917
+ }
6918
+ }
6919
+ }
6920
+ // Apply converter (if not an equivalence)
6921
+ if ( conv !== true ) {
6922
+ // Unless errors are allowed to bubble, catch and return them
6923
+ if ( conv && s["throws"] ) {
6924
+ response = conv( response );
6925
+ } else {
6926
+ try {
6927
+ response = conv( response );
6928
+ } catch ( e ) {
6929
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
6930
+ }
6931
+ }
6932
+ }
6933
+ }
6934
+ // Update prev for next iteration
6935
+ prev = current;
6936
+ }
6937
+ }
6938
+ return { state: "success", data: response };
6939
+ }
6940
+ // Install script dataType
6941
+ jQuery.ajaxSetup({
6942
+ accepts: {
6943
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
6944
+ },
6945
+ contents: {
6946
+ script: /(?:java|ecma)script/
6947
+ },
6948
+ converters: {
6949
+ "text script": function( text ) {
6950
+ jQuery.globalEval( text );
6951
+ return text;
6952
+ }
6953
+ }
6954
+ });
6955
+ // Handle cache's special case and global
6956
+ jQuery.ajaxPrefilter( "script", function( s ) {
6957
+ if ( s.cache === undefined ) {
6958
+ s.cache = false;
6959
+ }
6960
+ if ( s.crossDomain ) {
6961
+ s.type = "GET";
6962
+ s.global = false;
6963
+ }
6964
+ });
6965
+ // Bind script tag hack transport
6966
+ jQuery.ajaxTransport( "script", function(s) {
6967
+ // This transport only deals with cross domain requests
6968
+ if ( s.crossDomain ) {
6969
+ var script,
6970
+ head = document.head || jQuery("head")[0] || document.documentElement;
6971
+ return {
6972
+ send: function( _, callback ) {
6973
+ script = document.createElement("script");
6974
+ script.async = true;
6975
+ if ( s.scriptCharset ) {
6976
+ script.charset = s.scriptCharset;
6977
+ }
6978
+ script.src = s.url;
6979
+ // Attach handlers for all browsers
6980
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
6981
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
6982
+ // Handle memory leak in IE
6983
+ script.onload = script.onreadystatechange = null;
6984
+ // Remove the script
6985
+ if ( script.parentNode ) {
6986
+ script.parentNode.removeChild( script );
6987
+ }
6988
+ // Dereference the script
6989
+ script = null;
6990
+ // Callback if not abort
6991
+ if ( !isAbort ) {
6992
+ callback( 200, "success" );
6993
+ }
6994
+ }
6995
+ };
6996
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
6997
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
6998
+ head.insertBefore( script, head.firstChild );
6999
+ },
7000
+ abort: function() {
7001
+ if ( script ) {
7002
+ script.onload( undefined, true );
7003
+ }
7004
+ }
7005
+ };
7006
+ }
7007
+ });
7008
+ var oldCallbacks = [],
7009
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
7010
+ // Default jsonp settings
7011
+ jQuery.ajaxSetup({
7012
+ jsonp: "callback",
7013
+ jsonpCallback: function() {
7014
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
7015
+ this[ callback ] = true;
7016
+ return callback;
7017
+ }
7018
+ });
7019
+ // Detect, normalize options and install callbacks for jsonp requests
7020
+ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
7021
+ var callbackName, overwritten, responseContainer,
7022
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
7023
+ "url" :
7024
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
7025
+ );
7026
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
7027
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
7028
+ // Get callback name, remembering preexisting value associated with it
7029
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
7030
+ s.jsonpCallback() :
7031
+ s.jsonpCallback;
7032
+ // Insert callback into url or form data
7033
+ if ( jsonProp ) {
7034
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
7035
+ } else if ( s.jsonp !== false ) {
7036
+ s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
7037
+ }
7038
+ // Use data converter to retrieve json after script execution
7039
+ s.converters["script json"] = function() {
7040
+ if ( !responseContainer ) {
7041
+ jQuery.error( callbackName + " was not called" );
7042
+ }
7043
+ return responseContainer[ 0 ];
7044
+ };
7045
+ // force json dataType
7046
+ s.dataTypes[ 0 ] = "json";
7047
+ // Install callback
7048
+ overwritten = window[ callbackName ];
7049
+ window[ callbackName ] = function() {
7050
+ responseContainer = arguments;
7051
+ };
7052
+ // Clean-up function (fires after converters)
7053
+ jqXHR.always(function() {
7054
+ // Restore preexisting value
7055
+ window[ callbackName ] = overwritten;
7056
+ // Save back as free
7057
+ if ( s[ callbackName ] ) {
7058
+ // make sure that re-using the options doesn't screw things around
7059
+ s.jsonpCallback = originalSettings.jsonpCallback;
7060
+ // save the callback name for future use
7061
+ oldCallbacks.push( callbackName );
7062
+ }
7063
+ // Call if it was a function and we have a response
7064
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
7065
+ overwritten( responseContainer[ 0 ] );
7066
+ }
7067
+ responseContainer = overwritten = undefined;
7068
+ });
7069
+ // Delegate to script
7070
+ return "script";
7071
+ }
7072
+ });
7073
+ var xhrCallbacks, xhrSupported,
7074
+ xhrId = 0,
7075
+ // #5280: Internet Explorer will keep connections alive if we don't abort on unload
7076
+ xhrOnUnloadAbort = window.ActiveXObject && function() {
7077
+ // Abort all pending requests
7078
+ var key;
7079
+ for ( key in xhrCallbacks ) {
7080
+ xhrCallbacks[ key ]( undefined, true );
7081
+ }
7082
+ };
7083
+ // Functions to create xhrs
7084
+ function createStandardXHR() {
7085
+ try {
7086
+ return new window.XMLHttpRequest();
7087
+ } catch( e ) {}
7088
+ }
7089
+ function createActiveXHR() {
7090
+ try {
7091
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
7092
+ } catch( e ) {}
7093
+ }
7094
+ // Create the request object
7095
+ // (This is still attached to ajaxSettings for backward compatibility)
7096
+ jQuery.ajaxSettings.xhr = window.ActiveXObject ?
7097
+ /* Microsoft failed to properly
7098
+ * implement the XMLHttpRequest in IE7 (can't request local files),
7099
+ * so we use the ActiveXObject when it is available
7100
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
7101
+ * we need a fallback.
7102
+ */
7103
+ function() {
7104
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
7105
+ } :
7106
+ // For all other browsers, use the standard XMLHttpRequest object
7107
+ createStandardXHR;
7108
+ // Determine support properties
7109
+ xhrSupported = jQuery.ajaxSettings.xhr();
7110
+ jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
7111
+ xhrSupported = jQuery.support.ajax = !!xhrSupported;
7112
+ // Create transport if the browser can provide an xhr
7113
+ if ( xhrSupported ) {
7114
+ jQuery.ajaxTransport(function( s ) {
7115
+ // Cross domain only allowed if supported through XMLHttpRequest
7116
+ if ( !s.crossDomain || jQuery.support.cors ) {
7117
+ var callback;
7118
+ return {
7119
+ send: function( headers, complete ) {
7120
+ // Get a new xhr
7121
+ var handle, i,
7122
+ xhr = s.xhr();
7123
+ // Open the socket
7124
+ // Passing null username, generates a login popup on Opera (#2865)
7125
+ if ( s.username ) {
7126
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
7127
+ } else {
7128
+ xhr.open( s.type, s.url, s.async );
7129
+ }
7130
+ // Apply custom fields if provided
7131
+ if ( s.xhrFields ) {
7132
+ for ( i in s.xhrFields ) {
7133
+ xhr[ i ] = s.xhrFields[ i ];
7134
+ }
7135
+ }
7136
+ // Override mime type if needed
7137
+ if ( s.mimeType && xhr.overrideMimeType ) {
7138
+ xhr.overrideMimeType( s.mimeType );
7139
+ }
7140
+ // X-Requested-With header
7141
+ // For cross-domain requests, seeing as conditions for a preflight are
7142
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
7143
+ // (it can always be set on a per-request basis or even using ajaxSetup)
7144
+ // For same-domain requests, won't change header if already provided.
7145
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
7146
+ headers["X-Requested-With"] = "XMLHttpRequest";
7147
+ }
7148
+ // Need an extra try/catch for cross domain requests in Firefox 3
7149
+ try {
7150
+ for ( i in headers ) {
7151
+ xhr.setRequestHeader( i, headers[ i ] );
7152
+ }
7153
+ } catch( err ) {}
7154
+ // Do send the request
7155
+ // This may raise an exception which is actually
7156
+ // handled in jQuery.ajax (so no try/catch here)
7157
+ xhr.send( ( s.hasContent && s.data ) || null );
7158
+ // Listener
7159
+ callback = function( _, isAbort ) {
7160
+ var status, responseHeaders, statusText, responses;
7161
+ // Firefox throws exceptions when accessing properties
7162
+ // of an xhr when a network error occurred
7163
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
7164
+ try {
7165
+ // Was never called and is aborted or complete
7166
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
7167
+ // Only called once
7168
+ callback = undefined;
7169
+ // Do not keep as active anymore
7170
+ if ( handle ) {
7171
+ xhr.onreadystatechange = jQuery.noop;
7172
+ if ( xhrOnUnloadAbort ) {
7173
+ delete xhrCallbacks[ handle ];
7174
+ }
7175
+ }
7176
+ // If it's an abort
7177
+ if ( isAbort ) {
7178
+ // Abort it manually if needed
7179
+ if ( xhr.readyState !== 4 ) {
7180
+ xhr.abort();
7181
+ }
7182
+ } else {
7183
+ responses = {};
7184
+ status = xhr.status;
7185
+ responseHeaders = xhr.getAllResponseHeaders();
7186
+ // When requesting binary data, IE6-9 will throw an exception
7187
+ // on any attempt to access responseText (#11426)
7188
+ if ( typeof xhr.responseText === "string" ) {
7189
+ responses.text = xhr.responseText;
7190
+ }
7191
+ // Firefox throws an exception when accessing
7192
+ // statusText for faulty cross-domain requests
7193
+ try {
7194
+ statusText = xhr.statusText;
7195
+ } catch( e ) {
7196
+ // We normalize with Webkit giving an empty statusText
7197
+ statusText = "";
7198
+ }
7199
+ // Filter status for non standard behaviors
7200
+ // If the request is local and we have data: assume a success
7201
+ // (success with no data won't get notified, that's the best we
7202
+ // can do given current implementations)
7203
+ if ( !status && s.isLocal && !s.crossDomain ) {
7204
+ status = responses.text ? 200 : 404;
7205
+ // IE - #1450: sometimes returns 1223 when it should be 204
7206
+ } else if ( status === 1223 ) {
7207
+ status = 204;
7208
+ }
7209
+ }
7210
+ }
7211
+ } catch( firefoxAccessException ) {
7212
+ if ( !isAbort ) {
7213
+ complete( -1, firefoxAccessException );
7214
+ }
7215
+ }
7216
+ // Call complete if needed
7217
+ if ( responses ) {
7218
+ complete( status, statusText, responses, responseHeaders );
7219
+ }
7220
+ };
7221
+ if ( !s.async ) {
7222
+ // if we're in sync mode we fire the callback
7223
+ callback();
7224
+ } else if ( xhr.readyState === 4 ) {
7225
+ // (IE6 & IE7) if it's in cache and has been
7226
+ // retrieved directly we need to fire the callback
7227
+ setTimeout( callback );
7228
+ } else {
7229
+ handle = ++xhrId;
7230
+ if ( xhrOnUnloadAbort ) {
7231
+ // Create the active xhrs callbacks list if needed
7232
+ // and attach the unload handler
7233
+ if ( !xhrCallbacks ) {
7234
+ xhrCallbacks = {};
7235
+ jQuery( window ).unload( xhrOnUnloadAbort );
7236
+ }
7237
+ // Add to list of active xhrs callbacks
7238
+ xhrCallbacks[ handle ] = callback;
7239
+ }
7240
+ xhr.onreadystatechange = callback;
7241
+ }
7242
+ },
7243
+ abort: function() {
7244
+ if ( callback ) {
7245
+ callback( undefined, true );
7246
+ }
7247
+ }
7248
+ };
7249
+ }
7250
+ });
7251
+ }
7252
+ var fxNow, timerId,
7253
+ rfxtypes = /^(?:toggle|show|hide)$/,
7254
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
7255
+ rrun = /queueHooks$/,
7256
+ animationPrefilters = [ defaultPrefilter ],
7257
+ tweeners = {
7258
+ "*": [function( prop, value ) {
7259
+ var end, unit,
7260
+ tween = this.createTween( prop, value ),
7261
+ parts = rfxnum.exec( value ),
7262
+ target = tween.cur(),
7263
+ start = +target || 0,
7264
+ scale = 1,
7265
+ maxIterations = 20;
7266
+ if ( parts ) {
7267
+ end = +parts[2];
7268
+ unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
7269
+ // We need to compute starting value
7270
+ if ( unit !== "px" && start ) {
7271
+ // Iteratively approximate from a nonzero starting point
7272
+ // Prefer the current property, because this process will be trivial if it uses the same units
7273
+ // Fallback to end or a simple constant
7274
+ start = jQuery.css( tween.elem, prop, true ) || end || 1;
7275
+ do {
7276
+ // If previous iteration zeroed out, double until we get *something*
7277
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
7278
+ scale = scale || ".5";
7279
+ // Adjust and apply
7280
+ start = start / scale;
7281
+ jQuery.style( tween.elem, prop, start + unit );
7282
+ // Update scale, tolerating zero or NaN from tween.cur()
7283
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
7284
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
7285
+ }
7286
+ tween.unit = unit;
7287
+ tween.start = start;
7288
+ // If a +=/-= token was provided, we're doing a relative animation
7289
+ tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
7290
+ }
7291
+ return tween;
7292
+ }]
7293
+ };
7294
+ // Animations created synchronously will run synchronously
7295
+ function createFxNow() {
7296
+ setTimeout(function() {
7297
+ fxNow = undefined;
7298
+ });
7299
+ return ( fxNow = jQuery.now() );
7300
+ }
7301
+ function createTweens( animation, props ) {
7302
+ jQuery.each( props, function( prop, value ) {
7303
+ var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
7304
+ index = 0,
7305
+ length = collection.length;
7306
+ for ( ; index < length; index++ ) {
7307
+ if ( collection[ index ].call( animation, prop, value ) ) {
7308
+ // we're done with this property
7309
+ return;
7310
+ }
7311
+ }
7312
+ });
7313
+ }
7314
+ function Animation( elem, properties, options ) {
7315
+ var result,
7316
+ stopped,
7317
+ index = 0,
7318
+ length = animationPrefilters.length,
7319
+ deferred = jQuery.Deferred().always( function() {
7320
+ // don't match elem in the :animated selector
7321
+ delete tick.elem;
7322
+ }),
7323
+ tick = function() {
7324
+ if ( stopped ) {
7325
+ return false;
7326
+ }
7327
+ var currentTime = fxNow || createFxNow(),
7328
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7329
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
7330
+ temp = remaining / animation.duration || 0,
7331
+ percent = 1 - temp,
7332
+ index = 0,
7333
+ length = animation.tweens.length;
7334
+ for ( ; index < length ; index++ ) {
7335
+ animation.tweens[ index ].run( percent );
7336
+ }
7337
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
7338
+ if ( percent < 1 && length ) {
7339
+ return remaining;
7340
+ } else {
7341
+ deferred.resolveWith( elem, [ animation ] );
7342
+ return false;
7343
+ }
7344
+ },
7345
+ animation = deferred.promise({
7346
+ elem: elem,
7347
+ props: jQuery.extend( {}, properties ),
7348
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
7349
+ originalProperties: properties,
7350
+ originalOptions: options,
7351
+ startTime: fxNow || createFxNow(),
7352
+ duration: options.duration,
7353
+ tweens: [],
7354
+ createTween: function( prop, end ) {
7355
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
7356
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
7357
+ animation.tweens.push( tween );
7358
+ return tween;
7359
+ },
7360
+ stop: function( gotoEnd ) {
7361
+ var index = 0,
7362
+ // if we are going to the end, we want to run all the tweens
7363
+ // otherwise we skip this part
7364
+ length = gotoEnd ? animation.tweens.length : 0;
7365
+ if ( stopped ) {
7366
+ return this;
7367
+ }
7368
+ stopped = true;
7369
+ for ( ; index < length ; index++ ) {
7370
+ animation.tweens[ index ].run( 1 );
7371
+ }
7372
+ // resolve when we played the last frame
7373
+ // otherwise, reject
7374
+ if ( gotoEnd ) {
7375
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
7376
+ } else {
7377
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
7378
+ }
7379
+ return this;
7380
+ }
7381
+ }),
7382
+ props = animation.props;
7383
+ propFilter( props, animation.opts.specialEasing );
7384
+ for ( ; index < length ; index++ ) {
7385
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
7386
+ if ( result ) {
7387
+ return result;
7388
+ }
7389
+ }
7390
+ createTweens( animation, props );
7391
+ if ( jQuery.isFunction( animation.opts.start ) ) {
7392
+ animation.opts.start.call( elem, animation );
7393
+ }
7394
+ jQuery.fx.timer(
7395
+ jQuery.extend( tick, {
7396
+ elem: elem,
7397
+ anim: animation,
7398
+ queue: animation.opts.queue
7399
+ })
7400
+ );
7401
+ // attach callbacks from options
7402
+ return animation.progress( animation.opts.progress )
7403
+ .done( animation.opts.done, animation.opts.complete )
7404
+ .fail( animation.opts.fail )
7405
+ .always( animation.opts.always );
7406
+ }
7407
+ function propFilter( props, specialEasing ) {
7408
+ var value, name, index, easing, hooks;
7409
+ // camelCase, specialEasing and expand cssHook pass
7410
+ for ( index in props ) {
7411
+ name = jQuery.camelCase( index );
7412
+ easing = specialEasing[ name ];
7413
+ value = props[ index ];
7414
+ if ( jQuery.isArray( value ) ) {
7415
+ easing = value[ 1 ];
7416
+ value = props[ index ] = value[ 0 ];
7417
+ }
7418
+ if ( index !== name ) {
7419
+ props[ name ] = value;
7420
+ delete props[ index ];
7421
+ }
7422
+ hooks = jQuery.cssHooks[ name ];
7423
+ if ( hooks && "expand" in hooks ) {
7424
+ value = hooks.expand( value );
7425
+ delete props[ name ];
7426
+ // not quite $.extend, this wont overwrite keys already present.
7427
+ // also - reusing 'index' from above because we have the correct "name"
7428
+ for ( index in value ) {
7429
+ if ( !( index in props ) ) {
7430
+ props[ index ] = value[ index ];
7431
+ specialEasing[ index ] = easing;
7432
+ }
7433
+ }
7434
+ } else {
7435
+ specialEasing[ name ] = easing;
7436
+ }
7437
+ }
7438
+ }
7439
+ jQuery.Animation = jQuery.extend( Animation, {
7440
+ tweener: function( props, callback ) {
7441
+ if ( jQuery.isFunction( props ) ) {
7442
+ callback = props;
7443
+ props = [ "*" ];
7444
+ } else {
7445
+ props = props.split(" ");
7446
+ }
7447
+ var prop,
7448
+ index = 0,
7449
+ length = props.length;
7450
+ for ( ; index < length ; index++ ) {
7451
+ prop = props[ index ];
7452
+ tweeners[ prop ] = tweeners[ prop ] || [];
7453
+ tweeners[ prop ].unshift( callback );
7454
+ }
7455
+ },
7456
+ prefilter: function( callback, prepend ) {
7457
+ if ( prepend ) {
7458
+ animationPrefilters.unshift( callback );
7459
+ } else {
7460
+ animationPrefilters.push( callback );
7461
+ }
7462
+ }
7463
+ });
7464
+ function defaultPrefilter( elem, props, opts ) {
7465
+ /*jshint validthis:true */
7466
+ var prop, index, length,
7467
+ value, dataShow, toggle,
7468
+ tween, hooks, oldfire,
7469
+ anim = this,
7470
+ style = elem.style,
7471
+ orig = {},
7472
+ handled = [],
7473
+ hidden = elem.nodeType && isHidden( elem );
7474
+ // handle queue: false promises
7475
+ if ( !opts.queue ) {
7476
+ hooks = jQuery._queueHooks( elem, "fx" );
7477
+ if ( hooks.unqueued == null ) {
7478
+ hooks.unqueued = 0;
7479
+ oldfire = hooks.empty.fire;
7480
+ hooks.empty.fire = function() {
7481
+ if ( !hooks.unqueued ) {
7482
+ oldfire();
7483
+ }
7484
+ };
7485
+ }
7486
+ hooks.unqueued++;
7487
+ anim.always(function() {
7488
+ // doing this makes sure that the complete handler will be called
7489
+ // before this completes
7490
+ anim.always(function() {
7491
+ hooks.unqueued--;
7492
+ if ( !jQuery.queue( elem, "fx" ).length ) {
7493
+ hooks.empty.fire();
7494
+ }
7495
+ });
7496
+ });
7497
+ }
7498
+ // height/width overflow pass
7499
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
7500
+ // Make sure that nothing sneaks out
7501
+ // Record all 3 overflow attributes because IE does not
7502
+ // change the overflow attribute when overflowX and
7503
+ // overflowY are set to the same value
7504
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7505
+ // Set display property to inline-block for height/width
7506
+ // animations on inline elements that are having width/height animated
7507
+ if ( jQuery.css( elem, "display" ) === "inline" &&
7508
+ jQuery.css( elem, "float" ) === "none" ) {
7509
+ // inline-level elements accept inline-block;
7510
+ // block-level elements need to be inline with layout
7511
+ if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
7512
+ style.display = "inline-block";
7513
+ } else {
7514
+ style.zoom = 1;
7515
+ }
7516
+ }
7517
+ }
7518
+ if ( opts.overflow ) {
7519
+ style.overflow = "hidden";
7520
+ if ( !jQuery.support.shrinkWrapBlocks ) {
7521
+ anim.always(function() {
7522
+ style.overflow = opts.overflow[ 0 ];
7523
+ style.overflowX = opts.overflow[ 1 ];
7524
+ style.overflowY = opts.overflow[ 2 ];
7525
+ });
7526
+ }
7527
+ }
7528
+ // show/hide pass
7529
+ for ( index in props ) {
7530
+ value = props[ index ];
7531
+ if ( rfxtypes.exec( value ) ) {
7532
+ delete props[ index ];
7533
+ toggle = toggle || value === "toggle";
7534
+ if ( value === ( hidden ? "hide" : "show" ) ) {
7535
+ continue;
7536
+ }
7537
+ handled.push( index );
7538
+ }
7539
+ }
7540
+ length = handled.length;
7541
+ if ( length ) {
7542
+ dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
7543
+ if ( "hidden" in dataShow ) {
7544
+ hidden = dataShow.hidden;
7545
+ }
7546
+ // store state if its toggle - enables .stop().toggle() to "reverse"
7547
+ if ( toggle ) {
7548
+ dataShow.hidden = !hidden;
7549
+ }
7550
+ if ( hidden ) {
7551
+ jQuery( elem ).show();
7552
+ } else {
7553
+ anim.done(function() {
7554
+ jQuery( elem ).hide();
7555
+ });
7556
+ }
7557
+ anim.done(function() {
7558
+ var prop;
7559
+ jQuery._removeData( elem, "fxshow" );
7560
+ for ( prop in orig ) {
7561
+ jQuery.style( elem, prop, orig[ prop ] );
7562
+ }
7563
+ });
7564
+ for ( index = 0 ; index < length ; index++ ) {
7565
+ prop = handled[ index ];
7566
+ tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
7567
+ orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
7568
+ if ( !( prop in dataShow ) ) {
7569
+ dataShow[ prop ] = tween.start;
7570
+ if ( hidden ) {
7571
+ tween.end = tween.start;
7572
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
7573
+ }
7574
+ }
7575
+ }
7576
+ }
7577
+ }
7578
+ function Tween( elem, options, prop, end, easing ) {
7579
+ return new Tween.prototype.init( elem, options, prop, end, easing );
7580
+ }
7581
+ jQuery.Tween = Tween;
7582
+ Tween.prototype = {
7583
+ constructor: Tween,
7584
+ init: function( elem, options, prop, end, easing, unit ) {
7585
+ this.elem = elem;
7586
+ this.prop = prop;
7587
+ this.easing = easing || "swing";
7588
+ this.options = options;
7589
+ this.start = this.now = this.cur();
7590
+ this.end = end;
7591
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
7592
+ },
7593
+ cur: function() {
7594
+ var hooks = Tween.propHooks[ this.prop ];
7595
+ return hooks && hooks.get ?
7596
+ hooks.get( this ) :
7597
+ Tween.propHooks._default.get( this );
7598
+ },
7599
+ run: function( percent ) {
7600
+ var eased,
7601
+ hooks = Tween.propHooks[ this.prop ];
7602
+ if ( this.options.duration ) {
7603
+ this.pos = eased = jQuery.easing[ this.easing ](
7604
+ percent, this.options.duration * percent, 0, 1, this.options.duration
7605
+ );
7606
+ } else {
7607
+ this.pos = eased = percent;
7608
+ }
7609
+ this.now = ( this.end - this.start ) * eased + this.start;
7610
+ if ( this.options.step ) {
7611
+ this.options.step.call( this.elem, this.now, this );
7612
+ }
7613
+ if ( hooks && hooks.set ) {
7614
+ hooks.set( this );
7615
+ } else {
7616
+ Tween.propHooks._default.set( this );
7617
+ }
7618
+ return this;
7619
+ }
7620
+ };
7621
+ Tween.prototype.init.prototype = Tween.prototype;
7622
+ Tween.propHooks = {
7623
+ _default: {
7624
+ get: function( tween ) {
7625
+ var result;
7626
+ if ( tween.elem[ tween.prop ] != null &&
7627
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
7628
+ return tween.elem[ tween.prop ];
7629
+ }
7630
+ // passing an empty string as a 3rd parameter to .css will automatically
7631
+ // attempt a parseFloat and fallback to a string if the parse fails
7632
+ // so, simple values such as "10px" are parsed to Float.
7633
+ // complex values such as "rotate(1rad)" are returned as is.
7634
+ result = jQuery.css( tween.elem, tween.prop, "" );
7635
+ // Empty strings, null, undefined and "auto" are converted to 0.
7636
+ return !result || result === "auto" ? 0 : result;
7637
+ },
7638
+ set: function( tween ) {
7639
+ // use step hook for back compat - use cssHook if its there - use .style if its
7640
+ // available and use plain properties where available
7641
+ if ( jQuery.fx.step[ tween.prop ] ) {
7642
+ jQuery.fx.step[ tween.prop ]( tween );
7643
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
7644
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
7645
+ } else {
7646
+ tween.elem[ tween.prop ] = tween.now;
7647
+ }
7648
+ }
7649
+ }
7650
+ };
7651
+ // Remove in 2.0 - this supports IE8's panic based approach
7652
+ // to setting things on disconnected nodes
7653
+ Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
7654
+ set: function( tween ) {
7655
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
7656
+ tween.elem[ tween.prop ] = tween.now;
7657
+ }
7658
+ }
7659
+ };
7660
+ jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
7661
+ var cssFn = jQuery.fn[ name ];
7662
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
7663
+ return speed == null || typeof speed === "boolean" ?
7664
+ cssFn.apply( this, arguments ) :
7665
+ this.animate( genFx( name, true ), speed, easing, callback );
7666
+ };
7667
+ });
7668
+ jQuery.fn.extend({
7669
+ fadeTo: function( speed, to, easing, callback ) {
7670
+ // show any hidden elements after setting opacity to 0
7671
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
7672
+ // animate to the value specified
7673
+ .end().animate({ opacity: to }, speed, easing, callback );
7674
+ },
7675
+ animate: function( prop, speed, easing, callback ) {
7676
+ var empty = jQuery.isEmptyObject( prop ),
7677
+ optall = jQuery.speed( speed, easing, callback ),
7678
+ doAnimation = function() {
7679
+ // Operate on a copy of prop so per-property easing won't be lost
7680
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7681
+ doAnimation.finish = function() {
7682
+ anim.stop( true );
7683
+ };
7684
+ // Empty animations, or finishing resolves immediately
7685
+ if ( empty || jQuery._data( this, "finish" ) ) {
7686
+ anim.stop( true );
7687
+ }
7688
+ };
7689
+ doAnimation.finish = doAnimation;
7690
+ return empty || optall.queue === false ?
7691
+ this.each( doAnimation ) :
7692
+ this.queue( optall.queue, doAnimation );
7693
+ },
7694
+ stop: function( type, clearQueue, gotoEnd ) {
7695
+ var stopQueue = function( hooks ) {
7696
+ var stop = hooks.stop;
7697
+ delete hooks.stop;
7698
+ stop( gotoEnd );
7699
+ };
7700
+ if ( typeof type !== "string" ) {
7701
+ gotoEnd = clearQueue;
7702
+ clearQueue = type;
7703
+ type = undefined;
7704
+ }
7705
+ if ( clearQueue && type !== false ) {
7706
+ this.queue( type || "fx", [] );
7707
+ }
7708
+ return this.each(function() {
7709
+ var dequeue = true,
7710
+ index = type != null && type + "queueHooks",
7711
+ timers = jQuery.timers,
7712
+ data = jQuery._data( this );
7713
+ if ( index ) {
7714
+ if ( data[ index ] && data[ index ].stop ) {
7715
+ stopQueue( data[ index ] );
7716
+ }
7717
+ } else {
7718
+ for ( index in data ) {
7719
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7720
+ stopQueue( data[ index ] );
7721
+ }
7722
+ }
7723
+ }
7724
+ for ( index = timers.length; index--; ) {
7725
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
7726
+ timers[ index ].anim.stop( gotoEnd );
7727
+ dequeue = false;
7728
+ timers.splice( index, 1 );
7729
+ }
7730
+ }
7731
+ // start the next in the queue if the last step wasn't forced
7732
+ // timers currently will call their complete callbacks, which will dequeue
7733
+ // but only if they were gotoEnd
7734
+ if ( dequeue || !gotoEnd ) {
7735
+ jQuery.dequeue( this, type );
7736
+ }
7737
+ });
7738
+ },
7739
+ finish: function( type ) {
7740
+ if ( type !== false ) {
7741
+ type = type || "fx";
7742
+ }
7743
+ return this.each(function() {
7744
+ var index,
7745
+ data = jQuery._data( this ),
7746
+ queue = data[ type + "queue" ],
7747
+ hooks = data[ type + "queueHooks" ],
7748
+ timers = jQuery.timers,
7749
+ length = queue ? queue.length : 0;
7750
+ // enable finishing flag on private data
7751
+ data.finish = true;
7752
+ // empty the queue first
7753
+ jQuery.queue( this, type, [] );
7754
+ if ( hooks && hooks.cur && hooks.cur.finish ) {
7755
+ hooks.cur.finish.call( this );
7756
+ }
7757
+ // look for any active animations, and finish them
7758
+ for ( index = timers.length; index--; ) {
7759
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7760
+ timers[ index ].anim.stop( true );
7761
+ timers.splice( index, 1 );
7762
+ }
7763
+ }
7764
+ // look for any animations in the old queue and finish them
7765
+ for ( index = 0; index < length; index++ ) {
7766
+ if ( queue[ index ] && queue[ index ].finish ) {
7767
+ queue[ index ].finish.call( this );
7768
+ }
7769
+ }
7770
+ // turn off finishing flag
7771
+ delete data.finish;
7772
+ });
7773
+ }
7774
+ });
7775
+ // Generate parameters to create a standard animation
7776
+ function genFx( type, includeWidth ) {
7777
+ var which,
7778
+ attrs = { height: type },
7779
+ i = 0;
7780
+ // if we include width, step value is 1 to do all cssExpand values,
7781
+ // if we don't include width, step value is 2 to skip over Left and Right
7782
+ includeWidth = includeWidth? 1 : 0;
7783
+ for( ; i < 4 ; i += 2 - includeWidth ) {
7784
+ which = cssExpand[ i ];
7785
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
7786
+ }
7787
+ if ( includeWidth ) {
7788
+ attrs.opacity = attrs.width = type;
7789
+ }
7790
+ return attrs;
7791
+ }
7792
+ // Generate shortcuts for custom animations
7793
+ jQuery.each({
7794
+ slideDown: genFx("show"),
7795
+ slideUp: genFx("hide"),
7796
+ slideToggle: genFx("toggle"),
7797
+ fadeIn: { opacity: "show" },
7798
+ fadeOut: { opacity: "hide" },
7799
+ fadeToggle: { opacity: "toggle" }
7800
+ }, function( name, props ) {
7801
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
7802
+ return this.animate( props, speed, easing, callback );
7803
+ };
7804
+ });
7805
+ jQuery.speed = function( speed, easing, fn ) {
7806
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7807
+ complete: fn || !fn && easing ||
7808
+ jQuery.isFunction( speed ) && speed,
7809
+ duration: speed,
7810
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
7811
+ };
7812
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
7813
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
7814
+ // normalize opt.queue - true/undefined/null -> "fx"
7815
+ if ( opt.queue == null || opt.queue === true ) {
7816
+ opt.queue = "fx";
7817
+ }
7818
+ // Queueing
7819
+ opt.old = opt.complete;
7820
+ opt.complete = function() {
7821
+ if ( jQuery.isFunction( opt.old ) ) {
7822
+ opt.old.call( this );
7823
+ }
7824
+ if ( opt.queue ) {
7825
+ jQuery.dequeue( this, opt.queue );
7826
+ }
7827
+ };
7828
+ return opt;
7829
+ };
7830
+ jQuery.easing = {
7831
+ linear: function( p ) {
7832
+ return p;
7833
+ },
7834
+ swing: function( p ) {
7835
+ return 0.5 - Math.cos( p*Math.PI ) / 2;
7836
+ }
7837
+ };
7838
+ jQuery.timers = [];
7839
+ jQuery.fx = Tween.prototype.init;
7840
+ jQuery.fx.tick = function() {
7841
+ var timer,
7842
+ timers = jQuery.timers,
7843
+ i = 0;
7844
+ fxNow = jQuery.now();
7845
+ for ( ; i < timers.length; i++ ) {
7846
+ timer = timers[ i ];
7847
+ // Checks the timer has not already been removed
7848
+ if ( !timer() && timers[ i ] === timer ) {
7849
+ timers.splice( i--, 1 );
7850
+ }
7851
+ }
7852
+ if ( !timers.length ) {
7853
+ jQuery.fx.stop();
7854
+ }
7855
+ fxNow = undefined;
7856
+ };
7857
+ jQuery.fx.timer = function( timer ) {
7858
+ if ( timer() && jQuery.timers.push( timer ) ) {
7859
+ jQuery.fx.start();
7860
+ }
7861
+ };
7862
+ jQuery.fx.interval = 13;
7863
+ jQuery.fx.start = function() {
7864
+ if ( !timerId ) {
7865
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
7866
+ }
7867
+ };
7868
+ jQuery.fx.stop = function() {
7869
+ clearInterval( timerId );
7870
+ timerId = null;
7871
+ };
7872
+ jQuery.fx.speeds = {
7873
+ slow: 600,
7874
+ fast: 200,
7875
+ // Default speed
7876
+ _default: 400
7877
+ };
7878
+ // Back Compat <1.8 extension point
7879
+ jQuery.fx.step = {};
7880
+ if ( jQuery.expr && jQuery.expr.filters ) {
7881
+ jQuery.expr.filters.animated = function( elem ) {
7882
+ return jQuery.grep(jQuery.timers, function( fn ) {
7883
+ return elem === fn.elem;
7884
+ }).length;
7885
+ };
7886
+ }
7887
+ jQuery.fn.offset = function( options ) {
7888
+ if ( arguments.length ) {
7889
+ return options === undefined ?
7890
+ this :
7891
+ this.each(function( i ) {
7892
+ jQuery.offset.setOffset( this, options, i );
7893
+ });
7894
+ }
7895
+ var docElem, win,
7896
+ box = { top: 0, left: 0 },
7897
+ elem = this[ 0 ],
7898
+ doc = elem && elem.ownerDocument;
7899
+ if ( !doc ) {
7900
+ return;
7901
+ }
7902
+ docElem = doc.documentElement;
7903
+ // Make sure it's not a disconnected DOM node
7904
+ if ( !jQuery.contains( docElem, elem ) ) {
7905
+ return box;
7906
+ }
7907
+ // If we don't have gBCR, just use 0,0 rather than error
7908
+ // BlackBerry 5, iOS 3 (original iPhone)
7909
+ if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
7910
+ box = elem.getBoundingClientRect();
7911
+ }
7912
+ win = getWindow( doc );
7913
+ return {
7914
+ top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
7915
+ left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
7916
+ };
7917
+ };
7918
+ jQuery.offset = {
7919
+ setOffset: function( elem, options, i ) {
7920
+ var position = jQuery.css( elem, "position" );
7921
+ // set position first, in-case top/left are set even on static elem
7922
+ if ( position === "static" ) {
7923
+ elem.style.position = "relative";
7924
+ }
7925
+ var curElem = jQuery( elem ),
7926
+ curOffset = curElem.offset(),
7927
+ curCSSTop = jQuery.css( elem, "top" ),
7928
+ curCSSLeft = jQuery.css( elem, "left" ),
7929
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
7930
+ props = {}, curPosition = {}, curTop, curLeft;
7931
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
7932
+ if ( calculatePosition ) {
7933
+ curPosition = curElem.position();
7934
+ curTop = curPosition.top;
7935
+ curLeft = curPosition.left;
7936
+ } else {
7937
+ curTop = parseFloat( curCSSTop ) || 0;
7938
+ curLeft = parseFloat( curCSSLeft ) || 0;
7939
+ }
7940
+ if ( jQuery.isFunction( options ) ) {
7941
+ options = options.call( elem, i, curOffset );
7942
+ }
7943
+ if ( options.top != null ) {
7944
+ props.top = ( options.top - curOffset.top ) + curTop;
7945
+ }
7946
+ if ( options.left != null ) {
7947
+ props.left = ( options.left - curOffset.left ) + curLeft;
7948
+ }
7949
+ if ( "using" in options ) {
7950
+ options.using.call( elem, props );
7951
+ } else {
7952
+ curElem.css( props );
7953
+ }
7954
+ }
7955
+ };
7956
+ jQuery.fn.extend({
7957
+ position: function() {
7958
+ if ( !this[ 0 ] ) {
7959
+ return;
7960
+ }
7961
+ var offsetParent, offset,
7962
+ parentOffset = { top: 0, left: 0 },
7963
+ elem = this[ 0 ];
7964
+ // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
7965
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
7966
+ // we assume that getBoundingClientRect is available when computed position is fixed
7967
+ offset = elem.getBoundingClientRect();
7968
+ } else {
7969
+ // Get *real* offsetParent
7970
+ offsetParent = this.offsetParent();
7971
+ // Get correct offsets
7972
+ offset = this.offset();
7973
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
7974
+ parentOffset = offsetParent.offset();
7975
+ }
7976
+ // Add offsetParent borders
7977
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
7978
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
7979
+ }
7980
+ // Subtract parent offsets and element margins
7981
+ // note: when an element has margin: auto the offsetLeft and marginLeft
7982
+ // are the same in Safari causing offset.left to incorrectly be 0
7983
+ return {
7984
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
7985
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
7986
+ };
7987
+ },
7988
+ offsetParent: function() {
7989
+ return this.map(function() {
7990
+ var offsetParent = this.offsetParent || document.documentElement;
7991
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
7992
+ offsetParent = offsetParent.offsetParent;
7993
+ }
7994
+ return offsetParent || document.documentElement;
7995
+ });
7996
+ }
7997
+ });
7998
+ // Create scrollLeft and scrollTop methods
7999
+ jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
8000
+ var top = /Y/.test( prop );
8001
+ jQuery.fn[ method ] = function( val ) {
8002
+ return jQuery.access( this, function( elem, method, val ) {
8003
+ var win = getWindow( elem );
8004
+ if ( val === undefined ) {
8005
+ return win ? (prop in win) ? win[ prop ] :
8006
+ win.document.documentElement[ method ] :
8007
+ elem[ method ];
8008
+ }
8009
+ if ( win ) {
8010
+ win.scrollTo(
8011
+ !top ? val : jQuery( win ).scrollLeft(),
8012
+ top ? val : jQuery( win ).scrollTop()
8013
+ );
8014
+ } else {
8015
+ elem[ method ] = val;
8016
+ }
8017
+ }, method, val, arguments.length, null );
8018
+ };
8019
+ });
8020
+ function getWindow( elem ) {
8021
+ return jQuery.isWindow( elem ) ?
8022
+ elem :
8023
+ elem.nodeType === 9 ?
8024
+ elem.defaultView || elem.parentWindow :
8025
+ false;
8026
+ }
8027
+ // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
8028
+ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
8029
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
8030
+ // margin is only for outerHeight, outerWidth
8031
+ jQuery.fn[ funcName ] = function( margin, value ) {
8032
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
8033
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
8034
+ return jQuery.access( this, function( elem, type, value ) {
8035
+ var doc;
8036
+ if ( jQuery.isWindow( elem ) ) {
8037
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
8038
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
8039
+ // https://github.com/jquery/jquery/pull/764
8040
+ return elem.document.documentElement[ "client" + name ];
8041
+ }
8042
+ // Get document width or height
8043
+ if ( elem.nodeType === 9 ) {
8044
+ doc = elem.documentElement;
8045
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
8046
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
8047
+ return Math.max(
8048
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
8049
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
8050
+ doc[ "client" + name ]
8051
+ );
8052
+ }
8053
+ return value === undefined ?
8054
+ // Get width or height on the element, requesting but not forcing parseFloat
8055
+ jQuery.css( elem, type, extra ) :
8056
+ // Set width or height on the element
8057
+ jQuery.style( elem, type, value, extra );
8058
+ }, type, chainable ? margin : undefined, chainable, null );
8059
+ };
8060
+ });
8061
+ });
8062
+ // Limit scope pollution from any deprecated API
8063
+ // (function() {
8064
+ // })();
8065
+ // Expose jQuery to the global object
8066
+ window.jQuery = window.$ = jQuery;
8067
+ // Expose jQuery as an AMD module, but only for AMD loaders that
8068
+ // understand the issues with loading multiple versions of jQuery
8069
+ // in a page that all might call define(). The loader will indicate
8070
+ // they have special allowances for multiple jQuery versions by
8071
+ // specifying define.amd.jQuery = true. Register as a named module,
8072
+ // since jQuery can be concatenated with other files that may use define,
8073
+ // but not use a proper concatenation script that understands anonymous
8074
+ // AMD modules. A named AMD is safest and most robust way to register.
8075
+ // Lowercase jquery is used because AMD module names are derived from
8076
+ // file names, and jQuery is normally delivered in a lowercase file name.
8077
+ // Do this after creating the global so that if an AMD module wants to call
8078
+ // noConflict to hide this version of jQuery, it will work.
8079
+ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
8080
+ define( "jquery", [], function () { return jQuery; } );
8081
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8082
  })( window );
js/jquery.rating.min.js CHANGED
@@ -1,13 +1,13 @@
1
- if(window.jQuery){(function($){if((!$.support.opacity&&!$.support.style)){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}$.fn.rating=function(options){if(this.length==0){return this;}if(typeof arguments[0]=="string"){if(this.length>1){var args=arguments;return this.each(function(){$.fn.rating.apply($(this),args);});}$.fn.rating[arguments[0]].apply(this,$.makeArray(arguments).slice(1)||[]);return this;}var options=$.extend({},$.fn.rating.options,options||{});$.fn.rating.calls++;this.not(".star-rating-applied").addClass("star-rating-applied").each(function(){var control,input=$(this);var eid=(this.name||"unnamed-rating").replace(/\[|\]/g,"_").replace(/^\_+|\_+$/g,"");var context=$(this.form||document.body);var raters=context.data("rating");if(!raters||raters.call!=$.fn.rating.calls){raters={count:0,call:$.fn.rating.calls};}var rater=raters[eid]||context.data("rating"+eid);if(rater){control=rater.data("rating");}if(rater&&control){control.count++;}else{control=$.extend({},options||{},($.metadata?input.metadata():($.meta?input.data():null))||{},{count:0,stars:[],inputs:[]});control.serial=raters.count++;rater=$('<span class="star-rating-control"/>');input.before(rater);rater.addClass("rating-to-be-drawn");if(input.attr("disabled")||input.hasClass("disabled")){control.readOnly=true;}if(input.hasClass("required")){control.required=true;}rater.append(control.cancel=$('<div class="rating-cancel"><a title="'+control.cancel+'">'+control.cancelValue+"</a></div>").on("mouseover",function(){$(this).rating("drain");$(this).addClass("star-rating-hover");}).on("mouseout",function(){$(this).rating("draw");$(this).removeClass("star-rating-hover");}).on("click",function(){$(this).rating("select");}).data("rating",control));}var star=$('<div role="text" aria-label="'+this.title+'" class="star-rating rater-'+control.serial+'"><a title="'+(this.title||this.value)+'">'+this.value+"</a></div>");rater.append(star);if(this.id){star.attr("id",this.id);}if(this.className){star.addClass(this.className);}if(control.half){control.split=2;}if(typeof control.split=="number"&&control.split>0){var stw=($.fn.width?star.width():0)||control.starWidth;var spi=(control.count%control.split),spw=Math.floor(stw/control.split);star.width(spw).find("a").css({"margin-left":"-"+(spi*spw)+"px"});}if(control.readOnly){star.addClass("star-rating-readonly");}else{star.addClass("star-rating-live").on("mouseover",function(){$(this).rating("fill");$(this).rating("focus");}).on("mouseout",function(){$(this).rating("draw");$(this).rating("blur");}).on("click",function(){$(this).rating("select");});}if(this.checked){control.current=star;}if(this.nodeName=="A"){if($(this).hasClass("selected")){control.current=star;}}input.hide();input.on("change.rating",function(event){if(event.selfTriggered){return false;}$(this).rating("select");});star.data("rating.input",input.data("rating.star",star));control.stars[control.stars.length]=star[0];control.inputs[control.inputs.length]=input[0];control.rater=raters[eid]=rater;control.context=context;input.data("rating",control);rater.data("rating",control);star.data("rating",control);context.data("rating",raters);context.data("rating"+eid,rater);});$(".rating-to-be-drawn").rating("draw").removeClass("rating-to-be-drawn");return this;};$.extend($.fn.rating,{calls:0,focus:function(){var control=this.data("rating");if(!control){return this;}if(!control.focus){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.focus){control.focus.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},blur:function(){var control=this.data("rating");if(!control){return this;}if(!control.blur){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.blur){control.blur.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},fill:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}this.rating("drain");this.prevAll().addBack().filter(".rater-"+control.serial).addClass("star-rating-hover");},drain:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.rater.children().filter(".rater-"+control.serial).removeClass("star-rating-on").removeClass("star-rating-hover");},draw:function(){var control=this.data("rating");if(!control){return this;}this.rating("drain");var current=$(control.current);var starson=current.length?current.prevAll().addBack().filter(".rater-"+control.serial):null;if(starson){starson.addClass("star-rating-on");}control.cancel[control.readOnly||control.required?"hide":"show"]();this.siblings()[control.readOnly?"addClass":"removeClass"]("star-rating-readonly");},select:function(value,wantCallBack){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.current=null;if(typeof value!="undefined"||this.length>1){if(typeof value=="number"){return $(control.stars[value]).rating("select",undefined,wantCallBack);}if(typeof value=="string"){$.each(control.stars,function(){if($(this).data("rating.input").val()==value){$(this).rating("select",undefined,wantCallBack);}});return this;}}else{control.current=this[0].tagName=="INPUT"?this.data("rating.star"):(this.is(".rater-"+control.serial)?this:null);}this.data("rating",control);this.rating("draw");var current=$(control.current?control.current.data("rating.input"):null);var lastipt=$(control.inputs).filter(":checked");var deadipt=$(control.inputs).not(current);deadipt.prop("checked",false);current.prop("checked",true);$(current.length?current:lastipt).trigger({type:"change",selfTriggered:true});if((wantCallBack||wantCallBack==undefined)&&control.callback){control.callback.apply(current[0],[current.val(),$("a",control.current)[0]]);}return this;},readOnly:function(toggle,disable){var control=this.data("rating");if(!control){return this;}control.readOnly=toggle||toggle==undefined?true:false;if(disable){$(control.inputs).attr("disabled","disabled");}else{$(control.inputs).removeAttr("disabled");}this.data("rating",control);this.rating("draw");},disable:function(){this.rating("readOnly",true,true);},enable:function(){this.rating("readOnly",false,false);}});$.fn.rating.options={cancel:"Cancel Rating",cancelValue:"",split:0,starWidth:16};$(function(){$("input[type=radio].star").rating();});})(jQuery);}(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata";}var data=$.data(elem,settings.single);if(data){return data;}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1];}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return;}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML);}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr;}}}}if(data.indexOf("{")<0){data="{"+data+"}";}data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);
2
- /*!
3
- * jQuery Form Plugin
4
- * version: 3.27.0-2013.02.06
5
- * @requires jQuery v1.5 or later
6
- *
7
- * Examples and documentation at: http://malsup.com/jquery/form/
8
- * Project repository: https://github.com/malsup/form
9
- * Dual licensed under the MIT and GPL licenses:
10
- * http://malsup.github.com/mit-license.txt
11
- * http://malsup.github.com/gpl-license-v2.txt
12
- */
13
  (function($){var feature={};feature.fileapi=$("<input type='file'/>").get(0).files!==undefined;feature.formdata=window.FormData!==undefined;$.fn.ajaxSubmit=function(options){if(!this.length){log("ajaxSubmit: skipping submit process - no element selected");return this;}var method,action,url,$form=this;if(typeof options=="function"){options={success:options};}method=this.attr("method");action=this.attr("action");url=(typeof action==="string")?$.trim(action):"";url=url||window.location.href||"";if(url){url=(url.match(/^([^#]+)/)||[])[1];}options=$.extend(true,{url:url,success:$.ajaxSettings.success,type:method||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},options);var veto={};this.trigger("form-pre-serialize",[this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this;}if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log("ajaxSubmit: submit aborted via beforeSerialize callback");return this;}var traditional=options.traditional;if(traditional===undefined){traditional=$.ajaxSettings.traditional;}var elements=[];var qx,a=this.formToArray(options.semantic,elements);if(options.data){options.extraData=options.data;qx=$.param(options.data,traditional);}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log("ajaxSubmit: submit aborted via beforeSubmit callback");return this;}this.trigger("form-submit-validate",[a,this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this;}var q=$.param(a,traditional);if(qx){q=(q?(q+"&"+qx):qx);}if(options.type.toUpperCase()=="GET"){options.url+=(options.url.indexOf("?")>=0?"&":"?")+q;options.data=null;}else{options.data=q;}var callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm();});}if(options.clearForm){callbacks.push(function(){$form.clearForm(options.includeHidden);});}if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?"replaceWith":"html";$(options.target)[fn](data).each(oldSuccess,arguments);});}else{if(options.success){callbacks.push(options.success);}}options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i<max;i++){callbacks[i].apply(context,[data,status,xhr||$form,$form]);}};var fileInputs=$('input[type=file]:enabled[value!=""]',this);var hasFileInputs=fileInputs.length>0;var mp="multipart/form-data";var multipart=($form.attr("enctype")==mp||$form.attr("encoding")==mp);var fileAPI=feature.fileapi&&feature.formdata;log("fileAPI :"+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI;var jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a);});}else{jqxhr=fileUploadIframe(a);}}else{if((hasFileInputs||multipart)&&fileAPI){jqxhr=fileUploadXhr(a);}else{jqxhr=$.ajax(options);}}$form.removeData("jqxhr").data("jqxhr",jqxhr);for(var k=0;k<elements.length;k++){elements[k]=null;}this.trigger("form-submit-notify",[this,options]);return this;function deepSerialize(extraData){var serialized=$.param(extraData).split("&");var len=serialized.length;var result=[];var i,part;for(i=0;i<len;i++){serialized[i]=serialized[i].replace(/\+/g," ");part=serialized[i].split("=");result.push([decodeURIComponent(part[0]),decodeURIComponent(part[1])]);}return result;}function fileUploadXhr(a){var formdata=new FormData();for(var i=0;i<a.length;i++){formdata.append(a[i].name,a[i].value);}if(options.extraData){var serializedData=deepSerialize(options.extraData);for(i=0;i<serializedData.length;i++){if(serializedData[i]){formdata.append(serializedData[i][0],serializedData[i][1]);}}}options.data=null;var s=$.extend(true,{},$.ajaxSettings,options,{contentType:false,processData:false,cache:false,type:method||"POST"});if(options.uploadProgress){s.xhr=function(){var xhr=jQuery.ajaxSettings.xhr();if(xhr.upload){xhr.upload.addEventListener("progress",function(event){var percent=0;var position=event.loaded||event.position;var total=event.total;if(event.lengthComputable){percent=Math.ceil(position/total*100);}options.uploadProgress(event,position,total,percent);},false);}return xhr;};}s.data=null;var beforeSend=s.beforeSend;s.beforeSend=function(xhr,o){o.data=formdata;if(beforeSend){beforeSend.call(this,xhr,o);}};return $.ajax(s);}function fileUploadIframe(a){var form=$form[0],el,i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;var useProp=!!$.fn.prop;var deferred=$.Deferred();if(a){for(i=0;i<elements.length;i++){el=$(elements[i]);if(useProp){el.prop("disabled",false);}else{el.removeAttr("disabled");}}}s=$.extend(true,{},$.ajaxSettings,options);s.context=s.context||s;id="jqFormIO"+(new Date().getTime());if(s.iframeTarget){$io=$(s.iframeTarget);n=$io.attr("name");if(!n){$io.attr("name",id);}else{id=n;}}else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />');$io.css({position:"absolute",top:"-1000px",left:"-1000px"});}io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==="timeout"?"timeout":"aborted");log("aborting upload... "+e);this.aborted=1;try{if(io.contentWindow.document.execCommand){io.contentWindow.document.execCommand("Stop");}}catch(ignore){}$io.attr("src",s.iframeSrc);xhr.error=e;if(s.error){s.error.call(s.context,xhr,e,status);}if(g){$.event.trigger("ajaxError",[xhr,s,e]);}if(s.complete){s.complete.call(s.context,xhr,e);}}};g=s.global;if(g&&0===$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,s]);}if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global){$.active--;}deferred.reject();return deferred;}if(xhr.aborted){deferred.reject();return deferred;}sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type=="image"){s.extraData[n+".x"]=form.clk_x;s.extraData[n+".y"]=form.clk_y;}}}var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=frame.contentWindow?frame.contentWindow.document:frame.contentDocument?frame.contentDocument:frame.document;return doc;}var csrf_token=$("meta[name=csrf-token]").attr("content");var csrf_param=$("meta[name=csrf-param]").attr("content");if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token;}function doSubmit(){var t=$form.attr("target"),a=$form.attr("action");form.setAttribute("target",id);if(!method){form.setAttribute("method","POST");}if(a!=s.url){form.setAttribute("action",s.url);}if(!s.skipEncodingOverride&&(!method||/post/i.test(method))){$form.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});}if(s.timeout){timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);}function checkState(){try{var state=getDoc(io).readyState;log("state = "+state);if(state&&state.toLowerCase()=="uninitialized"){setTimeout(checkState,50);}}catch(e){log("Server abort: ",e," (",e.name,")");cb(SERVER_ABORT);if(timeoutHandle){clearTimeout(timeoutHandle);}timeoutHandle=undefined;}}var extraInputs=[];try{if(s.extraData){for(var n in s.extraData){if(s.extraData.hasOwnProperty(n)){if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty("name")&&s.extraData[n].hasOwnProperty("value")){extraInputs.push($('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value).appendTo(form)[0]);}else{extraInputs.push($('<input type="hidden" name="'+n+'">').val(s.extraData[n]).appendTo(form)[0]);}}}}if(!s.iframeTarget){$io.appendTo("body");if(io.attachEvent){io.attachEvent("onload",cb);}else{io.addEventListener("load",cb,false);}}setTimeout(checkState,15);var submitFn=document.createElement("form").submit;submitFn.apply(form);}finally{form.setAttribute("action",a);if(t){form.setAttribute("target",t);}else{$form.removeAttr("target");}$(extraInputs).remove();}}if(s.forceSync){doSubmit();}else{setTimeout(doSubmit,10);}var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed){return;}try{doc=getDoc(io);}catch(ex){log("cannot access response document: ",ex);e=SERVER_ABORT;}if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort("timeout");deferred.reject(xhr,"timeout");return;}else{if(e==SERVER_ABORT&&xhr){xhr.abort("server abort");deferred.reject(xhr,"error","server abort");return;}}if(!doc||doc.location.href==s.iframeSrc){if(!timedOut){return;}}if(io.detachEvent){io.detachEvent("onload",cb);}else{io.removeEventListener("load",cb,false);}var status="success",errMsg;try{if(timedOut){throw"timeout";}var isXml=s.dataType=="xml"||doc.XMLDocument||$.isXMLDoc(doc);log("isXml="+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML)){if(--domCheckCount){log("requeing onLoad callback, DOM not available");setTimeout(cb,250);return;}}var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml){s.dataType="xml";}xhr.getResponseHeader=function(header){var headers={"content-type":s.dataType};return headers[header];};if(docRoot){xhr.status=Number(docRoot.getAttribute("status"))||xhr.status;xhr.statusText=docRoot.getAttribute("statusText")||xhr.statusText;}var dt=(s.dataType||"").toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName("textarea")[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute("status"))||xhr.status;xhr.statusText=ta.getAttribute("statusText")||xhr.statusText;}else{if(scr){var pre=doc.getElementsByTagName("pre")[0];var b=doc.getElementsByTagName("body")[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerText;}else{if(b){xhr.responseText=b.textContent?b.textContent:b.innerText;}}}}}else{if(dt=="xml"&&!xhr.responseXML&&xhr.responseText){xhr.responseXML=toXml(xhr.responseText);}}try{data=httpData(xhr,dt,s);}catch(e){status="parsererror";xhr.error=errMsg=(e||status);}}catch(e){log("error caught: ",e);status="error";xhr.error=errMsg=(e||status);}if(xhr.aborted){log("upload aborted");status=null;}if(xhr.status){status=(xhr.status>=200&&xhr.status<300||xhr.status===304)?"success":"error";}if(status==="success"){if(s.success){s.success.call(s.context,data,"success",xhr);}deferred.resolve(xhr.responseText,"success",xhr);if(g){$.event.trigger("ajaxSuccess",[xhr,s]);}}else{if(status){if(errMsg===undefined){errMsg=xhr.statusText;}if(s.error){s.error.call(s.context,xhr,status,errMsg);}deferred.reject(xhr,"error",errMsg);if(g){$.event.trigger("ajaxError",[xhr,s,errMsg]);}}}if(g){$.event.trigger("ajaxComplete",[xhr,s]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(s.complete){s.complete.call(s.context,xhr,status);}callbackProcessed=true;if(s.timeout){clearTimeout(timeoutHandle);}setTimeout(function(){if(!s.iframeTarget){$io.remove();}xhr.responseXML=null;},100);}var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return(doc&&doc.documentElement&&doc.documentElement.nodeName!="parsererror")?doc:null;};var parseJSON=$.parseJSON||function(s){return window["eval"]("("+s+")");};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){if($.error){$.error("parsererror");}}if(s&&s.dataFilter){data=s.dataFilter(data,type);}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=parseJSON(data);}else{if(type==="script"||!type&&ct.indexOf("javascript")>=0){$.globalEval(data);}}}return data;};return deferred;}};$.fn.ajaxForm=function(options){options=options||{};options.delegation=options.delegation&&$.isFunction($.fn.on);if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log("DOM not ready, queuing ajaxForm");$(function(){$(o.s,o.c).ajaxForm(options);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}if(options.delegation){$(document).off("submit.form-plugin",this.selector,doAjaxSubmit).off("click.form-plugin",this.selector,captureSubmittingElement).on("submit.form-plugin",this.selector,options,doAjaxSubmit).on("click.form-plugin",this.selector,options,captureSubmittingElement);return this;}return this.ajaxFormUnbind().bind("submit.form-plugin",options,doAjaxSubmit).bind("click.form-plugin",options,captureSubmittingElement);};function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(this).ajaxSubmit(options);}}function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!($el.is("[type=submit],[type=image]"))){var t=$el.closest("[type=submit]");if(t.length===0){return;}target=t[0];}var form=this;form.clk=target;if(target.type=="image"){if(e.offsetX!==undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}}setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);}$.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin");};$.fn.formToArray=function(semantic,elements){var a=[];if(this.length===0){return a;}var form=this[0];var els=semantic?form.getElementsByTagName("*"):form.elements;if(!els){return a;}var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n){continue;}if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val(),type:el.type});a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y});}continue;}v=$.fieldValue(el,true);if(v&&v.constructor==Array){if(elements){elements.push(el);}for(j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(feature.fileapi&&el.type=="file"&&!el.disabled){if(elements){elements.push(el);}var files=el.files;if(files.length){for(j=0;j<files.length;j++){a.push({name:n,value:files[j],type:el.type});}}else{a.push({name:n,value:"",type:el.type});}}else{if(v!==null&&typeof v!="undefined"){if(elements){elements.push(el);}a.push({name:n,value:v,type:el.type,required:el.required});}}}}if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type=="image"){a.push({name:n,value:$input.val()});a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y});}}return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}if(v.constructor==Array){$.merge(val,v);}else{val.push(v);}}return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(successful===undefined){successful=true;}if(successful&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var index=el.selectedIndex;if(index<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v){v=(op.attributes&&op.attributes.value&&!(op.attributes.value.specified))?op.text:op.value;}if(one){return v;}a.push(v);}}return a;}return $(el).val();};$.fn.clearForm=function(includeHidden){return this.each(function(){$("input,select,textarea",this).clearFields(includeHidden);});};$.fn.clearFields=$.fn.clearInputs=function(includeHidden){var re=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(re.test(t)||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}else{if(t=="file"){if(/MSIE/.test(navigator.userAgent)){$(this).replaceWith($(this).clone());}else{$(this).val("");}}else{if(includeHidden){if((includeHidden===true&&/hidden/.test(t))||(typeof includeHidden=="string"&&$(this).is(includeHidden))){this.value="";}}}}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};$.fn.enable=function(b){if(b===undefined){b=true;}return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select===undefined){select=true;}return this.each(function(){var t=this.type;if(t=="checkbox"||t=="radio"){this.checked=select;}else{if(this.tagName.toLowerCase()=="option"){var $sel=$(this).parent("select");if(select&&$sel[0]&&$sel[0].type=="select-one"){$sel.find("option").selected(false);}this.selected=select;}}});};$.fn.ajaxSubmit.debug=false;function log(){if(!$.fn.ajaxSubmit.debug){return;}var msg="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(msg);}else{if(window.opera&&window.opera.postError){window.opera.postError(msg);}}}})(jQuery);eval(function(p,a,c,k,e,r){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36));};if(!"".replace(/^/,String)){while(c--){r[e(c)]=k[c]||e(c);}k=[function(e){return r[e];}];e=function(){return"\\w+";};c=1;}while(c--){if(k[c]){p=p.replace(new RegExp("\\b"+e(c)+"\\b","g"),k[c]);}}return p;}(";5(1W.1C)(8($){5((!$.1s.1V&&!$.1s.1U))2d{1j.1X(\"1T\",C,s)}1R(e){};$.o.4=8(j){5(3.u==0)9 3;5(M V[0]=='1m'){5(3.u>1){7 k=V;9 3.18(8(){$.o.4.K($(3),k)})};$.o.4[V[0]].K(3,$.27(V).26(1)||[]);9 3};7 j=$.1b({},$.o.4.1w,j||{});$.o.4.P++;3.1y('.l-4-1g').p('l-4-1g').18(8(){7 b,m=$(3);7 c=(3.2g||'28-4').1f(/\\[|\\]/g,'Y').1f(/^\\Y+|\\Y+$/g,'');7 d=$(3.2h||1j.1H);7 e=d.6('4');5(!e||e.1o!=$.o.4.P)e={E:0,1o:$.o.4.P};7 f=e[c]||d.6('4'+c);5(f)b=f.6('4');5(f&&b)b.E++;R{b=$.1b({},j||{},($.1d?m.1d():($.25?m.6():w))||{},{E:0,L:[],v:[]});b.z=e.E++;f=$('<1G 13=\"l-4-1I\"/>');m.1J(f);f.p('4-12-11-10');5(m.Z('G')||m.14('G'))b.n=s;5(m.14('1c'))b.1c=s;f.1r(b.D=$('<W 13=\"4-D\"><a U=\"'+b.D+'\">'+b.1B+'</a></W>').q('1e',8(){$(3).4('N');$(3).p('l-4-T')}).q('1h',8(){$(3).4('x');$(3).I('l-4-T')}).q('1i',8(){$(3).4('y')}).6('4',b))};7 g=$('<W 20=\"21\" 22-24=\"'+3.U+'\" 13=\"l-4 t-'+b.z+'\"><a U=\"'+(3.U||3.1k)+'\">'+3.1k+'</a></W>');f.1r(g);5(3.X)g.Z('X',3.X);5(3.1x)g.p(3.1x);5(b.29)b.B=2;5(M b.B=='1l'&&b.B>0){7 h=($.o.15?g.15():0)||b.1n;7 i=(b.E%b.B),17=1K.1L(h/b.B);g.15(17).1M('a').1N({'1O-1P':'-'+(i*17)+'1Q'})};5(b.n)g.p('l-4-1p');R g.p('l-4-1S').q('1e',8(){$(3).4('1q');$(3).4('J')}).q('1h',8(){$(3).4('x');$(3).4('H')}).q('1i',8(){$(3).4('y')});5(3.S)b.r=g;5(3.1Y==\"A\"){5($(3).14('1Z'))b.r=g};m.1t();m.q('1u.4',8(a){5(a.1v)9 C;$(3).4('y')});g.6('4.m',m.6('4.l',g));b.L[b.L.u]=g[0];b.v[b.v.u]=m[0];b.t=e[c]=f;b.23=d;m.6('4',b);f.6('4',b);g.6('4',b);d.6('4',e);d.6('4'+c,f)});$('.4-12-11-10').4('x').I('4-12-11-10');9 3};$.1b($.o.4,{P:0,J:8(){7 a=3.6('4');5(!a)9 3;5(!a.J)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.J)a.J.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},H:8(){7 a=3.6('4');5(!a)9 3;5(!a.H)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.H)a.H.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},1q:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;3.4('N');3.1z().1A().O('.t-'+a.z).p('l-4-T')},N:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;a.t.2a().O('.t-'+a.z).I('l-4-q').I('l-4-T')},x:8(){7 a=3.6('4');5(!a)9 3;3.4('N');7 b=$(a.r);7 c=b.u?b.1z().1A().O('.t-'+a.z):w;5(c)c.p('l-4-q');a.D[a.n||a.1c?'1t':'2b']();3.2c()[a.n?'p':'I']('l-4-1p')},y:8(a,b){7 c=3.6('4');5(!c)9 3;5(c.n)9;c.r=w;5(M a!='F'||3.u>1){5(M a=='1l')9 $(c.L[a]).4('y',F,b);5(M a=='1m'){$.18(c.L,8(){5($(3).6('4.m').Q()==a)$(3).4('y',F,b)});9 3}}R{c.r=3[0].19=='1a'?3.6('4.l'):(3.2e('.t-'+c.z)?3:w)};3.6('4',c);3.4('x');7 d=$(c.r?c.r.6('4.m'):w);7 e=$(c.v).O(':S');7 f=$(c.v).1y(d);f.1D('S',C);d.1D('S',s);$(d.u?d:e).2f({1E:'1u',1v:s});5((b||b==F)&&c.1F)c.1F.K(d[0],[d.Q(),$('a',c.r)[0]]);9 3},n:8(a,b){7 c=3.6('4');5(!c)9 3;c.n=a||a==F?s:C;5(b)$(c.v).Z(\"G\",\"G\");R $(c.v).2i(\"G\");3.6('4',c);3.4('x')},2j:8(){3.4('n',s,s)},2k:8(){3.4('n',C,C)}});$.o.4.1w={D:'2l 2m',1B:'',B:0,1n:16};$(8(){$('m[1E=2n].l').4()})})(1C);",62,148,"|||this|rating|if|data|var|function|return||||||||||||star|input|readOnly|fn|addClass|on|current|true|rater|length|inputs|null|draw|select|serial||split|false|cancel|count|undefined|disabled|blur|removeClass|focus|apply|stars|typeof|drain|filter|calls|val|else|checked|hover|title|arguments|div|id|_|attr|drawn|be|to|class|hasClass|width||spw|each|tagName|INPUT|extend|required|metadata|mouseover|replace|applied|mouseout|click|document|value|number|string|starWidth|call|readonly|fill|append|support|hide|change|selfTriggered|options|className|not|prevAll|addBack|cancelValue|jQuery|prop|type|callback|span|body|control|before|Math|floor|find|css|margin|left|px|catch|live|BackgroundImageCache|style|opacity|window|execCommand|nodeName|selected|role|text|aria|context|label|meta|slice|makeArray|unnamed|half|children|show|siblings|try|is|trigger|name|form|removeAttr|disable|enable|Cancel|Rating|radio".split("|"),0,{}));
1
+ if(window.jQuery){(function($){if((!$.support.opacity&&!$.support.style)){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}$.fn.rating=function(options){if(this.length==0){return this;}if(typeof arguments[0]=="string"){if(this.length>1){var args=arguments;return this.each(function(){$.fn.rating.apply($(this),args);});}$.fn.rating[arguments[0]].apply(this,$.makeArray(arguments).slice(1)||[]);return this;}var options=$.extend({},$.fn.rating.options,options||{});$.fn.rating.calls++;this.not(".star-rating-applied").addClass("star-rating-applied").each(function(){var control,input=$(this);var eid=(this.name||"unnamed-rating").replace(/\[|\]/g,"_").replace(/^\_+|\_+$/g,"");var context=$(this.form||document.body);var raters=context.data("rating");if(!raters||raters.call!=$.fn.rating.calls){raters={count:0,call:$.fn.rating.calls};}var rater=raters[eid]||context.data("rating"+eid);if(rater){control=rater.data("rating");}if(rater&&control){control.count++;}else{control=$.extend({},options||{},($.metadata?input.metadata():($.meta?input.data():null))||{},{count:0,stars:[],inputs:[]});control.serial=raters.count++;rater=$('<span class="star-rating-control"/>');input.before(rater);rater.addClass("rating-to-be-drawn");if(input.attr("disabled")||input.hasClass("disabled")){control.readOnly=true;}if(input.hasClass("required")){control.required=true;}rater.append(control.cancel=$('<div class="rating-cancel"><a title="'+control.cancel+'">'+control.cancelValue+"</a></div>").on("mouseover",function(){$(this).rating("drain");$(this).addClass("star-rating-hover");}).on("mouseout",function(){$(this).rating("draw");$(this).removeClass("star-rating-hover");}).on("click",function(){$(this).rating("select");}).data("rating",control));}var star=$('<div role="text" aria-label="'+this.title+'" class="star-rating rater-'+control.serial+'"><a title="'+(this.title||this.value)+'">'+this.value+"</a></div>");rater.append(star);if(this.id){star.attr("id",this.id);}if(this.className){star.addClass(this.className);}if(control.half){control.split=2;}if(typeof control.split=="number"&&control.split>0){var stw=($.fn.width?star.width():0)||control.starWidth;var spi=(control.count%control.split),spw=Math.floor(stw/control.split);star.width(spw).find("a").css({"margin-left":"-"+(spi*spw)+"px"});}if(control.readOnly){star.addClass("star-rating-readonly");}else{star.addClass("star-rating-live").on("mouseover",function(){$(this).rating("fill");$(this).rating("focus");}).on("mouseout",function(){$(this).rating("draw");$(this).rating("blur");}).on("click",function(){$(this).rating("select");});}if(this.checked){control.current=star;}if(this.nodeName=="A"){if($(this).hasClass("selected")){control.current=star;}}input.hide();input.on("change.rating",function(event){if(event.selfTriggered){return false;}$(this).rating("select");});star.data("rating.input",input.data("rating.star",star));control.stars[control.stars.length]=star[0];control.inputs[control.inputs.length]=input[0];control.rater=raters[eid]=rater;control.context=context;input.data("rating",control);rater.data("rating",control);star.data("rating",control);context.data("rating",raters);context.data("rating"+eid,rater);});$(".rating-to-be-drawn").rating("draw").removeClass("rating-to-be-drawn");return this;};$.extend($.fn.rating,{calls:0,focus:function(){var control=this.data("rating");if(!control){return this;}if(!control.focus){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.focus){control.focus.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},blur:function(){var control=this.data("rating");if(!control){return this;}if(!control.blur){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.blur){control.blur.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},fill:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}this.rating("drain");this.prevAll().addBack().filter(".rater-"+control.serial).addClass("star-rating-hover");},drain:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.rater.children().filter(".rater-"+control.serial).removeClass("star-rating-on").removeClass("star-rating-hover");},draw:function(){var control=this.data("rating");if(!control){return this;}this.rating("drain");var current=$(control.current);var starson=current.length?current.prevAll().addBack().filter(".rater-"+control.serial):null;if(starson){starson.addClass("star-rating-on");}control.cancel[control.readOnly||control.required?"hide":"show"]();this.siblings()[control.readOnly?"addClass":"removeClass"]("star-rating-readonly");},select:function(value,wantCallBack){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.current=null;if(typeof value!="undefined"||this.length>1){if(typeof value=="number"){return $(control.stars[value]).rating("select",undefined,wantCallBack);}if(typeof value=="string"){$.each(control.stars,function(){if($(this).data("rating.input").val()==value){$(this).rating("select",undefined,wantCallBack);}});return this;}}else{control.current=this[0].tagName=="INPUT"?this.data("rating.star"):(this.is(".rater-"+control.serial)?this:null);}this.data("rating",control);this.rating("draw");var current=$(control.current?control.current.data("rating.input"):null);var lastipt=$(control.inputs).filter(":checked");var deadipt=$(control.inputs).not(current);deadipt.prop("checked",false);current.prop("checked",true);$(current.length?current:lastipt).trigger({type:"change",selfTriggered:true});if((wantCallBack||wantCallBack==undefined)&&control.callback){control.callback.apply(current[0],[current.val(),$("a",control.current)[0]]);}return this;},readOnly:function(toggle,disable){var control=this.data("rating");if(!control){return this;}control.readOnly=toggle||toggle==undefined?true:false;if(disable){$(control.inputs).attr("disabled","disabled");}else{$(control.inputs).removeAttr("disabled");}this.data("rating",control);this.rating("draw");},disable:function(){this.rating("readOnly",true,true);},enable:function(){this.rating("readOnly",false,false);}});$.fn.rating.options={cancel:"Cancel Rating",cancelValue:"",split:0,starWidth:16};$(function(){$("input[type=radio].star").rating();});})(jQuery);}(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata";}var data=$.data(elem,settings.single);if(data){return data;}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1];}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return;}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML);}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr;}}}}if(data.indexOf("{")<0){data="{"+data+"}";}data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);
2
+ /*!
3
+ * jQuery Form Plugin
4
+ * version: 3.27.0-2013.02.06
5
+ * @requires jQuery v1.5 or later
6
+ *
7
+ * Examples and documentation at: http://malsup.com/jquery/form/
8
+ * Project repository: https://github.com/malsup/form
9
+ * Dual licensed under the MIT and GPL licenses:
10
+ * http://malsup.github.com/mit-license.txt
11
+ * http://malsup.github.com/gpl-license-v2.txt
12
+ */
13
  (function($){var feature={};feature.fileapi=$("<input type='file'/>").get(0).files!==undefined;feature.formdata=window.FormData!==undefined;$.fn.ajaxSubmit=function(options){if(!this.length){log("ajaxSubmit: skipping submit process - no element selected");return this;}var method,action,url,$form=this;if(typeof options=="function"){options={success:options};}method=this.attr("method");action=this.attr("action");url=(typeof action==="string")?$.trim(action):"";url=url||window.location.href||"";if(url){url=(url.match(/^([^#]+)/)||[])[1];}options=$.extend(true,{url:url,success:$.ajaxSettings.success,type:method||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},options);var veto={};this.trigger("form-pre-serialize",[this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this;}if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log("ajaxSubmit: submit aborted via beforeSerialize callback");return this;}var traditional=options.traditional;if(traditional===undefined){traditional=$.ajaxSettings.traditional;}var elements=[];var qx,a=this.formToArray(options.semantic,elements);if(options.data){options.extraData=options.data;qx=$.param(options.data,traditional);}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log("ajaxSubmit: submit aborted via beforeSubmit callback");return this;}this.trigger("form-submit-validate",[a,this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this;}var q=$.param(a,traditional);if(qx){q=(q?(q+"&"+qx):qx);}if(options.type.toUpperCase()=="GET"){options.url+=(options.url.indexOf("?")>=0?"&":"?")+q;options.data=null;}else{options.data=q;}var callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm();});}if(options.clearForm){callbacks.push(function(){$form.clearForm(options.includeHidden);});}if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?"replaceWith":"html";$(options.target)[fn](data).each(oldSuccess,arguments);});}else{if(options.success){callbacks.push(options.success);}}options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i<max;i++){callbacks[i].apply(context,[data,status,xhr||$form,$form]);}};var fileInputs=$('input[type=file]:enabled[value!=""]',this);var hasFileInputs=fileInputs.length>0;var mp="multipart/form-data";var multipart=($form.attr("enctype")==mp||$form.attr("encoding")==mp);var fileAPI=feature.fileapi&&feature.formdata;log("fileAPI :"+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI;var jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a);});}else{jqxhr=fileUploadIframe(a);}}else{if((hasFileInputs||multipart)&&fileAPI){jqxhr=fileUploadXhr(a);}else{jqxhr=$.ajax(options);}}$form.removeData("jqxhr").data("jqxhr",jqxhr);for(var k=0;k<elements.length;k++){elements[k]=null;}this.trigger("form-submit-notify",[this,options]);return this;function deepSerialize(extraData){var serialized=$.param(extraData).split("&");var len=serialized.length;var result=[];var i,part;for(i=0;i<len;i++){serialized[i]=serialized[i].replace(/\+/g," ");part=serialized[i].split("=");result.push([decodeURIComponent(part[0]),decodeURIComponent(part[1])]);}return result;}function fileUploadXhr(a){var formdata=new FormData();for(var i=0;i<a.length;i++){formdata.append(a[i].name,a[i].value);}if(options.extraData){var serializedData=deepSerialize(options.extraData);for(i=0;i<serializedData.length;i++){if(serializedData[i]){formdata.append(serializedData[i][0],serializedData[i][1]);}}}options.data=null;var s=$.extend(true,{},$.ajaxSettings,options,{contentType:false,processData:false,cache:false,type:method||"POST"});if(options.uploadProgress){s.xhr=function(){var xhr=jQuery.ajaxSettings.xhr();if(xhr.upload){xhr.upload.addEventListener("progress",function(event){var percent=0;var position=event.loaded||event.position;var total=event.total;if(event.lengthComputable){percent=Math.ceil(position/total*100);}options.uploadProgress(event,position,total,percent);},false);}return xhr;};}s.data=null;var beforeSend=s.beforeSend;s.beforeSend=function(xhr,o){o.data=formdata;if(beforeSend){beforeSend.call(this,xhr,o);}};return $.ajax(s);}function fileUploadIframe(a){var form=$form[0],el,i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;var useProp=!!$.fn.prop;var deferred=$.Deferred();if(a){for(i=0;i<elements.length;i++){el=$(elements[i]);if(useProp){el.prop("disabled",false);}else{el.removeAttr("disabled");}}}s=$.extend(true,{},$.ajaxSettings,options);s.context=s.context||s;id="jqFormIO"+(new Date().getTime());if(s.iframeTarget){$io=$(s.iframeTarget);n=$io.attr("name");if(!n){$io.attr("name",id);}else{id=n;}}else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />');$io.css({position:"absolute",top:"-1000px",left:"-1000px"});}io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==="timeout"?"timeout":"aborted");log("aborting upload... "+e);this.aborted=1;try{if(io.contentWindow.document.execCommand){io.contentWindow.document.execCommand("Stop");}}catch(ignore){}$io.attr("src",s.iframeSrc);xhr.error=e;if(s.error){s.error.call(s.context,xhr,e,status);}if(g){$.event.trigger("ajaxError",[xhr,s,e]);}if(s.complete){s.complete.call(s.context,xhr,e);}}};g=s.global;if(g&&0===$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,s]);}if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global){$.active--;}deferred.reject();return deferred;}if(xhr.aborted){deferred.reject();return deferred;}sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type=="image"){s.extraData[n+".x"]=form.clk_x;s.extraData[n+".y"]=form.clk_y;}}}var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=frame.contentWindow?frame.contentWindow.document:frame.contentDocument?frame.contentDocument:frame.document;return doc;}var csrf_token=$("meta[name=csrf-token]").attr("content");var csrf_param=$("meta[name=csrf-param]").attr("content");if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token;}function doSubmit(){var t=$form.attr("target"),a=$form.attr("action");form.setAttribute("target",id);if(!method){form.setAttribute("method","POST");}if(a!=s.url){form.setAttribute("action",s.url);}if(!s.skipEncodingOverride&&(!method||/post/i.test(method))){$form.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});}if(s.timeout){timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);}function checkState(){try{var state=getDoc(io).readyState;log("state = "+state);if(state&&state.toLowerCase()=="uninitialized"){setTimeout(checkState,50);}}catch(e){log("Server abort: ",e," (",e.name,")");cb(SERVER_ABORT);if(timeoutHandle){clearTimeout(timeoutHandle);}timeoutHandle=undefined;}}var extraInputs=[];try{if(s.extraData){for(var n in s.extraData){if(s.extraData.hasOwnProperty(n)){if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty("name")&&s.extraData[n].hasOwnProperty("value")){extraInputs.push($('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value).appendTo(form)[0]);}else{extraInputs.push($('<input type="hidden" name="'+n+'">').val(s.extraData[n]).appendTo(form)[0]);}}}}if(!s.iframeTarget){$io.appendTo("body");if(io.attachEvent){io.attachEvent("onload",cb);}else{io.addEventListener("load",cb,false);}}setTimeout(checkState,15);var submitFn=document.createElement("form").submit;submitFn.apply(form);}finally{form.setAttribute("action",a);if(t){form.setAttribute("target",t);}else{$form.removeAttr("target");}$(extraInputs).remove();}}if(s.forceSync){doSubmit();}else{setTimeout(doSubmit,10);}var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed){return;}try{doc=getDoc(io);}catch(ex){log("cannot access response document: ",ex);e=SERVER_ABORT;}if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort("timeout");deferred.reject(xhr,"timeout");return;}else{if(e==SERVER_ABORT&&xhr){xhr.abort("server abort");deferred.reject(xhr,"error","server abort");return;}}if(!doc||doc.location.href==s.iframeSrc){if(!timedOut){return;}}if(io.detachEvent){io.detachEvent("onload",cb);}else{io.removeEventListener("load",cb,false);}var status="success",errMsg;try{if(timedOut){throw"timeout";}var isXml=s.dataType=="xml"||doc.XMLDocument||$.isXMLDoc(doc);log("isXml="+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML)){if(--domCheckCount){log("requeing onLoad callback, DOM not available");setTimeout(cb,250);return;}}var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml){s.dataType="xml";}xhr.getResponseHeader=function(header){var headers={"content-type":s.dataType};return headers[header];};if(docRoot){xhr.status=Number(docRoot.getAttribute("status"))||xhr.status;xhr.statusText=docRoot.getAttribute("statusText")||xhr.statusText;}var dt=(s.dataType||"").toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName("textarea")[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute("status"))||xhr.status;xhr.statusText=ta.getAttribute("statusText")||xhr.statusText;}else{if(scr){var pre=doc.getElementsByTagName("pre")[0];var b=doc.getElementsByTagName("body")[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerText;}else{if(b){xhr.responseText=b.textContent?b.textContent:b.innerText;}}}}}else{if(dt=="xml"&&!xhr.responseXML&&xhr.responseText){xhr.responseXML=toXml(xhr.responseText);}}try{data=httpData(xhr,dt,s);}catch(e){status="parsererror";xhr.error=errMsg=(e||status);}}catch(e){log("error caught: ",e);status="error";xhr.error=errMsg=(e||status);}if(xhr.aborted){log("upload aborted");status=null;}if(xhr.status){status=(xhr.status>=200&&xhr.status<300||xhr.status===304)?"success":"error";}if(status==="success"){if(s.success){s.success.call(s.context,data,"success",xhr);}deferred.resolve(xhr.responseText,"success",xhr);if(g){$.event.trigger("ajaxSuccess",[xhr,s]);}}else{if(status){if(errMsg===undefined){errMsg=xhr.statusText;}if(s.error){s.error.call(s.context,xhr,status,errMsg);}deferred.reject(xhr,"error",errMsg);if(g){$.event.trigger("ajaxError",[xhr,s,errMsg]);}}}if(g){$.event.trigger("ajaxComplete",[xhr,s]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(s.complete){s.complete.call(s.context,xhr,status);}callbackProcessed=true;if(s.timeout){clearTimeout(timeoutHandle);}setTimeout(function(){if(!s.iframeTarget){$io.remove();}xhr.responseXML=null;},100);}var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return(doc&&doc.documentElement&&doc.documentElement.nodeName!="parsererror")?doc:null;};var parseJSON=$.parseJSON||function(s){return window["eval"]("("+s+")");};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){if($.error){$.error("parsererror");}}if(s&&s.dataFilter){data=s.dataFilter(data,type);}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=parseJSON(data);}else{if(type==="script"||!type&&ct.indexOf("javascript")>=0){$.globalEval(data);}}}return data;};return deferred;}};$.fn.ajaxForm=function(options){options=options||{};options.delegation=options.delegation&&$.isFunction($.fn.on);if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log("DOM not ready, queuing ajaxForm");$(function(){$(o.s,o.c).ajaxForm(options);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}if(options.delegation){$(document).off("submit.form-plugin",this.selector,doAjaxSubmit).off("click.form-plugin",this.selector,captureSubmittingElement).on("submit.form-plugin",this.selector,options,doAjaxSubmit).on("click.form-plugin",this.selector,options,captureSubmittingElement);return this;}return this.ajaxFormUnbind().bind("submit.form-plugin",options,doAjaxSubmit).bind("click.form-plugin",options,captureSubmittingElement);};function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(this).ajaxSubmit(options);}}function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!($el.is("[type=submit],[type=image]"))){var t=$el.closest("[type=submit]");if(t.length===0){return;}target=t[0];}var form=this;form.clk=target;if(target.type=="image"){if(e.offsetX!==undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}}setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);}$.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin");};$.fn.formToArray=function(semantic,elements){var a=[];if(this.length===0){return a;}var form=this[0];var els=semantic?form.getElementsByTagName("*"):form.elements;if(!els){return a;}var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n){continue;}if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val(),type:el.type});a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y});}continue;}v=$.fieldValue(el,true);if(v&&v.constructor==Array){if(elements){elements.push(el);}for(j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(feature.fileapi&&el.type=="file"&&!el.disabled){if(elements){elements.push(el);}var files=el.files;if(files.length){for(j=0;j<files.length;j++){a.push({name:n,value:files[j],type:el.type});}}else{a.push({name:n,value:"",type:el.type});}}else{if(v!==null&&typeof v!="undefined"){if(elements){elements.push(el);}a.push({name:n,value:v,type:el.type,required:el.required});}}}}if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type=="image"){a.push({name:n,value:$input.val()});a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y});}}return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}if(v.constructor==Array){$.merge(val,v);}else{val.push(v);}}return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(successful===undefined){successful=true;}if(successful&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var index=el.selectedIndex;if(index<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v){v=(op.attributes&&op.attributes.value&&!(op.attributes.value.specified))?op.text:op.value;}if(one){return v;}a.push(v);}}return a;}return $(el).val();};$.fn.clearForm=function(includeHidden){return this.each(function(){$("input,select,textarea",this).clearFields(includeHidden);});};$.fn.clearFields=$.fn.clearInputs=function(includeHidden){var re=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(re.test(t)||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}else{if(t=="file"){if(/MSIE/.test(navigator.userAgent)){$(this).replaceWith($(this).clone());}else{$(this).val("");}}else{if(includeHidden){if((includeHidden===true&&/hidden/.test(t))||(typeof includeHidden=="string"&&$(this).is(includeHidden))){this.value="";}}}}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};$.fn.enable=function(b){if(b===undefined){b=true;}return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select===undefined){select=true;}return this.each(function(){var t=this.type;if(t=="checkbox"||t=="radio"){this.checked=select;}else{if(this.tagName.toLowerCase()=="option"){var $sel=$(this).parent("select");if(select&&$sel[0]&&$sel[0].type=="select-one"){$sel.find("option").selected(false);}this.selected=select;}}});};$.fn.ajaxSubmit.debug=false;function log(){if(!$.fn.ajaxSubmit.debug){return;}var msg="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(msg);}else{if(window.opera&&window.opera.postError){window.opera.postError(msg);}}}})(jQuery);eval(function(p,a,c,k,e,r){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36));};if(!"".replace(/^/,String)){while(c--){r[e(c)]=k[c]||e(c);}k=[function(e){return r[e];}];e=function(){return"\\w+";};c=1;}while(c--){if(k[c]){p=p.replace(new RegExp("\\b"+e(c)+"\\b","g"),k[c]);}}return p;}(";5(1W.1C)(8($){5((!$.1s.1V&&!$.1s.1U))2d{1j.1X(\"1T\",C,s)}1R(e){};$.o.4=8(j){5(3.u==0)9 3;5(M V[0]=='1m'){5(3.u>1){7 k=V;9 3.18(8(){$.o.4.K($(3),k)})};$.o.4[V[0]].K(3,$.27(V).26(1)||[]);9 3};7 j=$.1b({},$.o.4.1w,j||{});$.o.4.P++;3.1y('.l-4-1g').p('l-4-1g').18(8(){7 b,m=$(3);7 c=(3.2g||'28-4').1f(/\\[|\\]/g,'Y').1f(/^\\Y+|\\Y+$/g,'');7 d=$(3.2h||1j.1H);7 e=d.6('4');5(!e||e.1o!=$.o.4.P)e={E:0,1o:$.o.4.P};7 f=e[c]||d.6('4'+c);5(f)b=f.6('4');5(f&&b)b.E++;R{b=$.1b({},j||{},($.1d?m.1d():($.25?m.6():w))||{},{E:0,L:[],v:[]});b.z=e.E++;f=$('<1G 13=\"l-4-1I\"/>');m.1J(f);f.p('4-12-11-10');5(m.Z('G')||m.14('G'))b.n=s;5(m.14('1c'))b.1c=s;f.1r(b.D=$('<W 13=\"4-D\"><a U=\"'+b.D+'\">'+b.1B+'</a></W>').q('1e',8(){$(3).4('N');$(3).p('l-4-T')}).q('1h',8(){$(3).4('x');$(3).I('l-4-T')}).q('1i',8(){$(3).4('y')}).6('4',b))};7 g=$('<W 20=\"21\" 22-24=\"'+3.U+'\" 13=\"l-4 t-'+b.z+'\"><a U=\"'+(3.U||3.1k)+'\">'+3.1k+'</a></W>');f.1r(g);5(3.X)g.Z('X',3.X);5(3.1x)g.p(3.1x);5(b.29)b.B=2;5(M b.B=='1l'&&b.B>0){7 h=($.o.15?g.15():0)||b.1n;7 i=(b.E%b.B),17=1K.1L(h/b.B);g.15(17).1M('a').1N({'1O-1P':'-'+(i*17)+'1Q'})};5(b.n)g.p('l-4-1p');R g.p('l-4-1S').q('1e',8(){$(3).4('1q');$(3).4('J')}).q('1h',8(){$(3).4('x');$(3).4('H')}).q('1i',8(){$(3).4('y')});5(3.S)b.r=g;5(3.1Y==\"A\"){5($(3).14('1Z'))b.r=g};m.1t();m.q('1u.4',8(a){5(a.1v)9 C;$(3).4('y')});g.6('4.m',m.6('4.l',g));b.L[b.L.u]=g[0];b.v[b.v.u]=m[0];b.t=e[c]=f;b.23=d;m.6('4',b);f.6('4',b);g.6('4',b);d.6('4',e);d.6('4'+c,f)});$('.4-12-11-10').4('x').I('4-12-11-10');9 3};$.1b($.o.4,{P:0,J:8(){7 a=3.6('4');5(!a)9 3;5(!a.J)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.J)a.J.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},H:8(){7 a=3.6('4');5(!a)9 3;5(!a.H)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.H)a.H.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},1q:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;3.4('N');3.1z().1A().O('.t-'+a.z).p('l-4-T')},N:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;a.t.2a().O('.t-'+a.z).I('l-4-q').I('l-4-T')},x:8(){7 a=3.6('4');5(!a)9 3;3.4('N');7 b=$(a.r);7 c=b.u?b.1z().1A().O('.t-'+a.z):w;5(c)c.p('l-4-q');a.D[a.n||a.1c?'1t':'2b']();3.2c()[a.n?'p':'I']('l-4-1p')},y:8(a,b){7 c=3.6('4');5(!c)9 3;5(c.n)9;c.r=w;5(M a!='F'||3.u>1){5(M a=='1l')9 $(c.L[a]).4('y',F,b);5(M a=='1m'){$.18(c.L,8(){5($(3).6('4.m').Q()==a)$(3).4('y',F,b)});9 3}}R{c.r=3[0].19=='1a'?3.6('4.l'):(3.2e('.t-'+c.z)?3:w)};3.6('4',c);3.4('x');7 d=$(c.r?c.r.6('4.m'):w);7 e=$(c.v).O(':S');7 f=$(c.v).1y(d);f.1D('S',C);d.1D('S',s);$(d.u?d:e).2f({1E:'1u',1v:s});5((b||b==F)&&c.1F)c.1F.K(d[0],[d.Q(),$('a',c.r)[0]]);9 3},n:8(a,b){7 c=3.6('4');5(!c)9 3;c.n=a||a==F?s:C;5(b)$(c.v).Z(\"G\",\"G\");R $(c.v).2i(\"G\");3.6('4',c);3.4('x')},2j:8(){3.4('n',s,s)},2k:8(){3.4('n',C,C)}});$.o.4.1w={D:'2l 2m',1B:'',B:0,1n:16};$(8(){$('m[1E=2n].l').4()})})(1C);",62,148,"|||this|rating|if|data|var|function|return||||||||||||star|input|readOnly|fn|addClass|on|current|true|rater|length|inputs|null|draw|select|serial||split|false|cancel|count|undefined|disabled|blur|removeClass|focus|apply|stars|typeof|drain|filter|calls|val|else|checked|hover|title|arguments|div|id|_|attr|drawn|be|to|class|hasClass|width||spw|each|tagName|INPUT|extend|required|metadata|mouseover|replace|applied|mouseout|click|document|value|number|string|starWidth|call|readonly|fill|append|support|hide|change|selfTriggered|options|className|not|prevAll|addBack|cancelValue|jQuery|prop|type|callback|span|body|control|before|Math|floor|find|css|margin|left|px|catch|live|BackgroundImageCache|style|opacity|window|execCommand|nodeName|selected|role|text|aria|context|label|meta|slice|makeArray|unnamed|half|children|show|siblings|try|is|trigger|name|form|removeAttr|disable|enable|Cancel|Rating|radio".split("|"),0,{}));
js/jquery.timePicker.min.js CHANGED
@@ -1,13 +1,13 @@
1
- /**
2
- * A time picker for jQuery.
3
- *
4
- * Dual licensed under the MIT and GPL licenses.
5
- * Copyright (c) 2009 Anders Fajerson
6
- *
7
- * @name timePicker
8
- * @author Anders Fajerson (http://perifer.se)
9
- * @see http://github.com/perifer/timePicker
10
- * @example $("#mytime").timePicker();
11
- * @example $("#mytime").timePicker({step:30, startTime:"15:00", endTime:"18:00"});
12
- */
13
  (function(a){function g(a){a.setFullYear(2001),a.setMonth(0),a.setDate(0);return a}function f(a,b){if(a){var c=a.split(b.separator),d=parseFloat(c[0]),e=parseFloat(c[1]);b.show24Hours||(d===12&&a.indexOf("AM")!==-1?d=0:d!==12&&a.indexOf("PM")!==-1&&(d+=12));var f=new Date(0,0,0,d,e,0);return g(f)}return null}function e(a,b){return typeof a=="object"?g(a):f(a,b)}function d(a){return(a<10?"0":"")+a}function c(a,b){var c=a.getHours(),e=b.show24Hours?c:(c+11)%12+1,f=a.getMinutes();return d(e)+b.separator+d(f)+(b.show24Hours?"":c<12?" AM":" PM")}function b(b,c,d,e){b.value=a(c).text(),a(b).change(),a.browser.msie||b.focus(),d.hide()}a.fn.timePicker=function(b){var c=a.extend({},a.fn.timePicker.defaults,b);return this.each(function(){a.timePicker(this,c)})},a.timePicker=function(b,c){var d=a(b)[0];return d.timePicker||(d.timePicker=new jQuery._timePicker(d,c))},a.timePicker.version="0.3",a._timePicker=function(d,h){var i=!1,j=!1,k=e(h.startTime,h),l=e(h.endTime,h),m="selected",n="li."+m;a(d).attr("autocomplete","OFF");var o=[],p=new Date(k);while(p<=l)o[o.length]=c(p,h),p=new Date(p.setMinutes(p.getMinutes()+h.step));var q=a('<div class="time-picker'+(h.show24Hours?"":" time-picker-12hours")+'"></div>'),r=a("<ul></ul>");for(var s=0;s<o.length;s++)r.append("<li>"+o[s]+"</li>");q.append(r),q.appendTo("body").hide(),q.mouseover(function(){i=!0}).mouseout(function(){i=!1}),a("li",r).mouseover(function(){j||(a(n,q).removeClass(m),a(this).addClass(m))}).mousedown(function(){i=!0}).click(function(){b(d,this,q,h),i=!1});var t=function(){if(q.is(":visible"))return!1;a("li",q).removeClass(m);var b=a(d).offset();q.css({top:b.top+d.offsetHeight,left:b.left}),q.show();var e=d.value?f(d.value,h):k,i=k.getHours()*60+k.getMinutes(),j=e.getHours()*60+e.getMinutes()-i,n=Math.round(j/h.step),o=g(new Date(0,0,0,0,n*h.step+i,0));o=k<o&&o<=l?o:k;var p=a("li:contains("+c(o,h)+")",q);p.length&&(p.addClass(m),q[0].scrollTop=p[0].offsetTop);return!0};a(d).focus(t).click(t),a(d).blur(function(){i||q.hide()});var u=a.browser.opera||a.browser.mozilla?"keypress":"keydown";a(d)[u](function(c){var e;j=!0;var f=q[0].scrollTop;switch(c.keyCode){case 38:if(t())return!1;e=a(n,r);var g=e.prev().addClass(m)[0];g?(e.removeClass(m),g.offsetTop<f&&(q[0].scrollTop=f-g.offsetHeight)):(e.removeClass(m),g=a("li:last",r).addClass(m)[0],q[0].scrollTop=g.offsetTop-g.offsetHeight);return!1;case 40:if(t())return!1;e=a(n,r);var i=e.next().addClass(m)[0];i?(e.removeClass(m),i.offsetTop+i.offsetHeight>f+q[0].offsetHeight&&(q[0].scrollTop=f+i.offsetHeight)):(e.removeClass(m),i=a("li:first",r).addClass(m)[0],q[0].scrollTop=0);return!1;case 13:if(q.is(":visible")){var k=a(n,r)[0];b(d,k,q,h)}return!1;case 27:q.hide();return!1}return!0}),a(d).keyup(function(a){j=!1}),this.getTime=function(){return f(d.value,h)},this.setTime=function(b){d.value=c(e(b,h),h),a(d).change()}},a.fn.timePicker.defaults={step:30,startTime:new Date(0,0,0,0,0,0),endTime:new Date(0,0,0,23,30,0),separator:":",show24Hours:!0}})(jQuery)
1
+ /**
2
+ * A time picker for jQuery.
3
+ *
4
+ * Dual licensed under the MIT and GPL licenses.
5
+ * Copyright (c) 2009 Anders Fajerson
6
+ *
7
+ * @name timePicker
8
+ * @author Anders Fajerson (http://perifer.se)
9
+ * @see http://github.com/perifer/timePicker
10
+ * @example $("#mytime").timePicker();
11
+ * @example $("#mytime").timePicker({step:30, startTime:"15:00", endTime:"18:00"});
12
+ */
13
  (function(a){function g(a){a.setFullYear(2001),a.setMonth(0),a.setDate(0);return a}function f(a,b){if(a){var c=a.split(b.separator),d=parseFloat(c[0]),e=parseFloat(c[1]);b.show24Hours||(d===12&&a.indexOf("AM")!==-1?d=0:d!==12&&a.indexOf("PM")!==-1&&(d+=12));var f=new Date(0,0,0,d,e,0);return g(f)}return null}function e(a,b){return typeof a=="object"?g(a):f(a,b)}function d(a){return(a<10?"0":"")+a}function c(a,b){var c=a.getHours(),e=b.show24Hours?c:(c+11)%12+1,f=a.getMinutes();return d(e)+b.separator+d(f)+(b.show24Hours?"":c<12?" AM":" PM")}function b(b,c,d,e){b.value=a(c).text(),a(b).change(),a.browser.msie||b.focus(),d.hide()}a.fn.timePicker=function(b){var c=a.extend({},a.fn.timePicker.defaults,b);return this.each(function(){a.timePicker(this,c)})},a.timePicker=function(b,c){var d=a(b)[0];return d.timePicker||(d.timePicker=new jQuery._timePicker(d,c))},a.timePicker.version="0.3",a._timePicker=function(d,h){var i=!1,j=!1,k=e(h.startTime,h),l=e(h.endTime,h),m="selected",n="li."+m;a(d).attr("autocomplete","OFF");var o=[],p=new Date(k);while(p<=l)o[o.length]=c(p,h),p=new Date(p.setMinutes(p.getMinutes()+h.step));var q=a('<div class="time-picker'+(h.show24Hours?"":" time-picker-12hours")+'"></div>'),r=a("<ul></ul>");for(var s=0;s<o.length;s++)r.append("<li>"+o[s]+"</li>");q.append(r),q.appendTo("body").hide(),q.mouseover(function(){i=!0}).mouseout(function(){i=!1}),a("li",r).mouseover(function(){j||(a(n,q).removeClass(m),a(this).addClass(m))}).mousedown(function(){i=!0}).click(function(){b(d,this,q,h),i=!1});var t=function(){if(q.is(":visible"))return!1;a("li",q).removeClass(m);var b=a(d).offset();q.css({top:b.top+d.offsetHeight,left:b.left}),q.show();var e=d.value?f(d.value,h):k,i=k.getHours()*60+k.getMinutes(),j=e.getHours()*60+e.getMinutes()-i,n=Math.round(j/h.step),o=g(new Date(0,0,0,0,n*h.step+i,0));o=k<o&&o<=l?o:k;var p=a("li:contains("+c(o,h)+")",q);p.length&&(p.addClass(m),q[0].scrollTop=p[0].offsetTop);return!0};a(d).focus(t).click(t),a(d).blur(function(){i||q.hide()});var u=a.browser.opera||a.browser.mozilla?"keypress":"keydown";a(d)[u](function(c){var e;j=!0;var f=q[0].scrollTop;switch(c.keyCode){case 38:if(t())return!1;e=a(n,r);var g=e.prev().addClass(m)[0];g?(e.removeClass(m),g.offsetTop<f&&(q[0].scrollTop=f-g.offsetHeight)):(e.removeClass(m),g=a("li:last",r).addClass(m)[0],q[0].scrollTop=g.offsetTop-g.offsetHeight);return!1;case 40:if(t())return!1;e=a(n,r);var i=e.next().addClass(m)[0];i?(e.removeClass(m),i.offsetTop+i.offsetHeight>f+q[0].offsetHeight&&(q[0].scrollTop=f+i.offsetHeight)):(e.removeClass(m),i=a("li:first",r).addClass(m)[0],q[0].scrollTop=0);return!1;case 13:if(q.is(":visible")){var k=a(n,r)[0];b(d,k,q,h)}return!1;case 27:q.hide();return!1}return!0}),a(d).keyup(function(a){j=!1}),this.getTime=function(){return f(d.value,h)},this.setTime=function(b){d.value=c(e(b,h),h),a(d).change()}},a.fn.timePicker.defaults={step:30,startTime:new Date(0,0,0,0,0,0),endTime:new Date(0,0,0,23,30,0),separator:":",show24Hours:!0}})(jQuery)
js/media.js CHANGED
@@ -1,30 +1,30 @@
1
- jQuery(document).ready(function($){
2
- if(pagenow != 'attachment')
3
- {
4
- var _custom_media = true,
5
- _orig_send_attachment = wp.media.editor.send.attachment;
6
- $('.bsf_upload_button').click(function(e) {
7
- var send_attachment_bkp = wp.media.editor.send.attachment;
8
- var button = $(this);
9
- var id = 'bsf_upload_file'; //button.attr('id').replace('_button', '');
10
- _custom_media = true;
11
- wp.media.editor.send.attachment = function(props, attachment){
12
- if ( _custom_media ) {
13
- $("."+id).val(attachment.url);
14
- $(".bsf_media_status").html('<img src="'+ attachment.url +'" />');
15
- } else {
16
- return _orig_send_attachment.apply( this, [props, attachment] );
17
- };
18
- }
19
- wp.media.editor.open(button);
20
- return false;
21
- });
22
- $('.add_media').on('click', function(){
23
- _custom_media = false;
24
- });
25
- }
26
- else
27
- {
28
- $("#review_metabox").hide();
29
- }
30
  });
1
+ jQuery(document).ready(function($){
2
+ if(pagenow != 'attachment')
3
+ {
4
+ var _custom_media = true,
5
+ _orig_send_attachment = wp.media.editor.send.attachment;
6
+ $('.bsf_upload_button').click(function(e) {
7
+ var send_attachment_bkp = wp.media.editor.send.attachment;
8
+ var button = $(this);
9
+ var id = 'bsf_upload_file'; //button.attr('id').replace('_button', '');
10
+ _custom_media = true;
11
+ wp.media.editor.send.attachment = function(props, attachment){
12
+ if ( _custom_media ) {
13
+ $("."+id).val(attachment.url);
14
+ $(".bsf_media_status").html('<img src="'+ attachment.url +'" />');
15
+ } else {
16
+ return _orig_send_attachment.apply( this, [props, attachment] );
17
+ };
18
+ }
19
+ wp.media.editor.open(button);
20
+ return false;
21
+ });
22
+ $('.add_media').on('click', function(){
23
+ _custom_media = false;
24
+ });
25
+ }
26
+ else
27
+ {
28
+ $("#review_metabox").hide();
29
+ }
30
  });
js/retina.js CHANGED
@@ -1,3 +1,2 @@
1
- // retina.js, a high-resolution image swapper (http://retinajs.com), v0.0.2
2
-
3
  (function(){function t(e){this.path=e;var t=this.path.split("."),n=t.slice(0,t.length-1).join("."),r=t[t.length-1];this.at_2x_path=n+"@2x."+r}function n(e){this.el=e,this.path=new t(this.el.getAttribute("src"));var n=this;this.path.check_2x_variant(function(e){e&&n.swap()})}var e=typeof exports=="undefined"?window:exports;e.RetinaImagePath=t,t.confirmed_paths=[],t.prototype.is_external=function(){return!!this.path.match(/^https?\:/i)&&!this.path.match("//"+document.domain)},t.prototype.check_2x_variant=function(e){var n,r=this;if(this.is_external())return e(!1);if(this.at_2x_path in t.confirmed_paths)return e(!0);n=new XMLHttpRequest,n.open("HEAD",this.at_2x_path),n.onreadystatechange=function(){return n.readyState!=4?e(!1):n.status>=200&&n.status<=399?(t.confirmed_paths.push(r.at_2x_path),e(!0)):e(!1)},n.send()},e.RetinaImage=n,n.prototype.swap=function(e){function n(){t.el.complete?(t.el.setAttribute("width",t.el.offsetWidth),t.el.setAttribute("height",t.el.offsetHeight),t.el.setAttribute("src",e)):setTimeout(n,5)}typeof e=="undefined"&&(e=this.path.at_2x_path);var t=this;n()},e.devicePixelRatio>1&&(window.onload=function(){var e=document.getElementsByTagName("img"),t=[],r,i;for(r=0;r<e.length;r++)i=e[r],t.push(new n(i))})})();
1
+ // retina.js, a high-resolution image swapper (http://retinajs.com), v0.0.2
 
2
  (function(){function t(e){this.path=e;var t=this.path.split("."),n=t.slice(0,t.length-1).join("."),r=t[t.length-1];this.at_2x_path=n+"@2x."+r}function n(e){this.el=e,this.path=new t(this.el.getAttribute("src"));var n=this;this.path.check_2x_variant(function(e){e&&n.swap()})}var e=typeof exports=="undefined"?window:exports;e.RetinaImagePath=t,t.confirmed_paths=[],t.prototype.is_external=function(){return!!this.path.match(/^https?\:/i)&&!this.path.match("//"+document.domain)},t.prototype.check_2x_variant=function(e){var n,r=this;if(this.is_external())return e(!1);if(this.at_2x_path in t.confirmed_paths)return e(!0);n=new XMLHttpRequest,n.open("HEAD",this.at_2x_path),n.onreadystatechange=function(){return n.readyState!=4?e(!1):n.status>=200&&n.status<=399?(t.confirmed_paths.push(r.at_2x_path),e(!0)):e(!1)},n.send()},e.RetinaImage=n,n.prototype.swap=function(e){function n(){t.el.complete?(t.el.setAttribute("width",t.el.offsetWidth),t.el.setAttribute("height",t.el.offsetHeight),t.el.setAttribute("src",e)):setTimeout(n,5)}typeof e=="undefined"&&(e=this.path.at_2x_path);var t=this;n()},e.devicePixelRatio>1&&(window.onload=function(){var e=document.getElementsByTagName("img"),t=[],r,i;for(r=0;r<e.length;r++)i=e[r],t.push(new n(i))})})();
js/toggle.js CHANGED
@@ -1,108 +1,108 @@
1
- jQuery(document).ready(function() {
2
- var selected = jQuery("#_bsf_post_type").val();
3
- if(selected == "0")
4
- hidden();
5
- else
6
- expand_default(selected);
7
- //Function to hide all the snippet blocks
8
- function hidden() {
9
- jQuery(".review").hide();
10
- jQuery(".events").hide();
11
- jQuery(".music").hide();
12
- jQuery(".organization").hide();
13
- jQuery(".people").hide();
14
- jQuery(".product").hide();
15
- jQuery(".recipes").hide();
16
- jQuery(".software").hide();
17
- jQuery(".video").hide();
18
- jQuery(".article").hide();
19
- }
20
- //Function to expand the updated snippet block
21
- function expand_default(selected) {
22
- hidden();
23
- if(selected == '1')
24
- {
25
- jQuery(".review").show(500);
26
- }
27
- else if(selected == '2')
28
- {
29
- jQuery(".events").show(500);
30
- }
31
- else if(selected == '3')
32
- {
33
- jQuery(".music").show(500);
34
- }
35
- else if(selected == '4')
36
- {
37
- jQuery(".organization").show(500);
38
- }
39
- else if(selected == '5')
40
- {
41
- jQuery(".people").show(500);
42
- }
43
- else if(selected == '6')
44
- {
45
- jQuery(".product").show(500);
46
- }
47
- else if(selected == '7')
48
- {
49
- jQuery(".recipes").show(500);
50
- }
51
- else if(selected == '8')
52
- {
53
- jQuery(".software").show(500);
54
- }
55
- else if(selected == '9')
56
- {
57
- jQuery(".video").show(500);
58
- }
59
- else if(selected == '10')
60
- {
61
- jQuery(".article").show(500);
62
- }
63
- }
64
- jQuery("#_bsf_post_type").change(function() {
65
- hidden();
66
- var type=jQuery(this).val();
67
- if(type == '1')
68
- {
69
- jQuery(".review").show(500);
70
- }
71
- else if(type == '2')
72
- {
73
- jQuery(".events").show(500);
74
- }
75
- else if(type == '3')
76
- {
77
- jQuery(".music").show(500);
78
- }
79
- else if(type == '4')
80
- {
81
- jQuery(".organization").show(500);
82
- }
83
- else if(type == '5')
84
- {
85
- jQuery(".people").show(500);
86
- }
87
- else if(type == '6')
88
- {
89
- jQuery(".product").show(500);
90
- }
91
- else if(type == '7')
92
- {
93
- jQuery(".recipes").show(500);
94
- }
95
- else if(type == '8')
96
- {
97
- jQuery(".software").show(500);
98
- }
99
- else if(type == '9')
100
- {
101
- jQuery(".video").show(500);
102
- }
103
- else if(type == '10')
104
- {
105
- jQuery(".article").show(500);
106
- }
107
- });
108
  });
1
+ jQuery(document).ready(function() {
2
+ var selected = jQuery("#_bsf_post_type").val();
3
+ if(selected == "0")
4
+ hidden();
5
+ else
6
+ expand_default(selected);
7
+ //Function to hide all the snippet blocks
8
+ function hidden() {
9
+ jQuery(".review").hide();
10
+ jQuery(".events").hide();
11
+ jQuery(".music").hide();
12
+ jQuery(".organization").hide();
13
+ jQuery(".people").hide();
14
+ jQuery(".product").hide();
15
+ jQuery(".recipes").hide();
16
+ jQuery(".software").hide();
17
+ jQuery(".video").hide();
18
+ jQuery(".article").hide();
19
+ }
20
+ //Function to expand the updated snippet block
21
+ function expand_default(selected) {
22
+ hidden();
23
+ if(selected == '1')
24
+ {
25
+ jQuery(".review").show(500);
26
+ }
27
+ else if(selected == '2')
28
+ {
29
+ jQuery(".events").show(500);
30
+ }
31
+ else if(selected == '3')
32
+ {
33
+ jQuery(".music").show(500);
34
+ }
35
+ else if(selected == '4')
36
+ {
37
+ jQuery(".organization").show(500);
38
+ }
39
+ else if(selected == '5')
40
+ {
41
+ jQuery(".people").show(500);
42
+ }
43
+ else if(selected == '6')
44
+ {
45
+ jQuery(".product").show(500);
46
+ }
47
+ else if(selected == '7')
48
+ {
49
+ jQuery(".recipes").show(500);
50
+ }
51
+ else if(selected == '8')
52
+ {
53
+ jQuery(".software").show(500);
54
+ }
55
+ else if(selected == '9')
56
+ {
57
+ jQuery(".video").show(500);
58
+ }
59
+ else if(selected == '10')
60
+ {
61
+ jQuery(".article").show(500);
62
+ }
63
+ }
64
+ jQuery("#_bsf_post_type").change(function() {
65
+ hidden();
66
+ var type=jQuery(this).val();
67
+ if(type == '1')
68
+ {
69
+ jQuery(".review").show(500);
70
+ }
71
+ else if(type == '2')
72
+ {
73
+ jQuery(".events").show(500);
74
+ }
75
+ else if(type == '3')
76
+ {
77
+ jQuery(".music").show(500);
78
+ }
79
+ else if(type == '4')
80
+ {
81
+ jQuery(".organization").show(500);
82
+ }
83
+ else if(type == '5')
84
+ {
85
+ jQuery(".people").show(500);
86
+ }
87
+ else if(type == '6')
88
+ {
89
+ jQuery(".product").show(500);
90
+ }
91
+ else if(type == '7')
92
+ {
93
+ jQuery(".recipes").show(500);
94
+ }
95
+ else if(type == '8')
96
+ {
97
+ jQuery(".software").show(500);
98
+ }
99
+ else if(type == '9')
100
+ {
101
+ jQuery(".video").show(500);
102
+ }
103
+ else if(type == '10')
104
+ {
105
+ jQuery(".article").show(500);
106
+ }
107
+ });
108
  });
readme.txt CHANGED
@@ -1,36 +1,33 @@
1
  === All In One Schema.org Rich Snippets ===
2
-
3
  Contributors: yawalkarm, brainstormforce
4
  Donate link: http://www.brainstormforce.com
5
  Tags: Review, Event, People, Product, Recipe, Software Application, Video, Article, rdfa, rich snippet, schema.org, schema, microdata, microformat, SERP, Google, Yahoo, Bing
6
  Requires at least: 3.5
7
  Tested up to: 3.8.1
8
- Stable tag: 1.1.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
-
12
  Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
13
 
14
  == Description ==
15
 
16
  = What is a Rich Snippet? =
17
-
18
  It is basically a short summary of your page in the search results of Google, Yahoo, Bing and sometimes in the News feed of Facebook in nice format with star ratings, author photo, image, etc.
19
-
20
  [See Examples of Rich Snippets Here.](http://www.seomoz.org/blog/schema-examples/ "Rich Snippets Examples")
21
 
22
  = How does a Rich Snippet help? =
23
-
24
  - It gives search engines only the important & precise information to display in search result snippets.
25
  - Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
26
  - [See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
27
  - Helps you rank higher in search results
28
  - Helps Facebook display proper information when users share your links on Facebook
29
 
30
- = Supported Content Types - =
 
 
31
 
 
32
  This plugin supports the following types of Schemas:
33
-
34
  * Review
35
  * Event
36
  * People
@@ -41,82 +38,58 @@ This plugin supports the following types of Schemas:
41
  * Articles
42
 
43
  = Future release would include - =
44
-
45
  * Breadcrumbs
46
  * Local Business
47
  * Books
48
 
49
  = Want to contribute to the plugin? =
50
-
51
  You may now contribute to the plugin on Github: [All in one Schema.org Rich Snippets on Github](https://github.com/brainstormforce/All-In-One-Schema.org-Rich-Snippets "Contribute on Github")
52
 
53
  == Installation ==
54
-
55
  = Through Dashboard =
56
-
57
  1. Go to Plugins -> Add New -> Search for "All in One Schema.org Rich Snippets" Or Upload the plugins zip file
58
 
59
  = Through FTP =
60
-
61
  1. Upload the plugin into `wp-content/plugins` directory
62
-
63
  2. Activate the plugin through the 'Plugins' menu in WordPress
64
-
65
  3. That's It.
66
-
67
  Now go and create a new post. There you will find a meta box, select the type of post from dropdown and fill out the details, publish the post.
68
  Google will start showing rich snippets in the search results, as soon as your post is crawled.
69
-
70
  You can test the rich snippet on Google Webmasters Rich Snippets Testing Tool
71
 
72
  == Release Notes ==
73
-
74
- What's new in this version 1.1.1
75
-
76
  From the very beginning - one of the major thing we are known for is our designs. It always has been one of our major focus. In fact you can say design is our DNA. However, in previous versions on AIOSRS, we felt it was missing somehow.
77
-
78
  We have received requests for article rich snippets from a huge no. of our users. So, we have added the Article type in this new update.
79
-
80
  Also, we observed most of the people did not want the MicroData box visible to users but only to search engines and requested the feature. However as this is against Google's guidelines, we gave a though to an alternative. Rather than people using the plugin only for 'displaying rich snippets in search results' and 'comporting on front end design' - why not design the plugin in a way that people would want the plugin for displaying a beautiful post summary and rich snippets would come with that? Wouldn't that be awesome?
81
-
82
  So with this update, we stared trying the same thing; and with of course with feedbacks from our beloved users, we look forward making it even better.
83
-
84
  In brief, new things in updated version -
85
-
86
  * Redesigned Front End
87
  * Fully Responsive
88
  * Retina Ready
89
  * Options Panel to make settings and control front end display
90
  * Options Panel to make settings and control strings (Flexibility for admin & also helpful for sites in other languages)
91
  * Setting to make images look better
92
-
93
-
94
  Some of the other non design things -
95
-
96
  * Better reviews and ratings functionality
97
  * 100% MicroData. Rolled out RDFa completely
98
  * and many other small but important things
99
-
100
  Thanks [Nitin](http://profiles.wordpress.org/yawalkarm/ "Nitin Yawalkar") & Pratik for your major contributions
101
-
102
  ******************** ******************** ********************
103
-
104
  Next scheduled version will include -
105
-
106
  - Even simpler, shorter, typographic and more beautiful design of MicroData box. May be like this https://moqups.com/brainstormforce/5P0EaLtt
107
  - Redesigned admin panel
108
  - Refined MicroData input options
109
  - Support for more post types (Local Business, etc)
110
-
111
  Cheers & Regards,
112
  Sujay
113
 
114
  == Frequently Asked Questions ==
 
115
  = What is a Rich Snippet? =
116
  It is basically a short summary of your page in the search results of Google, Yahoo, Bing and sometimes in the News feed of Facebook in nice format with star ratings, author photo, image, etc.
117
 
118
  = How does a Rich Snippet help? =
119
-
120
  - It gives search engines only the important & precise information to display in search result snippets.
121
  - Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
122
  - [See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
@@ -126,7 +99,6 @@ It is basically a short summary of your page in the search results of Google, Ya
126
  = Which Content Types are Supported? =
127
 
128
  This plugin currently supports almost all of the content types that are released by Schema.org at one place.
129
-
130
  Review, Event, People, Product, Recipe, Software Application, Video, Articles etc.
131
 
132
  == Screenshots ==
@@ -138,70 +110,64 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et
138
 
139
  == Changelog ==
140
 
 
 
 
 
 
141
  = 1.1.6 =
142
  * Improvement: Compatibility with WordPres 3.8
143
  * Fixed: Admin CSS breaking tabs in WP 3.8
144
  * Added - reference post url field in "contact developers" form on settings page
145
 
146
  = 1.1.5 =
147
-
148
  * Improvement: Replaced rating 'count' with 'votes' on products - as directed by Google
149
  * Fixed: Article snippet not displaying accurate when snippet title is blank
150
  * Fixed: Recipe string 'Published on' can be changed.
151
 
152
  = 1.1.4 =
153
-
154
  * Fixed: Illegal string offset `user_rating` Warning
155
 
156
  = 1.1.3 =
157
-
158
  * Improvement : Network Activation
159
 
160
  = 1.1.2 =
161
-
162
  * Fixed: Edit media functionality.
163
 
164
  = 1.1.1 =
165
-
166
  * Added: Article type
167
  * Added: Compatibility with WooThemes Plugins and themes
168
  * Added: New Media Manager for uploading images in metabox
169
 
170
  = 1.1.0 =
171
-
172
  * Added: Admin options
173
  * Fixed: Ratings on recipe, products and software application
174
  * Improvement: Admin options for customizing everything
175
  * Improvement: New snippet box design with responsive layout
176
 
177
  = 1.0.4 =
178
-
179
  * Fixed: Rating on Comments
180
  * Fixed: On deleting any deactivated plugin
181
  * Fixed: Error message comming on commenting
182
  * Fixed: On post save draft
183
 
184
  = 1.0.3 =
185
-
186
  * Clean up the code
187
  * Fixed: Plugin activation error
188
  * Fixed: Error on editing theme and plugin files.
189
  * Removed : Breadcrumbs
190
 
191
  = 1.0.2 =
192
-
193
  * Added: RDFa Breadcrumbs Plugin is now a part of All in One Schema.org Rich Snippets !
194
  * Added: Star rating and review for recipe
195
  * Fized: Recipe type
196
  * Fixed: Post update error
197
 
198
  = 1.0.1 =
199
-
200
  * Minor Bugs Fixes
201
 
202
  = 1.0 =
203
  * Initial Release.
204
 
205
  == Upgrade Notice ==
206
-
207
- Note: A normal bug fix. Please update to use the bug free plugin .
1
  === All In One Schema.org Rich Snippets ===
 
2
  Contributors: yawalkarm, brainstormforce
3
  Donate link: http://www.brainstormforce.com
4
  Tags: Review, Event, People, Product, Recipe, Software Application, Video, Article, rdfa, rich snippet, schema.org, schema, microdata, microformat, SERP, Google, Yahoo, Bing
5
  Requires at least: 3.5
6
  Tested up to: 3.8.1
7
+ Stable tag: 1.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
10
  Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
11
 
12
  == Description ==
13
 
14
  = What is a Rich Snippet? =
 
15
  It is basically a short summary of your page in the search results of Google, Yahoo, Bing and sometimes in the News feed of Facebook in nice format with star ratings, author photo, image, etc.
 
16
  [See Examples of Rich Snippets Here.](http://www.seomoz.org/blog/schema-examples/ "Rich Snippets Examples")
17
 
18
  = How does a Rich Snippet help? =
 
19
  - It gives search engines only the important & precise information to display in search result snippets.
20
  - Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
21
  - [See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
22
  - Helps you rank higher in search results
23
  - Helps Facebook display proper information when users share your links on Facebook
24
 
25
+ > **Curious, how does this plugin work?**
26
+ >
27
+ > [Take a quick test drive!](http://www.sharkslab.com/testdrive/)
28
 
29
+ = Supported Content Types - =
30
  This plugin supports the following types of Schemas:
 
31
  * Review
32
  * Event
33
  * People
38
  * Articles
39
 
40
  = Future release would include - =
 
41
  * Breadcrumbs
42
  * Local Business
43
  * Books
44
 
45
  = Want to contribute to the plugin? =
 
46
  You may now contribute to the plugin on Github: [All in one Schema.org Rich Snippets on Github](https://github.com/brainstormforce/All-In-One-Schema.org-Rich-Snippets "Contribute on Github")
47
 
48
  == Installation ==
 
49
  = Through Dashboard =
 
50
  1. Go to Plugins -> Add New -> Search for "All in One Schema.org Rich Snippets" Or Upload the plugins zip file
51
 
52
  = Through FTP =
 
53
  1. Upload the plugin into `wp-content/plugins` directory
 
54
  2. Activate the plugin through the 'Plugins' menu in WordPress
 
55
  3. That's It.
 
56
  Now go and create a new post. There you will find a meta box, select the type of post from dropdown and fill out the details, publish the post.
57
  Google will start showing rich snippets in the search results, as soon as your post is crawled.
 
58
  You can test the rich snippet on Google Webmasters Rich Snippets Testing Tool
59
 
60
  == Release Notes ==
61
+ What's new in this version 1.1.7
 
 
62
  From the very beginning - one of the major thing we are known for is our designs. It always has been one of our major focus. In fact you can say design is our DNA. However, in previous versions on AIOSRS, we felt it was missing somehow.
 
63
  We have received requests for article rich snippets from a huge no. of our users. So, we have added the Article type in this new update.
 
64
  Also, we observed most of the people did not want the MicroData box visible to users but only to search engines and requested the feature. However as this is against Google's guidelines, we gave a though to an alternative. Rather than people using the plugin only for 'displaying rich snippets in search results' and 'comporting on front end design' - why not design the plugin in a way that people would want the plugin for displaying a beautiful post summary and rich snippets would come with that? Wouldn't that be awesome?
 
65
  So with this update, we stared trying the same thing; and with of course with feedbacks from our beloved users, we look forward making it even better.
 
66
  In brief, new things in updated version -
 
67
  * Redesigned Front End
68
  * Fully Responsive
69
  * Retina Ready
70
  * Options Panel to make settings and control front end display
71
  * Options Panel to make settings and control strings (Flexibility for admin & also helpful for sites in other languages)
72
  * Setting to make images look better
 
 
73
  Some of the other non design things -
 
74
  * Better reviews and ratings functionality
75
  * 100% MicroData. Rolled out RDFa completely
76
  * and many other small but important things
 
77
  Thanks [Nitin](http://profiles.wordpress.org/yawalkarm/ "Nitin Yawalkar") & Pratik for your major contributions
 
78
  ******************** ******************** ********************
 
79
  Next scheduled version will include -
 
80
  - Even simpler, shorter, typographic and more beautiful design of MicroData box. May be like this https://moqups.com/brainstormforce/5P0EaLtt
81
  - Redesigned admin panel
82
  - Refined MicroData input options
83
  - Support for more post types (Local Business, etc)
 
84
  Cheers & Regards,
85
  Sujay
86
 
87
  == Frequently Asked Questions ==
88
+
89
  = What is a Rich Snippet? =
90
  It is basically a short summary of your page in the search results of Google, Yahoo, Bing and sometimes in the News feed of Facebook in nice format with star ratings, author photo, image, etc.
91
 
92
  = How does a Rich Snippet help? =
 
93
  - It gives search engines only the important & precise information to display in search result snippets.
94
  - Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
95
  - [See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
99
  = Which Content Types are Supported? =
100
 
101
  This plugin currently supports almost all of the content types that are released by Schema.org at one place.
 
102
  Review, Event, People, Product, Recipe, Software Application, Video, Articles etc.
103
 
104
  == Screenshots ==
110
 
111
  == Changelog ==
112
 
113
+ = 1.1.7 =
114
+ * Improvement: Added "Test Rich Snippets" menu in admin bar for testing rich snippets in Google Webmasters Tools
115
+ * Fixed: retina.js issue resolved
116
+ * Removed unnecessary code
117
+
118
  = 1.1.6 =
119
  * Improvement: Compatibility with WordPres 3.8
120
  * Fixed: Admin CSS breaking tabs in WP 3.8
121
  * Added - reference post url field in "contact developers" form on settings page
122
 
123
  = 1.1.5 =
 
124
  * Improvement: Replaced rating 'count' with 'votes' on products - as directed by Google
125
  * Fixed: Article snippet not displaying accurate when snippet title is blank
126
  * Fixed: Recipe string 'Published on' can be changed.
127
 
128
  = 1.1.4 =
 
129
  * Fixed: Illegal string offset `user_rating` Warning
130
 
131
  = 1.1.3 =
 
132
  * Improvement : Network Activation
133
 
134
  = 1.1.2 =
 
135
  * Fixed: Edit media functionality.
136
 
137
  = 1.1.1 =
 
138
  * Added: Article type
139
  * Added: Compatibility with WooThemes Plugins and themes
140
  * Added: New Media Manager for uploading images in metabox
141
 
142
  = 1.1.0 =
 
143
  * Added: Admin options
144
  * Fixed: Ratings on recipe, products and software application
145
  * Improvement: Admin options for customizing everything
146
  * Improvement: New snippet box design with responsive layout
147
 
148
  = 1.0.4 =
 
149
  * Fixed: Rating on Comments
150
  * Fixed: On deleting any deactivated plugin
151
  * Fixed: Error message comming on commenting
152
  * Fixed: On post save draft
153
 
154
  = 1.0.3 =
 
155
  * Clean up the code
156
  * Fixed: Plugin activation error
157
  * Fixed: Error on editing theme and plugin files.
158
  * Removed : Breadcrumbs
159
 
160
  = 1.0.2 =
 
161
  * Added: RDFa Breadcrumbs Plugin is now a part of All in One Schema.org Rich Snippets !
162
  * Added: Star rating and review for recipe
163
  * Fized: Recipe type
164
  * Fixed: Post update error
165
 
166
  = 1.0.1 =
 
167
  * Minor Bugs Fixes
168
 
169
  = 1.0 =
170
  * Initial Release.
171
 
172
  == Upgrade Notice ==
173
+ Note: New features introduced! Update plugin to enjoy them.