/*!
 * jQuery UI Core 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/category/ui-core/
 */
!function(e,t){function i(t,i){var s,o,r,a=t.nodeName.toLowerCase();return"area"===a?(s=t.parentNode,o=s.name,t.href&&o&&"map"===s.nodeName.toLowerCase()?(r=e("img[usemap=#"+o+"]")[0],!!r&&n(r)):!1):(/input|select|textarea|button|object/.test(a)?!t.disabled:"a"===a?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,o=/^ui-id-\d+$/;e.ui=e.ui||{},e.ui.version||(e.extend(e.ui,{version:"1.10.0",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:e.fn.focus,focus:function(t,i){return"number"==typeof t?this.each(function(){var n=this;setTimeout(function(){e(n).focus(),i&&i.call(n)},t)}):this._focus.apply(this,arguments)},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 n,s,o=e(this[0]);o.length&&o[0]!==document;){if(n=o.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(o.css("zIndex"),10),!isNaN(s)&&0!==s))return s;o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){o.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,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(o,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var o="Width"===n?["Left","Right"]:["Top","Bottom"],r=n.toLowerCase(),a={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?a["inner"+n].call(this):this.each(function(){e(this).css(r,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?a["outer"+n].call(this,t):this.each(function(){e(this).css(r,s(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,n){var s,o=e.ui[t].prototype;for(s in n)o.plugins[s]=o.plugins[s]||[],o.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;n<s.length;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}}))}(jQuery),/*!
 * jQuery UI Widget 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/jQuery.widget/
 */
function(e,t){var i=0,n=Array.prototype.slice,s=e.cleanData;e.cleanData=function(t){for(var i,n=0;null!=(i=t[n]);n++)try{e(i).triggerHandler("remove")}catch(o){}s(t)},e.widget=function(t,i,n){var s,o,r,a,l={},u=t.split(".")[0];t=t.split(".")[1],s=u+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][s.toLowerCase()]=function(t){return!!e.data(t,s)},e[u]=e[u]||{},o=e[u][t],r=e[u][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new r(e,t)},e.extend(r,o,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),a=new i,a.options=e.widget.extend({},a.options),e.each(n,function(t,n){return e.isFunction(n)?(l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},s=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,o=this._superApply;return this._super=e,this._superApply=s,t=n.apply(this,arguments),this._super=i,this._superApply=o,t}}(),void 0):(l[t]=n,void 0)}),r.prototype=e.widget.extend(a,{widgetEventPrefix:o?a.widgetEventPrefix:t},l,{constructor:r,namespace:u,widgetName:t,widgetFullName:s}),o?(e.each(o._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,r,i._proto)}),delete o._childConstructors):i._childConstructors.push(r),e.widget.bridge(t,r)},e.widget.extend=function(i){for(var s,o,r=n.call(arguments,1),a=0,l=r.length;l>a;a++)for(s in r[a])o=r[a][s],r[a].hasOwnProperty(s)&&o!==t&&(i[s]=e.isPlainObject(o)?e.isPlainObject(i[s])?e.widget.extend({},i[s],o):e.widget.extend({},o):o);return i},e.widget.bridge=function(i,s){var o=s.prototype.widgetFullName||i;e.fn[i]=function(r){var a="string"==typeof r,l=n.call(arguments,1),u=this;return r=!a&&l.length?e.widget.extend.apply(null,[r].concat(l)):r,a?this.each(function(){var n,s=e.data(this,o);return s?e.isFunction(s[r])&&"_"!==r.charAt(0)?(n=s[r].apply(s,l),n!==s&&n!==t?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0):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,o);t?t.option(r||{})._init():e.data(this,o,new s(r,this))}),u}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),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(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),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,n){var s,o,r,a=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(a={},s=i.split("."),i=s.shift(),s.length){for(o=a[i]=e.widget.extend({},this.options[i]),r=0;r<s.length-1;r++)o[s[r]]=o[s[r]]||{},o=o[s[r]];if(i=s.pop(),n===t)return o[i]===t?null:o[i];o[i]=n}else{if(n===t)return this.options[i]===t?null:this.options[i];a[i]=n}return this._setOptions(a),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(t,i,n){var s,o=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=s=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,s=this.widget()),e.each(n,function(n,r){function a(){return t||o.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof r?o[r]:r).apply(o,arguments):void 0}"string"!=typeof r&&(a.guid=r.guid=r.guid||a.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+o.eventNamespace,c=l[2];c?s.delegate(c,u,a):i.bind(u,a)})},_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?n[e]:e).apply(n,arguments)}var n=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,n){var s,o,r=this.options[t];if(n=n||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(s in o)s in i||(i[s]=o[s]);return this.element.trigger(i,n),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(n))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,s,o){"string"==typeof s&&(s={effect:s});var r,a=s?s===!0||"number"==typeof s?i:s.effect||i:t;s=s||{},"number"==typeof s&&(s={duration:s}),r=!e.isEmptyObject(s),s.complete=o,s.delay&&n.delay(s.delay),r&&e.effects&&e.effects.effect[a]?n[t](s):a!==t&&n[a]?n[a](s.duration,s.easing,o):n.queue(function(i){e(this)[t](),o&&o.call(n[0]),i()})}})}(jQuery),/*!
 * jQuery UI Accordion 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/accordion/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
function(e){var t=0,i={},n={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",n.height=n.paddingTop=n.paddingBottom=n.borderTopWidth=n.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.0",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 t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;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(),e=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&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,n=this.headers.length,s=this.headers.index(t.target),o=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(s+1)%n];break;case i.LEFT:case i.UP:o=this.headers[(s-1+n)%n];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[n-1]}o&&(e(t.target).attr("tabIndex",-1),e(o).attr("tabIndex",0),o.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),(t.active===!1&&t.collapsible===!0||!this.headers.length)&&(t.active=!1,this.active=e()),t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.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,n=this.options,s=n.heightStyle,o=this.element.parent(),r=this.accordionId="ui-accordion-"+(this.element.attr("id")||++t);this.active=this._findActive(n.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var i=e(this),n=i.attr("id"),s=i.next(),o=s.attr("id");n||(n=r+"-header-"+t,i.attr("id",n)),o||(o=r+"-panel-"+t,s.attr("id",o)),i.attr("aria-controls",o),s.attr("aria-labelledby",n)}).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(n.event),"fill"===s?(i=o.height(),this.element.siblings(":visible").each(function(){var t=e(this),n=t.css("position");"absolute"!==n&&"fixed"!==n&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(i=0,this.headers.next().each(function(){i=Math.max(i,e(this).css("height","").height())}).height(i))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_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(t){var i=this.options,n=this.active,s=e(t.currentTarget),o=s[0]===n[0],r=o&&i.collapsible,a=r?e():s.next(),l=n.next(),u={oldHeader:n,oldPanel:l,newHeader:r?e():s,newPanel:a};t.preventDefault(),o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.headers.index(s),this.active=o?e():s,this._toggle(u),n.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),o||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,n=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=n,this.options.animate?this._animate(i,n,t):(n.hide(),i.show(),this._toggleComplete(t)),n.attr({"aria-expanded":"false","aria-hidden":"true"}),n.prev().attr("aria-selected","false"),i.length&&n.length?n.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,s){var o,r,a,l=this,u=0,c=e.length&&(!t.length||e.index()<t.index()),h=this.options.animate||{},d=c&&h.down||h,p=function(){l._toggleComplete(s)};return"number"==typeof d&&(a=d),"string"==typeof d&&(r=d),r=r||d.easing||h.easing,a=a||d.duration||h.duration,t.length?e.length?(o=e.show().outerHeight(),t.animate(i,{duration:a,easing:r,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(n,{duration:a,easing:r,complete:p,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?u+=i.now:"content"!==l.options.heightStyle&&(i.now=Math.round(o-t.outerHeight()-u),u=0)}}),void 0):t.animate(i,a,r,p):e.animate(n,a,r,p)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})}(jQuery),/*!
 * jQuery UI Position 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/position/
 */
function(e,t){function i(e,t,i){return[parseInt(e[0],10)*(p.test(e[0])?t/100:1),parseInt(e[1],10)*(p.test(e[1])?i/100:1)]}function n(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var o,r=Math.max,a=Math.abs,l=Math.round,u=/left|center|right/,c=/top|center|bottom/,h=/[\+\-]\d+%?/,d=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(o!==t)return o;var i,n,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=s.children()[0];return e("body").append(s),i=r.offsetWidth,s.css("overflow","scroll"),n=r.offsetWidth,i===n&&(n=s[0].clientWidth),s.remove(),o=i-n},getScrollInfo:function(t){var i=t.isWindow?"":t.element.css("overflow-x"),n=t.isWindow?"":t.element.css("overflow-y"),s="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,o="scroll"===n||"auto"===n&&t.height<t.element[0].scrollHeight;return{width:s?e.position.scrollbarWidth():0,height:o?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),n=e.isWindow(i[0]);return{element:i,isWindow:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:n?i.width():i.outerWidth(),height:n?i.height():i.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return f.apply(this,arguments);t=e.extend({},t);var o,p,m,g,v,y,b=e(t.of),_=e.position.getWithinInfo(t.within),w=e.position.getScrollInfo(_),x=(t.collision||"flip").split(" "),T={};return y=s(b),b[0].preventDefault&&(t.at="left top"),p=y.width,m=y.height,g=y.offset,v=e.extend({},g),e.each(["my","at"],function(){var e,i,n=(t[this]||"").split(" ");1===n.length&&(n=u.test(n[0])?n.concat(["center"]):c.test(n[0])?["center"].concat(n):["center","center"]),n[0]=u.test(n[0])?n[0]:"center",n[1]=c.test(n[1])?n[1]:"center",e=h.exec(n[0]),i=h.exec(n[1]),T[this]=[e?e[0]:0,i?i[0]:0],t[this]=[d.exec(n[0])[0],d.exec(n[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===t.at[0]?v.left+=p:"center"===t.at[0]&&(v.left+=p/2),"bottom"===t.at[1]?v.top+=m:"center"===t.at[1]&&(v.top+=m/2),o=i(T.at,p,m),v.left+=o[0],v.top+=o[1],this.each(function(){var s,u,c=e(this),h=c.outerWidth(),d=c.outerHeight(),f=n(this,"marginLeft"),y=n(this,"marginTop"),E=h+f+n(this,"marginRight")+w.width,k=d+y+n(this,"marginBottom")+w.height,C=e.extend({},v),j=i(T.my,c.outerWidth(),c.outerHeight());"right"===t.my[0]?C.left-=h:"center"===t.my[0]&&(C.left-=h/2),"bottom"===t.my[1]?C.top-=d:"center"===t.my[1]&&(C.top-=d/2),C.left+=j[0],C.top+=j[1],e.support.offsetFractions||(C.left=l(C.left),C.top=l(C.top)),s={marginLeft:f,marginTop:y},e.each(["left","top"],function(i,n){e.ui.position[x[i]]&&e.ui.position[x[i]][n](C,{targetWidth:p,targetHeight:m,elemWidth:h,elemHeight:d,collisionPosition:s,collisionWidth:E,collisionHeight:k,offset:[o[0]+j[0],o[1]+j[1]],my:t.my,at:t.at,within:_,elem:c})}),t.using&&(u=function(e){var i=g.left-C.left,n=i+p-h,s=g.top-C.top,o=s+m-d,l={target:{element:b,left:g.left,top:g.top,width:p,height:m},element:{element:c,left:C.left,top:C.top,width:h,height:d},horizontal:0>n?"left":i>0?"right":"center",vertical:0>o?"top":s>0?"bottom":"middle"};h>p&&a(i+n)<p&&(l.horizontal="center"),d>m&&a(s+o)<m&&(l.vertical="middle"),l.important=r(a(i),a(n))>r(a(s),a(o))?"horizontal":"vertical",t.using.call(this,e,l)}),c.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var i,n=t.within,s=n.isWindow?n.scrollLeft:n.offset.left,o=n.width,a=e.left-t.collisionPosition.marginLeft,l=s-a,u=a+t.collisionWidth-o-s;t.collisionWidth>o?l>0&&0>=u?(i=e.left+l+t.collisionWidth-o-s,e.left+=l-i):e.left=u>0&&0>=l?s:l>u?s+o-t.collisionWidth:s:l>0?e.left+=l:u>0?e.left-=u:e.left=r(e.left-a,e.left)},top:function(e,t){var i,n=t.within,s=n.isWindow?n.scrollTop:n.offset.top,o=t.within.height,a=e.top-t.collisionPosition.marginTop,l=s-a,u=a+t.collisionHeight-o-s;t.collisionHeight>o?l>0&&0>=u?(i=e.top+l+t.collisionHeight-o-s,e.top+=l-i):e.top=u>0&&0>=l?s:l>u?s+o-t.collisionHeight:s:l>0?e.top+=l:u>0?e.top-=u:e.top=r(e.top-a,e.top)}},flip:{left:function(e,t){var i,n,s=t.within,o=s.offset.left+s.scrollLeft,r=s.width,l=s.isWindow?s.scrollLeft:s.offset.left,u=e.left-t.collisionPosition.marginLeft,c=u-l,h=u+t.collisionWidth-r-l,d="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>c?(i=e.left+d+p+f+t.collisionWidth-r-o,(0>i||i<a(c))&&(e.left+=d+p+f)):h>0&&(n=e.left-t.collisionPosition.marginLeft+d+p+f-l,(n>0||a(n)<h)&&(e.left+=d+p+f))},top:function(e,t){var i,n,s=t.within,o=s.offset.top+s.scrollTop,r=s.height,l=s.isWindow?s.scrollTop:s.offset.top,u=e.top-t.collisionPosition.marginTop,c=u-l,h=u+t.collisionHeight-r-l,d="top"===t.my[1],p=d?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>c?(n=e.top+p+f+m+t.collisionHeight-r-o,e.top+p+f+m>c&&(0>n||n<a(c))&&(e.top+=p+f+m)):h>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-l,e.top+p+f+m>h&&(i>0||a(i)<h)&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,n,s,o,r=document.getElementsByTagName("body")[0],a=document.createElement("div");t=document.createElement(r?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in n)t.style[o]=n[o];t.appendChild(a),i=r||document.documentElement,i.insertBefore(t,i.firstChild),a.style.cssText="position: absolute; left: 10.7432222px;",s=e(a).offset().left,e.support.offsetFractions=s>10&&11>s,t.innerHTML="",i.removeChild(t)}()}(jQuery),/*!
 * jQuery UI Menu 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/menu/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.position.js
 */
function(e){e.widget("ui.menu",{version:"1.10.0",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,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var i=e(t.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(t),i.has(".ui-menu").length?this.expand(t):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(t){var i=e(t.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),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 t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,s,o,r,a,l=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:l=!1,s=this.previousFilter||"",o=String.fromCharCode(t.keyCode),r=!1,clearTimeout(this.filterTimer),o===s?r=!0:o=s+o,a=new RegExp("^"+i(o),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return a.test(e(this).children("a").text())}),n=r&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(o=String.fromCharCode(t.keyCode),a=new RegExp("^"+i(o),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return a.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,i=this.options.icons.submenu,n=this.element.find(this.options.menus);n.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 t=e(this),n=t.prev("a"),s=e("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);n.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",n.attr("id"))}),t=n.add(this.element),t.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()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),this._super(e,t)},focus:function(e,t){var i,n;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),n=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",n.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,n,s,o,r,a;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,n=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,s=t.offset().top-this.activeMenu.offset().top-i-n,o=this.activeMenu.scrollTop(),r=this.activeMenu.height(),a=t.height(),0>s?this.activeMenu.scrollTop(o+s):s+a>r&&this.activeMenu.scrollTop(o+s-r+a))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var n=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));n.length||(n=this.element),this._close(n),this.blur(t),this.activeMenu=n},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},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(e,t,i){var n;this.active&&(n="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),n&&n.length&&this.active||(n=this.activeMenu.children(".ui-menu-item")[t]()),this.focus(i,n)},nextPage:function(t){var i,n,s;return this.active?(this.isLastItem()||(this._hasScroll()?(n=this.active.offset().top,s=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-n-s<0}),this.focus(t,i)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,n,s;return this.active?(this.isFirstItem()||(this._hasScroll()?(n=this.active.offset().top,s=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-n+s>0}),this.focus(t,i)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)}})}(jQuery),/*!
 * jQuery UI Autocomplete 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/autocomplete/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.position.js
 *	jquery.ui.menu.js
 */
function(e){var t=0;e.widget("ui.autocomplete",{version:"1.10.0",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,n;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(s){if(this.element.prop("readOnly"))return t=!0,n=!0,i=!0,void 0;t=!1,n=!1,i=!1;var o=e.ui.keyCode;switch(s.keyCode){case o.PAGE_UP:t=!0,this._move("previousPage",s);break;case o.PAGE_DOWN:t=!0,this._move("nextPage",s);break;case o.UP:t=!0,this._keyEvent("previous",s);break;case o.DOWN:t=!0,this._keyEvent("next",s);break;case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(t=!0,s.preventDefault(),this.menu.select(s));break;case o.TAB:this.menu.active&&this.menu.select(s);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(s),s.preventDefault());break;default:i=!0,this._searchTimeout(s)}},keypress:function(n){if(t)return t=!1,n.preventDefault(),void 0;if(!i){var s=e.ui.keyCode;switch(n.keyCode){case s.PAGE_UP:this._move("previousPage",n);break;case s.PAGE_DOWN:this._move("nextPage",n);break;case s.UP:this._keyEvent("previous",n);break;case s.DOWN:this._keyEvent("next",n)}}},input:function(e){return n?(n=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete").appendTo(this._appendTo()).menu({input:e(),role:null}).zIndex(this.element.zIndex()+1).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(n){n.target===t.element[0]||n.target===i||e.contains(i,n.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)}),void 0;var n=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:n})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value):this.liveRegion.text(n.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n,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},_isMultiLine:function(){return this.element.is("textarea")?!0:this.element.is("input")?!1:this.element.prop("isContentEditable")},_initSource:function(){var t,i,n=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,n){n(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,s){n.xhr&&n.xhr.abort(),n.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){s(e)},error:function(){s([])}})}):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):void 0},_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(n){i===t&&e.__response(n),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().zIndex(this.element.zIndex()+1);this._renderMenu(i,t),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 n=this;e.each(i,function(e,i){n._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(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},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 n=new RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return n.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),/*!
 * jQuery UI Button 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/button/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
function(e){var t,i,n,s,o="ui-button ui-widget ui-state-default ui-corner-all",r="ui-state-hover ui-state-active ",a="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",l=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},u=function(t){var i=t.name,n=t.form,s=e([]);return i&&(i=i.replace(/'/g,"\\'"),s=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),s};e.widget("ui.button",{version:"1.10.0",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,l),"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 r=this,a=this.options,c="checkbox"===this.type||"radio"===this.type,h=c?"":"ui-state-active",d="ui-state-focus";null===a.label&&(a.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){a.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){a.disabled||e(this).removeClass(h)}).bind("click"+this.eventNamespace,function(e){a.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){r.buttonElement.addClass(d)}).bind("blur"+this.eventNamespace,function(){r.buttonElement.removeClass(d)}),c&&(this.element.bind("change"+this.eventNamespace,function(){s||r.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){a.disabled||(s=!1,i=e.pageX,n=e.pageY)}).bind("mouseup"+this.eventNamespace,function(e){a.disabled||(i!==e.pageX||n!==e.pageY)&&(s=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return a.disabled||s?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(a.disabled||s)return!1;e(this).addClass("ui-state-active"),r.buttonElement.attr("aria-pressed","true");var t=r.element[0];u(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return a.disabled?!1:(e(this).addClass("ui-state-active"),t=this,r.document.one("mouseup",function(){t=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return a.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return a.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",a.disabled),this._resetButton()},_determineButtonType:function(){var e,t,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?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),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(o+" "+r+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(t?this.element.prop("disabled",!0):this.element.prop("disabled",!1),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?u(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(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),void 0;var t=this.buttonElement.removeClass(a),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),n=this.options.icons,s=n.primary&&n.secondary,o=[];n.primary||n.secondary?(this.options.text&&o.push("ui-button-text-icon"+(s?"s":n.primary?"-primary":"-secondary")),n.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+n.primary+"'></span>"),n.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+n.secondary+"'></span>"),this.options.text||(o.push(s?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.0",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(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="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 e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),/*!
 * jQuery UI Datepicker 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/datepicker/
 *
 * Depends:
 *	jquery.ui.core.js
 */
function(e,t){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},e.extend(this._defaults,this.regional[""]),this.dpDiv=n(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(o.inline?t.parent()[0]:o.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,i){e.extend(t,i);for(var n in i)null==i[n]&&(t[n]=i[n]);return t}e.extend(e.ui,{datepicker:{version:"1.10.0"}});var o,r="datepicker",a=(new Date).getTime();e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var n,s,o;n=t.nodeName.toLowerCase(),s="div"===n||"span"===n,t.id||(this.uuid+=1,t.id="dp"+this.uuid),o=this._newInst(e(t),s),o.settings=e.extend({},i||{}),"input"===n?this._connectDatepicker(t,o):s&&this._inlineDatepicker(t,o)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var n=e(t);i.append=e([]),i.trigger=e([]),n.hasClass(this.markerClassName)||(this._attachments(n,i),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,r,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var n,s,o,r=this._get(i,"appendText"),a=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[a?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),n=this._get(i,"showOn"),("focus"===n||"both"===n)&&t.focus(this._showDatepicker),("button"===n||"both"===n)&&(s=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(o?e("<img/>").attr({src:o,alt:s,title:s}):s)),t[a?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,n,s,o=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,n=0,s=0;s<e.length;s++)e[s].length>i&&(i=e[s].length,n=s);return n},o.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),e.input.attr("size",this._formatDate(e,o).length)}},_inlineDatepicker:function(t,i){var n=e(t);n.hasClass(this.markerClassName)||(n.addClass(this.markerClassName).append(i.dpDiv),e.data(t,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,n,o,a){var l,u,c,h,d,p=this._dialogInst;return p||(this.uuid+=1,l="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+l+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,o||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(u=document.documentElement.clientWidth,c=document.documentElement.clientHeight,h=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[u/2-100+h,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var i,n=e(t),s=e.data(t,r);n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===i?(s.append.remove(),s.trigger.remove(),n.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&n.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,n,s=e(t),o=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(n=s.children("."+this._inlineClass),n.children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,n,s=e(t),o=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(n=s.children("."+this._inlineClass),n.children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,n,o){var r,a,l,u,c=this._getInst(i);return 2===arguments.length&&"string"==typeof n?"defaults"===n?e.extend({},e.datepicker._defaults):c?"all"===n?e.extend({},c.settings):this._get(c,n):null:(r=n||{},"string"==typeof n&&(r={},r[n]=o),c&&(this._curInst===c&&this._hideDatepicker(),a=this._getDateDatepicker(i,!0),l=this._getMinMaxDate(c,"min"),u=this._getMinMaxDate(c,"max"),s(c.settings,r),null!==l&&r.dateFormat!==t&&r.minDate===t&&(c.settings.minDate=this._formatDate(c,l)),null!==u&&r.dateFormat!==t&&r.maxDate===t&&(c.settings.maxDate=this._formatDate(c,u)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),c),this._autoSize(c),this._setDate(c,a),this._updateAlternate(c),this._updateDatepicker(c)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,n,s,o=e.datepicker._getInst(t.target),r=!0,a=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",o.dpDiv),s[0]&&e.datepicker._selectDay(t.target,o.selectedMonth,o.selectedYear,s[0]),i=e.datepicker._get(o,"onSelect"),i?(n=e.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[n,o])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(o,"stepBigMonths"):-e.datepicker._get(o,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(o,"stepBigMonths"):+e.datepicker._get(o,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,a?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(o,"stepBigMonths"):-e.datepicker._get(o,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,a?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(o,"stepBigMonths"):+e.datepicker._get(o,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,n,s=e.datepicker._getInst(t.target);return e.datepicker._get(s,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(s,"dateFormat")),n=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">n||!i||i.indexOf(n)>-1):void 0},_doKeyUp:function(t){var i,n=e.datepicker._getInst(t.target);if(n.input.val()!==n.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(n,"dateFormat"),n.input?n.input.val():null,e.datepicker._getFormatConfig(n)),i&&(e.datepicker._setDateFromField(n),e.datepicker._updateAlternate(n),e.datepicker._updateDatepicker(n))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,o,r,a,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),o=n?n.apply(t,[t,i]):{},o!==!1&&(s(i.settings,o),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),a={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),a=e.datepicker._checkOffset(i,a,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),i.input.is(":visible")&&!i.input.is(":disabled")&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,o=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,n=this._getNumberOfMonths(t),s=n[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==n[0]||1!==n[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&t.input[0]!==document.activeElement&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(t,i,n){var s=t.dpDiv.outerWidth(),o=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,a=t.input?t.input.outerHeight():0,l=document.documentElement.clientWidth+(n?0:e(document).scrollLeft()),u=document.documentElement.clientHeight+(n?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-r:0,i.left-=n&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=n&&i.top===t.input.offset().top+a?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>l&&l>s?Math.abs(i.left+s-l):0),i.top-=Math.min(i.top,i.top+o>u&&u>o?Math.abs(o+a):0),i},_findPos:function(t){for(var i,n=this._getInst(t),s=this._get(n,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,n,s,o,a=this._curInst;!a||t&&a!==e.data(t,r)||this._datepickerShowing&&(i=this._get(a,"showAnim"),n=this._get(a,"duration"),s=function(){e.datepicker._tidyDialog(a)},e.effects&&(e.effects.effect[i]||e.effects[i])?a.dpDiv.hide(i,e.datepicker._get(a,"showOptions"),n,s):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?n:null,s),i||s(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),n=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==n)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,n){var s=e(t),o=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(o,i+("M"===n?this._get(o,"showCurrentAtPos"):0),n),this._updateDatepicker(o))},_gotoToday:function(t){var i,n=e(t),s=this._getInst(n[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(n)},_selectMonthYear:function(t,i,n){var s=e(t),o=this._getInst(s[0]);o["selected"+("M"===n?"Month":"Year")]=o["draw"+("M"===n?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(s)},_selectDay:function(t,i,n,s){var o,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(o=this._getInst(r[0]),o.selectedDay=o.currentDay=e("a",s).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=n,this._selectDate(t,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var n,s=e(t),o=this._getInst(s[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),n=this._get(o,"onSelect"),n?n.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,n,s,o=this._get(t,"altField");o&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),n=this._getDate(t),s=this.formatDate(i,n,this._getFormatConfig(t)),e(o).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,n){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?i.toString():i+"",""===i)return null;var s,o,r,a,l=0,u=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof u?u:(new Date).getFullYear()%100+parseInt(u,10),h=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,d=(n?n.dayNames:null)||this._defaults.dayNames,p=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,f=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=s+1<t.length&&t.charAt(s+1)===e;return i&&s++,i},w=function(e){var t=_(e),n="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=new RegExp("^\\d{1,"+n+"}"),o=i.substring(l).match(s);if(!o)throw"Missing number at position "+l;return l+=o[0].length,parseInt(o[0],10)},x=function(t,n,s){var o=-1,r=e.map(_(t)?s:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(r,function(e,t){var n=t[1];return i.substr(l,n.length).toLowerCase()===n.toLowerCase()?(o=t[0],l+=n.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+l},T=function(){if(i.charAt(l)!==t.charAt(s))throw"Unexpected literal at position "+l;l++};for(s=0;s<t.length;s++)if(b)"'"!==t.charAt(s)||_("'")?T():b=!1;else switch(t.charAt(s)){case"d":v=w("d");break;case"D":x("D",h,d);break;case"o":y=w("o");break;case"m":g=w("m");break;case"M":g=x("M",p,f);break;case"y":m=w("y");break;case"@":a=new Date(w("@")),m=a.getFullYear(),g=a.getMonth()+1,v=a.getDate();break;case"!":a=new Date((w("!")-this._ticksTo1970)/1e4),m=a.getFullYear(),g=a.getMonth()+1,v=a.getDate();break;case"'":_("'")?T():b=!0;break;default:T()}if(l<i.length&&(r=i.substr(l),!/^\s+/.test(r)))throw"Extra/unparsed characters found in date: "+r;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=m?0:-100)),y>-1)for(g=1,v=y;;){if(o=this._getDaysInMonth(m,g-1),o>=v)break;g++,v-=o}if(a=this._daylightSavingAdjust(new Date(m,g-1,v)),a.getFullYear()!==m||a.getMonth()+1!==g||a.getDate()!==v)throw"Invalid date";return a},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(e,t,i){if(!t)return"";var n,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,a=(i?i.monthNames:null)||this._defaults.monthNames,l=function(t){var i=n+1<e.length&&e.charAt(n+1)===t;return i&&n++,i},u=function(e,t,i){var n=""+t;if(l(e))for(;n.length<i;)n="0"+n;return n},c=function(e,t,i,n){return l(e)?n[t]:i[t]},h="",d=!1;if(t)for(n=0;n<e.length;n++)if(d)"'"!==e.charAt(n)||l("'")?h+=e.charAt(n):d=!1;else switch(e.charAt(n)){case"d":h+=u("d",t.getDate(),2);break;case"D":h+=c("D",t.getDay(),s,o);break;case"o":h+=u("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":h+=u("m",t.getMonth()+1,2);break;case"M":h+=c("M",t.getMonth(),r,a);break;case"y":h+=l("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":h+=t.getTime();break;case"!":h+=1e4*t.getTime()+this._ticksTo1970;break;case"'":l("'")?h+="'":d=!0;break;default:h+=e.charAt(n)}return h},_possibleChars:function(e){var t,i="",n=!1,s=function(i){var n=t+1<e.length&&e.charAt(t+1)===i;return n&&t++,n};for(t=0;t<e.length;t++)if(n)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):n=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":n=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),n=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),o=s,r=this._getFormatConfig(e);try{o=this.parseDate(i,n,r)||s}catch(a){n=t?"":n}e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),e.currentDay=n?o.getDate():0,e.currentMonth=n?o.getMonth():0,e.currentYear=n?o.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,n){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},o=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(n){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,o=s.getFullYear(),r=s.getMonth(),a=s.getDate(),l=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,u=l.exec(i);u;){switch(u[2]||"d"){case"d":case"D":a+=parseInt(u[1],10);break;case"w":case"W":a+=7*parseInt(u[1],10);break;case"m":case"M":r+=parseInt(u[1],10),a=Math.min(a,e.datepicker._getDaysInMonth(o,r));break;case"y":case"Y":o+=parseInt(u[1],10),a=Math.min(a,e.datepicker._getDaysInMonth(o,r))}u=l.exec(i)}return new Date(o,r,a)},r=null==i||""===i?n:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?n:s(i):new Date(i.getTime());return r=r&&"Invalid Date"===r.toString()?n:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var n=!t,s=e.selectedMonth,o=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&o===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(n?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),n="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){window["DP_jQuery_"+a].datepicker._adjustDate(n,-i,"M")},next:function(){window["DP_jQuery_"+a].datepicker._adjustDate(n,+i,"M")},hide:function(){window["DP_jQuery_"+a].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+a].datepicker._gotoToday(n)},selectDay:function(){return window["DP_jQuery_"+a].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+a].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+a].datepicker._selectMonthYear(n,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,n,s,o,r,a,l,u,c,h,d,p,f,m,g,v,y,b,_,w,x,T,E,k,C,j,S,D,O,P,I,M,A,N,B,F,H,R,L=new Date,z=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),W=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),Q=this._get(e,"hideIfNoPrevNext"),$=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),Y=this._get(e,"showCurrentAtPos"),V=this._get(e,"stepMonths"),K=1!==q[0]||1!==q[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),Z=this._getMinMaxDate(e,"max"),J=e.drawMonth-Y,et=e.drawYear;if(0>J&&(J+=12,et--),Z)for(t=this._daylightSavingAdjust(new Date(Z.getFullYear(),Z.getMonth()-q[0]*q[1]+1,Z.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,J,1))>t;)J--,0>J&&(J=11,et--);for(e.drawMonth=J,e.drawYear=et,i=this._get(e,"prevText"),i=$?this.formatDate(i,this._daylightSavingAdjust(new Date(et,J-V,1)),this._getFormatConfig(e)):i,n=this._canAdjustMonth(e,-1,et,J)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(W?"e":"w")+"'>"+i+"</span></a>":Q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(W?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=$?this.formatDate(s,this._daylightSavingAdjust(new Date(et,J+V,1)),this._getFormatConfig(e)):s,o=this._canAdjustMonth(e,1,et,J)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(W?"w":"e")+"'>"+s+"</span></a>":Q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(W?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),a=this._get(e,"gotoCurrent")&&e.currentDay?G:z,r=$?this.formatDate(r,a,this._getFormatConfig(e)):r,l=e.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(e,"closeText")+"</button>",u=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(W?l:"")+(this._isInRange(e,a)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(W?"":l)+"</div>":"",c=parseInt(this._get(e,"firstDay"),10),c=isNaN(c)?0:c,h=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",x=0;x<q[0];x++){for(T="",this.maxRows=4,E=0;E<q[1];E++){if(k=this._daylightSavingAdjust(new Date(et,J,e.selectedDay)),C=" ui-corner-all",j="",K){if(j+="<div class='ui-datepicker-group",q[1]>1)switch(E){case 0:j+=" ui-datepicker-group-first",C=" ui-corner-"+(W?"right":"left");break;case q[1]-1:j+=" ui-datepicker-group-last",C=" ui-corner-"+(W?"left":"right");break;default:j+=" ui-datepicker-group-middle",C=""}j+="'>"}for(j+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&0===x?W?o:n:"")+(/all|right/.test(C)&&0===x?W?n:o:"")+this._generateMonthYearHeader(e,J,et,X,Z,x>0||E>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",S=h?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",w=0;7>w;w++)D=(w+c)%7,S+="<th"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[D]+"'>"+p[D]+"</span></th>";for(j+=S+"</tr></thead><tbody>",O=this._getDaysInMonth(et,J),et===e.selectedYear&&J===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,O)),P=(this._getFirstDayOfMonth(et,J)-c+7)%7,I=Math.ceil((P+O)/7),M=K?this.maxRows>I?this.maxRows:I:I,this.maxRows=M,A=this._daylightSavingAdjust(new Date(et,J,1-P)),N=0;M>N;N++){for(j+="<tr>",B=h?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(A)+"</td>":"",w=0;7>w;w++)F=g?g.apply(e.input?e.input[0]:null,[A]):[!0,""],H=A.getMonth()!==J,R=H&&!y||!F[0]||X&&X>A||Z&&A>Z,B+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(H?" ui-datepicker-other-month":"")+(A.getTime()===k.getTime()&&J===e.selectedMonth&&e._keyEvent||b.getTime()===A.getTime()&&b.getTime()===k.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(H&&!v?"":" "+F[1]+(A.getTime()===G.getTime()?" "+this._currentClass:"")+(A.getTime()===z.getTime()?" ui-datepicker-today":""))+"'"+(H&&!v||!F[2]?"":" title='"+F[2]+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+(H&&!v?"&#xa0;":R?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===z.getTime()?" ui-state-highlight":"")+(A.getTime()===G.getTime()?" ui-state-active":"")+(H?" ui-priority-secondary":"")+"' href='#'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);j+=B+"</tr>"}J++,J>11&&(J=0,et++),j+="</tbody></table>"+(K?"</div>"+(q[0]>0&&E===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),T+=j}_+=T}return _+=u,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,n,s,o,r,a){var l,u,c,h,d,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(o||!g)_+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(l=n&&n.getFullYear()===i,u=s&&s.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!l||c>=n.getMonth())&&(!u||c<=s.getMonth())&&(_+="<option value='"+c+"'"+(c===t?" selected='selected'":"")+">"+a[c]+"</option>");_+="</select>"}if(y||(b+=_+(!o&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",o||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(h=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10);return isNaN(t)?d:t},f=p(h[0]),m=Math.max(f,p(h[1]||"")),f=n?Math.max(f,n.getFullYear()):f,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!o&&g&&v?"":"&#xa0;")+_),b+="</div>"
},_adjustInstDate:function(e,t,i){var n=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),o=Math.min(e.selectedDay,this._getDaysInMonth(n,s))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(n,s,o)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return n&&s>n?n:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,n){var s=this._getNumberOfMonths(e),o=this._daylightSavingAdjust(new Date(i,n+(0>t?t:s[0]*s[1]),1));return 0>t&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(e,o)},_isInRange:function(e,t){var i,n,s=this._getMinMaxDate(e,"min"),o=this._getMinMaxDate(e,"max"),r=null,a=null,l=this._get(e,"yearRange");return l&&(i=l.split(":"),n=(new Date).getFullYear(),r=parseInt(i[0],10)+n,a=parseInt(i[1],10)+n),(!s||t.getTime()>=s.getTime())&&(!o||t.getTime()<=o.getTime())&&(!r||t.getFullYear()>=r)&&(!a||t.getFullYear()<=a)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,n){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(n,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.0",window["DP_jQuery_"+a]=e}(jQuery),/*!
 * jQuery UI Mouse 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/mouse/
 *
 * Depends:
 *	jquery.ui.widget.js
 */
function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.0",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):void 0}),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 n=this,s=1===i.which,o="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.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 n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._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||document.documentMode<9)&&!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),/*!
 * jQuery UI Draggable 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/draggable/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.0",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 n=this._uiHash();if(this._trigger("drag",t,n)===!1)return this._mouseUp({}),!1;this.position=n.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,n=this,s=!1,o=!1;for(e.ui.ddmanager&&!this.options.dropBehaviour&&(o=e.ui.ddmanager.drop(this,t)),this.dropped&&(o=this.dropped,this.dropped=!1),i=this.element[0];i&&(i=i.parentNode);)i===document&&(s=!0);return s||"original"!==this.options.helper?("invalid"===this.options.revert&&!o||"valid"===this.options.revert&&o||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,o)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){n._trigger("stop",t)!==!1&&n._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){var i=this.options.handle&&e(this.options.handle,this.element).length?!1:!0;return e(this.options.handle,this.element).find("*").addBack().each(function(){this===t.target&&(i=!0)}),i},_createHelper:function(t){var i=this.options,n=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_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,n,s=this.options;if("parent"===s.containment&&(s.containment=this.helper[0].parentNode),("document"===s.containment||"window"===s.containment)&&(this.containment=["document"===s.containment?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"===s.containment?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"===s.containment?0:e(window).scrollLeft())+e("document"===s.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"===s.containment?0:e(window).scrollTop())+(e("document"===s.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(s.containment)||s.containment.constructor===Array)s.containment.constructor===Array&&(this.containment=s.containment);else{if(i=e(s.containment),n=i[0],!n)return;t="hidden"!==e(n).css("overflow"),this.containment=[(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0),(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0),(t?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).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 n="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:s.scrollTop())*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*n}},_generatePosition:function(t){var i,n,s,o,r=this.options,a="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(a[0].tagName),u=t.pageX,c=t.pageY;return this.originalPosition&&(this.containment&&(this.relative_container?(n=this.relative_container.offset(),i=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(u=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(c=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(u=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(c=i[3]+this.offset.click.top)),r.grid&&(s=r.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,c=i?s-this.offset.click.top>=i[1]||s-this.offset.click.top>i[3]?s:s-this.offset.click.top>=i[1]?s-r.grid[1]:s+r.grid[1]:s,o=r.grid[0]?this.originalPageX+Math.round((u-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,u=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-r.grid[0]:o+r.grid[0]:o)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:u-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:a.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,n){return n=n||this._uiHash(),e.ui.plugin.call(this,t,[i,n]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,n)},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 n=e(this).data("ui-draggable"),s=n.options,o=e.extend({},i,{item:n.element});n.sortables=[],e(s.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(n.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,o))})},stop:function(t,i){var n=e(this).data("ui-draggable"),s=e.extend({},i,{item:n.element});e.each(n.sortables,function(){this.instance.isOver?(this.instance.isOver=0,n.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===n.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,s))})},drag:function(t,i){var n=e(this).data("ui-draggable"),s=this;e.each(n.sortables,function(){var o=!1,r=this;this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(n.sortables,function(){return this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this!==r&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(r.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(s).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=n.offset.click.top,this.instance.offset.click.left=n.offset.click.left,this.instance.offset.parent.left-=n.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=n.offset.parent.top-this.instance.offset.parent.top,n._trigger("toSortable",t),n.dropped=this.instance.element,n.currentItem=n.element,this.instance.fromOutside=n),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(),n._trigger("fromSortable",t),n.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 n=e(i.helper),s=e(this).data("ui-draggable").options;n.css("opacity")&&(s._opacity=n.css("opacity")),n.css("opacity",s.opacity)},stop:function(t,i){var n=e(this).data("ui-draggable").options;n._opacity&&e(i.helper).css("opacity",n._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"),n=i.options,s=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(n.axis&&"x"===n.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?i.scrollParent[0].scrollTop=s=i.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-i.overflowOffset.top<n.scrollSensitivity&&(i.scrollParent[0].scrollTop=s=i.scrollParent[0].scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?i.scrollParent[0].scrollLeft=s=i.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-i.overflowOffset.left<n.scrollSensitivity&&(i.scrollParent[0].scrollLeft=s=i.scrollParent[0].scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(document).scrollTop()<n.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(document).scrollLeft()<n.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed)))),s!==!1&&e.ui.ddmanager&&!n.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),n=i.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:n.top,left:n.left})})},drag:function(t,i){var n,s,o,r,a,l,u,c,h,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(h=p.snapElements.length-1;h>=0;h--)a=p.snapElements[h].left,l=a+p.snapElements[h].width,u=p.snapElements[h].top,c=u+p.snapElements[h].height,g>a-m&&l+m>g&&y>u-m&&c+m>y||g>a-m&&l+m>g&&b>u-m&&c+m>b||v>a-m&&l+m>v&&y>u-m&&c+m>y||v>a-m&&l+m>v&&b>u-m&&c+m>b?("inner"!==f.snapMode&&(n=Math.abs(u-b)<=m,s=Math.abs(c-y)<=m,o=Math.abs(a-v)<=m,r=Math.abs(l-g)<=m,n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),s&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:a-p.helperProportions.width}).left-p.margins.left),r&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),d=n||s||o||r,"outer"!==f.snapMode&&(n=Math.abs(u-y)<=m,s=Math.abs(c-b)<=m,o=Math.abs(a-g)<=m,r=Math.abs(l-v)<=m,n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),s&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:a}).left-p.margins.left),r&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[h].snapping&&(n||s||o||r||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[h].item})),p.snapElements[h].snapping=n||s||o||r||d):(p.snapElements[h].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[h].item})),p.snapElements[h].snapping=!1)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=e(this).data("ui-draggable").options,n=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});n.length&&(t=parseInt(n[0].style.zIndex,10)||0,e(n).each(function(e){this.style.zIndex=t+e}),this[0].style.zIndex=t+n.length)}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var n=e(i.helper),s=e(this).data("ui-draggable").options;n.css("zIndex")&&(s._zIndex=n.css("zIndex")),n.css("zIndex",s.zIndex)},stop:function(t,i){var n=e(this).data("ui-draggable").options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}})}(jQuery),/*!
 * jQuery UI Resizable 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/resizable/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
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.0",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,n,s,o,r=this,a=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.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=a.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;i<t.length;i++)n=e.trim(t[i]),o="ui-resizable-"+n,s=e("<div class='ui-resizable-handle "+o+"'></div>"),s.css({zIndex:a.zIndex}),"se"===n&&s.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[n]=".ui-resizable-"+n,this.element.append(s);this._renderAxis=function(t){var i,n,s,o;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)&&(n=e(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth(),s=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(s,o),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){r.resizing||(this.className&&(s=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=s&&s[1]?s[1]:"se")}),a.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){a.disabled||(e(this).removeClass("ui-resizable-autohide"),r._handles.show())}).mouseleave(function(){a.disabled||r.resizing||(e(this).addClass("ui-resizable-autohide"),r._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,n,s=!1;for(i in this.handles)n=e(this.handles[i])[0],(n===t.target||e.contains(n,t.target))&&(s=!0);return!this.options.disabled&&s},_mouseStart:function(i){var n,s,o,r=this.options,a=this.element.position(),l=this.element;return this.resizing=!0,/absolute/.test(l.css("position"))?l.css({position:"absolute",top:l.css("top"),left:l.css("left")}):l.is(".ui-draggable")&&l.css({position:"absolute",top:a.top,left:a.left}),this._renderProxy(),n=t(this.helper.css("left")),s=t(this.helper.css("top")),r.containment&&(n+=e(r.containment).scrollLeft()||0,s+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:s},this.size=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalSize=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalPosition={left:n,top:s},this.sizeDiff={width:l.outerWidth()-l.width(),height:l.outerHeight()-l.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===o?this.axis+"-resize":o),l.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,n=this.helper,s={},o=this.originalMousePosition,r=this.axis,a=this.position.top,l=this.position.left,u=this.size.width,c=this.size.height,h=t.pageX-o.left||0,d=t.pageY-o.top||0,p=this._change[r];return p?(i=p.apply(this,[t,h,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!==a&&(s.top=this.position.top+"px"),this.position.left!==l&&(s.left=this.position.left+"px"),this.size.width!==u&&(s.width=this.size.width+"px"),this.size.height!==c&&(s.height=this.size.height+"px"),n.css(s),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,n,s,o,r,a,l,u=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,n=i.length&&/textarea/i.test(i[0].nodeName),s=n&&e.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,o=n?0:c.sizeDiff.width,r={width:c.helper.width()-o,height:c.helper.height()-s},a=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,l=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,u.animate||this.element.css(e.extend(r,{top:l,left:a})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!u.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,n,s,o,r,a=this.options;r={minWidth:i(a.minWidth)?a.minWidth:0,maxWidth:i(a.maxWidth)?a.maxWidth:1/0,minHeight:i(a.minHeight)?a.minHeight:0,maxHeight:i(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||e)&&(t=r.minHeight*this.aspectRatio,s=r.minWidth/this.aspectRatio,n=r.maxHeight*this.aspectRatio,o=r.maxWidth/this.aspectRatio,t>r.minWidth&&(r.minWidth=t),s>r.minHeight&&(r.minHeight=s),n<r.maxWidth&&(r.maxWidth=n),o<r.maxHeight&&(r.maxHeight=o)),this._vBoundaries=r},_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,n=this.size,s=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(n.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(n.height-e.height),e.left=t.left+(n.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,n=this.axis,s=i(e.width)&&t.maxWidth&&t.maxWidth<e.width,o=i(e.height)&&t.maxHeight&&t.maxHeight<e.height,r=i(e.width)&&t.minWidth&&t.minWidth>e.width,a=i(e.height)&&t.minHeight&&t.minHeight>e.height,l=this.originalPosition.left+this.originalSize.width,u=this.position.top+this.size.height,c=/sw|nw|w/.test(n),h=/nw|ne|n/.test(n);return r&&(e.width=t.minWidth),a&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),o&&(e.height=t.maxHeight),r&&c&&(e.left=l-t.minWidth),s&&c&&(e.left=l-t.maxWidth),a&&h&&(e.top=u-t.minHeight),o&&h&&(e.top=u-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,n,s,o=this.helper||this.element;for(e=0;e<this._proportionallyResizeElements.length;e++){if(s=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[s.css("borderTopWidth"),s.css("borderRightWidth"),s.css("borderBottomWidth"),s.css("borderLeftWidth")],n=[s.css("paddingTop"),s.css("paddingRight"),s.css("paddingBottom"),s.css("paddingLeft")],t=0;t<i.length;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(n[t],10)||0);s.css({height:o.height()-this.borderDif[0]-this.borderDif[2]||0,width:o.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,n=this.originalPosition;return{left:n.left+t,width:i.width-t}},n:function(e,t,i){var n=this.originalSize,s=this.originalPosition;return{top:s.top+i,height:n.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},sw:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,n]))},ne:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},nw:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,n]))}},_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"),n=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),r=o&&e.ui.hasScroll(s[0],"left")?0:i.sizeDiff.height,a=o?0:i.sizeDiff.width,l={width:i.size.width-a,height:i.size.height-r},u=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(l,c&&u?{top:c,left:u}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={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)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,n,s,o,r,a,l,u=e(this).data("ui-resizable"),c=u.options,h=u.element,d=c.containment,p=d instanceof e?d.get(0):/parent/.test(d)?h.parent().get(0):d;p&&(u.containerElement=e(p),/document/.test(d)||d===document?(u.containerOffset={left:0,top:0},u.containerPosition={left:0,top:0},u.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),n=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){n[e]=t(i.css("padding"+s))}),u.containerOffset=i.offset(),u.containerPosition=i.position(),u.containerSize={height:i.innerHeight()-n[3],width:i.innerWidth()-n[1]},s=u.containerOffset,o=u.containerSize.height,r=u.containerSize.width,a=e.ui.hasScroll(p,"left")?p.scrollWidth:r,l=e.ui.hasScroll(p)?p.scrollHeight:o,u.parentData={element:p,left:s.left,top:s.top,width:a,height:l}))},resize:function(t){var i,n,s,o,r=e(this).data("ui-resizable"),a=r.options,l=r.containerOffset,u=r.position,c=r._aspectRatio||t.shiftKey,h={top:0,left:0},d=r.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(h=l),u.left<(r._helper?l.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-l.left:r.position.left-h.left),c&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=a.helper?l.left:0),u.top<(r._helper?l.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-l.top:r.position.top),c&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?l.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top,i=Math.abs((r._helper?r.offset.left-h.left:r.offset.left-h.left)+r.sizeDiff.width),n=Math.abs((r._helper?r.offset.top-h.top:r.offset.top-l.top)+r.sizeDiff.height),s=r.containerElement.get(0)===r.element.parent().get(0),o=/relative|absolute/.test(r.containerElement.css("position")),s&&o&&(i-=r.parentData.left),i+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-i,c&&(r.size.height=r.size.width/r.aspectRatio)),n+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-n,c&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,n=t.containerOffset,s=t.containerPosition,o=t.containerElement,r=e(t.helper),a=r.offset(),l=r.outerWidth()-t.sizeDiff.width,u=r.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(o.css("position"))&&e(this).css({left:a.left-s.left-n.left,width:l,height:u}),t._helper&&!i.animate&&/static/.test(o.css("position"))&&e(this).css({left:a.left-s.left-n.left,width:l,height:u})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,n=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?n(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],n(i.alsoResize)):e.each(i.alsoResize,function(e){n(e)})},resize:function(t,i){var n=e(this).data("ui-resizable"),s=n.options,o=n.originalSize,r=n.originalPosition,a={height:n.size.height-o.height||0,width:n.size.width-o.width||0,top:n.position.top-r.top||0,left:n.position.left-r.left||0},l=function(t,n){e(t).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),o={},r=n&&n.length?n:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(e,t){var i=(s[t]||0)+(a[t]||0);i&&i>=0&&(o[t]=i||null)}),t.css(o)})};"object"!=typeof s.alsoResize||s.alsoResize.nodeType?l(s.alsoResize):e.each(s.alsoResize,function(e,t){l(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,n=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.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,n=t.size,s=t.originalSize,o=t.originalPosition,r=t.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=a[0]||1,u=a[1]||1,c=Math.round((n.width-s.width)/l)*l,h=Math.round((n.height-s.height)/u)*u,d=s.width+c,p=s.height+h,f=i.maxWidth&&i.maxWidth<d,m=i.maxHeight&&i.maxHeight<p,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=a,g&&(d+=l),v&&(p+=u),f&&(d-=l),m&&(p-=u),/^(se|s|e)$/.test(r)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(r)?(t.size.width=d,t.size.height=p,t.position.top=o.top-h):/^(sw)$/.test(r)?(t.size.width=d,t.size.height=p,t.position.left=o.left-c):(t.size.width=d,t.size.height=p,t.position.top=o.top-h,t.position.left=o.left-c)}})}(jQuery),/*!
 * jQuery UI Dialog 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/dialog/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *  jquery.ui.button.js
 *	jquery.ui.draggable.js
 *	jquery.ui.mouse.js
 *	jquery.ui.position.js
 *	jquery.ui.resizable.js
 */
function(e){var t={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.0",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(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.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&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=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),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i=this;this._isOpen&&this._trigger("beforeClose",t)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||e(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show),this._focusTabbable(),this._isOpen=!0,this._trigger("open"),this._trigger("focus"),void 0)},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<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(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),n=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==n[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(s.focus(1),t.preventDefault()):(n.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<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(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,n){var s,o;n=e.isFunction(n)?{click:n,text:i}:n,n=e.extend({type:"button"},n),s=n.click,n.click=function(){s.apply(t.element[0],arguments)},o={icons:n.icons,text:n.showText},delete n.icons,delete n.showText,e("<button></button>",n).button(o).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,s){e(this).addClass("ui-dialog-dragging"),i._trigger("dragStart",n,t(s))},drag:function(e,n){i._trigger("drag",e,t(n))},stop:function(s,o){n.position=[o.position.left-i.document.scrollLeft(),o.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._trigger("dragStop",s,t(o))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,n=this.options,s=n.resizable,o=this.uiDialog.css("position"),r="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:r,start:function(n,s){e(this).addClass("ui-dialog-resizing"),i._trigger("resizeStart",n,t(s))},resize:function(e,n){i._trigger("resize",e,t(n))},stop:function(s,o){n.height=e(this).height(),n.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._trigger("resizeStop",s,t(o))}}).css("position",o)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(n){var s=this,o=!1,r={};e.each(n,function(e,n){s._setOption(e,n),e in t&&(o=!0),e in i&&(r[e]=n)}),o&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,t){var i,n,s=this.uiDialog;"dialogClass"===e&&s.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=s.is(":data(ui-draggable)"),i&&!t&&s.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(n=s.is(":data(ui-resizable)"),n&&!t&&s.resizable("destroy"),n&&"string"==typeof t&&s.resizable("option","handles",t),n||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),e=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),t=Math.max(0,n.minHeight-e),i="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-e):"none","auto"===n.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,n.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_createOverlay:function(){this.options.modal&&(e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this._on(this.document,{focusin:function(t){e(t.target).closest(".ui-dialog").length||(t.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data("ui-dialog")._focusTabbable())}})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this.document[0].body),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++)},_destroyOverlay:function(){this.options.modal&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this._off(this.document,"focusin"),this.overlay.remove())}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,n=[],s=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(n=i.split?i.split(" "):[i[0],i[1]],1===n.length&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(s[e]=n[e],n[e]=t)}),i={my:n[0]+(s[0]<0?s[0]:"+"+s[0])+" "+n[1]+(s[1]<0?s[1]:"+"+s[1]),at:n.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})}(jQuery),/*!
 * jQuery UI Droppable 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/droppable/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 */
function(e){function t(e,t,i){return e>t&&t+i>e}e.widget("ui.droppable",{version:"1.10.0",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];t<i.length;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 n=i||e.ui.ddmanager.current,s=!1;return n&&(n.currentItem||n.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===n.options.scope&&t.accept.call(t.element[0],n.currentItem||n.element)&&e.ui.intersect(n,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(s=!0,!1):void 0}),s?!1:this.accept.call(this.element[0],n.currentItem||n.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(n)),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,n){if(!i.offset)return!1;var s,o,r=(e.positionAbs||e.position.absolute).left,a=r+e.helperProportions.width,l=(e.positionAbs||e.position.absolute).top,u=l+e.helperProportions.height,c=i.offset.left,h=c+i.proportions.width,d=i.offset.top,p=d+i.proportions.height;switch(n){case"fit":return r>=c&&h>=a&&l>=d&&p>=u;case"intersect":return c<r+e.helperProportions.width/2&&a-e.helperProportions.width/2<h&&d<l+e.helperProportions.height/2&&u-e.helperProportions.height/2<p;case"pointer":return s=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,o=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(o,d,i.proportions.height)&&t(s,c,i.proportions.width);case"touch":return(l>=d&&p>=l||u>=d&&p>=u||d>l&&u>p)&&(r>=c&&h>=r||a>=c&&h>=a||c>r&&a>h);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var n,s,o=e.ui.ddmanager.droppables[t.options.scope]||[],r=i?i.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(n=0;n<o.length;n++)if(!(o[n].options.disabled||t&&!o[n].accept.call(o[n].element[0],t.currentItem||t.element))){for(s=0;s<a.length;s++)if(a[s]===o[n].element[0]){o[n].proportions.height=0;continue e}o[n].visible="none"!==o[n].element.css("display"),o[n].visible&&("mousedown"===r&&o[n]._activate.call(o[n],i),o[n].offset=o[n].element.offset(),o[n].proportions={width:o[n].element[0].offsetWidth,height:o[n].element[0].offsetHeight})}},drop:function(t,i){var n=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(n=this._drop.call(this,i)||n),!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)))}),n},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 n,s,o,r=e.ui.intersect(t,this,this.options.tolerance),a=!r&&this.isover?"isout":r&&!this.isover?"isover":null;a&&(this.options.greedy&&(s=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===s}),o.length&&(n=e.data(o[0],"ui-droppable"),n.greedyChild="isover"===a)),n&&"isover"===a&&(n.isover=!1,n.isout=!0,n._out.call(n,i)),this[a]=!0,this["isout"===a?"isover":"isout"]=!1,this["isover"===a?"_over":"_out"].call(this,i),n&&"isout"===a&&(n.isout=!1,n.isover=!0,n._over.call(n,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}}(jQuery),jQuery.effects||function(e,t){var i="ui-effects-";e.effects={effect:{}},/*!
 * jQuery Color Animations v2.1.2
 * https://github.com/jquery/jquery-color
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * Date: Wed Jan 16 08:47:09 2013 -0600
 */
function(e,t){function i(e,t,i){var n=h[t.type]||{};return null==e?i||!t.def?null:t.def:(e=n.floor?~~e:parseFloat(e),isNaN(e)?t.def:n.mod?(e+n.mod)%n.mod:0>e?0:n.max<e?n.max:e)}function n(t){var i=u(),n=i._rgba=[];return t=t.toLowerCase(),f(l,function(e,s){var o,r=s.re.exec(t),a=r&&s.parse(r),l=s.space||"rgba";return a?(o=i[l](a),i[c[l].cache]=o[c[l].cache],n=i._rgba=o._rgba,!1):void 0}),n.length?("0,0,0,0"===n.join()&&e.extend(n,o.transparent),i):o[t]}function s(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var o,r="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",a=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],u=e.Color=function(t,i,n,s){return new e.Color.fn.parse(t,i,n,s)},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"}}}},h={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=u.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),u.fn=e.extend(u.prototype,{parse:function(s,r,a,l){if(s===t)return this._rgba=[null,null,null,null],this;(s.jquery||s.nodeType)&&(s=e(s).css(r),r=t);var h=this,d=e.type(s),p=this._rgba=[];return r!==t&&(s=[s,r,a,l],d="array"),"string"===d?this.parse(n(s)||o._default):"array"===d?(f(c.rgba.props,function(e,t){p[t.idx]=i(s[t.idx],t)}),this):"object"===d?(s instanceof u?f(c,function(e,t){s[t.cache]&&(h[t.cache]=s[t.cache].slice())}):f(c,function(t,n){var o=n.cache;f(n.props,function(e,t){if(!h[o]&&n.to){if("alpha"===e||null==s[e])return;h[o]=n.to(h._rgba)}h[o][t.idx]=i(s[e],t,!0)}),h[o]&&e.inArray(null,h[o].slice(0,3))<0&&(h[o][3]=1,n.from&&(h._rgba=n.from(h[o])))}),this):void 0},is:function(e){var t=u(e),i=!0,n=this;return f(c,function(e,s){var o,r=t[s.cache];return r&&(o=n[s.cache]||s.to&&s.to(n._rgba)||[],f(s.props,function(e,t){return null!=r[t.idx]?i=r[t.idx]===o[t.idx]:void 0})),i}),i},_space:function(){var e=[],t=this;return f(c,function(i,n){t[n.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var n=u(e),s=n._space(),o=c[s],r=0===this.alpha()?u("transparent"):this,a=r[o.cache]||o.to(r._rgba),l=a.slice();return n=n[o.cache],f(o.props,function(e,s){var o=s.idx,r=a[o],u=n[o],c=h[s.type]||{};null!==u&&(null===r?l[o]=u:(c.mod&&(u-r>c.mod/2?r+=c.mod:r-u>c.mod/2&&(r-=c.mod)),l[o]=i((u-r)*t+r,s)))}),this[s](l)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),n=i.pop(),s=u(t)._rgba;return u(e.map(i,function(e,t){return(1-n)*s[t]+n*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),n=i.pop();return t&&i.push(~~(255*n)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),u.fn.parse.prototype=u.fn,c.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,n=e[0]/255,s=e[1]/255,o=e[2]/255,r=e[3],a=Math.max(n,s,o),l=Math.min(n,s,o),u=a-l,c=a+l,h=.5*c;return t=l===a?0:n===a?60*(s-o)/u+360:s===a?60*(o-n)/u+120:60*(n-s)/u+240,i=0===u?0:.5>=h?u/c:u/(2-c),[Math.round(t)%360,i,h,null==r?1:r]},c.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],n=e[2],o=e[3],r=.5>=n?n*(1+i):n+i-n*i,a=2*n-r;return[Math.round(255*s(a,r,t+1/3)),Math.round(255*s(a,r,t)),Math.round(255*s(a,r,t-1/3)),o]},f(c,function(n,s){var o=s.props,r=s.cache,l=s.to,c=s.from;u.fn[n]=function(n){if(l&&!this[r]&&(this[r]=l(this._rgba)),n===t)return this[r].slice();var s,a=e.type(n),h="array"===a||"object"===a?n:arguments,d=this[r].slice();return f(o,function(e,t){var n=h["object"===a?e:t.idx];null==n&&(n=d[t.idx]),d[t.idx]=i(n,t)}),c?(s=u(c(d)),s[r]=d,s):u(d)},f(o,function(t,i){u.fn[t]||(u.fn[t]=function(s){var o,r=e.type(s),l="alpha"===t?this._hsla?"hsla":"rgba":n,u=this[l](),c=u[i.idx];return"undefined"===r?c:("function"===r&&(s=s.call(this,c),r=e.type(s)),null==s&&i.empty?this:("string"===r&&(o=a.exec(s),o&&(s=c+parseFloat(o[2])*("+"===o[1]?1:-1))),u[i.idx]=s,this[l](u)))})})}),u.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,s){var o,r,a="";if("transparent"!==s&&("string"!==e.type(s)||(o=n(s)))){if(s=u(o||s),!d.rgba&&1!==s._rgba[3]){for(r="backgroundColor"===i?t.parentNode:t;(""===a||"transparent"===a)&&r&&r.style;)try{a=e.css(r,"backgroundColor"),r=r.parentNode}catch(l){}s=s.blend(a&&"transparent"!==a?a:"_default")}s=s.toRgbaString()}try{t.style[i]=s}catch(l){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=u(t.elem,i),t.end=u(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},u.hook(r),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,n){t["border"+n+"Color"]=e}),t}},o=e.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(t){var i,n,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,o={};if(s&&s.length&&s[0]&&s[s[0]])for(n=s.length;n--;)i=s[n],"string"==typeof s[i]&&(o[e.camelCase(i)]=s[i]);else for(i in s)"string"==typeof s[i]&&(o[i]=s[i]);return o}function n(t,i){var n,s,r={};for(n in i)s=i[n],t[n]!==s&&(o[n]||(e.fx.step[n]||!isNaN(parseFloat(s)))&&(r[n]=s));return r}var s=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(jQuery.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(t,o,r,a){var l=e.speed(o,r,a);return this.queue(function(){var o,r=e(this),a=r.attr("class")||"",u=l.children?r.find("*").addBack():r;u=u.map(function(){var t=e(this);return{el:t,start:i(this)}}),o=function(){e.each(s,function(e,i){t[i]&&r[i+"Class"](t[i])})},o(),u=u.map(function(){return this.end=i(this.el[0]),this.diff=n(this.start,this.end),this}),r.attr("class",a),u=u.map(function(){var t=this,i=e.Deferred(),n=e.extend({},l,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,n),i.promise()}),e.when.apply(e,u.get()).done(function(){o(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),l.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,i,n,s){return i?e.effects.animateClass.call(this,{add:t},i,n,s):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,i,n,s){return i?e.effects.animateClass.call(this,{remove:t},i,n,s):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(i,n,s,o,r){return"boolean"==typeof n||n===t?s?e.effects.animateClass.call(this,n?{add:i}:{remove:i},s,o,r):this._toggleClass(i,n):e.effects.animateClass.call(this,{toggle:i},n,s,o)},switchClass:function(t,i,n,s,o){return e.effects.animateClass.call(this,{add:i,remove:t},n,s,o)}})}(),function(){function n(t,i,n,s){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(s=i,n=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(s=n,n=i,i={}),e.isFunction(n)&&(s=n,n=null),i&&e.extend(t,i),n=n||i.duration,t.duration=e.fx.off?0:"number"==typeof n?n:n in e.fx.speeds?e.fx.speeds[n]:e.fx.speeds._default,t.complete=s||i.complete,t}function s(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"==typeof t&&!e.effects.effect[t]}e.extend(e.effects,{version:"1.10.0",save:function(e,t){for(var n=0;n<t.length;n++)null!==t[n]&&e.data(i+t[n],e[0].style[t[n]])},restore:function(e,n){var s,o;for(o=0;o<n.length;o++)null!==n[o]&&(s=e.data(i+n[o]),s===t&&(s=""),e.css(n[o],s))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,n;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=e[1]/t.width}return{x:n,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},n=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),s={width:t.width(),height:t.height()},o=document.activeElement;try{o.id}catch(r){o=document.body}return t.wrap(n),(t[0]===o||e.contains(t[0],o))&&e(o).focus(),n=t.parent(),"static"===t.css("position")?(n.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,n){i[n]=t.css(n),isNaN(parseInt(i[n],10))&&(i[n]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(s),n.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,n,s){return s=s||{},e.each(i,function(e,i){var o=t.cssUnit(i);o[0]>0&&(s[i]=o[0]*n+o[1])}),s}}),e.fn.extend({effect:function(){function t(t){function n(){e.isFunction(o)&&o.call(s[0]),e.isFunction(t)&&t()}var s=e(this),o=i.complete,a=i.mode;(s.is(":hidden")?"hide"===a:"show"===a)?n():r.call(s[0],i,n)}var i=n.apply(this,arguments),s=i.mode,o=i.queue,r=e.effects.effect[i.effect];return e.fx.off||!r?s?this[s](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):o===!1?this.each(t):this.queue(o||"fx",t)},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=n.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=n.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||"boolean"==typeof t||e.isFunction(t))return this.__toggle.apply(this,arguments);var i=n.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)},cssUnit:function(t){var i=this.css(t),n=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(n=[parseFloat(i),t])}),n}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;e<((t=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}()}(jQuery),/*!
 * jQuery UI Effects Blind 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/blind-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){var t=/up|down|vertical/,i=/up|left|vertical|horizontal/;e.effects.effect.blind=function(n,s){var o,r,a,l=e(this),u=["position","top","bottom","left","right","height","width"],c=e.effects.setMode(l,n.mode||"hide"),h=n.direction||"up",d=t.test(h),p=d?"height":"width",f=d?"top":"left",m=i.test(h),g={},v="show"===c;l.parent().is(".ui-effects-wrapper")?e.effects.save(l.parent(),u):e.effects.save(l,u),l.show(),o=e.effects.createWrapper(l).css({overflow:"hidden"}),r=o[p](),a=parseFloat(o.css(f))||0,g[p]=v?r:0,m||(l.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:r+a),v&&(o.css(p,0),m||o.css(f,a+r)),o.animate(g,{duration:n.duration,easing:n.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),e.effects.restore(l,u),e.effects.removeWrapper(l),s()}})}}(jQuery),/*!
 * jQuery UI Effects Bounce 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/bounce-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.bounce=function(t,i){var n,s,o,r=e(this),a=["position","top","bottom","left","right","height","width"],l=e.effects.setMode(r,t.mode||"effect"),u="hide"===l,c="show"===l,h=t.direction||"up",d=t.distance,p=t.times||5,f=2*p+(c||u?1:0),m=t.duration/f,g=t.easing,v="up"===h||"down"===h?"top":"left",y="up"===h||"left"===h,b=r.queue(),_=b.length;for((c||u)&&a.push("opacity"),e.effects.save(r,a),r.show(),e.effects.createWrapper(r),d||(d=r["top"===v?"outerHeight":"outerWidth"]()/3),c&&(o={opacity:1},o[v]=0,r.css("opacity",0).css(v,y?2*-d:2*d).animate(o,m,g)),u&&(d/=Math.pow(2,p-1)),o={},o[v]=0,n=0;p>n;n++)s={},s[v]=(y?"-=":"+=")+d,r.animate(s,m,g).animate(o,m,g),d=u?2*d:d/2;u&&(s={opacity:0},s[v]=(y?"-=":"+=")+d,r.animate(s,m,g)),r.queue(function(){u&&r.hide(),e.effects.restore(r,a),e.effects.removeWrapper(r),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),r.dequeue()}}(jQuery),/*!
 * jQuery UI Effects Clip 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/clip-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.clip=function(t,i){var n,s,o,r=e(this),a=["position","top","bottom","left","right","height","width"],l=e.effects.setMode(r,t.mode||"hide"),u="show"===l,c=t.direction||"vertical",h="vertical"===c,d=h?"height":"width",p=h?"top":"left",f={};e.effects.save(r,a),r.show(),n=e.effects.createWrapper(r).css({overflow:"hidden"}),s="IMG"===r[0].tagName?n:r,o=s[d](),u&&(s.css(d,0),s.css(p,o/2)),f[d]=u?o:0,f[p]=u?0:o/2,s.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){u||r.hide(),e.effects.restore(r,a),e.effects.removeWrapper(r),i()}})}}(jQuery),/*!
 * jQuery UI Effects Drop 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/drop-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.drop=function(t,i){var n,s=e(this),o=["position","top","bottom","left","right","opacity","height","width"],r=e.effects.setMode(s,t.mode||"hide"),a="show"===r,l=t.direction||"left",u="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",h={opacity:a?1:0};e.effects.save(s,o),s.show(),e.effects.createWrapper(s),n=t.distance||s["top"===u?"outerHeight":"outerWidth"](!0)/2,a&&s.css("opacity",0).css(u,"pos"===c?-n:n),h[u]=(a?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+n,s.animate(h,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===r&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}}(jQuery),/*!
 * jQuery UI Effects Explode 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/explode-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.explode=function(t,i){function n(){b.push(this),b.length===h*d&&s()}function s(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var o,r,a,l,u,c,h=t.pieces?Math.round(Math.sqrt(t.pieces)):3,d=h,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),y=Math.ceil(p.outerHeight()/h),b=[];for(o=0;h>o;o++)for(l=g.top+o*y,c=o-(h-1)/2,r=0;d>r;r++)a=g.left+r*v,u=r-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-r*v,top:-o*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:a+(m?u*v:0),top:l+(m?c*y:0),opacity:m?0:1}).animate({left:a+(m?0:u*v),top:l+(m?0:c*y),opacity:m?1:0},t.duration||500,t.easing,n)}}(jQuery),/*!
 * jQuery UI Effects Fade 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/fade-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.fade=function(t,i){var n=e(this),s=e.effects.setMode(n,t.mode||"toggle");n.animate({opacity:s},{queue:!1,duration:t.duration,easing:t.easing,complete:i})}}(jQuery),/*!
 * jQuery UI Effects Fold 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/fold-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.fold=function(t,i){var n,s,o=e(this),r=["position","top","bottom","left","right","height","width"],a=e.effects.setMode(o,t.mode||"hide"),l="show"===a,u="hide"===a,c=t.size||15,h=/([0-9]+)%/.exec(c),d=!!t.horizFirst,p=l!==d,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(o,r),o.show(),n=e.effects.createWrapper(o).css({overflow:"hidden"}),s=p?[n.width(),n.height()]:[n.height(),n.width()],h&&(c=parseInt(h[1],10)/100*s[u?0:1]),l&&n.css(d?{height:0,width:c}:{height:c,width:0}),g[f[0]]=l?s[0]:c,v[f[1]]=l?s[1]:0,n.animate(g,m,t.easing).animate(v,m,t.easing,function(){u&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()})}}(jQuery),/*!
 * jQuery UI Effects Highlight 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/highlight-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.highlight=function(t,i){var n=e(this),s=["backgroundImage","backgroundColor","opacity"],o=e.effects.setMode(n,t.mode||"show"),r={backgroundColor:n.css("backgroundColor")};"hide"===o&&(r.opacity=0),e.effects.save(n,s),n.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(r,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,s),i()}})}}(jQuery),/*!
 * jQuery UI Effects Pulsate 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/pulsate-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.pulsate=function(t,i){var n,s=e(this),o=e.effects.setMode(s,t.mode||"show"),r="show"===o,a="hide"===o,l=r||"hide"===o,u=2*(t.times||5)+(l?1:0),c=t.duration/u,h=0,d=s.queue(),p=d.length;for((r||!s.is(":visible"))&&(s.css("opacity",0).show(),h=1),n=1;u>n;n++)s.animate({opacity:h},c,t.easing),h=1-h;s.animate({opacity:h},c,t.easing),s.queue(function(){a&&s.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,u+1))),s.dequeue()}}(jQuery),/*!
 * jQuery UI Effects Scale 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/scale-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.puff=function(t,i){var n=e(this),s=e.effects.setMode(n,t.mode||"hide"),o="hide"===s,r=parseInt(t.percent,10)||150,a=r/100,l={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:s,complete:i,percent:o?r:100,from:o?l:{height:l.height*a,width:l.width*a,outerHeight:l.outerHeight*a,outerWidth:l.outerWidth*a}}),n.effect(t)},e.effects.effect.scale=function(t,i){var n=e(this),s=e.extend(!0,{},t),o=e.effects.setMode(n,t.mode||"effect"),r=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===o?0:100),a=t.direction||"both",l=t.origin,u={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()},c={y:"horizontal"!==a?r/100:1,x:"vertical"!==a?r/100:1};s.effect="size",s.queue=!1,s.complete=i,"effect"!==o&&(s.origin=l||["middle","center"],s.restore=!0),s.from=t.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:u),s.to={height:u.height*c.y,width:u.width*c.x,outerHeight:u.outerHeight*c.y,outerWidth:u.outerWidth*c.x},s.fade&&("show"===o&&(s.from.opacity=0,s.to.opacity=1),"hide"===o&&(s.from.opacity=1,s.to.opacity=0)),n.effect(s)},e.effects.effect.size=function(t,i){var n,s,o,r=e(this),a=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],u=["width","height","overflow"],c=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(r,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=r.css("position"),y=f?a:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&r.show(),n={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},"toggle"===t.mode&&"show"===p?(r.from=t.to||b,r.to=t.from||n):(r.from=t.from||("show"===p?b:n),r.to=t.to||("hide"===p?b:n)),o={from:{y:r.from.height/n.height,x:r.from.width/n.width},to:{y:r.to.height/n.height,x:r.to.width/n.width}},("box"===m||"both"===m)&&(o.from.y!==o.to.y&&(y=y.concat(h),r.from=e.effects.setTransition(r,h,o.from.y,r.from),r.to=e.effects.setTransition(r,h,o.to.y,r.to)),o.from.x!==o.to.x&&(y=y.concat(d),r.from=e.effects.setTransition(r,d,o.from.x,r.from),r.to=e.effects.setTransition(r,d,o.to.x,r.to))),("content"===m||"both"===m)&&o.from.y!==o.to.y&&(y=y.concat(c).concat(u),r.from=e.effects.setTransition(r,c,o.from.y,r.from),r.to=e.effects.setTransition(r,c,o.to.y,r.to)),e.effects.save(r,y),r.show(),e.effects.createWrapper(r),r.css("overflow","hidden").css(r.from),g&&(s=e.effects.getBaseline(g,n),r.from.top=(n.outerHeight-r.outerHeight())*s.y,r.from.left=(n.outerWidth-r.outerWidth())*s.x,r.to.top=(n.outerHeight-r.to.outerHeight)*s.y,r.to.left=(n.outerWidth-r.to.outerWidth)*s.x),r.css(r.from),("content"===m||"both"===m)&&(h=h.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),u=a.concat(h).concat(d),r.find("*[width]").each(function(){var i=e(this),n={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&e.effects.save(i,u),i.from={height:n.height*o.from.y,width:n.width*o.from.x,outerHeight:n.outerHeight*o.from.y,outerWidth:n.outerWidth*o.from.x},i.to={height:n.height*o.to.y,width:n.width*o.to.x,outerHeight:n.height*o.to.y,outerWidth:n.width*o.to.x},o.from.y!==o.to.y&&(i.from=e.effects.setTransition(i,h,o.from.y,i.from),i.to=e.effects.setTransition(i,h,o.to.y,i.to)),o.from.x!==o.to.x&&(i.from=e.effects.setTransition(i,d,o.from.x,i.from),i.to=e.effects.setTransition(i,d,o.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,u)})})),r.animate(r.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===r.to.opacity&&r.css("opacity",r.from.opacity),"hide"===p&&r.hide(),e.effects.restore(r,y),f||("static"===v?r.css({position:"relative",top:r.to.top,left:r.to.left}):e.each(["top","left"],function(e,t){r.css(t,function(t,i){var n=parseInt(i,10),s=e?r.to.left:r.to.top;return"auto"===i?s+"px":n+s+"px"})})),e.effects.removeWrapper(r),i()}})}}(jQuery),/*!
 * jQuery UI Effects Shake 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/shake-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.shake=function(t,i){var n,s=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(s,t.mode||"effect"),a=t.direction||"left",l=t.distance||20,u=t.times||3,c=2*u+1,h=Math.round(t.duration/c),d="up"===a||"down"===a?"top":"left",p="up"===a||"left"===a,f={},m={},g={},v=s.queue(),y=v.length;for(e.effects.save(s,o),s.show(),e.effects.createWrapper(s),f[d]=(p?"-=":"+=")+l,m[d]=(p?"+=":"-=")+2*l,g[d]=(p?"-=":"+=")+2*l,s.animate(f,h,t.easing),n=1;u>n;n++)s.animate(m,h,t.easing).animate(g,h,t.easing);s.animate(m,h,t.easing).animate(f,h/2,t.easing).queue(function(){"hide"===r&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,c+1))),s.dequeue()}}(jQuery),/*!
 * jQuery UI Effects Slide 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/slide-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.slide=function(t,i){var n,s=e(this),o=["position","top","bottom","left","right","width","height"],r=e.effects.setMode(s,t.mode||"show"),a="show"===r,l=t.direction||"left",u="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,h={};e.effects.save(s,o),s.show(),n=t.distance||s["top"===u?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(s).css({overflow:"hidden"}),a&&s.css(u,c?isNaN(n)?"-"+n:-n:n),h[u]=(a?c?"+=":"-=":c?"-=":"+=")+n,s.animate(h,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===r&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}}(jQuery),/*!
 * jQuery UI Effects Transfer 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/transfer-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
function(e){e.effects.effect.transfer=function(t,i){var n=e(this),s=e(t.to),o="fixed"===s.css("position"),r=e("body"),a=o?r.scrollTop():0,l=o?r.scrollLeft():0,u=s.offset(),c={top:u.top-a,left:u.left-l,height:s.innerHeight(),width:s.innerWidth()},h=n.offset(),d=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:h.top-a,left:h.left-l,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(c,t.duration,t.easing,function(){d.remove(),i()})}}(jQuery),/*!
 * jQuery UI Progressbar 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/progressbar/
 *
 * Depends:
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 */
function(e,t){e.widget("ui.progressbar",{version:"1.10.0",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=e("<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(e){return e===t?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return e===t&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===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=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}})}(jQuery),/*!
 * jQuery UI Selectable 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/selectable/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
function(e){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.0",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,n=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(n.filter,this.element[0]),this._trigger("start",t),e(n.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),n.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var n=e.data(this,"selectable-item");n.startselected=!0,t.metaKey||t.ctrlKey||(n.$element.removeClass("ui-selected"),n.selected=!1,n.$element.addClass("ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",t,{unselecting:n.element}))}),e(t.target).parents().addBack().each(function(){var n,s=e.data(this,"selectable-item");return s?(n=!t.metaKey&&!t.ctrlKey||!s.$element.hasClass("ui-selected"),s.$element.removeClass(n?"ui-unselecting":"ui-selected").addClass(n?"ui-selecting":"ui-unselecting"),s.unselecting=!n,s.selecting=n,s.selected=n,n?i._trigger("selecting",t,{selecting:s.element}):i._trigger("unselecting",t,{unselecting:s.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,n=this,s=this.options,o=this.opos[0],r=this.opos[1],a=t.pageX,l=t.pageY;return o>a&&(i=a,a=o,o=i),r>l&&(i=l,l=r,r=i),this.helper.css({left:o,top:r,width:a-o,height:l-r}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),u=!1;i&&i.element!==n.element[0]&&("touch"===s.tolerance?u=!(i.left>a||i.right<o||i.top>l||i.bottom<r):"fit"===s.tolerance&&(u=i.left>o&&i.right<a&&i.top>r&&i.bottom<l),u?(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,n._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),n._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,n._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 n=e.data(this,"selectable-item");n.$element.removeClass("ui-unselecting"),n.unselecting=!1,n.startselected=!1,i._trigger("unselected",t,{unselected:n.element})}),e(".ui-selecting",this.element[0]).each(function(){var n=e.data(this,"selectable-item");n.$element.removeClass("ui-selecting").addClass("ui-selected"),n.selecting=!1,n.selected=!0,n.startselected=!0,i._trigger("selected",t,{selected:n.element})}),this._trigger("stop",t),this.helper.remove(),!1}})}(jQuery),/*!
 * jQuery UI Slider 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/slider/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
function(e){var t=5;e.widget("ui.slider",e.ui.mouse,{version:"1.10.0",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(){var t,i,n=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",r=[];for(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.range=e([]),n.range&&(n.range===!0&&(n.values?n.values.length&&2!==n.values.length?n.values=[n.values[0],n.values[0]]:e.isArray(n.values)&&(n.values=n.values.slice(0)):n.values=[this._valueMin(),this._valueMin()]),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===n.range||"max"===n.range?" ui-slider-range-"+n.range:""))),i=n.values&&n.values.length||1,t=s.length;i>t;t++)r.push(o);this.handles=s.add(e(r.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(function(){n.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){n.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)}),this._setOption("disabled",n.disabled),this._on(this.handles,this._handleEvents),this._refreshValue(),this._animateOff=!1},_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(t){var i,n,s,o,r,a,l,u,c=this,h=this.options;return h.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(i),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(n-c.values(t));(s>i||s===i&&(t===c._lastChangedValue||c.values(t)===h.min))&&(s=i,o=e(this),r=t)}),a=this._start(t,r),a===!1?!1:(this._mouseSliding=!0,this._handleIndex=r,o.addClass("ui-state-active").focus(),l=o.offset(),u=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=u?{left:0,top:0}:{left:t.pageX-l.left-o.width()/2,top:t.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,r,n),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,n,s,o;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),n=i/t,n>1&&(n=1),0>n&&(n=0),"vertical"===this.orientation&&(n=1-n),s=this._valueMax()-this._valueMin(),o=this._valueMin()+n*s,this._trimAlignValue(o)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var n,s,o;this.options.values&&this.options.values.length?(n=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>n||1===t&&n>i)&&(i=n),i!==this.values(t)&&(s=this.values(),s[t]=i,o=this._trigger("slide",e,{handle:this.handles[t],value:i,values:s}),n=this.values(t?0:1),o!==!1&&this.values(t,i,!0))):i!==this.value()&&(o=this._trigger("slide",e,{handle:this.handles[t],value:i}),o!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var n,s,o;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(n=this.options.values,s=arguments[0],o=0;o<n.length;o+=1)n[o]=this._trimAlignValue(s[o]),this._change(null,o);this._refreshValue()},_setOption:function(t,i){var n,s=0;switch(e.isArray(this.options.values)&&(s=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments),t){case"disabled":i?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0)):this.handles.prop("disabled",!1);break;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(),n=0;s>n;n+=1)this._change(null,n);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,n;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);for(i=this.options.values.slice(),n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(i[n]);return i},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,n=e-i;return 2*Math.abs(i)>=t&&(n+=i>0?t:-t),parseFloat(n.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,i,n,s,o,r=this.options.range,a=this.options,l=this,u=this._animateOff?!1:a.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(n){i=100*((l.values(n)-l._valueMin())/(l._valueMax()-l._valueMin())),c["horizontal"===l.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[u?"animate":"css"](c,a.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===n&&l.range.stop(1,1)[u?"animate":"css"]({left:i+"%"},a.animate),1===n&&l.range[u?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:a.animate})):(0===n&&l.range.stop(1,1)[u?"animate":"css"]({bottom:i+"%"},a.animate),1===n&&l.range[u?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:a.animate}))),t=i}):(n=this.value(),s=this._valueMin(),o=this._valueMax(),i=o!==s?100*((n-s)/(o-s)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[u?"animate":"css"](c,a.animate),"min"===r&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:i+"%"},a.animate),"max"===r&&"horizontal"===this.orientation&&this.range[u?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:a.animate}),"min"===r&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:i+"%"},a.animate),"max"===r&&"vertical"===this.orientation&&this.range[u?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:a.animate}))},_handleEvents:{keydown:function(i){var n,s,o,r,a=e(i.target).data("ui-slider-handle-index");switch(i.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(i.target).addClass("ui-state-active"),n=this._start(i,a),n===!1))return}switch(r=this.options.step,s=o=this.options.values&&this.options.values.length?this.values(a):this.value(),i.keyCode){case e.ui.keyCode.HOME:o=this._valueMin();break;case e.ui.keyCode.END:o=this._valueMax();break;case e.ui.keyCode.PAGE_UP:o=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.PAGE_DOWN:o=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;o=this._trimAlignValue(s+r);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;o=this._trimAlignValue(s-r)}this._slide(i,a,o)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}})}(jQuery),/*!
 * jQuery UI Sortable 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/sortable/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
function(e){function t(e,t,i){return e>t&&t+i>e}e.widget("ui.sortable",e.ui.mouse,{version:"1.10.0",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 e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===e.axis||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!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 e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,i){"disabled"===t?(this.options[t]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,i){var n=null,s=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,o.widgetName+"-item")===o?(n=e(this),!1):void 0}),e.data(t.target,o.widgetName+"-item")===o&&(n=e(t.target)),n?!this.options.handle||i||(e(this.options.handle,n).find("*").addBack().each(function(){this===t.target&&(s=!0)}),s)?(this.currentItem=n,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,n){var s,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),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},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.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(t),this.originalPageX=t.pageX,this.originalPageY=t.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&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",o.cursor)),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",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,n,s,o,r=this.options,a=!1;for(this.position=this._generatePosition(t),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-t.pageY<r.scrollSensitivity?this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+r.scrollSpeed:t.pageY-this.overflowOffset.top<r.scrollSensitivity&&(this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-r.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<r.scrollSensitivity?this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+r.scrollSpeed:t.pageX-this.overflowOffset.left<r.scrollSensitivity&&(this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-r.scrollSpeed)):(t.pageY-e(document).scrollTop()<r.scrollSensitivity?a=e(document).scrollTop(e(document).scrollTop()-r.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<r.scrollSensitivity&&(a=e(document).scrollTop(e(document).scrollTop()+r.scrollSpeed)),t.pageX-e(document).scrollLeft()<r.scrollSensitivity?a=e(document).scrollLeft(e(document).scrollLeft()-r.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<r.scrollSensitivity&&(a=e(document).scrollLeft(e(document).scrollLeft()+r.scrollSpeed))),a!==!1&&e.ui.ddmanager&&!r.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),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(n=this.items[i],s=n.item[0],o=this._intersectsWithPointer(n),o&&n.instance===this.currentContainer&&s!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==s&&!e.contains(this.placeholder[0],s)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],s):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(t,n),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var n=this,s=this.placeholder.offset();this.reverting=!0,e(this.helper).animate({left:s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft),top:s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){n._clear(t)})}else this._clear(t,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 t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].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(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&n.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!n.length&&t.key&&n.push(t.key+"="),n.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},i.each(function(){n.push(e(t.item||this).attr(t.attribute||"id")||"")}),n},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,n=this.positionAbs.top,s=n+this.helperProportions.height,o=e.left,r=o+e.width,a=e.top,l=a+e.height,u=this.offset.click.top,c=this.offset.click.left,h=n+u>a&&l>n+u&&t+c>o&&r>t+c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?h:o<t+this.helperProportions.width/2&&i-this.helperProportions.width/2<r&&a<n+this.helperProportions.height/2&&s-this.helperProportions.height/2<l},_intersectsWithPointer:function(e){var i="x"===this.options.axis||t(this.positionAbs.top+this.offset.click.top,e.top,e.height),n="y"===this.options.axis||t(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=i&&n,o=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();return s?this.floating?r&&"right"===r||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(e){var i=t(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),n=t(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&n||"left"===o&&!n:s&&("down"===s&&i||"up"===s&&!i)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var i,n,s,o,r=[],a=[],l=this._connectWith();if(l&&t)for(i=l.length-1;i>=0;i--)for(s=e(l[i]),n=s.length-1;n>=0;n--)o=e.data(s[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&a.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(a.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=a.length-1;i>=0;i--)a[i][0].each(function(){r.push(this)});return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;i<t.length;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,n,s,o,r,a,l,u,c=this.items,h=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(s=e(d[i]),n=s.length-1;n>=0;n--)o=e.data(s[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(h.push([e.isFunction(o.options.items)?o.options.items.call(o.element[0],t,{item:this.currentItem}):e(o.options.items,o.element),o]),this.containers.push(o));for(i=h.length-1;i>=0;i--)for(r=h[i][1],a=h[i][0],n=0,u=a.length;u>n;n++)l=e(a[n]),l.data(this.widgetName+"-item",r),c.push({item:l,instance:r,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,n,s,o;for(i=this.items.length-1;i>=0;i--)n=this.items[i],n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?e(this.options.toleranceElement,n.item):n.item,t||(n.width=s.outerWidth(),n.height=s.outerHeight()),o=s.offset(),n.left=o.left,n.top=o.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--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.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(t){t=t||this;var i,n=t.options;n.placeholder&&n.placeholder.constructor!==String||(i=n.placeholder,n.placeholder={element:function(){var n=e(document.createElement(t.currentItem[0].nodeName)).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return i||(n.style.visibility="hidden"),n},update:function(e,s){(!i||n.forcePlaceholderSize)&&(s.height()||s.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),s.width()||s.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,n,s,o,r,a,l,u,c,h=null,d=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(h&&e.contains(this.containers[i].element[0],h.element[0]))continue;h=this.containers[i],d=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(h)if(1===this.containers.length)this.containers[d]._trigger("over",t,this._uiHash(this)),this.containers[d].containerCache.over=1;else{for(s=1e4,o=null,r=this.containers[d].floating?"left":"top",a=this.containers[d].floating?"width":"height",l=this.positionAbs[r]+this.offset.click[r],n=this.items.length-1;n>=0;n--)e.contains(this.containers[d].element[0],this.items[n].item[0])&&this.items[n].item[0]!==this.currentItem[0]&&(u=this.items[n].item.offset()[r],c=!1,Math.abs(u-l)>Math.abs(u+this.items[n][a]-l)&&(c=!0,u+=this.items[n][a]),Math.abs(u-l)<s&&(s=Math.abs(u-l),o=this.items[n],this.direction=c?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[d].element,!0),this._trigger("change",t,this._uiHash()),this.containers[d]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",t,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(t){var i=this.options,n=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[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")}),(!n[0].style.width||i.forceHelperSize)&&n.width(this.currentItem.width()),(!n[0].style.height||i.forceHelperSize)&&n.height(this.currentItem.height()),n},_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.currentItem.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.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 t,i,n,s=this.options;"parent"===s.containment&&(s.containment=this.helper[0].parentNode),("document"===s.containment||"window"===s.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===s.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===s.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(s.containment)||(t=e(s.containment)[0],i=e(s.containment).offset(),n="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(n?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(n?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var n="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:s.scrollTop())*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*n}},_generatePosition:function(t){var i,n,s=this.options,o=t.pageX,r=t.pageY,a="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(a[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&&(t.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(r=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),s.grid&&(i=this.originalPageY+Math.round((r-this.originalPageY)/s.grid[1])*s.grid[1],r=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-s.grid[1]:i+s.grid[1]:i,n=this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0],o=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-s.grid[0]:n+s.grid[0]:n)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())}},_rearrange:function(e,t,i,n){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var s=this.counter;this._delay(function(){s===this.counter&&this.refreshPositions(!n)})},_clear:function(t,i){this.reverting=!1;var n,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)("auto"===this._storedCSS[n]||"static"===this._storedCSS[n])&&(this._storedCSS[n]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!i&&s.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||i||s.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(i||(s.push(function(e){this._trigger("remove",e,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)i||s.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over&&(s.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over=0);if(this._storedCursor&&e("body").css("cursor",this._storedCursor),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(!i){for(this._trigger("beforeStop",t,this._uiHash()),n=0;n<s.length;n++)s[n].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(i||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,!i){for(n=0;n<s.length;n++)s[n].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}})}(jQuery),/*!
 * jQuery UI Spinner 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/spinner/
 *
 * Depends:
 *  jquery.ui.core.js
 *  jquery.ui.widget.js
 *  jquery.ui.button.js
 */
function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.10.0",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 t={},i=this.element;return e.each(["min","max","step"],function(e,n){var s=i.attr(n);void 0!==s&&s.length&&(t[n]=s)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=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=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,n=e.ui.keyCode;switch(t.keyCode){case n.UP:return this._repeat(null,1,t),!0;case n.DOWN:return this._repeat(null,-1,t),!0;case n.PAGE_UP:return this._repeat(null,i.page,t),!0;case n.PAGE_DOWN:return this._repeat(null,-i.page,t),!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(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,n=this.options;return t=null!==n.min?n.min:0,i=e-t,i=Math.round(i/n.step)*n.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==n.max&&e>n.max?n.max:null!==n.min&&e<n.min?n.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),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:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(t(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})}(jQuery),/*!
 * jQuery UI Tabs 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/tabs/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
function(e,t){function i(){return++s}function n(e){return e.hash.length>1&&decodeURIComponent(e.href.replace(o,""))===decodeURIComponent(location.href.replace(o,""))}var s=0,o=/#.*$/;e.widget("ui.tabs",{version:"1.10.0",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 t=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(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,n=location.hash.substring(1);return null===t&&(n&&this.tabs.each(function(i,s){return e(s).attr("aria-controls")===n?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),n=this.tabs.index(i),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:n++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:s=!1,n--;break;case e.ui.keyCode.END:n=this.anchors.length-1;break;case e.ui.keyCode.HOME:n=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(n),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,s),t.ctrlKey||(i.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(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function n(){return t>s&&(t=0),0>t&&(t=s),t}for(var s=this.tabs.length-1;-1!==e.inArray(n(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),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 t=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 e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var o,r,a,l=e(s).uniqueId().attr("id"),u=e(s).closest("li"),c=u.attr("aria-controls");n(s)?(o=s.hash,r=t.element.find(t._sanitizeSelector(o))):(a=t._tabId(u),o="#"+a,r=t.element.find(o),r.length||(r=t._createPanel(a),r.insertAfter(t.panels[i-1]||t.tablist)),r.attr("aria-live","polite")),r.length&&(t.panels=t.panels.add(r)),c&&u.data("ui-tabs-aria-controls",c),u.attr({"aria-controls":o.substring(1),"aria-labelledby":l}),r.attr("aria-labelledby",l)}),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(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,n=0;i=this.tabs[n];n++)t===!0||-1!==e.inArray(n,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){i[t]="_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(t){var i,n=this.element.parent();"fill"===t?(i=n.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),n=t.css("position");"absolute"!==n&&"fixed"!==n&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,n=this.active,s=e(t.currentTarget),o=s.closest("li"),r=o[0]===n[0],a=r&&i.collapsible,l=a?e():this._getPanelForTab(o),u=n.length?this._getPanelForTab(n):e(),c={oldTab:n,oldPanel:u,newTab:a?e():o,newPanel:l};t.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||r&&!i.collapsible||this._trigger("beforeActivate",t,c)===!1||(i.active=a?!1:this.tabs.index(o),this.active=r?e():o,this.xhr&&this.xhr.abort(),u.length||l.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),t),this._toggle(t,c))},_toggle:function(t,i){function n(){o.running=!1,o._trigger("activate",t,i)}function s(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&o.options.show?o._show(r,o.options.show,n):(r.show(),n())}var o=this,r=i.newPanel,a=i.oldPanel;this.running=!0,a.length&&this.options.hide?this._hide(a,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),a.hide(),s()),a.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),r.length&&a.length?i.oldTab.attr("tabIndex",-1):r.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),r.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var i,n=this._findActive(t);n[0]!==this.active[0]&&(n.length||(n=this.active),i=n.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_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(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(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 t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var n=this.options.disabled;n!==!1&&(i===t?n=!1:(i=this._getIndex(i),n=e.isArray(n)?e.map(n,function(e){return e!==i?e:null}):e.map(this.tabs,function(e,t){return t!==i?t:null})),this._setupDisabled(n))},disable:function(i){var n=this.options.disabled;if(n!==!0){if(i===t)n=!0;else{if(i=this._getIndex(i),-1!==e.inArray(i,n))return;n=e.isArray(n)?e.merge([i],n).sort():[i]}this._setupDisabled(n)}},load:function(t,i){t=this._getIndex(t);var s=this,o=this.tabs.eq(t),r=o.find(".ui-tabs-anchor"),a=this._getPanelForTab(o),l={tab:o,panel:a};n(r[0])||(this.xhr=e.ajax(this._ajaxSettings(r,i,l)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){a.html(e),s._trigger("load",i,l)},1)}).complete(function(e,t){setTimeout(function(){"abort"===t&&s.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),a.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr},1)})))},_ajaxSettings:function(t,i,n){var s=this;return{url:t.attr("href"),beforeSend:function(t,o){return s._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:o},n))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})}(jQuery),/*!
 * jQuery UI Tooltip 1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/tooltip/
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.position.js
 */
function(e){function t(t,i){var n=(t.attr("aria-describedby")||"").split(/\s+/);n.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(n.join(" ")))}function i(t){var i=t.data("ui-tooltip-id"),n=(t.attr("aria-describedby")||"").split(/\s+/),s=e.inArray(i,n);-1!==s&&n.splice(s,1),t.removeData("ui-tooltip-id"),n=e.trim(n.join(" ")),n?t.attr("aria-describedby",n):t.removeAttr("aria-describedby")}var n=0;e.widget("ui.tooltip",{version:"1.10.0",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).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(t,i){var n=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){n._updateContent(t)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,n){var s=e.Event("blur");s.target=s.currentTarget=n[0],t.close(s,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,n=e(t?t.target:this.element).closest(this.options.items);n.length&&!n.data("ui-tooltip-id")&&(n.attr("title")&&n.data("ui-tooltip-title",n.attr("title")),n.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&n.parents().each(function(){var t,n=e(this);n.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),n.attr("title")&&(n.uniqueId(),i.parents[this.id]={element:this,title:n.attr("title")},n.attr("title",""))}),this._updateContent(n,t))},_updateContent:function(e,t){var i,n=this.options.content,s=this,o=t?t.type:null;return"string"==typeof n?this._open(t,e,n):(i=n.call(e[0],function(i){e.data("ui-tooltip-open")&&s._delay(function(){t&&(t.type=o),this._open(t,e,i)})}),i&&this._open(t,e,i),void 0)},_open:function(i,n,s){function o(e){u.of=e,r.is(":hidden")||r.position(u)}var r,a,l,u=e.extend({},this.options.position);if(s){if(r=this._find(n),r.length)return r.find(".ui-tooltip-content").html(s),void 0;n.is("[title]")&&(i&&"mouseover"===i.type?n.attr("title",""):n.removeAttr("title")),r=this._tooltip(n),t(n,r.attr("id")),r.find(".ui-tooltip-content").html(s),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):r.position(e.extend({of:n},this.options.position)),r.hide(),this._show(r,this.options.show),this.options.show&&this.options.show.delay&&(l=this.delayedShow=setInterval(function(){r.is(":visible")&&(o(u.of),clearInterval(l))},e.fx.interval)),this._trigger("open",i,{tooltip:r}),a={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var i=e.Event(t);i.currentTarget=n[0],this.close(i,!0)}},remove:function(){this._removeTooltip(r)}},i&&"mouseover"!==i.type||(a.mouseleave="close"),i&&"focusin"!==i.type||(a.focusout="close"),this._on(!0,n,a)}},close:function(t){var n=this,s=e(t?t.currentTarget:this.element),o=this._find(s);this.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&s.attr("title",s.data("ui-tooltip-title")),i(s),o.stop(!0),this._hide(o,this.options.hide,function(){n._removeTooltip(e(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:o}),this.closing=!1)},_tooltip:function(t){var i="ui-tooltip-"+n++,s=e("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(s),s.appendTo(this.document[0].body),this.tooltips[i]=t,s},_find:function(t){var i=t.data("ui-tooltip-id");return i?e("#"+i):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,n){var s=e.Event("blur");s.target=s.currentTarget=n[0],t.close(s,!0),e("#"+i).remove(),n.data("ui-tooltip-title")&&(n.attr("title",n.data("ui-tooltip-title")),n.removeData("ui-tooltip-title"))})}})}(jQuery),function(e){e.color={},e.color.make=function(t,i,n,s){var o={};return o.r=t||0,o.g=i||0,o.b=n||0,o.a=null!=s?s:1,o.add=function(e,t){for(var i=0;i<e.length;++i)o[e.charAt(i)]+=t;return o.normalize()},o.scale=function(e,t){for(var i=0;i<e.length;++i)o[e.charAt(i)]*=t;return o.normalize()},o.toString=function(){return o.a>=1?"rgb("+[o.r,o.g,o.b].join(",")+")":"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"},o.normalize=function(){function e(e,t,i){return e>t?e:t>i?i:t}return o.r=e(0,parseInt(o.r),255),o.g=e(0,parseInt(o.g),255),o.b=e(0,parseInt(o.b),255),o.a=e(0,o.a,1),o},o.clone=function(){return e.color.make(o.r,o.b,o.g,o.a)},o.normalize()},e.color.extract=function(t,i){var n;do{if(n=t.css(i).toLowerCase(),""!=n&&"transparent"!=n)break;t=t.parent()}while(!e.nodeName(t.get(0),"body"));return"rgba(0, 0, 0, 0)"==n&&(n="transparent"),e.color.parse(n)},e.color.parse=function(i){var n,s=e.color.make;if(n=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(i))return s(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10));if(n=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return s(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4]));if(n=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(i))return s(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]));if(n=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return s(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]),parseFloat(n[4]));if(n=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(i))return s(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16));if(n=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(i))return s(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16));var o=e.trim(i).toLowerCase();return"transparent"==o?s(255,255,255,0):(n=t[o]||[0,0,0],s(n[0],n[1],n[2]))};var t={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(e){function t(t,s,o,r){function a(e,t){t=[_t].concat(t);for(var i=0;i<e.length;++i)e[i].apply(this,t)}function l(){for(var t=0;t<r.length;++t){var i=r[t];i.init(_t),i.options&&e.extend(!0,rt,i.options)}}function u(t){var i;for(e.extend(!0,rt,t),null==rt.xaxis.color&&(rt.xaxis.color=rt.grid.color),null==rt.yaxis.color&&(rt.yaxis.color=rt.grid.color),null==rt.xaxis.tickColor&&(rt.xaxis.tickColor=rt.grid.tickColor),null==rt.yaxis.tickColor&&(rt.yaxis.tickColor=rt.grid.tickColor),null==rt.grid.borderColor&&(rt.grid.borderColor=rt.grid.color),null==rt.grid.tickColor&&(rt.grid.tickColor=e.color.parse(rt.grid.color).scale("a",.22).toString()),i=0;i<Math.max(1,rt.xaxes.length);++i)rt.xaxes[i]=e.extend(!0,{},rt.xaxis,rt.xaxes[i]);for(i=0;i<Math.max(1,rt.yaxes.length);++i)rt.yaxes[i]=e.extend(!0,{},rt.yaxis,rt.yaxes[i]);for(rt.xaxis.noTicks&&null==rt.xaxis.ticks&&(rt.xaxis.ticks=rt.xaxis.noTicks),rt.yaxis.noTicks&&null==rt.yaxis.ticks&&(rt.yaxis.ticks=rt.yaxis.noTicks),rt.x2axis&&(rt.xaxes[1]=e.extend(!0,{},rt.xaxis,rt.x2axis),rt.xaxes[1].position="top"),rt.y2axis&&(rt.yaxes[1]=e.extend(!0,{},rt.yaxis,rt.y2axis),rt.yaxes[1].position="right"),rt.grid.coloredAreas&&(rt.grid.markings=rt.grid.coloredAreas),rt.grid.coloredAreasColor&&(rt.grid.markingsColor=rt.grid.coloredAreasColor),rt.lines&&e.extend(!0,rt.series.lines,rt.lines),rt.points&&e.extend(!0,rt.series.points,rt.points),rt.bars&&e.extend(!0,rt.series.bars,rt.bars),null!=rt.shadowSize&&(rt.series.shadowSize=rt.shadowSize),i=0;i<rt.xaxes.length;++i)g(dt,i+1).options=rt.xaxes[i];for(i=0;i<rt.yaxes.length;++i)g(pt,i+1).options=rt.yaxes[i];for(var n in bt)rt.hooks[n]&&rt.hooks[n].length&&(bt[n]=bt[n].concat(rt.hooks[n]));a(bt.processOptions,[rt])}function c(e){ot=h(e),v(),y()}function h(t){for(var i=[],n=0;n<t.length;++n){var s=e.extend(!0,{},rt.series);null!=t[n].data?(s.data=t[n].data,delete t[n].data,e.extend(!0,s,t[n]),t[n].data=s.data):s.data=t[n],i.push(s)}return i}function d(e,t){var i=e[t+"axis"];return"object"==typeof i&&(i=i.n),"number"!=typeof i&&(i=1),i}function p(){return e.grep(dt.concat(pt),function(e){return e})}function f(e){var t,i,n={};for(t=0;t<dt.length;++t)i=dt[t],i&&i.used&&(n["x"+i.n]=i.c2p(e.left));for(t=0;t<pt.length;++t)i=pt[t],i&&i.used&&(n["y"+i.n]=i.c2p(e.top));return void 0!==n.x1&&(n.x=n.x1),void 0!==n.y1&&(n.y=n.y1),n}function m(e){var t,i,n,s={};for(t=0;t<dt.length;++t)if(i=dt[t],i&&i.used&&(n="x"+i.n,null==e[n]&&1==i.n&&(n="x"),null!=e[n])){s.left=i.p2c(e[n]);break}for(t=0;t<pt.length;++t)if(i=pt[t],i&&i.used&&(n="y"+i.n,null==e[n]&&1==i.n&&(n="y"),null!=e[n])){s.top=i.p2c(e[n]);break}return s}function g(t,i){return t[i-1]||(t[i-1]={n:i,direction:t==dt?"x":"y",options:e.extend(!0,{},t==dt?rt.xaxis:rt.yaxis)}),t[i-1]}function v(){var t,i=ot.length,n=[],s=[];for(t=0;t<ot.length;++t){var o=ot[t].color;null!=o&&(--i,"number"==typeof o?s.push(o):n.push(e.color.parse(ot[t].color)))}for(t=0;t<s.length;++t)i=Math.max(i,s[t]+1);var r=[],a=0;for(t=0;r.length<i;){var l;l=rt.colors.length==t?e.color.make(100,100,100):e.color.parse(rt.colors[t]);var u=1==a%2?-1:1;l.scale("rgb",1+.2*u*Math.ceil(a/2)),r.push(l),++t,t>=rt.colors.length&&(t=0,++a)}var c,h=0;for(t=0;t<ot.length;++t){if(c=ot[t],null==c.color?(c.color=r[h].toString(),++h):"number"==typeof c.color&&(c.color=r[c.color].toString()),null==c.lines.show){var p,f=!0;for(p in c)if(c[p]&&c[p].show){f=!1;break}f&&(c.lines.show=!0)}c.xaxis=g(dt,d(c,"x")),c.yaxis=g(pt,d(c,"y"))}}function y(){function t(e,t,i){t<e.datamin&&t!=-g&&(e.datamin=t),i>e.datamax&&i!=g&&(e.datamax=i)}var i,n,s,o,r,l,u,c,h,d,f=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=Number.MAX_VALUE;for(e.each(p(),function(e,t){t.datamin=f,t.datamax=m,t.used=!1}),i=0;i<ot.length;++i)r=ot[i],r.datapoints={points:[]},a(bt.processRawData,[r,r.data,r.datapoints]);for(i=0;i<ot.length;++i){r=ot[i];var v=r.data,y=r.datapoints.format;if(y||(y=[],y.push({x:!0,number:!0,required:!0}),y.push({y:!0,number:!0,required:!0}),(r.bars.show||r.lines.show&&r.lines.fill)&&(y.push({y:!0,number:!0,required:!1,defaultValue:0}),r.bars.horizontal&&(delete y[y.length-1].y,y[y.length-1].x=!0)),r.datapoints.format=y),null==r.datapoints.pointsize)for(r.datapoints.pointsize=y.length,u=r.datapoints.pointsize,l=r.datapoints.points,insertSteps=r.lines.show&&r.lines.steps,r.xaxis.used=r.yaxis.used=!0,n=s=0;n<v.length;++n,s+=u){d=v[n];var b=null==d;if(!b)for(o=0;u>o;++o)c=d[o],h=y[o],h&&(h.number&&null!=c&&(c=+c,isNaN(c)?c=null:1/0==c?c=g:c==-1/0&&(c=-g)),null==c&&(h.required&&(b=!0),null!=h.defaultValue&&(c=h.defaultValue))),l[s+o]=c;if(b)for(o=0;u>o;++o)c=l[s+o],null!=c&&(h=y[o],h.x&&t(r.xaxis,c,c),h.y&&t(r.yaxis,c,c)),l[s+o]=null;else if(insertSteps&&s>0&&null!=l[s-u]&&l[s-u]!=l[s]&&l[s-u+1]!=l[s+1]){for(o=0;u>o;++o)l[s+u+o]=l[s+o];l[s+1]=l[s-u+1],s+=u}}}for(i=0;i<ot.length;++i)r=ot[i],a(bt.processDatapoints,[r,r.datapoints]);for(i=0;i<ot.length;++i){r=ot[i],l=r.datapoints.points,u=r.datapoints.pointsize;var _=f,w=f,x=m,T=m;for(n=0;n<l.length;n+=u)if(null!=l[n])for(o=0;u>o;++o)c=l[n+o],h=y[o],h&&c!=g&&c!=-g&&(h.x&&(_>c&&(_=c),c>x&&(x=c)),h.y&&(w>c&&(w=c),c>T&&(T=c)));if(r.bars.show){var E="left"==r.bars.align?0:-r.bars.barWidth/2;r.bars.horizontal?(w+=E,T+=E+r.bars.barWidth):(_+=E,x+=E+r.bars.barWidth)}t(r.xaxis,_,x),t(r.yaxis,w,T)}e.each(p(),function(e,t){t.datamin==f&&(t.datamin=null),t.datamax==m&&(t.datamax=null)})}function b(i,n){var s=document.createElement("canvas");return s.className=n,s.width=mt,s.height=gt,i||e(s).css({position:"absolute",left:0,top:0}),e(s).appendTo(t),s.getContext||(s=window.G_vmlCanvasManager.initElement(s)),s.getContext("2d").save(),s}function _(){if(mt=t.width(),gt=t.height(),0>=mt||0>=gt)throw"Invalid dimensions for plot, width = "+mt+", height = "+gt}function w(e){e.width!=mt&&(e.width=mt),e.height!=gt&&(e.height=gt);var t=e.getContext("2d");t.restore(),t.save()}function x(){var i,n=t.children("canvas.base"),s=t.children("canvas.overlay");0==n.length||0==s?(t.html(""),t.css({padding:0}),"static"==t.css("position")&&t.css("position","relative"),_(),at=b(!0,"base"),lt=b(!1,"overlay"),i=!1):(at=n.get(0),lt=s.get(0),i=!0),ct=at.getContext("2d"),ht=lt.getContext("2d"),ut=e([lt,at]),i&&(t.data("plot").shutdown(),_t.resize(),ht.clearRect(0,0,mt,gt),ut.unbind(),t.children().not([at,lt]).remove()),t.data("plot",_t)}function T(){rt.grid.hoverable&&(ut.mousemove(Y),ut.mouseleave(V)),rt.grid.clickable&&ut.click(K),a(bt.bindEvents,[ut])}function E(){xt&&clearTimeout(xt),ut.unbind("mousemove",Y),ut.unbind("mouseleave",V),ut.unbind("click",K),a(bt.shutdown,[ut])}function k(e){function t(e){return e}var i,n,s=e.options.transform||t,o=e.options.inverseTransform;"x"==e.direction?(i=e.scale=vt/Math.abs(s(e.max)-s(e.min)),n=Math.min(s(e.max),s(e.min))):(i=e.scale=yt/Math.abs(s(e.max)-s(e.min)),i=-i,n=Math.max(s(e.max),s(e.min))),e.p2c=s==t?function(e){return(e-n)*i}:function(e){return(s(e)-n)*i},e.c2p=o?function(e){return o(n+e/i)}:function(e){return n+e/i}}function C(i){function n(n,s){return e('<div style="position:absolute;top:-10000px;'+s+'font-size:smaller">'+'<div class="'+i.direction+"Axis "+i.direction+i.n+'Axis">'+n.join("")+"</div></div>").appendTo(t)}var s,o,r,a=i.options,l=i.ticks||[],u=[],c=a.labelWidth,h=a.labelHeight;if("x"==i.direction){if(null==c&&(c=Math.floor(mt/(l.length>0?l.length:1))),null==h){for(u=[],s=0;s<l.length;++s)o=l[s].label,o&&u.push('<div class="tickLabel" style="float:left;width:'+c+'px">'+o+"</div>");u.length>0&&(u.push('<div style="clear:left"></div>'),r=n(u,"width:10000px;"),h=r.height(),r.remove())}}else if(null==c||null==h){for(s=0;s<l.length;++s)o=l[s].label,o&&u.push('<div class="tickLabel">'+o+"</div>");u.length>0&&(r=n(u,""),null==c&&(c=r.children().width()),null==h&&(h=r.find("div.tickLabel").height()),r.remove())}null==c&&(c=0),null==h&&(h=0),i.labelWidth=c,i.labelHeight=h}function j(t){var i=t.labelWidth,n=t.labelHeight,s=t.options.position,o=t.options.tickLength,r=rt.grid.axisMargin,a=rt.grid.labelMargin,l="x"==t.direction?dt:pt,u=e.grep(l,function(e){return e&&e.options.position==s&&e.reserveSpace});e.inArray(t,u)==u.length-1&&(r=0),null==o&&(o="full");var c=e.grep(l,function(e){return e&&e.reserveSpace}),h=0==e.inArray(t,c);h||"full"!=o||(o=5),isNaN(+o)||(a+=+o),"x"==t.direction?(n+=a,"bottom"==s?(ft.bottom+=n+r,t.box={top:gt-ft.bottom,height:n}):(t.box={top:ft.top+r,height:n},ft.top+=n+r)):(i+=a,"left"==s?(t.box={left:ft.left+r,width:i},ft.left+=i+r):(ft.right+=i+r,t.box={left:mt-ft.right,width:i})),t.position=s,t.tickLength=o,t.box.padding=a,t.innermost=h}function S(e){"x"==e.direction?(e.box.left=ft.left,e.box.width=vt):(e.box.top=ft.top,e.box.height=yt)}function D(){var t,i=p();if(e.each(i,function(e,t){t.show=t.options.show,null==t.show&&(t.show=t.used),t.reserveSpace=t.show||t.options.reserveSpace,O(t)}),allocatedAxes=e.grep(i,function(e){return e.reserveSpace}),ft.left=ft.right=ft.top=ft.bottom=0,rt.grid.show){for(e.each(allocatedAxes,function(e,t){P(t),I(t),M(t,t.ticks),C(t)}),t=allocatedAxes.length-1;t>=0;--t)j(allocatedAxes[t]);var n=rt.grid.minBorderMargin;if(null==n)for(n=0,t=0;t<ot.length;++t)n=Math.max(n,ot[t].points.radius+ot[t].points.lineWidth/2);for(var s in ft)ft[s]+=rt.grid.borderWidth,ft[s]=Math.max(n,ft[s])}vt=mt-ft.left-ft.right,yt=gt-ft.bottom-ft.top,e.each(i,function(e,t){k(t)}),rt.grid.show&&(e.each(allocatedAxes,function(e,t){S(t)}),H()),$()}function O(e){var t=e.options,i=+(null!=t.min?t.min:e.datamin),n=+(null!=t.max?t.max:e.datamax),s=n-i;if(0==s){var o=0==n?1:.01;null==t.min&&(i-=o),(null==t.max||null!=t.min)&&(n+=o)}else{var r=t.autoscaleMargin;null!=r&&(null==t.min&&(i-=s*r,0>i&&null!=e.datamin&&e.datamin>=0&&(i=0)),null==t.max&&(n+=s*r,n>0&&null!=e.datamax&&e.datamax<=0&&(n=0)))}e.min=i,e.max=n}function P(t){var i,s=t.options;i="number"==typeof s.ticks&&s.ticks>0?s.ticks:.3*Math.sqrt("x"==t.direction?mt:gt);var o,r,a,l,u,c,h,d=(t.max-t.min)/i;if("time"==s.mode){var p={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,year:1e3*525949.2*60},f=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]],m=0;null!=s.minTickSize&&(m="number"==typeof s.tickSize?s.tickSize:s.minTickSize[0]*p[s.minTickSize[1]]);for(var u=0;u<f.length-1&&!(d<(f[u][0]*p[f[u][1]]+f[u+1][0]*p[f[u+1][1]])/2&&f[u][0]*p[f[u][1]]>=m);++u);o=f[u][0],a=f[u][1],"year"==a&&(c=Math.pow(10,Math.floor(Math.log(d/p.year)/Math.LN10)),h=d/p.year/c,o=1.5>h?1:3>h?2:7.5>h?5:10,o*=c),t.tickSize=s.tickSize||[o,a],r=function(e){var t=[],i=e.tickSize[0],s=e.tickSize[1],o=new Date(e.min),r=i*p[s];"second"==s&&o.setUTCSeconds(n(o.getUTCSeconds(),i)),"minute"==s&&o.setUTCMinutes(n(o.getUTCMinutes(),i)),"hour"==s&&o.setUTCHours(n(o.getUTCHours(),i)),"month"==s&&o.setUTCMonth(n(o.getUTCMonth(),i)),"year"==s&&o.setUTCFullYear(n(o.getUTCFullYear(),i)),o.setUTCMilliseconds(0),r>=p.minute&&o.setUTCSeconds(0),r>=p.hour&&o.setUTCMinutes(0),r>=p.day&&o.setUTCHours(0),r>=4*p.day&&o.setUTCDate(1),r>=p.year&&o.setUTCMonth(0);var a,l=0,u=Number.NaN;do if(a=u,u=o.getTime(),t.push(u),"month"==s)if(1>i){o.setUTCDate(1);var c=o.getTime();o.setUTCMonth(o.getUTCMonth()+1);var h=o.getTime();o.setTime(u+l*p.hour+(h-c)*i),l=o.getUTCHours(),o.setUTCHours(0)}else o.setUTCMonth(o.getUTCMonth()+i);else"year"==s?o.setUTCFullYear(o.getUTCFullYear()+i):o.setTime(u+r);while(u<e.max&&u!=a);return t},l=function(t,i){var n=new Date(t);if(null!=s.timeformat)return e.plot.formatDate(n,s.timeformat,s.monthNames);var o=i.tickSize[0]*p[i.tickSize[1]],r=i.max-i.min,a=s.twelveHourClock?" %p":"";return fmt=o<p.minute?"%h:%M:%S"+a:o<p.day?r<2*p.day?"%h:%M"+a:"%b %d %h:%M"+a:o<p.month?"%b %d":o<p.year?r<p.year?"%b":"%b %y":"%y",e.plot.formatDate(n,fmt,s.monthNames)}}else{var g=s.tickDecimals,v=-Math.floor(Math.log(d)/Math.LN10);null!=g&&v>g&&(v=g),c=Math.pow(10,-v),h=d/c,1.5>h?o=1:3>h?(o=2,h>2.25&&(null==g||g>=v+1)&&(o=2.5,++v)):o=7.5>h?5:10,o*=c,null!=s.minTickSize&&o<s.minTickSize&&(o=s.minTickSize),t.tickDecimals=Math.max(0,null!=g?g:v),t.tickSize=s.tickSize||o,r=function(e){var t,i=[],s=n(e.min,e.tickSize),o=0,r=Number.NaN;do t=r,r=s+o*e.tickSize,i.push(r),++o;while(r<e.max&&r!=t);return i},l=function(e,t){return e.toFixed(t.tickDecimals)}}if(null!=s.alignTicksWithAxis){var y=("x"==t.direction?dt:pt)[s.alignTicksWithAxis-1];if(y&&y.used&&y!=t){var b=r(t);if(b.length>0&&(null==s.min&&(t.min=Math.min(t.min,b[0])),null==s.max&&b.length>1&&(t.max=Math.max(t.max,b[b.length-1]))),r=function(e){var t,i,n=[];for(i=0;i<y.ticks.length;++i)t=(y.ticks[i].v-y.min)/(y.max-y.min),t=e.min+t*(e.max-e.min),n.push(t);return n},"time"!=t.mode&&null==s.tickDecimals){var _=Math.max(0,-Math.floor(Math.log(d)/Math.LN10)+1),w=r(t);w.length>1&&/\..*0$/.test((w[1]-w[0]).toFixed(_))||(t.tickDecimals=_)}}}t.tickGenerator=r,t.tickFormatter=e.isFunction(s.tickFormatter)?function(e,t){return""+s.tickFormatter(e,t)}:l}function I(t){var i=t.options.ticks,n=[];null==i||"number"==typeof i&&i>0?n=t.tickGenerator(t):i&&(n=e.isFunction(i)?i({min:t.min,max:t.max}):i);var s,o;for(t.ticks=[],s=0;s<n.length;++s){var r=null,a=n[s];"object"==typeof a?(o=+a[0],a.length>1&&(r=a[1])):o=+a,null==r&&(r=t.tickFormatter(o,t)),isNaN(o)||t.ticks.push({v:o,label:r})}}function M(e,t){e.options.autoscaleMargin&&t.length>0&&(null==e.options.min&&(e.min=Math.min(e.min,t[0].v)),null==e.options.max&&t.length>1&&(e.max=Math.max(e.max,t[t.length-1].v)))}function A(){ct.clearRect(0,0,mt,gt);var e=rt.grid;e.show&&e.backgroundColor&&B(),e.show&&!e.aboveData&&F();for(var t=0;t<ot.length;++t)a(bt.drawSeries,[ct,ot[t]]),R(ot[t]);a(bt.draw,[ct]),e.show&&e.aboveData&&F()}function N(e,t){var n,s,o,r,a=p();for(i=0;i<a.length;++i)if(n=a[i],n.direction==t&&(r=t+n.n+"axis",e[r]||1!=n.n||(r=t+"axis"),e[r])){s=e[r].from,o=e[r].to;break}if(e[r]||(n="x"==t?dt[0]:pt[0],s=e[t+"1"],o=e[t+"2"]),null!=s&&null!=o&&s>o){var l=s;s=o,o=l}return{from:s,to:o,axis:n}}function B(){ct.save(),ct.translate(ft.left,ft.top),ct.fillStyle=st(rt.grid.backgroundColor,yt,0,"rgba(255, 255, 255, 0)"),ct.fillRect(0,0,vt,yt),ct.restore()}function F(){var t;ct.save(),ct.translate(ft.left,ft.top);var i=rt.grid.markings;if(i){if(e.isFunction(i)){var n=_t.getAxes();n.xmin=n.xaxis.min,n.xmax=n.xaxis.max,n.ymin=n.yaxis.min,n.ymax=n.yaxis.max,i=i(n)}for(t=0;t<i.length;++t){var s=i[t],o=N(s,"x"),r=N(s,"y");null==o.from&&(o.from=o.axis.min),null==o.to&&(o.to=o.axis.max),null==r.from&&(r.from=r.axis.min),null==r.to&&(r.to=r.axis.max),o.to<o.axis.min||o.from>o.axis.max||r.to<r.axis.min||r.from>r.axis.max||(o.from=Math.max(o.from,o.axis.min),o.to=Math.min(o.to,o.axis.max),r.from=Math.max(r.from,r.axis.min),r.to=Math.min(r.to,r.axis.max),(o.from!=o.to||r.from!=r.to)&&(o.from=o.axis.p2c(o.from),o.to=o.axis.p2c(o.to),r.from=r.axis.p2c(r.from),r.to=r.axis.p2c(r.to),o.from==o.to||r.from==r.to?(ct.beginPath(),ct.strokeStyle=s.color||rt.grid.markingsColor,ct.lineWidth=s.lineWidth||rt.grid.markingsLineWidth,ct.moveTo(o.from,r.from),ct.lineTo(o.to,r.to),ct.stroke()):(ct.fillStyle=s.color||rt.grid.markingsColor,ct.fillRect(o.from,r.to,o.to-o.from,r.from-r.to))))}}for(var n=p(),a=rt.grid.borderWidth,l=0;l<n.length;++l){var u,c,h,d,f=n[l],m=f.box,g=f.tickLength;if(f.show&&0!=f.ticks.length){for(ct.strokeStyle=f.options.tickColor||e.color.parse(f.options.color).scale("a",.22).toString(),ct.lineWidth=1,"x"==f.direction?(u=0,c="full"==g?"top"==f.position?0:yt:m.top-ft.top+("top"==f.position?m.height:0)):(c=0,u="full"==g?"left"==f.position?0:vt:m.left-ft.left+("left"==f.position?m.width:0)),f.innermost||(ct.beginPath(),h=d=0,"x"==f.direction?h=vt:d=yt,1==ct.lineWidth&&(u=Math.floor(u)+.5,c=Math.floor(c)+.5),ct.moveTo(u,c),ct.lineTo(u+h,c+d),ct.stroke()),ct.beginPath(),t=0;t<f.ticks.length;++t){var v=f.ticks[t].v;h=d=0,v<f.min||v>f.max||"full"==g&&a>0&&(v==f.min||v==f.max)||("x"==f.direction?(u=f.p2c(v),d="full"==g?-yt:g,"top"==f.position&&(d=-d)):(c=f.p2c(v),h="full"==g?-vt:g,"left"==f.position&&(h=-h)),1==ct.lineWidth&&("x"==f.direction?u=Math.floor(u)+.5:c=Math.floor(c)+.5),ct.moveTo(u,c),ct.lineTo(u+h,c+d))}ct.stroke()}}a&&(ct.lineWidth=a,ct.strokeStyle=rt.grid.borderColor,ct.strokeRect(-a/2,-a/2,vt+a,yt+a)),ct.restore()}function H(){t.find(".tickLabels").remove();for(var e=['<div class="tickLabels" style="font-size:smaller">'],i=p(),n=0;n<i.length;++n){var s=i[n],o=s.box;if(s.show){e.push('<div class="'+s.direction+"Axis "+s.direction+s.n+'Axis" style="color:'+s.options.color+'">');for(var r=0;r<s.ticks.length;++r){var a=s.ticks[r];if(!(!a.label||a.v<s.min||a.v>s.max)){var l,u={};"x"==s.direction?(l="center",u.left=Math.round(ft.left+s.p2c(a.v)-s.labelWidth/2),"bottom"==s.position?u.top=o.top+o.padding:u.bottom=gt-(o.top+o.height-o.padding)):(u.top=Math.round(ft.top+s.p2c(a.v)-s.labelHeight/2),"left"==s.position?(u.right=mt-(o.left+o.width-o.padding),l="right"):(u.left=o.left+o.padding,l="left")),u.width=s.labelWidth;var c=["position:absolute","text-align:"+l];for(var h in u)c.push(h+":"+u[h]+"px");e.push('<div class="tickLabel" style="'+c.join(";")+'">'+a.label+"</div>")}}e.push("</div>")}}e.push("</div>"),t.append(e.join(""))}function R(e){e.lines.show&&L(e),e.bars.show&&U(e),e.points.show&&z(e)}function L(e){function t(e,t,i,n,s){var o=e.points,r=e.pointsize,a=null,l=null;ct.beginPath();for(var u=r;u<o.length;u+=r){var c=o[u-r],h=o[u-r+1],d=o[u],p=o[u+1];if(null!=c&&null!=d){if(p>=h&&h<s.min){if(p<s.min)continue;c=(s.min-h)/(p-h)*(d-c)+c,h=s.min}else if(h>=p&&p<s.min){if(h<s.min)continue;d=(s.min-h)/(p-h)*(d-c)+c,p=s.min}if(h>=p&&h>s.max){if(p>s.max)continue;c=(s.max-h)/(p-h)*(d-c)+c,h=s.max}else if(p>=h&&p>s.max){if(h>s.max)continue;d=(s.max-h)/(p-h)*(d-c)+c,p=s.max}if(d>=c&&c<n.min){if(d<n.min)continue;h=(n.min-c)/(d-c)*(p-h)+h,c=n.min}else if(c>=d&&d<n.min){if(c<n.min)continue;p=(n.min-c)/(d-c)*(p-h)+h,d=n.min}if(c>=d&&c>n.max){if(d>n.max)continue;h=(n.max-c)/(d-c)*(p-h)+h,c=n.max}else if(d>=c&&d>n.max){if(c>n.max)continue;p=(n.max-c)/(d-c)*(p-h)+h,d=n.max}(c!=a||h!=l)&&ct.moveTo(n.p2c(c)+t,s.p2c(h)+i),a=d,l=p,ct.lineTo(n.p2c(d)+t,s.p2c(p)+i)}}ct.stroke()}function i(e,t,i){for(var n=e.points,s=e.pointsize,o=Math.min(Math.max(0,i.min),i.max),r=0,a=!1,l=1,u=0,c=0;;){if(s>0&&r>n.length+s)break;r+=s;var h=n[r-s],d=n[r-s+l],p=n[r],f=n[r+l];if(a){if(s>0&&null!=h&&null==p){c=r,s=-s,l=2;continue}if(0>s&&r==u+s){ct.fill(),a=!1,s=-s,l=1,r=u=c+s;continue}}if(null!=h&&null!=p){if(p>=h&&h<t.min){if(p<t.min)continue;d=(t.min-h)/(p-h)*(f-d)+d,h=t.min}else if(h>=p&&p<t.min){if(h<t.min)continue;f=(t.min-h)/(p-h)*(f-d)+d,p=t.min}if(h>=p&&h>t.max){if(p>t.max)continue;d=(t.max-h)/(p-h)*(f-d)+d,h=t.max}else if(p>=h&&p>t.max){if(h>t.max)continue;f=(t.max-h)/(p-h)*(f-d)+d,p=t.max}if(a||(ct.beginPath(),ct.moveTo(t.p2c(h),i.p2c(o)),a=!0),d>=i.max&&f>=i.max)ct.lineTo(t.p2c(h),i.p2c(i.max)),ct.lineTo(t.p2c(p),i.p2c(i.max));else if(d<=i.min&&f<=i.min)ct.lineTo(t.p2c(h),i.p2c(i.min)),ct.lineTo(t.p2c(p),i.p2c(i.min));else{var m=h,g=p;f>=d&&d<i.min&&f>=i.min?(h=(i.min-d)/(f-d)*(p-h)+h,d=i.min):d>=f&&f<i.min&&d>=i.min&&(p=(i.min-d)/(f-d)*(p-h)+h,f=i.min),d>=f&&d>i.max&&f<=i.max?(h=(i.max-d)/(f-d)*(p-h)+h,d=i.max):f>=d&&f>i.max&&d<=i.max&&(p=(i.max-d)/(f-d)*(p-h)+h,f=i.max),h!=m&&ct.lineTo(t.p2c(m),i.p2c(d)),ct.lineTo(t.p2c(h),i.p2c(d)),ct.lineTo(t.p2c(p),i.p2c(f)),p!=g&&(ct.lineTo(t.p2c(p),i.p2c(f)),ct.lineTo(t.p2c(g),i.p2c(f)))}}}}ct.save(),ct.translate(ft.left,ft.top),ct.lineJoin="round";var n=e.lines.lineWidth,s=e.shadowSize;if(n>0&&s>0){ct.lineWidth=s,ct.strokeStyle="rgba(0,0,0,0.1)";var o=Math.PI/18;t(e.datapoints,Math.sin(o)*(n/2+s/2),Math.cos(o)*(n/2+s/2),e.xaxis,e.yaxis),ct.lineWidth=s/2,t(e.datapoints,Math.sin(o)*(n/2+s/4),Math.cos(o)*(n/2+s/4),e.xaxis,e.yaxis)}ct.lineWidth=n,ct.strokeStyle=e.color;var r=Q(e.lines,e.color,0,yt);r&&(ct.fillStyle=r,i(e.datapoints,e.xaxis,e.yaxis)),n>0&&t(e.datapoints,0,0,e.xaxis,e.yaxis),ct.restore()}function z(e){function t(e,t,i,n,s,o,r,a){for(var l=e.points,u=e.pointsize,c=0;c<l.length;c+=u){var h=l[c],d=l[c+1];null==h||h<o.min||h>o.max||d<r.min||d>r.max||(ct.beginPath(),h=o.p2c(h),d=r.p2c(d)+n,"circle"==a?ct.arc(h,d,t,0,s?Math.PI:2*Math.PI,!1):a(ct,h,d,t,s),ct.closePath(),i&&(ct.fillStyle=i,ct.fill()),ct.stroke())}}ct.save(),ct.translate(ft.left,ft.top);var i=e.points.lineWidth,n=e.shadowSize,s=e.points.radius,o=e.points.symbol;if(i>0&&n>0){var r=n/2;ct.lineWidth=r,ct.strokeStyle="rgba(0,0,0,0.1)",t(e.datapoints,s,null,r+r/2,!0,e.xaxis,e.yaxis,o),ct.strokeStyle="rgba(0,0,0,0.2)",t(e.datapoints,s,null,r/2,!0,e.xaxis,e.yaxis,o)}ct.lineWidth=i,ct.strokeStyle=e.color,t(e.datapoints,s,Q(e.points,e.color),0,!1,e.xaxis,e.yaxis,o),ct.restore()}function W(e,t,i,n,s,o,r,a,l,u,c,h){var d,p,f,m,g,v,y,b,_;c?(b=v=y=!0,g=!1,d=i,p=e,m=t+n,f=t+s,d>p&&(_=p,p=d,d=_,g=!0,v=!1)):(g=v=y=!0,b=!1,d=e+n,p=e+s,f=i,m=t,f>m&&(_=m,m=f,f=_,b=!0,y=!1)),p<a.min||d>a.max||m<l.min||f>l.max||(d<a.min&&(d=a.min,g=!1),p>a.max&&(p=a.max,v=!1),f<l.min&&(f=l.min,b=!1),m>l.max&&(m=l.max,y=!1),d=a.p2c(d),f=l.p2c(f),p=a.p2c(p),m=l.p2c(m),r&&(u.beginPath(),u.moveTo(d,f),u.lineTo(d,m),u.lineTo(p,m),u.lineTo(p,f),u.fillStyle=r(f,m),u.fill()),h>0&&(g||v||y||b)&&(u.beginPath(),u.moveTo(d,f+o),g?u.lineTo(d,m+o):u.moveTo(d,m+o),y?u.lineTo(p,m+o):u.moveTo(p,m+o),v?u.lineTo(p,f+o):u.moveTo(p,f+o),b?u.lineTo(d,f+o):u.moveTo(d,f+o),u.stroke()))}function U(e){function t(t,i,n,s,o,r,a){for(var l=t.points,u=t.pointsize,c=0;c<l.length;c+=u)null!=l[c]&&W(l[c],l[c+1],l[c+2],i,n,s,o,r,a,ct,e.bars.horizontal,e.bars.lineWidth)}ct.save(),ct.translate(ft.left,ft.top),ct.lineWidth=e.bars.lineWidth,ct.strokeStyle=e.color;var i="left"==e.bars.align?0:-e.bars.barWidth/2,n=e.bars.fill?function(t,i){return Q(e.bars,e.color,t,i)}:null;t(e.datapoints,i,i+e.bars.barWidth,0,n,e.xaxis,e.yaxis),ct.restore()}function Q(t,i,n,s){var o=t.fill;if(!o)return null;if(t.fillColor)return st(t.fillColor,n,s,i);var r=e.color.parse(i);return r.a="number"==typeof o?o:.4,r.normalize(),r.toString()}function $(){if(t.find(".legend").remove(),rt.legend.show){for(var i,n,s=[],o=!1,r=rt.legend.labelFormatter,a=0;a<ot.length;++a)i=ot[a],n=i.label,n&&(0==a%rt.legend.noColumns&&(o&&s.push("</tr>"),s.push("<tr>"),o=!0),r&&(n=r(n,i)),s.push('<td class="legendColorBox"><div style="border:1px solid '+rt.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+i.color+';overflow:hidden"></div></div></td>'+'<td class="legendLabel">'+n+"</td>"));if(o&&s.push("</tr>"),0!=s.length){var l='<table style="font-size:smaller;color:'+rt.grid.color+'">'+s.join("")+"</table>";if(null!=rt.legend.container)e(rt.legend.container).html(l);else{var u="",c=rt.legend.position,h=rt.legend.margin;null==h[0]&&(h=[h,h]),"n"==c.charAt(0)?u+="top:"+(h[1]+ft.top)+"px;":"s"==c.charAt(0)&&(u+="bottom:"+(h[1]+ft.bottom)+"px;"),"e"==c.charAt(1)?u+="right:"+(h[0]+ft.right)+"px;":"w"==c.charAt(1)&&(u+="left:"+(h[0]+ft.left)+"px;");var d=e('<div class="legend">'+l.replace('style="','style="position:absolute;'+u+";")+"</div>").appendTo(t);if(0!=rt.legend.backgroundOpacity){var p=rt.legend.backgroundColor;null==p&&(p=rt.grid.backgroundColor,p=p&&"string"==typeof p?e.color.parse(p):e.color.extract(d,"background-color"),p.a=1,p=p.toString());var f=d.children();e('<div style="position:absolute;width:'+f.width()+"px;height:"+f.height()+"px;"+u+"background-color:"+p+';"> </div>').prependTo(d).css("opacity",rt.legend.backgroundOpacity)}}}}}function q(e,t,i){var n,s,o=rt.grid.mouseActiveRadius,r=o*o+1,a=null;for(n=ot.length-1;n>=0;--n)if(i(ot[n])){var l=ot[n],u=l.xaxis,c=l.yaxis,h=l.datapoints.points,d=l.datapoints.pointsize,p=u.c2p(e),f=c.c2p(t),m=o/u.scale,g=o/c.scale;if(u.options.inverseTransform&&(m=Number.MAX_VALUE),c.options.inverseTransform&&(g=Number.MAX_VALUE),l.lines.show||l.points.show)for(s=0;s<h.length;s+=d){var v=h[s],y=h[s+1];if(null!=v&&!(v-p>m||-m>v-p||y-f>g||-g>y-f)){var b=Math.abs(u.p2c(v)-e),_=Math.abs(c.p2c(y)-t),w=b*b+_*_;r>w&&(r=w,a=[n,s/d])}}if(l.bars.show&&!a){var x="left"==l.bars.align?0:-l.bars.barWidth/2,T=x+l.bars.barWidth;for(s=0;s<h.length;s+=d){var v=h[s],y=h[s+1],E=h[s+2];null!=v&&(ot[n].bars.horizontal?p<=Math.max(E,v)&&p>=Math.min(E,v)&&f>=y+x&&y+T>=f:p>=v+x&&v+T>=p&&f>=Math.min(E,y)&&f<=Math.max(E,y))&&(a=[n,s/d])}}}return a?(n=a[0],s=a[1],d=ot[n].datapoints.pointsize,{datapoint:ot[n].datapoints.points.slice(s*d,(s+1)*d),dataIndex:s,series:ot[n],seriesIndex:n}):null}function Y(e){rt.grid.hoverable&&G("plothover",e,function(e){return 0!=e.hoverable})}function V(e){rt.grid.hoverable&&G("plothover",e,function(){return!1})}function K(e){G("plotclick",e,function(e){return 0!=e.clickable})}function G(e,i,n){var s=ut.offset(),o=i.pageX-s.left-ft.left,r=i.pageY-s.top-ft.top,a=f({left:o,top:r});a.pageX=i.pageX,a.pageY=i.pageY;var l=q(o,r,n);if(l&&(l.pageX=parseInt(l.series.xaxis.p2c(l.datapoint[0])+s.left+ft.left),l.pageY=parseInt(l.series.yaxis.p2c(l.datapoint[1])+s.top+ft.top)),rt.grid.autoHighlight){for(var u=0;u<wt.length;++u){var c=wt[u];c.auto!=e||l&&c.series==l.series&&c.point[0]==l.datapoint[0]&&c.point[1]==l.datapoint[1]||et(c.series,c.point)}l&&J(l.series,l.datapoint,e)}t.trigger(e,[a,l])}function X(){xt||(xt=setTimeout(Z,30))
}function Z(){xt=null,ht.save(),ht.clearRect(0,0,mt,gt),ht.translate(ft.left,ft.top);var e,t;for(e=0;e<wt.length;++e)t=wt[e],t.series.bars.show?nt(t.series,t.point):it(t.series,t.point);ht.restore(),a(bt.drawOverlay,[ht])}function J(e,t,i){if("number"==typeof e&&(e=ot[e]),"number"==typeof t){var n=e.datapoints.pointsize;t=e.datapoints.points.slice(n*t,n*(t+1))}var s=tt(e,t);-1==s?(wt.push({series:e,point:t,auto:i}),X()):i||(wt[s].auto=!1)}function et(e,t){null==e&&null==t&&(wt=[],X()),"number"==typeof e&&(e=ot[e]),"number"==typeof t&&(t=e.data[t]);var i=tt(e,t);-1!=i&&(wt.splice(i,1),X())}function tt(e,t){for(var i=0;i<wt.length;++i){var n=wt[i];if(n.series==e&&n.point[0]==t[0]&&n.point[1]==t[1])return i}return-1}function it(t,i){var n=i[0],s=i[1],o=t.xaxis,r=t.yaxis;if(!(n<o.min||n>o.max||s<r.min||s>r.max)){var a=t.points.radius+t.points.lineWidth/2;ht.lineWidth=a,ht.strokeStyle=e.color.parse(t.color).scale("a",.5).toString();var l=1.5*a,n=o.p2c(n),s=r.p2c(s);ht.beginPath(),"circle"==t.points.symbol?ht.arc(n,s,l,0,2*Math.PI,!1):t.points.symbol(ht,n,s,l,!1),ht.closePath(),ht.stroke()}}function nt(t,i){ht.lineWidth=t.bars.lineWidth,ht.strokeStyle=e.color.parse(t.color).scale("a",.5).toString();var n=e.color.parse(t.color).scale("a",.5).toString(),s="left"==t.bars.align?0:-t.bars.barWidth/2;W(i[0],i[1],i[2]||0,s,s+t.bars.barWidth,0,function(){return n},t.xaxis,t.yaxis,ht,t.bars.horizontal,t.bars.lineWidth)}function st(t,i,n,s){if("string"==typeof t)return t;for(var o=ct.createLinearGradient(0,n,0,i),r=0,a=t.colors.length;a>r;++r){var l=t.colors[r];if("string"!=typeof l){var u=e.color.parse(s);null!=l.brightness&&(u=u.scale("rgb",l.brightness)),null!=l.opacity&&(u.a*=l.opacity),l=u.toString()}o.addColorStop(r/(a-1),l)}return o}var ot=[],rt={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85},xaxis:{show:null,position:"bottom",mode:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:!1},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1},shadowSize:3},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},hooks:{}},at=null,lt=null,ut=null,ct=null,ht=null,dt=[],pt=[],ft={left:0,right:0,top:0,bottom:0},mt=0,gt=0,vt=0,yt=0,bt={processOptions:[],processRawData:[],processDatapoints:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},_t=this;_t.setData=c,_t.setupGrid=D,_t.draw=A,_t.getPlaceholder=function(){return t},_t.getCanvas=function(){return at},_t.getPlotOffset=function(){return ft},_t.width=function(){return vt},_t.height=function(){return yt},_t.offset=function(){var e=ut.offset();return e.left+=ft.left,e.top+=ft.top,e},_t.getData=function(){return ot},_t.getAxes=function(){var t={};return e.each(dt.concat(pt),function(e,i){i&&(t[i.direction+(1!=i.n?i.n:"")+"axis"]=i)}),t},_t.getXAxes=function(){return dt},_t.getYAxes=function(){return pt},_t.c2p=f,_t.p2c=m,_t.getOptions=function(){return rt},_t.highlight=J,_t.unhighlight=et,_t.triggerRedrawOverlay=X,_t.pointOffset=function(e){return{left:parseInt(dt[d(e,"x")-1].p2c(+e.x)+ft.left),top:parseInt(pt[d(e,"y")-1].p2c(+e.y)+ft.top)}},_t.shutdown=E,_t.resize=function(){_(),w(at),w(lt)},_t.hooks=bt,l(_t),u(o),x(),c(s),D(),A(),T();var wt=[],xt=null}function n(e,t){return t*Math.floor(e/t)}e.plot=function(i,n,s){var o=new t(e(i),n,s,e.plot.plugins);return o},e.plot.version="0.7",e.plot.plugins=[],e.plot.formatDate=function(e,t,i){var n=function(e){return e=""+e,1==e.length?"0"+e:e},s=[],o=!1,r=!1,a=e.getUTCHours(),l=12>a;null==i&&(i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),-1!=t.search(/%p|%P/)&&(a>12?a-=12:0==a&&(a=12));for(var u=0;u<t.length;++u){var c=t.charAt(u);if(o){switch(c){case"h":c=""+a;break;case"H":c=n(a);break;case"M":c=n(e.getUTCMinutes());break;case"S":c=n(e.getUTCSeconds());break;case"d":c=""+e.getUTCDate();break;case"m":c=""+(e.getUTCMonth()+1);break;case"y":c=""+e.getUTCFullYear();break;case"b":c=""+i[e.getUTCMonth()];break;case"p":c=l?"am":"pm";break;case"P":c=l?"AM":"PM";break;case"0":c="",r=!0}c&&r&&(c=n(c),r=!1),s.push(c),r||(o=!1)}else"%"==c?o=!0:s.push(c)}return s.join("")}}(jQuery),// Copyright 2006 Google Inc.
document.createElement("canvas").getContext||function(){function e(){return this.context_||(this.context_=new x(this))}function t(e,t){var i=z.call(arguments,2);return function(){return e.apply(t,i.concat(z.call(arguments)))}}function i(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function n(e){if(e.namespaces.g_vml_||e.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML"),e.namespaces.g_o_||e.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML"),!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function o(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function r(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function a(){return[[1,0,0],[0,1,0],[0,0,1]]}function u(e,t){for(var i=a(),n=0;3>n;n++)for(var s=0;3>s;s++){for(var o=0,r=0;3>r;r++)o+=e[n][r]*t[r][s];i[n][s]=o}return i}function c(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function d(e){var t=e.indexOf("(",3),i=e.indexOf(")",t+1),n=e.substring(t+1,i).split(",");return 4==n.length&&"a"==e.substr(3,1)?alpha=Number(n[3]):n[3]=1,n}function p(e){return parseFloat(e)/100}function f(e,t,i){return Math.min(i,Math.max(t,e))}function m(e){var t,i,n;if(h=parseFloat(e[0])/360%360,0>h&&h++,s=f(p(e[1]),0,1),l=f(p(e[2]),0,1),0==s)t=i=n=l;else{var o=.5>l?l*(1+s):l+s-l*s,r=2*l-o;t=g(r,o,h+1/3),i=g(r,o,h),n=g(r,o,h-1/3)}return"#"+U[Math.floor(255*t)]+U[Math.floor(255*i)]+U[Math.floor(255*n)]}function g(e,t,i){return 0>i&&i++,i>1&&i--,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}function v(e){var t,i=1;if(e=String(e),"#"==e.charAt(0))t=e;else if(/^rgb/.test(e)){for(var n,s=d(e),t="#",o=0;3>o;o++)n=-1!=s[o].indexOf("%")?Math.floor(255*p(s[o])):Number(s[o]),t+=U[f(n,0,255)];i=s[3]}else if(/^hsl/.test(e)){var s=d(e);t=m(s),i=s[3]}else t=q[e]||e;return{color:t,alpha:i}}function y(e){if(V[e])return V[e];var t=document.createElement("div"),i=t.style;try{i.font=e}catch(n){}return V[e]={style:i.fontStyle||Y.style,variant:i.fontVariant||Y.variant,weight:i.fontWeight||Y.weight,size:i.fontSize||Y.size,family:i.fontFamily||Y.family}}function b(e,t){var i={};for(var n in e)i[n]=e[n];var s=parseFloat(t.currentStyle.fontSize),o=parseFloat(e.size);return i.size="number"==typeof e.size?e.size:-1!=e.size.indexOf("px")?o:-1!=e.size.indexOf("em")?s*o:-1!=e.size.indexOf("%")?s/100*o:-1!=e.size.indexOf("pt")?o/.75:s,i.size*=.981,i}function _(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function w(e){switch(e){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function x(e){this.m_=a(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=1*R,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t=e.ownerDocument.createElement("div");t.style.width=e.clientWidth+"px",t.style.height=e.clientHeight+"px",t.style.overflow="hidden",t.style.position="absolute",e.appendChild(t),this.element_=t,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function T(e,t,i,n){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:i.x,cp2y:i.y,x:n.x,y:n.y}),e.currentX_=n.x,e.currentY_=n.y}function E(e,t){var i=v(e.strokeStyle),n=i.color,s=i.alpha*e.globalAlpha,o=e.lineScale_*e.lineWidth;1>o&&(s*=o),t.push("<g_vml_:stroke",' opacity="',s,'"',' joinstyle="',e.lineJoin,'"',' miterlimit="',e.miterLimit,'"',' endcap="',w(e.lineCap),'"',' weight="',o,'px"',' color="',n,'" />')}function k(e,t,i,n){var s=e.fillStyle,o=e.arcScaleX_,r=e.arcScaleY_,a=n.x-i.x,l=n.y-i.y;if(s instanceof S){var u=0,c={x:0,y:0},h=0,d=1;if("gradient"==s.type_){var p=s.x0_/o,f=s.y0_/r,m=s.x1_/o,g=s.y1_/r,y=e.getCoords_(p,f),b=e.getCoords_(m,g),_=b.x-y.x,w=b.y-y.y;u=180*Math.atan2(_,w)/Math.PI,0>u&&(u+=360),1e-6>u&&(u=0)}else{var y=e.getCoords_(s.x0_,s.y0_);c={x:(y.x-i.x)/a,y:(y.y-i.y)/l},a/=o*R,l/=r*R;var x=M.max(a,l);h=2*s.r0_/x,d=2*s.r1_/x-h}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});for(var E=T.length,k=T[0].color,C=T[E-1].color,j=T[0].alpha*e.globalAlpha,O=T[E-1].alpha*e.globalAlpha,P=[],I=0;E>I;I++){var A=T[I];P.push(A.offset*d+h+" "+A.color)}t.push('<g_vml_:fill type="',s.type_,'"',' method="none" focus="100%"',' color="',k,'"',' color2="',C,'"',' colors="',P.join(","),'"',' opacity="',O,'"',' g_o_:opacity2="',j,'"',' angle="',u,'"',' focusposition="',c.x,",",c.y,'" />')}else if(s instanceof D){if(a&&l){var N=-i.x,B=-i.y;t.push("<g_vml_:fill",' position="',N/a*o*o,",",B/l*r*r,'"',' type="tile"',' src="',s.src_,'" />')}}else{var F=v(e.fillStyle),H=F.color,L=F.alpha*e.globalAlpha;t.push('<g_vml_:fill color="',H,'" opacity="',L,'" />')}}function C(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function j(e,t,i){if(C(t)&&(e.m_=t,i)){var n=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=H(F(n))}}function S(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function D(e,t){switch(P(e),t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:O("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function O(e){throw new I(e)}function P(e){e&&1==e.nodeType&&"IMG"==e.tagName||O("TYPE_MISMATCH_ERR"),"complete"!=e.readyState&&O("INVALID_STATE_ERR")}function I(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var M=Math,A=M.round,N=M.sin,B=M.cos,F=M.abs,H=M.sqrt,R=10,L=R/2,z=Array.prototype.slice;n(document);var W={init:function(e){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var i=e||document;i.createElement("canvas"),i.attachEvent("onreadystatechange",t(this.init_,this,i))}},init_:function(e){for(var t=e.getElementsByTagName("canvas"),i=0;i<t.length;i++)this.initElement(t[i])},initElement:function(t){if(!t.getContext){t.getContext=e,n(t.ownerDocument),t.innerHTML="",t.attachEvent("onpropertychange",o),t.attachEvent("onresize",r);var i=t.attributes;i.width&&i.width.specified?t.style.width=i.width.nodeValue+"px":t.width=t.clientWidth,i.height&&i.height.specified?t.style.height=i.height.nodeValue+"px":t.height=t.clientHeight}return t}};W.init();for(var U=[],Q=0;16>Q;Q++)for(var $=0;16>$;$++)U[16*Q+$]=Q.toString(16)+$.toString(16);var q={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},Y={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"},V={},K=x.prototype;K.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},K.beginPath=function(){this.currentPath_=[]},K.moveTo=function(e,t){var i=this.getCoords_(e,t);this.currentPath_.push({type:"moveTo",x:i.x,y:i.y}),this.currentX_=i.x,this.currentY_=i.y},K.lineTo=function(e,t){var i=this.getCoords_(e,t);this.currentPath_.push({type:"lineTo",x:i.x,y:i.y}),this.currentX_=i.x,this.currentY_=i.y},K.bezierCurveTo=function(e,t,i,n,s,o){var r=this.getCoords_(s,o),a=this.getCoords_(e,t),l=this.getCoords_(i,n);T(this,a,l,r)},K.quadraticCurveTo=function(e,t,i,n){var s=this.getCoords_(e,t),o=this.getCoords_(i,n),r={x:this.currentX_+2/3*(s.x-this.currentX_),y:this.currentY_+2/3*(s.y-this.currentY_)},a={x:r.x+(o.x-this.currentX_)/3,y:r.y+(o.y-this.currentY_)/3};T(this,r,a,o)},K.arc=function(e,t,i,n,s,o){i*=R;var r=o?"at":"wa",a=e+B(n)*i-L,l=t+N(n)*i-L,u=e+B(s)*i-L,c=t+N(s)*i-L;a!=u||o||(a+=.125);var h=this.getCoords_(e,t),d=this.getCoords_(a,l),p=this.getCoords_(u,c);this.currentPath_.push({type:r,x:h.x,y:h.y,radius:i,xStart:d.x,yStart:d.y,xEnd:p.x,yEnd:p.y})},K.rect=function(e,t,i,n){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath()},K.strokeRect=function(e,t,i,n){var s=this.currentPath_;this.beginPath(),this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath(),this.stroke(),this.currentPath_=s},K.fillRect=function(e,t,i,n){var s=this.currentPath_;this.beginPath(),this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath(),this.fill(),this.currentPath_=s},K.createLinearGradient=function(e,t,i,n){var s=new S("gradient");return s.x0_=e,s.y0_=t,s.x1_=i,s.y1_=n,s},K.createRadialGradient=function(e,t,i,n,s,o){var r=new S("gradientradial");return r.x0_=e,r.y0_=t,r.r0_=i,r.x1_=n,r.y1_=s,r.r1_=o,r},K.drawImage=function(e){var t,i,n,s,o,r,a,l,u=e.runtimeStyle.width,c=e.runtimeStyle.height;e.runtimeStyle.width="auto",e.runtimeStyle.height="auto";var h=e.width,d=e.height;if(e.runtimeStyle.width=u,e.runtimeStyle.height=c,3==arguments.length)t=arguments[1],i=arguments[2],o=r=0,a=n=h,l=s=d;else if(5==arguments.length)t=arguments[1],i=arguments[2],n=arguments[3],s=arguments[4],o=r=0,a=h,l=d;else{if(9!=arguments.length)throw Error("Invalid number of arguments");o=arguments[1],r=arguments[2],a=arguments[3],l=arguments[4],t=arguments[5],i=arguments[6],n=arguments[7],s=arguments[8]}var p=this.getCoords_(t,i),f=[],m=10,g=10;if(f.push(" <g_vml_:group",' coordsize="',R*m,",",R*g,'"',' coordorigin="0,0"',' style="width:',m,"px;height:",g,"px;position:absolute;"),1!=this.m_[0][0]||this.m_[0][1]||1!=this.m_[1][1]||this.m_[1][0]){var v=[];v.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",A(p.x/R),",","Dy=",A(p.y/R),"");var y=p,b=this.getCoords_(t+n,i),_=this.getCoords_(t,i+s),w=this.getCoords_(t+n,i+s);y.x=M.max(y.x,b.x,_.x,w.x),y.y=M.max(y.y,b.y,_.y,w.y),f.push("padding:0 ",A(y.x/R),"px ",A(y.y/R),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",v.join(""),", sizingmethod='clip');")}else f.push("top:",A(p.y/R),"px;left:",A(p.x/R),"px;");f.push(' ">','<g_vml_:image src="',e.src,'"',' style="width:',R*n,"px;"," height:",R*s,'px"',' cropleft="',o/h,'"',' croptop="',r/d,'"',' cropright="',(h-o-a)/h,'"',' cropbottom="',(d-r-l)/d,'"'," />","</g_vml_:group>"),this.element_.insertAdjacentHTML("BeforeEnd",f.join(""))},K.stroke=function(e){for(var t=10,i=10,n=5e3,s={x:null,y:null},o={x:null,y:null},r=0;r<this.currentPath_.length;r+=n){var a=[];a.push("<g_vml_:shape",' filled="',!!e,'"',' style="position:absolute;width:',t,"px;height:",i,'px;"',' coordorigin="0,0"',' coordsize="',R*t,",",R*i,'"',' stroked="',!e,'"',' path="');for(var l=r;l<Math.min(r+n,this.currentPath_.length);l++){0==l%n&&l>0&&a.push(" m ",A(this.currentPath_[l-1].x),",",A(this.currentPath_[l-1].y));var u,c=this.currentPath_[l];switch(c.type){case"moveTo":u=c,a.push(" m ",A(c.x),",",A(c.y));break;case"lineTo":a.push(" l ",A(c.x),",",A(c.y));break;case"close":a.push(" x "),c=null;break;case"bezierCurveTo":a.push(" c ",A(c.cp1x),",",A(c.cp1y),",",A(c.cp2x),",",A(c.cp2y),",",A(c.x),",",A(c.y));break;case"at":case"wa":a.push(" ",c.type," ",A(c.x-this.arcScaleX_*c.radius),",",A(c.y-this.arcScaleY_*c.radius)," ",A(c.x+this.arcScaleX_*c.radius),",",A(c.y+this.arcScaleY_*c.radius)," ",A(c.xStart),",",A(c.yStart)," ",A(c.xEnd),",",A(c.yEnd))}c&&((null==s.x||c.x<s.x)&&(s.x=c.x),(null==o.x||c.x>o.x)&&(o.x=c.x),(null==s.y||c.y<s.y)&&(s.y=c.y),(null==o.y||c.y>o.y)&&(o.y=c.y))}a.push(' ">'),e?k(this,a,s,o):E(this,a),a.push("</g_vml_:shape>"),this.element_.insertAdjacentHTML("beforeEnd",a.join(""))}},K.fill=function(){this.stroke(!0)},K.closePath=function(){this.currentPath_.push({type:"close"})},K.getCoords_=function(e,t){var i=this.m_;return{x:R*(e*i[0][0]+t*i[1][0]+i[2][0])-L,y:R*(e*i[0][1]+t*i[1][1]+i[2][1])-L}},K.save=function(){var e={};c(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=u(a(),this.m_)},K.restore=function(){this.aStack_.length&&(c(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},K.translate=function(e,t){var i=[[1,0,0],[0,1,0],[e,t,1]];j(this,u(i,this.m_),!1)},K.rotate=function(e){var t=B(e),i=N(e),n=[[t,i,0],[-i,t,0],[0,0,1]];j(this,u(n,this.m_),!1)},K.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var i=[[e,0,0],[0,t,0],[0,0,1]];j(this,u(i,this.m_),!0)},K.transform=function(e,t,i,n,s,o){var r=[[e,t,0],[i,n,0],[s,o,1]];j(this,u(r,this.m_),!0)},K.setTransform=function(e,t,i,n,s,o){var r=[[e,t,0],[i,n,0],[s,o,1]];j(this,r,!0)},K.drawText_=function(e,t,n,s,o){var r=this.m_,a=1e3,l=0,u=a,c={x:0,y:0},h=[],d=b(y(this.font),this.element_),p=_(d),f=this.element_.currentStyle,m=this.textAlign.toLowerCase();switch(m){case"left":case"center":case"right":break;case"end":m="ltr"==f.direction?"right":"left";break;case"start":m="rtl"==f.direction?"right":"left";break;default:m="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(m){case"right":l=a,u=.05;break;case"center":l=u=a/2}var g=this.getCoords_(t+c.x,n+c.y);h.push('<g_vml_:line from="',-l,' 0" to="',u,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!o,'" stroked="',!!o,'" style="position:absolute;width:1px;height:1px;">'),o?E(this,h):k(this,h,{x:-l,y:0},{x:u,y:d.size});var v=r[0][0].toFixed(3)+","+r[1][0].toFixed(3)+","+r[0][1].toFixed(3)+","+r[1][1].toFixed(3)+",0,0",w=A(g.x/R)+","+A(g.y/R);h.push('<g_vml_:skew on="t" matrix="',v,'" ',' offset="',w,'" origin="',l,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',i(e),'" style="v-text-align:',m,";font:",i(p),'" /></g_vml_:line>'),this.element_.insertAdjacentHTML("beforeEnd",h.join(""))},K.fillText=function(e,t,i,n){this.drawText_(e,t,i,n,!1)},K.strokeText=function(e,t,i,n){this.drawText_(e,t,i,n,!0)},K.measureText=function(e){if(!this.textMeasureEl_){var t='<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var i=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(i.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},K.clip=function(){},K.arcTo=function(){},K.createPattern=function(e,t){return new D(e,t)},S.prototype.addColorStop=function(e,t){t=v(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var G=I.prototype=new Error;G.INDEX_SIZE_ERR=1,G.DOMSTRING_SIZE_ERR=2,G.HIERARCHY_REQUEST_ERR=3,G.WRONG_DOCUMENT_ERR=4,G.INVALID_CHARACTER_ERR=5,G.NO_DATA_ALLOWED_ERR=6,G.NO_MODIFICATION_ALLOWED_ERR=7,G.NOT_FOUND_ERR=8,G.NOT_SUPPORTED_ERR=9,G.INUSE_ATTRIBUTE_ERR=10,G.INVALID_STATE_ERR=11,G.SYNTAX_ERR=12,G.INVALID_MODIFICATION_ERR=13,G.NAMESPACE_ERR=14,G.INVALID_ACCESS_ERR=15,G.VALIDATION_ERR=16,G.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=W,CanvasRenderingContext2D=x,CanvasGradient=S,CanvasPattern=D,DOMException=I}(),function($){$.fn.editable=function(e,t){if("disable"==e)return $(this).data("disabled.editable",!0),void 0;if("enable"==e)return $(this).data("disabled.editable",!1),void 0;if("destroy"==e)return $(this).unbind($(this).data("event.editable")).removeData("disabled.editable").removeData("event.editable"),void 0;var i=$.extend({},$.fn.editable.defaults,{target:e},t),n=$.editable.types[i.type].plugin||function(){},s=$.editable.types[i.type].submit||function(){},o=$.editable.types[i.type].buttons||$.editable.types.defaults.buttons,r=$.editable.types[i.type].content||$.editable.types.defaults.content,a=$.editable.types[i.type].element||$.editable.types.defaults.element,l=$.editable.types[i.type].reset||$.editable.types.defaults.reset,u=i.callback||function(){},c=i.onedit||function(){},h=i.onsubmit||function(){},d=i.onreset||function(){},p=i.onerror||l;return i.tooltip&&$(this).attr("title",i.tooltip),i.autowidth="auto"==i.width,i.autoheight="auto"==i.height,this.each(function(){var e=this,t=$(e).width(),f=$(e).height();$(this).data("event.editable",i.event),$.trim($(this).html())||$(this).html(i.placeholder),$(this).bind(i.event,function(d){if(!0!==$(this).data("disabled.editable")&&!e.editing&&!1!==c.apply(this,[i,e])){d.preventDefault(),d.stopPropagation(),i.tooltip&&$(e).removeAttr("title"),0==$(e).width()?(i.width=t,i.height=f):("none"!=i.width&&(i.width=i.autowidth?$(e).width():i.width),"none"!=i.height&&(i.height=i.autoheight?$(e).height():i.height)),$(this).html().toLowerCase().replace(/(;|")/g,"")==i.placeholder.toLowerCase().replace(/(;|")/g,"")&&$(this).html(""),e.editing=!0,e.revert=$(e).html(),$(e).html("");var m=$("<form />");i.cssclass&&("inherit"==i.cssclass?m.attr("class",$(e).attr("class")):m.attr("class",i.cssclass)),i.style&&("inherit"==i.style?(m.attr("style",$(e).attr("style")),m.css("display",$(e).css("display"))):m.attr("style",i.style));var g,v=a.apply(m,[i,e]);if(i.loadurl){var y=setTimeout(function(){v.disabled=!0,r.apply(m,[i.loadtext,i,e])},100),b={};b[i.id]=e.id,$.isFunction(i.loaddata)?$.extend(b,i.loaddata.apply(e,[e.revert,i])):$.extend(b,i.loaddata),$.ajax({type:i.loadtype,url:i.loadurl,data:b,async:!1,success:function(e){window.clearTimeout(y),g=e,v.disabled=!1}})}else i.data?(g=i.data,$.isFunction(i.data)&&(g=i.data.apply(e,[e.revert,i]))):g=e.revert;r.apply(m,[g,i,e]),v.attr("name",i.name),o.apply(m,[i,e]),$(e).append(m),n.apply(m,[i,e]),$(":input:visible:enabled:first",m).focus(),i.select&&v.select(),v.keydown(function(t){27==t.keyCode&&(t.preventDefault(),l.apply(m,[i,e]))});var y;"cancel"==i.onblur?v.blur(function(){y=setTimeout(function(){l.apply(m,[i,e])},500)}):"submit"==i.onblur?v.blur(function(){y=setTimeout(function(){m.submit()},200)}):$.isFunction(i.onblur)?v.blur(function(){i.onblur.apply(e,[v.val(),i])}):v.blur(function(){}),m.submit(function(t){if(y&&clearTimeout(y),t.preventDefault(),!1!==h.apply(m,[i,e])&&!1!==s.apply(m,[i,e]))if($.isFunction(i.target)){var n=i.target.apply(e,[v.val(),i]);$(e).html(n),e.editing=!1,u.apply(e,[e.innerHTML,i]),$.trim($(e).html())||$(e).html(i.placeholder)}else{var o={};o[i.name]=v.val(),o[i.id]=e.id,$.isFunction(i.submitdata)?$.extend(o,i.submitdata.apply(e,[e.revert,i])):$.extend(o,i.submitdata),"PUT"==i.method&&(o._method="put"),$(e).html(i.indicator);var r={type:"POST",data:o,dataType:"html",url:i.target,success:function(t){"html"==r.dataType&&$(e).html(t),e.editing=!1,u.apply(e,[t,i]),$.trim($(e).html())||$(e).html(i.placeholder)},error:function(t){p.apply(m,[i,e,t])}};$.extend(r,i.ajaxoptions),$.ajax(r)}return $(e).attr("title",i.tooltip),!1})}}),this.reset=function(t){this.editing&&!1!==d.apply(t,[i,e])&&($(e).html(e.revert),e.editing=!1,$.trim($(e).html())||$(e).html(i.placeholder),i.tooltip&&$(e).attr("title",i.tooltip))}})},$.editable={types:{defaults:{element:function(){var e=$('<input type="hidden"></input>');return $(this).append(e),e},content:function(e){$(":input:first",this).val(e)},reset:function(e,t){t.reset(this)},buttons:function(e,t){var i=this;if(e.submit){if(e.submit.match(/>$/))var n=$(e.submit).click(function(){"submit"!=n.attr("type")&&i.submit()});else{var n=$('<button type="submit" />');n.html(e.submit)}$(this).append(n)}if(e.cancel){if(e.cancel.match(/>$/))var s=$(e.cancel);else{var s=$('<button type="cancel" />');s.html(e.cancel)}$(this).append(s),$(s).click(function(){if($.isFunction($.editable.types[e.type].reset))var n=$.editable.types[e.type].reset;else var n=$.editable.types.defaults.reset;return n.apply(i,[e,t]),!1})}}},text:{element:function(e){var t=$("<input />");return"none"!=e.width&&t.width(e.width),"none"!=e.height&&t.height(e.height),t.attr("autocomplete","off"),$(this).append(t),t}},textarea:{element:function(e){var t=$("<textarea />");return e.rows?t.attr("rows",e.rows):"none"!=e.height&&t.height(e.height),e.cols?t.attr("cols",e.cols):"none"!=e.width&&t.width(e.width),$(this).append(t),t}},select:{element:function(){var e=$("<select />");return $(this).append(e),e},content:function(data,settings,original){if(String==data.constructor)eval("var json = "+data);else var json=data;for(var key in json)if(json.hasOwnProperty(key)&&"selected"!=key){var option=$("<option />").val(key).append(json[key]);$("select",this).append(option)}$("select",this).children().each(function(){($(this).val()==json.selected||$(this).text()==$.trim(original.revert))&&$(this).attr("selected","selected")})}}},addInputType:function(e,t){$.editable.types[e]=t}},$.fn.editable.defaults={name:"value",id:"id",type:"text",width:"auto",height:"auto",event:"click.editable",onblur:"cancel",loadtype:"GET",loadtext:"Loading...",placeholder:"Click to edit",loaddata:{},submitdata:{},ajaxoptions:{}}}(jQuery),/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
jQuery.cookie=function(e,t,i){if("undefined"==typeof t){var n=null;if(document.cookie&&""!=document.cookie)for(var s=document.cookie.split(";"),o=0;o<s.length;o++){var r=jQuery.trim(s[o]);if(r.substring(0,e.length+1)==e+"="){n=decodeURIComponent(r.substring(e.length+1));break}}return n}i=i||{},null===t&&(t="",i.expires=-1);var a="";if(i.expires&&("number"==typeof i.expires||i.expires.toUTCString)){var l;"number"==typeof i.expires?(l=new Date,l.setTime(l.getTime()+1e3*60*60*24*i.expires)):l=i.expires,a="; expires="+l.toUTCString()}var u=i.path?"; path="+i.path:"",c=i.domain?"; domain="+i.domain:"",h=i.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(t),a,u,c,h].join("")},/**
 * @author Ryan Johnson <http://syntacticx.com/>
 * @copyright 2008 PersonalGrid Corporation <http://personalgrid.com/>
 * @package LivePipe UI
 * @license MIT
 * @url http://livepipe.net/core
 * @require prototype.js
 */
"undefined"==typeof Control&&(Control={});var $proc=function(e){return"function"==typeof e?e:function(){return e}},$value=function(e){return"function"==typeof e?e():e};Object.Event={extend:function(e){e._objectEventSetup=function(e){this._observers=this._observers||{},this._observers[e]=this._observers[e]||[]},e.observe=function(e,t){if("string"==typeof e&&"undefined"!=typeof t)this._objectEventSetup(e),this._observers[e].include(t)||this._observers[e].push(t);else for(var i in e)this.observe(i,e[i])},e.stopObserving=function(e,t){this._objectEventSetup(e),e&&t?this._observers[e]=this._observers[e].without(t):e?this._observers[e]=[]:this._observers={}},e.observeOnce=function(e,t){var i=function(){t.apply(this,arguments),this.stopObserving(e,i)}.bind(this);this._objectEventSetup(e),this._observers[e].push(i)},e.notify=function(e){this._objectEventSetup(e);var t=[],i=$A(arguments).slice(1);try{for(var n=0;n<this._observers[e].length;++n)t.push(this._observers[e][n].apply(this,i)||null)}catch(s){if(s==$break)return!1;throw s}return t},e.prototype&&(e.prototype._objectEventSetup=e._objectEventSetup,e.prototype.observe=e.observe,e.prototype.stopObserving=e.stopObserving,e.prototype.observeOnce=e.observeOnce,e.prototype.notify=function(t){if(e.notify){var i=$A(arguments).slice(1);i.unshift(this),i.unshift(t),e.notify.apply(e,i)}this._objectEventSetup(t);var i=$A(arguments).slice(1),n=[];try{this.options&&this.options[t]&&"function"==typeof this.options[t]&&n.push(this.options[t].apply(this,i)||null);for(var s=this._observers[t],o=0;o<s.length;++o)n.push(s[o].apply(this,i)||null)}catch(r){if(r==$break)return!1;throw r}return n})}},Element.addMethods({observeOnce:function(e,t,i){var n=function(){i.apply(this,arguments),Element.stopObserving(e,t,n)};Element.observe(e,t,n)}}),function(){function e(e){var t,i,n;return e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),t?(i=Event.extend(e).target,i=Element.extend(i.nodeType===Node.TEXT_NODE?i.parentNode:i),n=i.fire("mouse:wheel",{delta:t}),n.stopped?(Event.stop(e),!1):void 0):void 0}document.observe("mousewheel",e),document.observe("DOMMouseScroll",e)}();var IframeShim=Class.create({initialize:function(){this.element=new Element("iframe",{style:"position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);display:none",src:"javascript:void(0);",frameborder:0}),$(document.body).insert(this.element)},hide:function(){return this.element.hide(),this},show:function(){return this.element.show(),this},positionUnder:function(e){var e=$(e),t=e.cumulativeOffset(),i=e.getDimensions();return this.element.setStyle({left:t[0]+"px",top:t[1]+"px",width:i.width+"px",height:i.height+"px",zIndex:e.getStyle("zIndex")-1}).show(),this},setBounds:function(e){for(prop in e)e[prop]+="px";return this.element.setStyle(e),this},destroy:function(){return this.element&&this.element.remove(),this}});if(/**
 * @author Ryan Johnson <http://syntacticx.com/>
 * @copyright 2008 PersonalGrid Corporation <http://personalgrid.com/>
 * @package LivePipe UI
 * @license MIT
 * @url http://livepipe.net/control/window
 * @require prototype.js, effects.js, draggable.js, resizable.js, livepipe.js
 */
"undefined"!=typeof Draggable&&(Draggable.prototype.draw=function(e){var t=Position.cumulativeOffset(this.element);if(this.options.ghosting){var i=Position.realOffset(this.element);t[0]+=i[0]-Position.deltaX,t[1]+=i[1]-Position.deltaY}var n=this.currentDelta();t[0]-=n[0],t[1]-=n[1],this.options.scroll&&this.options.scroll!=window&&this._isScrollChild&&(t[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft,t[1]-=this.options.scroll.scrollTop-this.originalScrollTop);var s=[0,1].map(function(i){return e[i]-t[i]-this.offset[i]}.bind(this));if(this.options.snap&&(s="function"==typeof this.options.snap?this.options.snap(s[0],s[1],this):this.options.snap instanceof Array?s.map(function(e,t){return Math.round(e/this.options.snap[t])*this.options.snap[t]}.bind(this)):s.map(function(e){return Math.round(e/this.options.snap)*this.options.snap}.bind(this))),this.options.onDraw)this.options.onDraw.bind(this)(s);else{var o=this.element.style;if(this.options.constrainToViewport){var r=document.viewport.getDimensions(),a=this.element.getDimensions(),l=parseInt(this.element.getStyle("margin-top")),u=parseInt(this.element.getStyle("margin-left")),c=[[0-u,0-l],[r.width-a.width-u,r.height-a.height-l]];this.options.constraint&&"horizontal"!=this.options.constraint||(this.element.style.left=s[0]>=c[0][0]&&s[0]<=c[1][0]?s[0]+"px":(s[0]<c[0][0]?c[0][0]:c[1][0])+"px"),this.options.constraint&&"vertical"!=this.options.constraint||(this.element.style.top=s[1]>=c[0][1]&&s[1]<=c[1][1]?s[1]+"px":(s[1]<=c[0][1]?c[0][1]:c[1][1])+"px")}else this.options.constraint&&"horizontal"!=this.options.constraint||(o.left=s[0]+"px"),this.options.constraint&&"vertical"!=this.options.constraint||(o.top=s[1]+"px");"hidden"==o.visibility&&(o.visibility="")}}),"undefined"==typeof Prototype)throw"Control.Window requires Prototype to be loaded.";if("undefined"==typeof IframeShim)throw"Control.Window requires IframeShim to be loaded.";if("undefined"==typeof Object.Event)throw"Control.Window requires Object.Event to be loaded.";Control.Window=Class.create({initialize:function(e,t){if(Control.Window.windows.push(this),this.container=!1,this.isOpen=!1,this.href=!1,this.sourceContainer=!1,this.ajaxRequest=!1,this.remoteContentLoaded=!1,this.numberInSequence=Control.Window.windows.length+1,this.indicator=!1,this.effects={fade:!1,appear:!1},this.indicatorEffects={fade:!1,appear:!1},this.options=Object.extend({beforeOpen:Prototype.emptyFunction,afterOpen:Prototype.emptyFunction,beforeClose:Prototype.emptyFunction,afterClose:Prototype.emptyFunction,height:null,width:null,className:!1,position:"center",offsetLeft:0,offsetTop:0,iframe:!1,hover:!1,indicator:!1,closeOnClick:!1,iframeshim:!0,fade:!1,fadeDuration:.75,draggable:!1,onDrag:Prototype.emptyFunction,resizable:!1,minHeight:!1,minWidth:!1,maxHeight:!1,maxWidth:!1,onResize:Prototype.emptyFunction,constrainToViewport:!1,method:"post",parameters:{},onComplete:Prototype.emptyFunction,onSuccess:Prototype.emptyFunction,onFailure:Prototype.emptyFunction,onException:Prototype.emptyFunction,onRemoteContentLoaded:Prototype.emptyFunction,insertRemoteContentAt:!1},t||{}),this.indicator=this.options.indicator?$(this.options.indicator):!1,e)if("string"==typeof e&&e.match(Control.Window.uriRegex))this.href=e;else if(this.container=$(e),this.createDefaultContainer(e),this.container&&(this.container.readAttribute("href")&&""!=this.container.readAttribute("href")||this.options.hover&&this.options.hover!==!0)){if(this.options.hover&&this.options.hover!==!0)this.sourceContainer=$(this.options.hover);else{this.sourceContainer=this.container,this.href=this.container.readAttribute("href");var i=this.href.match(/^#(.+)$/);i&&i[1]?(this.container=$(i[1]),this.href=!1):this.container=!1}this.sourceContainerOpenHandler=function(e){if(Event.isLeftClick(e)){if(!(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey))return this.open(e),e.stop(),!1}else if(!Event.isMiddleClick(e))return this.open(e),e.stop(),!1}.bindAsEventListener(this),this.sourceContainerCloseHandler=function(e){this.close(e)}.bindAsEventListener(this),this.sourceContainerMouseMoveHandler=function(e){this.position(e)}.bindAsEventListener(this),this.options.hover?(this.sourceContainer.observe("mouseenter",this.sourceContainerOpenHandler),this.sourceContainer.observe("mouseleave",this.sourceContainerCloseHandler),"mouse"==this.options.position&&this.sourceContainer.observe("mousemove",this.sourceContainerMouseMoveHandler)):this.sourceContainer.observe("click",this.sourceContainerOpenHandler)}this.createDefaultContainer(e),this.options.insertRemoteContentAt===!1&&(this.options.insertRemoteContentAt=this.container);var n={margin:0,position:"absolute",zIndex:Control.Window.initialZIndexForWindow()};this.options.width&&(n.width=$value(this.options.width)+"px"),this.options.height&&(n.height=$value(this.options.height)+"px"),this.container.setStyle(n),this.options.className&&this.container.addClassName(this.options.className),this.positionHandler=this.position.bindAsEventListener(this),this.outOfBoundsPositionHandler=this.ensureInBounds.bindAsEventListener(this),this.bringToFrontHandler=this.bringToFront.bindAsEventListener(this),this.container.observe("mousedown",this.bringToFrontHandler),this.container.hide(),this.closeHandler=this.close.bindAsEventListener(this),this.options.iframeshim&&(this.iFrameShim=new IframeShim,this.iFrameShim.hide()),this.applyResizable(),this.applyDraggable(),Event.observe(window,"resize",this.outOfBoundsPositionHandler),this.notify("afterInitialize")},open:function(e){if(this.isOpen)return this.bringToFront(),!1;if(this.notify("beforeOpen")===!1)return!1;if(this.options.closeOnClick&&(this.options.closeOnClick===!0?this.closeOnClickContainer=$(document.body):"container"==this.options.closeOnClick?this.closeOnClickContainer=this.container:"overlay"==this.options.closeOnClick?(Control.Overlay.load(),this.closeOnClickContainer=Control.Overlay.container):this.closeOnClickContainer=$(this.options.closeOnClick),this.closeOnClickContainer.observe("click",this.closeHandler)),this.href&&!this.options.iframe&&!this.remoteContentLoaded){if(this.remoteContentLoaded=!0,this.href.match(/\.(jpe?g|gif|png|tiff?)$/i)){var t=new Element("img");t.observe("load",function(e){this.getRemoteContentInsertionTarget().insert(e),this.position(),this.notify("onRemoteContentLoaded")!==!1&&(this.options.indicator&&this.hideIndicator(),this.finishOpen())}.bind(this,t)),t.writeAttribute("src",this.href)}else this.ajaxRequest||(this.options.indicator&&this.showIndicator(),this.ajaxRequest=new Ajax.Request(this.href,{method:this.options.method,parameters:this.options.parameters,onComplete:function(e){this.notify("onComplete",e),this.ajaxRequest=!1}.bind(this),onSuccess:function(e){this.getRemoteContentInsertionTarget().insert(e.responseText),this.notify("onSuccess",e),this.notify("onRemoteContentLoaded")!==!1&&(this.options.indicator&&this.hideIndicator(),this.finishOpen())}.bind(this),onFailure:function(e){this.notify("onFailure",e),this.options.indicator&&this.hideIndicator()}.bind(this),onException:function(e,t){this.notify("onException",e,t),this.options.indicator&&this.hideIndicator()}.bind(this)}));return!0}if(this.options.iframe&&!this.remoteContentLoaded){this.remoteContentLoaded=!0,this.options.indicator&&this.showIndicator(),this.getRemoteContentInsertionTarget().insert(Control.Window.iframeTemplate.evaluate({href:this.href}));var i=this.container.down("iframe");i.onload=function(){this.notify("onRemoteContentLoaded"),this.options.indicator&&this.hideIndicator(),i.onload=null}.bind(this)}return this.finishOpen(e),!0},close:function(e){return this.isOpen&&this.notify("beforeClose",e)!==!1?(this.options.closeOnClick&&this.closeOnClickContainer.stopObserving("click",this.closeHandler),this.options.fade?this.effects.fade=new Effect.Fade(this.container,{queue:{position:"front",scope:"Control.Window"+this.numberInSequence},from:1,to:0,duration:this.options.fadeDuration/2,afterFinish:function(){this.iFrameShim&&this.iFrameShim.hide(),this.isOpen=!1,this.notify("afterClose")}.bind(this)}):(this.container.hide(),this.iFrameShim&&this.iFrameShim.hide()),this.ajaxRequest&&this.ajaxRequest.transport.abort(),this.options.draggable||this.options.resizable||"center"!=this.options.position||Event.stopObserving(window,"resize",this.positionHandler),this.options.draggable||"center"!=this.options.position||Event.stopObserving(window,"scroll",this.positionHandler),this.options.indicator&&this.hideIndicator(),this.options.fade||(this.isOpen=!1,this.notify("afterClose")),!0):!1},position:function(e){if("mouse"==this.options.position){var t=[Event.pointerX(e),Event.pointerY(e)];return this.container.setStyle({top:t[1]+$value(this.options.offsetTop)+"px",left:t[0]+$value(this.options.offsetLeft)+"px"}),void 0}var i=this.container.getDimensions(),n=document.viewport.getDimensions();Position.prepare();var s=Position.deltaX+Math.floor((n.width-i.width)/2),o=Position.deltaY+(n.height>i.height?Math.floor((n.height-i.height)/2):0);if("center"==this.options.position||"center_once"==this.options.position)this.container.setStyle({top:i.height<=n.height?(null!=o&&o>0?o:0)+"px":0,left:i.width<=n.width?(null!=s&&s>0?s:0)+"px":0});else if("relative"==this.options.position){var t=this.sourceContainer.cumulativeOffset(),r=t[1]+$value(this.options.offsetTop),a=t[0]+$value(this.options.offsetLeft);this.container.setStyle({top:i.height<=n.height?(this.options.constrainToViewport?Math.max(0,Math.min(n.height-i.height,r)):r)+"px":0,left:i.width<=n.width?(this.options.constrainToViewport?Math.max(0,Math.min(n.width-i.width,a)):a)+"px":0})}else if(this.options.position.length){var r=$value(this.options.position[1])+$value(this.options.offsetTop),a=$value(this.options.position[0])+$value(this.options.offsetLeft);this.container.setStyle({top:i.height<=n.height?(this.options.constrainToViewport?Math.max(0,Math.min(n.height-i.height,r)):r)+"px":0,left:i.width<=n.width?(this.options.constrainToViewport?Math.max(0,Math.min(n.width-i.width,a)):a)+"px":0})}this.iFrameShim&&this.updateIFrameShimZIndex()},ensureInBounds:function(){if(this.isOpen){var e=document.viewport.getDimensions(),t=this.container.cumulativeOffset(),i=this.container.getDimensions();t.left+i.width>e.width&&this.container.setStyle({left:Math.max(0,e.width-i.width)+"px"}),t.top+i.height>e.height&&this.container.setStyle({top:Math.max(0,e.height-i.height)+"px"})}},bringToFront:function(){Control.Window.bringToFront(this),this.notify("bringToFront")},destroy:function(){this.container.stopObserving("mousedown",this.bringToFrontHandler),this.draggable&&(Draggables.removeObserver(this.container),this.draggable.handle.stopObserving("mousedown",this.bringToFrontHandler),this.draggable.destroy()),this.resizable&&(Resizables.removeObserver(this.container),this.resizable.handle.stopObserving("mousedown",this.bringToFrontHandler),this.resizable.destroy()),this.container&&!this.sourceContainer&&this.container.remove(),this.sourceContainer&&(this.options.hover?(this.sourceContainer.stopObserving("mouseenter",this.sourceContainerOpenHandler),this.sourceContainer.stopObserving("mouseleave",this.sourceContainerCloseHandler),"mouse"==this.options.position&&this.sourceContainer.stopObserving("mousemove",this.sourceContainerMouseMoveHandler)):this.sourceContainer.stopObserving("click",this.sourceContainerOpenHandler)),this.iFrameShim&&this.iFrameShim.destroy(),Event.stopObserving(window,"resize",this.outOfBoundsPositionHandler),Control.Window.windows=Control.Window.windows.without(this),this.notify("afterDestroy")},applyResizable:function(){if(this.options.resizable){if("undefined"==typeof Resizable)throw"Control.Window requires resizable.js to be loaded.";var e=null;this.options.resizable===!0?(e=new Element("div",{className:"resizable_handle"}),this.container.insert(e)):e=$(this.options.resziable),this.resizable=new Resizable(this.container,{handle:e,minHeight:this.options.minHeight,minWidth:this.options.minWidth,maxHeight:this.options.constrainToViewport?function(e){return document.viewport.getDimensions().height-parseInt(e.style.top||0)-(e.getHeight()-parseInt(e.style.height||0))}:this.options.maxHeight,maxWidth:this.options.constrainToViewport?function(e){return document.viewport.getDimensions().width-parseInt(e.style.left||0)-(e.getWidth()-parseInt(e.style.width||0))}:this.options.maxWidth}),this.resizable.handle.observe("mousedown",this.bringToFrontHandler),Resizables.addObserver(new Control.Window.LayoutUpdateObserver(this,function(){this.iFrameShim&&this.updateIFrameShimZIndex(),this.notify("onResize")}.bind(this)))}},applyDraggable:function(){if(this.options.draggable){if("undefined"==typeof Draggables)throw"Control.Window requires dragdrop.js to be loaded.";var e=null;this.options.draggable===!0?(e=new Element("div",{className:"draggable_handle"}),this.container.insert(e)):e=$(this.options.draggable),this.draggable=new Draggable(this.container,{handle:e,constrainToViewport:this.options.constrainToViewport,zindex:this.container.getStyle("z-index"),starteffect:function(){Prototype.Browser.IE&&(this.old_onselectstart=document.onselectstart,document.onselectstart=function(){return!1})}.bind(this),endeffect:function(){document.onselectstart=this.old_onselectstart}.bind(this)}),this.draggable.handle.observe("mousedown",this.bringToFrontHandler),Draggables.addObserver(new Control.Window.LayoutUpdateObserver(this,function(){this.iFrameShim&&this.updateIFrameShimZIndex(),this.notify("onDrag")}.bind(this)))}},createDefaultContainer:function(e){this.container||(this.container=new Element("div",{id:"control_window_"+this.numberInSequence}),$(document.body).insert(this.container),"string"!=typeof e||null!=$(e)||e.match(/^#(.+)$/)||e.match(Control.Window.uriRegex)||this.container.update(e))},finishOpen:function(e){if(this.bringToFront(),this.options.fade){if("undefined"==typeof Effect)throw"Control.Window requires effects.js to be loaded.";this.effects.fade&&this.effects.fade.cancel(),this.effects.appear=new Effect.Appear(this.container,{queue:{position:"end",scope:"Control.Window."+this.numberInSequence},from:0,to:1,duration:this.options.fadeDuration/2,afterFinish:function(){this.iFrameShim&&this.updateIFrameShimZIndex(),this.isOpen=!0,this.notify("afterOpen")}.bind(this)})}else this.container.show();return this.position(e),this.options.draggable||this.options.resizable||"center"!=this.options.position||Event.observe(window,"resize",this.positionHandler,!1),this.options.draggable||"center"!=this.options.position||Event.observe(window,"scroll",this.positionHandler,!1),this.options.fade||(this.isOpen=!0,this.notify("afterOpen")),!0},showIndicator:function(){this.showIndicatorTimeout=window.setTimeout(function(){this.options.fade?this.indicatorEffects.appear=new Effect.Appear(this.indicator,{queue:{position:"front",scope:"Control.Window.indicator."+this.numberInSequence},from:0,to:1,duration:this.options.fadeDuration/2}):this.indicator.show()}.bind(this),Control.Window.indicatorTimeout)},hideIndicator:function(){this.showIndicatorTimeout&&window.clearTimeout(this.showIndicatorTimeout),this.indicator.hide()},getRemoteContentInsertionTarget:function(){return"string"==typeof this.options.insertRemoteContentAt?this.container.down(this.options.insertRemoteContentAt):$(this.options.insertRemoteContentAt)},updateIFrameShimZIndex:function(){this.iFrameShim&&this.iFrameShim.positionUnder(this.container)}}),Object.extend(Control.Window,{windows:[],baseZIndex:9999,indicatorTimeout:250,iframeTemplate:new Template('<iframe src="#{href}" width="100%" height="100%" frameborder="0"></iframe>'),uriRegex:/^(\/|\#|https?\:\/\/|[\w]+\/)/,bringToFront:function(e){Control.Window.windows=Control.Window.windows.without(e),Control.Window.windows.push(e),Control.Window.windows.each(function(e,t){var i=Control.Window.baseZIndex+t;e.container.setStyle({zIndex:i}),e.isOpen&&e.iFrameShim&&e.updateIFrameShimZIndex(),e.options.draggable&&(e.draggable.options.zindex=i)})},open:function(e,t){var i=new Control.Window(e,t);return i.open(),i},initialZIndexForWindow:function(){return Control.Window.baseZIndex+(Control.Window.windows.length-1)}}),Object.Event.extend(Control.Window),Control.Window.LayoutUpdateObserver=Class.create({initialize:function(e,t){this.w=e,this.element=$(e.container),this.observer=t},onStart:Prototype.emptyFunction,onEnd:function(e,t){t.element==this.element&&this.iFrameShim&&this.w.updateIFrameShimZIndex()},onResize:function(e,t){t.element==this.element&&this.observer(this.element)},onDrag:function(e,t){t.element==this.element&&this.observer(this.element)}}),Control.Overlay={id:"control_overlay",loaded:!1,container:!1,lastOpacity:0,styles:{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:9998},ieStyles:{position:"absolute",top:0,left:0,zIndex:9998},effects:{fade:!1,appear:!1},load:function(){return Control.Overlay.loaded?!1:(Control.Overlay.loaded=!0,Control.Overlay.container=new Element("div",{id:Control.Overlay.id}),$(document.body).insert(Control.Overlay.container),Prototype.Browser.IE?(Control.Overlay.container.setStyle(Control.Overlay.ieStyles),Event.observe(window,"scroll",Control.Overlay.positionOverlay),Event.observe(window,"resize",Control.Overlay.positionOverlay),Control.Overlay.observe("beforeShow",Control.Overlay.positionOverlay)):Control.Overlay.container.setStyle(Control.Overlay.styles),Control.Overlay.iFrameShim=new IframeShim,Control.Overlay.iFrameShim.hide(),Event.observe(window,"resize",Control.Overlay.positionIFrameShim),Control.Overlay.container.hide(),!0)},unload:function(){return Control.Overlay.loaded?(Event.stopObserving(window,"resize",Control.Overlay.positionOverlay),Control.Overlay.stopObserving("beforeShow",Control.Overlay.positionOverlay),Event.stopObserving(window,"resize",Control.Overlay.positionIFrameShim),Control.Overlay.iFrameShim.destroy(),Control.Overlay.container.remove(),Control.Overlay.loaded=!1,!0):!1},show:function(e,t){if(Control.Overlay.notify("beforeShow")===!1)return!1;if(Control.Overlay.lastOpacity=e,Control.Overlay.positionIFrameShim(),Control.Overlay.iFrameShim.show(),t){if("undefined"==typeof Effect)throw"Control.Window requires effects.js to be loaded.";Control.Overlay.effects.fade&&Control.Overlay.effects.fade.cancel(),Control.Overlay.effects.appear=new Effect.Appear(Control.Overlay.container,{queue:{position:"end",scope:"Control.Overlay"},afterFinish:function(){Control.Overlay.notify("afterShow")},from:0,to:Control.Overlay.lastOpacity,duration:(t===!0?.75:t)/2})}else Control.Overlay.container.setStyle({opacity:e||1}),Control.Overlay.container.show(),Control.Overlay.notify("afterShow");return!0},hide:function(e){return Control.Overlay.notify("beforeHide")===!1?!1:(Control.Overlay.effects.appear&&Control.Overlay.effects.appear.cancel(),Control.Overlay.iFrameShim.hide(),e?Control.Overlay.effects.fade=new Effect.Fade(Control.Overlay.container,{queue:{position:"front",scope:"Control.Overlay"},afterFinish:function(){Control.Overlay.notify("afterHide")},from:Control.Overlay.lastOpacity,to:0,duration:(e===!0?.75:e)/2}):(Control.Overlay.container.hide(),Control.Overlay.notify("afterHide")),!0)},positionIFrameShim:function(){Control.Overlay.container.visible()&&Control.Overlay.iFrameShim.positionUnder(Control.Overlay.container)},positionOverlay:function(){Control.Overlay.container.setStyle({width:document.body.clientWidth+"px",height:document.body.clientHeight+"px"})}},Object.Event.extend(Control.Overlay),Control.ToolTip=Class.create(Control.Window,{initialize:function($super,e,t,i){$super(t,Object.extend(Object.extend(Object.clone(Control.ToolTip.defaultOptions),i||{}),{position:"mouse",hover:e}))}}),Object.extend(Control.ToolTip,{defaultOptions:{offsetLeft:10}}),Control.Modal=Class.create(Control.Window,{initialize:function($super,e,t){Control.Modal.InstanceMethods.beforeInitialize.bind(this)(),$super(e,Object.extend(Object.clone(Control.Modal.defaultOptions),t||{}))},closeWithoutOverlay:function(){this.keepOverlay=!0,this.close()}}),Object.extend(Control.Modal,{defaultOptions:{overlayOpacity:.5,closeOnClick:"overlay"},current:!1,open:function(e,t){var i=new Control.Modal(e,t);return i.open(),i},close:function(){Control.Modal.current&&Control.Modal.current.close()},InstanceMethods:{beforeInitialize:function(){Control.Overlay.load(),this.observe("beforeOpen",Control.Modal.Observers.beforeOpen.bind(this)),this.observe("afterOpen",Control.Modal.Observers.afterOpen.bind(this)),this.observe("afterClose",Control.Modal.Observers.afterClose.bind(this))}},Observers:{beforeOpen:function(){if(Control.Window.windows.without(this).each(function(e){e.closeWithoutOverlay&&e.isOpen?e.closeWithoutOverlay():e.close()}),!Control.Overlay.overlayFinishedOpening)throw Control.Overlay.observeOnce("afterShow",function(){Control.Overlay.overlayFinishedOpening=!0,this.open()}.bind(this)),Control.Overlay.show(this.options.overlayOpacity,this.options.fade?this.options.fadeDuration:!1),$break},afterOpen:function(){Control.Overlay.show(this.options.overlayOpacity),Control.Overlay.overlayFinishedOpening=!0,Control.Modal.current=this},afterClose:function(){this.keepOverlay||(Control.Overlay.hide(this.options.fade?this.options.fadeDuration:!1),Control.Overlay.overlayFinishedOpening=!1),this.keepOverlay=!1,Control.Modal.current=!1}}}),Control.LightBox=Class.create(Control.Window,{initialize:function($super,e,t){if(this.allImagesLoaded=!1,t.modal){var t=Object.extend(Object.clone(Control.LightBox.defaultOptions),t||{});t=Object.extend(Object.clone(Control.Modal.defaultOptions),t),t=Control.Modal.InstanceMethods.beforeInitialize.bind(this)(t),$super(e,t)}else $super(e,Object.extend(Object.clone(Control.LightBox.defaultOptions),t||{}));this.hasRemoteContent=this.href&&!this.options.iframe,this.hasRemoteContent?this.observe("onRemoteContentLoaded",Control.LightBox.Observers.onRemoteContentLoaded.bind(this)):this.applyImageObservers(),this.observe("beforeOpen",Control.LightBox.Observers.beforeOpen.bind(this))},applyImageObservers:function(){var e=this.getImages();this.numberImagesToLoad=e.length,this.numberofImagesLoaded=0,e.each(function(e){e.observe("load",function(){++this.numberofImagesLoaded,this.numberImagesToLoad==this.numberofImagesLoaded&&(this.allImagesLoaded=!0,this.onAllImagesLoaded())}.bind(this,e)),e.hide()}.bind(this))},onAllImagesLoaded:function(){this.getImages().each(function(e){this.showImage(e)}.bind(this)),this.hasRemoteContent?(this.options.indicator&&this.hideIndicator(),this.finishOpen()):this.open()},getImages:function(){return this.container.select(Control.LightBox.imageSelector)},showImage:function(e){e.show()}}),Object.extend(Control.LightBox,{imageSelector:"img",defaultOptions:{},Observers:{beforeOpen:function(){if(!this.hasRemoteContent&&!this.allImagesLoaded)throw $break},onRemoteContentLoaded:function(){if(this.applyImageObservers(),!this.allImagesLoaded)throw $break}}}),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
(null===window.RB||void 0===window.RB)&&(window.RB=function(e){var t,i,n,s,o;return t={create:function(){function e(){}var t,i,n,s;for(e.prototype=arguments[0],t=new e,i=1;i<arguments.length;i+=1)if(n=arguments[i],"object"==typeof n)for(s in n)n.hasOwnProperty(s)&&(t[s]=n[s]);return t}},i=t.create({initialize:function(e,i){var n;return n=t.create(e),n.initialize(i),n}}),n=t.create({msg:function(t){var i;i=0===e("#msgBox").size()?e('<div id="msgBox"></div>').appendTo("body"):e("#msgBox"),i.html(t),i.dialog({title:"Backlogs Plugin",buttons:{OK:function(){e(this).dialog("close")}},modal:!0})}}),o=function(){var t,i,n;return t=[],i=!1,n=function(){var n=t.shift();null!==n&&void 0!==n&&(i=!0,e.ajax(n))},e(document).ajaxComplete(function(){i=!1,n()}),function(e){t.push(e),i||n()}}(),s=t.create({get:function(t){return e.cookie(t)},set:function(t,i){e.cookie(t,i,{expires:3650})}}),{Object:t,Factory:i,Dialog:n,UserPreferences:s,ajax:o}}(jQuery)),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
jQuery(function(e){if(e(".backlog").each(function(){RB.Factory.initialize(RB.Backlog,this)}),e.browser.msie&&e.browser.version<=7){var t=50;e(".backlog, .header").each(function(){e(this).css("z-index",t),t-=1})}e(".backlog .toggler").on("click",function(){e(this).toggleClass("closed"),e(this).parents(".backlog").find("ul.stories").toggleClass("closed")})}),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.Backlog=function(e){return RB.Object.create({initialize:function(t){this.$=e(t),this.el=t,this.$.data("this",this),this.getList().sortable({connectWith:".stories",dropOnEmpty:!0,start:this.dragStart,stop:this.dragStop,update:this.dragComplete,receive:this.dragChanged,remove:this.dragChanged,containment:e("#backlogs_container"),scroll:!0,helper:function(t,i){var n=e(i).clone();return n.css("position","absolute"),n.get(0)}}),this.$.find(".add_new_story").click(this.handleNewStoryClick),this.isSprintBacklog()&&(RB.Factory.initialize(RB.Sprint,this.getSprint()),this.burndown=RB.Factory.initialize(RB.Burndown,this.$.find(".show_burndown_chart")),this.burndown.setSprintId(this.getSprint().data("this").getID())),this.getStories().each(function(){RB.Factory.initialize(RB.Story,this)}),this.isSprintBacklog()&&this.refresh()},dragChanged:function(){e(this).parents(".backlog").data("this").refresh()},dragComplete:function(e,t){var i=null===t.sender||void 0===t.sender;i&&t.item.data("this").saveDragResult()},dragStart:function(e,t){t.item.addClass("dragging")},dragStop:function(t,i){i.item.removeClass("dragging"),e.browser.msie&&e.browser.version<=7&&i.item.css("z-index",0)},getSprint:function(){return e(this.el).find(".model.sprint").first()},getStories:function(){return this.getList().children(".story")},getList:function(){return this.$.children(".stories").first()},handleNewStoryClick:function(t){var i=e(this).parents(".header").find(".toggler");i.hasClass("closed")&&i.click(),t.preventDefault(),e(this).parents(".backlog").data("this").newStory()},isSprintBacklog:function(){return 1===e(this.el).find(".sprint").length},newStory:function(){var t,i;t=e("#story_template").children().first().clone(),this.getList().prepend(t),i=RB.Factory.initialize(RB.Story,t[0]),i.edit(),t.find(".editor").first().focus()},refresh:function(){this.recalcVelocity(),this.recalcOddity()},recalcVelocity:function(){var t;return this.isSprintBacklog()?(t=0,this.getStories().each(function(){t+=e(this).data("this").getPoints()}),this.$.children(".header").children(".velocity").text(t),void 0):!0},recalcOddity:function(){this.$.find(".story:even").removeClass("odd").addClass("even"),this.$.find(".story:odd").removeClass("even").addClass("odd")}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.Burndown=function(e){return RB.Object.create({initialize:function(t){this.$=e(t),this.el=t,this.$.data("this",this),this.$.click(this.show)},setSprintId:function(e){this.sprintId=e},getSprintId:function(){return this.sprintId},show:function(t){t.preventDefault(),0===e("#charts").length&&e('<div id="charts"></div>').appendTo("body"),e("#charts").html("<div class='loading'>"+RB.i18n.generating_graph+"</div>"),e("#charts").load(RB.urlFor("show_burndown_chart",{sprint_id:e(this).data("this").sprintId,project_id:RB.constants.project_id})),e("#charts").dialog({dialogClass:"rb_dialog",height:530,width:710,position:"center",modal:!0,title:RB.i18n.burndown_graph,resizable:!1})}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.Model=function(e){return RB.Object.create({initialize:function(t){this.$=e(t),this.el=t},afterCreate:function(){},afterSave:function(e,t,i){var n,s;n=this.isNew(),s=RB.Factory.initialize(RB.Model,e),this.unmarkSaving(),this.refresh(s),n?(this.$.attr("id",s.$.attr("id")),this.afterCreate(e,t,i)):this.afterUpdate(e,t,i)},afterUpdate:function(){},beforeSave:function(){},cancelEdit:function(){this.endEdit(),this.isNew()&&this.$.hide("blind")},close:function(){this.$.addClass("closed")},copyFromDialog:function(){var t;t=0===this.$.find(".editors").length?e("<div class='editors'></div>").appendTo(this.$):this.$.find(".editors").first(),t.html(""),t.append(e("#"+this.getType().toLowerCase()+"_editor").children(".editor")),this.saveEdits()},displayEditor:function(t){var i=this.$.offset(),n=this;t.dialog({buttons:{OK:function(){n.copyFromDialog(),e(this).dialog("close")},Cancel:function(){n.cancelEdit(),e(this).dialog("close")}},close:function(e){27===e.which&&n.cancelEdit()},dialogClass:this.getType().toLowerCase()+"_editor_dialog",modal:!0,position:[i.left-e(document).scrollLeft(),i.top-e(document).scrollTop()],resizable:!1,title:this.isNew()?this.newDialogTitle():this.editDialogTitle()}),t.find(".editor").first().focus()},edit:function(){var t=this.getEditor(),i=this,n=0;return e(".stories .editors .editor").each(function(){var t;t=parseInt(e(this).attr("tabindex"),10),t>n&&(n=t)}),this.$.find(".editable").each(function(){var s,o,r,a,l,u,c,h,d;s=e(this),fieldId=s.attr("field_id"),a=s.attr("fieldname"),r=s.attr("fieldlabel"),l=parseInt(s.attr("fieldorder"),10),o=s.attr("fieldtype")||"input",r||(r=a.replace(/_/gi," ").replace(/ id$/gi,"")),"select"===o?"status_id"===a?(h=e.trim(i.$.find(".type_id .v").html()),""==h&&(h=e("#type_id_options").val()),d=e.trim(i.$.find(".status_id .v").html()),u=i.findFactory(h,d,a)):"type_id"===a?(u=e("#"+a+"_options").clone(!0),u.change(function(){h=e(this).val(),d=e.trim(i.$.find(".status_id .v").html()),c=i.findFactory(h,d,"status_id"),c=i.prepareInputFromFactory(c,fieldId,"status_id",l,n),c=i.replaceStatusForNewType(u,c,e(this).parent().find(".status_id").val(),t)})):u=e("#"+a+"_options").clone(!0):u=e(document.createElement(o)),u=i.prepareInputFromFactory(u,fieldId,a,l,n),u.val("select"===o?s.children(".v").first().text():s.text()),s.hasClass("date")&&(u.datepicker({changeMonth:!0,changeYear:!0,closeText:"Close",dateFormat:"yy-mm-dd",firstDay:1,showOn:"button",onClose:function(){e(this).focus()},selectOtherMonths:!0,showAnim:"",showButtonPanel:!0,showOtherMonths:!0}),s.unbind("click"),s.click(function(){u.datepicker("show")}),u.mouseup(function(){e(this).datepicker("show")})),u.focus(function(){i.$.data("focus",e(this).attr("name"))}),u.blur(function(){i.$.data("focus","")}),e("<label />").attr({"for":u.attr("id")}).text(r).appendTo(t),u.appendTo(t)}),this.displayEditor(t),this.editorDisplayed(t),t},findFactory:function(t,i,n){return newInput=e("#"+n+"_options_"+t+"_"+i),0===newInput.length&&(newInput=e("#status_id_options_default_"+i)),newInput=newInput.clone(!0)},prepareInputFromFactory:function(e,t,i,n,s){return e.attr("id",i+"_"+t),e.attr("name",i),e.attr("tabindex",n+s),e.addClass(i),e.addClass("editor"),e.removeClass("template"),e.removeClass("helper"),e},replaceStatusForNewType:function(t,i,n,s){i.val(n),i.val()!==n&&(i.append(new Option("","")),i.val("")),i.focus(function(){self.$.data("focus",e(this).attr("name"))}),i.blur(function(){self.$.data("focus","")}),i.appendTo(s),t.parent().find(".status_id").replaceWith(i)},editDialogTitle:function(){return"Edit "+this.getType()},editorDisplayed:function(){},endEdit:function(){this.$.removeClass("editing")},error:function(t,i,n){this.markError(),RB.Dialog.msg(e(t.responseText).find(".errors").html()),this.processError(t,i,n)},getEditor:function(){var t,i;return t=this.getType().toLowerCase()+"_editor",i=e("#"+t).html(""),0===i.length&&(i=e("<div id='"+t+"'></div>").appendTo("body")),i},getID:function(){return this.$.children(".id").children(".v").text()},getType:function(){throw"Child objects must override getType()"},handleClick:function(t){var i,n,s,o;i=e(this),n=i.parents(".model").first().data("this"),s=n.$,s.hasClass("editing")||s.hasClass("dragging")||s.hasClass("prevent_edit")||e(t.target).hasClass("prevent_edit")||(o=n.edit(),o.find("."+e(t.currentTarget).attr("fieldname")+".editor").focus())},handleSelect:function(t){var i=e(this),n=i.data("this");e(t.target).hasClass("editable")||e(t.target).hasClass("checkbox")||i.hasClass("editing")||"A"===t.target.tagName||i.hasClass("dragging")||n.setSelection(!n.isSelected())},isClosed:function(){return this.$.hasClass("closed")},isNew:function(){return""===this.getID()},markError:function(){this.$.addClass("error")},markIfClosed:function(){throw"Child objects must override markIfClosed()"},markSaving:function(){this.$.addClass("saving")},newDialogTitle:function(){return"New "+this.getType()},open:function(){this.$.removeClass("closed")},processError:function(){},refresh:function(t){this.$.html(t.$.html()),t.$.length>1&&t.$.filter("script").each(function(){try{e.globalEval(e(this).html())}catch(t){}}),t.isClosed()?this.close():this.open(),this.refreshed()},refreshed:function(){},saveDirectives:function(){throw"Child object must implement saveDirectives()"},saveEdits:function(){var t,i=this.$,n=this,s=i.find(".editor");s.each(function(){var t,n;t=e(this),n=t.attr("name"),this.type.match(/select/)?((""!==t.val()||"status_id"!==n)&&i.children("div."+n).children(".v").text(t.val()),i.children("div."+n).children(".t").text(t.children(":selected").text())):i.children("div."+n).text(t.val())}),n.markIfClosed(),t=n.saveDirectives(),n.beforeSave(),n.unmarkError(),n.markSaving(),RB.ajax({type:"POST",url:t.url,data:t.data,success:function(e,t,i){n.afterSave(e,t,i)},error:function(e,t,i){n.error(e,t,i)}}),n.endEdit()},unmarkError:function(){this.$.removeClass("error")},unmarkSaving:function(){this.$.removeClass("saving")}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.EditableInplace=function(e){return RB.Object.create(RB.Model,{displayEditor:function(e){this.$.addClass("editing"),e.find(".editor").bind("keyup",this.handleKeyup)},getEditor:function(){var t=this.$.children(".editors").first().html("");return 0===t.length&&(t=e("<div class='editors'></div>").appendTo(this.$)),t},handleKeyup:function(t){var i,n;switch(i=e(this).parents(".model").first(),n=i.data("this"),t.which){case 13:n.saveEdits();break;case 27:n.cancelEdit();break;default:return!0}}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.Sprint=function(e){return RB.Object.create(RB.Model,RB.EditableInplace,{initialize:function(t){this.$=e(t),this.el=t,this.$.data("this",this),this.$.find(".editable").mouseup(this.handleClick)},beforeSave:function(){},getType:function(){return"Sprint"},markIfClosed:function(){},refreshed:function(){this.$.find(".editable").mouseup(this.handleClick)},saveDirectives:function(){var e=this.$,t=e.find(".editor").serialize()+"&_method=put",i=RB.urlFor("update_sprint",{id:this.getID()});return{url:i,data:t}},beforeSaveDragResult:function(){}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.WorkPackage=function(e){return RB.Object.create(RB.Model,{initialize:function(t){this.$=e(t),this.el=t},beforeSaveDragResult:function(){},getType:function(){return"WorkPackage"},saveDragResult:function(){this.beforeSaveDragResult(),this.$.hasClass("editing")||this.saveEdits()}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.Story=function(e){return RB.Object.create(RB.WorkPackage,RB.EditableInplace,{initialize:function(t){this.$=e(t),this.el=t,this.$.data("this",this),this.$.find(".editable").live("mouseup",this.handleClick)},beforeSave:function(){this.refreshStory()},afterCreate:function(){this.refreshStory()},afterUpdate:function(){this.refreshStory()},refreshed:function(){this.refreshStory()},editDialogTitle:function(){return"Story #"+this.getID()},editorDisplayed:function(){},getPoints:function(){var e=parseInt(this.$.find(".story_points").first().text(),10);return isNaN(e)?0:e},getType:function(){return"Story"},markIfClosed:function(){},newDialogTitle:function(){return"New Story"},refreshStory:function(){this.recalcVelocity()},recalcVelocity:function(){this.$.parents(".backlog").first().data("this").refresh()},saveDirectives:function(){var e,t,i,n;return t=this.$.prev(),i=this.$.parents(".backlog").data("this").isSprintBacklog()?this.$.parents(".backlog").data("this").getSprint().data("this").getID():"",n="prev="+(1===t.length?t.data("this").getID():"")+"&fixed_version_id="+i,this.$.find(".editor").length>0&&(n+="&"+this.$.find(".editor").serialize()),this.isNew()?e=RB.urlFor("create_story",{sprint_id:i}):(e=RB.urlFor("update_story",{id:this.getID(),sprint_id:i}),n+="&_method=put"),{url:e,data:n}},beforeSaveDragResult:function(){}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.Task=function(e){return RB.Object.create(RB.WorkPackage,{initialize:function(t){this.$=e(t),this.el=t,this.$.addClass("task"),this.$.data("this",this),this.$.find(".editable").live("mouseup",this.handleClick),this.defaultColor=e("#rb .task").css("background-color")},beforeSave:function(){if(!this.el||!e(this.el).hasClass("dragging")){var t=this.$.find("select.assigned_to_id").children(":selected").attr("color")||this.defaultColor;this.$.css("background-color",t),this.$.colorcontrast()}},editorDisplayed:function(e){e.parents(".ui-dialog").css("background-color",this.$.css("background-color")),e.parents(".ui-dialog").colorcontrast()},getType:function(){return"Task"},markIfClosed:function(){this.$.parent("td").first().hasClass("closed")?this.$.addClass("closed"):this.$.removeClass("closed")},saveDirectives:function(){var e,t,i,n;return e=this.$.prev(),t=this.$.parent("td").first().attr("id").split("_"),i=this.$.find(".editor").serialize()+"&parent_id="+t[0]+"&status_id="+t[1]+"&prev="+(1===e.length?e.data("this").getID():"")+(this.isNew()?"":"&id="+this.$.children(".id").text()),this.isNew()?n=RB.urlFor("create_task",{sprint_id:RB.constants.sprint_id}):(n=RB.urlFor("update_task",{id:this.getID(),sprint_id:RB.constants.sprint_id}),i+="&_method=put"),{url:n,data:i}},beforeSaveDragResult:function(){this.$.parent("td").first().hasClass("closed")&&(this.$.children(".remaining_hours.editor").val(""),this.$.children(".remaining_hours.editable").text(""))},refreshed:function(){var e=this.$.children(".remaining_hours.editable");e.toggleClass("empty",e.is(":empty"))}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.Impediment=function(e){return RB.Object.create(RB.Task,{initialize:function(t){var i;this.$=i=e(t),this.el=t,i.addClass("impediment"),i.data("this",this),i.find(".editable").live("mouseup",this.handleClick)},saveDirectives:function(){var e,t,i,n,s;return e=this.$,t=this.$.prev(),i=e.parent("td").first().attr("id").split("_")[1],n=e.find(".editor").serialize()+"&is_impediment=true"+"&fixed_version_id="+RB.constants.sprint_id+"&status_id="+i+"&prev="+(1===t.length?t.data("this").getID():"")+(this.isNew()?"":"&id="+e.children(".id").text()),this.isNew()?s=RB.urlFor("create_impediment",{sprint_id:RB.constants.sprint_id}):(s=RB.urlFor("update_impediment",{id:this.getID(),sprint_id:RB.constants.sprint_id}),n+="&_method=put"),{url:s,data:n}}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
RB.Taskboard=function(e){return RB.Object.create(RB.Model,{initialize:function(t){var i=this;this.$=e(t),this.el=t,this.$.data("this",this),this.colWidthUnit=e(".swimlane").width(),this.defaultColWidth=1,this.loadColWidthPreference(),this.updateColWidths(),e("#col_width input").keyup(function(e){13===e.which&&i.updateColWidths()}),this.initializeTasks(),this.initializeImpediments(),this.initializeNewButtons(),this.initializeSortables()},initializeNewButtons:function(){this.$.find("#tasks .add_new.clickable").click(this.handleAddNewTaskClick),this.$.find("#impediments .add_new.clickable").click(this.handleAddNewImpedimentClick)},initializeSortables:function(){this.$.find("#impediments .list").sortable({placeholder:"placeholder",start:this.dragStart,stop:this.dragStop,update:this.dragComplete,cancel:".prevent_edit"}).sortable("option","connectWith","#impediments .list"),e("#impediments .list").disableSelection();var t,i,n=this;t=this.$.find("#tasks .list"),i=function(){e(t.splice(0,50)).sortable({placeholder:"placeholder",start:n.dragStart,stop:n.dragStop,update:n.dragComplete,cancel:".prevent_edit"}).sortable("option","connectWith","#tasks .list"),e("#tasks .list").disableSelection(),t.length>0&&setTimeout(i,10)},i()},initializeTasks:function(){this.$.find(".task").each(function(){RB.Factory.initialize(RB.Task,this)})},initializeImpediments:function(){this.$.find(".impediment").each(function(){RB.Factory.initialize(RB.Impediment,this)})},dragComplete:function(e,t){var i=null===t.sender;i&&t.item.data("this").saveDragResult()},dragStart:function(e,t){t.item.addClass("dragging")},dragStop:function(t,i){i.item.removeClass("dragging"),e.browser.msie&&e.browser.version<=7&&i.item.css("z-index",0)},handleAddNewImpedimentClick:function(){var t=e(this).parents("tr").first();e("#taskboard").data("this").newImpediment(t)},handleAddNewTaskClick:function(){var t=e(this).parents("tr").first();e("#taskboard").data("this").newTask(t)},loadColWidthPreference:function(){var t=RB.UserPreferences.get("taskboardColWidth");(null===t||void 0===t)&&(t=this.defaultColWidth,RB.UserPreferences.set("taskboardColWidth",t)),e("#col_width input").val(t)},newImpediment:function(t){var i,n;i=e("#impediment_template").children().first().clone(),t.find(".list").first().prepend(i),n=RB.Factory.initialize(RB.Impediment,i),n.edit()},newTask:function(t){var i,n;i=e("#task_template").children().first().clone(),t.find(".list").first().prepend(i),n=RB.Factory.initialize(RB.Task,i),n.edit()},updateColWidths:function(){var t=parseInt(e("#col_width input").val(),10);(isNaN(t)||0>=t)&&(t=this.defaultColWidth),e("#col_width input").val(t),RB.UserPreferences.set("taskboardColWidth",t),e(".swimlane").width(this.colWidthUnit*t).css("min-width",this.colWidthUnit*t)}})}(jQuery),//-- copyright
// Copyright (C)2013-2014 the OpenProject Foundation (OPF)
// Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
// Copyright (C)2010-2011 friflaj
// Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
// Copyright (C)2009-2010 Mark Maglana
// Copyright (C)2009 Joe Heck, Nate Lowrie
// The copyright follows:
// Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
// Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
// See doc/COPYRIGHT.rdoc for more details.
jQuery(function(e){var t;RB.Factory.initialize(RB.Taskboard,e("#taskboard")),e("#assigned_to_id_options").change(function(){var i=e(this).children(":selected");t||(t=e("#work_package_").css("background-color")),e(this).parents(".ui-dialog").css("background-color",i.attr("color")||t),e(this).parents(".ui-dialog").colorcontrast()})});