/* js bundle for tags

<script type="text/javascript">//<![CDATA[
window.CKEDITOR_BASEPATH = "/js/lib/ckeditor/";
//]]></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/jquery/jquery.js?v=6a8915f9"></script>
<script type="text/javascript">//<![CDATA[
jQuery.noConflict();
//]]></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/jquery/jquery-migrate-mute.js?v=58e01b12"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/jquery/jquery-migrate.js?v=3f1f3f6e"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/jquery/jquery-ui.js?v=d961c98f"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/stacktrace/stacktrace.js?v=b0b8ab14"></script>
<script type="text/javascript" src="<activebaseurl>/js/error_reporter.js?v=9ecc9ff3"></script>
<script type="text/javascript" src="<activebaseurl>/js/loadtime_tracker.js?v=73fd0722"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/backbone/underscore.js?v=2781eeee"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/backbone/underscore.string.js?v=d2ca80db"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/backbone/backbone.js?v=e62b5c5a"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/backbone/backbone.epoxy.js?v=e5af041c"></script>
<script type="text/javascript" src="<activebaseurl>/js/main.js?v=c6501e2d"></script>
<script type="text/javascript" src="<activebaseurl>/js/backbone_sync.js?v=3a930cd3"></script>
<script type="text/javascript" src="<activebaseurl>/js/lang/en_AU.js?v=f1d9baff"></script>
<script type="text/javascript" src="<activebaseurl>/js/model.js?v=a39753b9"></script>
<script type="text/javascript" src="<activebaseurl>/js/commonutils.js?v=8aa61ded"></script>
<script type="text/javascript" src="<activebaseurl>/js/commonui.js?v=ba667ce0"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/decimaljs/decimal.js?v=3e9986b6"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/ejs/ejs.js?v=db577997"></script>
<script type="text/javascript" src="<activebaseurl>/js/httpreq.js?v=c053ecac"></script>
<script type="text/javascript" src="<activebaseurl>/js/popup.js?v=b6a2efc0"></script>
<script type="text/javascript" src="<activebaseurl>/js/usermsg.js?v=2fe16aee"></script>
<script type="text/javascript" src="<activebaseurl>/js/framemain.js?v=0726ee00"></script>
<script type="text/javascript" src="<activebaseurl>/js/slidemenu.js?v=6e8318c6"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/jquery/plugins/select2/select2.js?v=18930125"></script>
<script type="text/javascript" src="<activebaseurl>/js/lib/mousetrap.js?v=1c0c22ed"></script>
<script type="text/javascript" src="<activebaseurl>/js/instasearch.js?v=75e77cdc"></script>

*/



          if (!window.Dependency) {
              window.Dependency = {_js: {}};
          }
        window.CKEDITOR_BASEPATH = "/js/lib/ckeditor/";
;
!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e){var t=!!e&&"length"in e&&e.length,n=K.type(e);return"function"!==n&&!K.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e,t,n){if(K.isFunction(t))return K.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return K.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ue.test(t))return K.filter(t,e,n);t=K.filter(t,e)}return K.grep(e,function(e){return V.call(t,e)>-1!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(){_.removeEventListener("DOMContentLoaded",o),e.removeEventListener("load",o),K.ready()}function s(){this.expando=K.expando+s.uid++}function a(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(be,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:xe.test(n)?K.parseJSON(n):n)}catch(e){}ye.set(e,t,n)}else n=void 0;return n}function u(e,t,n,r){var i,o=1,s=20,a=r?function(){return r.cur()}:function(){return K.css(e,t,"")},u=a(),l=n&&n[3]||(K.cssNumber[t]?"":"px"),c=(K.cssNumber[t]||"px"!==l&&+u)&&Te.exec(K.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do{c/=o=o||".5",K.style(e,t,c+l)}while(o!==(o=a()/u)&&1!==o&&--s)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function l(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&K.nodeName(e,t)?K.merge([e],n):n}function c(e,t){for(var n=0,r=e.length;n<r;n++)ve.set(e[n],"globalEval",!t||ve.get(t[n],"globalEval"))}function f(e,t,n,r,i){for(var o,s,a,u,f,p,d=t.createDocumentFragment(),h=[],g=0,m=e.length;g<m;g++)if((o=e[g])||0===o)if("object"===K.type(o))K.merge(h,o.nodeType?[o]:o);else if(qe.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(Ne.exec(o)||["",""])[1].toLowerCase(),u=je[a]||je._default,s.innerHTML=u[1]+K.htmlPrefilter(o)+u[2],p=u[0];p--;)s=s.lastChild;K.merge(h,s.childNodes),(s=d.firstChild).textContent=""}else h.push(t.createTextNode(o));for(d.textContent="",g=0;o=h[g++];)if(r&&K.inArray(o,r)>-1)i&&i.push(o);else if(f=K.contains(o.ownerDocument,o),s=l(d.appendChild(o),"script"),f&&c(s),n)for(p=0;o=s[p++];)Se.test(o.type||"")&&n.push(o);return d}function p(){return!0}function d(){return!1}function h(){try{return _.activeElement}catch(e){}}function g(e,t,n,r,i,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)g(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=d;else if(!i)return e;return 1===o&&(s=i,(i=function(e){return K().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=K.guid++)),e.each(function(){K.event.add(this,t,i,r,n)})}function m(e,t){return K.nodeName(e,"table")&&K.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function v(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function y(e){var t=Me.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function x(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(ve.hasData(e)&&(o=ve.access(e),s=ve.set(t,o),l=o.events))for(i in delete s.handle,s.events={},l)for(n=0,r=l[i].length;n<r;n++)K.event.add(t,i,l[i][n]);ye.hasData(e)&&(a=ye.access(e),u=K.extend({},a),ye.set(t,u))}}function b(e,t,n,r){t=z.apply([],t);var i,o,s,a,u,c,p=0,d=e.length,h=d-1,g=t[0],m=K.isFunction(g);if(m||d>1&&"string"==typeof g&&!J.checkClone&&Re.test(g))return e.each(function(i){var o=e.eq(i);m&&(t[0]=g.call(this,i,o.html())),b(o,t,n,r)});if(d&&(o=(i=f(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=(s=K.map(l(i,"script"),v)).length;p<d;p++)u=i,p!==h&&(u=K.clone(u,!0,!0),a&&K.merge(s,l(u,"script"))),n.call(e[p],u,p);if(a)for(c=s[s.length-1].ownerDocument,K.map(s,y),p=0;p<a;p++)u=s[p],Se.test(u.type||"")&&!ve.access(u,"globalEval")&&K.contains(c,u)&&(u.src?K._evalUrl&&K._evalUrl(u.src):K.globalEval(u.textContent.replace(Ie,"")))}return e}function w(e,t,n){for(var r,i=t?K.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||K.cleanData(l(r)),r.parentNode&&(n&&K.contains(r.ownerDocument,r)&&c(l(r,"script")),r.parentNode.removeChild(r));return e}function T(e,t){var n=K(t.createElement(e)).appendTo(t.body),r=K.css(n[0],"display");return n.detach(),r}function C(e){var t=_,n=$e[e];return n||("none"!==(n=T(e,t))&&n||((t=(We=(We||K("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentDocument).write(),t.close(),n=T(e,t),We.detach()),$e[e]=n),n}function k(e,t,n){var r,i,o,s,a=e.style;return""!==(s=(n=n||Xe(e))?n.getPropertyValue(t)||n[t]:void 0)&&void 0!==s||K.contains(e.ownerDocument,e)||(s=K.style(e,t)),n&&!J.pixelMarginRight()&&_e.test(s)&&Be.test(t)&&(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o),void 0!==s?s+"":s}function E(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}function N(e){if(e in Je)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;n--;)if((e=Qe[n]+t)in Je)return e}function S(e,t,n){var r=Te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function j(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;o<4;o+=2)"margin"===n&&(s+=K.css(e,n+Ce[o],!0,i)),r?("content"===n&&(s-=K.css(e,"padding"+Ce[o],!0,i)),"margin"!==n&&(s-=K.css(e,"border"+Ce[o]+"Width",!0,i))):(s+=K.css(e,"padding"+Ce[o],!0,i),"padding"!==n&&(s+=K.css(e,"border"+Ce[o]+"Width",!0,i)));return s}function D(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Xe(e),s="border-box"===K.css(e,"boxSizing",!1,o);if(i<=0||null==i){if(((i=k(e,t,o))<0||null==i)&&(i=e.style[t]),_e.test(i))return i;r=s&&(J.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+j(e,t,n||(s?"border":"content"),r,o)+"px"}function A(e,t){for(var n,r,i,o=[],s=0,a=e.length;s<a;s++)(r=e[s]).style&&(o[s]=ve.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&ke(r)&&(o[s]=ve.access(r,"olddisplay",C(r.nodeName)))):(i=ke(r),"none"===n&&i||ve.set(r,"olddisplay",i?n:K.css(r,"display"))));for(s=0;s<a;s++)(r=e[s]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}function q(e,t,n,r,i){return new q.prototype.init(e,t,n,r,i)}function L(){return e.setTimeout(function(){Ke=void 0}),Ke=K.now()}function H(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Ce[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function O(e,t,n){for(var r,i=(F.tweeners[t]||[]).concat(F.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,t,e))return r}function F(e,t,n){var r,i,o=0,s=F.prefilters.length,a=K.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Ke||L(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,s=l.tweens.length;o<s;o++)l.tweens[o].run(r);return a.notifyWith(e,[l,r,n]),r<1&&s?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:K.extend({},t),opts:K.extend(!0,{specialEasing:{},easing:K.easing._default},n),originalProperties:t,originalOptions:n,startTime:Ke||L(),duration:n.duration,tweens:[],createTween:function(t,n){var r=K.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(a.notifyWith(e,[l,1,0]),a.resolveWith(e,[l,t])):a.rejectWith(e,[l,t]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,s;for(n in e)if(i=t[r=K.camelCase(n)],o=e[n],K.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(s=K.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);o<s;o++)if(r=F.prefilters[o].call(l,e,c,l.opts))return K.isFunction(r.stop)&&(K._queueHooks(l.elem,l.opts.queue).stop=K.proxy(r.stop,r)),r;return K.map(c,O,l),K.isFunction(l.opts.start)&&l.opts.start.call(e,l),K.fx.timer(K.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function P(e){return e.getAttribute&&e.getAttribute("class")||""}function R(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(he)||[];if(K.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function M(e,t,n,r){function i(a){var u;return o[a]=!0,K.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||s||o[l]?s?!(u=l):void 0:(t.dataTypes.unshift(l),i(l),!1)}),u}var o={},s=e===xt;return i(t.dataTypes[0])||!o["*"]&&i("*")}function I(e,t){var n,r,i=K.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&K.extend(!0,e,r),e}function W(e,t,n,r){var i;if(K.isArray(t))K.each(t,function(t,i){n||Ct.test(e)?r(e,i):W(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==K.type(t))r(e,t);else for(i in t)W(e+"["+i+"]",t[i],n,r)}function $(e){return K.isWindow(e)?e:9===e.nodeType&&e.defaultView}var B=[],_=e.document,X=B.slice,z=B.concat,U=B.push,V=B.indexOf,Y={},G=Y.toString,Q=Y.hasOwnProperty,J={},K=function(e,t){return new K.fn.init(e,t)},Z=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ee=/^-ms-/,te=/-([\da-z])/gi,ne=function(e,t){return t.toUpperCase()};K.fn=K.prototype={jquery:"2.2.4",constructor:K,selector:"",length:0,toArray:function(){return X.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:X.call(this)},pushStack:function(e){var t=K.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return K.each(this,e)},map:function(e){return this.pushStack(K.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(X.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:U,sort:B.sort,splice:B.splice},K.extend=K.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[a]||{},a++),"object"==typeof s||K.isFunction(s)||(s={}),a===u&&(s=this,a--);a<u;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],s!==(r=e[t])&&(l&&r&&(K.isPlainObject(r)||(i=K.isArray(r)))?(i?(i=!1,o=n&&K.isArray(n)?n:[]):o=n&&K.isPlainObject(n)?n:{},s[t]=K.extend(l,o,r)):void 0!==r&&(s[t]=r));return s},K.extend({expando:"jQuery"+("2.2.4"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===K.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=e&&e.toString();return!K.isArray(e)&&t-parseFloat(t)+1>=0},isPlainObject:function(e){var t;if("object"!==K.type(e)||e.nodeType||K.isWindow(e))return!1;if(e.constructor&&!Q.call(e,"constructor")&&!Q.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return void 0===t||Q.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Y[G.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;(e=K.trim(e))&&(1===e.indexOf("use strict")?((t=_.createElement("script")).text=e,_.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(ee,"ms-").replace(te,ne)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;i<r&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},trim:function(e){return null==e?"":(e+"").replace(Z,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?K.merge(r,"string"==typeof e?[e]:e):U.call(r,e)),r},inArray:function(e,t,n){return null==t?-1:V.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,s=!n;i<o;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,r){var i,o,s=0,a=[];if(n(e))for(i=e.length;s<i;s++)null!=(o=t(e[s],s,r))&&a.push(o);else for(s in e)null!=(o=t(e[s],s,r))&&a.push(o);return z.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),K.isFunction(e))return r=X.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(X.call(arguments)))}).guid=e.guid=e.guid||K.guid++,i},now:Date.now,support:J}),"function"==typeof Symbol&&(K.fn[Symbol.iterator]=B[Symbol.iterator]),K.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){Y["[object "+t+"]"]=t.toLowerCase()});var re=function(e){function t(e,t,n,r){var i,o,s,a,u,l,f,d,h=t&&t.ownerDocument,g=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==g&&9!==g&&11!==g)return n;if(!r&&((t?t.ownerDocument||t:M)!==A&&D(t),t=t||A,L)){if(11!==g&&(l=ge.exec(e)))if(i=l[1]){if(9===g){if(!(s=t.getElementById(i)))return n;if(s.id===i)return n.push(s),n}else if(h&&(s=h.getElementById(i))&&P(t,s)&&s.id===i)return n.push(s),n}else{if(l[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&x.getElementsByClassName&&t.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(i)),n}if(x.qsa&&!_[e+" "]&&(!H||!H.test(e))){if(1!==g)h=t,d=e;else if("object"!==t.nodeName.toLowerCase()){for((a=t.getAttribute("id"))?a=a.replace(ve,"\\$&"):t.setAttribute("id",a=R),o=(f=C(e)).length,u=ce.test(a)?"#"+a:"[id='"+a+"']";o--;)f[o]=u+" "+p(f[o]);d=f.join(","),h=me.test(e)&&c(t.parentNode)||t}if(d)try{return Q.apply(n,h.querySelectorAll(d)),n}catch(e){}finally{a===R&&t.removeAttribute("id")}}}return E(e.replace(oe,"$1"),t,n,r)}function n(){var e=[];return function t(n,r){return e.push(n+" ")>b.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function r(e){return e[R]=!0,e}function i(e){var t=A.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)b.attrHandle[n[r]]=t}function s(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||z)-(~e.sourceIndex||z);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function p(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,s){var a,u,l,c=[I,o];if(s){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if((a=(u=(l=t[R]||(t[R]={}))[t.uniqueID]||(l[t.uniqueID]={}))[r])&&a[0]===I&&a[1]===o)return c[2]=a[2];if(u[r]=c,c[2]=e(t,n,s))return!0}}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,t,n,r,i){for(var o,s=[],a=0,u=e.length,l=null!=t;a<u;a++)(o=e[a])&&(n&&!n(o,r,i)||(s.push(o),l&&t.push(a)));return s}function m(e,n,i,o,s,a){return o&&!o[R]&&(o=m(o)),s&&!s[R]&&(s=m(s,a)),r(function(r,a,u,l){var c,f,p,d=[],h=[],m=a.length,v=r||function(e,n,r){for(var i=0,o=n.length;i<o;i++)t(e,n[i],r);return r}(n||"*",u.nodeType?[u]:u,[]),y=!e||!r&&n?v:g(v,d,e,u,l),x=i?s||(r?e:m||o)?[]:a:y;if(i&&i(y,x,u,l),o)for(c=g(x,h),o(c,[],u,l),f=c.length;f--;)(p=c[f])&&(x[h[f]]=!(y[h[f]]=p));if(r){if(s||e){if(s){for(c=[],f=x.length;f--;)(p=x[f])&&c.push(y[f]=p);s(null,x=[],c,l)}for(f=x.length;f--;)(p=x[f])&&(c=s?K(r,p):d[f])>-1&&(r[c]=!(a[c]=p))}}else x=g(x===a?x.splice(m,x.length):x),s?s(null,a,x,l):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=b.relative[e[0].type],s=o||b.relative[" "],a=o?1:0,u=d(function(e){return e===t},s,!0),l=d(function(e){return K(t,e)>-1},s,!0),c=[function(e,n,r){var i=!o&&(r||n!==N)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];a<i;a++)if(n=b.relative[e[a].type])c=[d(h(c),n)];else{if((n=b.filter[e[a].type].apply(null,e[a].matches))[R]){for(r=++a;r<i&&!b.relative[e[r].type];r++);return m(a>1&&h(c),a>1&&p(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(oe,"$1"),n,a<r&&v(e.slice(a,r)),r<i&&v(e=e.slice(r)),r<i&&p(e))}c.push(n)}return h(c)}var y,x,b,w,T,C,k,E,N,S,j,D,A,q,L,H,O,F,P,R="sizzle"+1*new Date,M=e.document,I=0,W=0,$=n(),B=n(),_=n(),X=function(e,t){return e===t&&(j=!0),0},z=1<<31,U={}.hasOwnProperty,V=[],Y=V.pop,G=V.push,Q=V.push,J=V.slice,K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},Z="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ee="[\\x20\\t\\r\\n\\f]",te="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ne="\\["+ee+"*("+te+")(?:"+ee+"*([*^$|!~]?=)"+ee+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+te+"))|)"+ee+"*\\]",re=":("+te+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ne+")*)|.*)\\)|)",ie=new RegExp(ee+"+","g"),oe=new RegExp("^"+ee+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ee+"+$","g"),se=new RegExp("^"+ee+"*,"+ee+"*"),ae=new RegExp("^"+ee+"*([>+~]|"+ee+")"+ee+"*"),ue=new RegExp("="+ee+"*([^\\]'\"]*?)"+ee+"*\\]","g"),le=new RegExp(re),ce=new RegExp("^"+te+"$"),fe={ID:new RegExp("^#("+te+")"),CLASS:new RegExp("^\\.("+te+")"),TAG:new RegExp("^("+te+"|[*])"),ATTR:new RegExp("^"+ne),PSEUDO:new RegExp("^"+re),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ee+"*(even|odd|(([+-]|)(\\d*)n|)"+ee+"*(?:([+-]|)"+ee+"*(\\d+)|))"+ee+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+ee+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ee+"*((?:-\\d)?\\d*)"+ee+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,de=/^h\d$/i,he=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,me=/[+~]/,ve=/'|\\/g,ye=new RegExp("\\\\([\\da-f]{1,6}"+ee+"?|("+ee+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},be=function(){D()};try{Q.apply(V=J.call(M.childNodes),M.childNodes),V[M.childNodes.length].nodeType}catch(e){Q={apply:V.length?function(e,t){G.apply(e,J.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}for(y in x=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},D=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:M;return r!==A&&9===r.nodeType&&r.documentElement?(q=(A=r).documentElement,L=!T(A),(n=A.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",be,!1):n.attachEvent&&n.attachEvent("onunload",be)),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(A.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=he.test(A.getElementsByClassName),x.getById=i(function(e){return q.appendChild(e).id=R,!A.getElementsByName||!A.getElementsByName(R).length}),x.getById?(b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&L){var n=t.getElementById(e);return n?[n]:[]}},b.filter.ID=function(e){var t=e.replace(ye,xe);return function(e){return e.getAttribute("id")===t}}):(delete b.find.ID,b.filter.ID=function(e){var t=e.replace(ye,xe);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),b.find.TAG=x.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):x.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=x.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&L)return t.getElementsByClassName(e)},O=[],H=[],(x.qsa=he.test(A.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="<a id='"+R+"'></a><select id='"+R+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&H.push("[*^$]="+ee+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||H.push("\\["+ee+"*(?:value|"+Z+")"),e.querySelectorAll("[id~="+R+"-]").length||H.push("~="),e.querySelectorAll(":checked").length||H.push(":checked"),e.querySelectorAll("a#"+R+"+*").length||H.push(".#.+[+~]")}),i(function(e){var t=A.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&H.push("name"+ee+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||H.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),H.push(",.*:")})),(x.matchesSelector=he.test(F=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){x.disconnectedMatch=F.call(e,"div"),F.call(e,"[s!='']:x"),O.push("!=",re)}),H=H.length&&new RegExp(H.join("|")),O=O.length&&new RegExp(O.join("|")),t=he.test(q.compareDocumentPosition),P=t||he.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},X=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===A||e.ownerDocument===M&&P(M,e)?-1:t===A||t.ownerDocument===M&&P(M,t)?1:S?K(S,e)-K(S,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],u=[t];if(!i||!o)return e===A?-1:t===A?1:i?-1:o?1:S?K(S,e)-K(S,t):0;if(i===o)return s(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?s(a[r],u[r]):a[r]===M?-1:u[r]===M?1:0},A):A},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==A&&D(e),n=n.replace(ue,"='$1']"),x.matchesSelector&&L&&!_[n+" "]&&(!O||!O.test(n))&&(!H||!H.test(n)))try{var r=F.call(e,n);if(r||x.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,A,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==A&&D(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==A&&D(e);var n=b.attrHandle[t.toLowerCase()],r=n&&U.call(b.attrHandle,t.toLowerCase())?n(e,t,!L):void 0;return void 0!==r?r:x.attributes||!L?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!x.detectDuplicates,S=!x.sortStable&&e.slice(0),e.sort(X),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return S=null,e},w=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=w(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=w(t);return n},(b=t.selectors={cacheLength:50,createPseudo:r,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ye,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(ye,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&le.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ye,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ee+")"+e+"("+ee+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ie," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!u&&!a,x=!1;if(m){if(o){for(;g;){for(p=t;p=p[g];)if(a?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&y){for(x=(d=(l=(c=(f=(p=m)[R]||(p[R]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===I&&l[1])&&l[2],p=d&&m.childNodes[d];p=++d&&p&&p[g]||(x=d=0)||h.pop();)if(1===p.nodeType&&++x&&p===t){c[e]=[I,d,x];break}}else if(y&&(x=d=(l=(c=(f=(p=t)[R]||(p[R]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===I&&l[1]),!1===x)for(;(p=++d&&p&&p[g]||(x=d=0)||h.pop())&&((a?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++x||(y&&((c=(f=p[R]||(p[R]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[I,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=b.pseudos[e]||b.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[R]?o(n):o.length>1?(i=[e,e,"",n],b.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),s=i.length;s--;)e[r=K(e,i[s])]=!(t[r]=i[s])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(oe,"$1"));return i[R]?r(function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(ye,xe),function(t){return(t.textContent||t.innerText||w(t)).indexOf(e)>-1}}),lang:r(function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ye,xe).toLowerCase(),function(t){var n;do{if(n=L?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===A.activeElement&&(!A.hasFocus||A.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return de.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:l(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:l(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[y]=a(y);for(y in{submit:!0,reset:!0})b.pseudos[y]=u(y);return f.prototype=b.filters=b.pseudos,b.setFilters=new f,C=t.tokenize=function(e,n){var r,i,o,s,a,u,l,c=B[e+" "];if(c)return n?0:c.slice(0);for(a=e,u=[],l=b.preFilter;a;){for(s in r&&!(i=se.exec(a))||(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),r=!1,(i=ae.exec(a))&&(r=i.shift(),o.push({value:r,type:i[0].replace(oe," ")}),a=a.slice(r.length)),b.filter)!(i=fe[s].exec(a))||l[s]&&!(i=l[s](i))||(r=i.shift(),o.push({value:r,type:s,matches:i}),a=a.slice(r.length));if(!r)break}return n?a.length:a?t.error(e):B(e,u).slice(0)},k=t.compile=function(e,n){var i,o=[],s=[],a=_[e+" "];if(!a){for(n||(n=C(e)),i=n.length;i--;)(a=v(n[i]))[R]?o.push(a):s.push(a);(a=_(e,function(e,n){var i=n.length>0,o=e.length>0,s=function(r,s,a,u,l){var c,f,p,d=0,h="0",m=r&&[],v=[],y=N,x=r||o&&b.find.TAG("*",l),w=I+=null==y?1:Math.random()||.1,T=x.length;for(l&&(N=s===A||s||l);h!==T&&null!=(c=x[h]);h++){if(o&&c){for(f=0,s||c.ownerDocument===A||(D(c),a=!L);p=e[f++];)if(p(c,s||A,a)){u.push(c);break}l&&(I=w)}i&&((c=!p&&c)&&d--,r&&m.push(c))}if(d+=h,i&&h!==d){for(f=0;p=n[f++];)p(m,v,s,a);if(r){if(d>0)for(;h--;)m[h]||v[h]||(v[h]=Y.call(u));v=g(v)}Q.apply(u,v),l&&!r&&v.length>0&&d+n.length>1&&t.uniqueSort(u)}return l&&(I=w,N=y),m};return i?r(s):s}(s,o))).selector=e}return a},E=t.select=function(e,t,n,r){var i,o,s,a,u,l="function"==typeof e&&e,f=!r&&C(e=l.selector||e);if(n=n||[],1===f.length){if((o=f[0]=f[0].slice(0)).length>2&&"ID"===(s=o[0]).type&&x.getById&&9===t.nodeType&&L&&b.relative[o[1].type]){if(!(t=(b.find.ID(s.matches[0].replace(ye,xe),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=fe.needsContext.test(e)?0:o.length;i--&&(s=o[i],!b.relative[a=s.type]);)if((u=b.find[a])&&(r=u(s.matches[0].replace(ye,xe),me.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&p(o)))return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!L,n,!t||me.test(e)&&c(t.parentNode)||t),n},x.sortStable=R.split("").sort(X).join("")===R,x.detectDuplicates=!!j,D(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(A.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(Z,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);K.find=re,K.expr=re.selectors,K.expr[":"]=K.expr.pseudos,K.uniqueSort=K.unique=re.uniqueSort,K.text=re.getText,K.isXMLDoc=re.isXML,K.contains=re.contains;var ie=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&K(e).is(n))break;r.push(e)}return r},oe=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},se=K.expr.match.needsContext,ae=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,ue=/^.[^:#\[\.,]*$/;K.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?K.find.matchesSelector(r,e)?[r]:[]:K.find.matches(e,K.grep(t,function(e){return 1===e.nodeType}))},K.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(K(e).filter(function(){for(t=0;t<n;t++)if(K.contains(i[t],this))return!0}));for(t=0;t<n;t++)K.find(e,i[t],r);return(r=this.pushStack(n>1?K.unique(r):r)).selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&se.test(e)?K(e):e||[],!1).length}});var le,ce=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(K.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||le,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:ce.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof K?t[0]:t,K.merge(this,K.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:_,!0)),ae.test(r[1])&&K.isPlainObject(t))for(r in t)K.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=_.getElementById(r[2]))&&i.parentNode&&(this.length=1,this[0]=i),this.context=_,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):K.isFunction(e)?void 0!==n.ready?n.ready(e):e(K):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),K.makeArray(e,this))}).prototype=K.fn,le=K(_);var fe=/^(?:parents|prev(?:Until|All))/,pe={children:!0,contents:!0,next:!0,prev:!0};K.fn.extend({has:function(e){var t=K(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(K.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],s=se.test(e)||"string"!=typeof e?K(e,t||this.context):0;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&K.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?K.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?V.call(K(e),this[0]):V.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(K.uniqueSort(K.merge(this.get(),K(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),K.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ie(e,"parentNode")},parentsUntil:function(e,t,n){return ie(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return ie(e,"nextSibling")},prevAll:function(e){return ie(e,"previousSibling")},nextUntil:function(e,t,n){return ie(e,"nextSibling",n)},prevUntil:function(e,t,n){return ie(e,"previousSibling",n)},siblings:function(e){return oe((e.parentNode||{}).firstChild,e)},children:function(e){return oe(e.firstChild)},contents:function(e){return e.contentDocument||K.merge([],e.childNodes)}},function(e,t){K.fn[e]=function(n,r){var i=K.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=K.filter(r,i)),this.length>1&&(pe[e]||K.uniqueSort(i),fe.test(e)&&i.reverse()),this.pushStack(i)}});var de,he=/\S+/g;K.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return K.each(e.match(he)||[],function(e,n){t[n]=!0}),t}(e):K.extend({},e);var t,n,r,i,o=[],s=[],a=-1,u=function(){for(i=e.once,r=t=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(a=o.length-1,s.push(n)),function t(n){K.each(n,function(n,r){K.isFunction(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==K.type(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return K.each(arguments,function(e,t){for(var n;(n=K.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--}),this},has:function(e){return e?K.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},K.extend({Deferred:function(e){var t=[["resolve","done",K.Callbacks("once memory"),"resolved"],["reject","fail",K.Callbacks("once memory"),"rejected"],["notify","progress",K.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return K.Deferred(function(n){K.each(t,function(t,o){var s=K.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&K.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?K.extend(e,r):r}},i={};return r.pipe=r.then,K.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=X.call(arguments),s=o.length,a=1!==s||e&&K.isFunction(e.promise)?s:0,u=1===a?e:K.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?X.call(arguments):i,r===t?u.notifyWith(n,r):--a||u.resolveWith(n,r)}};if(s>1)for(t=new Array(s),n=new Array(s),r=new Array(s);i<s;i++)o[i]&&K.isFunction(o[i].promise)?o[i].promise().progress(l(i,n,t)).done(l(i,r,o)).fail(u.reject):--a;return a||u.resolveWith(r,o),u.promise()}}),K.fn.ready=function(e){return K.ready.promise().done(e),this},K.extend({isReady:!1,readyWait:1,holdReady:function(e){e?K.readyWait++:K.ready(!0)},ready:function(e){(!0===e?--K.readyWait:K.isReady)||(K.isReady=!0,!0!==e&&--K.readyWait>0||(de.resolveWith(_,[K]),K.fn.triggerHandler&&(K(_).triggerHandler("ready"),K(_).off("ready"))))}}),K.ready.promise=function(t){return de||(de=K.Deferred(),"complete"===_.readyState||"loading"!==_.readyState&&!_.documentElement.doScroll?e.setTimeout(K.ready):(_.addEventListener("DOMContentLoaded",o),e.addEventListener("load",o))),de.promise(t)},K.ready.promise();var ge=function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===K.type(n))for(a in i=!0,n)ge(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,K.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(K(e),n)})),t))for(;a<u;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},me=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};s.uid=1,s.prototype={register:function(e,t){var n=t||{};return e.nodeType?e[this.expando]=n:Object.defineProperty(e,this.expando,{value:n,writable:!0,configurable:!0}),e[this.expando]},cache:function(e){if(!me(e))return{};var t=e[this.expando];return t||(t={},me(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[t]=n;else for(r in t)i[r]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?void 0!==(r=this.get(e,t))?r:this.get(e,K.camelCase(t)):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,o=e[this.expando];if(void 0!==o){if(void 0===t)this.register(e);else{K.isArray(t)?r=t.concat(t.map(K.camelCase)):(i=K.camelCase(t),r=t in o?[t,i]:(r=i)in o?[r]:r.match(he)||[]),n=r.length;for(;n--;)delete o[r[n]]}(void 0===t||K.isEmptyObject(o))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!K.isEmptyObject(t)}};var ve=new s,ye=new s,xe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,be=/[A-Z]/g;K.extend({hasData:function(e){return ye.hasData(e)||ve.hasData(e)},data:function(e,t,n){return ye.access(e,t,n)},removeData:function(e,t){ye.remove(e,t)},_data:function(e,t,n){return ve.access(e,t,n)},_removeData:function(e,t){ve.remove(e,t)}}),K.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=ye.get(o),1===o.nodeType&&!ve.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=K.camelCase(r.slice(5)),a(o,r,i[r]));ve.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){ye.set(this,e)}):ge(this,function(t){var n,r;if(o&&void 0===t)return void 0!==(n=ye.get(o,e)||ye.get(o,e.replace(be,"-$&").toLowerCase()))?n:(r=K.camelCase(e),void 0!==(n=ye.get(o,r))?n:void 0!==(n=a(o,r,void 0))?n:void 0);r=K.camelCase(e),this.each(function(){var n=ye.get(this,r);ye.set(this,r,t),e.indexOf("-")>-1&&void 0!==n&&ye.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){ye.remove(this,e)})}}),K.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ve.get(e,t),n&&(!r||K.isArray(n)?r=ve.access(e,t,K.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=K.queue(e,t),r=n.length,i=n.shift(),o=K._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){K.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ve.get(e,n)||ve.access(e,n,{empty:K.Callbacks("once memory").add(function(){ve.remove(e,[t+"queue",n])})})}}),K.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?K.queue(this[0],e):void 0===t?this:this.each(function(){var n=K.queue(this,e,t);K._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&K.dequeue(this,e)})},dequeue:function(e){return this.each(function(){K.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=K.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=ve.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var we=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Te=new RegExp("^(?:([+-])=|)("+we+")([a-z%]*)$","i"),Ce=["Top","Right","Bottom","Left"],ke=function(e,t){return e=t||e,"none"===K.css(e,"display")||!K.contains(e.ownerDocument,e)},Ee=/^(?:checkbox|radio)$/i,Ne=/<([\w:-]+)/,Se=/^$|\/(?:java|ecma)script/i,je={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};je.optgroup=je.option,je.tbody=je.tfoot=je.colgroup=je.caption=je.thead,je.th=je.td;var De,Ae,qe=/<|&#?\w+;/;De=_.createDocumentFragment().appendChild(_.createElement("div")),(Ae=_.createElement("input")).setAttribute("type","radio"),Ae.setAttribute("checked","checked"),Ae.setAttribute("name","t"),De.appendChild(Ae),J.checkClone=De.cloneNode(!0).cloneNode(!0).lastChild.checked,De.innerHTML="<textarea>x</textarea>",J.noCloneChecked=!!De.cloneNode(!0).lastChild.defaultValue;var Le=/^key/,He=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Oe=/^([^.]*)(?:\.(.+)|)/;K.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,d,h,g,m=ve.get(e);if(m)for(n.handler&&(n=(o=n).handler,i=o.selector),n.guid||(n.guid=K.guid++),(u=m.events)||(u=m.events={}),(s=m.handle)||(s=m.handle=function(t){return"undefined"!=typeof K&&K.event.triggered!==t.type?K.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(he)||[""]).length;l--;)d=g=(a=Oe.exec(t[l])||[])[1],h=(a[2]||"").split(".").sort(),d&&(f=K.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=K.event.special[d]||{},c=K.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&K.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,s)||e.addEventListener&&e.addEventListener(d,s)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),K.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,d,h,g,m=ve.hasData(e)&&ve.get(e);if(m&&(u=m.events)){for(l=(t=(t||"").match(he)||[""]).length;l--;)if(d=g=(a=Oe.exec(t[l])||[])[1],h=(a[2]||"").split(".").sort(),d){for(f=K.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));s&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,m.handle)||K.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)K.event.remove(e,d+t[l],n,r,!0);K.isEmptyObject(u)&&ve.remove(e,"handle events")}},dispatch:function(e){e=K.event.fix(e);var t,n,r,i,o,s,a=X.call(arguments),u=(ve.get(this,"events")||{})[e.type]||[],l=K.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,e)){for(s=K.event.handlers.call(this,e,u),t=0;(i=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,void 0!==(r=((K.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(e.result=r)&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&(!0!==u.disabled||"click"!==e.type)){for(r=[],n=0;n<a;n++)void 0===r[i=(o=t[n]).selector+" "]&&(r[i]=o.needsContext?K(i,this).index(u)>-1:K.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return a<t.length&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button;return null==e.pageX&&null!=t.clientX&&(r=(n=e.target.ownerDocument||_).documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[K.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=He.test(i)?this.mouseHooks:Le.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new K.Event(o),t=r.length;t--;)e[n=r[t]]=o[n];return e.target||(e.target=_),3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==h()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===h()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&K.nodeName(this,"input"))return this.click(),!1},_default:function(e){return K.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},K.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},K.Event=function(e,t){if(!(this instanceof K.Event))return new K.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?p:d):this.type=e,t&&K.extend(this,t),this.timeStamp=e&&e.timeStamp||K.now(),this[K.expando]=!0},K.Event.prototype={constructor:K.Event,isDefaultPrevented:d,isPropagationStopped:d,isImmediatePropagationStopped:d,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=p,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=p,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=p,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},K.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){K.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||K.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),K.fn.extend({on:function(e,t,n,r){return g(this,e,t,n,r)},one:function(e,t,n,r){return g(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,K(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=d),this.each(function(){K.event.remove(this,e,n,t)})}});var Fe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Pe=/<script|<style|<link/i,Re=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^true\/(.*)/,Ie=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;K.extend({htmlPrefilter:function(e){return e.replace(Fe,"<$1></$2>")},clone:function(e,t,n){var r,i,o,s,a,u,f,p=e.cloneNode(!0),d=K.contains(e.ownerDocument,e);if(!(J.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||K.isXMLDoc(e)))for(s=l(p),r=0,i=(o=l(e)).length;r<i;r++)a=o[r],u=s[r],void 0,"input"===(f=u.nodeName.toLowerCase())&&Ee.test(a.type)?u.checked=a.checked:"input"!==f&&"textarea"!==f||(u.defaultValue=a.defaultValue);if(t)if(n)for(o=o||l(e),s=s||l(p),r=0,i=o.length;r<i;r++)x(o[r],s[r]);else x(e,p);return(s=l(p,"script")).length>0&&c(s,!d&&l(e,"script")),p},cleanData:function(e){for(var t,n,r,i=K.event.special,o=0;void 0!==(n=e[o]);o++)if(me(n)){if(t=n[ve.expando]){if(t.events)for(r in t.events)i[r]?K.event.remove(n,r):K.removeEvent(n,r,t.handle);n[ve.expando]=void 0}n[ye.expando]&&(n[ye.expando]=void 0)}}}),K.fn.extend({domManip:b,detach:function(e){return w(this,e,!0)},remove:function(e){return w(this,e)},text:function(e){return ge(this,function(e){return void 0===e?K.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return b(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||m(this,e).appendChild(e)})},prepend:function(){return b(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=m(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return b(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return b(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(K.cleanData(l(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return K.clone(this,e,t)})},html:function(e){return ge(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Pe.test(e)&&!je[(Ne.exec(e)||["",""])[1].toLowerCase()]){e=K.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(K.cleanData(l(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return b(this,arguments,function(t){var n=this.parentNode;K.inArray(this,e)<0&&(K.cleanData(l(this)),n&&n.replaceChild(t,this))},e)}}),K.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){K.fn[e]=function(e){for(var n,r=[],i=K(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),K(i[s])[t](n),U.apply(r,n.get());return this.pushStack(r)}});var We,$e={HTML:"block",BODY:"block"},Be=/^margin/,_e=new RegExp("^("+we+")(?!px)[a-z%]+$","i"),Xe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},ze=function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=s[o];return i},Ue=_.documentElement;!function(){function t(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",a.innerHTML="",Ue.appendChild(s);var t=e.getComputedStyle(a);n="1%"!==t.top,o="2px"===t.marginLeft,r="4px"===t.width,a.style.marginRight="50%",i="4px"===t.marginRight,Ue.removeChild(s)}var n,r,i,o,s=_.createElement("div"),a=_.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",J.clearCloneStyle="content-box"===a.style.backgroundClip,s.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",s.appendChild(a),K.extend(J,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return null==r&&t(),r},pixelMarginRight:function(){return null==r&&t(),i},reliableMarginLeft:function(){return null==r&&t(),o},reliableMarginRight:function(){var t,n=a.appendChild(_.createElement("div"));return n.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",a.style.width="1px",Ue.appendChild(s),t=!parseFloat(e.getComputedStyle(n).marginRight),Ue.removeChild(s),a.removeChild(n),t}}))}();var Ve=/^(none|table(?!-c[ea]).+)/,Ye={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"},Qe=["Webkit","O","Moz","ms"],Je=_.createElement("div").style;K.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=k(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=K.camelCase(t),l=e.style;if(t=K.cssProps[a]||(K.cssProps[a]=N(a)||a),s=K.cssHooks[t]||K.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=Te.exec(n))&&i[1]&&(n=u(e,t,i),o="number"),null!=n&&n==n&&("number"===o&&(n+=i&&i[3]||(K.cssNumber[a]?"":"px")),J.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(l[t]=n))}},css:function(e,t,n,r){var i,o,s,a=K.camelCase(t);return t=K.cssProps[a]||(K.cssProps[a]=N(a)||a),(s=K.cssHooks[t]||K.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=k(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),K.each(["height","width"],function(e,t){K.cssHooks[t]={get:function(e,n,r){if(n)return Ve.test(K.css(e,"display"))&&0===e.offsetWidth?ze(e,Ye,function(){return D(e,t,r)}):D(e,t,r)},set:function(e,n,r){var i,o=r&&Xe(e),s=r&&j(e,t,r,"border-box"===K.css(e,"boxSizing",!1,o),o);return s&&(i=Te.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=K.css(e,t)),S(0,n,s)}}}),K.cssHooks.marginLeft=E(J.reliableMarginLeft,function(e,t){if(t)return(parseFloat(k(e,"marginLeft"))||e.getBoundingClientRect().left-ze(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),K.cssHooks.marginRight=E(J.reliableMarginRight,function(e,t){if(t)return ze(e,{display:"inline-block"},k,[e,"marginRight"])}),K.each({margin:"",padding:"",border:"Width"},function(e,t){K.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Ce[r]+t]=o[r]||o[r-2]||o[0];return i}},Be.test(e)||(K.cssHooks[e+t].set=S)}),K.fn.extend({css:function(e,t){return ge(this,function(e,t,n){var r,i,o={},s=0;if(K.isArray(t)){for(r=Xe(e),i=t.length;s<i;s++)o[t[s]]=K.css(e,t[s],!1,r);return o}return void 0!==n?K.style(e,t,n):K.css(e,t)},e,t,arguments.length>1)},show:function(){return A(this,!0)},hide:function(){return A(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ke(this)?K(this).show():K(this).hide()})}}),K.Tween=q,q.prototype={constructor:q,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||K.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(K.cssNumber[n]?"":"px")},cur:function(){var e=q.propHooks[this.prop];return e&&e.get?e.get(this):q.propHooks._default.get(this)},run:function(e){var t,n=q.propHooks[this.prop];return this.options.duration?this.pos=t=K.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):q.propHooks._default.set(this),this}},q.prototype.init.prototype=q.prototype,q.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=K.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){K.fx.step[e.prop]?K.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[K.cssProps[e.prop]]&&!K.cssHooks[e.prop]?e.elem[e.prop]=e.now:K.style(e.elem,e.prop,e.now+e.unit)}}},q.propHooks.scrollTop=q.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},K.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},K.fx=q.prototype.init,K.fx.step={};var Ke,Ze,et=/^(?:toggle|show|hide)$/,tt=/queueHooks$/;K.Animation=K.extend(F,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return u(n.elem,e,Te.exec(t),n),n}]},tweener:function(e,t){K.isFunction(e)?(t=e,e=["*"]):e=e.match(he);for(var n,r=0,i=e.length;r<i;r++)n=e[r],F.tweeners[n]=F.tweeners[n]||[],F.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,s,a,u,l,c=this,f={},p=e.style,d=e.nodeType&&ke(e),h=ve.get(e,"fxshow");for(r in n.queue||(null==(a=K._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,c.always(function(){c.always(function(){a.unqueued--,K.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===("none"===(l=K.css(e,"display"))?ve.get(e,"olddisplay")||C(e.nodeName):l)&&"none"===K.css(e,"float")&&(p.display="inline-block")),n.overflow&&(p.overflow="hidden",c.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),t)if(i=t[r],et.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(d?"hide":"show")){if("show"!==i||!h||void 0===h[r])continue;d=!0}f[r]=h&&h[r]||K.style(e,r)}else l=void 0;if(K.isEmptyObject(f))"inline"===("none"===l?C(e.nodeName):l)&&(p.display=l);else for(r in h?"hidden"in h&&(d=h.hidden):h=ve.access(e,"fxshow",{}),o&&(h.hidden=!d),d?K(e).show():c.done(function(){K(e).hide()}),c.done(function(){var t;for(t in ve.remove(e,"fxshow"),f)K.style(e,t,f[t])}),f)s=O(d?h[r]:0,r,c),r in h||(h[r]=s.start,d&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}],prefilter:function(e,t){t?F.prefilters.unshift(e):F.prefilters.push(e)}}),K.speed=function(e,t,n){var r=e&&"object"==typeof e?K.extend({},e):{complete:n||!n&&t||K.isFunction(e)&&e,duration:e,easing:n&&t||t&&!K.isFunction(t)&&t};return r.duration=K.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in K.fx.speeds?K.fx.speeds[r.duration]:K.fx.speeds._default,null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){K.isFunction(r.old)&&r.old.call(this),r.queue&&K.dequeue(this,r.queue)},r},K.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ke).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=K.isEmptyObject(e),o=K.speed(t,n,r),s=function(){var t=F(this,K.extend({},e),o);(i||ve.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=K.timers,s=ve.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&tt.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||K.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=ve.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=K.timers,s=r?r.length:0;for(n.finish=!0,K.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),K.each(["toggle","show","hide"],function(e,t){var n=K.fn[t];K.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(H(t,!0),e,r,i)}}),K.each({slideDown:H("show"),slideUp:H("hide"),slideToggle:H("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){K.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),K.timers=[],K.fx.tick=function(){var e,t=0,n=K.timers;for(Ke=K.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||K.fx.stop(),Ke=void 0},K.fx.timer=function(e){K.timers.push(e),e()?K.fx.start():K.timers.pop()},K.fx.interval=13,K.fx.start=function(){Ze||(Ze=e.setInterval(K.fx.tick,K.fx.interval))},K.fx.stop=function(){e.clearInterval(Ze),Ze=null},K.fx.speeds={slow:600,fast:200,_default:400},K.fn.delay=function(t,n){return t=K.fx&&K.fx.speeds[t]||t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=_.createElement("input"),t=_.createElement("select"),n=t.appendChild(_.createElement("option"));e.type="checkbox",J.checkOn=""!==e.value,J.optSelected=n.selected,t.disabled=!0,J.optDisabled=!n.disabled,(e=_.createElement("input")).value="t",e.type="radio",J.radioValue="t"===e.value}();var nt,rt=K.expr.attrHandle;K.fn.extend({attr:function(e,t){return ge(this,K.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){K.removeAttr(this,e)})}}),K.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?K.prop(e,t,n):(1===o&&K.isXMLDoc(e)||(t=t.toLowerCase(),i=K.attrHooks[t]||(K.expr.match.bool.test(t)?nt:void 0)),void 0!==n?null===n?void K.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=K.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!J.radioValue&&"radio"===t&&K.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(he);if(o&&1===e.nodeType)for(;n=o[i++];)r=K.propFix[n]||n,K.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)}}),nt={set:function(e,t,n){return!1===t?K.removeAttr(e,n):e.setAttribute(n,n),n}},K.each(K.expr.match.bool.source.match(/\w+/g),function(e,t){var n=rt[t]||K.find.attr;rt[t]=function(e,t,r){var i,o;return r||(o=rt[t],rt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,rt[t]=o),i}});var it=/^(?:input|select|textarea|button)$/i,ot=/^(?:a|area)$/i;K.fn.extend({prop:function(e,t){return ge(this,K.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[K.propFix[e]||e]})}}),K.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&K.isXMLDoc(e)||(t=K.propFix[t]||t,i=K.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=K.find.attr(e,"tabindex");return t?parseInt(t,10):it.test(e.nodeName)||ot.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),J.optSelected||(K.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),K.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){K.propFix[this.toLowerCase()]=this});var st=/[\t\r\n\f]/g;K.fn.extend({addClass:function(e){var t,n,r,i,o,s,a,u=0;if(K.isFunction(e))return this.each(function(t){K(this).addClass(e.call(this,t,P(this)))});if("string"==typeof e&&e)for(t=e.match(he)||[];n=this[u++];)if(i=P(n),r=1===n.nodeType&&(" "+i+" ").replace(st," ")){for(s=0;o=t[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(a=K.trim(r))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,i,o,s,a,u=0;if(K.isFunction(e))return this.each(function(t){K(this).removeClass(e.call(this,t,P(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(he)||[];n=this[u++];)if(i=P(n),r=1===n.nodeType&&(" "+i+" ").replace(st," ")){for(s=0;o=t[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(a=K.trim(r))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):K.isFunction(e)?this.each(function(n){K(this).toggleClass(e.call(this,n,P(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=K(this),o=e.match(he)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=P(this))&&ve.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":ve.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+P(n)+" ").replace(st," ").indexOf(t)>-1)return!0;return!1}});var at=/\r/g,ut=/[\x20\t\r\n\f]+/g;K.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=K.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,K(this).val()):e)?i="":"number"==typeof i?i+="":K.isArray(i)&&(i=K.map(i,function(e){return null==e?"":e+""})),(t=K.valHooks[this.type]||K.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=K.valHooks[i.type]||K.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(at,""):null==n?"":n:void 0}}),K.extend({valHooks:{option:{get:function(e){var t=K.find.attr(e,"value");return null!=t?t:K.trim(K.text(e)).replace(ut," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,s=o?null:[],a=o?i+1:r.length,u=i<0?a:o?i:0;u<a;u++)if(((n=r[u]).selected||u===i)&&(J.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!K.nodeName(n.parentNode,"optgroup"))){if(t=K(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=K.makeArray(t),s=i.length;s--;)((r=i[s]).selected=K.inArray(K.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),K.each(["radio","checkbox"],function(){K.valHooks[this]={set:function(e,t){if(K.isArray(t))return e.checked=K.inArray(K(e).val(),t)>-1}},J.checkOn||(K.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var lt=/^(?:focusinfocus|focusoutblur)$/;K.extend(K.event,{trigger:function(t,n,r,i){var o,s,a,u,l,c,f,p=[r||_],d=Q.call(t,"type")?t.type:t,h=Q.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||_,3!==r.nodeType&&8!==r.nodeType&&!lt.test(d+K.event.triggered)&&(d.indexOf(".")>-1&&(d=(h=d.split(".")).shift(),h.sort()),l=d.indexOf(":")<0&&"on"+d,(t=t[K.expando]?t:new K.Event(d,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:K.makeArray(n,[t]),f=K.event.special[d]||{},i||!f.trigger||!1!==f.trigger.apply(r,n))){if(!i&&!f.noBubble&&!K.isWindow(r)){for(u=f.delegateType||d,lt.test(u+d)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(r.ownerDocument||_)&&p.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=p[o++])&&!t.isPropagationStopped();)t.type=o>1?u:f.bindType||d,(c=(ve.get(s,"events")||{})[t.type]&&ve.get(s,"handle"))&&c.apply(s,n),(c=l&&s[l])&&c.apply&&me(s)&&(t.result=c.apply(s,n),!1===t.result&&t.preventDefault());return t.type=d,i||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(p.pop(),n)||!me(r)||l&&K.isFunction(r[d])&&!K.isWindow(r)&&((a=r[l])&&(r[l]=null),K.event.triggered=d,r[d](),K.event.triggered=void 0,a&&(r[l]=a)),t.result}},simulate:function(e,t,n){var r=K.extend(new K.Event,n,{type:e,isSimulated:!0});K.event.trigger(r,null,t)}}),K.fn.extend({trigger:function(e,t){return this.each(function(){K.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return K.event.trigger(e,t,n,!0)}}),K.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){K.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),K.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),J.focusin="onfocusin"in e,J.focusin||K.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){K.event.simulate(t,e.target,K.event.fix(e))};K.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ve.access(r,t);i||r.addEventListener(e,n,!0),ve.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ve.access(r,t)-1;i?ve.access(r,t,i):(r.removeEventListener(e,n,!0),ve.remove(r,t))}}});var ct=e.location,ft=K.now(),pt=/\?/;K.parseJSON=function(e){return JSON.parse(e+"")},K.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||K.error("Invalid XML: "+t),n};var dt=/#.*$/,ht=/([?&])_=[^&]*/,gt=/^(.*?):[ \t]*([^\r\n]*)$/gm,mt=/^(?:GET|HEAD)$/,vt=/^\/\//,yt={},xt={},bt="*/".concat("*"),wt=_.createElement("a");wt.href=ct.href,K.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ct.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":bt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":K.parseJSON,"text xml":K.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?I(I(e,K.ajaxSettings),t):I(K.ajaxSettings,e)},ajaxPrefilter:R(yt),ajaxTransport:R(xt),ajax:function(t,n){function r(t,n,r,a){var l,f,y,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),i=void 0,s=a||"",T.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(x=function(e,t,n){for(var r,i,o,s,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,T,r)),x=function(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(i in l)if((a=i.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[i]:!0!==l[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(p,x,T,l),l?(p.ifModified&&((w=T.getResponseHeader("Last-Modified"))&&(K.lastModified[o]=w),(w=T.getResponseHeader("etag"))&&(K.etag[o]=w)),204===t||"HEAD"===p.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,l=!(y=x.error))):(y=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",l?g.resolveWith(d,[f,C,T]):g.rejectWith(d,[T,C,y]),T.statusCode(v),v=void 0,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[T,p,l?f:y]),m.fireWith(d,[T,C]),c&&(h.trigger("ajaxComplete",[T,p]),--K.active||K.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,s,a,u,l,c,f,p=K.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?K(d):K.event,g=K.Deferred(),m=K.Callbacks("once memory"),v=p.statusCode||{},y={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!a)for(a={};t=gt.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)v[t]=[v[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return i&&i.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,p.url=((t||p.url||ct.href)+"").replace(dt,"").replace(vt,ct.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=K.trim(p.dataType||"*").toLowerCase().match(he)||[""],null==p.crossDomain){l=_.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=wt.protocol+"//"+wt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=K.param(p.data,p.traditional)),M(yt,p,n,T),2===b)return T;for(f in(c=K.event&&p.global)&&0==K.active++&&K.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!mt.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(pt.test(o)?"&":"?")+p.data,delete p.data),!1===p.cache&&(p.url=ht.test(o)?o.replace(ht,"$1_="+ft++):o+(pt.test(o)?"&":"?")+"_="+ft++)),p.ifModified&&(K.lastModified[o]&&T.setRequestHeader("If-Modified-Since",K.lastModified[o]),K.etag[o]&&T.setRequestHeader("If-None-Match",K.etag[o])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&T.setRequestHeader("Content-Type",p.contentType),T.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+bt+"; q=0.01":""):p.accepts["*"]),p.headers)T.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(d,T,p)||2===b))return T.abort();for(f in w="abort",{success:1,error:1,complete:1})T[f](p[f]);if(i=M(xt,p,n,T)){if(T.readyState=1,c&&h.trigger("ajaxSend",[T,p]),2===b)return T;p.async&&p.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},p.timeout));try{b=1,i.send(y,r)}catch(e){if(!(b<2))throw e;r(-1,e)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return K.get(e,t,n,"json")},getScript:function(e,t){return K.get(e,void 0,t,"script")}}),K.each(["get","post"],function(e,t){K[t]=function(e,n,r,i){return K.isFunction(n)&&(i=i||r,r=n,n=void 0),K.ajax(K.extend({url:e,type:t,dataType:i,data:n,success:r},K.isPlainObject(e)&&e))}}),K._evalUrl=function(e){return K.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},K.fn.extend({wrapAll:function(e){var t;return K.isFunction(e)?this.each(function(t){K(this).wrapAll(e.call(this,t))}):(this[0]&&(t=K(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return K.isFunction(e)?this.each(function(t){K(this).wrapInner(e.call(this,t))}):this.each(function(){var t=K(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=K.isFunction(e);return this.each(function(n){K(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){K.nodeName(this,"body")||K(this).replaceWith(this.childNodes)}).end()}}),K.expr.filters.hidden=function(e){return!K.expr.filters.visible(e)},K.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var Tt=/%20/g,Ct=/\[\]$/,kt=/\r?\n/g,Et=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;K.param=function(e,t){var n,r=[],i=function(e,t){t=K.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=K.ajaxSettings&&K.ajaxSettings.traditional),K.isArray(e)||e.jquery&&!K.isPlainObject(e))K.each(e,function(){i(this.name,this.value)});else for(n in e)W(n,e[n],t,i);return r.join("&").replace(Tt,"+")},K.fn.extend({serialize:function(){return K.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=K.prop(this,"elements");return e?K.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!K(this).is(":disabled")&&Nt.test(this.nodeName)&&!Et.test(e)&&(this.checked||!Ee.test(e))}).map(function(e,t){var n=K(this).val();return null==n?null:K.isArray(n)?K.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}}),K.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var St={0:200,1223:204},jt=K.ajaxSettings.xhr();J.cors=!!jt&&"withCredentials"in jt,J.ajax=jt=!!jt,K.ajaxTransport(function(t){var n,r;if(J.cors||jt&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(St[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),K.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return K.globalEval(e),e}}}),K.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),K.ajaxTransport("script",function(e){var t,n;if(e.crossDomain)return{send:function(r,i){t=K("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),_.head.appendChild(t[0])},abort:function(){n&&n()}}});var Dt=[],At=/(=)\?(?=&|$)|\?\?/;K.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Dt.pop()||K.expando+"_"+ft++;return this[e]=!0,e}}),K.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=!1!==t.jsonp&&(At.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&At.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=K.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(At,"$1"+i):!1!==t.jsonp&&(t.url+=(pt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||K.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){void 0===o?K(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Dt.push(i)),s&&K.isFunction(o)&&o(s[0]),s=o=void 0}),"script"}),K.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||_;var r=ae.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=f([e],t,i),i&&i.length&&K(i).remove(),K.merge([],r.childNodes))};var qt=K.fn.load;K.fn.load=function(e,t,n){if("string"!=typeof e&&qt)return qt.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>-1&&(r=K.trim(e.slice(a)),e=e.slice(0,a)),K.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&K.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?K("<div>").append(K.parseHTML(e)).find(r):e)}).always(n&&function(e,t){s.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},K.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){K.fn[t]=function(e){return this.on(t,e)}}),K.expr.filters.animated=function(e){return K.grep(K.timers,function(t){return e===t.elem}).length},K.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l=K.css(e,"position"),c=K(e),f={};"static"===l&&(e.style.position="relative"),a=c.offset(),o=K.css(e,"top"),u=K.css(e,"left"),("absolute"===l||"fixed"===l)&&(o+u).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),K.isFunction(t)&&(t=t.call(e,n,K.extend({},a))),null!=t.top&&(f.top=t.top-a.top+s),null!=t.left&&(f.left=t.left-a.left+i),"using"in t?t.using.call(e,f):c.css(f)}},K.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){K.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;return o?(t=o.documentElement,K.contains(t,r)?(i=r.getBoundingClientRect(),n=$(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i):void 0},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===K.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),K.nodeName(e[0],"html")||(r=e.offset()),r.top+=K.css(e[0],"borderTopWidth",!0),r.left+=K.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-K.css(n,"marginTop",!0),left:t.left-r.left-K.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===K.css(e,"position");)e=e.offsetParent;return e||Ue})}}),K.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;K.fn[e]=function(r){return ge(this,function(e,r,i){var o=$(e);if(void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),K.each(["top","left"],function(e,t){K.cssHooks[t]=E(J.pixelPosition,function(e,n){if(n)return n=k(e,t),_e.test(n)?K(e).position()[t]+"px":n})}),K.each({Height:"height",Width:"width"},function(e,t){K.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){K.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(!0===r||!0===i?"margin":"border");return ge(this,function(t,n,r){var i;return K.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?K.css(t,n,s):K.style(t,n,r,s)},t,o?r:void 0,o,null)}})}),K.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},size:function(){return this.length}}),K.fn.andSelf=K.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return K});var Lt=e.jQuery,Ht=e.$;return K.noConflict=function(t){return e.$===K&&(e.$=Ht),t&&e.jQuery===K&&(e.jQuery=Lt),K},t||(e.jQuery=e.$=K),K});
;Dependency._js['lib/jquery/jquery']=true;

;
jQuery.noConflict();
;
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0);
;Dependency._js['lib/jquery/jquery-migrate-mute']=true;

;
!function(e,t,n){"use strict";function r(n){var r=t.console;a[n]||(a[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(e(this).migrate_warn.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function o(t,n,o,a){if(Object.defineProperty)try{return void Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:function(){return r(a),o},set:function(e){r(a),o=e}})}catch(e){}e._definePropertyBroken=!0,t[n]=o}e.migrateVersion="1.4.1",e.fn.migrate_warn={warning_count:0,$warning_banner:null,warn:function(n){console.warn(n);var r=t.location.origin?t.location.origin:t.location.protocol+"//"+t.location.hostname+(t.location.port?":"+t.location.port:""),o=new XMLHttpRequest;"undefined"==typeof baseurl&&"undefined"==typeof getBaseURL||(o.open("POST",r+("undefined"==typeof baseurl?getBaseURL():baseurl)+"/RPC2/",!0),o.setRequestHeader("Content-Type","application/json"),o.send(JSON.stringify({id:1,method:"response.report_jswarning",params:[n,t.location.href,new Error("jQuery Migrate:").stack]})));var a=this;e(document).ready(function(){if(a.$warning_banner=e("body>#jquery-warning-banner"),a.$warning_banner.length){var t=a.$warning_banner.find("#jquery-migrate-issue-count");a.$warning_banner.find("ul").append("<li>"+n+"</li>"),a.warning_count+=1,t.text(a.warning_count)}else a.warning_count=1,e("<div id='jquery-warning-banner' style='padding:10px;width:100%;background-color:#ffff99;font-size:13px;'><b>jQuery Migrate: <span id='jquery-migrate-issue-count'>"+a.warning_count+"</span> issue(s) found, please check console log and fix them.</b><ul><li>"+n+"</li></ul></div>").prependTo(document.body)})}};var a={};e.migrateWarnings=[],t.console&&t.console.log&&t.console.log("JQMIGRATE: Migrate is installed"+(e.migrateMute?"":" with logging active")+", version "+e.migrateVersion),void 0===e.migrateTrace&&(e.migrateTrace=!0),e.migrateReset=function(){a={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var i=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,c=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},u=e.attrHooks.value&&e.attrHooks.value.set||function(){},d=/^[238]$/,l=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,p=/^(?:checked|selected)$/i;o(e,"attrFn",i||{},"jQuery.attrFn is deprecated"),e.attr=function(t,n,o,a){var c=n.toLowerCase(),u=t&&t.nodeType;return a&&(s.length<4&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(u)&&(i?n in i:e.isFunction(e.fn[n])))?e(t)[n](o):(!e.attrHooks[c]&&l.test(c)&&(e.attrHooks[c]={get:function(t,n){var r,o=e.prop(t,n);return!0===o||"boolean"!=typeof o&&(r=t.getAttributeNode(n))&&!1!==r.nodeValue?n.toLowerCase():void 0},set:function(t,n,r){var o;return!1===n?e.removeAttr(t,r):((o=e.propFix[r]||r)in t&&(t[o]=!0),t.setAttribute(r,r.toLowerCase())),r}},p.test(c)&&r("jQuery.fn.attr('"+c+"') might use property instead of attribute")),s.call(e,t,n,o))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?c.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var n=(e.nodeName||"").toLowerCase();if("button"===n)return u.apply(this,arguments);"input"!==n&&"option"!==n&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t}};var f,g,h,v=e.fn.init,y=e.find,m=e.parseJSON,b=/^\s*</,w=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,j=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,x=/^([^<]*)(<[\w\W]+>)([^>]*)$/;for(h in e.fn.init=function(t,n,o){var a,i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(a=x.exec(e.trim(t)))&&a[0]&&(b.test(t)||r("$(html) HTML strings must start with '<' character"),a[3]&&r("$(html) HTML text after last tag is ignored"),"#"===a[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&n.context.nodeType&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(a[2],n&&n.ownerDocument||n||document,!0),n,o):(i=v.apply(this,arguments),t&&void 0!==t.selector?(i.selector=t.selector,i.context=t.context):(i.selector="string"==typeof t?t:"",t&&(i.context=t.nodeType?t:n||document)),i)},e.fn.init.prototype=e.fn,e.find=function(e){var t=Array.prototype.slice.call(arguments);if("string"==typeof e&&w.test(e))try{document.querySelector(e)}catch(n){e=e.replace(j,function(e,t,n,r){return"["+t+n+'"'+r+'"]'});try{document.querySelector(e),r("Attribute selector with '#' must be quoted: "+t[0]),t[0]=e}catch(e){r("Attribute selector with '#' was not fixed: "+t[0])}}return y.apply(this,t)},y)Object.prototype.hasOwnProperty.call(y,h)&&(e.find[h]=y[h]);e.parseJSON=function(e){return e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g={},(f=e.uaMatch(navigator.userAgent)).browser&&(g[f.browser]=!0,g.version=f.version),g.chrome?g.webkit=!0:g.webkit&&(g.safari=!0),e.browser=g),o(e,"browser",e.browser,"jQuery.browser is deprecated"),e.boxModel=e.support.boxModel="CSS1Compat"===document.compatMode,o(e,"boxModel",e.boxModel,"jQuery.boxModel is deprecated"),o(e.support,"boxModel",e.support.boxModel,"jQuery.support.boxModel is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,o){var a=e.fn.init.call(this,r,o,n);return a instanceof t?a:t(a)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.fn.size=function(){return r("jQuery.fn.size() is deprecated; use the .length property"),this.length};var k=!1;e.swap&&e.each(["height","width","reliableMarginRight"],function(t,n){var r=e.cssHooks[n]&&e.cssHooks[n].get;r&&(e.cssHooks[n].get=function(){var e;return k=!0,e=r.apply(this,arguments),k=!1,e})}),e.swap=function(e,t,n,o){var a,i,s={};for(i in k||r("jQuery.swap() is undocumented and deprecated"),t)s[i]=e.style[i],e.style[i]=t[i];for(i in a=n.apply(e,o||[]),t)e.style[i]=s[i];return a},e.ajaxSetup({converters:{"text json":e.parseJSON}});var Q=e.fn.data;e.fn.data=function(t){var n,o,a=this[0];return!a||"events"!==t||1!==arguments.length||(n=e.data(a,t),o=e._data(a,t),void 0!==n&&n!==o||void 0===o)?Q.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),o)};var M=/\/(java|ecma)script/i;e.clean||(e.clean=function(t,n,o,a){n=(n=!(n=n||document).nodeType&&n[0]||n).ownerDocument||n,r("jQuery.clean() is deprecated");var i,s,c,u,d=[];if(e.merge(d,e.buildFragment(t,n).childNodes),o)for(c=function(e){if(!e.type||M.test(e.type))return a?a.push(e.parentNode?e.parentNode.removeChild(e):e):o.appendChild(e)},i=0;null!=(s=d[i]);i++)e.nodeName(s,"script")&&c(s)||(o.appendChild(s),"undefined"!=typeof s.getElementsByTagName&&(u=e.grep(e.merge([],s.getElementsByTagName("script")),c),d.splice.apply(d,[i+1,0].concat(u)),i+=u.length));return d});var C=e.event.add,S=e.event.remove,T=e.event.trigger,_=e.fn.toggle,H=e.fn.live,N=e.fn.die,A=e.fn.load,R="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",$=new RegExp("\\b(?:"+R+")\\b"),L=/(?:^|\s)hover(\.\S+|)\b/,O=function(t){return"string"!=typeof t||e.event.special.hover?t:(L.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(L,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&o(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,o,a){e!==document&&$.test(t)&&r("AJAX events should be attached to document: "+t),C.call(this,e,O(t||""),n,o,a)},e.event.remove=function(e,t,n,r,o){S.call(this,e,O(t)||"",n,r,o)},e.each(["load","unload","error"],function(t,n){e.fn[n]=function(){var e=Array.prototype.slice.call(arguments,0);return"load"===n&&"string"==typeof e[0]?A.apply(this,e):(r("jQuery.fn."+n+"() is deprecated"),e.splice(0,0,n),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this))}}),e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return _.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var o=arguments,a=t.guid||e.guid++,i=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%i;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),o[r].apply(this,arguments)||!1};for(s.guid=a;i<o.length;)o[i++].guid=a;return this.click(s)},e.fn.live=function(t,n,o){return r("jQuery.fn.live() is deprecated"),H?H.apply(this,arguments):(e(this.context).on(t,this.selector,n,o),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),N?N.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,o){return n||$.test(e)||r("Global events are undocumented and deprecated"),T.call(this,e,t,n||document,o)},e.each(R.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,Array.prototype.slice.call(arguments,1),t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}}),e.event.special.ready={setup:function(){this===document&&r("'ready' event is deprecated")}};var q=e.fn.andSelf||e.fn.addBack,F=e.fn.find;if(e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),q.apply(this,arguments)},e.fn.find=function(e){var t=F.apply(this,arguments);return t.context=this.context,t.selector=this.selector?this.selector+" "+e:e,t},e.Callbacks){var J=e.Deferred,E=[["resolve","done",e.Callbacks("once memory"),e.Callbacks("once memory"),"resolved"],["reject","fail",e.Callbacks("once memory"),e.Callbacks("once memory"),"rejected"],["notify","progress",e.Callbacks("memory"),e.Callbacks("memory")]];e.Deferred=function(t){var n=J(),o=n.promise();return n.pipe=o.pipe=function(){var t=arguments;return r("deferred.pipe() is deprecated"),e.Deferred(function(r){e.each(E,function(a,i){var s=e.isFunction(t[a])&&t[a];n[i[1]](function(){var t=s&&s.apply(this,arguments);t&&e.isFunction(t.promise)?t.promise().done(r.resolve).fail(r.reject).progress(r.notify):r[i[0]+"With"](this===o?r.promise():this,s?[t]:arguments)})}),t=null}).promise()},n.isResolved=function(){return r("deferred.isResolved is deprecated"),"resolved"===n.state()},n.isRejected=function(){return r("deferred.isRejected is deprecated"),"rejected"===n.state()},t&&t.call(n,n),n}}}(jQuery,window);
;Dependency._js['lib/jquery/jquery-migrate']=true;

;
!function(t,e){function i(e,i){var n,a,o,r=e.nodeName.toLowerCase();return"area"===r?(a=(n=e.parentNode).name,!(!e.href||!a||"map"!==n.nodeName.toLowerCase())&&(!!(o=t("img[usemap=#"+a+"]")[0])&&s(o))):(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"===r&&e.href||i)&&s(e)}function s(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var n,a,o=0,r=/^ui-id-\d+$/;(t.uiBackCompat=!1,t.ui=t.ui||{},t.ui.version)||(t.extend(t.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({_focus:t.fn.focus,focus:function(e,i){return"number"==typeof e?this.each(function(){var s=this;setTimeout(function(){t(s).focus(),i&&i.call(s)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var i,s,n=t(this[0]);n.length&&n[0]!==document;){if(("absolute"===(i=n.css("position"))||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++o)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var s=t.attr(e,"tabindex"),n=isNaN(s);return(n||s>=0)&&i(e,!n)}}),t(function(){var e=document.body,i=e.appendChild(i=document.createElement("div"));i.offsetHeight,t.extend(i.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),t.support.minHeight=100===i.offsetHeight,t.support.selectstart="onselectstart"in i,e.removeChild(i).style.display="none"}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(e,i){function s(e,i,s,a){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),a&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?o["inner"+i].call(this):this.each(function(){t(this).css(a,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?o["outer"+i].call(this,e):this.each(function(){t(this).css(a,s(this,e,!0,n)+"px")})}}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=(n=t.fn.removeData,function(e){return arguments.length?n.call(this,t.camelCase(e)):n.call(this)})),a=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[],t.ui.ie=!!a.length,t.ui.ie6=6===parseFloat(a[1],10),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,s){var n,a=t.ui[e].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(t,e,i){var s,n=t.plugins[e];if(n&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(s=0;s<n.length;s++)t.options[n[s][0]]&&n[s][1].apply(t.element,i)}},contains:t.contains,hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s,n=i&&"left"===i?"scrollLeft":"scrollTop";return e[n]>0||(e[n]=1,s=e[n]>0,e[n]=0,s)},isOverAxis:function(t,e,i){return t>e&&t<e+i},isOver:function(e,i,s,n,a,o){return t.ui.isOverAxis(e,s,a)&&t.ui.isOverAxis(i,n,o)}}))}(jQuery),function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(t){}n(e)},t.widget=function(e,i,s){var n,a,o,r,h=e.split(".")[0];e=e.split(".")[1],n=h+"-"+e,s||(s=i,i=t.Widget),t.expr[":"][n.toLowerCase()]=function(e){return!!t.data(e,n)},t[h]=t[h]||{},a=t[h][e],o=t[h][e]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},t.extend(o,a,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),(r=new i).options=t.widget.extend({},r.options),t.each(s,function(e,n){var a,o;t.isFunction(n)&&(s[e]=(a=function(){return i.prototype[e].apply(this,arguments)},o=function(t){return i.prototype[e].apply(this,t)},function(){var t,e=this._super,i=this._superApply;return this._super=a,this._superApply=o,t=n.apply(this,arguments),this._super=e,this._superApply=i,t}))}),o.prototype=t.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix:e},s,{constructor:o,namespace:h,widgetName:e,widgetBaseClass:n,widgetFullName:n}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o)},t.widget.extend=function(e){for(var i,n,a=s.call(arguments,1),o=0,r=a.length;o<r;o++)for(i in a[o])n=a[o][i],a[o].hasOwnProperty(i)&&void 0!==n&&(t.isPlainObject(n)?e[i]=t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):e[i]=n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(a){var o="string"==typeof a,r=s.call(arguments,1),h=this;return a=!o&&r.length?t.widget.extend.apply(null,[a].concat(r)):a,o?this.each(function(){var i,s=t.data(this,n);return s?t.isFunction(s[a])&&"_"!==a.charAt(0)?(i=s[a].apply(s,r))!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0:t.error("no such method '"+a+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,n);e?e.option(a||{})._init():t.data(this,n,new i(a,this))}),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetName,this),t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.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:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,a,o=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(o={},e=(s=e.split(".")).shift(),s.length){for(n=o[e]=t.widget.extend({},this.options[e]),a=0;a<s.length-1;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(e=s.pop(),void 0===i)return void 0===n[e]?null:n[e];n[e]=i}else{if(void 0===i)return void 0===this.options[e]?null:this.options[e];o[e]=i}return this._setOptions(o),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),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(e,i,s){var n,a=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,o){function r(){if(e||!0!==a.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof o?a[o]:o).apply(a,arguments)}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||t.guid++);var h=s.match(/^(\w+)\s*(.*)$/),l=h[1]+a.eventNamespace,c=h[2];c?n.delegate(c,l,r):i.bind(l,r)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,a,o=this.options[e];if(s=s||{},(i=t.Event(i)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(t.isFunction(o)&&!1===o.apply(this.element[0],[i].concat(s))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?!0===n||"number"==typeof n?i:n.effect||i:e;"number"==typeof(n=n||{})&&(n={duration:n}),o=!t.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&t.effects&&(t.effects.effect[r]||!1!==t.uiBackCompat&&t.effects[r])?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){t(this)[e](),a&&a.call(s[0]),i()})}}),!1!==t.uiBackCompat&&(t.Widget.prototype._getCreateOptions=function(){return t.metadata&&t.metadata.get(this.element[0])[this.widgetName]})}(jQuery),function(t,e){var i=!1;t(document).mouseup(function(t){i=!1}),t.widget("ui.mouse",{version:"1.9.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent"))return t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!i){this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var s=this,n=1===e.which,a=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&t(e.target).closest(this.options.cancel).length;return!(n&&!a&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),i=!0,!0))}},_mouseMove:function(e){return!t.ui.ie||document.documentMode>=9||e.button?this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted):this._mouseUp(e)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(t){return this.mouseDelayMet},_mouseStart:function(t){},_mouseDrag:function(t){},_mouseStop:function(t){},_mouseCapture:function(t){return!0}})}(jQuery),function(t,e){function i(t,e,i){return[parseInt(t[0],10)*(d.test(t[0])?e/100:1),parseInt(t[1],10)*(d.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}t.ui=t.ui||{};var n,a=Math.max,o=Math.abs,r=Math.round,h=/left|center|right/,l=/top|center|bottom/,c=/[\+\-]\d+%?/,u=/^\w+/,d=/%$/,p=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return t("body").append(s),e=a.offsetWidth,s.css("overflow","scroll"),e===(i=a.offsetWidth)&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:n?t.position.scrollbarWidth():0,height:a?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return p.apply(this,arguments);e=t.extend({},e);var n,d,f,g,m,v=t(e.of),_=t.position.getWithinInfo(e.within),b=t.position.getScrollInfo(_),y=v[0],w=(e.collision||"flip").split(" "),x={};return 9===y.nodeType?(d=v.width(),f=v.height(),g={top:0,left:0}):t.isWindow(y)?(d=v.width(),f=v.height(),g={top:v.scrollTop(),left:v.scrollLeft()}):y.preventDefault?(e.at="left top",d=f=0,g={top:y.pageY,left:y.pageX}):(d=v.outerWidth(),f=v.outerHeight(),g=v.offset()),m=t.extend({},g),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):l.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=l.test(s[1])?s[1]:"center",t=c.exec(s[0]),i=c.exec(s[1]),x[this]=[t?t[0]:0,i?i[0]:0],e[this]=[u.exec(s[0])[0],u.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?m.left+=d:"center"===e.at[0]&&(m.left+=d/2),"bottom"===e.at[1]?m.top+=f:"center"===e.at[1]&&(m.top+=f/2),n=i(x.at,d,f),m.left+=n[0],m.top+=n[1],this.each(function(){var h,l,c=t(this),u=c.outerWidth(),p=c.outerHeight(),y=s(this,"marginLeft"),k=s(this,"marginTop"),C=u+y+s(this,"marginRight")+b.width,D=p+k+s(this,"marginBottom")+b.height,P=t.extend({},m),I=i(x.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?P.left-=u:"center"===e.my[0]&&(P.left-=u/2),"bottom"===e.my[1]?P.top-=p:"center"===e.my[1]&&(P.top-=p/2),P.left+=I[0],P.top+=I[1],t.support.offsetFractions||(P.left=r(P.left),P.top=r(P.top)),h={marginLeft:y,marginTop:k},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](P,{targetWidth:d,targetHeight:f,elemWidth:u,elemHeight:p,collisionPosition:h,collisionWidth:C,collisionHeight:D,offset:[n[0]+I[0],n[1]+I[1]],my:e.my,at:e.at,within:_,elem:c})}),t.fn.bgiframe&&c.bgiframe(),e.using&&(l=function(t){var i=g.left-P.left,s=i+d-u,n=g.top-P.top,r=n+f-p,h={target:{element:v,left:g.left,top:g.top,width:d,height:f},element:{element:c,left:P.left,top:P.top,width:u,height:p},horizontal:s<0?"left":i>0?"right":"center",vertical:r<0?"top":n>0?"bottom":"middle"};d<u&&o(i+s)<d&&(h.horizontal="center"),f<p&&o(n+r)<f&&(h.vertical="middle"),a(o(i),o(s))>a(o(n),o(r))?h.important="horizontal":h.important="vertical",e.using.call(this,t,h)}),c.offset(t.extend(P,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-o-n;e.collisionWidth>o?h>0&&l<=0?(i=t.left+h+e.collisionWidth-o-n,t.left+=h-i):t.left=l>0&&h<=0?n:h>l?n+o-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=a(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,o=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-o-n;e.collisionHeight>o?h>0&&l<=0?(i=t.top+h+e.collisionHeight-o-n,t.top+=h-i):t.top=l>0&&h<=0?n:h>l?n+o-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=a(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];c<0?((i=t.left+d+p+f+e.collisionWidth-r-a)<0||i<o(c))&&(t.left+=d+p+f):u>0&&((s=t.left-e.collisionPosition.marginLeft+d+p+f-h)>0||o(s)<u)&&(t.left+=d+p+f)},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,p="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,f=-2*e.offset[1];c<0?(s=t.top+d+p+f+e.collisionHeight-r-a,t.top+d+p+f>c&&(s<0||s<o(c))&&(t.top+=d+p+f)):u>0&&(i=t.top-e.collisionPosition.marginTop+d+p+f-h,t.top+d+p+f>u&&(i>0||o(i)<u)&&(t.top+=d+p+f))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");for(a in e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"}),s)e.style[a]=s[a];e.appendChild(r),(i=o||document.documentElement).insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&n<11,e.innerHTML="",i.removeChild(e)}(),!1!==t.uiBackCompat&&function(t){var e=t.fn.position;t.fn.position=function(i){if(!i||!i.offset)return e.call(this,i);var s=i.offset.split(" "),n=i.at.split(" ");return 1===s.length&&(s[1]=s[0]),/^\d/.test(s[0])&&(s[0]="+"+s[0]),/^\d/.test(s[1])&&(s[1]="+"+s[1]),1===n.length&&(/left|center|right/.test(n[0])?n[1]="center":(n[1]=n[0],n[0]="center")),e.call(this,t.extend(i,{at:n[0]+s[0]+" "+n[1]+s[1],offset:void 0}))}}(jQuery)}(jQuery),function(t,e){t.widget("ui.draggable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_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(e){var i=this.options;return!(this.helper||i.disabled||t(e.target).is(".ui-resizable-handle"))&&(this.handle=this._getHandle(e),!!this.handle&&(t(!0===i.iframeFix?"iframe":i.iframeFix).each(function(){t('<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(t(this).offset()).appendTo("body")}),!0))},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.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},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),i.containment&&this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(!1===this._trigger("drag",e,s))return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=!1;t.ui.ddmanager&&!this.options.dropBehaviour&&(i=t.ui.ddmanager.drop(this,e)),this.dropped&&(i=this.dropped,this.dropped=!1);for(var s=this.element[0],n=!1;s&&(s=s.parentNode);)s==document&&(n=!0);if(!n&&"original"===this.options.helper)return!1;if("invalid"==this.options.revert&&!i||"valid"==this.options.revert&&i||!0===this.options.revert||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)){var a=this;t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==a._trigger("stop",e)&&a._clear()})}else!1!==this._trigger("stop",e)&&this._clear();return!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){var i=!this.options.handle||!t(this.options.handle,this.element).length;return t(this.options.handle,this.element).find("*").addBack().each(function(){this==e.target&&(i=!0)}),i},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"==i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"==i.appendTo?this.element[0].parentNode:i.appendTo),s[0]==this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.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 e=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),"document"!=e.containment&&"window"!=e.containment||(this.containment=["document"==e.containment?0:t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"==e.containment?0:t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"==e.containment?0:t(window).scrollLeft())+t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==e.containment?0:t(window).scrollTop())+(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(e.containment)||e.containment.constructor==Array)e.containment.constructor==Array&&(this.containment=e.containment);else{var i=t(e.containment),s=i[0];if(!s)return;i.offset();var n="hidden"!=t(s).css("overflow");this.containment=[(parseInt(t(s).css("borderLeftWidth"),10)||0)+(parseInt(t(s).css("paddingLeft"),10)||0),(parseInt(t(s).css("borderTopWidth"),10)||0)+(parseInt(t(s).css("paddingTop"),10)||0),(n?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(t(s).css("borderLeftWidth"),10)||0)-(parseInt(t(s).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(n?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(t(s).css("borderTopWidth"),10)||0)-(parseInt(t(s).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i}},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"==e?1:-1,n=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i=this.options,s="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,n=/(html|body)/i.test(s[0].tagName),a=e.pageX,o=e.pageY;if(this.originalPosition){var r;if(this.containment){if(this.relative_container){var h=this.relative_container.offset();r=[this.containment[0]+h.left,this.containment[1]+h.top,this.containment[2]+h.left,this.containment[3]+h.top]}else r=this.containment;e.pageX-this.offset.click.left<r[0]&&(a=r[0]+this.offset.click.left),e.pageY-this.offset.click.top<r[1]&&(o=r[1]+this.offset.click.top),e.pageX-this.offset.click.left>r[2]&&(a=r[2]+this.offset.click.left),e.pageY-this.offset.click.top>r[3]&&(o=r[3]+this.offset.click.top)}if(i.grid){var l=i.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1]:this.originalPageY;o=r&&(l-this.offset.click.top<r[1]||l-this.offset.click.top>r[3])?l-this.offset.click.top<r[1]?l+i.grid[1]:l-i.grid[1]:l;var c=i.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/i.grid[0])*i.grid[0]:this.originalPageX;a=r&&(c-this.offset.click.left<r[0]||c-this.offset.click.left>r[2])?c-this.offset.click.left<r[0]?c+i.grid[0]:c-i.grid[0]:c}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"==this.cssPosition?-this.scrollParent.scrollTop():n?0:s.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():n?0:s.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(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"==e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(t){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("draggable"),n=s.options,a=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var s=t(this).data("draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"==s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("draggable"),n=this;t.each(s.sortables,function(a){var o=!1,r=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!=r&&this.instance._intersectsWith(this.instance.containerCache)&&t.ui.contains(r.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i){var s=t("body"),n=t(this).data("draggable").options;s.css("cursor")&&(n._cursor=s.css("cursor")),s.css("cursor",n.cursor)},stop:function(e,i){var s=t(this).data("draggable").options;s._cursor&&t("body").css("cursor",s._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(e,i){var s=t(this).data("draggable");s.scrollParent[0]!=document&&"HTML"!=s.scrollParent[0].tagName&&(s.overflowOffset=s.scrollParent.offset())},drag:function(e,i){var s=t(this).data("draggable"),n=s.options,a=!1;s.scrollParent[0]!=document&&"HTML"!=s.scrollParent[0].tagName?(n.axis&&"x"==n.axis||(s.overflowOffset.top+s.scrollParent[0].offsetHeight-e.pageY<n.scrollSensitivity?s.scrollParent[0].scrollTop=a=s.scrollParent[0].scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(s.scrollParent[0].scrollTop=a=s.scrollParent[0].scrollTop-n.scrollSpeed)),n.axis&&"y"==n.axis||(s.overflowOffset.left+s.scrollParent[0].offsetWidth-e.pageX<n.scrollSensitivity?s.scrollParent[0].scrollLeft=a=s.scrollParent[0].scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(s.scrollParent[0].scrollLeft=a=s.scrollParent[0].scrollLeft-n.scrollSpeed))):(n.axis&&"x"==n.axis||(e.pageY-t(document).scrollTop()<n.scrollSensitivity?a=t(document).scrollTop(t(document).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<n.scrollSensitivity&&(a=t(document).scrollTop(t(document).scrollTop()+n.scrollSpeed))),n.axis&&"y"==n.axis||(e.pageX-t(document).scrollLeft()<n.scrollSensitivity?a=t(document).scrollLeft(t(document).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<n.scrollSensitivity&&(a=t(document).scrollLeft(t(document).scrollLeft()+n.scrollSpeed)))),!1!==a&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i){var s=t(this).data("draggable"),n=s.options;s.snapElements=[],t(n.snap.constructor!=String?n.snap.items||":data(draggable)":n.snap).each(function(){var e=t(this),i=e.offset();this!=s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i){for(var s=t(this).data("draggable"),n=s.options,a=n.snapTolerance,o=i.offset.left,r=o+s.helperProportions.width,h=i.offset.top,l=h+s.helperProportions.height,c=s.snapElements.length-1;c>=0;c--){var u=s.snapElements[c].left,d=u+s.snapElements[c].width,p=s.snapElements[c].top,f=p+s.snapElements[c].height;if(u-a<o&&o<d+a&&p-a<h&&h<f+a||u-a<o&&o<d+a&&p-a<l&&l<f+a||u-a<r&&r<d+a&&p-a<h&&h<f+a||u-a<r&&r<d+a&&p-a<l&&l<f+a){if("inner"!=n.snapMode){var g=Math.abs(p-l)<=a,m=Math.abs(f-h)<=a,v=Math.abs(u-r)<=a,_=Math.abs(d-o)<=a;g&&(i.position.top=s._convertPositionTo("relative",{top:p-s.helperProportions.height,left:0}).top-s.margins.top),m&&(i.position.top=s._convertPositionTo("relative",{top:f,left:0}).top-s.margins.top),v&&(i.position.left=s._convertPositionTo("relative",{top:0,left:u-s.helperProportions.width}).left-s.margins.left),_&&(i.position.left=s._convertPositionTo("relative",{top:0,left:d}).left-s.margins.left)}var b=g||m||v||_;if("outer"!=n.snapMode){g=Math.abs(p-h)<=a,m=Math.abs(f-l)<=a,v=Math.abs(u-o)<=a,_=Math.abs(d-r)<=a;g&&(i.position.top=s._convertPositionTo("relative",{top:p,left:0}).top-s.margins.top),m&&(i.position.top=s._convertPositionTo("relative",{top:f-s.helperProportions.height,left:0}).top-s.margins.top),v&&(i.position.left=s._convertPositionTo("relative",{top:0,left:u}).left-s.margins.left),_&&(i.position.left=s._convertPositionTo("relative",{top:0,left:d-s.helperProportions.width}).left-s.margins.left)}!s.snapElements[c].snapping&&(g||m||v||_||b)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=g||m||v||_||b}else s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1}}}),t.ui.plugin.add("draggable","stack",{start:function(e,i){var s=t(this).data("draggable").options,n=t.makeArray(t(s.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});if(n.length){var a=parseInt(n[0].style.zIndex)||0;t(n).each(function(t){this.style.zIndex=a+t}),this[0].style.zIndex=a+n.length}}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})}(jQuery),function(t,e){t.widget("ui.droppable",{version:"1.9.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var e=this.options,i=e.accept;this.isover=0,this.isout=1,this.accept=t.isFunction(i)?i:function(t){return t.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},t.ui.ddmanager.droppables[e.scope]=t.ui.ddmanager.droppables[e.scope]||[],t.ui.ddmanager.droppables[e.scope].push(this),e.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=t.ui.ddmanager.droppables[this.options.scope],i=0;i<e.length;i++)e[i]==this&&e.splice(i,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"==e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.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",e,this.ui(i)))},_out:function(e){var i=t.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",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current;if(!s||(s.currentItem||s.element)[0]==this.element[0])return!1;var n=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"droppable");if(e.options.greedy&&!e.options.disabled&&e.options.scope==s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance))return n=!0,!1}),!n&&(!!this.accept.call(this.element[0],s.currentItem||s.element)&&(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(e,i,s){if(!i.offset)return!1;var n=(e.positionAbs||e.position.absolute).left,a=n+e.helperProportions.width,o=(e.positionAbs||e.position.absolute).top,r=o+e.helperProportions.height,h=i.offset.left,l=h+i.proportions.width,c=i.offset.top,u=c+i.proportions.height;switch(s){case"fit":return h<=n&&a<=l&&c<=o&&r<=u;case"intersect":return h<n+e.helperProportions.width/2&&a-e.helperProportions.width/2<l&&c<o+e.helperProportions.height/2&&r-e.helperProportions.height/2<u;case"pointer":var d=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,p=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top;return t.ui.isOver(p,d,c,h,i.proportions.height,i.proportions.width);case"touch":return(o>=c&&o<=u||r>=c&&r<=u||o<c&&r>u)&&(n>=h&&n<=l||a>=h&&a<=l||n<h&&a>l);default:return!1}},t.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,i){var s=t.ui.ddmanager.droppables[e.options.scope]||[],n=i?i.type:null,a=(e.currentItem||e.element).find(":data(droppable)").addBack();t:for(var o=0;o<s.length;o++)if(!(s[o].options.disabled||e&&!s[o].accept.call(s[o].element[0],e.currentItem||e.element))){for(var r=0;r<a.length;r++)if(a[r]==s[o].element[0]){s[o].proportions.height=0;continue t}s[o].visible="none"!=s[o].element.css("display"),s[o].visible&&("mousedown"==n&&s[o]._activate.call(s[o],i),s[o].offset=s[o].element.offset(),s[o].proportions={width:s[o].element[0].offsetWidth,height:s[o].element[0].offsetHeight})}},drop:function(e,i){var s=!1;return t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s=t.ui.intersect(e,this,this.options.tolerance),n=s||1!=this.isover?s&&0==this.isover?"isover":null:"isout";if(n){var a;if(this.options.greedy){var o=this.options.scope,r=this.element.parents(":data(droppable)").filter(function(){return t.data(this,"droppable").options.scope===o});r.length&&((a=t.data(r[0],"droppable")).greedyChild="isover"==n?1:0)}a&&"isover"==n&&(a.isover=0,a.isout=1,a._out.call(a,i)),this[n]=1,this["isout"==n?"isover":"isout"]=0,this["isover"==n?"_over":"_out"].call(this,i),a&&"isout"==n&&(a.isout=0,a.isover=1,a._over.call(a,i))}}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}}(jQuery),function(t,e){t.widget("ui.resizable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var e=this,i=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t('<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("resizable",this.element.data("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=i.handles||(t(".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){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var s=this.handles.split(",");this.handles={};for(var n=0;n<s.length;n++){var a=t.trim(s[n]),o=t('<div class="ui-resizable-handle '+("ui-resizable-"+a)+'"></div>');o.css({zIndex:i.zIndex}),"se"==a&&o.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[a]=".ui-resizable-"+a,this.element.append(o)}}this._renderAxis=function(e){for(var i in e=e||this.element,this.handles){if(this.handles[i].constructor==String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var s,n=t(this.handles[i],this.element);s=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth();var a=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");e.css(a,s),this._proportionallyResize()}t(this.handles[i]).length}},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!e.resizing){if(this.className)var t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);e.axis=t&&t[1]?t[1]:"se"}}),i.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){i.disabled||(t(this).removeClass("ui-resizable-autohide"),e._handles.show())}).mouseleave(function(){i.disabled||e.resizing||(t(this).addClass("ui-resizable-autohide"),e._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var i=this.element;this.originalElement.css({position:i.css("position"),width:i.outerWidth(),height:i.outerHeight(),top:i.css("top"),left:i.css("left")}).insertAfter(i),i.remove()}return this.originalElement.css("resize",this.originalResizeStyle),e(this.originalElement),this},_mouseCapture:function(e){var i=!1;for(var s in this.handles)t(this.handles[s])[0]==e.target&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(e){var s=this.options,n=this.element.position(),a=this.element;this.resizing=!0,this.documentScroll={top:t(document).scrollTop(),left:t(document).scrollLeft()},(a.is(".ui-draggable")||/absolute/.test(a.css("position")))&&a.css({position:"absolute",top:n.top,left:n.left}),this._renderProxy();var o=i(this.helper.css("left")),r=i(this.helper.css("top"));s.containment&&(o+=t(s.containment).scrollLeft()||0,r+=t(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:r},this.size=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalPosition={left:o,top:r},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1;var h=t(".ui-resizable-"+this.axis).css("cursor");return t("body").css("cursor","auto"==h?this.axis+"-resize":h),a.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(t){var e=this.helper,i=(this.options,this.originalMousePosition),s=this.axis,n=t.pageX-i.left||0,a=t.pageY-i.top||0,o=this._change[s];if(!o)return!1;var r=o.apply(this,[t,n,a]);return this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(r=this._updateRatio(r,t)),r=this._respectSize(r,t),this._propagate("resize",t),e.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(r),this._trigger("resize",t,this.ui()),!1},_mouseStop:function(e){this.resizing=!1;var i=this.options;if(this._helper){var s=this._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),a=n&&t.ui.hasScroll(s[0],"left")?0:this.sizeDiff.height,o=n?0:this.sizeDiff.width,r={width:this.helper.width()-o,height:this.helper.height()-a},h=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null,l=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;i.animate||this.element.css(t.extend(r,{top:l,left:h})),this.helper.height(this.size.height),this.helper.width(this.size.width),this._helper&&!i.animate&&this._proportionallyResize()}return t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,i,n,a,o,r=this.options;o={minWidth:s(r.minWidth)?r.minWidth:0,maxWidth:s(r.maxWidth)?r.maxWidth:1/0,minHeight:s(r.minHeight)?r.minHeight:0,maxHeight:s(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),i<o.maxWidth&&(o.maxWidth=i),a<o.maxHeight&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(t){this.options;this.offset=this.helper.offset(),s(t.left)&&(this.position.left=t.left),s(t.top)&&(this.position.top=t.top),s(t.height)&&(this.size.height=t.height),s(t.width)&&(this.size.width=t.width)},_updateRatio:function(t,e){this.options;var i=this.position,n=this.size,a=this.axis;return s(t.height)?t.width=t.height*this.aspectRatio:s(t.width)&&(t.height=t.width/this.aspectRatio),"sw"==a&&(t.left=i.left+(n.width-t.width),t.top=null),"nw"==a&&(t.top=i.top+(n.height-t.height),t.left=i.left+(n.width-t.width)),t},_respectSize:function(t,e){this.helper;var i=this._vBoundaries,n=(this._aspectRatio||e.shiftKey,this.axis),a=s(t.width)&&i.maxWidth&&i.maxWidth<t.width,o=s(t.height)&&i.maxHeight&&i.maxHeight<t.height,r=s(t.width)&&i.minWidth&&i.minWidth>t.width,h=s(t.height)&&i.minHeight&&i.minHeight>t.height;r&&(t.width=i.minWidth),h&&(t.height=i.minHeight),a&&(t.width=i.maxWidth),o&&(t.height=i.maxHeight);var l=this.originalPosition.left+this.originalSize.width,c=this.position.top+this.size.height,u=/sw|nw|w/.test(n),d=/nw|ne|n/.test(n);r&&u&&(t.left=l-i.minWidth),a&&u&&(t.left=l-i.maxWidth),h&&d&&(t.top=c-i.minHeight),o&&d&&(t.top=c-i.maxHeight);var p=!t.width&&!t.height;return p&&!t.left&&t.top?t.top=null:p&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){this.options;if(this._proportionallyResizeElements.length)for(var e=this.helper||this.element,i=0;i<this._proportionallyResizeElements.length;i++){var s=this._proportionallyResizeElements[i];if(!this.borderDif){var n=[s.css("borderTopWidth"),s.css("borderRightWidth"),s.css("borderBottomWidth"),s.css("borderLeftWidth")],a=[s.css("paddingTop"),s.css("paddingRight"),s.css("paddingBottom"),s.css("paddingLeft")];this.borderDif=t.map(n,function(t,e){return(parseInt(t,10)||0)+(parseInt(a[e],10)||0)})}s.css({height:e.height()-this.borderDif[0]-this.borderDif[2]||0,width:e.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var e=this.element,i=this.options;if(this.elementOffset=e.offset(),this._helper){this.helper=this.helper||t('<div style="overflow:hidden;"></div>');var s=t.ui.ie6?1:0,n=t.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+n,height:this.element.outerHeight()+n,position:"absolute",left:this.elementOffset.left-s+"px",top:this.elementOffset.top-s+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(t,e,i){return{width:this.originalSize.width+e}},w:function(t,e,i){this.options;var s=this.originalSize;return{left:this.originalPosition.left+e,width:s.width-e}},n:function(t,e,i){this.options;var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!=e&&this._trigger(e,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}}}),t.ui.plugin.add("resizable","alsoResize",{start:function(e,i){var s=t(this).data("resizable").options,n=function(e){t(e).each(function(){var e=t(this);e.data("resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof s.alsoResize||s.alsoResize.parentNode?n(s.alsoResize):s.alsoResize.length?(s.alsoResize=s.alsoResize[0],n(s.alsoResize)):t.each(s.alsoResize,function(t){n(t)})},resize:function(e,i){var s=t(this).data("resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("resizable-alsoresize"),a={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(a[e]=i||null)}),e.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(e,i){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","animate",{stop:function(e,i){var s=t(this).data("resizable"),n=s.options,a=s._proportionallyResizeElements,o=a.length&&/textarea/i.test(a[0].nodeName),r=o&&t.ui.hasScroll(a[0],"left")?0:s.sizeDiff.height,h=o?0:s.sizeDiff.width,l={width:s.size.width-h,height:s.size.height-r},c=parseInt(s.element.css("left"),10)+(s.position.left-s.originalPosition.left)||null,u=parseInt(s.element.css("top"),10)+(s.position.top-s.originalPosition.top)||null;s.element.animate(t.extend(l,u&&c?{top:u,left:c}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var i={width:parseInt(s.element.css("width"),10),height:parseInt(s.element.css("height"),10),top:parseInt(s.element.css("top"),10),left:parseInt(s.element.css("left"),10)};a&&a.length&&t(a[0]).css({width:i.width,height:i.height}),s._updateCache(i),s._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(e,s){var n=t(this).data("resizable"),a=n.options,o=n.element,r=a.containment,h=r instanceof t?r.get(0):/parent/.test(r)?o.parent().get(0):r;if(h)if(n.containerElement=t(h),/document/.test(r)||r==document)n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight};else{var l=t(h),c=[];t(["Top","Right","Left","Bottom"]).each(function(t,e){c[t]=i(l.css("padding"+e))}),n.containerOffset=l.offset(),n.containerPosition=l.position(),n.containerSize={height:l.innerHeight()-c[3],width:l.innerWidth()-c[1]};var u=n.containerOffset,d=n.containerSize.height,p=n.containerSize.width,f=t.ui.hasScroll(h,"left")?h.scrollWidth:p,g=t.ui.hasScroll(h)?h.scrollHeight:d;n.parentData={element:h,left:u.left,top:u.top,width:f,height:g}}},resize:function(e,i){var s=t(this).data("resizable"),n=s.options,a=(s.containerSize,s.containerOffset),o=(s.size,s.position),r=s._aspectRatio||e.shiftKey,h={top:0,left:0},l=s.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(h=a),o.left<(s._helper?a.left:0)&&(s.size.width=s.size.width+(s._helper?s.position.left-a.left:s.position.left-h.left),r&&(s.size.height=s.size.width/s.aspectRatio),s.position.left=n.helper?a.left:0),o.top<(s._helper?a.top:0)&&(s.size.height=s.size.height+(s._helper?s.position.top-a.top:s.position.top),r&&(s.size.width=s.size.height*s.aspectRatio),s.position.top=s._helper?a.top:0),s.offset.left=s.parentData.left+s.position.left,s.offset.top=s.parentData.top+s.position.top;var c=Math.abs((s._helper,s.offset.left-h.left+s.sizeDiff.width)),u=Math.abs((s._helper?s.offset.top-h.top:s.offset.top-a.top)+s.sizeDiff.height),d=s.containerElement.get(0)==s.element.parent().get(0),p=/relative|absolute/.test(s.containerElement.css("position"));d&&p&&(c-=s.parentData.left),c+s.size.width>=s.parentData.width&&(s.size.width=s.parentData.width-c,r&&(s.size.height=s.size.width/s.aspectRatio)),u+s.size.height>=s.parentData.height&&(s.size.height=s.parentData.height-u,r&&(s.size.width=s.size.height*s.aspectRatio))},stop:function(e,i){var s=t(this).data("resizable"),n=s.options,a=(s.position,s.containerOffset),o=s.containerPosition,r=s.containerElement,h=t(s.helper),l=h.offset(),c=h.outerWidth()-s.sizeDiff.width,u=h.outerHeight()-s.sizeDiff.height;s._helper&&!n.animate&&/relative/.test(r.css("position"))&&t(this).css({left:l.left-o.left-a.left,width:c,height:u}),s._helper&&!n.animate&&/static/.test(r.css("position"))&&t(this).css({left:l.left-o.left-a.left,width:c,height:u})}}),t.ui.plugin.add("resizable","ghost",{start:function(e,i){var s=t(this).data("resizable"),n=s.options,a=s.size;s.ghost=s.originalElement.clone(),s.ghost.css({opacity:.25,display:"block",position:"relative",height:a.height,width:a.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof n.ghost?n.ghost:""),s.ghost.appendTo(s.helper)},resize:function(e,i){var s=t(this).data("resizable");s.options;s.ghost&&s.ghost.css({position:"relative",height:s.size.height,width:s.size.width})},stop:function(e,i){var s=t(this).data("resizable");s.options;s.ghost&&s.helper&&s.helper.get(0).removeChild(s.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(e,i){var s=t(this).data("resizable"),n=s.options,a=s.size,o=s.originalSize,r=s.originalPosition,h=s.axis;n._aspectRatio||e.shiftKey;n.grid="number"==typeof n.grid?[n.grid,n.grid]:n.grid;var l=Math.round((a.width-o.width)/(n.grid[0]||1))*(n.grid[0]||1),c=Math.round((a.height-o.height)/(n.grid[1]||1))*(n.grid[1]||1);/^(se|s|e)$/.test(h)?(s.size.width=o.width+l,s.size.height=o.height+c):/^(ne)$/.test(h)?(s.size.width=o.width+l,s.size.height=o.height+c,s.position.top=r.top-c):/^(sw)$/.test(h)?(s.size.width=o.width+l,s.size.height=o.height+c,s.position.left=r.left-l):(s.size.width=o.width+l,s.size.height=o.height+c,s.position.top=r.top-c,s.position.left=r.left-l)}});var i=function(t){return parseInt(t,10)||0},s=function(t){return!isNaN(parseInt(t,10))}}(jQuery),function(t,e){t.widget("ui.selectable",t.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){(e=t(i.options.filter,i.element[0])).addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<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(e){var i=this;if(this.opos=[e.pageX,e.pageY],!this.options.disabled){var s=this.options;this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s=t.data(this,"selectable-item");if(s){var n=!e.metaKey&&!e.ctrlKey||!s.$element.hasClass("ui-selected");return 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",e,{selecting:s.element}):i._trigger("unselecting",e,{unselecting:s.element}),!1}})}},_mouseDrag:function(e){var i=this;if(this.dragged=!0,!this.options.disabled){var s=this.options,n=this.opos[0],a=this.opos[1],o=e.pageX,r=e.pageY;if(n>o){var h=o;o=n,n=h}if(a>r){h=r;r=a,a=h}return this.helper.css({left:n,top:a,width:o-n,height:r-a}),this.selectees.each(function(){var h=t.data(this,"selectable-item");if(h&&h.element!=i.element[0]){var l=!1;"touch"==s.tolerance?l=!(h.left>o||h.right<n||h.top>r||h.bottom<a):"fit"==s.tolerance&&(l=h.left>n&&h.right<o&&h.top>a&&h.bottom<r),l?(h.selected&&(h.$element.removeClass("ui-selected"),h.selected=!1),h.unselecting&&(h.$element.removeClass("ui-unselecting"),h.unselecting=!1),h.selecting||(h.$element.addClass("ui-selecting"),h.selecting=!0,i._trigger("selecting",e,{selecting:h.element}))):(h.selecting&&((e.metaKey||e.ctrlKey)&&h.startselected?(h.$element.removeClass("ui-selecting"),h.selecting=!1,h.$element.addClass("ui-selected"),h.selected=!0):(h.$element.removeClass("ui-selecting"),h.selecting=!1,h.startselected&&(h.$element.addClass("ui-unselecting"),h.unselecting=!0),i._trigger("unselecting",e,{unselecting:h.element}))),h.selected&&(e.metaKey||e.ctrlKey||h.startselected||(h.$element.removeClass("ui-selected"),h.selected=!1,h.$element.addClass("ui-unselecting"),h.unselecting=!0,i._trigger("unselecting",e,{unselecting:h.element}))))}}),!1}},_mouseStop:function(e){var i=this;this.dragged=!1;this.options;return t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})}(jQuery),function(t,e){t.widget("ui.sortable",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===t.axis||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display"))),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=this;if(this.reverting)return!1;if(this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(e);var n=null;t(e.target).parents().each(function(){if(t.data(this,s.widgetName+"-item")==s)return n=t(this),!1});if(t.data(e.target,s.widgetName+"-item")==s&&(n=t(e.target)),!n)return!1;if(this.options.handle&&!i){var a=!1;if(t(this.options.handle,n).find("*").addBack().each(function(){this==e.target&&(a=!0)}),!a)return!1}return this.currentItem=n,this._removeCurrentsFromItems(),!0},_mouseStart:function(e,i,s){var n=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),n.containment&&this._setContainment(),n.cursor&&(t("body").css("cursor")&&(this._storedCursor=t("body").css("cursor")),t("body").css("cursor",n.cursor)),n.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",n.opacity)),n.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",n.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(var a=this.containers.length-1;a>=0;a--)this.containers[a]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){var i=this.options,s=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<i.scrollSensitivity?this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+i.scrollSpeed:e.pageY-this.overflowOffset.top<i.scrollSensitivity&&(this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-i.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<i.scrollSensitivity?this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+i.scrollSpeed:e.pageX-this.overflowOffset.left<i.scrollSensitivity&&(this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-i.scrollSpeed)):(e.pageY-t(document).scrollTop()<i.scrollSensitivity?s=t(document).scrollTop(t(document).scrollTop()-i.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<i.scrollSensitivity&&(s=t(document).scrollTop(t(document).scrollTop()+i.scrollSpeed)),e.pageX-t(document).scrollLeft()<i.scrollSensitivity?s=t(document).scrollLeft(t(document).scrollLeft()-i.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<i.scrollSensitivity&&(s=t(document).scrollLeft(t(document).scrollLeft()+i.scrollSpeed))),!1!==s&&t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)}this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(var n=this.items.length-1;n>=0;n--){var a=this.items[n],o=a.item[0],r=this._intersectsWithPointer(a);if(r&&(a.instance===this.currentContainer&&!(o==this.currentItem[0]||this.placeholder[1==r?"next":"prev"]()[0]==o||t.contains(this.placeholder[0],o)||"semi-dynamic"==this.options.type&&t.contains(this.element[0],o)))){if(this.direction=1==r?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(a))break;this._rearrange(e,a),this._trigger("change",e,this._uiHash());break}}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset();this.reverting=!0,t(this.helper).animate({left:n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:n.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(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=t.left,o=a+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u=s+l>r&&s+l<h&&e+c>a&&e+c<o;return"pointer"==this.options.tolerance||this.options.forcePointerForContainers||"pointer"!=this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?u:a<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<o&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<h},_intersectsWithPointer:function(e){var i="x"===this.options.axis||t.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),s="y"===this.options.axis||t.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),n=i&&s,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return!!n&&(this.floating?o&&"right"==o||"down"==a?2:1:a&&("down"==a?2:1))},_intersectsWithSides:function(e){var i=t.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),s=t.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"==a&&s||"left"==a&&!s:n&&("down"==n&&i||"up"==n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i=[],s=[],n=this._connectWith();if(n&&e)for(var a=n.length-1;a>=0;a--)for(var o=t(n[a]),r=o.length-1;r>=0;r--){var h=t.data(o[r],this.widgetName);h&&h!=this&&!h.options.disabled&&s.push([t.isFunction(h.options.items)?h.options.items.call(h.element):t(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}s.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=s.length-1;a>=0;a--)s[a][0].each(function(){i.push(this)});return t(i)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;i<e.length;i++)if(e[i]==t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i=this.items,s=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],n=this._connectWith();if(n&&this.ready)for(var a=n.length-1;a>=0;a--)for(var o=t(n[a]),r=o.length-1;r>=0;r--){var h=t.data(o[r],this.widgetName);h&&h!=this&&!h.options.disabled&&(s.push([t.isFunction(h.options.items)?h.options.items.call(h.element[0],e,{item:this.currentItem}):t(h.options.items,h.element),h]),this.containers.push(h))}for(a=s.length-1;a>=0;a--)for(var l=s[a][1],c=s[a][0],u=(r=0,c.length);r<u;r++){var d=t(c[r]);d.data(this.widgetName+"-item",l),i.push({item:d,instance:l,width:0,height:0,left:0,top:0})}},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var i=this.items.length-1;i>=0;i--){var s=this.items[i];if(s.instance==this.currentContainer||!this.currentContainer||s.item[0]==this.currentItem[0]){var n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item;e||(s.width=n.outerWidth(),s.height=n.outerHeight());var a=n.offset();s.left=a.left,s.top=a.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--){a=this.containers[i].element.offset();this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}return this},_createPlaceholder:function(e){var i=(e=e||this).options;if(!i.placeholder||i.placeholder.constructor==String){var s=i.placeholder;i.placeholder={element:function(){var i=t(document.createElement(e.currentItem[0].nodeName)).addClass(s||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return s||(i.style.visibility="hidden"),i},update:function(t,n){s&&!i.forcePlaceholderSize||(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}}e.placeholder=t(i.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),i.placeholder.update(e,e.placeholder)},_contactContainers:function(e){for(var i=null,s=null,n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(i&&t.contains(this.containers[n].element[0],i.element[0]))continue;i=this.containers[n],s=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",e,this._uiHash(this)),this.containers[n].containerCache.over=0);if(i)if(1===this.containers.length)this.containers[s]._trigger("over",e,this._uiHash(this)),this.containers[s].containerCache.over=1;else{for(var a=1e4,o=null,r=this.containers[s].floating?"left":"top",h=this.containers[s].floating?"width":"height",l=this.positionAbs[r]+this.offset.click[r],c=this.items.length-1;c>=0;c--)if(t.contains(this.containers[s].element[0],this.items[c].item[0])&&this.items[c].item[0]!=this.currentItem[0]){var u=this.items[c].item.offset()[r],d=!1;Math.abs(u-l)>Math.abs(u+this.items[c][h]-l)&&(d=!0,u+=this.items[c][h]),Math.abs(u-l)<a&&(a=Math.abs(u-l),o=this.items[c],this.direction=d?"up":"down")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[s],o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[s].element,!0),this._trigger("change",e,this._uiHash()),this.containers[s]._trigger("change",e,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[s]._trigger("over",e,this._uiHash(this)),this.containers[s].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"==i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!=i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(""==s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(""==s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),"document"!=e.containment&&"window"!=e.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),!/^(document|window|parent)$/.test(e.containment)){var i=t(e.containment)[0],s=t(e.containment).offset(),n="hidden"!=t(i).css("overflow");this.containment=[s.left+(parseInt(t(i).css("borderLeftWidth"),10)||0)+(parseInt(t(i).css("paddingLeft"),10)||0)-this.margins.left,s.top+(parseInt(t(i).css("borderTopWidth"),10)||0)+(parseInt(t(i).css("paddingTop"),10)||0)-this.margins.top,s.left+(n?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t(i).css("borderLeftWidth"),10)||0)-(parseInt(t(i).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,s.top+(n?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t(i).css("borderTopWidth"),10)||0)-(parseInt(t(i).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"==e?1:-1,n=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i=this.options,s="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,n=/(html|body)/i.test(s[0].tagName);"relative"!=this.cssPosition||this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());var a=e.pageX,o=e.pageY;if(this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid)){var r=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1];o=this.containment&&(r-this.offset.click.top<this.containment[1]||r-this.offset.click.top>this.containment[3])?r-this.offset.click.top<this.containment[1]?r+i.grid[1]:r-i.grid[1]:r;var h=this.originalPageX+Math.round((a-this.originalPageX)/i.grid[0])*i.grid[0];a=this.containment&&(h-this.offset.click.left<this.containment[0]||h-this.offset.click.left>this.containment[2])?h-this.offset.click.left<this.containment[0]?h+i.grid[0]:h-i.grid[0]:h}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"==this.cssPosition?-this.scrollParent.scrollTop():n?0:s.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():n?0:s.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"==this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n==this.counter&&this.refreshPositions(!s)})},_clear:function(e,i){this.reverting=!1;var s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]==this.currentItem[0]){for(var 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();this.fromOutside&&!i&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev==this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent==this.currentItem.parent()[0]||i||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(i||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer))));for(n=this.containers.length-1;n>=0;n--)i||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over=0);if(this._storedCursor&&t("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){this._trigger("beforeStop",e,this._uiHash());for(n=0;n<s.length;n++)s[n].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(i||this._trigger("beforeStop",e,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,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})}(jQuery),function(t,e){var i=0,s={},n={};s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="hide",n.height=n.paddingTop=n.paddingBottom=n.borderTopWidth=n.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.9.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.accordionId="ui-accordion-"+(this.element.attr("id")||++i),s=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(s.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),s.collapsible||!1!==s.active&&null!=s.active||(s.active=0),s.active<0&&(s.active+=this.headers.length),this.active=this._findActive(s.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._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(i){var s=t(this),n=s.attr("id"),a=s.next(),o=a.attr("id");n||(n=e+"-header-"+i,s.attr("id",n)),o||(o=e+"-panel-"+i,a.attr("id",o)),s.attr("aria-controls",o),a.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._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(s.event)},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e)):this._activate(e)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),a=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(t(e.target).attr("tabIndex",-1),t(a).attr("tabIndex",0),a.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e,i,s=this.options.heightStyle,n=this.element.parent();"fill"===s?(t.support.minHeight||(i=n.css("overflow"),n.css("overflow","hidden")),e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),i&&n.css("overflow",i),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){e=Math.max(e,t(this).css("height","").height())}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={};e&&(t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._on(this.headers,i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?t():n.next(),h={oldHeader:s,oldPanel:s.next(),newHeader:o?t():n,newPanel:r};e.preventDefault(),a&&!i.collapsible||!1===this._trigger("beforeActivate",e,h)||(i.active=!o&&this.headers.index(n),this.active=a?t():n,this._toggle(h),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-expanded":"false","aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,i){var a,o,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(i)};return"number"==typeof d&&(r=d),"string"==typeof d&&(o=d),o=o||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(a=t.show().outerHeight(),e.animate(s,{duration:r,easing:o,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(n,{duration:r,easing:o,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(a-e.outerHeight()-l),l=0)}})):e.animate(s,r,o,p):t.animate(n,r,o,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),!1!==t.uiBackCompat&&(function(t,e){t.extend(e.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var i=e._create;e._create=function(){if(this.options.navigation){var e=this,s=this.element.find(this.options.header),n=s.next(),a=s.add(n).find("a").filter(this.options.navigationFilter)[0];a&&s.add(n).each(function(i){if(t.contains(this,a))return e.options.active=Math.floor(i/2),!1})}i.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(t,e){t.extend(e.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var i=e._create,s=e._setOption;t.extend(e,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),i.call(this)},_setOption:function(t){"autoHeight"!==t&&"clearStyle"!==t&&"fillSpace"!==t||(this.options.heightStyle=this._mergeHeightStyle()),s.apply(this,arguments)},_mergeHeightStyle:function(){var t=this.options;return t.fillSpace?"fill":t.clearStyle?"content":t.autoHeight?"auto":void 0}})}(jQuery,jQuery.ui.accordion.prototype),function(t,e){t.extend(e.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var i=e._createIcons;e._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),i.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(t,e){e.activate=e._activate;var i=e._findActive;e._findActive=function(t){return-1===t&&(t=!1),t&&"number"!=typeof t&&-1===(t=this.headers.index(this.headers.filter(t)))&&(t=!1),i.call(this,t)}}(jQuery,jQuery.ui.accordion.prototype),jQuery.ui.accordion.prototype.resize=jQuery.ui.accordion.prototype.refresh,function(t,e){t.extend(e.options,{change:null,changestart:null});var i=e._trigger;e._trigger=function(t,e,s){var n=i.apply(this,arguments);return!!n&&("beforeActivate"===t?n=i.call(this,"changestart",e,{oldHeader:s.oldHeader,oldContent:s.oldPanel,newHeader:s.newHeader,newContent:s.newPanel}):"activate"===t&&(n=i.call(this,"change",e,{oldHeader:s.oldHeader,oldContent:s.oldPanel,newHeader:s.newHeader,newContent:s.newPanel})),n)}}(jQuery,jQuery.ui.accordion.prototype),function(t,e){t.extend(e.options,{animate:null,animated:"slide"});var i=e._create;e._create=function(){var t=this.options;null===t.animate&&(t.animated?"slide"===t.animated?t.animate=300:"bounceslide"===t.animated?t.animate={duration:200,down:{easing:"easeOutBounce",duration:1e3}}:t.animate=t.animated:t.animate=!1),i.call(this)}}(jQuery,jQuery.ui.accordion.prototype))}(jQuery),function(t,e){var i=0;t.widget("ui.autocomplete",{version:"1.9.2",defaultElement:"<input>",options:{appendTo:"body",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 e,i,s;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(n){if(this.element.prop("readOnly"))return e=!0,s=!0,void(i=!0);e=!1,s=!1,i=!1;var a=t.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:e=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case a.UP:e=!0,this._keyEvent("previous",n);break;case a.DOWN:e=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,void s.preventDefault();if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){if(s)return s=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:t(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)});var s=i.item.data("ui-autocomplete-item")||i.item.data("item.autocomplete");!1!==this._trigger("focus",e,{item:s})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item")||e.item.data("item.autocomplete"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),t.fn.bgiframe&&this.menu.element.bgiframe(),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(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this.document.find(e||"body")[0]),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isMultiLine:function(){return!!this.element.is("textarea")||!this.element.is("input")&&this.element.prop("isContentEditable")},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var t=this,e=++i;return function(s){e===i&&t.__response(s),t.pending--,t.pending||t.element.removeClass("ui-autocomplete-loading")}},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(i,e),this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=new RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})}(jQuery),function(t,e){var i,s,n,a,o="ui-button ui-widget ui-state-default ui-corner-all",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",h=function(){var e=t(this).find(":ui-button");setTimeout(function(){e.button("refresh")},1)},l=function(e){var i=e.name,s=e.form,n=t([]);return i&&(n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.9.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,h),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var e=this,r=this.options,c="checkbox"===this.type||"radio"===this.type,u=c?"":"ui-state-active";null===r.label&&(r.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(){r.disabled||this===i&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){r.disabled||t(this).removeClass(u)}).bind("click"+this.eventNamespace,function(t){r.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){e.buttonElement.addClass("ui-state-focus")}).bind("blur"+this.eventNamespace,function(){e.buttonElement.removeClass("ui-state-focus")}),c&&(this.element.bind("change"+this.eventNamespace,function(){a||e.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(t){r.disabled||(a=!1,s=t.pageX,n=t.pageY)}).bind("mouseup"+this.eventNamespace,function(t){r.disabled||s===t.pageX&&n===t.pageY||(a=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||a)return!1;t(this).toggleClass("ui-state-active"),e.buttonElement.attr("aria-pressed",e.element[0].checked)}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||a)return!1;t(this).addClass("ui-state-active"),e.buttonElement.attr("aria-pressed","true");var i=e.element[0];l(i).not(i).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(r.disabled)return!1;t(this).addClass("ui-state-active"),i=this,e.document.one("mouseup",function(){i=null})}).bind("mouseup"+this.eventNamespace,function(){if(r.disabled)return!1;t(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(e){if(r.disabled)return!1;e.keyCode!==t.ui.keyCode.SPACE&&e.keyCode!==t.ui.keyCode.ENTER||t(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",r.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),(i=this.element.is(":checked"))&&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+" ui-state-hover ui-state-active  "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){this._super(t,e),"disabled"!==t?this._resetButton():e?this.element.prop("disabled",!0):this.element.prop("disabled",!1)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?l(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"!==this.type){var e=this.buttonElement.removeClass(r),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}else this.options.label&&this.element.val(this.options.label)}}),t.widget("ui.buttonset",{version:"1.9.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function($,undefined){function Datepicker(){this.debug=!1,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},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(e,"mouseout",function(){$(this).removeClass("ui-state-hover"),-1!=this.className.indexOf("ui-datepicker-prev")&&$(this).removeClass("ui-datepicker-prev-hover"),-1!=this.className.indexOf("ui-datepicker-next")&&$(this).removeClass("ui-datepicker-next-hover")}).delegate(e,"mouseover",function(){$.datepicker._isDisabledDatepicker(instActive.inline?t.parent()[0]:instActive.input[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),-1!=this.className.indexOf("ui-datepicker-prev")&&$(this).addClass("ui-datepicker-prev-hover"),-1!=this.className.indexOf("ui-datepicker-next")&&$(this).addClass("ui-datepicker-next-hover"))})}function extendRemove(t,e){for(var i in $.extend(t,e),e)null!=e[i]&&e[i]!=undefined||(t[i]=e[i]);return t}$.extend($.ui,{datepicker:{version:"1.9.2"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return extendRemove(this._defaults,t||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(t){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline="div"==nodeName||"span"==nodeName;target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),"input"==nodeName?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(t,e){var i=$(t);e.append=$([]),e.trigger=$([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(t,i,s){e.settings[i]=s}).bind("getData.datepicker",function(t,i){return this._get(e,i)}),this._autoSize(e),$.data(t,PROP_NAME,e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i=this._get(e,"appendText"),s=this._get(e,"isRTL");e.append&&e.append.remove(),i&&(e.append=$('<span class="'+this._appendClass+'">'+i+"</span>"),t[s?"before":"after"](e.append)),t.unbind("focus",this._showDatepicker),e.trigger&&e.trigger.remove();var n=this._get(e,"showOn");if("focus"!=n&&"both"!=n||t.focus(this._showDatepicker),"button"==n||"both"==n){var a=this._get(e,"buttonText"),o=this._get(e,"buttonImage");e.trigger=$(this._get(e,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:o,alt:a,title:a}):$('<button type="button"></button>').addClass(this._triggerClass).html(""==o?a:$("<img/>").attr({src:o,alt:a,title:a}))),t[s?"before":"after"](e.trigger),e.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==t[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=t[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(t[0])):$.datepicker._showDatepicker(t[0]),!1})}},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e=new Date(2009,11,20),i=this._get(t,"dateFormat");if(i.match(/[DM]/)){var s=function(t){for(var e=0,i=0,s=0;s<t.length;s++)t[s].length>e&&(e=t[s].length,i=s);return i};e.setMonth(s(this._get(t,i.match(/MM/)?"monthNames":"monthNamesShort"))),e.setDate(s(this._get(t,i.match(/DD/)?"dayNames":"dayNamesShort"))+20-e.getDay())}t.input.attr("size",this._formatDate(t,e).length)}},_inlineDatepicker:function(t,e){var i=$(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv).bind("setData.datepicker",function(t,i,s){e.settings[i]=s}).bind("getData.datepicker",function(t,i){return this._get(e,i)}),$.data(t,PROP_NAME,e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var a=this._dialogInst;if(!a){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+o+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),(a=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},$.data(this._dialogInput[0],PROP_NAME,a)}if(extendRemove(a.settings,s||{}),e=e&&e.constructor==Date?this._formatDate(a,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,!this._pos){var r=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[r/2-100+l,h/2-150+c]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),a.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,a),this},_destroyDatepicker:function(t){var e=$(t),i=$.data(t,PROP_NAME);if(e.hasClass(this.markerClassName)){var s=t.nodeName.toLowerCase();$.removeData(t,PROP_NAME),"input"==s?(i.append.remove(),i.trigger.remove(),e.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!=s&&"span"!=s||e.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(t){var e=$(t),i=$.data(t,PROP_NAME);if(e.hasClass(this.markerClassName)){var s=t.nodeName.toLowerCase();if("input"==s)t.disabled=!1,i.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if("div"==s||"span"==s){var n=e.children("."+this._inlineClass);n.children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)}this._disabledInputs=$.map(this._disabledInputs,function(e){return e==t?null:e})}},_disableDatepicker:function(t){var e=$(t),i=$.data(t,PROP_NAME);if(e.hasClass(this.markerClassName)){var s=t.nodeName.toLowerCase();if("input"==s)t.disabled=!0,i.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if("div"==s||"span"==s){var n=e.children("."+this._inlineClass);n.children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)}this._disabledInputs=$.map(this._disabledInputs,function(e){return e==t?null:e}),this._disabledInputs[this._disabledInputs.length]=t}},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]==t)return!0;return!1},_getInst:function(t){try{return $.data(t,PROP_NAME)}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s=this._getInst(t);if(2==arguments.length&&"string"==typeof e)return"defaults"==e?$.extend({},$.datepicker._defaults):s?"all"==e?$.extend({},s.settings):this._get(s,e):null;var n=e||{};if("string"==typeof e&&((n={})[e]=i),s){this._curInst==s&&this._hideDatepicker();var a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(s,"min"),r=this._getMinMaxDate(s,"max");extendRemove(s.settings,n),null!==o&&n.dateFormat!==undefined&&n.minDate===undefined&&(s.settings.minDate=this._formatDate(s,o)),null!==r&&n.dateFormat!==undefined&&n.maxDate===undefined&&(s.settings.maxDate=this._formatDate(s,r)),this._attachments($(t),s),this._autoSize(s),this._setDate(s,a),this._updateAlternate(s),this._updateDatepicker(s)}},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(t){var e=$.datepicker._getInst(t.target),i=!0,s=e.dpDiv.is(".ui-datepicker-rtl");if(e._keyEvent=!0,$.datepicker._datepickerShowing)switch(t.keyCode){case 9:$.datepicker._hideDatepicker(),i=!1;break;case 13:var n=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",e.dpDiv);n[0]&&$.datepicker._selectDay(t.target,e.selectedMonth,e.selectedYear,n[0]);var a=$.datepicker._get(e,"onSelect");if(a){var o=$.datepicker._formatDate(e);a.apply(e.input?e.input[0]:null,[o,e])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(t.target,t.ctrlKey?-$.datepicker._get(e,"stepBigMonths"):-$.datepicker._get(e,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(t.target,t.ctrlKey?+$.datepicker._get(e,"stepBigMonths"):+$.datepicker._get(e,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&$.datepicker._clearDate(t.target),i=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&$.datepicker._gotoToday(t.target),i=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&$.datepicker._adjustDate(t.target,s?1:-1,"D"),i=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&$.datepicker._adjustDate(t.target,t.ctrlKey?-$.datepicker._get(e,"stepBigMonths"):-$.datepicker._get(e,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&$.datepicker._adjustDate(t.target,-7,"D"),i=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&$.datepicker._adjustDate(t.target,s?-1:1,"D"),i=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&$.datepicker._adjustDate(t.target,t.ctrlKey?+$.datepicker._get(e,"stepBigMonths"):+$.datepicker._get(e,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&$.datepicker._adjustDate(t.target,7,"D"),i=t.ctrlKey||t.metaKey;break;default:i=!1}else 36==t.keyCode&&t.ctrlKey?$.datepicker._showDatepicker(this):i=!1;i&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e=$.datepicker._getInst(t.target);if($.datepicker._get(e,"constrainInput")){var i=$.datepicker._possibleChars($.datepicker._get(e,"dateFormat")),s=String.fromCharCode(t.charCode==undefined?t.keyCode:t.charCode);return t.ctrlKey||t.metaKey||s<" "||!i||i.indexOf(s)>-1}},_doKeyUp:function(t){var e=$.datepicker._getInst(t.target);if(e.input.val()!=e.lastVal)try{$.datepicker.parseDate($.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,$.datepicker._getFormatConfig(e))&&($.datepicker._setDateFromField(e),$.datepicker._updateAlternate(e),$.datepicker._updateDatepicker(e))}catch(t){$.datepicker.log(t)}return!0},_showDatepicker:function(t){if("input"!=(t=t.target||t).nodeName.toLowerCase()&&(t=$("input",t.parentNode)[0]),!$.datepicker._isDisabledDatepicker(t)&&$.datepicker._lastInput!=t){var e=$.datepicker._getInst(t);$.datepicker._curInst&&$.datepicker._curInst!=e&&($.datepicker._curInst.dpDiv.stop(!0,!0),e&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var i=$.datepicker._get(e,"beforeShow"),s=i?i.apply(t,[t,e]):{};if(!1!==s){extendRemove(e.settings,s),e.lastVal=null,$.datepicker._lastInput=t,$.datepicker._setDateFromField(e),$.datepicker._inDialog&&(t.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(t),$.datepicker._pos[1]+=t.offsetHeight);var n=!1;$(t).parents().each(function(){return!(n|="fixed"==$(this).css("position"))});var a={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};if($.datepicker._pos=null,e.dpDiv.empty(),e.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(e),a=$.datepicker._checkOffset(e,a,n),e.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":n?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),!e.inline){var o=$.datepicker._get(e,"showAnim"),r=$.datepicker._get(e,"duration"),h=function(){var t=e.dpDiv.find("iframe.ui-datepicker-cover");if(t.length){var i=$.datepicker._getBorders(e.dpDiv);t.css({left:-i[0],top:-i[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()})}};e.dpDiv.zIndex($(t).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&($.effects.effect[o]||$.effects[o])?e.dpDiv.show(o,$.datepicker._get(e,"showOptions"),r,h):e.dpDiv[o||"show"](o?r:null,h),o&&r||h(),e.input.is(":visible")&&!e.input.is(":disabled")&&e.input.focus(),$.datepicker._curInst=e}}}},_updateDatepicker:function(t){this.maxRows=4;var e=$.datepicker._getBorders(t.dpDiv);instActive=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i=t.dpDiv.find("iframe.ui-datepicker-cover");i.length&&i.css({left:-e[0],top:-e[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()}),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var s=this._getNumberOfMonths(t),n=s[1];if(t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",17*n+"em"),t.dpDiv[(1!=s[0]||1!=s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t==$.datepicker._curInst&&$.datepicker._datepickerShowing&&t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&t.input[0]!=document.activeElement&&t.input.focus(),t.yearshtml){var a=t.yearshtml;setTimeout(function(){a===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),a=t.yearshtml=null},0)}},_getBorders:function(t){var e=function(t){return{thin:1,medium:2,thick:3}[t]||t};return[parseFloat(e(t.css("border-left-width"))),parseFloat(e(t.css("border-top-width")))]},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),a=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:$(document).scrollLeft()),h=document.documentElement.clientHeight+(i?0:$(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-a:0,e.left-=i&&e.left==t.input.offset().left?$(document).scrollLeft():0,e.top-=i&&e.top==t.input.offset().top+o?$(document).scrollTop():0,e.left-=Math.min(e.left,e.left+s>r&&r>s?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,e.top+n>h&&h>n?Math.abs(n+o):0),e},_findPos:function(t){for(var e=this._getInst(t),i=this._get(e,"isRTL");t&&("hidden"==t.type||1!=t.nodeType||$.expr.filters.hidden(t));)t=t[i?"previousSibling":"nextSibling"];var s=$(t).offset();return[s.left,s.top]},_hideDatepicker:function(t){var e=this._curInst;if(e&&(!t||e==$.data(t,PROP_NAME))&&this._datepickerShowing){var i=this._get(e,"showAnim"),s=this._get(e,"duration"),n=function(){$.datepicker._tidyDialog(e)};$.effects&&($.effects.effect[i]||$.effects[i])?e.dpDiv.hide(i,$.datepicker._get(e,"showOptions"),s,n):e.dpDiv["slideDown"==i?"slideUp":"fadeIn"==i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1;var a=this._get(e,"onClose");a&&a.apply(e.input?e.input[0]:null,[e.input?e.input.val():"",e]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if($.datepicker._curInst){var e=$(t.target),i=$.datepicker._getInst(e[0]);(e[0].id==$.datepicker._mainDivId||0!=e.parents("#"+$.datepicker._mainDivId).length||e.hasClass($.datepicker.markerClassName)||e.closest("."+$.datepicker._triggerClass).length||!$.datepicker._datepickerShowing||$.datepicker._inDialog&&$.blockUI)&&(!e.hasClass($.datepicker.markerClassName)||$.datepicker._curInst==i)||$.datepicker._hideDatepicker()}},_adjustDate:function(t,e,i){var s=$(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,e+("M"==i?this._get(n,"showCurrentAtPos"):0),i),this._updateDatepicker(n))},_gotoToday:function(t){var e=$(t),i=this._getInst(e[0]);if(this._get(i,"gotoCurrent")&&i.currentDay)i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear;else{var s=new Date;i.selectedDay=s.getDate(),i.drawMonth=i.selectedMonth=s.getMonth(),i.drawYear=i.selectedYear=s.getFullYear()}this._notifyChange(i),this._adjustDate(e),this._selectDate(t,this._formatDate(i,i.selectedDay,i.drawMonth,i.drawYear))},_selectMonthYear:function(t,e,i){var s=$(t),n=this._getInst(s[0]);n["selected"+("M"==i?"Month":"Year")]=n["draw"+("M"==i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,e,i,s){var n=$(t);if(!$(s).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(n[0])){var a=this._getInst(n[0]);a.selectedDay=a.currentDay=$("a",s).html(),a.selectedMonth=a.currentMonth=e,a.selectedYear=a.currentYear=i,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear))}},_clearDate:function(t){var e=$(t);this._getInst(e[0]);this._selectDate(e,"")},_selectDate:function(t,e){var i=$(t),s=this._getInst(i[0]);e=null!=e?e:this._formatDate(s),s.input&&s.input.val(e),this._updateAlternate(s);var n=this._get(s,"onSelect");n?n.apply(s.input?s.input[0]:null,[e,s]):s.input&&s.input.trigger("change"),s.inline?this._updateDatepicker(s):(this._hideDatepicker(),this._lastInput=s.input[0],"object"!=typeof s.input[0]&&s.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var e=this._get(t,"altField");if(e){var i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t));$(e).each(function(){$(this).val(n)})}},noWeekends:function(t){var e=t.getDay();return[e>0&&e<6,""]},iso8601Week:function(t){var e=new Date(t.getTime());e.setDate(e.getDate()+4-(e.getDay()||7));var i=e.getTime();return e.setMonth(0),e.setDate(1),Math.floor(Math.round((i-e)/864e5)/7)+1},parseDate:function(t,e,i){if(null==t||null==e)throw"Invalid arguments";if(""==(e="object"==typeof e?e.toString():e+""))return null;var s=(i?i.shortYearCutoff:null)||this._defaults.shortYearCutoff;s="string"!=typeof s?s:(new Date).getFullYear()%100+parseInt(s,10);for(var n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=-1,l=-1,c=-1,u=-1,d=!1,p=function(e){var i=_+1<t.length&&t.charAt(_+1)==e;return i&&_++,i},f=function(t){var i=p(t),s=new RegExp("^\\d{1,"+("@"==t?14:"!"==t?20:"y"==t&&i?4:"o"==t?3:2)+"}"),n=e.substring(v).match(s);if(!n)throw"Missing number at position "+v;return v+=n[0].length,parseInt(n[0],10)},g=function(t,i,s){var n=$.map(p(t)?s:i,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)}),a=-1;if($.each(n,function(t,i){var s=i[1];if(e.substr(v,s.length).toLowerCase()==s.toLowerCase())return a=i[0],v+=s.length,!1}),-1!=a)return a+1;throw"Unknown name at position "+v},m=function(){if(e.charAt(v)!=t.charAt(_))throw"Unexpected literal at position "+v;v++},v=0,_=0;_<t.length;_++)if(d)"'"!=t.charAt(_)||p("'")?m():d=!1;else switch(t.charAt(_)){case"d":c=f("d");break;case"D":g("D",n,a);break;case"o":u=f("o");break;case"m":l=f("m");break;case"M":l=g("M",o,r);break;case"y":h=f("y");break;case"@":h=(b=new Date(f("@"))).getFullYear(),l=b.getMonth()+1,c=b.getDate();break;case"!":var b;h=(b=new Date((f("!")-this._ticksTo1970)/1e4)).getFullYear(),l=b.getMonth()+1,c=b.getDate();break;case"'":p("'")?m():d=!0;break;default:m()}if(v<e.length){var y=e.substr(v);if(!/^\s+/.test(y))throw"Extra/unparsed characters found in date: "+y}if(-1==h?h=(new Date).getFullYear():h<100&&(h+=(new Date).getFullYear()-(new Date).getFullYear()%100+(h<=s?0:-100)),u>-1)for(l=1,c=u;;){var w=this._getDaysInMonth(h,l-1);if(c<=w)break;l++,c-=w}if((b=this._daylightSavingAdjust(new Date(h,l-1,c))).getFullYear()!=h||b.getMonth()+1!=l||b.getDate()!=c)throw"Invalid date";return b},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:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,i){if(!e)return"";var s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,r=function(e){var i=d+1<t.length&&t.charAt(d+1)==e;return i&&d++,i},h=function(t,e,i){var s=""+e;if(r(t))for(;s.length<i;)s="0"+s;return s},l=function(t,e,i,s){return r(t)?s[e]:i[e]},c="",u=!1;if(e)for(var d=0;d<t.length;d++)if(u)"'"!=t.charAt(d)||r("'")?c+=t.charAt(d):u=!1;else switch(t.charAt(d)){case"d":c+=h("d",e.getDate(),2);break;case"D":c+=l("D",e.getDay(),s,n);break;case"o":c+=h("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":c+=h("m",e.getMonth()+1,2);break;case"M":c+=l("M",e.getMonth(),a,o);break;case"y":c+=r("y")?e.getFullYear():(e.getYear()%100<10?"0":"")+e.getYear()%100;break;case"@":c+=e.getTime();break;case"!":c+=1e4*e.getTime()+this._ticksTo1970;break;case"'":r("'")?c+="'":u=!0;break;default:c+=t.charAt(d)}return c},_possibleChars:function(t){for(var e="",i=!1,s=function(e){var i=n+1<t.length&&t.charAt(n+1)==e;return i&&n++,i},n=0;n<t.length;n++)if(i)"'"!=t.charAt(n)||s("'")?e+=t.charAt(n):i=!1;else switch(t.charAt(n)){case"d":case"m":case"y":case"@":e+="0123456789";break;case"D":case"M":return null;case"'":s("'")?e+="'":i=!0;break;default:e+=t.charAt(n)}return e},_get:function(t,e){return t.settings[e]!==undefined?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!=t.lastVal){var i,s,n=this._get(t,"dateFormat"),a=t.lastVal=t.input?t.input.val():null;i=s=this._getDefaultDate(t);var o=this._getFormatConfig(t);try{i=this.parseDate(n,a,o)||s}catch(t){this.log(t),a=e?"":a}t.selectedDay=i.getDate(),t.drawMonth=t.selectedMonth=i.getMonth(),t.drawYear=t.selectedYear=i.getFullYear(),t.currentDay=a?i.getDate():0,t.currentMonth=a?i.getMonth():0,t.currentYear=a?i.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(t,e,i){var s=null==e||""===e?i:"string"==typeof e?function(e){try{return $.datepicker.parseDate($.datepicker._get(t,"dateFormat"),e,$.datepicker._getFormatConfig(t))}catch(t){}for(var i=(e.toLowerCase().match(/^c/)?$.datepicker._getDate(t):null)||new Date,s=i.getFullYear(),n=i.getMonth(),a=i.getDate(),o=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,r=o.exec(e);r;){switch(r[2]||"d"){case"d":case"D":a+=parseInt(r[1],10);break;case"w":case"W":a+=7*parseInt(r[1],10);break;case"m":case"M":n+=parseInt(r[1],10),a=Math.min(a,$.datepicker._getDaysInMonth(s,n));break;case"y":case"Y":s+=parseInt(r[1],10),a=Math.min(a,$.datepicker._getDaysInMonth(s,n))}r=o.exec(e)}return new Date(s,n,a)}(e):"number"==typeof e?isNaN(e)?i:function(t){var e=new Date;return e.setDate(e.getDate()+t),e}(e):new Date(e.getTime());return(s=s&&"Invalid Date"==s.toString()?i:s)&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,o=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=o.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=o.getMonth(),t.drawYear=t.selectedYear=t.currentYear=o.getFullYear(),n==t.selectedMonth&&a==t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""==t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(i,-e,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(i,+e,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(i)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(i,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e=new Date;e=this._daylightSavingAdjust(new Date(e.getFullYear(),e.getMonth(),e.getDate()));var i=this._get(t,"isRTL"),s=this._get(t,"showButtonPanel"),n=this._get(t,"hideIfNoPrevNext"),a=this._get(t,"navigationAsDateFormat"),o=this._getNumberOfMonths(t),r=this._get(t,"showCurrentAtPos"),h=this._get(t,"stepMonths"),l=1!=o[0]||1!=o[1],c=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),u=this._getMinMaxDate(t,"min"),d=this._getMinMaxDate(t,"max"),p=t.drawMonth-r,f=t.drawYear;if(p<0&&(p+=12,f--),d){var g=this._daylightSavingAdjust(new Date(d.getFullYear(),d.getMonth()-o[0]*o[1]+1,d.getDate()));for(g=u&&g<u?u:g;this._daylightSavingAdjust(new Date(f,p,1))>g;)--p<0&&(p=11,f--)}t.drawMonth=p,t.drawYear=f;var m=this._get(t,"prevText");m=a?this.formatDate(m,this._daylightSavingAdjust(new Date(f,p-h,1)),this._getFormatConfig(t)):m;var v=this._canAdjustMonth(t,-1,f,p)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(i?"e":"w")+'">'+m+"</span></a>":n?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(i?"e":"w")+'">'+m+"</span></a>",_=this._get(t,"nextText");_=a?this.formatDate(_,this._daylightSavingAdjust(new Date(f,p+h,1)),this._getFormatConfig(t)):_;var b=this._canAdjustMonth(t,1,f,p)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+_+'"><span class="ui-icon ui-icon-circle-triangle-'+(i?"w":"e")+'">'+_+"</span></a>":n?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+_+'"><span class="ui-icon ui-icon-circle-triangle-'+(i?"w":"e")+'">'+_+"</span></a>",y=this._get(t,"currentText"),w=this._get(t,"gotoCurrent")&&t.currentDay?c:e;y=a?this.formatDate(y,w,this._getFormatConfig(t)):y;var x=t.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(t,"closeText")+"</button>",k=s?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(i?x:"")+(this._isInRange(t,w)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+y+"</button>":"")+(i?"":x)+"</div>":"",C=parseInt(this._get(t,"firstDay"),10);C=isNaN(C)?0:C;for(var D=this._get(t,"showWeek"),P=this._get(t,"dayNames"),I=(this._get(t,"dayNamesShort"),this._get(t,"dayNamesMin")),M=this._get(t,"monthNames"),T=this._get(t,"monthNamesShort"),S=this._get(t,"beforeShowDay"),A=this._get(t,"showOtherMonths"),z=this._get(t,"selectOtherMonths"),H=(this._get(t,"calculateWeek")||this.iso8601Week,this._getDefaultDate(t)),N="",E=0;E<o[0];E++){var W="";this.maxRows=4;for(var O=0;O<o[1];O++){var F=this._daylightSavingAdjust(new Date(f,p,t.selectedDay)),R=" ui-corner-all",j="";if(l){if(j+='<div class="ui-datepicker-group',o[1]>1)switch(O){case 0:j+=" ui-datepicker-group-first",R=" ui-corner-"+(i?"right":"left");break;case o[1]-1:j+=" ui-datepicker-group-last",R=" ui-corner-"+(i?"left":"right");break;default:j+=" ui-datepicker-group-middle",R=""}j+='">'}j+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+R+'">'+(/all|left/.test(R)&&0==E?i?b:v:"")+(/all|right/.test(R)&&0==E?i?v:b:"")+this._generateMonthYearHeader(t,p,f,u,d,E>0||O>0,M,T)+'</div><table class="ui-datepicker-calendar"><thead><tr>';for(var L=D?'<th class="ui-datepicker-week-col">'+this._get(t,"weekHeader")+"</th>":"",Y=0;Y<7;Y++){var B=(Y+C)%7;L+="<th"+((Y+C+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+P[B]+'">'+I[B]+"</span></th>"}j+=L+"</tr></thead><tbody>";var K=this._getDaysInMonth(f,p);f==t.selectedYear&&p==t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,K));var q=(this._getFirstDayOfMonth(f,p)-C+7)%7,Q=Math.ceil((q+K)/7),U=l&&this.maxRows>Q?this.maxRows:Q;this.maxRows=U;for(var V=this._daylightSavingAdjust(new Date(f,p,1-q)),X=0;X<U;X++){j+="<tr>";var G=D?'<td class="ui-datepicker-week-col">'+this._get(t,"calculateWeek")(V)+"</td>":"";for(Y=0;Y<7;Y++){var Z=S?S.apply(t.input?t.input[0]:null,[V]):[!0,""],J=V.getMonth()!=p,tt=J&&!z||!Z[0]||u&&V<u||d&&V>d;G+='<td class="'+((Y+C+6)%7>=5?" ui-datepicker-week-end":"")+(J?" ui-datepicker-other-month":"")+(V.getTime()==F.getTime()&&p==t.selectedMonth&&t._keyEvent||H.getTime()==V.getTime()&&H.getTime()==F.getTime()?" "+this._dayOverClass:"")+(tt?" "+this._unselectableClass+" ui-state-disabled":"")+(J&&!A?"":" "+Z[1]+(V.getTime()==c.getTime()?" "+this._currentClass:"")+(V.getTime()==e.getTime()?" ui-datepicker-today":""))+'"'+(J&&!A||!Z[2]?"":' title="'+Z[2]+'"')+(tt?"":' data-handler="selectDay" data-event="click" data-month="'+V.getMonth()+'" data-year="'+V.getFullYear()+'"')+">"+(J&&!A?"&#xa0;":tt?'<span class="ui-state-default">'+V.getDate()+"</span>":'<a class="ui-state-default'+(V.getTime()==e.getTime()?" ui-state-highlight":"")+(V.getTime()==c.getTime()?" ui-state-active":"")+(J?" ui-priority-secondary":"")+'" href="#">'+V.getDate()+"</a>")+"</td>",V.setDate(V.getDate()+1),V=this._daylightSavingAdjust(V)}j+=G+"</tr>"}++p>11&&(p=0,f++),W+=j+="</tbody></table>"+(l?"</div>"+(o[0]>0&&O==o[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"")}N+=W}return N+=k+($.ui.ie6&&!t.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),t._keyEvent=!1,N},_generateMonthYearHeader:function(t,e,i,s,n,a,o,r){var h=this._get(t,"changeMonth"),l=this._get(t,"changeYear"),c=this._get(t,"showMonthAfterYear"),u='<div class="ui-datepicker-title">',d="";if(a||!h)d+='<span class="ui-datepicker-month">'+o[e]+"</span>";else{var p=s&&s.getFullYear()==i,f=n&&n.getFullYear()==i;d+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var g=0;g<12;g++)(!p||g>=s.getMonth())&&(!f||g<=n.getMonth())&&(d+='<option value="'+g+'"'+(g==e?' selected="selected"':"")+">"+r[g]+"</option>");d+="</select>"}if(c||(u+=d+(!a&&h&&l?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",a||!l)u+='<span class="ui-datepicker-year">'+i+"</span>";else{var m=this._get(t,"yearRange").split(":"),v=(new Date).getFullYear(),_=function(t){var e=t.match(/c[+-].*/)?i+parseInt(t.substring(1),10):t.match(/[+-].*/)?v+parseInt(t,10):parseInt(t,10);return isNaN(e)?v:e},b=_(m[0]),y=Math.max(b,_(m[1]||""));for(b=s?Math.max(b,s.getFullYear()):b,y=n?Math.min(y,n.getFullYear()):y,t.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';b<=y;b++)t.yearshtml+='<option value="'+b+'"'+(b==i?' selected="selected"':"")+">"+b+"</option>";t.yearshtml+="</select>",u+=t.yearshtml,t.yearshtml=null}return u+=this._get(t,"yearSuffix"),c&&(u+=(!a&&h&&l?"":"&#xa0;")+d),u+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"==i?e:0),n=t.drawMonth+("M"==i?e:0),a=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"==i?e:0),o=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,a)));t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),"M"!=i&&"Y"!=i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&e<i?i:e;return n=s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),a=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(t,a)},_isInRange:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max");return(!i||e.getTime()>=i.getTime())&&(!s||e.getTime()<=s.getTime())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),$.fn.datepicker=function(t){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var e=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]?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this].concat(e)):$.datepicker._attachDatepicker(this,t)}):$.datepicker["_"+t+"Datepicker"].apply($.datepicker,[this[0]].concat(e))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(t,e){var i="ui-dialog ui-widget ui-widget-content ui-corner-all ",s={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},n={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;i<0&&t(this).css("top",e.top-i)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),"string"!=typeof this.originalTitle&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var e,s,n,a,o,r=this,h=this.options,l=h.title||"&#160;";e=(this.uiDialog=t("<div>")).addClass(i+h.dialogClass).css({display:"none",outline:0,zIndex:h.zIndex}).attr("tabIndex",-1).keydown(function(e){h.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE&&(r.close(e),e.preventDefault())}).mousedown(function(t){r.moveToTop(!1,t)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(e),s=(this.uiDialogTitlebar=t("<div>")).addClass("ui-dialog-titlebar  ui-widget-header  ui-corner-all  ui-helper-clearfix").bind("mousedown",function(){e.focus()}).prependTo(e),n=t("<a href='#'></a>").addClass("ui-dialog-titlebar-close  ui-corner-all").attr("role","button").click(function(t){t.preventDefault(),r.close(t)}).appendTo(s),(this.uiDialogTitlebarCloseText=t("<span>")).addClass("ui-icon ui-icon-closethick").text(h.closeText).appendTo(n),a=t("<span>").uniqueId().addClass("ui-dialog-title").html(l).prependTo(s),o=(this.uiDialogButtonPane=t("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=t("<div>")).addClass("ui-dialog-buttonset").appendTo(o),e.attr({role:"dialog","aria-labelledby":a.attr("id")}),s.find("*").add(s).disableSelection(),this._hoverable(n),this._focusable(n),h.draggable&&t.fn.draggable&&this._makeDraggable(),h.resizable&&t.fn.resizable&&this._makeResizable(),this._createButtons(h.buttons),this._isOpen=!1,t.fn.bgiframe&&e.bgiframe(),this._on(e,{keydown:function(i){if(h.modal&&i.keyCode===t.ui.keyCode.TAB){var s=t(":tabbable",e),n=s.filter(":first"),a=s.filter(":last");return i.target!==a[0]||i.shiftKey?i.target===n[0]&&i.shiftKey?(a.focus(1),!1):void 0:(n.focus(1),!1)}}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var t,e=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(e){var i,s,n=this;if(this._isOpen&&!1!==this._trigger("beforeClose",e))return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",e)}):(this.uiDialog.hide(),this._trigger("close",e)),t.ui.dialog.overlay.resize(),this.options.modal&&(i=0,t(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(s=t(this).css("z-index"),isNaN(s)||(i=Math.max(i,s)))}),t.ui.dialog.maxZ=i),this},isOpen:function(){return this._isOpen},moveToTop:function(e,i){var s,n=this.options;return n.modal&&!e||!n.stack&&!n.modal?this._trigger("focus",i):(n.zIndex>t.ui.dialog.maxZ&&(t.ui.dialog.maxZ=n.zIndex),this.overlay&&(t.ui.dialog.maxZ+=1,t.ui.dialog.overlay.maxZ=t.ui.dialog.maxZ,this.overlay.$el.css("z-index",t.ui.dialog.overlay.maxZ)),s={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},t.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",t.ui.dialog.maxZ),this.element.attr(s),this._trigger("focus",i),this)},open:function(){if(!this._isOpen){var e,i=this.options,s=this.uiDialog;return this._size(),this._position(i.position),s.show(i.show),this.overlay=i.modal?new t.ui.dialog.overlay(this):null,this.moveToTop(!0),(e=this.element.find(":tabbable")).length||(e=this.uiDialogButtonPane.find(":tabbable")).length||(e=s),e.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this}},_createButtons:function(e){var i=this,s=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),"object"==typeof e&&null!==e&&t.each(e,function(){return!(s=!0)}),s?(t.each(e,function(e,s){var n,a;s=t.isFunction(s)?{click:s,text:e}:s,s=t.extend({type:"button"},s),a=s.click,s.click=function(){a.apply(i.element[0],arguments)},n=t("<button></button>",s).appendTo(i.uiButtonSet),t.fn.button&&n.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,a){s.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._trigger("dragStop",n,e(a)),t.ui.dialog.overlay.resize()}})},_makeResizable:function(e){function i(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}e=void 0===e?this.options.resizable:e;var s=this,n=this.options,a=this.uiDialog.css("position"),o="string"==typeof e?e:"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:o,start:function(e,n){t(this).addClass("ui-dialog-resizing"),s._trigger("resizeStart",e,i(n))},resize:function(t,e){s._trigger("resize",t,i(e))},stop:function(e,a){t(this).removeClass("ui-dialog-resizing"),n.height=t(this).height(),n.width=t(this).width(),s._trigger("resizeStop",e,i(a)),t.ui.dialog.overlay.resize()}}).css("position",a).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(e){var i,s=[],n=[0,0];e?(("string"==typeof e||"object"==typeof e&&"0"in e)&&(1===(s=e.split?e.split(" "):[e[0],e[1]]).length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),e={my:s[0]+(n[0]<0?n[0]:"+"+n[0])+" "+s[1]+(n[1]<0?n[1]:"+"+n[1]),at:s.join(" ")}),e=t.extend({},t.ui.dialog.prototype.options.position,e)):e=t.ui.dialog.prototype.options.position,(i=this.uiDialog.is(":visible"))||this.uiDialog.show(),this.uiDialog.position(e),i||this.uiDialog.hide()},_setOptions:function(e){var i=this,a={},o=!1;t.each(e,function(t,e){i._setOption(t,e),t in s&&(o=!0),t in n&&(a[t]=e)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",a)},_setOption:function(e,s){var n,a,o=this.uiDialog;switch(e){case"buttons":this._createButtons(s);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+s);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(i+s);break;case"disabled":s?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":(n=o.is(":data(draggable)"))&&!s&&o.draggable("destroy"),!n&&s&&this._makeDraggable();break;case"position":this._position(s);break;case"resizable":(a=o.is(":data(resizable)"))&&!s&&o.resizable("destroy"),a&&"string"==typeof s&&o.resizable("option","handles",s),a||!1===s||this._makeResizable(s);break;case"title":t(".ui-dialog-title",this.uiDialogTitlebar).html(""+(s||"&#160;"))}this._super(e,s)},_size:function(){var e,i,s,n=this.options,a=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),n.minWidth>n.width&&(n.width=n.minWidth),e=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),i=Math.max(0,n.minHeight-e),"auto"===n.height?t.support.minHeight?this.element.css({minHeight:i,height:"auto"}):(this.uiDialog.show(),s=this.element.css("height","auto").height(),a||this.uiDialog.hide(),this.element.height(Math.max(s,i))):this.element.height(Math.max(n.height-e,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),t.extend(t.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(t){var e=t.attr("id");return e||(this.uuid+=1,e=this.uuid),"ui-dialog-title-"+e},overlay:function(e){this.$el=t.ui.dialog.overlay.create(e)}}),t.extend(t.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:t.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(t){return t+".dialog-overlay"}).join(" "),create:function(e){0===this.instances.length&&(setTimeout(function(){t.ui.dialog.overlay.instances.length&&t(document).bind(t.ui.dialog.overlay.events,function(e){if(t(e.target).zIndex()<t.ui.dialog.overlay.maxZ)return!1})},1),t(window).bind("resize.dialog-overlay",t.ui.dialog.overlay.resize));var i=this.oldInstances.pop()||t("<div>").addClass("ui-widget-overlay");return t(document).bind("keydown.dialog-overlay",function(s){var n=t.ui.dialog.overlay.instances;0!==n.length&&n[n.length-1]===i&&e.options.closeOnEscape&&!s.isDefaultPrevented()&&s.keyCode&&s.keyCode===t.ui.keyCode.ESCAPE&&(e.close(s),s.preventDefault())}),i.appendTo(document.body).css({width:this.width(),height:this.height()}),t.fn.bgiframe&&i.bgiframe(),this.instances.push(i),i},destroy:function(e){var i=t.inArray(e,this.instances),s=0;-1!==i&&this.oldInstances.push(this.instances.splice(i,1)[0]),0===this.instances.length&&t([document,window]).unbind(".dialog-overlay"),e.height(0).width(0).remove(),t.each(this.instances,function(){s=Math.max(s,this.css("z-index"))}),this.maxZ=s},height:function(){var e;return t.ui.ie?(e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight))<Math.max(document.documentElement.offsetHeight,document.body.offsetHeight)?t(window).height()+"px":e+"px":t(document).height()+"px"},width:function(){var e;return t.ui.ie?(e=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth))<Math.max(document.documentElement.offsetWidth,document.body.offsetWidth)?t(window).width()+"px":e+"px":t(document).width()+"px"},resize:function(){var e=t([]);t.each(t.ui.dialog.overlay.instances,function(){e=e.add(this)}),e.css({width:0,height:0}).css({width:t.ui.dialog.overlay.width(),height:t.ui.dialog.overlay.height()})}}),t.extend(t.ui.dialog.overlay.prototype,{destroy:function(){t.ui.dialog.overlay.destroy(this.$el)}})}(jQuery),function(t,e){var i=!1;t.widget("ui.menu",{version:"1.9.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var s=t(e.target).closest(".ui-menu-item");!i&&s.not(".ui-state-disabled").length&&(i=!0,this.select(e),s.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),i=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=new RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),(s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s).length||(a=String.fromCharCode(e.keyCode),r=new RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),(e=s.add(this.element)).children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-—–\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),n<0?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;this.active?this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(i=t(this)).offset().top-s-n<0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())):this.next(e)},previousPage:function(e){var i,s,n;this.active?this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return(i=t(this)).offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())):this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})}(jQuery),function(t,e){t.widget("ui.progressbar",{version:"1.9.2",options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return void 0===t?this._value():(this._setOption("value",t),this)},_setOption:function(t,e){"value"===t&&(this.options.value=e,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(t,e)},_value:function(){var t=this.options.value;return"number"!=typeof t&&(t=0),Math.min(this.options.max,Math.max(this.min,t))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var t=this.value(),e=this._percentage();this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),this.valueDiv.toggle(t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(e.toFixed(0)+"%"),this.element.attr("aria-valuenow",t)}})}(jQuery),function(t,e){t.widget("ui.slider",t.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a=[];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"+(s.disabled?" ui-slider-disabled ui-disabled":"")),this.range=t([]),s.range&&(!0===s.range&&(s.values||(s.values=[this._valueMin(),this._valueMin()]),s.values.length&&2!==s.values.length&&(s.values=[s.values[0],s.values[0]])),this.range=t("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===s.range||"max"===s.range?" ui-slider-range-"+s.range:""))),i=s.values&&s.values.length||1,e=n.length;e<i;e++)a.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");this.handles=n.add(t(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(t){t.preventDefault()}).mouseenter(function(){s.disabled||t(this).addClass("ui-state-hover")}).mouseleave(function(){t(this).removeClass("ui-state-hover")}).focus(function(){s.disabled?t(this).blur():(t(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),t(this).addClass("ui-state-focus"))}).blur(function(){t(this).removeClass("ui-state-focus")}),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)}),this._on(this.handles,{keydown:function(e){var i,s,n,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(e.target).addClass("ui-state-active"),!1===this._start(e,a)))return}switch(n=this.options.step,i=s=this.options.values&&this.options.values.length?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:s=this._valueMin();break;case t.ui.keyCode.END:s=this._valueMax();break;case t.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/5);break;case t.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/5);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+n);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-n)}this._slide(e,a,s)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}),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-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,h,l=this,c=this.options;return!c.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-l.values(e));n>i&&(n=i,a=t(this),o=e)}),!0===c.range&&this.values(1)===c.min&&(o+=1,a=t(this.handles[o])),!1!==this._start(e,o)&&(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),r=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-r.left-a.width()/2,top:e.pageY-r.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),(s=i/e)>1&&(s=1),s<0&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&!0===this.options.range&&(0===e&&i>s||1===e&&i<s)&&(i=s),i!==this.values(e)&&((n=this.values())[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),!1!==a&&this.values(e,i,!0))):i!==this.value()&&!1!==(a=this._trigger("slide",t,{handle:this.handles[e],value:i}))&&this.value(i)},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;a<s.length;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch(t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"disabled":i?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));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(),s=0;s<n;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);for(i=this.options.values.slice(),s=0;s<i.length;s+=1)i[s]=this._trimAlignValue(i[s]);return i},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,h=this,l=!this._animateOff&&r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=(h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())*100,c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),!0===h.options.range&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?(s-n)/(a-n)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))}})}(jQuery),function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.9.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){this.element[0]===this.document[0].activeElement||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(e)&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active"))return!1!==this._start(e)&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>&#9660;</span></a>"},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return i=t-(e=null!==s.min?s.min:0),t=e+(i=Math.round(i/s.step)*s.step),t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&t<s.min?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,void this.element.val(this._format(i))}"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._spin((t||1)*this.options.step)},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._spin((t||1)*-this.options.step)},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());e(this._value).call(this,t)},widget:function(){return this.uiSpinner}})}(jQuery),function(t,e){function i(){return++a}function s(t){return t.hash.length>1&&t.href.replace(o,"")===location.href.replace(o,"").replace(/\s/g,"%20")}var n,a=0,o=/#.*$/;t.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options,s=i.active,n=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),null===s&&(n&&this.tabs.each(function(e,i){if(t(i).attr("aria-controls")===n)return s=e,!1}),null===s&&(s=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==s&&-1!==s||(s=!!this.tabs.length&&0)),!1!==s&&-1===(s=this.tabs.index(this.tabs.eq(s)))&&(s=!i.collapsible&&0),i.active=s,!i.collapsible&&!1===i.active&&this.anchors.length&&(i.active=0),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=t(),this._refresh(),this.active.length&&this.load(i.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(s);case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(s!==this.options.active&&s);default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){for(var s=this.tabs.length-1;-1!==t.inArray((e>s&&(e=0),e<0&&(e=s),e),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,e){"active"!==t?"disabled"!==t?(this._super(t,e),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._setupDisabled(e):this._activate(e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),!1!==e.active&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(a="#"+(r=e._tabId(l)),(o=e.element.find(a)).length||(o=e._createPanel(r)).insertAfter(e.panels[i-1]||e.tablist),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)!0===e||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s,n=this.element.parent();"fill"===e?(t.support.minHeight||(s=n.css("overflow"),n.css("overflow","hidden")),i=n.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),s&&n.css("overflow",s),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget).closest("li"),a=n[0]===s[0],o=a&&i.collapsible,r=o?t():this._getPanelForTab(n),h=s.length?this._getPanelForTab(s):t(),l={oldTab:s,oldPanel:h,newTab:o?t():n,newPanel:r};e.preventDefault(),n.hasClass("ui-state-disabled")||n.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||!1===this._trigger("beforeActivate",e,l)||(i.active=!o&&this.tabs.index(n),this.active=a?t():n,this.xhr&&this.xhr.abort(),h.length||r.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),r.length&&this.load(this.tabs.index(n),e),this._toggle(e,l))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return!1===e?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;!1!==i&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setupDisabled(i))},disable:function(e){var i=this.options.disabled;if(!0!==i){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setupDisabled(i)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),!1!==t.uiBackCompat&&(t.ui.tabs.prototype._ui=function(t,e){return{tab:t,panel:e,index:this.anchors.index(t)}},t.widget("ui.tabs",t.ui.tabs,{url:function(t,e){this.anchors.eq(t).attr("href",e)}}),t.widget("ui.tabs",t.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var e=this;this._on({tabsbeforeload:function(i,s){t.data(s.tab[0],"cache.tabs")?i.preventDefault():s.jqXHR.success(function(){e.options.cache&&t.data(s.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(e,i,s){var n=this.options.ajaxOptions;return t.extend({},n,{error:function(t,e){try{n.error(t,e,s.tab.closest("li").index(),s.tab[0])}catch(t){}}},this._superApply(arguments))},_setOption:function(t,e){"cache"===t&&!1===e&&this.anchors.removeData("cache.tabs"),this._super(t,e)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(t){this.anchors.eq(t).removeData("cache.tabs"),this._superApply(arguments)}}),t.widget("ui.tabs",t.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),t.widget("ui.tabs",t.ui.tabs,{options:{spinner:"<em>Loading&#8230;</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(t,e){if(t.target===this.element[0]&&this.options.spinner){var i=e.tab.find("span"),s=i.html();i.html(this.options.spinner),e.jqXHR.complete(function(){i.html(s)})}}})}}),t.widget("ui.tabs",t.ui.tabs,{options:{enable:null,disable:null},enable:function(e){var i,s=this.options;(e&&!0===s.disabled||t.isArray(s.disabled)&&-1!==t.inArray(e,s.disabled))&&(i=!0),this._superApply(arguments),i&&this._trigger("enable",null,this._ui(this.anchors[e],this.panels[e]))},disable:function(e){var i,s=this.options;(e&&!1===s.disabled||t.isArray(s.disabled)&&-1===t.inArray(e,s.disabled))&&(i=!0),this._superApply(arguments),i&&this._trigger("disable",null,this._ui(this.anchors[e],this.panels[e]))}}),t.widget("ui.tabs",t.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(e,i,s){void 0===s&&(s=this.anchors.length);var n,a,o=this.options,r=t(o.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,i)),h=e.indexOf("#")?this._tabId(r):e.replace("#","");return r.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),r.attr("aria-controls",h),n=s>=this.tabs.length,(a=this.element.find("#"+h)).length||(a=this._createPanel(h),n?s>0?a.insertAfter(this.panels.eq(-1)):a.appendTo(this.element):a.insertBefore(this.panels[s])),a.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),n?r.appendTo(this.tablist):r.insertBefore(this.tabs[s]),o.disabled=t.map(o.disabled,function(t){return t>=s?++t:t}),this.refresh(),1===this.tabs.length&&!1===o.active&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[s],this.panels[s])),this},remove:function(e){e=this._getIndex(e);var i=this.options,s=this.tabs.eq(e).remove(),n=this._getPanelForTab(s).remove();return s.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(e+(e+1<this.anchors.length?1:-1)),i.disabled=t.map(t.grep(i.disabled,function(t){return t!==e}),function(t){return t>=e?--t:t}),this.refresh(),this._trigger("remove",null,this._ui(s.find("a")[0],n[0])),this}}),t.widget("ui.tabs",t.ui.tabs,{length:function(){return this.anchors.length}}),t.widget("ui.tabs",t.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(e){var s=e.is("li")?e.find("a[href]"):e;return s=s[0],t(s).closest("li").attr("aria-controls")||s.title&&s.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),t.widget("ui.tabs",t.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(e){return t(this.options.panelTemplate).attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),t.widget("ui.tabs",t.ui.tabs,{_create:function(){var t=this.options;null===t.active&&void 0!==t.selected&&(t.active=-1!==t.selected&&t.selected),this._super(),t.selected=t.active,!1===t.selected&&(t.selected=-1)},_setOption:function(t,e){if("selected"!==t)return this._super(t,e);var i=this.options;this._super("active",-1!==e&&e),i.selected=i.active,!1===i.selected&&(i.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,!1===this.options.selected&&(this.options.selected=-1)}}),t.widget("ui.tabs",t.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),!1!==this.options.active&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(t,e,i){var s,n,a=this._superApply(arguments);return!!a&&("beforeActivate"===t?(s=i.newTab.length?i.newTab:i.oldTab,n=i.newPanel.length?i.newPanel:i.oldPanel,a=this._super("select",e,{tab:s.find(".ui-tabs-anchor")[0],panel:n[0],index:s.closest("li").index()})):"activate"===t&&i.newTab.length&&(a=this._super("show",e,{tab:i.newTab.find(".ui-tabs-anchor")[0],panel:i.newPanel[0],index:i.newTab.closest("li").index()})),a)}}),t.widget("ui.tabs",t.ui.tabs,{select:function(t){if(-1===(t=this._getIndex(t))){if(!this.options.collapsible||-1===this.options.selected)return;t=this.options.selected}this.anchors.eq(t).trigger(this.options.event+this.eventNamespace)}}),n=0,t.widget("ui.tabs",t.ui.tabs,{options:{cookie:null},_create:function(){var t,e=this.options;null==e.active&&e.cookie&&(-1===(t=parseInt(this._cookie(),10))&&(t=!1),e.active=t),this._super()},_cookie:function(e){var i=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++n)];return arguments.length&&(i.push(!1===e?-1:e),i.push(this.options.cookie)),t.cookie.apply(null,i)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}}),t.widget("ui.tabs",t.ui.tabs,{_trigger:function(e,i,s){var n=t.extend({},s);return"load"===e&&(n.panel=n.panel[0],n.tab=n.tab.find(".ui-tabs-anchor")[0]),this._super(e,i,n)}}),t.widget("ui.tabs",t.ui.tabs,{options:{fx:null},_getFx:function(){var e,i,s=this.options.fx;return s&&(t.isArray(s)?(e=s[0],i=s[1]):e=i=s),s?{show:i,hide:e}:null},_toggle:function(t,e){function i(){n.running=!1,n._trigger("activate",t,e)}function s(){e.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&r.show?a.animate(r.show,r.show.duration,function(){i()}):(a.show(),i())}var n=this,a=e.newPanel,o=e.oldPanel,r=this._getFx();if(!r)return this._super(t,e);n.running=!0,o.length&&r.hide?o.animate(r.hide,r.hide.duration,function(){e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s()}):(e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),o.hide(),s())}}))}(jQuery),function(t){var e=0;t.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return t(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;if("disabled"===e)return this[i?"_disable":"_enable"](),void(this.options[e]=i);this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)})},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&((e=t.Event("blur")).target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,a=e?e.type:null;if("string"==typeof s)return this._open(e,t,s);(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=a),this._open(e,t,i)})}))&&this._open(e,t,i)},_open:function(e,i,s){function n(t){u.of=t,a.is(":hidden")||a.position(u)}var a,o,r,h,l,c,u=t.extend({},this.options.position);s&&((a=this._find(i)).length?a.find(".ui-tooltip-content").html(s):(i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),h=i,l=a.attr("id"),(c=(h.attr("aria-describedby")||"").split(/\s+/)).push(l),h.data("ui-tooltip-id",l).attr("aria-describedby",t.trim(c.join(" "))),a.find(".ui-tooltip-content").html(s),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(r=setInterval(function(){a.is(":visible")&&(n(u.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a}),o={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}},remove:function(){this._removeTooltip(a)}},e&&"mouseover"!==e.type||(o.mouseleave="close"),e&&"focusin"!==e.type||(o.focusout="close"),this._on(!0,i,o)))},close:function(e){var i,s,n,a,o=this,r=t(e?e.currentTarget:this.element),h=this._find(r);this.closing||(r.data("ui-tooltip-title")&&r.attr("title",r.data("ui-tooltip-title")),s=(i=r).data("ui-tooltip-id"),n=(i.attr("aria-describedby")||"").split(/\s+/),-1!==(a=t.inArray(s,n))&&n.splice(a,1),i.removeData("ui-tooltip-id"),(n=t.trim(n.join(" ")))?i.attr("aria-describedby",n):i.removeAttr("aria-describedby"),h.stop(!0),this._hide(h,this.options.hide,function(){o._removeTooltip(t(this))}),r.removeData("ui-tooltip-open"),this._off(r,"mouseleave focusout keyup"),r[0]!==this.element[0]&&this._off(r,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete o.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:h}),this.closing=!1)},_tooltip:function(i){var s="ui-tooltip-"+e++,n=t("<div>").attr({id:s,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),t.fn.bgiframe&&n.bgiframe(),this.tooltips[s]=i,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})}(jQuery),jQuery.effects||function(t,e){var i,s=!1!==t.uiBackCompat;t.effects={effect:{}},function(e,i){function s(t,e,i){var s=d[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:s.max<t?s.max:t)}function n(t){var i=c(),s=i._rgba=[];return t=t.toLowerCase(),g(l,function(e,n){var a,o=n.re.exec(t),r=o&&n.parse(o),h=n.space||"rgba";if(r)return a=i[h](r),i[u[h].cache]=a[u[h].cache],s=i._rgba=a._rgba,!1}),s.length?("0,0,0,0"===s.join()&&e.extend(s,o.transparent),i):o[t]}function a(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}var o,r="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),h=/^([\-+])=\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(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],c=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={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"}}}},d={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},p=c.support={},f=e("<p>")[0],g=e.each;f.style.cssText="background-color:rgba(1,1,1,.5)",p.rgba=f.style.backgroundColor.indexOf("rgba")>-1,g(u,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),c.fn=e.extend(c.prototype,{parse:function(i,a,r,h){if(void 0===i)return this._rgba=[null,null,null,null],this;(i.jquery||i.nodeType)&&(i=e(i).css(a),a=void 0);var l=this,d=e.type(i),p=this._rgba=[];return void 0!==a&&(i=[i,a,r,h],d="array"),"string"===d?this.parse(n(i)||o._default):"array"===d?(g(u.rgba.props,function(t,e){p[e.idx]=s(i[e.idx],e)}),this):"object"===d?(g(u,i instanceof c?function(t,e){i[e.cache]&&(l[e.cache]=i[e.cache].slice())}:function(e,n){var a=n.cache;g(n.props,function(t,e){if(!l[a]&&n.to){if("alpha"===t||null==i[t])return;l[a]=n.to(l._rgba)}l[a][e.idx]=s(i[t],e,!0)}),l[a]&&t.inArray(null,l[a].slice(0,3))<0&&(l[a][3]=1,n.from&&(l._rgba=n.from(l[a])))}),this):void 0},is:function(t){var e=c(t),i=!0,s=this;return g(u,function(t,n){var a,o=e[n.cache];return o&&(a=s[n.cache]||n.to&&n.to(s._rgba)||[],g(n.props,function(t,e){if(null!=o[e.idx])return i=o[e.idx]===a[e.idx]})),i}),i},_space:function(){var t=[],e=this;return g(u,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var i=c(t),n=i._space(),a=u[n],o=0===this.alpha()?c("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return i=i[a.cache],g(a.props,function(t,n){var a=n.idx,o=r[a],l=i[a],c=d[n.type]||{};null!==l&&(null===o?h[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),h[a]=s((l-o)*e+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=c(t)._rgba;return c(e.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&e<3&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),c.fn.parse.prototype=c.fn,u.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===u||1===u?u:u<=.5?l/c:l/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},u.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],n=t[3],o=s<=.5?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*a(r,o,e+1/3)),Math.round(255*a(r,o,e)),Math.round(255*a(r,o,e-1/3)),n]},g(u,function(t,i){var n=i.props,a=i.cache,o=i.to,r=i.from;c.fn[t]=function(t){if(o&&!this[a]&&(this[a]=o(this._rgba)),void 0===t)return this[a].slice();var i,h=e.type(t),l="array"===h||"object"===h?t:arguments,u=this[a].slice();return g(n,function(t,e){var i=l["object"===h?t:e.idx];null==i&&(i=u[e.idx]),u[e.idx]=s(i,e)}),r?((i=c(r(u)))[a]=u,i):c(u)},g(n,function(i,s){c.fn[i]||(c.fn[i]=function(n){var a,o=e.type(n),r="alpha"===i?this._hsla?"hsla":"rgba":t,l=this[r](),c=l[s.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=e.type(n)),null==n&&s.empty?this:("string"===o&&(a=h.exec(n))&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1)),l[s.idx]=n,this[r](l)))})})}),g(r,function(t,i){e.cssHooks[i]={set:function(t,s){var a,o,r="";if("string"!==e.type(s)||(a=n(s))){if(s=c(a||s),!p.rgba&&1!==s._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(t){}s=s.blend(r&&"transparent"!==r?r:"_default")}s=s.toRgbaString()}try{t.style[i]=s}catch(t){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=c(t.elem,i),t.end=c(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}}),e.cssHooks.borderColor={expand:function(t){var e={};return g(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},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 e(){var e,i,s=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[t.camelCase(e)]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}var i=["add","remove","toggle"],s={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.effects.animateClass=function(n,a,o,r){var h=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){return{el:t(this),start:e.call(this)}}),(a=function(){t.each(i,function(t,e){n[e]&&o[e+"Class"](n[e])})})(),l=l.map(function(){return this.end=e.call(this.el[0]),this.diff=function(e,i){var n,a,o={};for(n in i)a=i[n],e[n]!==a&&(s[n]||!t.fx.step[n]&&isNaN(parseFloat(a))||(o[n]=a));return o}(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=jQuery.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(o[0])})})},t.fn.extend({_addClass:t.fn.addClass,addClass:function(e,i,s,n){return i?t.effects.animateClass.call(this,{add:e},i,s,n):this._addClass(e)},_removeClass:t.fn.removeClass,removeClass:function(e,i,s,n){return i?t.effects.animateClass.call(this,{remove:e},i,s,n):void 0!==e?this._removeClass(e):this._removeClass()},_toggleClass:t.fn.toggleClass,toggleClass:function(e,i,s,n,a){return"boolean"==typeof i||void 0===i?s?t.effects.animateClass.call(this,i?{add:e}:{remove:e},s,n,a):this._toggleClass(e,i):t.effects.animateClass.call(this,{toggle:e},i,s,n)},switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||"string"==typeof e&&!t.effects.effect[e]&&(!s||!t.effects[e])}t.extend(t.effects,{version:"1.9.2",save:function(t,e){for(var i=0;i<e.length;i++)null!==e[i]&&t.data("ui-effects-"+e[i],t[0].style[e[i]])},restore:function(t,e){var i,s;for(s=0;s<e.length;s++)null!==e[s]&&(void 0===(i=t.data("ui-effects-"+e[s]))&&(i=""),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),float:e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(t){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){t.isFunction(a)&&a.call(s[0]),t.isFunction(e)&&e()}var s=t(this),a=n.complete,o=n.mode;(s.is(":hidden")?"hide"===o:"show"===o)?i():r.call(s[0],n,i)}var n=e.apply(this,arguments),a=n.mode,o=n.queue,r=t.effects.effect[n.effect],h=!r&&s&&t.effects[n.effect];return t.fx.off||!r&&!h?a?this[a](n.duration,n.complete):this.each(function(){n.complete&&n.complete.call(this)}):r?!1===o?this.each(i):this.queue(o||"fx",i):h.call(this,{options:n,duration:n.duration,callback:n.complete,mode:n.mode})},_show:t.fn.show,show:function(t){if(i(t))return this._show.apply(this,arguments);var s=e.apply(this,arguments);return s.mode="show",this.effect.call(this,s)},_hide:t.fn.hide,hide:function(t){if(i(t))return this._hide.apply(this,arguments);var s=e.apply(this,arguments);return s.mode="hide",this.effect.call(this,s)},__toggle:t.fn.toggle,toggle:function(s){if(i(s)||"boolean"==typeof s||t.isFunction(s))return this.__toggle.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),i={},t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,e){i[e]=function(e){return Math.pow(e,t+2)}}),t.extend(i,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(i,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return t<.5?i(2*t)/2:1-i(-2*t+2)/2}})}(jQuery),function(t,e){var i=/up|down|vertical/,s=/up|left|vertical|horizontal/;t.effects.effect.blind=function(e,n){var a,o,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,e.mode||"hide"),u=e.direction||"up",d=i.test(u),p=d?"height":"width",f=d?"top":"left",g=s.test(u),m={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),o=(a=t.effects.createWrapper(h).css({overflow:"hidden"}))[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:e.duration,easing:e.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}}(jQuery),function(t,e){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&((a={opacity:1})[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),l&&(d/=Math.pow(2,p-1)),(a={})[v]=0,s=0;s<p;s++)(n={})[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=l?2*d:d/2;l&&((n={opacity:0})[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){l&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}}(jQuery),function(t,e){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h="show"===t.effects.setMode(o,e.mode||"hide"),l="vertical"===(e.direction||"vertical"),c=l?"height":"width",u=l?"top":"left",d={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),a=(n="IMG"===o[0].tagName?s:o)[c](),h&&(n.css(c,0),n.css(u,a/2)),d[c]=h?a:0,d[u]=h?0:a/2,n.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}}(jQuery),function(t,e){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t,e){t.effects.effect.explode=function(e,i){function s(){v.push(this),v.length===c*u&&function(){d.css({visibility:"visible"}),t(v).remove(),p||d.hide();i()}()}var n,a,o,r,h,l,c=e.pieces?Math.round(Math.sqrt(e.pieces)):3,u=c,d=t(this),p="show"===t.effects.setMode(d,e.mode||"hide"),f=d.show().css("visibility","hidden").offset(),g=Math.ceil(d.outerWidth()/u),m=Math.ceil(d.outerHeight()/c),v=[];for(n=0;n<c;n++)for(r=f.top+n*m,l=n-(c-1)/2,a=0;a<u;a++)o=f.left+a*g,h=a-(u-1)/2,d.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*g,top:-n*m}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g,height:m,left:o+(p?h*g:0),top:r+(p?l*m:0),opacity:p?0:1}).animate({left:o+(p?0:h*g),top:r+(p?0:l*m),opacity:p?1:0},e.duration||500,e.easing,s)}}(jQuery),function(t,e){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}}(jQuery),function(t,e){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){l&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}}(jQuery),function(t,e){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}}(jQuery),function(t,e){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for(!o&&n.is(":visible")||(n.css("opacity",0).show(),u=1),s=1;s<l;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}}(jQuery),function(t,e){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c="horizontal"!==r?o/100:1,u="vertical"!==r?o/100:1;n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c,width:l.width*u,outerHeight:l.outerHeight*c,outerWidth:l.outerWidth*u},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],u=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],d=t.effects.setMode(o,e.mode||"effect"),p=e.restore||"effect"!==d,f=e.scale||"both",g=e.origin||["middle","center"],m=o.css("position"),v=p?r:["position","top","bottom","left","right","overflow","opacity"],_={height:0,width:0,outerHeight:0,outerWidth:0};"show"===d&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===d?(o.from=e.to||_,o.to=e.from||s):(o.from=e.from||("show"===d?_:s),o.to=e.to||("hide"===d?_:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},"box"!==f&&"both"!==f||(a.from.y!==a.to.y&&(v=v.concat(c),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),a.from.x!==a.to.x&&(v=v.concat(u),o.from=t.effects.setTransition(o,u,a.from.x,o.from),o.to=t.effects.setTransition(o,u,a.to.x,o.to))),"content"!==f&&"both"!==f||a.from.y!==a.to.y&&(v=v.concat(l).concat(h),o.from=t.effects.setTransition(o,l,a.from.y,o.from),o.to=t.effects.setTransition(o,l,a.to.y,o.to)),t.effects.save(o,v),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=t.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),"content"!==f&&"both"!==f||(c=c.concat(["marginTop","marginBottom"]).concat(l),u=u.concat(["marginLeft","marginRight"]),h=r.concat(c).concat(u),o.find("*[width]").each(function(){var i=t(this),s=i.height(),n=i.width(),o=i.outerHeight(),r=i.outerWidth();p&&t.effects.save(i,h),i.from={height:s*a.from.y,width:n*a.from.x,outerHeight:o*a.from.y,outerWidth:r*a.from.x},i.to={height:s*a.to.y,width:n*a.to.x,outerHeight:s*a.to.y,outerWidth:n*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,c,a.from.y,i.from),i.to=t.effects.setTransition(i,c,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,u,a.from.x,i.from),i.to=t.effects.setTransition(i,u,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){p&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===d&&o.hide(),t.effects.restore(o,v),p||("static"===m?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}}(jQuery),function(t,e){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,g[d]=(p?"+=":"-=")+2*h,m[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;s<l;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}}(jQuery),function(t,e){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t,e){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}}(jQuery);
;Dependency._js['lib/jquery/jquery-ui']=true;

;
!function(n,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):n.printStackTrace=e()}(this,function(){function n(e){var t=(e=e||{guess:!0}).e||null,r=!!e.guess,o=e.mode||null,c=new n.implementation,s=c.run(t,o);return r?c.guessAnonymousFunctions(s):s}return n.implementation=function(){},n.implementation.prototype={run:function(n,e){return n=n||this.createException(),"other"===(e=e||this.mode(n))?this.other(arguments.callee):this[e](n)},createException:function(){try{this.undef()}catch(n){return n}},mode:function(n){return"undefined"!=typeof window&&window.navigator.userAgent.indexOf("PhantomJS")>-1?"phantomjs":n.arguments&&n.stack?"chrome":n.stack&&n.sourceURL?"safari":n.stack&&n.number?"ie":n.stack&&n.fileName?"firefox":n.message&&n["opera#sourceloc"]?n.stacktrace?n.message.indexOf("\n")>-1&&n.message.split("\n").length>n.stacktrace.split("\n").length?"opera9":"opera10a":"opera9":n.message&&n.stack&&n.stacktrace?n.stacktrace.indexOf("called from line")<0?"opera10b":"opera11":n.stack&&!n.fileName?"chrome":"other"},instrumentFunction:function(e,t,r){var o=(e=e||window)[t];e[t]=function(){return r.call(this,n().slice(4)),e[t]._instrumented.apply(this,arguments)},e[t]._instrumented=o},deinstrumentFunction:function(n,e){n[e].constructor===Function&&n[e]._instrumented&&n[e]._instrumented.constructor===Function&&(n[e]=n[e]._instrumented)},chrome:function(n){return(n.stack+"\n").replace(/^[\s\S]+?\s+at\s+/," at ").replace(/^\s+(at eval )?at\s+/gm,"").replace(/^([^\(]+?)([\n$])/gm,"{anonymous}() ($1)$2").replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm,"{anonymous}() ($1)").replace(/^(.+) \((.+)\)$/gm,"$1@$2").split("\n").slice(0,-1)},safari:function(n){return n.stack.replace(/\[native code\]\n/m,"").replace(/^(?=\w+Error\:).*$\n/m,"").replace(/^@/gm,"{anonymous}()@").split("\n")},ie:function(n){return n.stack.replace(/^\s*at\s+(.*)$/gm,"$1").replace(/^Anonymous function\s+/gm,"{anonymous}() ").replace(/^(.+)\s+\((.+)\)$/gm,"$1@$2").split("\n").slice(1)},firefox:function(n){return n.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^(?:\((\S*)\))?@/gm,"{anonymous}($1)@").split("\n")},opera11:function(n){for(var e=/^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/,t=n.stacktrace.split("\n"),r=[],o=0,c=t.length;o<c;o+=2){var s=e.exec(t[o]);if(s){var i=s[4]+":"+s[1]+":"+s[2],a=s[3]||"global code";a=a.replace(/<anonymous function: (\S+)>/,"$1").replace(/<anonymous function>/,"{anonymous}"),r.push(a+"@"+i+" -- "+t[o+1].replace(/^\s+/,""))}}return r},opera10b:function(n){for(var e=/^(.*)@(.+):(\d+)$/,t=n.stacktrace.split("\n"),r=[],o=0,c=t.length;o<c;o++){var s=e.exec(t[o]);if(s){var i=s[1]?s[1]+"()":"global code";r.push(i+"@"+s[2]+":"+s[3])}}return r},opera10a:function(n){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,t=n.stacktrace.split("\n"),r=[],o=0,c=t.length;o<c;o+=2){var s=e.exec(t[o]);if(s){var i=s[3]||"{anonymous}";r.push(i+"()@"+s[2]+":"+s[1]+" -- "+t[o+1].replace(/^\s+/,""))}}return r},opera9:function(n){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,t=n.message.split("\n"),r=[],o=2,c=t.length;o<c;o+=2){var s=e.exec(t[o]);s&&r.push("{anonymous}()@"+s[2]+":"+s[1]+" -- "+t[o+1].replace(/^\s+/,""))}return r},phantomjs:function(n){for(var e=/(\S+) \((\S+)\)/i,t=n.stack.split("\n"),r=[],o=1,c=t.length;o<c;o++){t[o]=t[o].replace(/^\s+at\s+/gm,"");var s=e.exec(t[o]);s?r.push(s[1]+"()@"+s[2]):r.push("{anonymous}()@"+t[o])}return r},other:function(n){for(var e,t,r=/function(?:\s+([\w$]+))?\s*\(/,o=[],c=Array.prototype.slice;n&&o.length<10;){e=r.test(n.toString())&&RegExp.$1||"{anonymous}";try{t=c.call(n.arguments||[])}catch(n){t=["Cannot access arguments: "+n]}o[o.length]=e+"("+this.stringifyArguments(t)+")";try{n=n.caller}catch(n){o[o.length]="Cannot access caller: "+n;break}}return o},stringifyArguments:function(n){for(var e=[],t=Array.prototype.slice,r=0;r<n.length;++r){var o=n[r];void 0===o?e[r]="undefined":null===o?e[r]="null":o.constructor&&(o.constructor===Array?o.length<3?e[r]="["+this.stringifyArguments(o)+"]":e[r]="["+this.stringifyArguments(t.call(o,0,1))+"..."+this.stringifyArguments(t.call(o,-1))+"]":o.constructor===Object?e[r]="#object":o.constructor===Function?e[r]="#function":o.constructor===String?e[r]='"'+o+'"':o.constructor===Number?e[r]=o:e[r]="?")}return e.join(",")},sourceCache:{},ajax:function(n){var e=this.createXMLHTTPObject();if(e)try{return e.open("GET",n,!1),e.send(null),e.responseText}catch(n){}return""},createXMLHTTPObject:function(){for(var n,e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=0;t<e.length;t++)try{return n=e[t](),this.createXMLHTTPObject=e[t],n}catch(n){}},isSameDomain:function(n){return"undefined"!=typeof location&&-1!==n.indexOf(location.hostname)},getSource:function(n){return n in this.sourceCache||(this.sourceCache[n]=this.ajax(n).split("\n")),this.sourceCache[n]},guessAnonymousFunctions:function(n){for(var e=0;e<n.length;++e){var t=n[e],r=/\{anonymous\}\(.*\)@(.*)/.exec(t);if(r){var o=/^(.*?)(?::(\d+))(?::(\d+))?(?: -- .+)?$/.exec(r[1]);if(o){var c=o[1],s=o[2],i=o[3]||0;if(c&&this.isSameDomain(c)&&s){var a=this.guessAnonymousFunction(c,s,i);n[e]=t.replace("{anonymous}",a)}}}}return n},guessAnonymousFunction:function(n,e,t){var r;try{r=this.findFunctionName(this.getSource(n),e)}catch(e){r="getSource failed with url: "+n+", exception: "+e.toString()}return r},findFunctionName:function(n,e){for(var t,r,o,c=/function\s+([^(]*?)\s*\(([^)]*)\)/,s=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,i=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,a="",u=Math.min(e,20),l=0;l<u;++l)if((o=(t=n[e-l-1]).indexOf("//"))>=0&&(t=t.substr(0,o)),t){if(a=t+a,(r=s.exec(a))&&r[1])return r[1];if((r=c.exec(a))&&r[1])return r[1];if((r=i.exec(a))&&r[1])return r[1]}return"(?)"}},n});
;Dependency._js['lib/stacktrace/stacktrace']=true;

;
"undefined"!=typeof Dependency&&"function"==typeof Dependency.addJS&&Dependency.addJS("lib/stacktrace/stacktrace"),function(){var e=window.onerror;window.onerror=function(r,t,n,a,o){window.printStackTrace=window.printStackTrace||function(e){return o.stack?o.stack.split("\n"):[]};var i=window.printStackTrace({e:o});if((window.XPLAN.debugmode||window.XPLAN.errormode)&&function(e){var r=jQuery.map(e,function(e){return jQuery("<div>").text(e)[0].outerHTML}).join("");this.$warning_banner=jQuery("#jquery-error-banner"),this.$warning_banner.length?this.$warning_banner.find("ul").append("<li>"+r+"</li>"):jQuery(function(e){return"<div id='jquery-error-banner'><div class='container'><div class='col col-8 float-left'><p class='title'>&gt;_&lt;</p><p class='sub-title'>JavaScript errors were detected when rendering this page.</p><p class='comment'>You are seeing this because there are errors either in relevant javascript code, or in backend code that supports and renders the current page.</p><p class='comment'>Please take time to read through the traceback and report errors accordingly.</p><p class='sub-title'>Tracebacks:</p><ul class='traceback'><li>"+e+"</li></ul></div><div class='col col-2 float-right'><div class='sub-title'>Report to JIRA</div><a class='report-btn' target='_blank' href='https://jira.iress.com/browse/XPLAN-51528'>Create a Client Focus Issue</a><a class='report-btn' target='_blank' href='https://jira.iress.com/browse/XPLAN-51529'>Create a Portfolio Issue</a><a class='report-btn' target='_blank' href='https://jira.iress.com/browse/XPLAN-51530'>Create an eApps Issue</a><a class='report-btn' target='_blank' href='https://jira.iress.com/browse/XPLAN-51533'>I am not sure</a></div></div></div>"}(r)).prependTo(document.body)}(i),window.XMLRPC&&XMLRPC.call("response.report_jserror",[r,t,n,a,navigator.userAgent,i.join("\n"),function(){var e=[],r=window;try{for(;r.parent.document&&r.parent!=r;)e.unshift(r.location.href),r=r.parent;return e.unshift(r.location.href),e}catch(e){return r.location.href}}()]),e&&e(r,t,n),window.console&&window.console.log){if(window.console.log("reporting unhandled error",r,t,n),window.XPLAN.debugmode)throw o;return!0}return!1}}();
;Dependency._js['error_reporter']=true;

;
jQuery(window).on("load",function(o){if(window.flightcontrol_Load_Start_Time){var t=(new Date).getTime()-window.flightcontrol_Load_Start_Time.getTime();window.setTimeout(function(){window.XMLRPC&&XMLRPC.call("response.report_loadtime",[t,window.location.pathname],function(){})},20)}});
;Dependency._js['loadtime_tracker']=true;

;
(function(){function n(n,r,t){for(var e=(t||0)-1,u=n?n.length:0;++e<u;)if(n[e]===r)return e;return-1}function r(n,r){for(var t=n.criteria,e=r.criteria,u=-1,o=t.length;++u<o;){var i=t[u],f=e[u];if(i!==f){if(i>f||"undefined"==typeof i)return 1;if(i<f||"undefined"==typeof f)return-1}}return n.index-r.index}function t(n){return"\\"+yn[n]}function e(n,r,t){r||(r=0),"undefined"==typeof t&&(t=n?n.length:0);for(var e=-1,u=t-r||0,o=Array(u<0?0:u);++e<u;)o[e]=n[r+e];return o}function u(n){return n instanceof u?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n}function i(n){var r=n[0],t=n[2],u=n[4];return function n(){if(t){var o=e(t);Nn.apply(o,arguments)}if(this instanceof n){var i=f(r.prototype),a=r.apply(i,o||arguments);return S(a)?a:i}return r.apply(u,o||arguments)}}function f(n,r){return S(n)?kn(n):{}}function a(n,r,t){if("function"!=typeof n)return X;if("undefined"==typeof r||!("prototype"in n))return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return K(n,r)}function l(n){var r=n[0],t=n[1],u=n[2],o=n[3],i=n[4],a=n[5],c=1&t,p=2&t,s=4&t,v=8&t,h=r;return function n(){var y=c?i:this;if(u){var g=e(u);Nn.apply(g,arguments)}if((o||s)&&(g||(g=e(arguments)),o&&Nn.apply(g,o),s&&g.length<a))return t|=16,l([r,v?t:-4&t,g,null,i,a]);if(g||(g=arguments),p&&(r=y[h]),this instanceof n){y=f(r.prototype);var _=r.apply(y,g);return S(_)?_:y}return r.apply(y,g)}}function c(n,r){for(var t=-1,e=_(),u=n?n.length:0,o=[];++t<u;){var i=n[t];e(r,i)<0&&o.push(i)}return o}function p(n,r,t,e){for(var u=(e||0)-1,o=n?n.length:0,i=[];++u<o;){var f=n[u];if(f&&"object"==typeof f&&"number"==typeof f.length&&(Cn(f)||b(f))){r||(f=p(f,r,t));var a=-1,l=f.length,c=i.length;for(i.length+=l;++a<l;)i[c++]=f[a]}else t||i.push(f)}return i}function s(n,r){return n+Sn($n()*(r-n+1))}function v(n,r,t){for(var e=-1,u=_(),o=n?n.length:0,i=[],f=t?[]:i;++e<o;){var a=n[e],l=t?t(a,e,n):a;(r?!e||f[f.length-1]!==l:u(f,l)<0)&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=Q(t,e,3);var o=-1,i=r?r.length:0;if("number"==typeof i)for(;++o<i;){var f=r[o];n(u,f,t(f,o,r),r)}else Kn(r,function(r,e,o){n(u,r,t(r,e,o),o)});return u}}function y(n,r,t,e,u,o){var f=16&r,a=32&r;if(!(2&r)&&!A(n))throw new TypeError;return f&&!t.length&&(r&=-17,f=t=!1),a&&!e.length&&(r&=-33,a=e=!1),(1==r||17===r?i:l)([n,r,t,e,u,o])}function g(n){return Un[n]}function _(){var r=(r=u.indexOf)===V?n:r;return r}function d(n){return"function"==typeof n&&En.test(n)}function m(n){return Vn[n]}function b(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Tn.call(n)==on||!1}function w(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n}function j(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function x(n){var r=[];return Jn(n,function(n,t){A(n)&&r.push(t)}),r.sort()}function T(n){for(var r=-1,t=Pn(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function E(n){if(!n)return!0;if(Cn(n)||N(n))return!n.length;for(var r in n)if(On.call(n,r))return!1;return!0}function A(n){return"function"==typeof n}function S(n){return!(!n||!hn[typeof n])}function O(n){return"number"==typeof n||n&&"object"==typeof n&&Tn.call(n)==cn||!1}function N(n){return"string"==typeof n||n&&"object"==typeof n&&Tn.call(n)==vn||!1}function R(n){for(var r=-1,t=Pn(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function k(n,r){var t=_(),e=n?n.length:0,u=!1;return e&&"number"==typeof e?u=t(n,r)>-1:Kn(n,function(n){return(u=n===r)&&rn}),u}function B(n,r,t){var e=!0;r=Q(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o&&(e=!!r(n[u],u,n)););else Kn(n,function(n,t,u){return!(e=!!r(n,t,u))&&rn});return e}function F(n,r,t){var e=[];r=Q(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o;){var i=n[u];r(i,u,n)&&e.push(i)}else Kn(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function q(n,r,t){r=Q(r,t,3);var e,u=-1,o=n?n.length:0;if("number"!=typeof o)return Kn(n,function(n,t,u){if(r(n,t,u))return e=n,rn}),e;for(;++u<o;){var i=n[u];if(r(i,u,n))return i}}function D(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&"undefined"==typeof t?r:a(r,t,3),"number"==typeof u)for(;++e<u&&r(n[e],e,n)!==rn;);else Kn(n,r)}function I(n,r,t){var e=-1,u=n?n.length:0;if(r=Q(r,t,3),"number"==typeof u)for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Kn(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function M(n,r,t){var e=-1/0,u=e;"function"!=typeof r&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&"number"==typeof i)for(;++o<i;){var f=n[o];f>u&&(u=f)}else r=Q(r,t,3),D(n,function(n,t,o){var i=r(n,t,o);i>e&&(e=i,u=n)});return u}function $(n,r,t,e){if(!n)return t;var u=arguments.length<3;r=Q(r,e,4);var o=-1,i=n.length;if("number"==typeof i)for(u&&(t=n[++o]);++o<i;)t=r(t,n[o],o,n);else Kn(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)});return t}function W(n,r,t,e){var u=arguments.length<3;return r=Q(r,e,4),function(n,r){var t=n?n.length:0;if("number"==typeof t)for(;t--&&!1!==r(n[t],t,n););else{var e=Pn(n);t=e.length,Kn(n,function(n,u,o){return u=e?e[--t]:--t,!1===r(o[u],u,o)&&rn})}}(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)}),t}function z(n){var r=-1,t=n?n.length:0,e=Array("number"==typeof t?t:0);return D(n,function(n){var t=s(0,++r);e[r]=e[t],e[t]=n}),e}function C(n,r,t){var e;r=Q(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o&&!(e=r(n[u],u,n)););else Kn(n,function(n,t,u){return(e=r(n,t,u))&&rn});return!!e}function P(n,r,t){return t&&E(r)?Z:(t?q:F)(n,r)}function U(n,r,t){var u=0,o=n?n.length:0;if("number"!=typeof r&&null!=r){var i=-1;for(r=Q(r,t,3);++i<o&&r(n[i],i,n);)u++}else if(null==(u=r)||t)return n?n[0]:Z;return e(n,0,Mn(In(0,u),o))}function V(r,t,e){if("number"==typeof e){var u=r?r.length:0;e=e<0?In(0,u+e):e||0}else if(e){var o=H(r,t);return r[o]===t?o:-1}return n(r,t,e)}function G(n,r,t){if("number"!=typeof r&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=Q(r,t,3);++o<i&&r(n[o],o,n);)u++}else u=null==r||t?1:In(0,r);return e(n,u)}function H(n,r,t,e){var u=0,o=n?n.length:u;for(r=(t=t?Q(t,e,1):X)(r);u<o;){var i=u+o>>>1;t(n[i])<r?u=i+1:o=i}return u}function J(n,r,t,e){return"boolean"!=typeof r&&null!=r&&(e=t,t="function"!=typeof r&&e&&e[r]===n?null:r,r=!1),null!=t&&(t=Q(t,e,3)),v(n,r,t)}function K(n,r){return arguments.length>2?y(n,17,e(arguments,2),null,r):y(n,1,null,null,r)}function L(n,r,t){var e,u,o,i,f,a,l,c=0,p=!1,s=!0;if(!A(n))throw new TypeError;if(r=In(0,r)||0,!0===t){var v=!0;s=!1}else S(t)&&(v=t.leading,p="maxWait"in t&&(In(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);var h=function(){var t=r-(Zn()-i);if(t<=0){u&&clearTimeout(u);var p=l;u=a=l=Z,p&&(c=Zn(),o=n.apply(f,e),a||u||(e=f=null))}else a=setTimeout(h,t)},y=function(){a&&clearTimeout(a),u=a=l=Z,(s||p!==r)&&(c=Zn(),o=n.apply(f,e),a||u||(e=f=null))};return function(){if(e=arguments,i=Zn(),f=this,l=s&&(a||!v),!1===p)var t=v&&!a;else{u||v||(c=i);var g=p-(i-c),_=g<=0;_?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(y,g))}return _&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(_=!0,o=n.apply(f,e)),!_||a||u||(e=f=null),o}}function Q(n,r,t){var e,u=typeof n;if(null==n||"function"==u)return a(n,r,t);if("object"!=u)return e=n,function(n){return n[e]};var o=Pn(n);return function(r){for(var t=o.length,e=!1;t--&&(e=r[o[t]]===n[o[t]]););return e}}function X(n){return n}function Y(n){D(x(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];Nn.apply(n,arguments);var r=t.apply(u,n);return this.__chain__?new o(r,!0):r}})}var Z,nn=0,rn={},tn=+new Date+"",en=/($^)/,un=/['\n\r\t\u2028\u2029\\]/g,on="[object Arguments]",fn="[object Array]",an="[object Boolean]",ln="[object Date]",cn="[object Number]",pn="[object Object]",sn="[object RegExp]",vn="[object String]",hn={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1},yn={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},gn=hn[typeof window]&&window||this,_n=hn[typeof exports]&&exports&&!exports.nodeType&&exports,dn=hn[typeof module]&&module&&!module.nodeType&&module,mn=dn&&dn.exports===_n&&_n,bn=hn[typeof global]&&global;!bn||bn.global!==bn&&bn.window!==bn||(gn=bn);var wn=[],jn=Object.prototype,xn=gn._,Tn=jn.toString,En=RegExp("^"+String(Tn).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),An=Math.ceil,Sn=Math.floor,On=jn.hasOwnProperty,Nn=wn.push,Rn=jn.propertyIsEnumerable,kn=d(kn=Object.create)&&kn,Bn=d(Bn=Array.isArray)&&Bn,Fn=gn.isFinite,qn=gn.isNaN,Dn=d(Dn=Object.keys)&&Dn,In=Math.max,Mn=Math.min,$n=Math.random;o.prototype=u.prototype;var Wn,zn={};Wn={0:1,length:1},zn.spliceObjects=(wn.splice.call(Wn,0,1),!Wn[0]),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},kn||(f=function(){function n(){}return function(r){if(S(r)){n.prototype=r;var t=new n;n.prototype=null}return t||gn.Object()}}()),b(arguments)||(b=function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&On.call(n,"callee")&&!Rn.call(n,"callee")||!1});var Cn=Bn||function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Tn.call(n)==fn||!1},Pn=Dn?function(n){return S(n)?Dn(n):[]}:function(n){var r,t=n,e=[];if(!t)return e;if(!hn[typeof n])return e;for(r in t)On.call(t,r)&&e.push(r);return e},Un={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},Vn=T(Un),Gn=RegExp("("+Pn(Vn).join("|")+")","g"),Hn=RegExp("["+Pn(Un).join("")+"]","g"),Jn=function(n,r){var t,e=n,u=e;if(!e)return u;if(!hn[typeof e])return u;for(t in e)if(r(e[t],t,n)===rn)return u;return u},Kn=function(n,r){var t,e=n,u=e;if(!e)return u;if(!hn[typeof e])return u;for(t in e)if(On.call(e,t)&&r(e[t],t,n)===rn)return u;return u};A(/x/)&&(A=function(n){return"function"==typeof n&&"[object Function]"==Tn.call(n)});var Ln=h(function(n,r,t){On.call(n,t)?n[t]++:n[t]=1}),Qn=h(function(n,r,t){(On.call(n,t)?n[t]:n[t]=[]).push(r)}),Xn=h(function(n,r,t){n[t]=r}),Yn=I,Zn=d(Zn=Date.now)&&Zn||function(){return(new Date).getTime()};u.after=function(n,r){if(!A(r))throw new TypeError;return function(){if(--n<1)return r.apply(this,arguments)}},u.bind=K,u.bindAll=function(n){for(var r=arguments.length>1?p(arguments,!0,!1,1):x(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=y(n[u],1,null,null,n)}return n},u.chain=function(n){return(n=new o(n)).__chain__=!0,n},u.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},u.compose=function(){for(var n=arguments,r=n.length;r--;)if(!A(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},u.countBy=Ln,u.debounce=L,u.defaults=j,u.defer=function(n){if(!A(n))throw new TypeError;var r=e(arguments,1);return setTimeout(function(){n.apply(Z,r)},1)},u.delay=function(n,r){if(!A(n))throw new TypeError;var t=e(arguments,2);return setTimeout(function(){n.apply(Z,t)},r)},u.difference=function(n){return c(n,p(arguments,!0,!0,1))},u.filter=F,u.flatten=function(n,r){return p(n,r)},u.forEach=D,u.functions=x,u.groupBy=Qn,u.indexBy=Xn,u.initial=function(n,r,t){var u=0,o=n?n.length:0;if("number"!=typeof r&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else u=null==r||t?1:r||u;return e(n,0,Mn(In(0,o-u),o))},u.intersection=function(){for(var n=[],r=-1,t=arguments.length;++r<t;){var e=arguments[r];(Cn(e)||b(e))&&n.push(e)}var u=n[0],o=-1,i=_(),f=u?u.length:0,a=[];n:for(;++o<f;)if(i(a,e=u[o])<0){for(r=t;--r;)if(i(n[r],e)<0)continue n;a.push(e)}return a},u.invert=T,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o="function"==typeof r,i=n?n.length:0,f=Array("number"==typeof i?i:0);return D(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Pn,u.map=I,u.max=M,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):tn+arguments[0];return On.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},u.min=function(n,r,t){var e=1/0,u=e;"function"!=typeof r&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&"number"==typeof i)for(;++o<i;){var f=n[o];f<u&&(u=f)}else r=Q(r,t,3),D(n,function(n,t,o){var i=r(n,t,o);i<e&&(e=i,u=n)});return u},u.omit=function(n){var r=[];Jn(n,function(n,t){r.push(t)});for(var t=-1,e=(r=c(r,p(arguments,!0,!1,1))).length,u={};++t<e;){var o=r[t];u[o]=n[o]}return u},u.once=function(n){var r,t;if(!A(n))throw new TypeError;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},u.pairs=function(n){for(var r=-1,t=Pn(n),e=t.length,u=Array(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u},u.partial=function(n){return y(n,16,e(arguments,1))},u.pick=function(n){for(var r=-1,t=p(arguments,!0,!1,1),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},u.pluck=Yn,u.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);for(var e=-1,u=In(0,An((r-n)/t)),o=Array(u);++e<u;)o[e]=n,n+=t;return o},u.reject=function(n,r,t){return r=Q(r,t,3),F(n,function(n,t,e){return!r(n,t,e)})},u.rest=G,u.shuffle=z,u.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array("number"==typeof o?o:0);for(t=Q(t,e,3),D(n,function(n,r,e){i[++u]={criteria:[t(n,r,e)],index:u,value:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].value;return i},u.tap=function(n,r){return r(n),n},u.throttle=function(n,r,t){var e=!0,u=!0;if(!A(n))throw new TypeError;return!1===t?e=!1:S(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),(t={}).leading=e,t.maxWait=r,t.trailing=u,L(n,r,t)},u.times=function(n,r,t){n=(n=+n)>-1?n:0;var e=-1,u=Array(n);for(r=a(r,t,1);++e<n;)u[e]=r(e);return u},u.toArray=function(n){return Cn(n)?e(n):n&&"number"==typeof n.length?I(n):R(n)},u.union=function(){return v(p(arguments,!0,!0))},u.uniq=J,u.values=R,u.where=P,u.without=function(n){return c(n,e(arguments,1))},u.wrap=function(n,r){return y(r,16,[n])},u.zip=function(){for(var n=-1,r=M(Yn(arguments,"length")),t=Array(r<0?0:r);++n<r;)t[n]=Yn(arguments,n);return t},u.collect=I,u.drop=G,u.each=D,u.extend=w,u.methods=x,u.object=function(n,r){var t=-1,e=n?n.length:0,u={};for(r||!e||Cn(n[0])||(r=[]);++t<e;){var o=n[t];r?u[o]=r[t]:o&&(u[o[0]]=o[1])}return u},u.select=F,u.tail=G,u.unique=J,u.clone=function(n){return S(n)?Cn(n)?e(n):w({},n):n},u.contains=k,u.escape=function(n){return null==n?"":String(n).replace(Hn,g)},u.every=B,u.find=q,u.has=function(n,r){return!!n&&On.call(n,r)},u.identity=X,u.indexOf=V,u.isArguments=b,u.isArray=Cn,u.isBoolean=function(n){return!0===n||!1===n||n&&"object"==typeof n&&Tn.call(n)==an||!1},u.isDate=function(n){return n&&"object"==typeof n&&Tn.call(n)==ln||!1},u.isElement=function(n){return n&&1===n.nodeType||!1},u.isEmpty=E,u.isEqual=function(n,r){return function n(r,t,e,o){if(r===t)return 0!==r||1/r==1/t;var i=typeof t;if(!(r!=r||r&&hn[typeof r]||t&&hn[i]))return!1;if(null==r||null==t)return r===t;var f=Tn.call(r);if(f!=Tn.call(t))return!1;switch(f){case an:case ln:return+r==+t;case cn:return r!=+r?t!=+t:0==r?1/r==1/t:r==+t;case sn:case vn:return r==String(t)}var a=f==fn;if(!a){var l=r instanceof u,c=t instanceof u;if(l||c)return n(l?r.__wrapped__:r,c?t.__wrapped__:t,e,o);if(f!=pn)return!1;var p=r.constructor,s=t.constructor;if(p!=s&&!(A(p)&&p instanceof p&&A(s)&&s instanceof s)&&"constructor"in r&&"constructor"in t)return!1}e||(e=[]),o||(o=[]);for(var v=e.length;v--;)if(e[v]==r)return o[v]==t;var h=!0,y=0;if(e.push(r),o.push(t),a){if(y=t.length,h=y==r.length)for(;y--&&(h=n(r[y],t[y],e,o)););}else Jn(t,function(t,u,i){if(On.call(i,u))return y++,!(h=On.call(r,u)&&n(r[u],t,e,o))&&rn}),h&&Jn(r,function(n,r,t){if(On.call(t,r))return!(h=--y>-1)&&rn});return e.pop(),o.pop(),h}(n,r)},u.isFinite=function(n){return Fn(n)&&!qn(parseFloat(n))},u.isFunction=A,u.isNaN=function(n){return O(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=O,u.isObject=S,u.isRegExp=function(n){return n&&hn[typeof n]&&Tn.call(n)==sn||!1},u.isString=N,u.isUndefined=function(n){return"undefined"==typeof n},u.lastIndexOf=function(n,r,t){var e=n?n.length:0;for("number"==typeof t&&(e=(t<0?In(0,e+t):Mn(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},u.mixin=Y,u.noConflict=function(){return gn._=xn,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Sn($n()*(r-n+1))},u.reduce=$,u.reduceRight=W,u.result=function(n,r){if(n){var t=n[r];return A(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return"number"==typeof r?r:Pn(n).length},u.some=C,u.sortedIndex=H,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=String(n||"");var f=0,a="__p += '",l=(e=j({},e,i)).variable,c=RegExp((e.escape||en).source+"|"+(e.interpolate||en).source+"|"+(e.evaluate||en).source+"|$","g");n.replace(c,function(r,e,u,o,i){return a+=n.slice(f,i).replace(un,t),e&&(a+="' +\n_.escape("+e+") +\n'"),o&&(a+="';\n"+o+";\n__p += '"),u&&(a+="' +\n((__t = ("+u+")) == null ? '' : __t) +\n'"),f=i+r.length,r}),a+="';\n",l||(a="with ("+(l="obj")+" || {}) {\n"+a+"\n}\n"),a="function("+l+") {\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n"+a+"return __p\n}";try{var p=Function("_","return "+a)(o)}catch(n){throw n.source=a,n}return r?p(r):(p.source=a,p)},u.unescape=function(n){return null==n?"":String(n).replace(Gn,m)},u.uniqueId=function(n){var r=++nn+"";return n?n+r:r},u.all=B,u.any=C,u.detect=q,u.findWhere=function(n,r){return P(n,r,!0)},u.foldl=$,u.foldr=W,u.include=k,u.inject=$,u.first=U,u.last=function(n,r,t){var u=0,o=n?n.length:0;if("number"!=typeof r&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else if(null==(u=r)||t)return n?n[o-1]:Z;return e(n,In(0,o-u))},u.sample=function(n,r,t){if(n&&"number"!=typeof n.length&&(n=R(n)),null==r||t)return n?n[s(0,n.length-1)]:Z;var e=z(n);return e.length=Mn(In(0,r),e.length),e},u.take=U,u.head=U,Y(u),u.VERSION="2.4.1",u.prototype.chain=function(){return this.__chain__=!0,this},u.prototype.value=function(){return this.__wrapped__},D(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var r=wn[n];u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),zn.spliceObjects||0!==n.length||delete n[0],this}}),D(["concat","join","slice"],function(n){var r=wn[n];u.prototype[n]=function(){var n=this.__wrapped__,t=r.apply(n,arguments);return this.__chain__&&((t=new o(t)).__chain__=!0),t}}),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(gn._=u,define(function(){return u})):_n&&dn?mn?(dn.exports=u)._=u:_n._=u:gn._=u}).call(this);
;Dependency._js['lib/backbone/underscore']=true;

;
!function(e,n){"use strict";function r(e,n){var r,t,u=e.toLowerCase();for(n=[].concat(n),r=0;r<n.length;r+=1)if(t=n[r]){if(t.test&&t.test(e))return!0;if(t.toLowerCase()===u)return!0}}var t=n.prototype.trim,u=n.prototype.trimRight,i=n.prototype.trimLeft,l=function(e){return 1*e||0},o=function(e,n){if(n<1)return"";for(var r="";n>0;)1&n&&(r+=e),n>>=1,e+=e;return r},a=[].slice,c=function(e){return null==e?"\\s":e.source?e.source:"["+g.escapeRegExp(e)+"]"},s={lt:"<",gt:">",quot:'"',amp:"&",apos:"'"},f={};for(var p in s)f[s[p]]=p;f["'"]="#39";var h=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var r=o,t=function(){return t.cache.hasOwnProperty(arguments[0])||(t.cache[arguments[0]]=t.parse(arguments[0])),t.format.call(null,t.cache[arguments[0]],arguments)};return t.format=function(t,u){var i,l,o,a,c,s,f,p=1,g=t.length,d="",m=[];for(l=0;l<g;l++)if("string"===(d=e(t[l])))m.push(t[l]);else if("array"===d){if((a=t[l])[2])for(i=u[p],o=0;o<a[2].length;o++){if(!i.hasOwnProperty(a[2][o]))throw new Error(h('[_.sprintf] property "%s" does not exist',a[2][o]));i=i[a[2][o]]}else i=a[1]?u[a[1]]:u[p++];if(/[^s]/.test(a[8])&&"number"!=e(i))throw new Error(h("[_.sprintf] expecting number but found %s",e(i)));switch(a[8]){case"b":i=i.toString(2);break;case"c":i=n.fromCharCode(i);break;case"d":i=parseInt(i,10);break;case"e":i=a[7]?i.toExponential(a[7]):i.toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=(i=n(i))&&a[7]?i.substring(0,a[7]):i;break;case"u":i=Math.abs(i);break;case"x":i=i.toString(16);break;case"X":i=i.toString(16).toUpperCase()}i=/[def]/.test(a[8])&&a[3]&&i>=0?"+"+i:i,s=a[4]?"0"==a[4]?"0":a[4].charAt(1):" ",f=a[6]-n(i).length,c=a[6]?r(s,f):"",m.push(a[5]?i+c:c+i)}return m.join("")},t.cache={},t.parse=function(e){for(var n=e,r=[],t=[],u=0;n;){if(null!==(r=/^[^\x25]+/.exec(n)))t.push(r[0]);else if(null!==(r=/^\x25{2}/.exec(n)))t.push("%");else{if(null===(r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n)))throw new Error("[_.sprintf] huh?");if(r[2]){u|=1;var i=[],l=r[2],o=[];if(null===(o=/^([a-z_][a-z_\d]*)/i.exec(l)))throw new Error("[_.sprintf] huh?");for(i.push(o[1]);""!==(l=l.substring(o[0].length));)if(null!==(o=/^\.([a-z_][a-z_\d]*)/i.exec(l)))i.push(o[1]);else{if(null===(o=/^\[(\d+)\]/.exec(l)))throw new Error("[_.sprintf] huh?");i.push(o[1])}r[2]=i}else u|=2;if(3===u)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");t.push(r)}n=n.substring(r[0].length)}return t},t}(),g={VERSION:"2.3.0",isBlank:function(e){return null==e&&(e=""),/^\s*$/.test(e)},stripTags:function(e){return null==e?"":n(e).replace(/<\/?[^>]+>/g,"")},capitalize:function(e){return(e=null==e?"":n(e)).charAt(0).toUpperCase()+e.slice(1)},chop:function(e,r){return null==e?[]:(e=n(e),(r=~~r)>0?e.match(new RegExp(".{1,"+r+"}","g")):[e])},clean:function(e){return g.strip(e).replace(/\s+/g," ")},count:function(e,r){if(null==e||null==r)return 0;e=n(e);for(var t=0,u=0,i=(r=n(r)).length;-1!==(u=e.indexOf(r,u));)t++,u+=i;return t},chars:function(e){return null==e?[]:n(e).split("")},swapCase:function(e){return null==e?"":n(e).replace(/\S/g,function(e){return e===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})},escapeHTML:function(e){return null==e?"":n(e).replace(/[&<>"']/g,function(e){return"&"+f[e]+";"})},unescapeHTML:function(e){return null==e?"":n(e).replace(/\&([^;]+);/g,function(e,r){var t;return r in s?s[r]:(t=r.match(/^#x([\da-fA-F]+)$/))?n.fromCharCode(parseInt(t[1],16)):(t=r.match(/^#(\d+)$/))?n.fromCharCode(~~t[1]):e})},escapeRegExp:function(e){return null==e?"":n(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},splice:function(e,n,r,t){var u=g.chars(e);return u.splice(~~n,~~r,t),u.join("")},insert:function(e,n,r){return g.splice(e,n,0,r)},include:function(e,r){return""===r||null!=e&&-1!==n(e).indexOf(r)},join:function(){var e=a.call(arguments),n=e.shift();return null==n&&(n=""),e.join(n)},lines:function(e){return null==e?[]:n(e).split("\n")},reverse:function(e){return g.chars(e).reverse().join("")},startsWith:function(e,r){return""===r||null!=e&&null!=r&&(e=n(e),r=n(r),e.length>=r.length&&e.slice(0,r.length)===r)},endsWith:function(e,r){return""===r||null!=e&&null!=r&&(e=n(e),r=n(r),e.length>=r.length&&e.slice(e.length-r.length)===r)},succ:function(e){return null==e?"":(e=n(e)).slice(0,-1)+n.fromCharCode(e.charCodeAt(e.length-1)+1)},titleize:function(e){return null==e?"":(e=n(e).toLowerCase()).replace(/(?:^|\s|-)\S/g,function(e){return e.toUpperCase()})},camelize:function(e){return g.trim(e).replace(/[-_\s]+(.)?/g,function(e,n){return n?n.toUpperCase():""})},underscored:function(e){return g.trim(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(e){return g.trim(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(e){return g.titleize(n(e).replace(/[\W_]/g," ")).replace(/\s/g,"")},humanize:function(e){return g.capitalize(g.underscored(e).replace(/_id$/,"").replace(/_/g," "))},trim:function(e,r){return null==e?"":!r&&t?t.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+|"+r+"+$","g"),""))},ltrim:function(e,r){return null==e?"":!r&&i?i.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+"),""))},rtrim:function(e,r){return null==e?"":!r&&u?u.call(e):(r=c(r),n(e).replace(new RegExp(r+"+$"),""))},truncate:function(e,r,t){return null==e?"":(e=n(e),t=t||"...",r=~~r,e.length>r?e.slice(0,r)+t:e)},prune:function(e,r,t){if(null==e)return"";if(e=n(e),r=~~r,t=null!=t?n(t):"...",e.length<=r)return e;var u=e.slice(0,r+1).replace(/.(?=\W*\w*$)/g,function(e){return e.toUpperCase()!==e.toLowerCase()?"A":" "});return((u=u.slice(u.length-2).match(/\w\w/)?u.replace(/\s*\S+$/,""):g.rtrim(u.slice(0,u.length-1)))+t).length>e.length?e:e.slice(0,u.length)+t},words:function(e,n){return g.isBlank(e)?[]:g.trim(e,n).split(n||/\s+/)},pad:function(e,r,t,u){e=null==e?"":n(e),r=~~r;var i=0;switch(t?t.length>1&&(t=t.charAt(0)):t=" ",u){case"right":return i=r-e.length,e+o(t,i);case"both":return i=r-e.length,o(t,Math.ceil(i/2))+e+o(t,Math.floor(i/2));default:return i=r-e.length,o(t,i)+e}},lpad:function(e,n,r){return g.pad(e,n,r)},rpad:function(e,n,r){return g.pad(e,n,r,"right")},lrpad:function(e,n,r){return g.pad(e,n,r,"both")},sprintf:h,vsprintf:function(e,n){return n.unshift(e),h.apply(null,n)},toNumber:function(e,n){return e?(e=g.trim(e)).match(/^-?\d+(?:\.\d+)?$/)?l(l(e).toFixed(~~n)):NaN:0},numberFormat:function(e,n,r,t){if(isNaN(e)||null==e)return"";e=e.toFixed(~~n),t="string"==typeof t?t:",";var u=e.split("."),i=u[0],l=u[1]?(r||".")+u[1]:"";return i.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+t)+l},strRight:function(e,r){if(null==e)return"";e=n(e);var t=(r=null!=r?n(r):r)?e.indexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strRightBack:function(e,r){if(null==e)return"";e=n(e);var t=(r=null!=r?n(r):r)?e.lastIndexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strLeft:function(e,r){if(null==e)return"";e=n(e);var t=(r=null!=r?n(r):r)?e.indexOf(r):-1;return~t?e.slice(0,t):e},strLeftBack:function(e,n){if(null==e)return"";e+="",n=null!=n?""+n:n;var r=e.lastIndexOf(n);return~r?e.slice(0,r):e},toSentence:function(e,n,r,t){n=n||", ",r=r||" and ";var u=e.slice(),i=u.pop();return e.length>2&&t&&(r=g.rtrim(n)+r),u.length?u.join(n)+r+i:i},toSentenceSerial:function(){var e=a.call(arguments);return e[3]=!0,g.toSentence.apply(g,e)},slugify:function(e){if(null==e)return"";var r="ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź",t=new RegExp(c(r),"g");return e=n(e).toLowerCase().replace(t,function(e){var n=r.indexOf(e);return"aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz".charAt(n)||"-"}),g.dasherize(e.replace(/[^\w\s-]/g,""))},surround:function(e,n){return[n,e,n].join("")},quote:function(e,n){return g.surround(e,n||'"')},unquote:function(e,n){return n=n||'"',e[0]===n&&e[e.length-1]===n?e.slice(1,e.length-1):e},exports:function(){var e={};for(var n in this)this.hasOwnProperty(n)&&!n.match(/^(?:include|contains|reverse)$/)&&(e[n]=this[n]);return e},repeat:function(e,r,t){if(null==e)return"";if(r=~~r,null==t)return o(n(e),r);for(var u=[];r>0;u[--r]=e);return u.join(t)},naturalCmp:function(e,r){if(e==r)return 0;if(!e)return-1;if(!r)return 1;for(var t=/(\.\d+)|(\d+)|(\D+)/g,u=n(e).toLowerCase().match(t),i=n(r).toLowerCase().match(t),l=Math.min(u.length,i.length),o=0;o<l;o++){var a=u[o],c=i[o];if(a!==c){var s=parseInt(a,10);if(!isNaN(s)){var f=parseInt(c,10);if(!isNaN(f)&&s-f)return s-f}return a<c?-1:1}}return u.length===i.length?u.length-i.length:e<r?-1:1},levenshtein:function(e,r){if(null==e&&null==r)return 0;if(null==e)return n(r).length;if(null==r)return n(e).length;e=n(e),r=n(r);for(var t,u,i=[],l=0;l<=r.length;l++)for(var o=0;o<=e.length;o++)u=l&&o?e.charAt(o-1)===r.charAt(l-1)?t:Math.min(i[o],i[o-1],t)+1:l+o,t=i[o],i[o]=u;return i.pop()},toBoolean:function(e,n,t){return"number"==typeof e&&(e=""+e),"string"!=typeof e?!!e:!!r(e=g.trim(e),n||["true","1"])||!r(e,t||["false","0"])&&void 0}};g.strip=g.trim,g.lstrip=g.ltrim,g.rstrip=g.rtrim,g.center=g.lrpad,g.rjust=g.lpad,g.ljust=g.rpad,g.contains=g.include,g.q=g.quote,g.toBool=g.toBoolean,"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(module.exports=g),exports._s=g),"function"==typeof define&&define.amd&&define("underscore.string",[],function(){return g}),e._=e._||{},e._.string=e._.str=g}(this,String);
;Dependency._js['lib/backbone/underscore.string']=true;

;
!function(t,e){if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(i,n,s){t.Backbone=e(t,s,i,n)});else if("undefined"!=typeof exports){var i,n=require("underscore");try{i=require("jquery")}catch(t){}e(t,exports,n,i)}else t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e,i,n){var s=t.Backbone,r=[],a=r.slice;e.VERSION="1.1.2",e.$=n,e.noConflict=function(){return t.Backbone=s,this},e.emulateHTTP=!1,e.emulateJSON=!1;var o=e.Events={on:function(t,e,i){return c(this,"on",t,[e,i])&&e?(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:i,ctx:i||this}),this):this},once:function(t,e,n){if(!c(this,"once",t,[e,n])||!e)return this;var s=this,r=i.once(function(){s.off(t,r),e.apply(this,arguments)});return r._callback=e,this.on(t,r,n)},off:function(t,e,n){var s,r,a,o,h,u,l,d;if(!this._events||!c(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events=void 0,this;for(h=0,u=(o=t?[t]:i.keys(this._events)).length;h<u;h++)if(t=o[h],a=this._events[t]){if(this._events[t]=s=[],e||n)for(l=0,d=a.length;l<d;l++)r=a[l],(e&&e!==r.callback&&e!==r.callback._callback||n&&n!==r.context)&&s.push(r);s.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=a.call(arguments,1);if(!c(this,"trigger",t,e))return this;var i=this._events[t],n=this._events.all;return i&&u(i,e),n&&u(n,arguments),this},stopListening:function(t,e,n){var s=this._listeningTo;if(!s)return this;var r=!e&&!n;for(var a in n||"object"!=typeof e||(n=this),t&&((s={})[t._listenId]=t),s)(t=s[a]).off(e,n,this),(r||i.isEmpty(t._events))&&delete this._listeningTo[a];return this}},h=/\s+/,c=function(t,e,i,n){if(!i)return!0;if("object"==typeof i){for(var s in i)t[e].apply(t,[s,i[s]].concat(n));return!1}if(h.test(i)){for(var r=i.split(h),a=0,o=r.length;a<o;a++)t[e].apply(t,[r[a]].concat(n));return!1}return!0},u=function(t,e){var i,n=-1,s=t.length,r=e[0],a=e[1],o=e[2];switch(e.length){case 0:for(;++n<s;)(i=t[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r);return;case 2:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,a);return;case 3:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,a,o);return;default:for(;++n<s;)(i=t[n]).callback.apply(i.ctx,e);return}};i.each({listenTo:"on",listenToOnce:"once"},function(t,e){o[e]=function(e,n,s){return(this._listeningTo||(this._listeningTo={}))[e._listenId||(e._listenId=i.uniqueId("l"))]=e,s||"object"!=typeof n||(s=this),e[t](n,s,this),this}}),o.bind=o.on,o.unbind=o.off,i.extend(e,o);var l=e.Model=function(t,e){var n=t||{};e||(e={}),this.cid=i.uniqueId("c"),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{}),n=i.defaults({},n,i.result(this,"defaults")),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};i.extend(l.prototype,o,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return null!=this.get(t)},set:function(t,e,n){var s,r,a,o,h,c,u,l;if(null==t)return this;if("object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),!this._validate(r,n))return!1;for(s in a=n.unset,h=n.silent,o=[],c=this._changing,this._changing=!0,c||(this._previousAttributes=i.clone(this.attributes),this.changed={}),l=this.attributes,u=this._previousAttributes,this.idAttribute in r&&(this.id=r[this.idAttribute]),r)e=r[s],i.isEqual(l[s],e)||o.push(s),i.isEqual(u[s],e)?delete this.changed[s]:this.changed[s]=e,a?delete l[s]:l[s]=e;if(!h){o.length&&(this._pending=n);for(var d=0,f=o.length;d<f;d++)this.trigger("change:"+o[d],this,l[o[d]],n)}if(c)return this;if(!h)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var n in this.attributes)e[n]=void 0;return this.set(e,i.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!i.isEmpty(this.changed):i.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&i.clone(this.changed);var e,n=!1,s=this._changing?this._previousAttributes:this.attributes;for(var r in t)i.isEqual(s[r],e=t[r])||((n||(n={}))[r]=e);return n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){void 0===(t=t?i.clone(t):{}).parse&&(t.parse=!0);var e=this,n=t.success;return t.success=function(i){if(!e.set(e.parse(i,t),t))return!1;n&&n(e,i,t),e.trigger("sync",e,i,t)},R(this,t),this.sync("read",this,t)},save:function(t,e,n){var s,r,a,o=this.attributes;if(null==t||"object"==typeof t?(s=t,n=e):(s={})[t]=e,n=i.extend({validate:!0},n),s&&!n.wait){if(!this.set(s,n))return!1}else if(!this._validate(s,n))return!1;s&&n.wait&&(this.attributes=i.extend({},o,s)),void 0===n.parse&&(n.parse=!0);var h=this,c=n.success;return n.success=function(t){h.attributes=o;var e=h.parse(t,n);if(n.wait&&(e=i.extend(s||{},e)),i.isObject(e)&&!h.set(e,n))return!1;c&&c(h,t,n),h.trigger("sync",h,t,n)},R(this,n),"patch"===(r=this.isNew()?"create":n.patch?"patch":"update")&&(n.attrs=s),a=this.sync(r,this,n),s&&n.wait&&(this.attributes=o),a},destroy:function(t){var e=this,n=(t=t?i.clone(t):{}).success,s=function(){e.trigger("destroy",e,e.collection,t)};if(t.success=function(i){(t.wait||e.isNew())&&s(),n&&n(e,i,t),e.isNew()||e.trigger("sync",e,i,t)},this.isNew())return t.success(),!1;R(this,t);var r=this.sync("delete",this,t);return t.wait||s(),r},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||N();return this.isNew()?t:t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=i.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,i.extend(e,{validationError:n})),!1)}});i.each(["keys","values","pairs","invert","pick","omit"],function(t){l.prototype[t]=function(){var e=a.call(arguments);return e.unshift(this.attributes),i[t].apply(i,e)}});var d=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,i.extend({silent:!0},e))},f={add:!0,remove:!0,merge:!0},p={add:!0,remove:!1};i.extend(d.prototype,o,{model:l,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:!1},e,p))},remove:function(t,e){var n,s,r,a,o=!i.isArray(t);for(t=o?[t]:i.clone(t),e||(e={}),n=0,s=t.length;n<s;n++)(a=t[n]=this.get(t[n]))&&(delete this._byId[a.id],delete this._byId[a.cid],r=this.indexOf(a),this.models.splice(r,1),this.length--,e.silent||(e.index=r,a.trigger("remove",a,this,e)),this._removeReference(a,e));return o?t[0]:t},set:function(t,e){(e=i.defaults({},e,f)).parse&&(t=this.parse(t,e));var n,s,r,a,o,h,c,u=!i.isArray(t);t=u?t?[t]:[]:i.clone(t);var d=e.at,p=this.model,g=this.comparator&&null==d&&!1!==e.sort,v=i.isString(this.comparator)?this.comparator:null,m=[],y=[],_={},b=e.add,w=e.merge,x=e.remove,E=!(g||!b||!x)&&[];for(n=0,s=t.length;n<s;n++){if(r=(o=t[n]||{})instanceof l?a=o:o[p.prototype.idAttribute||"id"],h=this.get(r))x&&(_[h.cid]=!0),w&&(o=o===a?a.attributes:o,e.parse&&(o=h.parse(o,e)),h.set(o,e),g&&!c&&h.hasChanged(v)&&(c=!0)),t[n]=h;else if(b){if(!(a=t[n]=this._prepareModel(o,e)))continue;m.push(a),this._addReference(a,e)}a=h||a,!E||!a.isNew()&&_[a.id]||E.push(a),_[a.id]=!0}if(x){for(n=0,s=this.length;n<s;++n)_[(a=this.models[n]).cid]||y.push(a);y.length&&this.remove(y,e)}if(m.length||E&&E.length)if(g&&(c=!0),this.length+=m.length,null!=d)for(n=0,s=m.length;n<s;n++)this.models.splice(d+n,0,m[n]);else{E&&(this.models.length=0);var k=E||m;for(n=0,s=k.length;n<s;n++)this.models.push(k[n])}if(c&&this.sort({silent:!0}),!e.silent){for(n=0,s=m.length;n<s;n++)(a=m[n]).trigger("add",a,this,e);(c||E&&E.length)&&this.trigger("sort",this,e)}return u?t[0]:t},reset:function(t,e){e||(e={});for(var n=0,s=this.models.length;n<s;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,i.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t),e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t),e},slice:function(){return a.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){return i.isEmpty(t)?e?void 0:[]:this[e?"find":"filter"](function(e){for(var i in t)if(t[i]!==e.get(i))return!1;return!0})},findWhere:function(t){return this.where(t,!0)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),i.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(i.bind(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){void 0===(t=t?i.clone(t):{}).parse&&(t.parse=!0);var e=t.success,n=this;return t.success=function(i){var s=t.reset?"reset":"set";n[s](i,t),e&&e(n,i,t),n.trigger("sync",n,i,t)},R(this,t),this.sync("read",this,t)},create:function(t,e){if(e=e?i.clone(e):{},!(t=this._prepareModel(t,e)))return!1;e.wait||this.add(t,e);var n=this,s=e.success;return e.success=function(t,i){e.wait&&n.add(t,e),s&&s(t,i,e)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(t instanceof l)return t;(e=e?i.clone(e):{}).collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_addReference:function(t,e){this._byId[t.cid]=t,null!=t.id&&(this._byId[t.id]=t),t.collection||(t.collection=this),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){("add"!==t&&"remove"!==t||i===this)&&("destroy"===t&&this.remove(e,n),e&&t==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],null!=e.id&&(this._byId[e.id]=e)),this.trigger.apply(this,arguments))}});i.each(["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"],function(t){d.prototype[t]=function(){var e=a.call(arguments);return e.unshift(this.models),i[t].apply(i,e)}});i.each(["groupBy","countBy","sortBy","indexBy"],function(t){d.prototype[t]=function(e,n){var s=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,s,n)}});var g=e.View=function(t){this.cid=i.uniqueId("view"),t||(t={}),i.extend(this,i.pick(t,m)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},v=/^(\S+)\s*(.*)$/,m=["model","collection","el","id","attributes","className","tagName","events"];i.extend(g.prototype,o,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,i){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0],!1!==i&&this.delegateEvents(),this},delegateEvents:function(t){if(!t&&!(t=i.result(this,"events")))return this;for(var e in this.undelegateEvents(),t){var n=t[e];if(i.isFunction(n)||(n=this[t[e]]),n){var s=e.match(v),r=s[1],a=s[2];n=i.bind(n,this),r+=".delegateEvents"+this.cid,""===a?this.$el.on(r,n):this.$el.on(r,a,n)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(i.result(this,"el"),!1);else{var t=i.extend({},i.result(this,"attributes"));this.id&&(t.id=i.result(this,"id")),this.className&&(t.class=i.result(this,"className"));var n=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(n,!1)}}}),e.sync=function(t,n,s){var r=_[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:r,dataType:"json"};if(s.url||(a.url=i.result(n,"url")||N()),null!=s.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(s.attrs||n.toJSON(s))),s.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),s.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){a.type="POST",s.emulateJSON&&(a.data._method=r);var o=s.beforeSend;s.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",r),o)return o.apply(this,arguments)}}"GET"===a.type||s.emulateJSON||(a.processData=!1),"PATCH"===a.type&&y&&(a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var h=s.xhr=e.ajax(i.extend(a,s));return n.trigger("request",n,h,s),h};var y=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),_={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var b=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},w=/\((.*?)\)/g,x=/(\(\?)?:\w+/g,E=/\*\w+/g,k=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(b.prototype,o,{initialize:function(){},route:function(t,n,s){i.isRegExp(t)||(t=this._routeToRegExp(t)),i.isFunction(n)&&(s=n,n=""),s||(s=this[n]);var r=this;return e.history.route(t,function(i){var a=r._extractParameters(t,i);r.execute(s,a),r.trigger.apply(r,["route:"+n].concat(a)),r.trigger("route",n,a),e.history.trigger("route",r,n,a)}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var t,e=i.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(k,"\\$&").replace(w,"(?:$1)?").replace(x,function(t,e){return e?t:"([^/?]+)"}).replace(E,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return i.map(n,function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null})}});var T=e.History=function(){this.handlers=[],i.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},$=/^[#\/]|\s+$/g,S=/^\/+|\/+$/g,H=/msie [\w.]+/,A=/\/$/,I=/#.*$/;T.started=!1,i.extend(T.prototype,o,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(A,"");t.indexOf(i)||(t=t.slice(i.length))}else t=this.getHash();return t.replace($,"")},start:function(t){if(T.started)throw new Error("Backbone.history has already been started");T.started=!0,this.options=i.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var n=this.getFragment(),s=document.documentMode,r=H.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);if(this.root=("/"+this.root+"/").replace(S,"/"),r&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow,this.navigate(n)}this._hasPushState?e.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!r?e.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=n;var o=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+"#"+this.fragment),!0;this._hasPushState&&this.atRoot()&&o.hash&&(this.fragment=this.getHash().replace($,""),this.history.replaceState({},document.title,this.root+this.fragment))}if(!this.options.silent)return this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),T.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getFragment(this.getHash(this.iframe))),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return t=this.fragment=this.getFragment(t),i.any(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0})},navigate:function(t,e){if(!T.started)return!1;e&&!0!==e||(e={trigger:!!e});var i=this.root+(t=this.getFragment(t||""));if(t=t.replace(I,""),this.fragment!==t){if(this.fragment=t,""===t&&"/"!==i&&(i=i.slice(0,-1)),this._hasPushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getFragment(this.getHash(this.iframe))&&(e.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,t,e.replace))}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){if(i){var n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}}),e.history=new T;l.extend=d.extend=b.extend=g.extend=T.extend=function(t,e){var n,s=this;n=t&&i.has(t,"constructor")?t.constructor:function(){return s.apply(this,arguments)},i.extend(n,s,e);var r=function(){this.constructor=n};return r.prototype=s.prototype,n.prototype=new r,t&&i.extend(n.prototype,t),n.__super__=s.prototype,n};var N=function(){throw new Error('A "url" property or function must be specified')},R=function(t,e){var i=e.error;e.error=function(n){i&&i(t,n,e),t.trigger("error",t,n,e)}};return e});
;Dependency._js['lib/backbone/backbone']=true;

;
!function(t,e){"undefined"!=typeof exports?module.exports=e(require("underscore"),require("backbone")):"function"==typeof define&&define.amd?define(["underscore","backbone"],e):e(t._,t.Backbone)}(this,function(t,e){function n(t,e,n){return t._super.prototype[e].apply(t,n)}function i(e,n,i,o){(i=i||{}).get&&v(i.get)&&(i._get=i.get),i.set&&v(i.set)&&(i._set=i.set),delete i.get,delete i.set,t.extend(this,i),this.model=e,this.name=n,this.deps=this.deps||[],o||this.init()}function o(e){return v(e)?e():(m(e)&&(e=t.clone(e),t.each(e,function(t,n){e[n]=o(t)})),e)}function r(t){return v(t)?{set:t}:t}function s(e){return function(){var n=arguments,i=v(e)?e:e.get,r=e.set;return function(e){return g(e)?i.apply(this,t.map(n,o)):n[0]((r||i).call(this,e))}}}function c(e,n,i,o,r){if(e=t.result(e,o))return y(e)?(r=r?r+"_":"",n["$"+o]=function(){return $&&$.push([e,"change"]),e},t.each(e.toJSON({computed:!0}),function(o,s){n[r+s]=function(n){return function(e,n,i,o){if($&&$.push([e,"change:"+n]),!g(i)){if(!m(i)||w(i)||t.isDate(i)){var r=i;(i={})[n]=r}return o&&o.save?e.save(i,o):e.set(i,o)}return e.get(n)}(e,s,n,i)}})):b(e)&&(n["$"+o]=function(){return $&&$.push([e,"reset add remove sort update"]),e}),e}function u(t,e){if(":el"===e)return t.$el;var n=t.$(e);return t.$el.is(e)&&(n=n.add(t.$el)),n}function h(e,n,i,o,r,s){try{var c=(V[i]||(V[i]=new Function("$f","$c","with($f){with($c){return{"+i+"}}}")))(s,o)}catch(t){throw'Error parsing bindings: "'+i+'"\n>> '+t}var u=t.map(t.union(c.events||[],["change"]),function(t){return t+".epoxy"}).join(" ");t.each(c,function(t,i){if(r.hasOwnProperty(i))e.b().push(new l(e,n,r[i],t,u,o,c));else if(!B.hasOwnProperty(i))throw'binding handler "'+i+'" is not defined.'})}function a(t,e,n){if(t&&t.hasOwnProperty(e))return g(n)?o(t[e]):t[e](n)}function l(e,n,i,r,s,c,u){var h=this,a=n[0].tagName.toLowerCase(),l="input"==a||"select"==a||"textarea"==a||"true"==n.prop("contenteditable"),f=[],d=function(t){h.$el&&h.set(h.$el,o(r),t)};if(h.view=e,h.$el=n,h.evt=s,t.extend(h,i),r=h.init(h.$el,o(r),c,u)||r,$=f,d(),$=null,l&&i.get&&v(r)&&h.$el.on(s,function(t){r(h.get(h.$el,o(r),t))}),f.length)for(var p=0,g=f.length;p<g;p++)h.listenTo(f[p][0],f[p][1],d)}var f,d=e.Epoxy={},p=Array.prototype,g=t.isUndefined,v=t.isFunction,m=t.isObject,w=t.isArray,y=function(t){return t instanceof e.Model},b=function(t){return t instanceof e.Collection},_=function(){},C={mixin:function(t){for(var e in t=t||{},this.prototype)"bindings"===e&&t.bindings||this.prototype.hasOwnProperty(e)&&"constructor"!==e&&(t[e]=this.prototype[e]);return t}},x=["computeds"];d.Model=e.Model.extend({_super:e.Model,constructor:function(e,i){t.extend(this,t.pick(i||{},x)),n(this,"constructor",arguments),this.initComputeds(e,i)},getCopy:function(e){return t.clone(this.get(e))},get:function(t){return f&&f.push(["change:"+t,this]),this.hasComputed(t)?this.c()[t].get():n(this,"get",arguments)},set:function(e,i,o){var r=e;r&&!m(r)?(r={})[e]=i:o=i,o=o||{};var s=this._setting=[];o.unset||(r=function e(n,i,o,r){for(var s in i)if(i.hasOwnProperty(s)){var c=i[s];if(n.hasComputed(s)){if(r.length&&t.contains(r,s))throw"Recursive setter: "+r.join(" > ");(c=n.c()[s].set(c))&&m(c)&&(o=e(n,c,o,r.concat(s)))}else o[s]=c}return o}(this,r,{},[])),delete this._setting;var c=n(this,"set",[r,o]);return o.silent||(!this.hasChanged()&&s.length&&this.trigger("change",this),t.each(s,function(t){this.trigger.apply(this,t)},this)),c},toJSON:function(e){var i=n(this,"toJSON",arguments);return e&&e.computed&&t.each(this.c(),function(t,e){i[e]=t.value}),i},destroy:function(){return this.clearComputeds(),n(this,"destroy",arguments)},c:function(){return this._c||(this._c={})},initComputeds:function(e,n){this.clearComputeds();var i=t.result(this,"computeds")||{};i=t.extend(i,t.pick(e||{},t.keys(i))),t.each(i,function(t,e){t._init=1,this.addComputed(e,t)},this),t.invoke(this.c(),"init")},addComputed:function(t,e,n){this.removeComputed(t);var o=e,r=o._init;if(v(e)){var s=2;(o={})._get=e,v(n)&&(o._set=n,s++),o.deps=p.slice.call(arguments,s)}return this.c()[t]=new i(this,t,o,r),this},hasComputed:function(t){return this.c().hasOwnProperty(t)},removeComputed:function(t){return this.hasComputed(t)&&(this.c()[t].dispose(),delete this.c()[t]),this},clearComputeds:function(){for(var t in this.c())this.removeComputed(t);return this},modifyArray:function(t,e,n){var i=this.get(t);if(w(i)&&v(p[e])){var o=p.slice.call(arguments,2),r=p[e].apply(i,o);return(n=n||{}).silent||this.trigger("change:"+t+" change",this,p,n),r}return null},modifyObject:function(t,e,n,i){var o=this.get(t),r=!1;return m(o)?(i=i||{},g(n)&&o.hasOwnProperty(e)?(delete o[e],r=!0):o[e]!==n&&(o[e]=n,r=!0),r&&!i.silent&&this.trigger("change:"+t+" change",this,o,i),o):null}},C),t.extend(i.prototype,e.Events,{init:function(){var e={},n=f=[];this.get(!0),f=null,n.length&&(t.each(n,function(n){var i=n[0],o=n[1];e[i]?t.contains(e[i],o)||e[i].push(o):e[i]=[o]}),t.each(e,function(e,n){for(var i=0,o=e.length;i<o;i++)this.listenTo(e[i],n,t.bind(this.get,this,!0))},this))},val:function(t){return this.model.get(t)},get:function(e){if(!0===e&&this._get){var n=this._get.apply(this.model,t.map(this.deps,this.val,this));this.change(n)}return this.value},set:function(t){if(this._get){if(this._set)return this._set.apply(this.model,arguments);throw"Cannot set read-only computed attribute."}return this.change(t),null},change:function(e){if(!t.isEqual(e,this.value)){this.value=e;var n=["change:"+this.name,this.model,e];this.model._setting?this.model._setting.push(n):(n[0]+=" change",this.model.trigger.apply(this.model,n))}},dispose:function(){this.stopListening(),this.off(),this.model=this.value=null}});var $,O={optionText:"label",optionValue:"value"},V={},k={attr:r(function(t,e){t.attr(e)}),checked:r({get:function(e,n){var i=!!e.prop("checked"),o=e.val();if(this.isRadio(e))return o;if(w(n)){n=n.slice();var r=t.indexOf(n,o);return i&&r<0?n.push(o):!i&&r>-1&&n.splice(r,1),n}return i},set:function(e,n){var i=!!n;this.isRadio(e)?i=n==e.val():w(n)&&(i=t.contains(n,e.val())),e.prop("checked",i)},isRadio:function(t){return"radio"===t.attr("type").toLowerCase()}}),classes:r(function(e,n){t.each(n,function(t,n){e.toggleClass(n,!!t)})}),collection:r({init:function(t,e,n,i){if(this.i=i.itemView?this.view[i.itemView]:this.view.itemView,!b(e))throw'Binding "collection" requires a Collection.';if(!v(this.i))throw'Binding "collection" requires an itemView.';this.v={}},set:function(e,n,i){var o,r=this.v,s=this.i,c=n.models,u=$;if($=null,y(i=i||n))if(r.hasOwnProperty(i.cid))r[i.cid].remove(),delete r[i.cid];else{r[i.cid]=o=new s({model:i,collectionView:this.view});var h=t.indexOf(c,i),a=e.children();h<a.length?a.eq(h).before(o.$el):e.append(o.$el)}else if(b(i)){var l=c.length===t.size(r)&&n.every(function(t){return r.hasOwnProperty(t.cid)});e.children().detach();var f=document.createDocumentFragment();l?n.each(function(t){f.appendChild(r[t.cid].el)}):(this.clean(),n.each(function(t){r[t.cid]=o=new s({model:t,collectionView:this.view}),f.appendChild(o.el)},this)),e.append(f)}$=u},clean:function(){for(var t in this.v)this.v.hasOwnProperty(t)&&(this.v[t].remove(),delete this.v[t])}}),css:r(function(t,e){t.css(e)}),disabled:r(function(t,e){t.prop("disabled",!!e)}),enabled:r(function(t,e){t.prop("disabled",!e)}),html:r(function(t,e){t.html(e)}),options:r({init:function(t,e,n,i){this.e=i.optionsEmpty,this.d=i.optionsDefault,this.v=i.value},set:function(e,n){var i=this,r=o(i.e),s=o(i.d),c=o(i.v),u=b(n)?n.models:n,h=u.length,a=!0,l="";h||s||!r?(s&&(u=[s].concat(u)),t.each(u,function(t,e){l+=i.opt(t,h)})):(l+=i.opt(r,h),a=!1),e.html(l).prop("disabled",!a).val(c);var f=e.val();i.v&&!t.isEqual(c,f)&&i.v(f)},opt:function(t,e){var n=t,i=t,o=O.optionText,r=O.optionValue;return m(t)&&(n=y(t)?t.get(o):t[o],i=y(t)?t.get(r):t[r]),['<option value="',i,'">',n,"</option>"].join("")},clean:function(){this.d=this.e=this.v=0}}),template:r({init:function(e,n,i){var o=e.find("script,template");if(this.t=t.template(o.length?o.html():e.html()),w(n))return t.pick(i,n)},set:function(t,e){e=y(e)?e.toJSON({computed:!0}):e,t.html(this.t(e))},clean:function(){this.t=null}}),text:r({get:function(t){return t.text()},set:function(t,e){t.text(e)}}),toggle:r(function(t,e){t.toggle(!!e)}),value:r({get:function(t){return t.val()},set:function(t,e){try{t.val()+""!=e+""&&t.val(e)}catch(t){}}})},P={all:s(function(){for(var t=arguments,e=0,n=t.length;e<n;e++)if(!t[e])return!1;return!0}),any:s(function(){for(var t=arguments,e=0,n=t.length;e<n;e++)if(t[e])return!0;return!1}),length:s(function(t){return t.length||0}),none:s(function(){for(var t=arguments,e=0,n=t.length;e<n;e++)if(t[e])return!1;return!0}),not:s(function(t){return!t}),format:s(function(t){for(var e=arguments,n=1,i=e.length;n<i;n++)t=t.replace(new RegExp("\\$"+n,"g"),e[n]);return t}),select:s(function(t,e,n){return t?e:n}),csv:s({get:function(t){return(t=String(t))?t.split(","):[]},set:function(t){return w(t)?t.join(","):t}}),integer:s(function(t){return t?parseInt(t,10):0}),decimal:s(function(t){return t?parseFloat(t):0})},B={events:1,itemView:1,optionsDefault:1,optionsEmpty:1};d.binding={allowedParams:B,addHandler:function(t,e){k[t]=r(e)},addFilter:function(t,e){P[t]=s(e)},config:function(e){t.extend(O,e)},emptyCache:function(){V={}}};var E=["viewModel","bindings","bindingFilters","bindingHandlers","bindingSources","computeds"];return d.View=e.View.extend({_super:e.View,constructor:function(e){t.extend(this,t.pick(e||{},E)),n(this,"constructor",arguments),this.applyBindings()},b:function(){return this._b||(this._b=[])},bindings:"data-bind",setterOptions:null,applyBindings:function(){this.removeBindings();var n=this,i=t.clone(t.result(n,"bindingSources")),o=n.bindings,a=n.setterOptions,l=t.clone(k),f=t.clone(P),d=n._c={};t.each(t.result(n,"bindingHandlers")||{},function(t,e){l[e]=r(t)}),t.each(t.result(n,"bindingFilters")||{},function(t,e){f[e]=s(t)}),n.model=c(n,d,a,"model"),n.viewModel=c(n,d,a,"viewModel"),n.collection=c(n,d,a,"collection"),n.collection&&n.collection.view&&(n.itemView=n.collection.view),i&&(t.each(i,function(t,e){i[e]=c(i,d,a,e,e)}),n.bindingSources=i),t.each(t.result(n,"computeds")||{},function(t,e){var i=v(t)?t:t.get,o=t.set,r=t.deps;d[e]=function(t){return!g(t)&&o?o.call(n,t):i.apply(n,function(t,e){var n=[];if(e&&t)for(var i=0,o=e.length;i<o;i++)n.push(e[i]in t?t[e[i]]():null);return n}(n._c,r))}}),m(o)?t.each(o,function(t,e){var i=u(n,e);i.length&&h(n,i,t,d,l,f)}):u(n,"["+o+"]").each(function(){var t=e.$(this);h(n,t,t.attr(o),d,l,f)})},getBinding:function(t){return a(this._c,t)},setBinding:function(t,e){return a(this._c,t,e)},removeBindings:function(){if(this._c=null,this._b)for(;this._b.length;)this._b.pop().dispose()},remove:function(){this.removeBindings(),n(this,"remove",arguments)}},C),t.extend(l.prototype,e.Events,{init:_,get:_,set:_,clean:_,dispose:function(){this.clean(),this.stopListening(),this.$el.off(this.evt),this.$el=this.view=null}}),d});
;Dependency._js['lib/backbone/backbone.epoxy']=true;

;
function getMainFrame(e){return e&&XPLAN.util.change_top_url(e,!0),XPLAN.util.get_top_frame()}function getHiddenFrame(e){var t=getMainFrame(),n=t.frames.xplanhidden;return n?(e&&(n.location.href=e),n):(jQuery('<iframe name="xplanhidden" />',getFrameDoc(t)).attr("src",e||getBaseURL()+"/static/dummy.html").css({display:"none",width:"100%",height:"500px"}).bind("load",function(){XPLAN.onloadhidden(this)}).appendTo(getFrameDoc(t).body),t.frames.xplanhidden)}function $(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if("string"==typeof n&&(n=document.getElementById(n)),1==arguments.length)return n;e.push(n)}return e}function $form(e,t){if(e)return"string"!=typeof e&&"number"!=typeof e||(e=document.forms[e]),e.elements[t];for(var n=0;n<document.forms.length;n++){var r=document.forms[n];if(r.elements[t])return r.elements[t]}return null}function $F(e){return $form(null,e)}function $FV(e,t){var n,r=$form(null,e);if(r){if(null!==t&&void 0!==t){if("SELECT"==r.tagName){for(n=0;n<r.options.length;n++)if(r.options[n].value==t){r.options[n].selected=!0,r.value=t;break}}else if(r.length){for(n=0;n<r.length;n++)if(r[n].value==t){r[n].checked=!0;break}}else r.value=t;return t}if("SELECT"==r.tagName){for(n=0;n<r.options.length;n++)if(r.options[n].selected)return r[n].value}else{if(!r.length)return r.value;for(n=0;n<r.length;n++)if(r[n].checked)return r[n].value}}}function getBaseURL(){if("string"==typeof baseurl)return baseurl;var e=window.frames.top;return e&&"string"==typeof e.baseurl?e.baseurl:e&&e.opener&&(e=e.opener.frames.top)&&"string"==typeof e.baseurl?e.baseurl:""}function getDocFrame(e){if(e){if(e.defaultView)return e.defaultView;if(e.parentWindow)return e.parentWindow}return null}function getFrameDoc(e){var t=jQuery(e).get(0),n=null;if(t){try{n=t.contentDocument}catch(e){}if(!n)try{n=t.contentWindow?t.contentWindow.document:t.document}catch(e){}}else n=null;return n}function openMarketData(){var e=getBaseURL()+"/portfolio/marketdata/market_overview",t=640,n=480,r=0,i=0;window.screen&&(t=80*jQuery(window).width()/100,n=80*jQuery(window).height()/100,i=(jQuery(window).width()-t)/2,r=(jQuery(window).height()-n)/2),window.open(e,"","height="+n+",width="+t+",top="+r+",left="+i+",location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no,border=no,heading=no,topbar=no").focus()}function setPDFImage(e){var t=getMainFrame();t&&(t.XPLAN.framemain.printpdf=e)}function getFormPostData(e,t,n,r,i,a){function o(e){var t=e.name.split(":");return"speedgroup"!=t[0]&&(t.length>=4&&"0"==t[3]&&(t[3]="1"),3==t.length&&t.push("1")),t.join(":")}var u=e.elements,s=t?{}:[];jQuery.watermark&&jQuery.watermark.hideAll();for(var l=0;l<u.length;l++){var c,d=u[l];if((n||!d.disabled)&&(("checkbox"!=d.type&&"radio"!=d.type||d.checked)&&"file"!=d.type&&!(r&&jQuery(d).parents(".exclude_from_form:first").length>0))){var f;try{f=d.value}catch(e){continue}if("textarea"===d.tagName.toLowerCase()&&(f=jQuery(d).val()),"SELECT"==d.tagName&&d.multiple){for(var p=[],h=0;h<d.options.length;h++)d.options[h].selected&&p.push(d.options[h].value);f=p}if(i){var g;if("none"===(g=jQuery(d).parents("tr:first")).css("display"))continue;if("none"===g.parents("tbody:first").css("display"))continue}if(c=d.name,a)"none"===(g=jQuery(d,jQuery(e)).parents("tr:first")).css("display")&&(c=o(d));if(t)if(s[d.name]){var m=s[d.name];"array"==XPLAN.util.getType(m)?m.push(f):s[c]=[m,f]}else s[c]=f;else s.push([c,f])}}return s}function getFormPostDataExclHidden(e,t,n,r){return getFormPostData(e,t,n,r,!0)}function getFormPostDataAdjustRequired(e,t,n,r){return getFormPostData(e,t,n,r,!1,!0)}function setFormPostData(e,t){var n;for(var r in t){var i=e.elements[r],a=t[r];if(i){var o=XPLAN.util.getType(i),u=XPLAN.util.getType(a);if("array"!=u||"array"!=o&&i.length!=a.length)if("array"==u&&"SELECT"==i.tagName&&i.multiple)for(n=0;n<a.length;n++)for(var s=a[n],l=0;l<i.options.length;l++)i.options[l].value==s&&(i.options[l].selected=!0);else i.value=a;else for(n=0;n<i.length;n++)i[n].value=a[n]}}}function palert(e){var t=XPLAN.util.pretty_print(e);alert(t)}function dalert(e){XPLAN.debug?XPLAN.debug.dalert(e):palert(e)}function openIOSPlusOrders(e){1==e&&1==XPLAN.cache.get("embedded",!1)?openIRESSCommand("OPAD1",""):XPLAN.util.form_redirect(getBaseURL()+"/portfolio/iosplus/orderpad")}function openIOSPlusOrderEntry(e,t,n){1==t&&1==XPLAN.cache.get("embedded",!1)?openIRESSCommand("IOSRAOE",""):Dependency.addJS("xpt/portfolio/iosplus/orderentry",function(){XPLAN.iosplus.orderentry.init(e,null),XPLAN.iosplus.orderentry.onOrderCreate=function(e){window.location=getBaseURL()+"/portfolio/iosplus/orderpad?from_order_entry=1&iosaccount="+e},XPLAN.iosplus.orderentry.openIOSPlusOrderEntry(n)})}function openIOSOrders(){XPLAN.util.form_redirect(getBaseURL()+"/portfolio/iosorders/orderpad")}function openIOSOrderEntry(e){Dependency.addJS("xpt/portfolio/ios/orderentry",function(){XPLAN.ios.orderentry.init(),XPLAN.ios.orderentry.onOrderCreate=function(e,t){window.location=getBaseURL()+"/portfolio/iosorders/orderpad?from_order_entry=1&iosname="+e+"&iosaccount="+t},XPLAN.ios.orderentry.openIOSOrderEntry(e)})}function openIRESSCommand(e,t){var n="iress:cmd="+e;t.length>0&&(n=n+"&"+t),window.location=n}function fixIE10_getElementsByName(){10===XPLAN.util.getIEVersion()&&(document._getElementsByName=document.getElementsByName,document.getElementsByName=function(e){var t=[];return jQuery(document).find('[name="%s"]'.replace("%s",e)).each(function(){t.push(this)}),t})}var underscore=window._?_:null;jQuery.ajaxSetup({cache:!0});var XPLAN=window.XPLAN||{debugmode:!1,errormode:!1};XPLAN.test_language_util={tag_start:'<del xplan="">',tag_end:"</del >",tag_escape_start:"~",tag_escape_end:"~",test_language:!1,prepare_escape:function(e){if(!XPLAN.util.isString(e))return e;var t=e;return this.test_language&&(t=(t=t.replace(this.tag_start,this.tag_escape_start)).replace(this.tag_end,this.tag_escape_end)),t},translate:function(e){return this.test_language?this.tag_start+e+this.tag_end:e},set_test_lanuage:function(e){this.test_language=e,e&&(jQuery.fn.extend({text:function(e){return e=XPLAN.test_language_util.prepare_escape(e),jQuery.access(this,function(e){return void 0===e?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(e))},null,e,arguments.length)}}),window._confirm=window.confirm,window.confirm=function(e){return e=XPLAN.test_language_util.prepare_escape(e),window._confirm(e)},window._alert=window.alert,window.alert=function(e){return e=XPLAN.test_language_util.prepare_escape(e),window._alert(e)})}},XPLAN.namespace=function(e,t){var n,r=t?getMainFrame().XPLAN:XPLAN;for(n="XPLAN"==(e=e.split("."))[0]?1:0;n<e.length;n++)r=r[e[n]]=r[e[n]]||{};if(t){var i=XPLAN;for(n="XPLAN"==e[0]?1:0;n<e.length-1;n++)i=i[e[n]]=i[e[n]]||{};i[e[e.length-1]]=r}return r},XPLAN.require=XPLAN.namespace,XPLAN.onloadhidden=function(e){if(XPLAN.onloadhidden_loaded){if("undefined"!=typeof onHiddenFrameLoad){var t=jQuery(getFrameDoc(e.contentWindow).body).html();t&&"&nbsp;"!=t&&onHiddenFrameLoad(t)}}else XPLAN.onloadhidden_loaded=!0};var DUMMY_RESPONSE="SUCCESS",True=!0,False=!1;XplanFrameCache=function(){},XplanFrameCache.prototype._getStorage=function(){return window.sessionStorage?window.sessionStorage.getItem("__pre_20")||"<D></D>":getMainFrame().window.name},XplanFrameCache.prototype._setStorage=function(e){window.sessionStorage?window.sessionStorage.setItem("__pre_20",e):getMainFrame().window.name=e},XplanFrameCache.prototype._getCache=function(){if(!this.cache){var e=this._getStorage(),t="string"==typeof e&&"<D>"==e.substr(0,3);this.cache=t?XMLiser.loadXML(e):{}}return this.cache},XplanFrameCache.prototype._setCache=function(e){this.cache=e,this._setStorage(XMLiser.dumpXML(e))},XplanFrameCache.prototype.del=function(e){var t=this._getCache();delete t[e],this._setCache(t)},XplanFrameCache.prototype.set=function(e,t){var n=this._getCache();n[e]=t,this._setCache(n)},XplanFrameCache.prototype.get=function(e,t){var n=this._getCache();try{var r=n[e];return void 0===r&&(r=t),r}catch(e){return t}},XPLAN.cache=new XplanFrameCache,XPLAN.postToHiddenFrame=function(e,t){var n=getHiddenFrame();return XPLAN.postWithPageNav(e,t,n.name),n},XPLAN.postWithPageNav=function(e,t,n){var r=document.createElement("form");jQuery(r).attr({action:e,method:"POST",target:n||"_self",style:"display:none"}),jQuery.each(t,function(e,t){jQuery(r).append(jQuery(document.createElement("input")).attr({name:e,value:t}))}),jQuery("body").append(r),jQuery(r).submit(),jQuery(r).remove()},XPLAN.serveTabularCSV=function(e,t){var n=XPLAN.createCsvContent(t);XPLAN.serveFile(e,n)},XPLAN.createCsvContent=function(e){var t="";return e.forEach(function(e){t+='"'+e.join('","')+'"\n'}),jQuery.trim(t)},XPLAN.serveFile=function(e,t,n){if(n="undefined"!=typeof n?n:"text/csv",window.navigator.msSaveOrOpenBlob){var r=new Blob([t],{type:n});window.navigator.msSaveOrOpenBlob(r,e)}else{var i="data:"+n+";charset=utf-8,"+encodeURI(t),a=document.createElement("a");a.setAttribute("href",i),a.setAttribute("download",e),a.setAttribute("hidden","hidden"),XPLAN.util.isBrowser("chrome")?a.click():(document.body.appendChild(a),a.click(),document.body.removeChild(a))}},XPLAN.namespace("data"),XPLAN.namespace("event"),XPLAN.event.connect=function(e,t,n){return(e=$(e)).addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n),[e,t,n]},XPLAN.event.dispatch=function(e,t){if(document.createEvent){var n=e.ownerDocument.createEvent("HTMLEvents");n.initEvent(t,!1,!1),e.dispatchEvent(n)}else e.fireEvent&&e.fireEvent("on"+t)},XPLAN.event.disconnect=function(){var e;switch(arguments.length){case 1:if(!arguments[0].length)return!1;e=arguments[0];break;case 3:e=arguments;break;default:return!1}var t=$(e[0]),n=e[1],r=e[2];return t.removeEventListener?t.removeEventListener(n,r,!1):t.detachEvent("on"+n,r),!0},XPLAN.event.handlers={},XPLAN.event.listen=function(e,t,n){return n&&(XPLAN.event.handlers[e]=[]),XPLAN.event.handlers[e]||(XPLAN.event.handlers[e]=[]),XPLAN.event.handlers[e].push(t),t.senderId=XPLAN.util.get_guid(),t.senderId},XPLAN.event.send=function(e,t,n){if(XPLAN.event.handlers[e])for(var r=XPLAN.event.handlers[e],i=0;i<r.length;i++){var a=r[i];void 0!==n&&a.senderId===n||a(t)}},XPLAN.event.process=function(e){if(XPLAN.event.handlers[e]&&"DONE"!=XPLAN.event.handlers[e])for(var t=XPLAN.event.handlers[e],n=0;n<t.length;n++)t[n]();XPLAN.event.handlers[e]="DONE"},XPLAN.event.queue=function(e,t){return XPLAN.event.handlers[e]||(XPLAN.event.handlers[e]=[]),"DONE"==XPLAN.event.handlers[e]?(t(),!0):(XPLAN.event.handlers[e].push(t),!1)},XPLAN.namespace("json"),XPLAN.json.keyExists=function(e,t){t=t.split(".");for(var n=0;n<t.length;n++){var r=t[n];if(void 0===e[r])return!1;e=e[r]}return!0},XPLAN.json.decode=function(e){if(e instanceof Object)return e;try{return JSON.parse(e,XPLAN.json._reviver)}catch(e){return null}},XPLAN.json._reviver=function(e,t){if("undefined"==typeof t)return t=XPLAN.json._reviver_walk(this,e),void(this[e]=t);if(!(t instanceof Object&&"_type"in t))return t;switch(t._type){case"Date":return"Z"==(r=t._val.match(/(\d{4})-(\d{2})-(\d{2})(T(\d{2}):(\d{2}):(\d{2})(\.\d+|)(Z?)|)/))[9]?((n=new Date).setUTCFullYear(r[1],Number(r[2])-1,r[3]),r[4]?(n.setUTCHours(r[5],r[6],r[7],0),r[8]&&n.setUTCMilliseconds(1e3*Number(r[8]))):n.setUTCHours(12,0,0,0),n):r[4]?new Date(r[1],Number(r[2])-1,r[3],r[5],r[6],r[7],r[8]?1e3*Number(r[8]):0):new Date(r[1],Number(r[2])-1,r[3]);case"Time":var n,r=t._val.match(/(\d{2}):(\d{2}):(\d{2})(\.\d+|)/);return(n=new Date(0)).setUTCFullYear(-1),n.setHours(r[1],r[2],r[3],0),r[4]&&n.setMilliseconds(1e3*Number(r[4])),n;case"BigDecimal":case"Decimal":return new Decimal(t._val);case"Currency":return new XPLAN.MultiCurrency.Currency(t._val.code,t._val.value);case"Error":return Error(t._val);default:return t}},XPLAN.json._reviver_walk=function(e,t){var n,r,i=e[t];if(i&&"object"==typeof i)for(n in i)Object.hasOwnProperty.call(i,n)&&(void 0!==(r=XPLAN.json._reviver_walk(i,n))?i[n]=r:delete i[n]);return XPLAN.json._reviver.call(e,t,i)},XPLAN.json.encode=function(e){return JSON.stringify(e)},void 0===Date.prototype._orig_toJSON&&(Date.prototype._orig_toJSON=Date.prototype.toJSON,Date.prototype.toJSON=function(e){function t(e){return e<10?"0"+e:e}return{_type:"Date",_val:isFinite(this.valueOf())?(n=this.getFullYear(),"0000".slice((n+"").length)+n+"-"+t(this.getMonth()+1)+"-"+t(this.getDate())+"T"+t(this.getHours())+":"+t(this.getMinutes())+":"+t(this.getSeconds())):null};var n}),Error.toJSON=function(e){return{_type:"Error",_val:this.message}},XPLAN.namespace("util"),XPLAN.util.validate_form=function(e,t){var n={messages:{required:_("This field is required."),remote:_("Please fix this field."),email:_("Please enter a valid email address."),url:_("Please enter a valid URL."),date:_("Please enter a valid date."),dateISO:_("Please enter a valid date (ISO)."),number:_("Please enter a valid number."),digits:_("Please enter only digits."),creditcard:_("Please enter a valid credit card number."),equalTo:_("Please enter the same value again."),accept:_("Please enter a value with a valid extension."),maxlength:jQuery.validator.format(_("Please enter no more than {0} characters.")),minlength:jQuery.validator.format(_("Please enter at least {0} characters.")),rangelength:jQuery.validator.format(_("Please enter a value between {0} and {1} characters long.")),range:jQuery.validator.format(_("Please enter a value between {0} and {1}.")),max:jQuery.validator.format(_("Please enter a value less than or equal to {0}.")),min:jQuery.validator.format(_("Please enter a value greater than or equal to {0}."))}};jQuery.extend(!0,n,t),jQuery(e).validate(t)},XPLAN.util.getFunctionName=function(e){var t=e.toString();return t=(t=t.substr("function ".length)).substr(0,t.indexOf("("))},XPLAN.util.getBrowser=function(){return navigator.appVersion.search("Chrome")>=0?"chrome":navigator.appVersion.search("Safari")>=0?"safari":underscore.isNumber(XPLAN.util.getIEVersion())?"ie":"Netscape"==navigator.appName?"firefox":"unknown"},XPLAN.util.isBrowser=function(e){return XPLAN.util.getBrowser()===e},XPLAN.util.getIEVersion=function(){var e=navigator.userAgent.match(/MSIE (\d+\.\d+)/);if(null!==e&&2===e.length)return parseInt(e[1],10);var t=navigator.userAgent.match(/Trident\/7.*rv\:(\d+\.\d+)/);return null!==t&&2===t.length?parseInt(t[1],10):void 0},XPLAN.util.isIE8=function(){return 8===XPLAN.util.getIEVersion()},XPLAN.util.isAppleMobileDevice=function(){return/iphone/i.test(navigator.userAgent.toLowerCase())||/ipad/i.test(navigator.userAgent.toLowerCase())||/ipod/i.test(navigator.userAgent.toLowerCase())},XPLAN.util.stripIXNP=function(e){var t=new RegExp("^.+:f="),n={};for(var r in e)n[r.replace(t,"")]=e[r];return n},XPLAN.util.first=function(e,t,n){var r=n;if(XPLAN.util.isArray(e))for(var i=0;i<e.length;i++)if(t(e[i]))return e[i];return r},XPLAN.util.elem2value=function(e){var t=jQuery(e);if(t.length>1){var n=[];return t.each(function(){n.push(jQuery(this).val())}),n}return t.val()},XPLAN.util.object2elem=function(e,t,n){function r(e,t){void 0===t||null===t?t=[]:XPLAN.util.isArray(t)||(t=[t]),e.val(t)}var i=jQuery(e);if(n){var a={};i.find(":input").each(function(){var e=jQuery(this).attr("name");e&&(a[e]=e)})}underscore.each(t,function(e,t,o){var u=i.find(':input[name="'+t+'"]');if(u.length>0){if(u.filter(":radio,select,:checkbox").length<u.length&&XPLAN.util.isArray(e)){var s=[],l=[];underscore.each(e,function(e,t){var n=jQuery(u[t]);n.is(":radio,select,:checkbox")?(s.push(n),l.push(e)):r(n,e)}),u=jQuery(s),e=l}r(u,e),n&&delete a[t]}}),n&&underscore.each(a,function(e,t,n){var r=i.find(':input[name="'+t+'"]');r.each(function(){r.val([])})})},XPLAN.util.elem2object=function(e,t,n){var r,i=jQuery(e);n&&(r=i.find("input:disabled,select:disabled").removeAttr("disabled"));var a=i.find(":input").serialize();n&&r.attr("disabled","disabled"),a=XPLAN.util.decodeQS(a);var o=XPLAN.util.qs2object(a);if(void 0!==t&&t)for(var u in o)""===o[u]&&delete o[u];return o},XPLAN.util.elemChange=function(e,t){var n=jQuery(e);n.data("__elem_old_value",XPLAN.util.elem2object(n)),jQuery(n).on("change",function(r){var i={old_data:n.data("__elem_old_value"),data:XPLAN.util.elem2object(n),changed_field:r&&r.target&&r.target.name,elem:n},a=t(i);a&&(a.updated_data&&XPLAN.util.object2elem(e,a.updated_data),a.field_changed&&jQuery(':input[name="'+a.field_changed+'"]').change()),n.data("__elem_old_value",XPLAN.util.elem2object(n))})},XPLAN.util.elemShowHide=function(e,t){var n=jQuery(e),r=n.data("__elemShowHide_rules");r||(r={}),jQuery.extend(r,t),n.data("__elemShowHide_rules",r),XPLAN.util.elemChange(e,function(e){for(var t in r){jQuery('[data-xpt-fieldholder="'+t+'"]',n).toggle(r[t](e))}}),n.change()},XPLAN.util.decodeQS=function(e){var t,n;if(!e){if(!((t=(e=""+document.location.href).indexOf("?"))>=0))return{};e=e.substring(t+1)}e=(e=e.replace(/&amp;/g,"&")).replace(/\+/g," ");var r=[];for(t=0,n=0;t>=0&&(n=e.indexOf("=",t))>=0;){var i,a;i=e.substring(t,n),(t=e.indexOf("&",n))<0?a=e.substring(n+1):(a=e.substring(n+1,t),t++),r.push([decodeURIComponent(i),decodeURIComponent(a)])}return r},XPLAN.util.encodeQS=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n][0],i=e[n][1];if(i instanceof Array)for(var a=encodeURIComponent(e[n][0]),o=0;o<i.length;o++)t.push(a+"="+encodeURIComponent(i[o]));else t.push(encodeURIComponent(r)+"="+encodeURIComponent(i))}return t.join("&")},XPLAN.util.object2QS=function(e){var t=[];if(e)for(var n in e)t.push([n,e[n]]);return t},XPLAN.util.encodeObject=function(e){var t=XPLAN.util.object2QS(e);return XPLAN.util.encodeQS(t)},XPLAN.util.appendUrl=function(e,t){var n=e.search(/\?/)>=0?"&":"?";return XPLAN.util.endswith(e,"#")&&(e=e.substring(0,e.length-1)),e+n+t},XPLAN.util._unescape_xml=function(e){return e.replace(/&#(x?)([\da-f]+);/gi,function(e,t,n){return String.fromCharCode(parseInt(n,t?16:10))})},XPLAN.util._unescape_jsq=function(e){return e.replace(/\\x([\da-f]{2})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})},XPLAN.util._unescape_css=function(e){return e.replace(/\\([\da-f]+) /gi,function(e,t){return String.fromCharCode(parseInt(t,16))})},XPLAN.util.escape_modes={xml:{re:/[^\w\d\. \n]/g,pre:"&#x",post:";",unescaper:XPLAN.util._unescape_xml},xmlq:{re:/[^\w\d\.]/g,pre:"&#x",post:";",unescaper:XPLAN.util._unescape_xml},jsq:{re:/[^\w\d\.]/g,pre:"\\x",post:"",unescaper:XPLAN.util._unescape_jsq},css:{re:/[^\w\d]/g,pre:"\\",post:" ",unescaper:XPLAN.util._unescape_css},uri:{unescaper:decodeURI},url:{unescaper:decodeURI},query:{unescaper:decodeURIComponent},jquery:{re:/(:|\.|\[|\]|,|=|@|\+|>)/g}},XPLAN.util.escape=function(e,t){t=t||"xml","string"!=typeof e&&(e=""+e),t=t.split("+");for(var n=0;n<t.length;n++){var r=t[n],i=XPLAN.util.escape_modes[r];if(i&&void 0!==i.re)e="jquery"==r?e.replace(i.re,"\\$1"):(e=XPLAN.test_language_util.prepare_escape(e)).replace(i.re,function(e){var t=e.charCodeAt(0).toString(16);return 2==t.length?i.pre+t+i.post:1==t.length?i.pre+"0"+t+i.post:e});else if("url"==r||"uri"==r)e=encodeURI(e);else{if("query"!=r)throw new Error(_("Unknown escape type:")+" "+r);e=encodeURIComponent(e)}}return e},XPLAN.util.unescape=function(e,t){t=t||"xml","string"!=typeof e&&(e=""+e),t=t.split("+");for(var n=0;n<t.length;n++){var r=t[n],i=XPLAN.util.escape_modes[r];if(!i||void 0===i.unescaper)throw new Error(_("Un-escape mode '%a' is not supported.").replace("%a",r));e=i.unescaper(e)}return e},XPLAN.util.getMaxZIndex=function(){var e=100;return jQuery("body > *:visible, div.zindex-important:visible").each(function(){var t=jQuery(this),n=parseInt(t.css("z-index"),10);n&&n>e&&(e=n)}),e},XPLAN.util.getType=function(e){var t=typeof e;switch(t=t.toLowerCase()){case"number":return Math.round(e)==e?"int":"float";case"object":return null===e?"null":XPLAN.util.isArray(e)?"array":XPLAN.util.isDate(e)?"date":void 0!==window.Decimal&&e instanceof Decimal?"decimal":"object";default:return t}},XPLAN.util.getScroll=function(e){var t=e==window||e==document?self.pageYOffset||jQuery.boxModel&&document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop;return{l:e==window||e==document?self.pageXOffset||jQuery.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft:e.scrollLeft,t:t}},XPLAN.util.scrollPageToTop=function(){jQuery("html, body").prop("scrollTop","0px")},XPLAN.util.getXY=function(e){var t,n,r,i=!1;if(e.tagName)r={x:(t=jQuery(e).offset()).left,y:t.top},i=!0;else{if(void 0===e.pageX)throw"Unknown element "+e;r={x:e.pageX,y:e.pageY},e=e.target}for(n=getDocFrame(e.ownerDocument);n.frameElement;){var a=n.frameElement;t=jQuery(a).offset(),r.x+=t.left,r.y+=t.top;var o=jQuery(getFrameDoc(n));r.x-=o.scrollLeft()||0,r.y-=o.scrollTop()||0,i&&(r.x-=n.pageXOffset||0,r.y-=n.pageYOffset||0),n=getDocFrame(a.ownerDocument)}return r.x=Math.floor(r.x),r.y=Math.floor(r.y),r},XPLAN.util.inArray=function(e,t){for(var n=0;n<t.length;n++)if(e==t[n])return!0;return!1},XPLAN.util.isArray=function(e){return jQuery.isArray(e)},XPLAN.util.isDate=function(e){return e instanceof Date||e.getFullYear&&e.getMonth&&e.getDate},XPLAN.util.isTrue=function(e){switch(XPLAN.util.getType(e)){case"array":case"string":return e.length>0;case"object":for(var t in e)return!0;return!1;default:return e}},XPLAN.util.isString=function(e){return"string"==XPLAN.util.getType(e)},XPLAN.util.getStringInbetween=function(e,t,n){return e.substring(e.indexOf(t)+t.length,e.indexOf(n))},XPLAN.util.getInts=function(e,t){return XPLAN.util.isString(e)&&void 0!==t&&(e=e.split(t)),e=underscore.map(e,function(e){return parseInt(e,10)}),e=underscore.filter(e,function(e){return!isNaN(e)})},XPLAN.util.hasFeature=function(e){var t;try{t=getMainFrame()}catch(e){return!1}var n=t.XPLAN.util.session_features||{},r=n[e];return void 0===r&&(r=XMLRPC.callGET("today.hasFeature",[e]),n[e]=r,t.XPLAN.util.session_features=n),r},XPLAN.util.hasFeatures=function(e){var t;try{t=getMainFrame()}catch(e){return!1}var n=t.XPLAN.util.session_features||{},r=underscore.difference(e,underscore.keys(n)),i=XMLRPC.callGET("today.hasFeatures",[r]);return jQuery.each(i,function(e,t){n[e]=t}),t.XPLAN.util.session_features=n,n},XPLAN.util.isCapable=function(e){var t;try{t=getMainFrame()}catch(e){return!1}if(t){var n=t.XPLAN.util.capabilities;if(n||(n=t.XPLAN.util.capabilities=XMLRPC.callGET("today.getCapabilities",[])),n&&n[e])return!0}return!1},XPLAN.util.SECTOR_MGT_TYPE_GICS=1,XPLAN.util.SECTOR_MGT_TYPE_FTSE=2,XPLAN.util.get_sector_type_title=function(e){var t;try{t=getMainFrame()}catch(e){return!1}if(t){var n=t.XPLAN.util.sector_type_titles;if(n||(n=t.XPLAN.util.sector_type_titles=XMLRPC.callGET("portfolio.get_sector_type_titles",[])),n&&e in n&&void 0!==n[e])return n[e]}return _("Undefined")},XPLAN.util.isRole=function(e){return getMainFrame().XPLAN.login_role==e},XPLAN.util.isLogin=function(){var e=getMainFrame();return!(!e||!e.XPLAN.login_role)},XPLAN.util.onCapabilitiesLoaded=function(e){var t;try{t=getMainFrame()}catch(e){return}t&&(t.XPLAN.util.capabilities?e():XMLRPC.callGET("today.getCapabilities",[],function(n){t.XPLAN.util.capabilities=n,e()}))},XPLAN.util.object2qs=function(e){var t=[];for(var n in e){var r=e[n];if(XPLAN.util.isArray(r))for(var i=0;i<r.length;i++)t.push([n,r[i]]);else t.push([n,r])}return t},XPLAN.util.parseXML=function(e){var t;document.all?((t=new ActiveXObject("Microsoft.XMLDOM")).async=!1,t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml");return t},XPLAN.util.qs2object=function(e){for(var t={},n=0;n<e.length;n++){var r=e[n][0],i=e[n][1];if(void 0!==t[r]){var a=t[r];XPLAN.util.isArray(a)?a.push(i):t[r]=[a,i]}else t[r]=i}return t},XPLAN.util.setdefault=function(e){null!==e&&void 0!==e||(e={});for(var t=1;t<arguments.length;t++){var n=arguments[t];if(void 0!==n&&null!==n)for(var r in n)void 0===e[r]&&(e[r]=n[r])}return e},XPLAN.util.update=function(e){null!==e&&void 0!==e||(e={});for(var t=1;t<arguments.length;t++){var n=arguments[t];if("undefined"!=typeof n&&null!==n)for(var r in n)e[r]=n[r]}return e},XPLAN.util.alertAndThrow=function(e){throw("string"==typeof e||"object"==typeof e&&e instanceof String)&&(e=new Error(e)),alert(e.message),e},XPLAN.util.showObject=function(e,t){var n="";for(var r in e)n+=r+":",t&&(n+=""+e[r]),n+="\n";return n},XPLAN.util.trim=function(e){return e.replace(/^\s+|\s+$/g,"")},XPLAN.util.startswith=function(e,t){return e.match("^"+t)==t},XPLAN.util.endswith=function(e,t){return e.match(t+"$")==t},XPLAN.util.get_row_class=function(e){return e%2==0?"item_even":"item_odd"},XPLAN.util.resolveCSSExt=function(e){return e.match(/[.](css|less)$/)?(e.match(/[.]less$/)&&!XPLAN.dont_compact_js&&(e=e.replace(/[.]less$/,".css")),e):e+".css"},XPLAN.util.resolveJSName=function(e){return e.match(/ckeditor\/ckeditor(.js|)$/)&&(window.CKEDITOR_BASEPATH=getBaseURL()+"/js/lib/ckeditor/"),e},XPLAN.util.cssLoaded=[],XPLAN.util.loadCSS=function(e){var t=(e=XPLAN.util.resolveCSSExt(e)).match(/[.]less$/);if(void 0===XPLAN.util.cssLoaded[e]){XPLAN.util.cssLoaded[e]=!0;var n=document.createElement("link");if(n.type="text/css",n.rel=t?"stylesheet/less":"stylesheet",n.href=getBaseURL()+e,t)window.less||(window.less={env:"development"}),Dependency.addJS("lib/less",function(){less.sheets.push(n),less.refresh()});else{var r=document.getElementsByTagName("head");(r=r.length>0?r[0]:document.documentElement.firstChild).appendChild(n)}XPLAN.util.cssLoaded[e]=!0;var i=getMainFrame();i&&i!=window&&i.XPLAN&&i.XPLAN.util&&i.XPLAN.util.loadCSS&&i.XPLAN.util.loadCSS(e)}},XPLAN.util.scriptLoaded={},XPLAN.util.loadScript=function(e,t){var n=jQuery.Deferred();e=XPLAN.util.resolveJSName(e);var r=XPLAN.util.scriptLoaded[e];if(void 0!==r)null!==r.onload?(t&&r.onload.push(t),r.onload.push(n.resolve)):(t&&t(),n.resolve());else{r=XPLAN.util.scriptLoaded[e]={loaded:!1,onload:[]},t&&r.onload.push(t),r.onload.push(n.resolve);var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.onload=function(){XPLAN.util.onScriptLoaded(e)},i.src=getBaseURL()+e;var a=document.getElementsByTagName("script");a.length>0?a[0].parentNode.insertBefore(i,a[0]):document.documentElement.firstChild.appendChild(i)}return n},XPLAN.util.onScriptLoaded=function(e){var t=XPLAN.util.scriptLoaded[e];for(var n in t&&(t.loaded=!0),XPLAN.util.scriptLoaded)if(!0!==XPLAN.util.scriptLoaded[n].loaded)return;var r=[];for(var n in XPLAN.util.scriptLoaded){null!==(t=XPLAN.util.scriptLoaded[n]).onload&&r.push.apply(r,t.onload),t.onload=null}for(var i=0;i<r.length;++i)r[i]()},XPLAN.util.deviceSpecificDownload=function(e){XPLAN.util.isAppleMobileDevice()?XPLAN.util.download(e):getHiddenFrame(e)},XPLAN.namespace("help"),XPLAN.help.index="",XPLAN.help.setHelp=function(e){XPLAN.help.index=e[0];var t=getMainFrame();if(t){var n=getFrameDoc(t).getElementById("helpimg");n&&(n.style.display=e[1]?"inline":"none")}},XPLAN.help.show=function(e){e.preventDefault();var t=XPLAN.help.index;if(!t){var n=""+getMainFrame().location.href,r=n.split("framemain");if(2==r.length)n=r[1];else{if(1!=r.length)return;2==(r=n.split("//")).length&&(n=r[1].substring(r[1].indexOf("/"),r[1].length))}(r=n.split("?")).length>1&&(n=r[0]),(r=n.split(getBaseURL())).length>1&&(n=r[1]),t=n}window.open(getBaseURL()+"/help/_check?index="+encodeURIComponent(t),"xplan_help","toolbar=no,scrollbars=yes,resizable=yes,top=0,height=420,width=600,left="+(window.screen?screen.availWidth-615:0)).focus()},XMLiser={},XMLiser.isTime=function(e){return 1970===e.getFullYear()&&0===e.getMonth()&&1===e.getDate()},XMLiser.isDate=function(e){return!XMLiser.isTime(e)&&0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds()},XMLiser.dumpTime=function(e){return e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()},XMLiser.dumpDate=function(e){return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()},XMLiser.dumpXML=function(e){var t,n,r=XPLAN.util.getType(e),i=r;switch(r){case"array":for(n=[],t=0;t<e.length;t++)n.push(XMLiser.dumpXML(e[t]));i="L",e=n.join("");break;case"boolean":i="b",e=e?"1":"0";break;case"object":for(t in n=[],e)n.push(XMLiser.dumpXML(t)),n.push(XMLiser.dumpXML(e[t]));i="D",e=n.join("");break;case"date":XMLiser.isTime(e)?(i="Time",e=XMLiser.dumpTime(e)):XMLiser.isDate(e)?(i="Date",e=XMLiser.dumpDate(e)):(i="DateTime",e=XMLiser.dumpDate(e)+" "+XMLiser.dumpTime(e));break;case"float":i="f";break;case"int":i="i";break;case"string":i="s",e=XPLAN.util.escape(e,"xml");break;case"null":case"undefined":i="n",e="";break;default:throw new Error(_("Invalid data type for XMLiser:")+" "+r)}return"<"+i+">"+e+"</"+i+">"},XMLiser.loadXML=function(e){var t=XPLAN.util.parseXML(e);return XMLiser.loadXMLElement(t.documentElement)},XMLiser.zeroParseInt=function(e){for(;e.length>0&&"0"==e.charAt(0);)e=e.substr(1,e.length);return e?parseInt(e,10):0},XMLiser.parseTime=function(e){var t=new Date;if(e){var n=e.split(":");t.setHours(XMLiser.zeroParseInt(n[0])),t.setMinutes(XMLiser.zeroParseInt(n[1])),t.setSeconds(XMLiser.zeroParseInt(n[2])),t.setMilliseconds(0)}return t},XMLiser.parseDate=function(e){var t=new Date;if(e){var n=e.split("-");t.setFullYear(XMLiser.zeroParseInt(n[0])),t.setMonth(XMLiser.zeroParseInt(n[1])-1),t.setDate(XMLiser.zeroParseInt(n[2]))}return t},XMLiser.parseDateTime=function(e){var t=new Date;if(t.setFullYear(1970),t.setMonth(0),t.setDate(1),e){var n=e.split(" ");if(n.length>=1&&(t=XMLiser.parseDate(n[0])),2==n.length){var r=XMLiser.parseTime(n[1]);t.setHours(r.getHours()),t.setMinutes(r.getMinutes()),t.setSeconds(r.getSeconds()),t.setMilliseconds(r.getMilliseconds())}}return t},XMLiser.loadXMLElement=function(e){var t,n;switch(e.tagName){case"b":return t=parseInt(e.firstChild.data,10),isNaN(t)?"true"==e.firstChild.data:0!==t;case"s":case"u":return e.firstChild?e.firstChild.data:"";case"d":case"f":return e.firstChild?parseFloat(e.firstChild.data):0;case"i":return e.firstChild?parseInt(e.firstChild.data,10):0;case"L":for(n=[],t=e.firstChild;t;)n.push(XMLiser.loadXMLElement(t)),t=t.nextSibling;return n;case"D":n={};for(var r=e.firstChild;r;){var i=XMLiser.loadXMLElement(r);(r=r.nextSibling)&&(t=XMLiser.loadXMLElement(r),n[i]=t,r=r.nextSibling)}return n;case"n":return null;case"DateTime":return XMLiser.parseDateTime(e.firstChild?e.firstChild.data:"");case"Date":return XMLiser.parseDate(e.firstChild?e.firstChild.data:"");case"Time":return XMLiser.parseTime(e.firstChild?e.firstChild.data:"");case"Currency":var a=XMLiser.loadXMLElement(e.firstChild),o=XMLiser.loadXMLElement(e.firstChild.nextSibling);return new XPLAN.MultiCurrency.Currency(a,o);default:return!1}},function(){var e={reference_count:0,eggtimer_id:"xplan_eggtimer",eggtimer_model_id:"xplan_eggtimer_modal",hide:function(e,t){if(getMainFrame().EggTimer.globalReferenceCount&&getMainFrame().EggTimer.globalReferenceCount--,t&&this.reference_count--,!t||this.reference_count<=0){var n=e||getFrameDoc(getMainFrame());jQuery("#"+this.eggtimer_id,n).hide(),jQuery("#"+this.eggtimer_model_id,n).hide()}},options:{positionElement:null,position:"center",height:null,width:null,timeout:null,modal:!1,html:null,doc:null,addClass:null},show:function(e,t){if(null===e||void 0===e)e=this.options;else for(var n in this.options)n in e&&(this.options[n]=e[n]);var r=e.doc||getFrameDoc(getMainFrame()),i=e.doc?jQuery:getMainFrame().jQuery;if(this.options.modal){var a=i("#"+this.eggtimer_model_id,r.body);a.length||(a=i('<div id="'+this.eggtimer_model_id+'" class="xplan_eggtimer_modal modaloverlay">&nbsp;</div>').appendTo(r.body)),a.show()}var o=i("#"+this.eggtimer_id,r),u=this.options.html?this.options.html:"<b>"+XPLAN.util.escape(_("Loading"))+"</b>";if(o.length)o.html(u);else try{o=i('<div id="'+this.eggtimer_id+'" class="xplan_eggtimer" style="display: none;">'+u+"</div>").appendTo(r.body)}catch(e){(o=r.createElement("div")).id=this.eggtimer_id,(o=i("#"+this.eggtimer_id,r)).css("display","none"),o.html(u)}var s=[],l=this.options.position;null!==this.options.positionElement?(elem=i(this.options.positionElement),"center"==l?(s[0]=elem.offset().top+(elem.outerHeight()/2-o.outerHeight()/2)-i(window).scrollTop(),s[1]=elem.offset().left+(elem.outerWidth()/2-o.outerWidth()/2)):(s[0]=elem.offset().top+l[0],s[1]=elem.offset().left+l[1])):"center"!=l&&(s=l),s.length>1&&(o.css("top",s[0]),o.css("left",s[1])),this.options.addClass&&o.addClass(this.options.addClass),this.options.height&&o.css("height",this.options.height),this.options.width&&o.css("width",this.options.width),this.options.timeout&&setTimeout(this.hide,this.options.timeout),t&&(this.reference_count=(this.reference_count||0)+1),o.show(),getMainFrame().EggTimer.globalReferenceCount=(getMainFrame().EggTimer.globalReferenceCount||0)+1},getNewTimer:function(t){void 0===t&&(t=XPLAN.util.get_html_random_id());var n={};return jQuery.extend(!0,n,e),n.eggtimer_id=t,n.eggtimer_model_id=t+"_modal",n}};window.jQuery?window.EggTimer=e.getNewTimer("xplan_eggtimer"):window.EggTimer=e}(),window.Dependency||(Dependency={}),underscore.defaults(Dependency,{_js:{},_css:{},_css_root:"/css/",_deferred_pool:[]}),Dependency.addCSS=function(e){if(e=XPLAN.util.resolveCSSExt(e),!Dependency._css[e]){Dependency._css[e]=!0;var t=Dependency._css_root+e;0!==jQuery('link[href^="'+getBaseURL()+t+'"]').length||XPLAN.util.loadCSS(t)}},Dependency._js_root="/js/",Dependency.addJS=function(e,t){if(e=XPLAN.util.resolveJSName(e),!Dependency._js[e]){Dependency._js[e]=!0;var n=Dependency._js_root+e+".js";if(0===jQuery('script[src^="'+getBaseURL()+n+'"]').length){var r=XPLAN.util.loadScript(n,t);return void Dependency._deferred_pool.push(r)}}t&&t()},Dependency._callback_stack=[],Dependency.load_dependencies=function(e){var t=jQuery.when.apply(jQuery,Dependency._deferred_pool);null!=e&&(Dependency._callback_stack.push(e),t.then(function(){for(;Dependency._callback_stack.length;)Dependency._callback_stack.shift()()}))},Dependency.registerJS=function(e){Dependency._js[e]=!0},Dependency.addJQueryPlugin=function(e,t){Dependency.addJS("lib/jquery/plugins/"+e+"/jquery."+e),t&&Dependency.addCSS("jquery/plugins/"+e+"/jquery."+e)},Dependency.addTemplate=function(e){XPLAN.debugmode||Dependency.addJS("tpl_bank/ejs/"+e)},XPLAN.util.log=function(e){if(XPLAN.debugmode){var t=window.console&&console.log?console.log:function(e){window.status=e};try{t(e)}catch(e){}}},XPLAN.util.openWindow=function(e,t){var n=window.open.apply(window,e);null!==n?t(n):alert(_("Unable to open a popup. Please ensure popup is allowed for this browser."))},XPLAN.util.download=function(e){window.open(e,"download","height=580,width=800,heading=no,topbar=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,border=no")},XPLAN.util.pretty_print=function(e,t,n){if(n=n||[],null===e||void 0===e)return"null";t=t||"";Boolean,Date,Function,Math,Number,RegExp,Error,String;var r=0;try{switch(typeof e){case"object":for(r=0;r<n.length;r++)if(e==n[r])return"circular reference...";var i,a,o;if(e instanceof Array){for((i=n.slice()).push(e),a=t+"    ",o=[],r=0;r<e.length;r++)try{o.push(XPLAN.util.pretty_print(e[r],a,i))}catch(e){o.push(_("ERROR, unable to pretty print this data"))}return"[\n"+a+o.join(",\n"+a)+"\n"+t+"]"}if(e instanceof Boolean)return e.toString();if(e instanceof Date)return e.toString();if(e instanceof Function)return e.toString();if(e instanceof Number)return e.toString();if(e instanceof RegExp)return e.toString();if(e instanceof Error)return e.toString();if(e instanceof String)return e.toString();if(e instanceof Decimal)return e.toString();for(r in(i=n.slice()).push(e),a=t+"    ",o=[],e)try{o.push(r+" : "+XPLAN.util.pretty_print(e[r],a,i))}catch(e){o.push(r+" : "+_("ERROR, unable to pretty print this data"))}return"{\n"+a+o.join(",\n"+a)+"\n"+t+"}";case"undefined":return"undefined";default:return e.toString()}}catch(e){return _("ERROR, unable to pretty print this data")}},XPLAN.util.fix_iframe_scrolling_for_ipad=function(){navigator.userAgent.match(/ipad/i)&&jQuery(function(){if(window!=window.parent){var e=parent.document.getElementById("mf-page");if(e){var t=jQuery(e).height();jQuery("#pagecontent").css({"max-height":t,overflow:"auto","-webkit-overflow-scrolling":"touch"})}}})};try{jQuery&&jQuery.fn.extend({getXY:function(){return this.length?XPLAN.util.getXY(this.get(0)):null},center:function(){return this.css("position","absolute"),this.css("top",(jQuery(window).height()-this.outerHeight())/2+jQuery(window).scrollTop()+"px"),this.css("left",(jQuery(window).width()-this.outerWidth())/2+jQuery(window).scrollLeft()+"px"),this},centerOn:function(e){var t=e.offset();return this.css("position","absolute"),this.css("top",(jQuery(e).outerHeight()-this.outerHeight())/2+t.top+"px"),this.css("left",(jQuery(e).outerWidth()-this.outerWidth())/2+t.left+"px"),this},displayOver:function(e){var t=e.offset();return this.css("position","absolute"),this.css("top",t.top+"px"),this.css("left",t.left+"px"),this.css("width",e.outerWidth()+"px"),this.css("height",e.outerHeight()+"px"),this},validateChart:function(e){var t=this.attr("data");return new HttpRequest(t).doGET("").indexOf(e)>=0}})}catch(e){}XPLAN.addjQueryUIDialogButtonPlugin=function(){try{if(jQuery.ui&&jQuery.ui.dialog&&void 0===jQuery.ui.dialog.prototype._original_createButtons)try{jQuery.fn.extend(jQuery.ui.dialog.prototype,{_original_createButtons:jQuery.ui.dialog.prototype._createButtons,_createButtons:function(e){this._original_createButtons(e);for(var t=0;t<jQuery(".ui-dialog-buttonpane button").length;t++){var n=jQuery(jQuery(".ui-dialog-buttonpane button > span")[t]).text();"^"==n.substring(0,1)&&(jQuery(jQuery(".ui-dialog-buttonpane button > span")[t]).text(n.substring(1)),jQuery(".ui-dialog-buttonpane button")[t].className="primary")}}})}catch(e){}}catch(e){}},XPLAN.addjQueryUIDialogButtonPlugin();try{(XPLAN.util.getIEVersion()<9||!this.JSON)&&Dependency.addJS("json2")}catch(e){}XPLAN.util.update_select_all_checkbox=function(e,t,n){try{t||(t=e+"_all"),n||(n=document);var r=jQuery(n),i=r.find('input[name="'+e+'"][type="checkbox"]'),a=r.find('input[name="'+e+'"][type="checkbox"]:checked'),o=a.length,u=r.find('input[id="'+t+'"][type="checkbox"]');o==i.length?u.prop("checked",!0):u.prop("checked",!1);var s=jQuery.map(a,function(e){return e.value});r.trigger("xevent_OnCheckboxSelect",{values:s,name:e})}catch(e){}},XPLAN.util.toggle_all_checkboxes=function(e,t,n){n||(n=document);var r=jQuery(n),i=r.find('input[name="'+t+'"][type="checkbox"]:visible'),a=0;i.each(function(){this.checked&&(a+=1)});var o=a===i.length;i.prop("checked",!o),i.trigger("toggle_content");var u=r.find('input[name="'+t+'"][type="checkbox"]:checked'),s=jQuery.map(u,function(e){return e.value});r.trigger("xevent_OnSelectAllCheckboxes",{values:s,name:t})},XPLAN.util.compare_array=function(e,t){if(e.length!=t.length)return!1;for(var n=e.sort(),r=t.sort(),i=0;t[i];i++)if(n[i]!==r[i])return!1;return!0},XPLAN.util.fix_dialog_auto_width=function(e,t){var n=jQuery(window).width()-50;(e=jQuery(e)).outerWidth(!0)>n?(e.dialog("option","width",n),e.css("overflow","auto")):"auto"!==e.dialog("option","width")&&e.dialog("option","width","auto"),e.dialog("option","position",e.dialog("option","position"))},XPLAN.util.appendOrFindDiv=function(e){return jQuery("#"+e).length||jQuery("body").append(jQuery("<div id='"+e+"' />")),jQuery("#"+e)},XPLAN.util.replace_url_params=function(e,t){var n=function(e,n,r){var i=t[e];return i?(r&&(i=i[r]),i||n):n},r=XPLAN.util.get_qs_from_url(e);if(!r)return e;var i=r.qs,a=[];for(var o in i){var u=i[o],s=u[1],l=u[0];if("[]"==l.slice(-2)){f=[];for(var c=0;c<s.length;c++){var d=n(l,s[c],c);f.push(d)}a.push([l,f])}else{var f=n(l,s);a.push([l,f])}}return"".concat(r.base,"?",XPLAN.util.encodeQS(a))},XPLAN.util.get_qs_from_url=function(e){var t;if((t=e.indexOf("?")+1)>=1){var n,r=e.substring(0,t-1),i=e.substring(t);return(n=i.indexOf("#"))>=1&&(r+=i.substring(n),i=i.substring(0,n)),{base:r,qs:XPLAN.util.decodeQS(i)}}return!1},XPLAN.util.form_submit=function(e){var t=[];e.fields&&(t=[].concat(e.fields));var n=jQuery.extend({method:"get",target:"_self"},e.form_options);if(void 0===n.action)throw _("Action not specified");var r,i,a=XPLAN.util.get_qs_from_url(n.action);for(var o in!1!==a&&(t=[].concat(t,a.qs),n.action=a.base),void 0===(r=XPLAN.util.form_submit.form)?(r=jQuery("<form />").appendTo(jQuery("body")),XPLAN.util.form_submit.form=r):r.html(""),n)r.attr(o,n[o]);for(var u in t){var s=t[u],l=s[1];if(void 0!==l&&!1!==l&&null!==l&&l!==Number.NaN)if("[]"==s[0].slice(-2))for(var c=0;c<s[1].length;c++)i=jQuery('<input type="hidden" />').attr("name",s[0]).val(l[c]),r.append(i);else i=jQuery('<input type="hidden" />').attr("name",s[0]).val(l),r.append(i)}return r.submit(),r},XPLAN.util.form_redirect=function(e,t){var n={form_options:{action:e}};t&&(n=jQuery.extend(!0,n,t)),XPLAN.util.form_submit(n)},XPLAN.util.reload=function(){XPLAN.util.form_redirect(window.location.href)},XPLAN.util.reload_iframe=function(e,t){jQuery('iframe[name="'+e+'"]').each(function(){t=t||jQuery(this).attr("src"),jQuery(this).attr("src",t)})},XPLAN.util.get_html_random_id=function(){return"a"+parseInt(1e10*Math.random(),10)},XPLAN.util.get_guid=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},XPLAN.util.getWindowEvent=function(e,t){var n=t||window.event;return e&&(n=jQuery.event.fix(n)),n},XPLAN.util.serializeForm=function(e){var t=jQuery(e).serializeArray(),n={};return jQuery.map(t,function(e,t){n[e.name]=e.value}),n},XPLAN.util.capitalize=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e},XPLAN.util.lookup_function=function(e){var t=window;ns=e.split(".");for(var n=0;n<ns.length&&void 0!==(t=t[ns[n]]||void 0);n++);return t},XPLAN.util.top_frame=null,XPLAN.util.get_top_frame=function(){if(null!==XPLAN.util.top_frame)return XPLAN.util.top_frame;for(var e=function(e){return"xplan_mainframe"===e.name||void 0!==e.Cypress},t=window;t.parent&&t.parent!=t&&!e(t);)t=t.parent;return XPLAN.util.top_frame=t,t},XPLAN.util.get_top_frame_target=function(){var e=XPLAN.util.get_top_frame();return window.top==e?"_top":e.name},XPLAN.util.change_top_url=function(e,t){if(!t){var n="/"==e.charAt(0)?"":"/";e=getBaseURL()+n+e}XPLAN.util.get_top_frame().location.href=e},XPLAN.util.notify_report_generated_background=function(){PopupMsgBox.show_bgtask_notification()},XPLAN.util.adjustContainerDivZIndex=function(e){if(void 0!==e){var t=underscore,n=jQuery,r=t.max(n(e).find("div").map(function(){var e=parseInt(n(this).css("z-index"),10);return isNaN(e)?0:e}).get());t.each(n(e),function(e){-1===t.indexOf(["relative","absolute","fixed"],n(e).css("position"))&&n(e).css("position","relative");var i=parseInt(n(e).css("z-index"),10);(isNaN(i)||i<r)&&n(e).css("z-index",r)})}},XPLAN.util.getURL=function(e,t,n){if(t&&!jQuery.isEmptyObject(t)){var r=e.split("?"),i=r[0],a={};r[1]&&(a=XPLAN.util.qs2object(XPLAN.util.decodeQS(r[1]))),XPLAN.util.update(a,t),(t=XPLAN.util.encodeQS(XPLAN.util.object2qs(a)))&&(e=XPLAN.util.appendUrl(i,t))}if(n){var o=getBaseURL();o&&XPLAN.util.startswith(e,o)||(e=o.replace(/\/$/,"")+"/"+e.replace(/^\//,""))}return e},XPLAN.util.getXPLANRelativeURL=function(e,t){var n=window.location.protocol+"//"+window.location.host,r=getBaseURL(),i=t?n.length:n.length+r.length;return XPLAN.util.startswith(e,n+r)?e.substring(i):e},fixIE10_getElementsByName(),XPLAN.namespace("attach"),XPLAN.attach.download=function(e,t){var n=getBaseURL()+"/attach/download/"+e+"/"+t;XPLAN.util.deviceSpecificDownload(n)},XPLAN.attach.download_docpart=function(e,t,n){var r=getBaseURL()+"/docnote/files/"+e+"/"+t+"?download=1";XPLAN.util.deviceSpecificDownload(r)},XPLAN.attach.download_multi=function(e){var t="",n=XPLAN.util.isArray(e),r=XPLAN.util.isString(e);if(n||r)if(n){if(e.length>0){for(var i=[],a=0;a<e.length;a++){var o=e[a];i.push(["i",o[0]]),i.push(["v",o[1]])}t=XPLAN.util.encodeQS(i)}}else t=e;if(t){var u=getBaseURL()+"/attach/download_multi?"+t;XPLAN.util.deviceSpecificDownload(u)}},XPLAN.util.isTextNode=function(){return 3===this.nodeType},XPLAN.util.countCSSRules=function(){function e(t){var n=0;if(t&&t.cssRules){for(var r=0,i=t.cssRules.length;r<i;r++){var a=t.cssRules[r];a instanceof CSSImportRule&&e(a.styleSheet),a.selectorText&&(n+=a.selectorText.split(",").length)}"\nFile: "+(t.href?t.href:"inline <style> tag"),"\nRules: "+t.cssRules.length,"\nSelectors: "+n,"\n--------------------------",n>=4096&&"\n********************************\nWARNING:\n There are "+n+" CSS rules in the stylesheet "+t.href+" - IE9 will ignore the last "+(n-4096)+" rules!\n"}}if(document.styleSheets){"\nTotal: "+document.styleSheets.length+" imported files","\n--------------------------";for(var t=0;t<document.styleSheets.length;t++)e(document.styleSheets[t])}},String.prototype.includes||(String.prototype.includes=function(e,t){"use strict";return"number"!=typeof t&&(t=0),!(t+e.length>this.length)&&-1!==this.indexOf(e,t)}),Math.trunc=Math.trunc||function(e){return isNaN(e)?NaN:e>0?Math.floor(e):Math.ceil(e)},String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.indexOf(e,t)===t}),XPLAN.util.is_positive_integer=function(e){return!isNaN(parseInt(e,10))&&Number(e)%1==0&&Number(e)>0},XPLAN.util.get_tab_index_by_href=function(e,t){return jQuery("a.ui-tabs-anchor",e).index(jQuery("a.ui-tabs-anchor",e).filter("[href='#"+t+"']"))},XPLAN.util.activate_tab_by_href=function(e,t){var n=XPLAN.util.get_tab_index_by_href(e,t);e.tabs("option","active",n)},XPLAN.util.open_iassist=function(){jQuery('div[id^="tokenticket_"]').xplan_tokenticket("show_dialog")},XPLAN.util.open_video_meeting_dialog=function(e){jQuery('div[data-xplan-elem="xplan_videomeeting"]').xplan_videomeeting("show_dialog",e)},XPLAN.util.focusWhenVisible=function(e,t,n){var r=jQuery(e);r.length>0&&t>0&&(r.is(":hidden")?setTimeout(function(){XPLAN.util.focusWhenVisible(e,t-1,n)},n):r.focus().select())},XPLAN.util.detectCDNAvailability=function(e,t,n){try{new HttpRequest(e).doHEAD(function(){},function(e){const r=e.stack||"";setTimeout(function(){new HttpRequest(t).doHEAD(function(){},function(e){const t=e.stack||"";!function(e,t){var n=getBaseURL()+"/resourceful/logging/app",r={entries:[{level:40,name:"apex.cdn",payload:{metaData:{value:e,bundleValue:t},name:"client_error",value:1,type:"counter"},timestamp:(new Date).getTime()}]};jQuery.ajax({url:n,type:"POST",contentType:"application/json",data:JSON.stringify(r)})}(r,t)})},n)})}catch(e){}},XPLAN.util.getTabIndexById=function(e,t){for(var n=jQuery("#"+e).find("a"),r=0;r<n.length;r++)if("#"+t===jQuery(n[r]).attr("href"))return r;return 0};
;Dependency._js['main']=true;

;
"undefined"!=typeof Dependency&&Dependency.addJS&&(Dependency.addJS("main"),Dependency.addJS("lib/backbone/underscore"),Dependency.addJS("lib/backbone/backbone")),function(){var e=XPLAN.namespace("backbone_sync");e.replace_backbone_sync=function(){e.original_backbone_sync=Backbone.sync,Backbone.sync=function(a,t,o){if((o=underscore.clone(o||{})).converters={"text json":function(e){return XPLAN.json.decode(e)}},null!=o.data||!t||"create"!==a&&"update"!==a&&"patch"!==a){if(!(a in n)||"application/json"===o.contentType){var c=n[a]||a;o.type="POST",o.url=underscore.result(t,"url")+"/?_method=%a".replace("%a",encodeURIComponent(c)),o.contentType="application/json",a=null}}else o.contentType="application/json",o.data=o.attrs?o.attrs:underscore.isFunction(t.get_save_data)?t.get_save_data(o):t.toJSON(o),o.extra_json_data&&underscore.extend(o.data,o.extra_json_data);var r,d;"application/json"===o.contentType&&(o.data=XPLAN.json.encode(o.data)),"read"!==a||o.dont_flatten||o.data&&!underscore.isString(o.data)&&(o.data=(r=o.data,(d=function(e,n){var a={};return underscore.isString(n)||underscore.isNumber(n)||underscore.isBoolean(n)?a[e]=n:n instanceof Date?a[e]=n.toJSON()._val:n instanceof Decimal?a[e]=n.toString():underscore.each(n,function(n,t){underscore.extend(a,d(e?e+"."+t:""+t,n))}),a})("",r)));var s,i=e.original_backbone_sync(a,t,o);(void 0===o.show_egg_timer||o.show_egg_timer)&&(EggTimer.show(null,!0),i.always?s=underscore.bind(i.always,i):i.finally&&(s=underscore.bind(i.finally,i)),s&&s(function(){EggTimer.hide(null,!0)}));return i}},e.replace_backbone_sync();var n={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"}}();
;Dependency._js['backbone_sync']=true;

;
XPLAN.currentLanguage="en_AU";XPLAN.TRAN||(XPLAN.TRAN={});XPLAN.PLURAL_EXPR="(n != 1)";window._=function(a){a=a.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ");return XPLAN.TRAN[a]||a};window.ngettext=function(a,d,e,c){a=a.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ");var b=XPLAN.TRAN[a];b?(a=eval(XPLAN.PLURAL_EXPR.replace("n",c))+0,b=b[a]):b=1==c?a:d;return b.replace(e,c)};

;Dependency._js['lang/en_AU']=true;

;
XPLAN.Model={factory:{createClass:function(e){void 0===e&&(e={parentClass:XPLAN.Model.Model}),e.parentClass||(e.parentClass=XPLAN.Model.Model),e.registryName&&!e.factoryRootClass&&(e.factoryRootClass=e.parentClass);var t=e.parentClass.extend(e.properties,e.classProperties);return e.registryName&&(e.factoryRootClass.getClass||jQuery.extend(e.factoryRootClass,this._registerClass()),e.factoryRootClass.registerClass(e.registryName,t)),t},_registerClass:function(){return{_cache:{},getClass:function(e){var t=this._cache[e];return void 0===t&&(t=this),t},getInstance:function(e,t,s){var r=this.getClass(e);if(s){var a=new r;return jQuery.extend(a,t),a}return new r(t)},registerClass:function(e,t){this._cache[e]=t}}}},Model:Backbone.Model.extend({}),View:Backbone.View.extend({}),extend_model_instance:function(){var e="boolean"==XPLAN.util.getType(arguments[0]),t=Array.prototype.slice.call(arguments),s=e?1:0,r=t[s],a=t[s]={};for(var o in jQuery.extend.apply(jQuery,t),a)r[o]=a[o]}};
;Dependency._js['model']=true;

;
XPLAN.namespace("commonutil"),XPLAN.commonutil.breakColour=function(n){if((4===n.length||7===n.length)&&"#"===n.substring(0,1)){if(7===n.length)return t=[parseInt(n.substring(1,3),16),parseInt(n.substring(3,5),16),parseInt(n.substring(5),16)];for(var t=n.split(""),r=[],o=0;o<t.length;o++)r.push(parseInt(t[o]+t[o],16));return r}return"rgb("===n.substring(0,4)&&(t=n.match(/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/))?[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]:null},XPLAN.commonutil.colourDarker=function(n,t){function r(n){return parseInt(n*t,10)}var o=XPLAN.commonutil.breakColour(n);return o?XPLAN.commonutil.RGBtoHex([r(o[0]),r(o[1]),r(o[2])]):null},XPLAN.commonutil.colourLighter=function(n,t){function r(n){return parseInt(255-Math.min(255,n),10)}function o(n){return 255-parseInt(n*t,10)}var u=XPLAN.commonutil.breakColour(n);return u?(u=[o((u=[r(u[0]),r(u[1]),r(u[2])])[0]),o(u[1]),o(u[2])],XPLAN.commonutil.RGBtoHex(u)):null},XPLAN.commonutil.RGBtoHex=function(n){var t=n[0].toString(16),r=n[1].toString(16),o=n[2].toString(16);return 1==t.length&&(t="0"+t),1==r.length&&(r="0"+r),1==o.length&&(o="0"+o),"#"+t+r+o},XPLAN.commonutil.getFileExtension=function(n){return/(?:\.([^.]+))?$/.exec(n)[1]},XPLAN.commonutil.chunkArray=function(n,t){if(null==t||t<1)return[];for(var r=[],o=0,u=n.length;o<u;)r.push(Array.prototype.slice.call(n,o,o+=t));return r};
;Dependency._js['commonutils']=true;

;
XPLAN.namespace("ui"),XPLAN.ui.IFrameResize=function(e,t,i,n){var a=getFrameDoc(e);if(!a)return t?(jQuery(e).height(t),t):void 0;jQuery(e).height(30);var o=a?Math.max(jQuery(a.body).prop("scrollHeight"),30):30,r=a?jQuery(a.body).prop("clientHeight"):30;if(r>=o&&(o+=i||23),t&&o<t&&(o=t),n){var u=jQuery(e).contents().find("#"+n).height();u&&u!==r&&(o=i?u+i:u+23,jQuery(e).contents().find("#pagecontent").height(o))}return jQuery(e).height(o),o},XPLAN.ui.MultiIFrameResize=function(e,t){var i=30;for(var n in e){var a=e[n];i=Math.max(i,XPLAN.ui.IFrameResize(a))}jQuery(t).height(i)},XPLAN.ui.bindIFrameResize=function(e,t){jQuery(e).on("load",function(){XPLAN.ui.IFrameResize(this,t)}),jQuery(e).parents('div[class^="fieldhide"]').on("show",function(){var t=jQuery(e).contents().find("iframe").toArray();for(var i in t){var n=t[i],a=jQuery(n).contents().find("#pagecontent").first().height();XPLAN.ui.IFrameResize(jQuery(n),a)}var o=jQuery(e).contents().find("#pagecontent").first().height();XPLAN.ui.IFrameResize(jQuery(e),o)})},XPLAN.ui.fixTableKeys=function(){var e=0;jQuery('div.content table[data-dontfixkeycolumns!="true"] > tbody > tr > td.key').each(function(){var t=jQuery(this).width();t>e&&(e=t)}).width(e)},XPLAN.ui.fixTableKeysBySelector=function(e){var t=0;e.find("table td.key").each(function(){var e=jQuery(this).width();e>t&&(t=e)}).width(t)},XPLAN.ui.fixLabelsBySelector=function(e){e.find("fieldset").not(".full").each(function(t,i){var n=Math.max.apply(Math,e.find(i).find("label").map(function(){return jQuery(this).width()}).get());e.find(i).find("label").width(n)})},XPLAN.ui.addPanelboxButton=function(e,t,i){e.is("div")&&(e=e.find("h2:first"));var n=jQuery('<a class="panelbutton"></a>');n.addClass(t).bind(i);var a=e.find(".panelbutton:last");a.length>0?a.after('<a class="panelbutton add"></a>'):e.prepend(n)},XPLAN.ui.handlePanelboxButton=function(e,t,i){if((e=jQuery(e)).is(".panelbutton.minmax")){if(e.is(".panelbutton.minmax.expand")?XPLAN.ui.showPanelbox(e.closest("div.panelbox"),t,i):XPLAN.ui.hidePanelbox(e.closest("div.panelbox"),t,i),!e.hasClass("dont-save-state")){var n=e.parents("div.panelbox");if(n){var a;a=n.attr("id")?n.attr("id"):jQuery.trim(n.children("h2").text());var o=e.is(".panelbutton.minmax.expand")?"Y":"N";XMLRPC.call("panelbox.set_panelbox_state",[jQuery("#page_content_filename").val()||"",a,o],null,null)}}}else e.is(".panelbutton.close")&&(t?e.parent().parent().hide(i):e.parent().parent().fadeOut(i))},XPLAN.ui.handlePanelboxState=function(e,t){jQuery("div.panelbox",e).each(function(){var e=jQuery(this);e.attr("id")&&XMLRPC.call("panelbox.get_panelbox_state",[jQuery("#page_content_filename").val(),e.attr("id")],function(i){i&&XPLAN.ui.panelboxVisible(e)?XPLAN.ui.hidePanelbox(e,t):i||XPLAN.ui.panelboxVisible(e)||XPLAN.ui.showPanelbox(e,t)})})},XPLAN.ui.panelboxVisible=function(e){return e.find("div.content").is(":visible")},XPLAN.ui.showPanelbox=function(e,t,i){var n=e.find("div.content");e.find("h2 a.panelbutton.minmax").removeClass("expand"),t?n.show(i):n.slideDown("fast",i)},XPLAN.ui.hidePanelbox=function(e,t,i){var n=e.find("div.content");e.find("h2 a.panelbutton.minmax").addClass("expand"),t?n.hide(i):n.slideUp("fast",i)},XPLAN.ui.createSlideOutPanel=function(e,t,i){e.click(function(e){"ui-widget-overlay"===e.target.className||jQuery(e.target).parents().hasClass("ui-dialog")||XPLAN.ui.hideSlideOutPanel(t,i)}),jQuery("iframe",e).each(function(){jQuery(this).contents().find("body").click(function(){XPLAN.ui.hideSlideOutPanel(t)})}),t.click(function(e){return e.stopPropagation(),jQuery(e.target).is(":input")}),jQuery(window).resize(function(){0===parseInt(t.css("right"))&&XPLAN.ui.showSlideOutPanel(e,t)})},XPLAN.ui.showSlideOutPanel=function(e,t,i){void 0===i&&(i={}),jQuery("a.panelbutton.close",t).click(function(){XPLAN.ui.hideSlideOutPanel(t,i)}),e.css({position:"relative"}),"content"!==i.height_control&&t.css("min-height",e.height()+"px"),i.panel_height&&t.css("height",i.panel_height+"px"),t.addClass("slideout_panel"),t.css("right","0px"),jQuery(window).scrollTop()>e.offset().top?(t.removeClass("position_absolute"),t.addClass("position_fixed")):(t.removeClass("position_fixed"),t.addClass("position_absolute")),document.body.scrollHeight>document.body.clientHeight&&jQuery("body").css("overflow","hidden"),XPLAN.util.isBrowser("ie")?t.show():t.fadeIn("slow"),jQuery("body").css("overflow","auto"),t.focus()},XPLAN.ui.getSlideOutPanel=function(e,t){return{panelbox:e,panel:t,is_created:!1,show:function(e){this.is_created||(XPLAN.ui.createSlideOutPanel(this.panelbox,this.panel,e),this.is_created=!0),XPLAN.ui.showSlideOutPanel(this.panelbox,this.panel,e)},hide:function(e){XPLAN.ui.hideSlideOutPanel(this.panel,e)}}},XPLAN.ui.hideSlideOutPanel=function(e,t){void 0===t&&(t={}),"content"!==t.height_control&&e.height("0px"),e.css("right","-400px").hide()},XPLAN.ui.sortTableByURL=function(e,t,i){i||(i="sort");var n=jQuery(e).hasClass("sortable-asc");t.length>1&&(t+="&"),t+=i+"="+e.id.replace("th_",""),t+=n?"&reverse=1":"&reverse=0",document.location.href=t},XPLAN.ui.applySortClassFromQS=function(){var e=XPLAN.util.qs2object(XPLAN.util.decodeQS());e.sort&&jQuery("#th_"+e.sort).addClass("1"==e.reverse?"sortable-des":"sortable-asc")},XPLAN.ui.getLightboxholder=function(){var e=getMainFrame(),t=e.jQuery,i=t("#lbholder");return i.length||(i=t('<div id="lbholder" style="display:none"></div>').appendTo(e.document.body)),i},XPLAN.ui.setButtonState=function(e,t){t?jQuery(e).prop("disabled",!0).addClass("btn_loading"):jQuery(e).prop("disabled",!1).removeClass("btn_loading")},XPLAN.ui.trigger_iResize=function(e){for(var t=jQuery("iframe",e),i=0,n=t.length;i<n;i++)t[i].contentWindow.document.body&&(t[i].style.height=t[i].contentWindow.document.body.scrollHeight+20+"px")},XPLAN.ui.createHTMLEditor=function(e,t,i,n,a,o,r,u){var s=jQuery(e),l=s.attr("id")||s.attr("name"),d=CKEDITOR.instances[l];if(d)try{d.destroy(!0)}catch(e){window.console&&console.log("Did you forget to destroy CKEditor?",e),delete CKEDITOR.instances[l]}var c=getBaseURL();u=void 0!==u&&u,s.ckeditor({basePath:c+"/js/lib/ckeditor/",customConfig:c+"/js/ckeditor/config_"+t+".js",height:i,width:n,toolbarStartupExpanded:o,toolbar:a,readOnly:u},r),window.setTimeout(function(){jQuery(".cke_hc").removeClass("cke_hc")},1e3)},XPLAN.ui.makeReadOnly=function(e){jQuery(document.body).css("background-color","white"),XPLAN.Portfolio.Subfunds.Dialog.resizeElements(),jQuery("input[type=hidden], input[type=submit], input[disabled=disabled]").remove(),jQuery("img.ui-datepicker-trigger").remove(),jQuery("span.icon").remove(),-1!=jQuery.inArray("input",e)&&jQuery("input:not(:checkbox)").each(function(e,t){var i=jQuery(t),n=i.attr("name");if("undefined"!=n){var a=i.val();jQuery("<span/>",{class:n}).prependTo(i.parent()).text(a),i.remove()}}),-1!=jQuery.inArray("checkbox",e)&&jQuery("input:checkbox").each(function(e,t){jQuery(t).prop("disabled",!0)}),-1!=jQuery.inArray("select",e)&&jQuery("option:selected").each(function(e,t){var i=jQuery(t),n=i.text(),a=i.parent(),o=a.attr("name");jQuery("<span/>",{class:o}).prependTo(a.parent()).text(n),a.remove()})};
;Dependency._js['commonui']=true;

;
!function(e){"use strict";function n(e){for(var n,t,r=1,i=e.length,o=e[0]+"";r<i;r++){for(n=e[r]+"",t=y-n.length;t--;)n="0"+n;o+=n}for(i=o.length;"0"==o.charAt(--i););return o.slice(0,i+1||1)}function t(e,n,t,r){var i,o,s,c,u;for(o=1,s=e[0];s>=10;s/=10,o++);return(s=n-o)<0?(s+=y,i=0):(i=Math.ceil((s+1)/y),s%=y),o=E(10,y-s),u=e[i]%o|0,null==r?s<3?(0==s?u=u/100|0:1==s&&(u=u/10|0),c=t<4&&99999==u||t>3&&49999==u||5e4==u||0==u):c=(t<4&&u+1==o||t>3&&u+1==o/2)&&(e[i+1]/o/100|0)==E(10,s-2)-1||(u==o/2||0==u)&&0==(e[i+1]/o/100|0):s<4?(0==s?u=u/1e3|0:1==s?u=u/100|0:2==s&&(u=u/10|0),c=(r||t<4)&&9999==u||!r&&t>3&&4999==u):c=((r||t<4)&&u+1==o||!r&&t>3&&u+1==o/2)&&(e[i+1]/o/1e3|0)==E(10,s-3)-1,c}function r(e,n,t){var r=e.constructor;return null==n||((m=n<0||n>8)||0!==n&&(r.errors?parseInt:parseFloat)(n)!=n)&&!u(r,"rounding mode",n,t,0)?r.rounding:0|n}function i(e,n,t,r){var i=e.constructor;return!(m=n<(r||0)||n>=F+1)&&(0===n||(i.errors?parseInt:parseFloat)(n)==n)||u(i,"argument",n,t,0)}function o(e,r){var i,o,s,c,u,l,f,h=0,g=0,p=0,m=e.constructor,d=m.ONE,N=m.rounding,v=m.precision;if(!e.c||!e.c[0]||e.e>17)return new m(e.c?e.c[0]?e.s<0?0:1/0:d:e.s?e.s<0?0:e:NaN);for(null==r?(w=!1,u=v):u=r,f=new m(.03125);e.e>-2;)e=e.times(f),p+=5;for(u+=o=Math.log(E(2,p))/Math.LN10*2+5|0,i=c=l=new m(d),m.precision=u;;){if(c=a(c.times(e),u,1),i=i.times(++g),n((f=l.plus(R(c,i,u,1))).c).slice(0,u)===n(l.c).slice(0,u)){for(s=p;s--;)l=a(l.times(l),u,1);if(null!=r)return m.precision=v,l;if(!(h<3&&t(l.c,u-o,N,h)))return a(l,m.precision=v,N,w=!0);m.precision=u+=10,i=c=f=new m(d),g=0,h++}l=f}}function s(e,t,r,i){var o,s,c=e.constructor,u=(e=new c(e)).e;if(null==t?r=0:(a(e,++t,r),r=i?t:t+e.e-u),u=e.e,o=n(e.c),1==i||2==i&&(t<=u||u<=c.toExpNeg)){for(;o.length<r;o+="0");o.length>1&&(o=o.charAt(0)+"."+o.slice(1)),o+=(u<0?"e":"e+")+u}else{if(i=o.length,u<0){for(s=r-i;++u;o="0"+o);o="0."+o}else if(++u>i){for(s=r-u,u-=i;u--;o+="0");s>0&&(o+=".")}else s=r-i,u<i?o=o.slice(0,u)+"."+o.slice(u):s>0&&(o+=".");if(s>0)for(;s--;o+="0");}return e.s<0&&e.c[0]?"-"+o:o}function c(e){var n=e.length-1,t=n*y+1;if(n=e[n]){for(;n%10==0;n/=10,t--);for(n=e[0];n>=10;n/=10,t++);}return t}function u(e,n,t,r,i){if(e.errors){var o=new Error((r||["new Decimal","cmp","div","eq","gt","gte","lt","lte","minus","mod","plus","times","toFraction","pow","random","log","sqrt","toNearest","divToInt"][N?N<0?-N:N:1/N<0?1:0])+"() "+(["number type has more than 15 significant digits","LN10 out of digits"][n]||n+([m?" out of range":" not an integer"," not a boolean or binary digit"][i]||""))+": "+t);throw o.name="Decimal Error",m=N=0,o}}function l(e,n,t){var r=new e(e.ONE);for(w=!1;1&t&&(r=r.times(n)),t>>=1;)n=n.times(n);return w=!0,r}function f(e,r){var i,o,s,c,l,h,g,p,m,d,N,v=1,E=e,x=E.c,b=E.constructor,y=b.ONE,O=b.rounding,D=b.precision;if(E.s<0||!x||!x[0]||!E.e&&1==x[0]&&1==x.length)return new b(x&&!x[0]?-1/0:1!=E.s?NaN:x?0:E);if(null==r?(w=!1,g=D):g=r,b.precision=g+=10,o=(i=n(x)).charAt(0),!(Math.abs(c=E.e)<15e14))return E=new b(o+"."+i.slice(1)),g+2>A.length&&u(b,1,g+2,"ln"),E=f(E,g-10).plus(new b(A.slice(0,g+2)).times(c+"")),b.precision=D,null==r?a(E,D,O,w=!0):E;for(;o<7&&1!=o||1==o&&i.charAt(1)>3;)o=(i=n((E=E.times(e)).c)).charAt(0),v++;for(c=E.e,o>1?(E=new b("0."+i),c++):E=new b(o+"."+i.slice(1)),d=E,p=l=E=R(E.minus(y),E.plus(y),g,1),N=a(E.times(E),g,1),s=3;;){if(l=a(l.times(N),g,1),n((m=p.plus(R(l,new b(s),g,1))).c).slice(0,g)===n(p.c).slice(0,g)){if(p=p.times(2),0!==c&&(g+2>A.length&&u(b,1,g+2,"ln"),p=p.plus(new b(A.slice(0,g+2)).times(c+""))),p=R(p,new b(v),g,1),null!=r)return b.precision=D,p;if(!t(p.c,g-10,O,h))return a(p,b.precision=D,O,w=!0);b.precision=g+=10,m=l=E=R(d.minus(y),d.plus(y),g,1),N=a(E.times(E),g,1),s=h=1}p=m,s+=2}}function a(e,n,t,r){var i,o,s,c,u,l,f,a,h=e.constructor;e:if(null!=n){if(!(f=e.c))return e;for(i=1,c=f[0];c>=10;c/=10,i++);if((o=n-i)<0)o+=y,s=n,l=(u=f[a=0])/E(10,i-s-1)%10|0;else if((a=Math.ceil((o+1)/y))>=f.length){if(!r)break e;for(;f.length<=a;f.push(0));u=l=0,i=1,s=(o%=y)-y+1}else{for(u=c=f[a],i=1;c>=10;c/=10,i++);l=(s=(o%=y)-y+i)<0?0:v(u/E(10,i-s-1)%10)}if(r=r||n<0||null!=f[a+1]||(s<0?u:u%E(10,i-s-1)),r=t<4?(l||r)&&(0==t||t==(e.s<0?3:2)):l>5||5==l&&(4==t||r||6==t&&(o>0?s>0?u/E(10,i-s):0:f[a-1])%10&1||t==(e.s<0?8:7)),n<1||!f[0])return f.length=0,r?(n-=e.e+1,f[0]=E(10,n%y),e.e=-n||0):f[0]=e.e=0,e;if(0==o?(f.length=a,c=1,a--):(f.length=a+1,c=E(10,y-o),f[a]=s>0?(u/E(10,i-s)%E(10,s)|0)*c:0),r)for(;;){if(0==a){for(o=1,s=f[0];s>=10;s/=10,o++);for(s=f[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(e.e++,f[0]==b&&(f[0]=1));break}if(f[a]+=c,f[a]!=b)break;f[a--]=0,c=1}for(o=f.length;0===f[--o];f.pop());}return w&&(e.e>h.maxE?e.c=e.e=null:e.e<h.minE&&(e.c=[e.e=0])),e}var h,g,p,m,d=e.crypto,w=!0,N=0,v=Math.floor,E=Math.pow,x=Object.prototype.toString,b=1e7,y=7,O="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",D={},S=9e15,F=1e9,A="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058";D.absoluteValue=D.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),a(e)},D.ceil=function(){return a(new this.constructor(this),this.e+1,2)},D.comparedTo=D.cmp=function(e,n){var t,r=this,i=r.c,o=(N=-N,(e=new r.constructor(e,n)).c),s=r.s,c=e.s,u=r.e,l=e.e;if(!s||!c)return null;if(t=i&&!i[0],n=o&&!o[0],t||n)return t?n?0:-c:s;if(s!=c)return s;if(t=s<0,!i||!o)return u==l?0:!i^t?1:-1;if(u!=l)return u>l^t?1:-1;for(s=-1,c=(u=i.length)<(l=o.length)?u:l;++s<c;)if(i[s]!=o[s])return i[s]>o[s]^t?1:-1;return u==l?0:u>l^t?1:-1},D.decimalPlaces=D.dp=function(){var e,n,t=null;if(e=this.c){if(t=((n=e.length-1)-v(this.e/y))*y,n=e[n])for(;n%10==0;n/=10,t--);t<0&&(t=0)}return t},D.dividedBy=D.div=function(e,n){return N=2,R(this,new this.constructor(e,n))},D.dividedToIntegerBy=D.divToInt=function(e,n){var t=this.constructor;return N=18,a(R(this,new t(e,n),0,1,1),t.precision,t.rounding)},D.equals=D.eq=function(e,n){return N=3,0===this.cmp(e,n)},D.exponential=D.exp=function(){return o(this)},D.floor=function(){return a(new this.constructor(this),this.e+1,3)},D.greaterThan=D.gt=function(e,n){return N=4,this.cmp(e,n)>0},D.greaterThanOrEqualTo=D.gte=function(e,n){return N=5,1==(n=this.cmp(e,n))||0===n},D.isFinite=function(){return!!this.c},D.isInteger=D.isInt=function(){return!!this.c&&v(this.e/y)>this.c.length-2},D.isNaN=function(){return!this.s},D.isNegative=D.isNeg=function(){return this.s<0},D.isZero=function(){return!!this.c&&0==this.c[0]},D.lessThan=D.lt=function(e,n){return N=6,this.cmp(e,n)<0},D.lessThanOrEqualTo=D.lte=function(e,n){return N=7,-1==(n=this.cmp(e,n))||0===n},D.logarithm=D.log=function(e,r){var i,o,s,c,l,h,g,p,m,d=this.constructor,v=d.precision,E=d.rounding;if(null==e)e=new d(10),i=!0;else{if(N=15,o=(e=new d(e,r)).c,e.s<0||!o||!o[0]||!e.e&&1==o[0]&&1==o.length)return new d(NaN);i=e.eq(10)}if(o=this.c,this.s<0||!o||!o[0]||!this.e&&1==o[0]&&1==o.length)return new d(o&&!o[0]?-1/0:1!=this.s?NaN:o?0:1/0);if(l=i&&(c=o[0],o.length>1||1!=c&&10!=c&&100!=c&&1e3!=c&&1e4!=c&&1e5!=c&&1e6!=c),w=!1,p=(g=v+5)+10,h=f(this,g),i?(p>A.length&&u(d,1,p,"log"),s=new d(A.slice(0,p))):s=f(e,g),t((m=R(h,s,g,1)).c,c=v,E))do{if(h=f(this,g+=10),i?((p=g+10)>A.length&&u(d,1,p,"log"),s=new d(A.slice(0,p))):s=f(e,g),m=R(h,s,g,1),!l){+n(m.c).slice(c+1,c+15)+1==1e14&&(m=a(m,v+1,0));break}}while(t(m.c,c+=10,E));return w=!0,a(m,v,E)},D.minus=function(e,n){var t,r,i,o,s=this,c=s.constructor,u=s.s;if(N=8,n=(e=new c(e,n)).s,!u||!n)return new c(NaN);if(u!=n)return e.s=-n,s.plus(e);var l=s.c,f=e.c,h=v(e.e/y),g=v(s.e/y),p=c.precision,m=c.rounding;if(!g||!h){if(!l||!f)return l?(e.s=-n,e):new c(f?s:NaN);if(!l[0]||!f[0])return s=f[0]?(e.s=-n,e):new c(l[0]?s:3==m?-0:0),w?a(s,p,m):s}if(r=(l=l.slice()).length,u=g-h){for((o=u<0)?(u=-u,t=l,r=f.length):(h=g,t=f),(g=Math.ceil(p/y))>r&&(r=g),u>(r+=2)&&(u=r,t.length=1),t.reverse(),n=u;n--;t.push(0));t.reverse()}else for((o=r<(i=f.length))&&(i=r),u=n=0;n<i;n++)if(l[n]!=f[n]){o=l[n]<f[n];break}if(o&&(t=l,l=f,f=t,e.s=-e.s),(n=-((i=l.length)-f.length))>0)for(;n--;l[i++]=0);for(g=b-1,n=f.length;n>u;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=g);--l[r],l[n]+=b}l[n]-=f[n]}for(;0==l[--i];l.pop());for(;0==l[0];l.shift(),--h);for(l[0]||(l=[h=0],e.s=3==m?-1:1),e.c=l,u=1,n=l[0];n>=10;n/=10,u++);return e.e=u+h*y-1,w?a(e,p,m):e},D.modulo=D.mod=function(e,n){var t,r,i=this,o=i.constructor,s=o.modulo;return N=9,n=(e=new o(e,n)).s,(t=!i.c||!n||e.c&&!e.c[0])||!e.c||i.c&&!i.c[0]?t?new o(NaN):a(new o(i),o.precision,o.rounding):(w=!1,9==s?(e.s=1,r=R(i,e,0,3,1),e.s=n,r.s*=n):r=R(i,e,0,s,1),r=r.times(e),w=!0,i.minus(r))},D.naturalLogarithm=D.ln=function(){return f(this)},D.negated=D.neg=function(){var e=new this.constructor(this);return e.s=-e.s||null,a(e)},D.plus=function(e,n){var t,r=this,i=r.constructor,o=r.s;if(N=10,n=(e=new i(e,n)).s,!o||!n)return new i(NaN);if(o!=n)return e.s=-n,r.minus(e);var s=r.c,c=e.c,u=v(e.e/y),l=v(r.e/y),f=i.precision,h=i.rounding;if(!l||!u){if(!s||!c)return new i(o/0);if(!s[0]||!c[0])return r=c[0]?e:new i(s[0]?r:0*o),w?a(r,f,h):r}if(s=s.slice(),o=l-u){for(o<0?(o=-o,t=s,n=c.length):(u=l,t=c,n=s.length),(l=Math.ceil(f/y))>n&&(n=l),o>++n&&(o=n,t.length=1),t.reverse();o--;t.push(0));t.reverse()}for(s.length-c.length<0&&(t=c,c=s,s=t),o=c.length,n=0,l=b;o;s[o]%=l)n=(s[--o]=s[o]+c[o]+n)/l|0;for(n&&(s.unshift(n),++u),o=s.length;0==s[--o];s.pop());for(e.c=s,o=1,n=s[0];n>=10;n/=10,o++);return e.e=o+u*y-1,w?a(e,f,h):e},D.precision=D.sd=function(e){var n=null,t=this;return e!=n&&e!==!!e&&1!==e&&0!==e&&u(t.constructor,"argument",e,"precision",1),t.c&&(n=c(t.c),e&&t.e+1>n&&(n=t.e+1)),n},D.round=function(){var e=this,n=e.constructor;return a(new n(e),e.e+1,n.rounding)},D.squareRoot=D.sqrt=function(){var e,t,r,i,o,s,c=this,u=c.c,l=c.s,f=c.e,h=c.constructor,g=new h(.5);if(1!==l||!u||!u[0])return new h(!l||l<0&&(!u||u[0])?NaN:u?c:1/0);for(w=!1,0==(l=Math.sqrt(+c))||l==1/0?(((t=n(u)).length+f)%2==0&&(t+="0"),l=Math.sqrt(t),f=v((f+1)/2)-(f<0||f%2),i=new h(t=l==1/0?"1e"+f:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+f)):i=new h(l.toString()),r=(f=h.precision)+3;;)if(s=i,i=g.times(s.plus(R(c,s,r+2,1))),n(s.c).slice(0,r)===(t=n(i.c)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(a(i,f+1,1),e=!i.times(i).eq(c));break}if(!o&&(a(s,f+1,0),s.times(s).eq(c))){i=s;break}r+=4,o=1}return w=!0,a(i,f,h.rounding,e)},D.times=function(e,n){var t,r,i=this,o=i.constructor,s=i.c,c=(N=11,(e=new o(e,n)).c),u=v(i.e/y),l=v(e.e/y),f=i.s;if(n=e.s,e.s=f==n?1:-1,!((u||s&&s[0])&&(l||c&&c[0])))return new o(!f||!n||s&&!s[0]&&!c||c&&!c[0]&&!s?NaN:s&&c?0*e.s:e.s/0);for(r=u+l,(f=s.length)<(n=c.length)&&(t=s,s=c,c=t,l=f,f=n,n=l),l=f+n,t=[];l--;t.push(0));for(u=n-1;u>-1;u--){for(n=0,l=f+u;l>u;n=n/b|0)n=t[l]+c[u]*s[l-u-1]+n,t[l--]=n%b|0;n&&(t[l]=(t[l]+n)%b)}for(n&&++r,t[0]||t.shift(),l=t.length;!t[--l];t.pop());for(e.c=t,f=1,n=t[0];n>=10;n/=10,f++);return e.e=f+r*y-1,w?a(e,o.precision,o.rounding):e},D.toDecimalPlaces=D.toDP=function(e,n){var t=this;return t=new t.constructor(t),null!=e&&i(t,e,"toDP")?a(t,(0|e)+t.e+1,r(t,n,"toDP")):t},D.toExponential=function(e,n){var t=this;return t.c?s(t,null!=e&&i(t,e,"toExponential")?0|e:null,null!=e&&r(t,n,"toExponential"),1):t.toString()},D.toFixed=function(e,n){var t,o=this,c=o.constructor,u=c.toExpNeg,l=c.toExpPos;return null!=e&&(e=i(o,e,t="toFixed")?o.e+(0|e):null,n=r(o,n,t)),c.toExpNeg=-(c.toExpPos=1/0),null!=e&&o.c?(t=s(o,e,n),o.s<0&&o.c&&(o.c[0]?t.indexOf("-")<0&&(t="-"+t):t=t.replace("-",""))):t=o.toString(),c.toExpNeg=u,c.toExpPos=l,t},D.toFormat=function(e,n){var t=this;if(!t.c)return t.toString();var r,i=t.s<0,o=t.constructor.format,s=o.groupSeparator,c=+o.groupSize,u=+o.secondaryGroupSize,l=t.toFixed(e,n).split("."),f=l[0],a=l[1],h=i?f.slice(1):f,g=h.length;if(u&&(g-=(r=c,c=u,u=r)),c>0&&g>0){for(r=g%c||c,f=h.substr(0,r);r<g;r+=c)f+=s+h.substr(r,c);u>0&&(f+=s+h.slice(r)),i&&(f="-"+f)}return a?f+o.decimalSeparator+((u=+o.fractionGroupSize)?a.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+o.fractionGroupSeparator):a):f},D.toFraction=function(e){var t,r,i,o,s,l,f,a,h=this,g=h.constructor,p=t=new g(g.ONE),d=l=new g(0),x=h.c,b=new g(d);if(!x)return h.toString();for(i=b.e=c(x)-h.e-1,b.c[0]=E(10,(f=i%y)<0?y+f:f),(null==e||(!(N=12,s=new g(e)).s||(m=s.cmp(p)<0||!s.c)||g.errors&&v(s.e/y)<s.c.length-1)&&!u(g,"max denominator",e,"toFraction",0)||(e=s).cmp(b)>0)&&(e=i>0?b:p),w=!1,s=new g(n(x)),f=g.precision,g.precision=i=x.length*y*2;a=R(s,b,0,1,1),1!=(r=t.plus(a.times(d))).cmp(e);)t=d,d=r,p=l.plus(a.times(r=p)),l=r,b=s.minus(a.times(r=b)),s=r;return r=R(e.minus(t),d,0,1,1),l=l.plus(r.times(p)),t=t.plus(r.times(d)),l.s=p.s=h.s,o=R(p,d,i,1).minus(h).abs().cmp(R(l,t,i,1).minus(h).abs())<1?[p+"",d+""]:[l+"",t+""],w=!0,g.precision=f,o},D.toNearest=function(e,n){var t=this,i=t.constructor;return t=new i(t),null==e?(e=new i(i.ONE),n=i.rounding):(N=17,e=new i(e),n=r(t,n,"toNearest")),e.c?t.c&&(e.c[0]?(w=!1,t=R(t,e,0,n<4?[4,5,7,8][n]:n,1).times(e),w=!0,a(t)):t.c=[t.e=0]):t.s&&(e.s&&(e.s=t.s),t=e),t},D.toNumber=function(){var e=this;return+e||(e.s?0*e.s:NaN)},D.toPower=D.pow=function(e,r){var i,s,c,u,h=this,g=h.constructor,p=h.s,m=(N=13,+(e=new g(e,r))),d=m<0?-m:m,x=g.precision,b=g.rounding;if(!h.c||!e.c||(c=!h.c[0])||!e.c[0])return new g(E(c?0*p:+h,m));if(i=(h=new g(h)).c.length,!h.e&&h.c[0]==h.s&&1==i)return h;if(r=e.c.length-1,e.e||e.c[0]!=e.s||r)if(!(c=(s=v(e.e/y))>=r)&&p<0)u=new g(NaN);else{if(c&&i*y*d<3e3){if(u=l(g,h,d),e.s<0)return g.ONE.div(u)}else{if(p=p<0&&1&e.c[Math.max(s,r)]?-1:1,(s=0!=(r=E(+h,m))&&isFinite(r)?new g(r+"").e:v(m*(Math.log("0."+n(h.c))/Math.LN10+h.e+1)))>g.maxE+1||s<g.minE-1)return new g(s>0?p/0:0);w=!1,g.rounding=h.s=1,d=Math.min(12,(s+"").length),t((u=a(u=o(e.times(f(h,x+d)),x),x+5,1)).c,x,b)&&(s=x+10,+n((u=a(o(e.times(f(h,s+d)),s),s+5,1)).c).slice(x+1,x+15)+1==1e14&&(u=a(u,x+1,0))),u.s=p,w=!0,g.rounding=b}u=a(u,x,b)}else u=a(h,x,b);return u},D.toPrecision=function(e,n){var t=this;return null!=e&&i(t,e,"toPrecision",1)&&t.c?s(t,0|--e,r(t,n,"toPrecision"),2):t.toString()},D.toSignificantDigits=D.toSD=function(e,n){var t=this,o=t.constructor;return t=new o(t),null!=e&&i(t,e,"toSD",1)?a(t,0|e,r(t,n,"toSD")):a(t,o.precision,o.rounding)},D.toString=function(e){var t,r,i,o=this,c=o.constructor,l=o.e;if(null===l)r=o.s?"Infinity":"NaN";else{if(e===t&&(l<=c.toExpNeg||l>=c.toExpPos))return s(o,null,c.rounding,1);if(r=n(o.c),l<0){for(;++l;r="0"+r);r="0."+r}else if(i=r.length,l>0)if(++l>i)for(l-=i;l--;r+="0");else l<i&&(r=r.slice(0,l)+"."+r.slice(l));else if(t=r.charAt(0),i>1)r=t+"."+r.slice(1);else if("0"==t)return t;if(null!=e)if((m=!(e>=2&&e<65))||e!=(0|e)&&c.errors)u(c,"base",e,"toString",0);else if("0"==(r=h(c,r,0|e,10,o.s)))return r}return o.s<0?"-"+r:r},D.truncated=D.trunc=function(){return a(new this.constructor(this),this.e+1,1)},D.valueOf=function(){return this.toString()},D.toJSON=function(){return{_type:"BigDecimal",_val:this.toString()}},h=function(){function e(e,n,t){for(var r,i,o=[0],s=0,c=e.length;s<c;){for(i=o.length;i--;o[i]*=n);for(o[r=0]+=O.indexOf(e.charAt(s++));r<o.length;r++)o[r]>t-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/t|0,o[r]%=t)}return o.reverse()}return function(n,t,r,i,o){var s,c,u,f,a,h,g=t.indexOf("."),p=n.precision,m=n.rounding;for(i<37&&(t=t.toLowerCase()),g>=0&&(t=t.replace(".",""),f=l(n,h=new n(i),t.length-g),h.c=e(f.toFixed(),10,r),h.e=h.c.length),s=c=(a=e(t,i,r)).length;0==a[--c];a.pop());if(!a[0])return"0";if(g<0?s--:(f.c=a,f.e=s,f.s=o,a=(f=R(f,h,p,m,0,r)).c,u=f.r,s=f.e),g=a[p],c=r/2,u=u||null!=a[p+1],m<4?(null!=g||u)&&(0==m||m==(f.s<0?3:2)):g>c||g==c&&(4==m||u||6==m&&1&a[p-1]||m==(f.s<0?8:7)))for(a.length=p,--r;++a[--p]>r;)a[p]=0,p||(++s,a.unshift(1));else a.length=p;for(c=a.length;!a[--c];);for(g=0,t="";g<=c;t+=O.charAt(a[g++]));if(s<0){for(;++s;t="0"+t);t="0."+t}else if(++s>(g=t.length))for(s-=g;s--;t+="0");else s<g&&(t=t.slice(0,s)+"."+t.slice(s));return t}}();var R=function(){function e(e,n,t){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*n+i,e[o]=r%t|0,i=r/t|0;return i&&e.unshift(i),e}function n(e,n,t,r){var i,o;if(t!=r)o=t>r?1:-1;else for(i=o=0;i<t;i++)if(e[i]!=n[i]){o=e[i]>n[i]?1:-1;break}return o}function t(e,n,t,r){for(var i=0;t--;)e[t]-=i,i=e[t]<n[t]?1:0,e[t]=i*r+e[t]-n[t];for(;!e[0]&&e.length>1;e.shift());}return function(r,i,o,s,c,u){var l,f,h,g,p,m,d,w,N,E,x,O,D,S,F,A,R,M,P,q=r.constructor,_=r.s==i.s?1:-1,L=r.c,U=i.c;if(!(L&&L[0]&&U&&U[0]))return new q(r.s&&i.s&&(L?!U||L[0]!=U[0]:U)?L&&0==L[0]||!U?0*_:_/0:NaN);for(u?(g=1,f=r.e-i.e):(u=b,g=y,f=v(r.e/g)-v(i.e/g)),M=U.length,A=L.length,E=(N=new q(_)).c=[],h=0;U[h]==(L[h]||0);h++);if(U[h]>(L[h]||0)&&f--,null==o?(_=o=q.precision,s=q.rounding):_=c?o+(r.e-i.e)+1:o,_<0)E.push(1),p=!0;else{if(_=_/g+2|0,h=0,1==M){for(m=0,U=U[0],_++;(h<A||m)&&_--;h++)S=m*u+(L[h]||0),E[h]=S/U|0,m=S%U|0;p=m||h<A}else{for((m=u/(U[0]+1)|0)>1&&(U=e(U,m,u),L=e(L,m,u),M=U.length,A=L.length),F=M,O=(x=L.slice(0,M)).length;O<M;x[O++]=0);(P=U.slice()).unshift(0),R=U[0],U[1]>=u/2&&R++;do{m=0,(l=n(U,x,M,O))<0?(D=x[0],M!=O&&(D=D*u+(x[1]||0)),(m=D/R|0)>1?(m>=u&&(m=u-1),1==(l=n(d=e(U,m,u),x,w=d.length,O=x.length))&&(m--,t(d,M<w?P:U,w,u))):(0==m&&(l=m=1),d=U.slice()),(w=d.length)<O&&d.unshift(0),t(x,d,O,u),-1==l&&(l=n(U,x,M,O=x.length))<1&&(m++,t(x,M<O?P:U,O,u)),O=x.length):0===l&&(m++,x=[0]),E[h++]=m,l&&x[0]?x[O++]=L[F]||0:(x=[L[F]],O=1)}while((F++<A||null!=x[0])&&_--);p=null!=x[0]}E[0]||E.shift()}if(1==g)N.e=f,N.r=+p;else{for(h=1,_=E[0];_>=10;_/=10,h++);N.e=h+f*g-1,a(N,c?o+N.e+1:o,s,p)}return N}}();if(g=function(){function e(e){var n,t,r,i="config",o=this.errors?parseInt:parseFloat;return e==t||"object"!=typeof e&&!u(this,"object expected",e,i)?this:((r=e[n="precision"])!=t&&((m=r<1||r>F)||o(r)!=r?u(this,n,r,i,0):this[n]=0|r),(r=e[n="rounding"])!=t&&((m=r<0||r>8)||o(r)!=r?u(this,n,r,i,0):this[n]=0|r),(r=e[n="toExpNeg"])!=t&&((m=r<-S||r>0)||o(r)!=r?u(this,n,r,i,0):this[n]=v(r)),(r=e[n="toExpPos"])!=t&&((m=r<0||r>S)||o(r)!=r?u(this,n,r,i,0):this[n]=v(r)),(r=e[n="minE"])!=t&&((m=r<-S||r>0)||o(r)!=r?u(this,n,r,i,0):this[n]=v(r)),(r=e[n="maxE"])!=t&&((m=r<0||r>S)||o(r)!=r?u(this,n,r,i,0):this[n]=v(r)),(r=e[n="errors"])!=t&&(r===!!r||1===r||0===r?(m=N=0,this[n]=!!r):u(this,n,r,i,1)),(r=e[n="crypto"])!=t&&(r===!!r||1===r||0===r?this[n]=!(!r||!d||"object"!=typeof d):u(this,n,r,i,1)),(r=e[n="modulo"])!=t&&((m=r<0||r>9)||o(r)!=r?u(this,n,r,i,0):this[n]=0|r),(e=e[n="format"])!=t&&("object"==typeof e?this[n]=e:u(this,"format object expected",e,i)),this)}function n(e){return new this(e).exp()}function t(e){return new this(e).ln()}function r(e,n){return new this(e).log(n)}function o(e,n,t){var r,i,o=0;for("[object Array]"==x.call(n[0])&&(n=n[0]),r=new e(n[0]);++o<n.length;){if(!(i=new e(n[o])).s){r=i;break}r[t](i)&&(r=i)}return r}function s(){return o(this,arguments,"lt")}function c(){return o(this,arguments,"gt")}function l(e,n){return new this(e).pow(n)}function f(e){var n,t,r,o=0,s=[],c=new this(this.ONE);if(null!=e&&i(c,e,"random")?e|=0:e=this.precision,t=Math.ceil(e/y),this.crypto)if(d&&d.getRandomValues)for(n=d.getRandomValues(new Uint32Array(t));o<t;)(r=n[o])>=429e7?n[o]=d.getRandomValues(new Uint32Array(1))[0]:s[o++]=r%1e7;else if(d&&d.randomBytes){for(n=d.randomBytes(t*=4);o<t;)(r=n[o]+(n[o+1]<<8)+(n[o+2]<<16)+((127&n[o+3])<<24))>=214e7?d.randomBytes(4).copy(n,o):(s.push(r%1e7),o+=4);o=t/4}else u(this,"crypto unavailable",d,"random");if(!o)for(;o<t;)s[o++]=1e7*Math.random()|0;for(t=s[--o],e%=y,t&&e&&(r=E(10,y-e),s[o]=(t/r|0)*r);0===s[o];o--)s.pop();if(o<0)s=[t=0];else{for(t=-1;0===s[0];)s.shift(),t-=y;for(o=1,r=s[0];r>=10;)r/=10,o++;o<y&&(t-=y-o)}return c.e=t,c.c=s,c}function g(e){return new this(e).sqrt()}var p,b,A=(p=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,b=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},function(e,n,t,r){var i,o,s,c,l,f;if("string"!=typeof t&&(t=(c="number"==typeof t||"[object Number]"==x.call(t))&&0===t&&1/t<0?"-0":t+""),l=t,null==r&&p.test(t))n.s="-"==t.charAt(0)?(t=t.slice(1),-1):1;else{if(10==r)return a(new e(t),e.precision,e.rounding);if(t=b.call(t).replace(/^\+(?!-)/,""),n.s="-"==t.charAt(0)?(t=t.replace(/^-(?!-)/,""),-1):1,null!=r?r!=(0|r)&&e.errors||(m=!(r>=2&&r<65))?(u(e,"base",r,0,0),f=p.test(t)):(i="["+O.slice(0,r|=0)+"]+",t=t.replace(/\.$/,"").replace(/^\./,"0."),(f=new RegExp("^"+i+"(?:\\."+i+")?$",r<37?"i":"").test(t))?(c&&(t.replace(/^0\.0*|\./,"").length>15&&u(e,0,l),c=!c),t=h(e,t,10,r,n.s)):"Infinity"!=t&&"NaN"!=t&&(u(e,"not a base "+r+" number",l),t="NaN")):f=p.test(t),!f)return n.c=n.e=null,"Infinity"!=t&&("NaN"!=t&&u(e,"not a number",l),n.s=null),N=0,n}for((o=t.indexOf("."))>-1&&(t=t.replace(".","")),(s=t.search(/e/i))>0?(o<0&&(o=s),o+=+t.slice(s+1),t=t.substring(0,s)):o<0&&(o=t.length),s=0;"0"==t.charAt(s);s++);for(r=t.length;"0"==t.charAt(--r););if(t=t.slice(s,r+1)){if(r=t.length,c&&r>15&&u(e,0,l),n.e=o=o-s-1,n.c=[],s=(o+1)%y,o<0&&(s+=y),s<r){for(s&&n.c.push(+t.slice(0,s)),r-=y;s<r;)n.c.push(+t.slice(s,s+=y));t=t.slice(s),s=y-t.length}else s-=r;for(;s--;t+="0");n.c.push(+t),w&&(n.e>e.maxE?n.c=n.e=null:n.e<e.minE&&(n.c=[n.e=0]))}else n.c=[n.e=0];N=0});return function i(o){function h(e,n){var t=this;if(!(t instanceof h))return u(h,"Decimal called without new",e),new h(e,n);if(e instanceof h){if(null==n)return N=0,t.constructor=e.constructor,t.s=e.s,t.e=e.e,void(t.c=(e=e.c)?e.slice():e);if(10==n)return a(new h(e),h.precision,h.rounding);e+=""}return A(t.constructor=h,t,e,n)}return h.precision=20,h.rounding=4,h.modulo=1,h.toExpNeg=-7,h.toExpPos=21,h.minE=-S,h.maxE=S,h.errors=!0,h.crypto=!1,h.format={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0},h.prototype=D,h.ZERO=new h(0),h.ONE=new h(1),h.HUNDRED=new h(100),h.ROUND_UP=0,h.ROUND_DOWN=1,h.ROUND_CEIL=2,h.ROUND_FLOOR=3,h.ROUND_HALF_UP=4,h.ROUND_HALF_DOWN=5,h.ROUND_HALF_EVEN=6,h.ROUND_HALF_CEIL=7,h.ROUND_HALF_FLOOR=8,h.EUCLID=9,h.config=e,h.constructor=i,h.exp=n,h.ln=t,h.log=r,h.max=s,h.min=c,h.pow=l,h.sqrt=g,h.random=f,null!=o&&h.config(o),h}()}(),"function"==typeof define&&define.amd)define(function(){return g});else if("undefined"!=typeof module&&module.exports){if(module.exports=g,!d)try{d=require("crypto")}catch(e){}}else p=e.Decimal,g.noConflict=function(){return e.Decimal=e.BigDecimal=e.FastBigDecimal=p,g},e.Decimal=e.BigDecimal=e.FastBigDecimal=g}(this);
;Dependency._js['lib/decimaljs/decimal']=true;

;
!function(){var rsplit=function(e,t){for(var n,i=t.exec(e),r=new Array;null!=i;)n=i.index,t.lastIndex,0!=n&&(e.substring(0,n),r.push(e.substring(0,n)),e=e.slice(n)),r.push(i[0]),e=e.slice(i[0].length),i=t.exec(e);return""==!e&&r.push(e),r},chop=function(e){return e.substr(0,e.length-1)},extend=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};EJS=function(e){if(e="string"==typeof e?{view:e}:e,this.set_options(e),e.precompiled)return this.template={},this.template.process=e.precompiled,void EJS.update(this.name,this);if(e.element){if("string"==typeof e.element){var t=e.element;if(e.element=document.getElementById(e.element),null==e.element)throw t+"does not exist!"}e.element.value?this.text=e.element.value:this.text=e.element.innerHTML,this.name=e.element.id,this.type="["}else if(e.url){e.url=EJS.endExt(e.url,this.extMatch),this.name=this.name?this.name:e.url;var n=e.url;if(i=EJS.get(this.name,this.cache))return i;if(i==EJS.INVALID_PATH)return null;try{this.text=EJS.request(n+(this.cache?"":"?"+Math.random()))}catch(e){}if(null==this.text)throw{type:"EJS",message:"There is no template at "+n}}var i;(i=new EJS.Compiler(this.text,this.type)).compile(e,this.name),EJS.update(this.name,this),this.template=i},EJS.prototype={render:function(e,t){e=e||{},this._extra_helpers=t;var n=new EJS.Helpers(e,t||{});return this.template.process.call(e,e,n)},update:function(element,options){if("string"==typeof element&&(element=document.getElementById(element)),null==options)return _template=this,function(e){EJS.prototype.update.call(_template,element,e)};"string"==typeof options?(params={},params.url=options,_template=this,params.onComplete=function(request){var object=eval(request.responseText);EJS.prototype.update.call(_template,element,object)},EJS.ajax_request(params)):element.innerHTML=this.render(options)},out:function(){return this.template.out},set_options:function(e){this.type=e.type||EJS.type,this.cache=null!=e.cache?e.cache:EJS.cache,this.text=e.text||null,this.name=e.name||null,this.ext=e.ext||EJS.ext,this.extMatch=new RegExp(this.ext.replace(/\./,"."))}},EJS.endExt=function(e,t){return e?(t.lastIndex=0,e+(t.test(e)?"":this.ext)):null},EJS.Scanner=function(e,t,n){extend(this,{left_delimiter:t+"%",right_delimiter:"%"+n,double_left:t+"%%",double_right:"%%"+n,left_equal:t+"%=",left_comment:t+"%#"}),this.SplitRegexp="["==t?/(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/:new RegExp("("+this.double_left+")|(%%"+this.double_right+")|("+this.left_equal+")|("+this.left_comment+")|("+this.left_delimiter+")|("+this.right_delimiter+"\n)|("+this.right_delimiter+")|(\n)"),this.source=e,this.stag=null,this.lines=0},EJS.Scanner.to_text=function(e){return null==e||void 0===e?"":e instanceof Date?e.toDateString():e.toString?e.toString():""},EJS.Scanner.prototype={scan:function(e){if(scanline=this.scanline,regex=this.SplitRegexp,""==!this.source)for(var t=rsplit(this.source,/\n/),n=0;n<t.length;n++){var i=t[n];this.scanline(i,regex,e)}},scanline:function(e,t,n){this.lines++;for(var i=rsplit(e,t),r=0;r<i.length;r++){var s=i[r];if(null!=s)try{n(s,this)}catch(e){throw{type:"EJS.Scanner",line:this.lines}}}}},EJS.Buffer=function(e,t){this.line=new Array,this.script="",this.pre_cmd=e,this.post_cmd=t;for(var n=0;n<this.pre_cmd.length;n++)this.push(e[n])},EJS.Buffer.prototype={push:function(e){this.line.push(e)},cr:function(){this.script=this.script+this.line.join("; "),this.line=new Array,this.script=this.script+"\n"},close:function(){if(this.line.length>0){for(var e=0;e<this.post_cmd.length;e++)this.push(pre_cmd[e]);this.script=this.script+this.line.join("; "),line=null}}},EJS.Compiler=function(e,t){this.pre_cmd=["var ___ViewO = [];"],this.post_cmd=new Array,this.source=" ",null!=e&&("string"==typeof e?(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n"),this.source=e):e.innerHTML&&(this.source=e.innerHTML),"string"!=typeof this.source&&(this.source=""));var n=">";switch(t=t||"<"){case"[":n="]";break;case"<":break;default:throw t+" is not a supported deliminator"}this.scanner=new EJS.Scanner(this.source,t,n),this.out=""},EJS.Compiler.prototype={compile:function(options,name){options=options||{},this.out="";var put_cmd="___ViewO.push(",insert_cmd=put_cmd,buff=new EJS.Buffer(this.pre_cmd,this.post_cmd),content="",clean=function(e){return e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/"/g,'\\"')};this.scanner.scan(function(e,t){if(null==t.stag)switch(e){case"\n":content+="\n",buff.push(put_cmd+'"'+clean(content)+'");'),buff.cr(),content="";break;case t.left_delimiter:case t.left_equal:case t.left_comment:t.stag=e,content.length>0&&buff.push(put_cmd+'"'+clean(content)+'")'),content="";break;case t.double_left:content+=t.left_delimiter;break;default:content+=e}else switch(e){case t.right_delimiter:switch(t.stag){case t.left_delimiter:"\n"==content[content.length-1]?(content=chop(content),buff.push(content),buff.cr()):buff.push(content);break;case t.left_equal:buff.push(insert_cmd+"(EJS.Scanner.to_text("+content+")))")}t.stag=null,content="";break;case t.double_right:content+=t.right_delimiter;break;default:content+=e}}),content.length>0&&buff.push(put_cmd+'"'+clean(content)+'")'),buff.close(),this.out=buff.script+";";var to_be_evaled="/*"+name+"*/this.process = function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {"+this.out+" return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}};";try{eval(to_be_evaled)}catch(e){if("undefined"==typeof JSLINT)throw e;JSLINT(this.out);for(var i=0;i<JSLINT.errors.length;i++){var error=JSLINT.errors[i];if("Unnecessary semicolon."!=error.reason){error.line++;var err=new Error;throw err.lineNumber=error.line,err.message=error.reason,options.view&&(err.fileName=options.view),err}}}}},EJS.config=function(e){EJS.cache=null!=e.cache?e.cache:EJS.cache,EJS.type=null!=e.type?e.type:EJS.type,EJS.ext=null!=e.ext?e.ext:EJS.ext;var t=EJS.templates_directory||{};EJS.templates_directory=t,EJS.get=function(e,n){return 0==n?null:t[e]?t[e]:null},EJS.update=function(e,n){null!=e&&(t[e]=n)},EJS.INVALID_PATH=-1},EJS.config({cache:!0,type:"<",ext:".ejs"}),EJS.Helpers=function(e,t){this._data=e,this._extras=t,extend(this,t)},EJS.Helpers.prototype={view:function(e,t,n){return n||(n=this._extras),t||(t=this._data),new EJS(e).render(t,n)},to_text:function(e,t){return null==e||void 0===e?t||"":e instanceof Date?e.toDateString():e.toString?e.toString().replace(/\n/g,"<br />").replace(/''/g,"'"):""}},EJS.newRequest=function(){for(var e=[function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new XMLHttpRequest},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=0;t<e.length;t++)try{var n=e[t]();if(null!=n)return n}catch(e){continue}},EJS.request=function(e){var t=new EJS.newRequest;t.open("GET",e,!1);try{t.send(null)}catch(e){return null}return 404==t.status||2==t.status||0==t.status&&""==t.responseText?null:t.responseText},EJS.ajax_request=function(e){e.method=e.method?e.method:"GET";var t=new EJS.newRequest;t.onreadystatechange=function(){4==t.readyState&&(t.status,e.onComplete(t))},t.open(e.method,e.url),t.send(null)}}();
;Dependency._js['lib/ejs/ejs']=true;

;
function HttpRequest(e){return this.setURL(e),this.onerror=null,this}"undefined"!=typeof Dependency&&Dependency.addJS("main"),HttpRequest._log_alert=function(e){"undefined"!=typeof console&&(console.log(e),"function"==typeof console.trace&&console.trace())},HttpRequest.dummy=function(e){},HttpRequest.httppool=new Array,HttpRequest.onerror=function(e){var t="errormsg"in e?e.errormsg:e.message,r=_("Error:\n%a").replace("%a",t);HttpRequest._log_alert(r),alert(r)},HttpRequest.prototype.callMultiRPC=function(e,t,r,n){t||(t=this.onerror);return HttpRequest.invoke(this.url,HttpRequest.prepareMultiRPC(e,n),HttpRequest.processRPC,function(n){for(var o=0;o<n.length;o++){var a=n[o];if("struct"==XMLRPC.getDataType(a)&&a.faultCode){var u=t;e[o].length>=4&&(u=e[o][3]),u(new Error(new String(a.faultString)))}else if(e[o].length>=3){var i=e[o][2];i&&i(a)}}r&&r(n)},t||this.onerror)},HttpRequest.prototype.callJSONGET=function(e,t,r,n){var o=this.url,a=HttpRequest.prepareJSON(e,t);if(a.data.length<1500){t=HttpRequest.buildData({rpcreq:a.data});o.indexOf("?")>=0?o+="&"+t:o+="?"+t,o.length>1900?o=this.url:(a.cmd="GET",delete a.data,delete a.mimetype)}return HttpRequest.invoke(o,a,HttpRequest.processJSON,r,n||this.onerror)},HttpRequest.prototype.callJSON=function(e,t,r,n){return HttpRequest.invoke(this.url,HttpRequest.prepareJSON(e,t),HttpRequest.processJSON,r,n||this.onerror)},HttpRequest.prototype.callRPC=function(e,t,r,n){return HttpRequest.invoke(this.url,HttpRequest.prepareRPC(e,t),HttpRequest.processRPC,r,n||this.onerror)},HttpRequest.prototype.doHEAD=function(e,t){var r=this.url;return HttpRequest.invoke(r,{cmd:"HEAD"},function(){},e,t||this.onerror,!0)},HttpRequest.prototype.doGET=function(e,t,r){var n=this.url;"object"==typeof e?e=HttpRequest.buildData(e):"string"!=typeof e&&(e=""),""!=e&&(n.indexOf("?")>=0?n+="&"+e:n+="?"+e);return HttpRequest.invoke(n,{cmd:"GET"},HttpRequest.process,t,r||this.onerror)},HttpRequest.prototype.doPOST=function(e,t,r,n){"object"==typeof e?e=HttpRequest.buildData(e,n):"string"!=typeof e&&(e="");var o={cmd:"POST",data:e,mimetype:"<?xml"==e.substring(0,5)?"text/xml":"application/x-www-form-urlencoded"};return HttpRequest.invoke(this.url,o,HttpRequest.process,t,r||this.onerror)},HttpRequest.invoke=function(e,t,r,n,o,a){if(!r||"function"!=typeof r)throw new Error('invoke: argument "processor" not defined.');var u=!!n,i=HttpRequest.getHTTP();return i.onreadystatechange=u?function(){if(4==i.readyState){try{n(HttpRequest.receive(i,r))}catch(e){if(0!==e.http_status||a){if(!o)throw e;o(e,this)}else HttpRequest._log_alert("HTTP Error: 0 (User left the page before an ajax call returned.)")}i.abort()}}:document.all?function(){}:null,i.open(t.cmd,e,u),t.data&&i.setRequestHeader("Content-Type",t.mimetype),i.send(t.data?t.data:""),!!u||HttpRequest.receive(i,r)},HttpRequest.prototype.setURL=function(e){e=e?HttpRequest.normaliseURL(e):HttpRequest.getRPC2URL(),this.url=e},HttpRequest.buildData=function(e,t){var r=new Array;if(e instanceof Array)for(var n=0;n<e.length;n++){var o=e[n][0];if((u=e[n][1])instanceof Array)for(var a=0;a<u.length;a++)r.push(encodeURIComponent(o)+"="+encodeURIComponent(u[a]));else r.push(encodeURIComponent(o)+"="+encodeURIComponent(u))}else for(var o in e){var u;if((u=e[o])||t&&void 0!==u&&null!==u)if(u instanceof Array)for(a=0;a<u.length;a++)r.push(encodeURIComponent(o)+"="+encodeURIComponent(u[a]));else r.push(encodeURIComponent(o)+"="+encodeURIComponent(u))}return r.join("&")},HttpRequest.getHTTP=function(){for(var e,t=0;t<HttpRequest.httppool.length;t++)if(0==(e=HttpRequest.httppool[t]).readyState)return e;if(window.XMLHttpRequest)e=new XMLHttpRequest;else{if(!window.ActiveXObject)throw new Error("Cannot create HTTP Request object.");e=new ActiveXObject("Microsoft.XMLHTTP")}return HttpRequest.httppool.push(e),e},HttpRequest.getRPC2URL=function(){if(!HttpRequest.rpc2url){var e=getBaseURL()+"/RPC2/";HttpRequest.rpc2url=HttpRequest.normaliseURL(e)}return HttpRequest.rpc2url},HttpRequest.normaliseURL=function(e){if(!/^https?:\/\//.test(e)){var t=new String(document.location);e=/^\//.test(e)?t.replace(/^(https?:\/\/[^\/]+)?.*/,"$1"+e):t.replace(/\/[^\/]*$/,"/"+e)}return e},HttpRequest.openTracebackBox=function(){var e=getBaseURL()+"/home/error/tracebackbox";window.open(e,"tracebackbox","height=350,width=500,heading=no,topbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,border=no")},HttpRequest.prepareMultiRPC=function(e,t){void 0===t&&(t=!0);for(var r=new Array,n=0;n<e.length;n++){var o={};o.methodName=e[n][0],o.params=e[n][1],r.push(o)}return HttpRequest.prepareRPC("system.multicall",[r,t])},HttpRequest.prepareJSON=function(e,t){var r={method:e,params:t,id:1};return{cmd:"POST",data:XPLAN.json.encode(r),mimetype:"application/json"}},HttpRequest.prepareRPC=function(e,t){var r;r='<?xml version="1.0"?>\n',r+="<methodCall>\n",r+="<methodName>"+e+"</methodName>\n",r+="<params>\n";for(var n=0;n<t.length;n++)r+="<param>\n",r+="<value>"+XMLRPC.encodeXML(t[n])+"</value>\n",r+="</param>\n";return r+="</params>\n",{cmd:"POST",data:r+="</methodCall>",mimetype:"text/xml"}},HttpRequest.process=function(e){var t=e.getResponseHeader("Content-Type");return"text/xml"==t.substring(0,8)?e.responseXML:"application/json"==t.substring(0,18)?XPLAN.json.decode(e.responseText):e.responseText},HttpRequest.processJSON=function(e){var t=XPLAN.json.decode(e.responseText);if(t){if(t.error)throw-32501!=t.error.faultCode&&-32502!=t.error.faultCode||getMainFrame().location.reload(),-32505==t.error.faultCode&&HttpRequest.openTracebackBox(),new Error(new String(t.error.faultString));return t.result}throw new Error("XMLRPC: Invalid JSON")},HttpRequest.processRPC=function(e){var t=e.responseXML;if(t)return XMLRPC.decodeResponse(t);throw new Error("XMLRPC: Invalid RPC response - not DOM.")},HttpRequest.receive=function(e,t){if(200==e.status)return t(e);var r=new Error("HTTP: "+e.status+" "+e.statusText);throw console.log(e.responseText),r.http_status=e.status,r},XMLRPC={},XMLRPC.iso8601=new RegExp("^(\\d{4})(\\d{2})(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})"),XMLRPC.call=function(e,t,r,n){return(new HttpRequest).callJSON(e,t,r,n)},XMLRPC.callGET=function(e,t,r,n){return(new HttpRequest).callJSONGET(e,t,r,n)},XMLRPC.decodeDOM=function(e){switch(e.tagName){case"string":for(var t="",r=0;r<e.childNodes.length;r++){t+=(o=e.childNodes[r]).data}return t;case"int":case"i4":return e.firstChild?parseInt(e.firstChild.data):0;case"double":return e.firstChild?parseFloat(e.firstChild.data):0;case"dateTime.iso8601":return XMLRPC.iso8601.test(e.firstChild.nodeValue)?new Date(RegExp.$1,RegExp.$2-1,RegExp.$3,RegExp.$4,RegExp.$5,RegExp.$6):new Date;case"array":if((e=XMLRPC.getNode(e,0))&&"data"==e.tagName){var n=new Array;for(r=0;r<e.childNodes.length;r++){1==(o=e.childNodes[r]).nodeType&&n.push(XMLRPC.decodeDOM(o))}return n}throw new Error("XMLRPC: Invalid RPC Response on <array />.");case"struct":for(n={},r=0,r=0;r<e.childNodes.length;r++){var o;if(1==(o=e.childNodes[r]).nodeType&&"member"==o.tagName){var a=XMLRPC.getNode(o,0),u=XMLRPC.getNode(o,1);a.childNodes.length>0&&(n[a.firstChild.nodeValue]=XMLRPC.decodeDOM(u))}else if(1==o.nodeType)throw new Error("XMLRPC: Invalid RPC Response on <struct />.")}return n;case"boolean":return isNaN(parseInt(e.firstChild.data))?"true"==e.firstChild.data:parseInt(e.firstChild.data);case"base64":return XMLRPC.decodeBase64(e.firstChild.nodeValue);case"value":return(o=XMLRPC.getNode(e,0))?XMLRPC.decodeDOM(o):e.firstChild?e.firstChild.data:"";default:return!1}},XMLRPC.decodeResponse=function(e){var t=e.getElementsByTagName("fault");if(t.length>0)throw-32501!=(t=XMLRPC.decodeDOM(XMLRPC.firstElementChild(t[0]))).faultCode&&-32502!=t.faultCode||getMainFrame().location.reload(),-32505==t.faultCode&&HttpRequest.openTracebackBox(),new Error(new String(t.faultString));var r=e.getElementsByTagName("param");return 0==r.length?null:XMLRPC.decodeDOM(XMLRPC.getNode(r[0],0))},XMLRPC.encodeXML=function(e){var t=XMLRPC.getDataType(e);switch(t){case"array":for(var r="<array><data>\n",n=0;n<e.length;n++)r+="<value>"+XMLRPC.encodeXML(e[n])+"</value>\n";return r+="</data></array>\n";case"date":return"<dateTime.iso8601>"+XMLRPC.dateToISO8601(e)+"</dateTime.iso8601>";case"struct":r="<struct>\n";for(var n in e)r+="<member>\n",r+="<name>"+n+"</name>\n",r+="<value>"+XMLRPC.encodeXML(e[n])+"</value>\n",r+="</member>\n";return r+="</struct>\n";case"boolean":return"<boolean>"+(e?"1":"0")+"</boolean>";case"string":e=(e=(e=new String(e)).replace(/&/g,"&amp;")).replace(/</g,"&lt;");default:return"<"+t+">"+e+"</"+t+">"}},XMLRPC.isArray=function(e){return e instanceof Array||e.push&&e.pop&&void 0!=e.length},XMLRPC.isDate=function(e){return e instanceof Date||e.getFullYear&&e.getMonth&&e.getDate},XMLRPC.getDataType=function(e){var t=typeof e;switch(t=t.toLowerCase()){case"number":return Math.round(e)==e?"i4":"double";case"object":return XMLRPC.isArray(e)?"array":XMLRPC.isDate(e)?"date":"struct";default:return t}},XMLRPC.dateToISO8601=function(e){return new String(e.getFullYear())+XMLRPC.leadingZero(new String(e.getMonth()+1))+XMLRPC.leadingZero(new String(e.getDate()))+"T"+XMLRPC.leadingZero(new String(e.getHours()))+":"+XMLRPC.leadingZero(new String(e.getMinutes()))+":"+XMLRPC.leadingZero(new String(e.getSeconds()))},XMLRPC.leadingZero=function(e){return 1==e.length?"0"+e:e},XMLRPC.decodeBase64=function(e){if(e.length%4>0)return e;if("undefined"!=typeof atob)return atob(e);var t,r,n="",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/\W|=/g,""),r=0;r<e.length;r+=4)t=(255&o.indexOf(e.charAt(r)))<<18|(255&o.indexOf(e.charAt(r+1)))<<12|(255&o.indexOf(e.charAt(r+2)))<<6|255&o.indexOf(e.charAt(r+3)),n+=String.fromCharCode(t>>16&255,t>>8&255,255&t);return n.substring(0,n.length-(61==e.charCodeAt(r-2)?2:61==e.charCodeAt(r-1)?1:0))},XMLRPC.getNode=function(e,t){var r=0;if(null==e)return!1;for(var n=0;n<e.childNodes.length;n++){var o=e.childNodes[n];if(1==o.nodeType&&r++==t)return o}return!1},XMLRPC.firstElementChild=function(e){for(e=e.firstChild;e&&1!==e.nodeType;)e=e.nextSibling;return e},XMLRPC.deferred_call=function(e,t){var r=jQuery.Deferred();return XMLRPC.call(e,t,function(e){r.resolve(e)},function(e){HttpRequest.onerror(e),r.reject(e)}),r.promise()},XMLRPCMulti={queue:new Array,timer:null,delay:1e3,qsize:10,onerror:function(e){alert(_("Multi-call error: %a").replace("%a",e.message))},separate_context:!0},XMLRPCMulti.callMulti=function(e,t){for(var r in e)if(e.hasOwnProperty(r)){var n=e[r].when;(void 0===n||("function"==typeof n?n():n))&&XMLRPCMulti.queue.push([r,e[r].params,e[r].onresponse,e[r].onerror])}XMLRPCMulti.callAsync(void 0===t?XMLRPCMulti.separate_context:t)},XMLRPCMulti.call=function(e,t,r,n,o){XMLRPCMulti.queue.push([e,t,r,n]),XMLRPCMulti.queue.length<XMLRPCMulti.qsize&&(XMLRPCMulti.timer&&clearTimeout(XMLRPCMulti.timer),XMLRPCMulti.timer=setTimeout(function(){XMLRPCMulti.callAsync(void 0===o?XMLRPCMulti.separate_context:o)},XMLRPCMulti.delay))},XMLRPCMulti.callAsync=function(e){if(XMLRPCMulti.queue.length>0){var t=new HttpRequest;if(1==XMLRPCMulti.queue.length){var r=XMLRPCMulti.queue.pop();t.callRPC(r[0],r[1],r[2]||HttpRequest.dummy,r[3]||XMLRPCMulti.onerror)}else t.callMultiRPC(XMLRPCMulti.queue,XMLRPCMulti.onerror,null,e),XMLRPCMulti.queue=new Array}XMLRPCMulti.timer=null},function(e){e.XPLAN.namespace("net");var t=function(e,r,n,o){return t.fn.init(e,r,n,o)};t.fn=t.prototype={constructor:t,init:function(t,r,n,o){var a=this,u=null,i={method:t,params:r,id:Math.floor(2147483647*Math.random())+""};return u={type:"POST",url:getBaseURL()+"/RPC2/",data:JSON.stringify(i),dataType:"json",contentType:"application/json",context:e.document,converters:{"text json":XPLAN.json.decode}},"function"==typeof o&&(u.error=function(e,t,r){o.apply(a,r)}),"function"==typeof n&&(u.success=function(e,t,r){n(e.result)}),jQuery.ajax(u)}},e.XPLAN.net.makeRequest=t}(window),QueuedXMLRPC=function(){var e=null;this.call=function(t,r,n,o){var a=jQuery.Deferred();this.setup().done(function(){XMLRPC.call(t,r,function(e){a.resolve(),n(e)},function(e){a.resolve(),null==o&&(o=HttpRequest.onerror),o(e)})}),e=a.promise()},this.setup=function(){var t=jQuery.Deferred();return jQuery.when(e).always(function(){t.resolve()}),t.promise()}};var LimitQueuedXMLRPC=function(e,t){function r(){var e=n.shift();return void 0!==e&&e.on_discard&&e.on_discard({discarded_by_queue:!0}),e}e=e||1,t=t||1;var n=[],o=0;this.call=function(a,u,i,s,l){!function(t,o,a,u,i){for(;n.length>=e;)r();n.push({method:t,args:o,success:a,error:u,on_discard:i})}(a,u,i,s,l),function e(){if(!(o>=t)){var r=n.shift();if(void 0!==r){var a=jQuery.Deferred();o++,XMLRPC.call(r.method,r.args,function(e){a.resolve(),r.success(e)},function(e){a.resolve(),(r.error||HttpRequest.onerror)(e)}),a.always(function(){o--,e()})}}}()},this.clear_queued=function(){for(;n.length>0;)r()}};
;Dependency._js['httpreq']=true;

;
function PopupContent(t){return this.html=t,this}function PopupURL(t){return this.url=t,this.hide_on_blur=!1,this.inc_height=0,this.inc_width=0,this.height=null,this.width=null,this}function PopupURL2(t,e,o){return this.url=t,this.width=e,this.height=o,this.hide_on_blur=!1,this}function PopupHelpTip(t,e,o){return this.html=t,this.width=e,this.height=o,this}function PopupMsgBox(t,e){return this.html=t,this.caption=e,this.onclose=null,this.oncancel=null,this.button=0,this.prompt=null,this}function PopupForm(t,e,o,n){return this.html=t,this.caption=e,this.onclose=null,this.iterative=o,this.width=n,this}function PopupContent2(t){return this.html=t,this.div=null,this}function PopupForm2(t,e,o){return this.html=t,this.caption=e,this.onclose=null,this.iterative=o,this}function PopupFrame(t){var e=getMainFrame(),o=getFrameDoc(e),n=jQuery('<iframe id="popupframe" class="popupframe" src="'+getBaseURL()+'/static/dummy.html" frameborder="0" scrolling="no"/>',o).appendTo(o.body);this.doc=o,this.frame=n,this.framenew=null,this.shown=!1,this.firsttime=!0,this.level=t,this.x=null,this.y=null}function PopupDiv(t,e){var o=getMainFrame(),n=null;n=e?jQuery(e).get(0).ownerDocument:getFrameDoc(o);var i=jQuery('<div class="popupdiv" id="popupdiv-'+t+'"><div class="popupdivinner"></div></div>',n).hide();null==e?i.appendTo(n.body):i.insertAfter(e),this.div=i,this.divnext=null,this.doc=n,this.shown=!1,this.level=t,this.x=null,this.y=null}function PopupURL3(t,e){return this.url=t,this.onclose=null,this.oncancel=null,this.button=0,this.prompt=null,this.handle_mouse=!0,this.updateAttrs(e,["caption","onclose","prompt","width","height","oncancel"]),this.button=e.button||[["ok",_("Ok")]],this.html='<iframe style="background-color:white" class="PopupURL2" src="'+getBaseURL()+this.url+'" width="'+(this.width-20)+'px" height="'+(this.height-80)+'px" frameborder="0" scrolling="auto"/>',this.enableEggTimer=e.enableEggTimer,this}function PopupYouTube(t,e){return this.videohash="0NogltmewmQ",this.caption=t,this.width=1e3,this.height=562,this.updateAttrs(e,["width","height"]),this}Date.now||(Date.now=function(){return(new Date).getTime()}),XPLAN.util.update(PopupContent,{css:getBaseURL()+"/css/",img:getBaseURL()+"/img/",dummy:function(){return!1},handleSelect:function(t){var e=t.target;return"INPUT"==e.tagName&&"text"==e.type||"TEXTAREA"==e.tagName}}),PopupContent.getHTMLSkel=function(t,e){return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" class="'+t+'">\n<head><link rel="StyleSheet" type="text/css" href="'+PopupContent.css+'main.css" />\n<link rel="StyleSheet" type="text/css" href="'+PopupContent.css+'popup.css" />\n</head>\n<body class="'+t+'">\n<script type="text/javascript" src="'+getBaseURL()+'/js/lib/jquery/jquery.js"><\/script>\n<script type="text/javascript" defer="defer">var jQuery=window.parent.jQuery;jQuery.noConflict();<\/script>\n'+e+"\n</body>\n</html>"},PopupContent.prototype.getSizeAdjustment=function(t,e){return[t,e]},PopupContent.prototype.onBlur=function(){return!0},PopupContent.prototype.onPostShow=function(t){},PopupContent.prototype.updateAttrs=function(t,e){for(var o=0;o<e.length;o++){var n=e[o];t[n]&&(this[n]=t[n],delete t[n])}},PopupContent.prototype.updateContent=function(t){var e=t.getDocument();e.open("text/html","replace"),e.write(PopupContent.getHTMLSkel("Content",this.html)),e.close()},PopupURL.showCentre=function(t,e,o,n){var i=new PopupURL(t),p={height:o,modal:n,width:e},u=["width","height","hide_on_blur","onclose"];"object"==XPLAN.util.getType(e)&&(p=e);for(var r=0;r<u.length;r++){var s=u[r];p[s]&&(i[s]=p[s])}return p.modal&&ModalUtil.setModal(!0),popup=PopupFrame.getPopup(i),popup.showCentre(),popup},PopupURL.prototype=new PopupContent,PopupURL.prototype.getSizeAdjustment=function(t,e){return this.width&&this.height?[this.width,this.height]:[t+this.inc_width,e+this.inc_height]},PopupURL.prototype.onBlur=function(){return this.hide_on_blur},PopupURL.prototype.updateContent=function(t){t.frame.attr("src",getBaseURL()+this.url)},PopupURL2.show=function(t,e){var o=new PopupURL2(t,e.width,e.height);return o.updateAttrs(e,["hide_on_blur"]),e.x&&e.y||(e.centre=!0),PopupDiv.show(o,e)},PopupURL2.prototype=new PopupContent,PopupURL2.prototype.onBlur=function(){return this.hide_on_blur},PopupURL2.prototype.updateContent=function(t){jQuery('<iframe id="PopupURL2" class="PopupURL2" src="'+getBaseURL()+this.url+'" frameborder="0" scrolling="no"/>',t.doc).width(this.width).height(this.height).appendTo(t.div.children())},PopupHelpTip.bindHover=function(t,e){var o=null;"string"==XPLAN.util.getType(e)&&(e=jQuery(e)),e.hover(function(e){o=PopupHelpTip.show(t,{evt:e,nohide:!0})},function(){o&&(o.hide(),o=null)})},PopupHelpTip.show=function(t,e){return e||(e={}),PopupDiv.show(new PopupHelpTip(t,e.width,e.height),e)},PopupHelpTip.showByClick=function(t,e,o,n){return PopupDiv.show(new PopupHelpTip(t,o,n),{evt:e})},PopupHelpTip.hideLast=function(){return PopupDiv.hideLast()},PopupHelpTip.prototype=new PopupContent,PopupHelpTip.prototype.updateContent=function(t){var e=jQuery('<div class="HelpTip">'+this.html+"</div>",t.doc).appendTo(t.div.children()).bind("contextmenu",PopupContent.dummy).bind("selectstart",PopupContent.handleSelect);this.width&&e.width(this.width),this.height&&e.height(this.height).css("overflow","auto")},PopupMsgBox.show_confirm_html=function(t,e,o,n,i,p){var u=n||_("Confirm");return PopupMsgBox.show_generic_html(t,u,{button:p||[["yes",_("Yes")],["no",_("No")]],icon:"icon-warning.png",onclose:e,width:o,oncancel:i})},PopupMsgBox.show_confirm_text=function(t,e,o,n,i,p){return PopupMsgBox.show_confirm_html(XPLAN.util.escape(t),e,o,n,i,p)},PopupMsgBox.show_error_html=function(t,e){return PopupMsgBox.show_generic_html(t,_("Error"),{icon:"icon-error.png",onclose:e})},PopupMsgBox.show_error_text=function(t,e){return PopupMsgBox.show_error_html(XPLAN.util.escape(t),e)},PopupMsgBox.show_generic_html=function(t,e,o){var n=new PopupMsgBox(t,e);return o=o||{},n.updateAttrs(o,["onclose","prompt","width","height","oncancel"]),n.button=o.button||[["ok",_("Ok")]],o.icon&&(n.icon=PopupContent.img+o.icon),o.x&&o.y||(o.centre=!0),PopupDiv.show(n,o)},PopupMsgBox.show_generic_text=function(t,e,o){return PopupMsgBox.show_generic_html(XPLAN.util.escape(t),e,o)},PopupMsgBox.show_info_html=function(t,e){return PopupMsgBox.show_generic_html(t,_("Information"),{icon:"icon-info.png",onclose:e})},PopupMsgBox.show_info_text=function(t,e){return PopupMsgBox.show_info_html(XPLAN.util.escape(t),e)},PopupMsgBox.show_bgtask_notification=function(t,e){var o="<p>"+XPLAN.util.escape(t?t+" ":_("The report is now being generated asynchronously in the background. \n"));o+=XPLAN.util.escape(_("A message will be sent to you when it is completed and ready for download. \n")),o+=XPLAN.util.escape(_("You will be notified by the envelope at the top right hand corner.\n"))+"</p>",PopupMsgBox.show_info_html(o,e)},PopupMsgBox.show_bgtask_already_running_notification=function(t,e,o){var n="<p>"+XPLAN.util.escape(e?e+" ":_("The report is already being generated asynchronously in the background (with job id %a).").replace("%a",t)+"\n");n+=XPLAN.util.escape(_("A message will be sent to you when it is completed and ready for download. \n")),n+=XPLAN.util.escape(_("You will be notified by the envelope at the top right hand corner.\n"))+"</p>",PopupMsgBox.show_info_html(n,o)},PopupMsgBox.show_warning_html=function(t,e,o,n){var i=n||_("Warning");return PopupMsgBox.show_generic_html(t,i,{icon:"icon-warning.png",onclose:e,width:o})},PopupMsgBox.show_warning_text=function(t,e,o,n){return PopupMsgBox.show_warning_html(XPLAN.util.escape(t),e,o,n)},PopupMsgBox.getButtonFunc=function(t,e){return function(){return e.hide(),t.onclose&&t.onclose(jQuery(this).text()),!1}},PopupMsgBox.getButtonPromptFunc=function(t,e){return function(){return e.hide(),t.onclose&&t.onclose(e.div.find("input:text").val()),!1}},PopupMsgBox.init=function(t,e){var o=e.xplanelem,n='<div class="MsgBox2"'+(o?' data-xplan-elem="'+o+'"':"")+">"+(e.title?'<h2 class="MsgBox-Title"></h2>':"")+(e.icon?'<div class="MsgBox-Icon"><img/></div>':"")+'<div class="MsgBox-Content'+(e.icon?" MsgBox-Content-Icon":"")+'"></div></div>',i=jQuery(n,t.doc).appendTo(t.div.children()).width(e.width);if(e.height&&i.height(e.height),e.title&&i.children("h2.MsgBox-Title").text(e.title).prepend('<a class="panelbutton close" data-xplan-elem="popup_btn_close"></a>').children("a").click(function(){t.hide(),t.content.oncancel&&t.content.oncancel()}),e.icon&&i.find("div.MsgBox-Icon > img").attr("src",e.icon),e.buttons){for(var p=jQuery('<div class="MsgBox-Button"/>',t.doc).appendTo(i),u=0;u<e.buttons.length;u++){var r=e.buttons[u],s="",h="";"string"==typeof r[0]?(s=r[0],h=r[0]):(s=r[0][0],h=r[0][1]),jQuery("<button/>",t.doc).attr("id","popup_btn_"+s).text(h).click(r[1]).appendTo(p)}jQuery("<br/>",t.doc).appendTo(i).css("clear","both")}return i.children("div.MsgBox-Content")},PopupMsgBox.prototype=new PopupContent,PopupMsgBox.prototype.onBlur=function(){return!1},PopupMsgBox.prototype.onPostShow=function(t){null!=this.prompt&&t.div.find("input").focus().select()},PopupMsgBox.prototype.updateContent=function(t){var e={icon:this.icon,title:this.caption?this.caption:"Message",height:this.height?this.height:0,width:this.width?this.width:this.icon?290:250};if(this.prompt)e.buttons=[[["ok",_("Ok")],PopupMsgBox.getButtonPromptFunc(this,t)],[["cancel",_("Cancel")],function(){t.hide()}]];else if(this.button){for(var o=[],n=0;n<this.button.length;n++)o.push([this.button[n],PopupMsgBox.getButtonFunc(this,t)]);e.buttons=o}var i=PopupMsgBox.init(t,e);i.html(this.html),this.prompt&&jQuery('<div class="MsgBox-Prompt"><input type="text"/></div>',t.doc).insertAfter(i).children("input").val(this.prompt)},PopupForm.getOkFunc=function(t,e,o){return function(){if(t.onbeforeclose||t.onclose)var n=getFormPostData(o,!0);return!(t.onbeforeclose&&!t.onbeforeclose(n,e.getDocument()))&&(e.hide(),t.onclose&&t.onclose(n),!1)}},PopupForm.getApplyFunc=function(t,e,o){return function(){return t.onapply&&t.onapply(getFormPostData(o,!0)),!1}},PopupForm.getDoneFunc=function(t,e,o){return function(){return t.ondone&&t.ondone(e.getDocument()),e.hide(),!1}},PopupForm.getCancelFunc=function(t,e,o){return function(){return t.oncancel&&t.oncancel(e.getDocument()),e.hide(),!1}},PopupForm.initBody=function(t,e,o){var n=t.getDocument();e=PopupContent.getHTMLSkel("MsgBox",e),n.open("text/html","replace"),n.write(e),n.close(),jQuery(n.body).bind("contextmenu",PopupContent.dummy).bind("selectstart",PopupContent.handleSelect);var i=jQuery("<div/>",n).appendTo(n.body);return o&&i.css("width",o),i},PopupForm.initButton=function(t,e,o){return"string"==typeof e?(id=e,text=e):(id=e[0],text=e[1]),t.append("<button/>").children("button:last").attr("id","btn_"+id).text(text).click(o)},PopupForm.initButtonBar=function(t){var e=t.children("#button-bar");return e.length||(e=t.append('<div id="button-bar" class="MsgBox-Button"/>').children("div:last")),e},PopupForm.initMainPane=function(t,e){var o;t.ownerDocument;if(e){var n=(o=t.append('<table cellpadding="0" cellspacing="0"/>').children("table:last").get(0)).insertRow(0);n.vAlign="top",jQuery(n.insertCell(0)).addClass("MsgBox-Icon").append("<img/>").children("img").attr("src",e),o=jQuery(n.insertCell(1))}else o=t.append("<div/>").children("div:last");return o.addClass("MsgBox-Content"),o},PopupForm.initTitle=function(t,e,o){return t.append('<div id="MsgBoxTitle" class="MsgBox-Title"/>').children("div:last").text(e||"Message")},PopupForm.prototype=new PopupContent,PopupForm.prototype.addCSS=function(t){this._css||(this._css=new Array),this._css.push(t)},PopupForm.prototype.addJS=function(t){this._js||(this._js=new Array),this._js.push(t)},PopupForm.prototype.getInitHTML=function(){var t="";if(this._css)for(var e=0;e<this._css.length;e++)t+='<link rel="StyleSheet" type="text/css" href="'+this._css[e]+'" />\n';if(this._js)for(e=0;e<this._js.length;e++)t+='<script type="text/javascript" src="'+this._js[e]+'"><\/script>\n';return t},PopupForm.prototype.onBlur=function(){return!1},PopupForm.prototype.onPostShow=function(t){var e=t.getDocument();jQuery("input:text,select,textarea",e).eq(0).focus()},PopupForm.prototype.updateContent=function(t){var e=this.getInitHTML();this.width||(this.width=this.icon?350:330);var o,n=PopupForm.initBody(t,e),i=n.get(0).ownerDocument;PopupForm.initTitle(n,this.caption,t,!0),o=PopupForm.initMainPane(n,this.icon);var p=i.createDocumentFragment(),u=[];jQuery(p).append(this.html);var r,s=i.getElementsByTagName("head")[0],h=jQuery('<form name="input"/>',i).append(p).css("margin","0").appendTo(o).bind("submit",function(){return!1}).get(0);u&&jQuery.each(u,function(t,e){var o=e.text||e.textContent||e.innerHTML||"",n=e.src,p=i.createElement("script");p.type="text/javascript",n&&(p.src=n),p.text=o,s.insertBefore(p,s.firstChild),s.removeChild(p)}),this.iterative?(r=PopupForm.getApplyFunc(this,t,h),f2=PopupForm.getDoneFunc(this,t,h)):(r=PopupForm.getOkFunc(this,t,h),f2=PopupForm.getCancelFunc(this,t,h)),o=PopupForm.initButtonBar(n),this.iterative?(PopupForm.initButton(o,["apply",_("Apply")],r),PopupForm.initButton(o,["done",_("Done")],f2)):(PopupForm.initButton(o,["ok",_("Ok")],r),PopupForm.initButton(o,["cancel",_("Cancel")],f2)),this.onaddeventhandler&&this.onaddeventhandler(i,t),this.data&&setFormPostData(i.forms[0],this.data)},PopupContent2.prototype=new PopupContent,PopupContent2.prototype.updateContent=function(t){t.div.html(this.html),this.div=t.div},PopupContent2.prototype.hide=function(){this.div.hide();var t=getMainFrame().PopupDiv;t&&t.hideAll()},PopupForm2.getApplyFunc=function(t,e){return function(){return t.onapply&&t.onapply(getFormPostData(PopupForm2.getForm(e),!0)),!1}},PopupForm2.getCancelFunc=function(t,e){return function(){return t.oncancel&&t.oncancel(e.div),e.hide(),!1}},PopupForm2.getDoneFunc=function(t,e){return function(){return t.ondone&&t.ondone(e.div),e.hide(),!1}},PopupForm2.getForm=function(t){return t.div.find("form").get(0)},PopupForm2.getOkFunc=function(t,e){return function(){if(t.onbeforeclose||t.onclose)var o=getFormPostData(PopupForm2.getForm(e),!0);return!(t.onbeforeclose&&!t.onbeforeclose(o,e.div,this))&&(e.hide(),t.onclose&&t.onclose(o),!1)}},PopupForm2.show=function(t,e,o){var n=new PopupForm2(t,e,!!o.interactive);return n.updateAttrs(o,["width","height","data","hide_on_blur","nocaption","onclose","ondone","onapply","oncancel","onbeforeclose","onupdatecontent","onaftershow","xplanelem","no_buttons","onblur"]),o.icon&&(n.icon=PopupContent.img+o.icon),o.x&&o.y||(o.centre=!0),PopupDiv.show(n,o),n},PopupForm2.prototype=new PopupContent,PopupForm2.prototype.onBlur=function(){return this.onblur&&this.onblur(),!!this.hide_on_blur},PopupForm2.prototype.onPostShow=function(t){var e=t.div.find("input:text,select,textarea");e.length&&e.eq(0).select(),this.onaftershow&&this.onaftershow(t)},PopupForm2.prototype.updateContent=function(t){var e={icon:this.icon,height:this.height?this.height:0,width:this.width?this.width:400,xplanelem:this.xplanelem};this.nocaption||(e.title=this.caption||"Input Form"),this.no_buttons||(this.iterative?e.buttons=[[["apply",_("Apply")],PopupForm2.getApplyFunc(this,t)],[["done",_("Done")],PopupForm2.getDoneFunc(this,t)]]:e.buttons=[[["ok",_("Ok")],PopupForm2.getOkFunc(this,t)],[["cancel",_("Cancel")],PopupForm2.getCancelFunc(this,t)]]);var o=PopupMsgBox.init(t,e),n=jQuery('<form name="input"><div id="popup_content"></div></form>',t.doc).bind("submit",function(){return!1}).appendTo(o);n.children("div#popup_content").html(this.html),this.onupdatecontent&&this.onupdatecontent(o),this.data&&setFormPostData(n.get(0),this.data)};var AbstractMenuElement=function(){};AbstractMenuElement.prototype=new PopupContent,AbstractMenuElement.prototype.appendRow=function(t,e){var o=jQuery('<li role="menuitem" />').appendTo(t);if(e)return o;o.addClass("Menu-Item");var n=this.is_menu?"menu":"item";if(this.href&&!this.disabled){var i={target:this.link_target,href:this.href};return this.options&&this.options.attributes&&underscore.extend(i,this.options.attributes),jQuery('<a class="button"/>').attr(i).text(this.text).attr("data-type",n).appendTo(o),o}var p=jQuery("<button/>");this.options&&this.options.attributes&&p.attr(this.options.attributes),p.attr("data-type",n),p.appendTo(o),jQuery("<span/>").text(this.text).appendTo(p),this.disabled&&(p.prop("disabled","disabled"),p.addClass("Menu-Item-Disabled"),this.disabled_reason&&p.prop("title",this.disabled_reason));var u=this;return this.action&&p.click(function(){u.disabled||(u._invoked=!0,u.dispatchAction())}).keydown(function(t){13==t.keyCode&&p.click()}),this._invoked=!1,o};var PopupMenu=function(t,e,o,n){return t||(t=new Array),this.title=t.title,this.items=t,this.text=e,this.disabled=o,this.level=-1,this.reverse=!1,this.is_menu=!0,this.popupDiv=null,this.options=n,this};PopupMenu.prototype=new AbstractMenuElement,PopupMenu.invoke_path=new Array,PopupMenu.showDropdown=function(t,e,o,n){var i=PopupMenu.generatePopupMenuFromMenuItems(t),p=jQuery(e),u=p.getXY();u.y+=p.outerHeight(),"right"==n&&(u.x+=p.outerWidth()),o=null==o?null:jQuery(o),PopupMenu.show(i,u.x,u.y,o,n)},PopupMenu.generatePopupMenuFromMenuItems=function(t){if(!t.length||t[0]instanceof PopupMenu||t[0]instanceof PopupMenuItem||t[0]instanceof PopupMenuOption||t[0]instanceof PopupMenuSeparator||t[0]instanceof PopupMenuSelect)return t;try{return function t(e,o){if(!o.length)return o;for(var n=0;n<o.length;n++){var i=o[n];if("menu"===i.type){var p=t([],i.items),u=!!i.disabled;e.push(new PopupMenu(p,i.title,u))}else if("menuitem"===i.type){var r=i.title,s=i.action||null,h=(u=!!i.disabled,i.link?getBaseURL()+i.link:null),a=i.target||null;e.push(new PopupMenuItem(r,s,u,h,a))}else"separator"===i.type&&e.push(new PopupMenuSeparator)}return e}(new Array,t)}catch(t){alert(t)}},PopupMenu.show=function(t,e,o,n,i){var p={x:e,y:o,insertAfterElem:n};return i&&(p[i]=!0),PopupDiv.show(new PopupMenu(t),p)},PopupMenu.showByClick=function(t,e,o,n){var i=PopupMenu.generatePopupMenuFromMenuItems(t);return!e&&window.event&&(e=jQuery.event.fix(window.event)),PopupDiv.show(new PopupMenu(i),{evt:e,x:o,y:n})},PopupMenu.prototype.itemEntered=function(t,e,o){this.clearTimers(t);this.isVerticalMove(o)?(this.hideSubMenu(),this.showSubMenu(t)):(this.delayCall(t,"_hovered_long",this.itemHoveredLongEnough,[t]),this.delayCall(t,"_hovered_maybe_stopped",this.itemHoveredMaybeStopped,[t]))},PopupMenu.prototype.itemLeft=function(t){this.clearTimers(t)},PopupMenu.prototype.isVerticalMove=function(t){if(!this.activeSubmenuDiv||null===this.menuTriggeredX||null===this.menuTriggeredY)return!0;var e=t.pageX-this.menuTriggeredX,o=-(t.pageY-this.menuTriggeredY),n=this.activeSubmenuDiv.div,i=n.offset(),p=n.height(),u=n.width(),r=this.menuTriggeredX>i.left,s=r?i.left+u:i.left,h=Math.max(25,p/8),a=s-this.menuTriggeredX,l=a*o-e*-(i.top-h-this.menuTriggeredY),c=a*o-e*-(i.top+p+h-this.menuTriggeredY);return!(r?l>=0&&c<=0:l<=0*c>=0)},PopupMenu.InitTimerDelays=function(t,e){for(var o=[],n=200;n<t;n+=150)o.push(n);PopupMenu._TimerDelays={_hovered_long:[t],_hovered_maybe_stopped:o},PopupMenu._hovered_stop_threshold=e},PopupMenu.InitTimerDelays(900,70),PopupMenu.prototype.clearTimers=function(t){for(key in PopupMenu._TimerDelays)this.clearTimer(t,key)},PopupMenu.prototype.clearTimer=function(t,e){var o=t[e];if(o)for(var n=0;n<o.length;n++)window.clearTimeout(o[n]);t[e]=null},PopupMenu.prototype.delayCall=function(t,e,o,n){var i=this;this.clearTimer(t,e);for(var p=[],u=PopupMenu._TimerDelays[e],r=0;r<u.length;r++)p.push(window.setTimeout(function(){o.apply(i,n)},u[r]));t[e]=p},PopupMenu.prototype.itemLeftLongAgo=function(t){if(this.clearTimers(t),this.activeSubmenuItem._hovered)return this.menuTriggeredX=null,void(this.menuTriggeredY=null);t===this.activeSubmenuItem&&this.hideSubMenu()},PopupMenu.prototype.itemHoveredLongEnough=function(t){this.hideSubMenu(),this.showSubMenu(t)},PopupMenu.prototype.itemHoveredMaybeStopped=function(t){Date.now()-this._mouse_time>PopupMenu._hovered_stop_threshold&&(this.hideSubMenu(),this.showSubMenu(t))},PopupMenu.prototype.showSubMenu=function(t){if(!t.disabled&&(this.clearTimers(t),this.menuTriggeredX=this._mouse_x,this.menuTriggeredY=this._mouse_y,t.is_menu)){var e=this.popupDiv.getX(),o=(this.popupDiv.getY(),t.el.offset().top),n=this.popupDiv.getWidth(),i=this.popupDiv.getNext(t);this.activeSubmenuDiv=i,this.activeSubmenuItem=t,i.show(e+n-3,o-1,!0);var p=this.popupDiv.doc.body.clientWidth,u=i.getWidth();(this.popupDiv.content.reverse||e+n+u-3>p)&&(i.fixPos(e-u+6,o-1),i.content.reverse=!0),t.el.addClass("Expanded"),this.menuEl.addClass("Expanded")}},PopupMenu.prototype.hideSubMenu=function(){this.menuEl.removeClass("Expanded"),this.activeSubmenuDiv&&(this.activeSubmenuDiv.hide(!1,!0),this.clearTimers(this.activeSubmenuItem),this.activeSubmenuItem.el.removeClass("Expanded"),this.activeSubmenuDiv=null,this.activeSubmenuItem=null,this.menuTriggeredX=null,this.menuTriggeredY=null)},PopupMenu.prototype.populateItem=function(t){return this.el=this.appendRow(t),this.icon&&(this.el.css("background-image","url("+this.icon+")"),table.addClass("Menu-Icon")),this.el.addClass("Expandable").attr("aria-haspopup",!0),this.el.attr("data-xplan-elem",this.text.replace(/ /g,"_").toLowerCase()),this.el},PopupMenu.prototype.rowCreated=function(t,e){var o=this;if(e.hover(function(n){o.itemEntered(t,e,n)},function(e){o.itemLeft(t)}),t.is_menu){o=this;e.keydown(function(e){13==e.keyCode&&(o.hideSubMenu(),o.showSubMenu(t))})}},PopupMenu.prototype.updateContent=function(t){this.popupDiv=t;var e=jQuery('<ul class="Menu" role="menu" />',t.doc).appendTo(t.div.children());this.menuEl=e;this.title&&jQuery('<h1 class="Menu-Title" />').text(this.title).insertBefore(e);var o=this;e.hover(function(){o._hovered=!0},function(){o._hovered=!1}),e.mousemove(function(t){o._mouse_x=t.pageX,o._mouse_y=t.pageY,o._mouse_time=Date.now()});var n=this.items;"function"==typeof n&&(n=n.apply(this),n=PopupMenu.generatePopupMenuFromMenuItems(n));var i=!1;if(n.length>0)for(var p=0;p<n.length;p++){var u=n[p].populateItem(e,t.level);this.rowCreated(n[p],u),!i&&u.find("button:enabled")&&(i=!0,u.find("button:enabled"),window.setTimeout(function(){},0))}else{var r=new PopupMenuItem(_("Empty"),null,!0);u=r.populateItem(e,t.level);this.rowCreated(r,u)}this.level=t.level,PopupMenu.invoke_path[this.level]=this;for(p=this.level+1;p<PopupMenu.invoke_path.length;p++)PopupMenu.invoke_path[p]=null;var s=t.div.outerHeight(),h=t.doc.body.clientHeight;if(h<s){var a=function(t){t=t||1;var o=e.scrollTop();o>0&&e.scrollTop(Math.max(o-10*t,0))},l=function(t){t=t||1,e.scrollTop(e.scrollTop()+10*t,0)};e.before('<div class="MenuScrollUp"/>').prev().hover(function(){jQuery(this).data("t",setInterval(a,100))},function(){clearTimeout(jQuery(this).data("t"))}).click(function(){a(10)}),e.after('<div class="MenuScrollDown"/>').next().hover(function(){jQuery(this).data("t",setInterval(l,100))},function(){clearTimeout(jQuery(this).data("t"))}).click(function(){l(10)}),n.show_scrollbar&&e.addClass("MenuScrollBar"),s=t.div.outerHeight();var c=t.div.is(":visible");t.div.show();var d=e.height();d-=s-(h-2),e.height(d),c||t.div.hide()}};var PopupMenuItem=function(t,e,o,n,i,p,u){return this.text=t,this.href=n,this.action=e,this.disabled=o||!1,this.level=-1,this.link_target=i||"_self",this.disabled_reason=p,this.options=u,this};PopupMenuItem.prototype=new AbstractMenuElement,PopupMenuItem.prototype.dispatchAction=function(){this.invoke()},PopupMenuItem.prototype.getInvokePath=function(){if(!this._invoked)return!1;for(var t=new Array,e=0;e<=this.level;e++)t.push(PopupMenu.invoke_path[e]);return t.push(this),t},PopupMenuItem.prototype.invoke=function(){if("string"==typeof this.action){var t=new String(this.action);t.match(/^javascript:/i)?this.action=new Function(t.substring(11)):this.action=function(){window.location.href=t}}for(var e=getMainFrame().PopupDiv;e;){if(e.content&&e.content.is_menu){e.hide();break}e=e.popup?e.popup:e.divnext}return this.action(this.getParams())},PopupMenuItem.prototype.populateItem=function(t,e){return this.el=this.appendRow(t),this.icon?this.iconType&&"SPAN"==this.iconType.toUpperCase()?(this.el.children().prepend('<span class="'+this.icon+'" />'),this.el.addClass("Menu-Icon-Span")):(this.el.css("background-image","url("+this.icon+")"),this.el.addClass("Menu-Icon-Img")):this.color&&this.el.prepend('<span style="font-size:80%;background-color:'+this.color+'" >&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;'),this.level=e,this.el.attr("data-xplan-elem",this.text.replace(/ /g,"_").toLowerCase()),this.el},PopupMenuItem.prototype.getParams=function(){return XPLAN.util.elem2object(this.el.parent())};var PopupMenuOption=function(t,e,o,n,i){return this.text=t,this.action=e,this.disabled=o||!1,this.checked=n,this.options=i,this};PopupMenuOption.prototype=new PopupMenuItem,PopupMenuOption.prototype.dispatchAction=function(){this.checked=!this.checked,0==this.invoke()&&(this.checked=!this.checked)},PopupMenuOption.prototype.populateItem=function(t){return this.el=this.appendRow(t),this.checked&&this.el.addClass("Tick"),this.el};var PopupMenuSeparator=function(){return this};PopupMenuSeparator.prototype=new AbstractMenuElement,PopupMenuSeparator.prototype.populateItem=function(t){return this.el=this.appendRow(t,!0),this.el.addClass("Menu-Separator").append("<hr/>"),this.el};var PopupMenuSelect=function(t,e,o){return this.name=t,this.options=o,this.label=e,this};PopupMenuSelect.prototype=new AbstractMenuElement,PopupMenuSelect.prototype.populateItem=function(t){var e=this;return e.el=e.appendRow(t,True),e.el.addClass("menu-select"),e.el.append(jQuery("<label>",{text:e.label})),e.el.append(jQuery("<select>",{name:e.name})),jQuery.each(e.options,function(t,o){jQuery('select[name="'+e.name+'"]').append(jQuery("<option>",{value:o[0],text:o[1]}))}),e.el},PopupFrame.popup=null,PopupFrame.modal=null,PopupFrame.getHideFunc=function(t){return function(){!t.frame.is(":hidden")&&t.content.onBlur()&&t.hide()}},PopupFrame.getOpener=function(){var t=getMainFrame();if(getFrameDoc(t)==document||!t.PopupFrame.popup)return t;for(var e=t.PopupFrame.popup,o=t;e.getDocument()!=document;)o=e.frame.get(0).contentWindow,e=e.getNext();return o},PopupFrame.getPopup=function(t,e){var o=PopupFrame.getPopupObj(e);return o.content=t,o},PopupFrame.getPopupObj=function(t){var e=getMainFrame();e.PopupFrame.popup||(e.PopupFrame.popup=new e.PopupFrame(0));var o=e.PopupFrame.popup;if(t)for(;t--;)o=o.getNext();else for(;o.getDocument()==document;)o=o.getNext();return o},PopupFrame.getSizeAdjusterFunc=function(t){return function(){t.fixPos(t.x,t.y)}},PopupFrame.hideAll=function(t){var e=getMainFrame().PopupFrame;e.popup&&e.popup.hide(),t&&(t.stopProgagation(),t.preventDefault())},PopupFrame.hideLast=function(){var t=getMainFrame().PopupFrame.popup;if(t){for(;t.framenew&&t.framenew.shown;)t=t.framenew;t.hide()}},PopupFrame.show=function(t,e,o){var n=PopupFrame.getPopup(t);e||(e=n.x),o||(o=n.y),n.show(e,o)},PopupFrame.show2=function(t,e,o){var n=PopupFrame.getPopup(t);e||(e=n.x),o||(o=n.y),n.show(e,o,function(){n.fixPos2(e,o)})},PopupFrame.showByClick=function(t,e,o){e&&ModalUtil.setModal(!0),PopupFrame.getPopup(t).showByClick(o,0,0)},PopupFrame.showCentre=function(t,e){e&&ModalUtil.setModal(!0),PopupFrame.getPopup(t).showCentre()},PopupFrame.prototype.fixPos=function(t,e){var o=this.doc.body.clientHeight,n=this.doc.body.clientWidth;o=this.frame.outerHeight()+e-o,n=this.frame.outerWidth()+t-n,this.frame.css({left:t-(n>0?n:0)+this.doc.body.scrollLeft+"px",top:e-(o>0?o:0)+this.doc.body.scrollTop+"px"})},PopupFrame.prototype.fixPos2=function(t,e){var o=this.doc.body.clientHeight,n=this.doc.body.clientWidth;o=this.frame.outerHeight()+e-o,n=this.frame.outerWidth()+t-n;var i=jQuery(this.doc).scrollTop(),p=o-i;this.frame.css({left:t-(n>0?n:0)+this.doc.body.scrollLeft+"px",top:e+(p>0?i-o:0)+"px"})},PopupFrame.prototype.setSize=function(t,e){return e&&(t=this.content.getSizeAdjustment(t[0],t[1])),this.frame.width(t[0]),this.frame.height(t[1]),t},PopupFrame.prototype.fixSize=function(){var t=this.getDocument(),e=this.content.width?this.content.width:t&&t.body?jQuery(t.body).outerWidth():10,o=this.content.height?this.content.height:t&&t.body?jQuery(t.body).outerHeight():10,n=this.content.getSizeAdjustment(e,o);return this.frame.width(n[0]).height(n[1]),n},PopupFrame.prototype.getDocument=function(){return this.frame.get(0).contentWindow.document},PopupFrame.prototype.getNext=function(t){var e=this.framenew;return e||(e=this.framenew=new PopupFrame(this.level+1)),t&&(e.content=t),e},PopupFrame.prototype.getPosition=function(){var t=this.frame.offset();return[t.left,t.top]},PopupFrame.prototype.getPrev=function(){return this.level>0?PopupFrame.getPopupObj(this.level-1):null},PopupFrame.prototype.getWindow=function(){return this.frame.get(0).contentWindow},PopupFrame.prototype.getX=function(){return this.frame.offset().left},PopupFrame.prototype.getY=function(){return this.frame.offset().top},PopupFrame.prototype.hide=function(){this.shown=!1,this.framenew&&this.framenew.shown&&this.framenew.hide(),this.frame&&(!this.frame.is(":hidden")&&this.onhide&&this.onhide(),this.frame.hide()),0==this.level&&ModalUtil.setModal(!1)},PopupFrame.prototype.unhide=function(){this.frame.show(),this.shown=!0},PopupFrame.prototype.move=function(t,e){this.frame.css({left:t+"px",top:e+"px"})},PopupFrame.prototype.setupHideHandler=function(){if(this.level>0)var t=PopupFrame.getPopupObj(this.level-1).getDocument();else t=document;if(!t._popup_frame_hide_handler){var e=PopupFrame.getHideFunc(this);jQuery(t.body).mousedown(e),t._popup_frame_hide_handler=!0,this._hide_handler||(this.frame.blur(e),this._hide_handler=!0)}},PopupFrame.prototype.show=function(t,e,o){this.content.updateContent(this),this.frame.show().css("z-index",XPLAN.util.getMaxZIndex()+1),this.content.width&&this.frame.width(this.content.width),this.content.height&&this.frame.height(this.content.height),this.shown=!0,this.x=t,this.y=e,o||(o=PopupFrame.getSizeAdjusterFunc(this));var n=this;jQuery(this.getDocument().body).ready(function(){o(n.fixSize()),n.content.onPostShow(n),setTimeout(function(){o(n.fixSize())},this.firstime?500:250),this.firsttime=!1}),this.setupHideHandler()},PopupFrame.prototype.showByClick=function(t,e,o){var n=0,i=0;!t&&window.event&&(t=jQuery.event.fix(window.event)),t&&(n=t.pageX,i=t.pageY),e&&(n+=e),o&&(i+=o),this.show(n,i),t&&(t.preventDefault(),t.stopPropagation())},PopupFrame.prototype.showCentre=function(){var t=this.frame;this.show(void 0,0,function(e){!function(t){var e=jQuery(t),o=jQuery;e.css("position","absolute"),e.css("top",Math.max(0,(o(window).height()-e.outerHeight())/2+o(window).scrollTop())+"px"),e.css("left",Math.max(0,(o(window).width()-e.outerWidth())/2+o(window).scrollLeft())+"px")}(t)})},PopupDiv.popup=null,PopupDiv.modal=null,PopupDiv.getPopup=function(t,e,o){var n=PopupDiv.getPopupObj(e,o);return n.content=t,n},PopupDiv.getPopupObj=function(t,e){var o=getMainFrame();o.PopupDiv.popup||(o.PopupDiv.popup=new o.PopupDiv(0,e));var n=o.PopupDiv.popup;if(t)for(;t--;)n=n.getNext();else for(;n.shown&&n.content&&!n.content.onBlur();)n=n.getNext();return n},PopupDiv.getSizeAdjusterFunc=function(t){return function(){t.fixPos(t.x,t.y),t.div.css("visibility",""),t.content.onPostShow(t)}},PopupDiv.hideAll=function(t){var e=getMainFrame().PopupDiv;e&&e.popup&&e.popup.hide()},PopupDiv.hideAllChecked=function(t){var e=getMainFrame().PopupDiv;e&&e.popup&&(hide=e.popup.hide(!0))},PopupDiv.hideLast=function(){var t=getMainFrame().PopupDiv.popup;if(t){for(;t.divnext&&t.divnext.shown;)t=t.divnext;t.hide()}},PopupDiv.show=function(t,e){var o,n,i=PopupDiv.getPopup(t,null,e.insertAfterElem),p=e.evt;if(p){var u=XPLAN.util.getXY(p);o=u.x+(e.x||0),n=u.y+(e.y||0);try{p.preventDefault(),p.stopPropagation()}catch(t){}}else o=e.x||i.x||0,n=e.y||i.y||0;return i.show(o,n,e.nohide),e.centre&&(o=(i.doc.body.clientWidth-i.div.width())/2+jQuery(i.doc).scrollLeft(),n=(i.doc.body.clientHeight-i.div.height())/2+jQuery(i.doc).scrollTop(),i.fixPos(o,n,e)),e.right&&(i.x=o-i.div.width(),i.div.css({left:o+"px"})),e.enableEggTimer&&(i.egg_timer=EggTimer.getNewTimer("popup_eggtimer"),i.egg_timer.show({doc:window.document,positionElement:i.div})),i},PopupDiv.hideEggTimer=function(t){t.egg_timer.hide(window.document)},PopupDiv.prototype.setupHideHandler=function(){var t=getMainFrame(),e=getFrameDoc(t),o=t.PopupDiv;null==o.modaldiv&&(o.modaldiv=jQuery("<div class=popupdivmodal />",e).appendTo(e.body).mousedown(PopupDiv.hideAllChecked)),body=jQuery(e.body);var n=body.width()+jQuery(e).scrollLeft(),i=body.height()+jQuery(e).scrollTop();o.modaldiv.show().width(n).height(i).css("z-index",this.zindex-1)},PopupDiv.prototype.fixPos=function(t,e,o){var n=jQuery(this.doc),i=this.doc.body.clientHeight+n.scrollTop(),p=this.doc.body.clientWidth+n.scrollLeft();"undefined"==typeof o?(this.div.outerHeight()+e>i&&(e=i-this.div.outerHeight()),this.div.outerWidth()+t>p&&(t=p-this.div.outerWidth())):(e=(this.doc.body.clientHeight-this.div.outerHeight())/2+n.scrollTop(),t=(this.doc.body.clientWidth-this.div.outerWidth())/2+n.scrollLeft()),e=e<n.scrollTop()?n.scrollTop():e,t=t<n.scrollLeft()?n.scrollLeft():t;var u=jQuery("#xplan-globalnav-root .header"),r=u.length>0&&"fixed"===u.css("position")?u.height():0,s=e-n.scrollTop();s<r&&(e=e+r-s),this.div.css({left:t+"px",top:e+"px"}),this.x=t,this.y=e},PopupDiv.prototype.getNext=function(t){var e=this.divnext;return e||(e=this.divnext=new PopupDiv(this.level+1,this.div)),t&&(e.content=t),e},PopupDiv.prototype.getPosition=function(){var t=this.div.offset();return[t.left,t.top]},PopupDiv.prototype.getPrev=function(){return this.level>0?PopupDiv.getPopupObj(this.level-1):null},PopupDiv.prototype.getWidth=function(){return this.div.outerWidth()},PopupDiv.prototype.getX=function(){return this.div.offset().left},PopupDiv.prototype.getY=function(){return this.div.offset().top},PopupDiv.prototype.hide=function(t,e){var o=!0;if(this.divnext&&this.divnext.shown&&(o=this.divnext.hide(t,e)),(o||!t)&&(!this.content||this.content.onBlur()||!t)){if(this.div.hide(),this.shown=!1,PopupDiv.modaldiv)if(0==this.level)PopupDiv.modaldiv.hide();else{var n=null;n=1==this.level?PopupDiv.popup:PopupDiv.getPopupObj(this.level-1),e||PopupDiv.modaldiv.css("z-index",n.zindex-1)}return jQuery(document).trigger("PopupDivHidden"),!0}return!1},PopupDiv.prototype.unhide=function(){this.div.css("visibility",""),this.div.show(),this.shown=!0},PopupDiv.prototype.move=function(t,e){this.div.css({left:t+"px",top:e+"px"})},PopupDiv.prototype.show=function(t,e,o){this.div.children().get(0).innerHTML="",this.content.updateContent(this),this.zindex=XPLAN.util.getMaxZIndex()+2,o||this.setupHideHandler(),this.div.show().css("z-index",this.zindex),this.fixPos(t,e),this.shown=!0,setTimeout(PopupDiv.getSizeAdjusterFunc(this),1)},PopupDragUtil={},PopupDragUtil.onmousedown=function(t){return function(e){var o=e.pageX,n=e.pageY,i=t.getPosition();t._drag=!0,t._drag_x=i[0]-o,t._drag_y=i[1]-n,e.stopPropagation(),e.preventDefault()}},PopupDragUtil.onmousemove=function(t){return function(e){t._drag&&(1==e.button?t.move(e.pageX+t._drag_x,e.pageY+t._drag_y):t._drag=!1)}},PopupDragUtil.onmouseup=function(t){return function(){t._drag=!1}};var ModalUtil={setModal:function(t){var e=getMainFrame(),o=getFrameDoc(e),n=jQuery(o).find("body > div.modalmask:first");if(0==n.length&&(n=jQuery('<div class="modalmask"></div>',o).appendTo(o.body)),t){var i=(o=jQuery(o)).width(),p=o.height();XPLAN.util.isBrowser("ie")&&(i-=21),n.show().width(i).height(p)}else n.hide()}};(function(t,e){t.XPLAN.namespace("ui.Popup");var o=function(t,e,n){return o.fn.init(t,e,n)};o.fn=o.prototype={constructor:o,init:function(t,e,o){return e.indexOf(getBaseURL())>-1?this.uri=e:this.uri=getBaseURL()+e,this.selector=t,"undefined"==typeof o?(this.options={},this.title=_("Popup Dialog"),this.width="auto",this.height="auto"):(this.options=o,this.title=o.title,this.width=o.width,this.height=o.height),this.mfjQuery=jQuery,this},show:function(){this.mfjQuery(this.selector).html("");var t=this._getOptions(),e=this.mfjQuery(this.selector).dialog(t),o=this,n=null;t.buttons||e.dialog("option","buttons",this._getButtons()),EggTimer.show(),(n=this.mfjQuery.get(this.uri)).success(function(t,n,i){o.mfjQuery(t).appendTo(e)}),n.error(function(t,n,i){alert(i),o.mfjQuery(n+": "+i).appendTo(e)}),n.complete(function(t,e){"function"==typeof o.options.onComplete&&o.options.onComplete(),EggTimer.hide(),o.mfjQuery(o.selector).dialog("option","zIndex",4e3),o.mfjQuery(o.selector).dialog("open")})},_getOptions:function(){var t=this,e={title:this.title,autoOpen:!1,modal:!0,height:t.height,width:t.width,resizable:!1,overlay:{"background-color":"#454545",opacity:.9},close:function(){t.mfjQuery(t.selector).empty()}};return this.width&&(e.width=this.width),this.height&&(e.height=this.height),e},_getButtons:function(){var t=[],e=this;return t.push({text:_("Cancel"),click:function(){"function"==typeof e.options.onCancel&&e.options.onCancel();var t=e.mfjQuery(e.selector);t.dialog("isOpen")&&t.dialog("close")}}),t.push({text:_("Ok"),click:function(){var t=!0;"function"==typeof e.options.onOk&&!1===e.options.onOk()&&(t=!1);var o=e.mfjQuery(e.selector);o.dialog("isOpen")&&!0===t&&o.dialog("close")}}),t}},t.XPLAN.ui.Popup.URL=o})(window),function(){var t={};XPLAN.ui.Popup.get_dialog=function(e){var o=t[e];void 0===o?0===jQuery("#"+e).length&&((o=jQuery('<div id="'+window.XPLAN.util.escape(e,"xmlq")+'" />').appendTo(jQuery("body"))).data("new",!0),t[e]=o):o.data("new",!1);return o}}(),PopupURL3.show=function(t,e){var o=new PopupURL3(t,e),n=jQuery.extend(!0,{},e);return n.icon&&(o.icon=PopupContent.img+n.icon),n.x&&n.y||(n.centre=!0),PopupDiv.show(o,n)},PopupURL3._onclose=function(t,e,o){t.enableEggTimer&&PopupDiv.hideEggTimer(e),t.onclose&&t.onclose(e,o)},PopupURL3.getButtonFunc=function(t,e){return function(){return PopupURL3._onclose(t,e,jQuery(this).text()),!1}},PopupURL3.getButtonPromptFunc=function(t,e){return function(){return PopupURL3._onclose(t,e,e.div.find("input:text").val()),!1}},PopupURL3.prototype=new PopupMsgBox,PopupURL3.prototype.updateContent=function(t){var e={icon:this.icon,title:this.caption?this.caption:"Message",height:this.height?this.height:0,width:this.width?this.width:this.icon?340:300,enableEggTimer:this.enableEggTimer};if(this.prompt)e.buttons=[[["ok",_("Ok")],PopupURL3.getButtonPromptFunc(this,t)],[["cancel",_("Cancel")],function(){t.hide()}]];else if(this.button){for(var o=[],n=0;n<this.button.length;n++)o.push([this.button[n],PopupURL3.getButtonFunc(this,t)]);e.buttons=o}var i=PopupMsgBox.init(t,e);i.html(this.html),this.enableEggTimer&&jQuery(t.div.find("iframe")).on("load",function(){PopupDiv.hideEggTimer(t)}),this.prompt&&jQuery('<div class="MsgBox-Prompt"><input type="text"/></div>',t.doc).insertAfter(i).children("input").val(this.prompt)},PopupYouTube.prototype=new PopupContent,PopupYouTube.show=function(t,e){var o=new PopupYouTube(t,e);(new HttpRequest).callRPC("factfind.lookupYouTube",[t],function(t){if(t.result){var e='<iframe name="youtubepopup" src="//www.youtube.com/embed/'+t.videohash+'?rel=0&autoplay=1&controls=0&showinfo=0" width="'+o.width+'" height="'+o.height+'" scrolling="no" frameborder="0" allowfullscreen=""></iframe>';PopupForm2.show(e,o.caption,{width:o.width+20,height:o.height+50,hide_on_blur:!0,no_buttons:!0,onblur:function(){jQuery('iframe[name="youtubepopup"').prop("src","")}})}},function(t){})};
;Dependency._js['popup']=true;

;
XPLAN.namespace("usermsg"),XPLAN.util.update(XPLAN.usermsg,{check_interval:15e3,msg_count:0}),XPLAN.usermsg.deleteAllMessage=function(){XMLRPC.call("today.deleteMessages",[XPLAN.login_role,!1],XPLAN.usermsg.onMessageDeleted)},XPLAN.usermsg.deleteAllRead=function(){XMLRPC.call("today.deleteMessages",[XPLAN.login_role,!0],XPLAN.usermsg.onMessageDeleted)},XPLAN.usermsg.fixCount=function(){var e=jQuery("#mfts-msg > a").text(XPLAN.usermsg.msg_count);XPLAN.usermsg.msg_count>0?e.addClass("hasusermsg"):e.removeClass("hasusermsg")},XPLAN.usermsg.init=function(e){var s=jQuery("#mfts-msg > a");(0!=s.length||e)&&(XPLAN.usermsg.fixCount(),s.click(XPLAN.usermsg.onImgClick),setInterval(function(){XMLRPC.callGET("today.checkUnreadMessage",[XPLAN.login_role],XPLAN.usermsg.onCheckResult,XPLAN.usermsg.onCheckError)},XPLAN.usermsg.check_interval))},XPLAN.usermsg.onCheckResult=function(e){XPLAN.usermsg.msg_count!=e&&(e>XPLAN.usermsg.msg_count&&XPLAN.usermsg.onNewMessage(),XPLAN.usermsg.msg_count=e,XPLAN.usermsg.fixCount())},XPLAN.usermsg.onCheckError=function(e){console.log(e)},XPLAN.usermsg.lastClicked=0,XPLAN.usermsg.windowOpened=!1,XPLAN.usermsg.onImgClick=function(e){var s=(new Date).valueOf();return XPLAN.usermsg.windowOpened||(XPLAN.usermsg.windowOpened=!0,s-XPLAN.usermsg.lastClicked>1e3&&XPLAN.usermsg.openWindow(),XPLAN.usermsg.lastClicked=s,XPLAN.usermsg.windowOpened=!1),!1},XPLAN.usermsg.onImgContext=function(e){var s=[new PopupMenuItem(_("Message Index"),XPLAN.usermsg.openMessageIndex),new PopupMenuItem(_("Send Message"),XPLAN.usermsg.sendMessage),new PopupMenuItem(_("Delete All Read Messages"),XPLAN.usermsg.deleteAllRead),new PopupMenuItem(_("Delete All Messages"),XPLAN.usermsg.deleteAllMessage)];PopupMenu.showByClick(s,e)},XPLAN.usermsg.onMessageDeleted=function(e){alert(ngettext("%a message deleted.","%a messages deleted.","%a",e))},XPLAN.usermsg.onNewMessage=function(){XPLAN.usermsg.msg_win&&!XPLAN.usermsg.msg_win.closed&&XPLAN.usermsg.msg_win.focus()},XPLAN.usermsg.openMessageIndex=function(){XPLAN.usermsg.openWindow("open=index")},XPLAN.usermsg.openWindow=function(e){if(XPLAN.usermsg.msg_win)try{XPLAN.usermsg.msg_win.window.XPLAN.usermsg}catch(e){XPLAN.usermsg.msg_win=void 0}if(!XPLAN.usermsg.msg_win||XPLAN.usermsg.msg_win.closed){var s=screen.width?(screen.width-400)/2:50,n="height=300,width=400,top="+(screen.height?(screen.height-300)/2:50)+",left="+s+",heading=no,topbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,border=no",g=getBaseURL()+"/home/usermsg";g+="?login_role="+XPLAN.login_role,e&&(g+="&"+e),XPLAN.usermsg.msg_win=window.open(g,"usermsg",n)}else jQuery(function(){XPLAN.usermsg.msg_win.window.XPLAN.usermsg.nextMessage()});XPLAN.usermsg.msg_win&&XPLAN.usermsg.msg_win.window.focus&&XPLAN.usermsg.msg_win.window.focus()},XPLAN.usermsg.sendMessage=function(){XPLAN.usermsg.openWindow("open=send")},XPLAN.usermsg.openURL=function(e){window.location.href=getBaseURL()+e};
;Dependency._js['usermsg']=true;

;
function expandPageContentPane(e){return XPLAN.framemain.expand_page(e)}TopFrame={action:null},TopFrame.addActionButton=function(e,t,n,a,i,r,o,u,l){null==r&&(r=True),(c=jQuery("div.buttonbar:eq(0)")).length&&!c.parents(".panelbox:eq(0)").length||(c=XPLAN.framemain.createButtonBar("mf-topaction"));var s="button";r&&(s+=" primary"),o&&(s+=" dropdown");var c=jQuery("div.buttonbar:eq(0)"),m=jQuery("div.buttonbar[id='bottombuttonbar']"),p=jQuery('<a href="#" class="'+s+'"/>'),d=jQuery('<a href="#" class="'+s+'"/>');l?(p.prependTo(c),d.prependTo(m)):(p.appendTo(c),d.appendTo(m));var f=/(.*)_([A-Za-z0-9])_(.*)/.exec(e);return null!=f?(p.append(f[1]),p.append("<u>"+f[2]+"</u>"),p.append(f[3]),p.attr("accessKey",f[2].toLowerCase()),d.append(f[1]),d.append("<u>"+f[2]+"</u>"),d.append(f[3]),d.attr("accessKey",f[2].toLowerCase())):p.text(e),d.text(e),u&&u.is_prevent_multiple_click&&(p.on("click",function(){p.attr("disabled","disabled").css("pointer-events","none")}),u.message_event&&XPLAN.event.listen("enable_top_frame_button_"+u.message_event,function(){p.removeAttr("disabled").css("pointer-events","")})),"string"==typeof t?(p.attr("href",t),d.attr("href",t),n&&"xplanmain"!=n&&(p.attr("target",n),d.attr("target",n))):(p.attr("href","#"),d.attr("href","#"),"function"==typeof t?(p.click(t),d.click(t)):t||(p.attr("disabled","disabled"),d.attr("disabled","disabled"))),i&&(p.attr("id",i),d.attr("id",i)),u&&u.attributes&&p.attr(u.attributes),a instanceof Function&&(p.length>0&&a(p.get(0)),d.length>0&&a(d.get(0))),p},TopFrame.addActionImage=function(e,t,n){var a=jQuery('<img class="action"/>').attr("src",e).click(function(){XPLAN.util.process_action(t)}).appendTo(TopFrame.getNewActionCell());return n instanceof Function&&n(a.get(0)),a},TopFrame.clear=function(){TopFrame.clearAction(),TopFrame.clearTitle()},TopFrame.clearAction=function(){jQuery("#mf-topaction").empty(),TopFrame.action=null,TopFrame.setCode("")},TopFrame.clearTitle=function(){jQuery("#mf-toptitle").text("")},TopFrame.getActionCellCount=function(){return null!=TopFrame.action?TopFrame.action.children("li").length:0},TopFrame.getActionCellElement=function(e){return null!=TopFrame.action?TopFrame.action.children("li").eq(e):null},TopFrame.getActionElement=function(){},TopFrame.getCode=function(){var e=getMainFrame();return e?e._top_frame_code:""},TopFrame.getNewActionCell=function(){var e;return null==TopFrame.action&&((e=jQuery("#mf-titlecontentwrap > ul")).length||(e=jQuery("<ul/>").appendTo("#mf-titlecontentwrap")),TopFrame.action=e),jQuery("<li/>").appendTo(TopFrame.action)},TopFrame.onTopFrameReady=function(delegate){delegate instanceof Function?delegate():eval(delegate)},TopFrame.setCode=function(e){var t=getMainFrame();t&&(t._top_frame_code=e)},TopFrame.setTitleText=function(e,t){XPLAN.framemain.setTitle(e),t&&jQuery("#mf-titlecontent").html(t)},TopFrame.appendTitle=function(e,t){return jQuery("#mf-titlecontent").append(t?e:XPLAN.util.escape(e))},TopFrame.addText=function(e){return jQuery('<span class="page_title">'+e+"</span>").appendTo(TopFrame.getNewActionCell())},XPLAN.namespace("framemain"),XPLAN.framemain.printpdf=!1,XPLAN.framemain.resizers=[],XPLAN.framemain.alert=function(e,t,n,a){a||(a=jQuery("#mf-contentinner"));var i=jQuery("#mf-alert",a);0==i.length&&(i=jQuery('<div id="mf-alert"><div class="mfa-icon"></div><span></span><div class="mfa-content"></div></div>').prependTo(a).children("span").click(function(){jQuery(this).parent().fadeOut()}).end()),t?i.children("div.mfa-icon").addClass("warning"):i.children("div.mfa-icon").removeClass("warning");var r=i.show("fast").children("div.mfa-content").html(e);return n&&setTimeout(function(){i.fadeOut()},n),r},XPLAN.framemain.alert_text=function(e,t,n,a){return XPLAN.framemain.alert(XPLAN.util.escape(e),t,n,a)},XPLAN.framemain.close=function(){var e=jQuery("#mf-alert");e.length>0&&e.fadeOut()},XPLAN.framemain.applyURL=function(url,target){if(url.search(/^https?:\/\//)<0){var jsregex=/^javascript:/;if(url.search(jsregex)<0)"_blank"==target?window.open(getBaseURL()+url):window.location.href=getBaseURL()+url;else{var evalstr=url.replace(jsregex,"");eval(evalstr)}}else window.open(url)},XPLAN.framemain.getURL=function(e,t){return function(){XPLAN.framemain.applyURL(e,t)}},XPLAN.framemain.doAddMenu=function(e){var t=jQuery(this);e.preventDefault(),XPLAN.framemain.add_menu?XPLAN.framemain.doAddContextMenu(XPLAN.framemain.add_menu,t):XMLRPC.callGET("today.get_add_links",[],function(e){XPLAN.framemain.add_menu=e,XPLAN.framemain.doAddContextMenu(e,t)})},XPLAN.framemain.doClientContextMenu=function(){var e=new Array;return FactFind.getClientContextMenu(this.entityid,e,this.email,this.visible),FactFind.entityid=this.entityid,FactFind.entityrole="client",e},XPLAN.framemain.doClientListMenu=function(e){var t=jQuery(this);e.preventDefault(),XMLRPC.callGET("factfind.getRecentEntities",["client"],function(e){for(var n=[new PopupMenuItem(_("Recent Clients"),null,!0),new PopupMenuSeparator],a=0;a<e.length;a++){var i=e[a],r=new PopupMenu(XPLAN.framemain.doClientContextMenu,i.name);r.entityid=i.entityid,r.email=i.email,r.visible=i.visible,n.push(r)}PopupMenu.showDropdown(n,t)})},XPLAN.framemain.doClientSearchContextMenu=function(e){var t=jQuery(this);e.preventDefault(),XMLRPC.callGET("factfind.getSavedSearch",[],function(e){for(var n=document.forms.quicksearch.elements.role.value,a=[new PopupMenuItem(_("Advanced Search"),XPLAN.framemain.getURL("/factfind/search?role="+n)),new PopupMenuSeparator],i=0;i<e.length;i++){var r=e[i],o=XPLAN.util.getURL("/factfind/search/load",{entityid:r.entityid,name:r.name,search:"1",role:n}),u=new PopupMenuItem(r.name,XPLAN.framemain.getURL(o));a.push(u)}a.show_scrollbar=!0,PopupMenu.showDropdown(a,t)})},XPLAN.framemain.doAddContextMenu=function(e,t){for(var n=[],a=0;a<e.length;a++)if(e[a].submenuitems){for(var i=[],r=0;r<e[a].submenuitems.length;r++){var o=e[a].submenuitems[r];i.push(new PopupMenuItem(o.title,XPLAN.framemain.getURL(o.url)))}n.push(new PopupMenu(i,e[a].title))}else if("-"==e[a])n.push(new PopupMenuSeparator);else{var u;u=e[a].script?new Function(e[a].script):XPLAN.framemain.getURL(e[a].url);var l=new PopupMenuItem(e[a].title,u);e[a].icon&&(l.icon=getBaseURL()+e[a].icon),n.push(l)}PopupMenu.showDropdown(n,t,jQuery("#mf-topapps"))},XPLAN.framemain.doHomeMenu=function(e){var t=jQuery(this);e.preventDefault(),XPLAN.framemain.getTodayMenu(function(e){var n=[new PopupMenuItem(_("Dashboard"),getBaseURL()+"/dashboard/mainhtml")];XPLAN.util.hasFeature("portfolio_dashboard")&&n.push(new PopupMenuItem(_("Portfolio Dashboard"),getBaseURL()+"/portfolio/app")),(XPLAN.util.isCapable("client_focus")||XPLAN.util.isCapable("edit_entity_note"))&&n.push(new PopupMenuItem(_("Document Library"),getBaseURL()+"/docnote/library")),XPLAN.util.isCapable("digital_signature")&&n.push(new PopupMenuItem(_("Digital Signature"),getBaseURL()+"/digital_signature/list")),n.push(new PopupMenuSeparator);for(var a=0;a<e.length;a++){for(var i=e[a],r=new Array,o=0;o<i.functions.length;o++){var u=i.functions[o],l={attributes:{"data-xplan-elem":XPLAN.util.escape(u.xplan_dataname,"xmlq")}},s=new PopupMenuItem(u.title,XPLAN.framemain.getURL(u.url,u.target),!1,void 0,void 0,void 0,l);u.icon&&(s.icon=getBaseURL()+u.icon),r.push(s)}if(r.length>0){l={attributes:{"data-xplan-elem":XPLAN.util.escape(i.id,"xmlq")}};r=new PopupMenu(r,i.title,!1,l),i.icon&&(r.icon=getBaseURL()+i.icon),n.push(r)}}PopupMenu.showDropdown(n,t,jQuery("#mf-topapps"))})},XPLAN.framemain.doLanguageMenu=function(e){e.preventDefault();var t=function(e){return function(){XMLRPC.call("sysadmin.saveLanguageSetting",[e,2],function(e){var t=top.location.toString();t.lastIndexOf("#")==t.length-1&&(t=t.substring(0,t.length-1)),top.location.href=t},HttpRequest.onerror)}},n=function(e){return function(){var t=top.location.toString();t.lastIndexOf("#")==t.length-1&&(t=t.substring(0,t.length-1)),t.indexOf("lang=")>0?url=t.replace(/lang=[a-z]{2}_[A-Z]{2}/,"lang="+e):url=t+"?lang="+e,window.location=url}};XMLRPC.callGET("today.get_language_menu",[],function(e){var a=[],i=n,r=e[1];if(r&&(a.push(new PopupMenuItem(_("Language Setting"),XPLAN.framemain.getURL("/sysadmin/user/language"))),i=t),(e=e[0]).length>0){a.length>0&&a.push(new PopupMenuSeparator);for(var o=0;o<e.length;o++){var u=new PopupMenuOption(e[o].text,i(e[o].value),!1,!!r&&e[o].selected);a.push(u)}PopupMenu.showDropdown(a,"#mfts-lang")}})},XPLAN.framemain.doQuicklinksMenu=function(e){e.preventDefault(),XMLRPC.callGET("today.get_quicklinks",[],function(t){var n=[new PopupMenuItem(_("Edit Quicklinks"),XPLAN.framemain.editQuicklinks),new PopupMenuItem(_("Load System Default Quicklinks"),XPLAN.framemain.loadSystemQuickLinks)];if(t.length>0){n.push(new PopupMenuSeparator);for(var a=0;a<t.length;a++){var i=t[a];n.push(new PopupMenuItem(i.title,XPLAN.framemain.getURL(i.url)))}}PopupMenu.showDropdown(n,e.target,jQuery("#mf-topapps"))})},XPLAN.framemain.doTradeMenu=function(e){e.preventDefault(),XMLRPC.callGET("today.get_trademenu",[],function(t){if(0==t.length)return!1;var n=t.can_plus_orderentry,a=t.can_plus_orderpad,i=t.can_classic_orderentry,r=t.can_classic_orderpad,o=[],u=[];n&&o.push(new PopupMenuItem(_("Buy"),function(){openIOSPlusOrderEntry(!0,!1,1)}),new PopupMenuItem(_("Sell"),function(){openIOSPlusOrderEntry(!0,!1,2)}),new PopupMenuItem(_("Short Sell"),function(){openIOSPlusOrderEntry(!0,!1,5)})),a&&o.push(new PopupMenuItem(_("Order Pad"),function(){openIOSPlusOrders(!1)})),i&&u.push(new PopupMenuItem(_("Buy"),function(){openIOSOrderEntry("B")}),new PopupMenuItem(_("Sell"),function(){openIOSOrderEntry("A")})),r&&u.push(new PopupMenuItem(_("Order Pad"),function(){openIOSOrders()}));var l=[];if(o.length>0&&u.length>0)l.push(new PopupMenu(o,_("IOS+"))),l.push(new PopupMenu(u,_("IOS")));else{for(var s=0;s<o.length;s++)l.push(o[s]);for(var c=0;c<u.length;c++)l.push(u[c])}0===l.length&&l.push(new PopupMenuItem(_("(No IOS Connections)"),null,!0)),PopupMenu.showDropdown(l,e.target,jQuery("#mf-topapps"))})},XPLAN.framemain.doSearchContextMenu=function(e){e.preventDefault(),XPLAN.util.onCapabilitiesLoaded(function(){PopupMenu.showDropdown(XPLAN.framemain.search_menu,e.target)})},XPLAN.framemain.doUpdateSearch=function(e,t){var n=document.forms.quicksearch,a=XPLAN.test_language_util.prepare_escape(this.text),i=jQuery("#mf-topsearchbox input");i.length&&i.hasClass("empty")&&i.val(a),jQuery("#mfts-select").attr("title",a).children("span").removeClass().addClass("entity_icon "+this.icon),jQuery(n).attr("action",getBaseURL()+this.posturl).find('input[name="role"]').val(this.role),t||XMLRPC.call("today.setSearchInputDefault",[this.role],HttpRequest.dummy),this.hasListing?jQuery("#mfts-list").show():jQuery("#mfts-list").hide(),this.hasListing?jQuery("#mfts-advanced").show():jQuery("#mfts-advanced").hide(),i.data("autocomplete")&&i.autocomplete("disable");var r=jQuery.inArray(this.role,["client","user","group","referral","supplier","profadviser","insurancepolicy"])>-1;r&&(i.data("autocomplete_role",this.role),XPLAN.framemain.activateQuickEntitySearch(i)),jQuery("#mfts-quick_client_search").toggle(r)},XPLAN.framemain.activateQuickEntitySearch=function(e){e.data("autocomplete")?e.autocomplete("enable"):e.autocomplete({source:function(t,n){role=e.data("autocomplete_role"),-1===t.term.indexOf(":")?XMLRPC.call("factfind.quick_search",[role,t.term],function(e){n(jQuery.map(e,function(e){return{value:e[1],label:e[1],id:e[0]}}))}):n([])},minLength:1,select:function(t,n){if(role=e.data("autocomplete_role"),jQuery.inArray(role,["client","user","group","referral","supplier","profadviser"])>-1)XPLAN.framemain.registerQuickSearch(),showEntity(n.item.id,role);else if("docnote"==role)FactFind.editNote(n.item.id);else if("insurancepolicy"==role){var a=n.item.id.split("-"),i=getBaseURL()+"/factfind/view_list/insurance_group?entityid="+a[1]+"&index="+a[0]+"&page_name=insurance_group";XPLAN.util.form_redirect(i)}}})},XPLAN.framemain.doListContextMenu=function(e){e.preventDefault();var t=[],n=document.forms.quicksearch.elements.role.value,a="/factfind/search/result?is_listing=1&refresh=1&role="+n,i="/factfind/search/result?role="+n;t.push(new PopupMenuItem(_("Entire List"),XPLAN.framemain.getURL(a))),t.push(new PopupMenuItem(_("Last Search"),XPLAN.framemain.getURL(i))),PopupMenu.showDropdown(t,jQuery(this))},XPLAN.framemain.editQuicklinks=function(){XPLAN.util.loadScript("/js/quicklinks.js",function(){XPLAN.framemain.editQuickLinks()})},XPLAN.framemain.loadSystemQuickLinks=function(){XPLAN.util.loadScript("/js/quicklinks.js",function(){XPLAN.framemain.loadSystemQuickLinks()})},XPLAN.framemain.expand_page=function(e){var t=getMainFrame(),n=getFrameDoc(t);n&&(e?jQuery("html",n).removeClass("expanded"):(jQuery("html",n).addClass("expanded"),XPLAN.framemain.registerResizer(null),jQuery(function(){var e=jQuery("#mf-contentinner",n),t=(e.height(),!1);e.children().each(function(){var e=jQuery(this);e.is("iframe")&&"100%"==e.attr("height")?t=!0:e.hasClass("maxpagepane")&&(t=!0)}),t&&e.css("overflow","hidden")})))},XPLAN.framemain.getTodayMenu=function(e){XPLAN.framemain.today_menu?e(XPLAN.framemain.today_menu):XMLRPC.callGET("today.getBlocks",[],function(t){XPLAN.framemain.today_menu=t,e(t)})},XPLAN.framemain.init=function(e){jQuery("#ta-home a").click(XPLAN.framemain.doHomeMenu),jQuery("#ta-add a").click(XPLAN.framemain.doAddMenu),jQuery("#ta-links a").click(XPLAN.framemain.doQuicklinksMenu),jQuery("#ta-trade a").click(XPLAN.framemain.doTradeMenu),jQuery("#mfts-recent a").click(XPLAN.framemain.doClientListMenu),jQuery("#mfts-lang a").click(XPLAN.framemain.doLanguageMenu),XPLAN.framemain.initSearchMenu(e);var t=jQuery("#mf-topsearchbox input");if(t.length){jQuery("#mfts-btn").click(function(){t.hasClass("empty")&&t.removeClass("empty").val(""),document.forms.quicksearch.submit()}),jQuery("#mfts-select").click(XPLAN.framemain.doSearchContextMenu),t.focus(function(){t.hasClass("empty")&&t.removeClass("empty").val("")}).blur(function(){XPLAN.framemain.registerQuickSearch(),""==t.val()&&t.addClass("empty").val(jQuery("#mfts-select").attr("title"))}).keypress(function(e){e&&13==e.keyCode&&XPLAN.framemain.registerQuickSearch()}).val(XPLAN.cache.get("qs","")).blur();for(var n=jQuery('form[name="quicksearch"] input[name="role"]').val(),a=0;a<XPLAN.framemain.search_menu.length;a++){var i=XPLAN.framemain.search_menu[a];if(i.role==n){i.action(this.event,!0);break}}}jQuery("#mfts-list a").click(XPLAN.framemain.doListContextMenu),jQuery("#mfts-advanced a").click(XPLAN.framemain.doClientSearchContextMenu),null!=XPLAN.no_usermsg&&XPLAN.no_usermsg&&XPLAN.debugmode||XPLAN.usermsg.init(),XPLAN.timeticker.init();var r=jQuery("#page_content_filename").val();"login/login.html"!=r&&"login/password_expired.html"!=r&&"login/login_duplicate.html"!=r&&XPLAN.util.isLogin()&&XMLRPC.callGET("panelbox.get_panelbox_collapsed_by_page",[jQuery("#page_content_filename").val()],XPLAN.framemain.setPanelboxState,HttpRequest.onerror)},XPLAN.framemain.createButtonBar=function(e){var t=jQuery("<div "+(e?' id="'+e+'" ':"")+'class="buttonbar"></div>').prependTo("#mf-contentinner");return XPLAN.event.send("button bar created",{bar:t}),t},XPLAN.framemain.logout=function(){XMLRPC.call("timetaken.has_unsaved_tickers",[],function(e){e?XPLAN.timeticker.alert(_("There are unsaved tickers. Please save or discard the tickers before logout.")):XPLAN.util.form_redirect(XPLAN.util.getURL("/home/logoff",{},!0))},function(){XPLAN.util.form_redirect(XPLAN.util.getURL("/home/logoff",{},!0))})},XPLAN.framemain.initFinal=function(e){if(e&&XPLAN.timeticker.alert_running_ticker(),jQuery("#mfts-logout").find("a").on("click",XPLAN.framemain.logout),"undefined"!=typeof doPrint&&XPLAN.framemain.printpdf){var t=jQuery("div.buttonbar:eq(0)");t.length||(t=XPLAN.framemain.createButtonBar());var n=!1;void 0==XPLAN.framemain.printpdfLabel&&(XPLAN.framemain.printpdfLabel=_("PDF"));var a=jQuery('<button type="button"></button>').text(XPLAN.framemain.printpdfLabel).click(doPrint);t.children("a.button,button").each(function(){var e=jQuery(this);if(e.hasClass("next")||e.hasClass("last"))return a.insertBefore(e),n=!0,!1}),n||a.appendTo(t)}},XPLAN.framemain.setPanelboxState=function(e){for(var t=0;t<e.length;t++){var n="#"+XPLAN.util.escape(e[t],"css");jQuery(n).length>0?jQuery(n).hasClass("dont-save-state")||(jQuery(n).children("div.content").hide(),jQuery(n+" > h2 > a.panelbutton.minmax").addClass("expand")):jQuery("div.panelbox > h2").each(function(n,a){jQuery.trim(jQuery(a).text()).substring(0,50)!=e[t]||jQuery(a).hasClass("dont-save-state")||(jQuery(a).parent().children("div.content").hide(),jQuery(a).children("a.panelbutton.minmax").addClass("expand"))})}},XPLAN.framemain.registerQuickSearch=function(){var e=jQuery("#mf-topsearchbox input"),t=e.val();e.hasClass("empty")||""===t?XPLAN.cache.del("qs"):XPLAN.cache.set("qs",t)},XPLAN.framemain.registerResizer=function(e){0==XPLAN.framemain.resizers.length&&(jQuery(window).resize(XPLAN.framemain.resize_page),jQuery(function(){jQuery(window).resize()})),XPLAN.framemain.resizers.push(e)},XPLAN.framemain.resize_page=function(){var e,t=getFrameDoc(getMainFrame()),n=jQuery("#mf-contentinner",t),a=n.offset(),i=Math.max(t.body.clientHeight-a.top-1,0),r=Math.max(t.body.clientWidth-a.left-26,0);for(n.height(i),e=0;e<XPLAN.framemain.resizers.length;e++){var o=XPLAN.framemain.resizers[e];"function"==typeof o&&o(r,i)}},XPLAN.framemain.height=function(){return jQuery("#mf-contentinner").height()},XPLAN.framemain.resize_element=function(e,t,n){if(e){var a=jQuery("#"+e);a.length&&((t=t||{height:0,width:0}).height||(t.height=0),t.width||(t.width=0),XPLAN.framemain.registerResizer(function(e,i){var r=jQuery("#mf-contentinner"),o=a.offset(),u=r.offset(),l=t.height+(a.outerHeight(!0)-a.innerHeight())/2,s=r.children().first();s.is("div.buttonbar")&&(l+=s.outerHeight());var c=t.width+(a.outerWidth(!0)-a.innerWidth())/2;a.width(e+u.left-o.left-c).height(i+u.top-o.top-l),void 0!=n&&n()}))}},XPLAN.framemain.resize_iframe=function(e,t){var n=(n=document.documentElement.clientHeight-jQuery("#mf-toppane").height()-t).toString()+"px";jQuery(e).css({height:n})},XPLAN.framemain.set_scroll=function(e){jQuery("#mf-contentinner",getFrameDoc(getMainFrame())).css("overflow",e?"auto":"hidden")},XPLAN.framemain.setTitle=function(e,t,n,a){var i,r=jQuery("#mf-titlecontent");if(r.length||(jQuery('<div id="mf-titlebar"><div><div id="mf-titlecontentwrap"><div id="mf-titlecontent"></div></div></div></div>').prependTo("#pagecontent"),r=jQuery("#mf-titlecontent")),t)if(e){var o=r.html("<strong></strong>: <span></span>").children("strong").text(e).end().children("span").text(t);n&&o.addClass("selector").click(n),i=e+": "+t}else{o=r.html("<span></span>").children("span").text(t);n&&o.addClass("selector").click(n),i=t,a&&a(jQuery("<span></span>").appendTo(r))}else r.text(e).attr("title",e),i=e;XPLAN.apptitle&&(i=i+" | "+XPLAN.apptitle),document.title=i},XPLAN.namespace("timeticker"),XPLAN.util.update(XPLAN.timeticker,{entityid:null,wnd:null,size_w:350,size_h:400,init:function(){jQuery("#mfts-ttaken").click(XPLAN.timeticker.onImgClick)},onImgClick:function(e){XPLAN.timeticker.start(XPLAN.timeticker.entityid)},_get_wnd_settings:function(e,t){return"height="+XPLAN.timeticker.size_h+",width="+XPLAN.timeticker.size_w+",top="+e+",left="+t+",heading=no,topbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,border=no"},start:function(e){if(!XPLAN.timeticker.wnd||XPLAN.timeticker.wnd.closed){var t=screen.width?screen.width-XPLAN.timeticker.size_w-5:0,n=XPLAN.timeticker._get_wnd_settings(0,t),a=getBaseURL()+"/timetaken/tickerpopup";e&&(a+="?entityid="+escape(e)),XPLAN.timeticker.wnd=window.open(a,"timeticker",n)}else e&&XPLAN.timeticker.wnd.TimeTicker.select_entity(e);XPLAN.timeticker._set_no_warning_entity(-1),XPLAN.timeticker.wnd.focus()},alert:function(e){if(!XPLAN.timeticker.wnd||XPLAN.timeticker.wnd.closed){var t=screen.width?(screen.width-XPLAN.timeticker.size_w-5)/2:0,n=XPLAN.timeticker._get_wnd_settings(0,t),a=getBaseURL()+"/timetaken/tickerpopup";XPLAN.timeticker.wnd=window.open(a,"timeticker",n)}XPLAN.timeticker.wnd.focus(),XPLAN.timeticker.wnd.alert(e)},_set_no_warning_entity:function(e){XMLRPC.call("timetaken.set_no_running_ticker_warning_entity",[e])},alert_running_ticker:function(){var e=XPLAN.ui.Popup.get_dialog("time_taken_running_alert");e.html("<p>"+XPLAN.util.escape(_("Time taken running. Do you wish to start a new time taken for this client?"))+"</p>"),e.dialog({title:_("Time Taken Running"),width:400,modal:!0,buttons:[{text:_("Pause"),click:function(){XMLRPC.call("timetaken.ticker_pause",[],function(){if(!XPLAN.timeticker.wnd||XPLAN.timeticker.wnd.closed){var e=screen.width?screen.width-XPLAN.timeticker.size_w-5:0,t=XPLAN.timeticker._get_wnd_settings(0,e),n=getBaseURL()+"/timetaken/tickerpopup";XPLAN.timeticker.wnd=window.open(n,"timeticker",t)}XPLAN.timeticker.wnd.focus()}),e.dialog("close"),e.dialog("destroy")}},{text:_("No"),click:function(){XPLAN.timeticker._set_no_warning_entity(XPLAN.timeticker.entityid),e.dialog("close"),e.dialog("destroy")}},{text:_("Yes"),click:function(){XPLAN.timeticker.start(XPLAN.timeticker.entityid),e.dialog("close"),e.dialog("destroy")}}]})}}),XPLAN.namespace("clientfocus"),XPLAN.clientfocus.outcome={handler:function(e){if(e&&e.url){var t=getBaseURL()+e.url;if(e.inpopup){window.open(t,"","height=500,width=700,heading=no,topbar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,border=no")}else getMainFrame(t)}}},XPLAN.framemain.search_menu=[],XPLAN.framemain.initSearchMenu=function(e){if(e)for(var t=0;t<e.length;t++){var n=new PopupMenuItem(e[t].title,XPLAN.framemain.doUpdateSearch);n.iconType="SPAN",n.icon=e[t].icon;var a=n.role=e[t].role;n.posturl=e[t].action,n.hasListing=e[t].has_listing,n.options={attributes:{"data-xplan-elem":a}},XPLAN.framemain.search_menu.push(n)}},XPLAN.namespace("layout"),XPLAN.layout.resizeVbox=function(e,t){var n,a,i,r,o,u=t,l=[],s=0;if(e.is("table")){r=!0,o=jQuery(e.get(0).rows);var c=parseInt(e.attr("cellspacing"),10)||0,m=parseInt(e.attr("cellpadding"),10)||0;u-=c*(o.length+1)}else r=!1,o=e.children();u-=e.outerHeight(!0)-e.height(),o.each(function(e){"none"!=(a=jQuery(this)).css("display")&&"inline"!=a.css("display")&&(i=parseInt(a.attr("flex-height"),10),isNaN(i)?u-=a.outerHeight(!0):(l.push([a,i]),s+=i))});var p=u/(s||1);for(n=0;n<l.length;n++)a=l[n][0],i=p*l[n][1],r?a.children().each(function(e){var t=jQuery(this),n=t.outerHeight(!0)-t.height()+2*m;t.height(Math.floor(i-n))}):(diff=a.outerHeight(!0)-a.height(),a.height(Math.floor(i-diff)))},XPLAN.layout.vbox=function(e){var t=jQuery(e);XPLAN.framemain.registerResizer(function(e,n){XPLAN.layout.resizeVbox(t,n)})};
;Dependency._js['framemain']=true;

;
SlideMenu={build:function(e,n,i){jQuery(e).empty().append(SlideMenu.buildMenu(n,0))},buildMenu:function(e,n){for(var i=jQuery('<ul class="slide-container slide-lvl'+n+'"/>'),t=0;t<e.length;t++){var l=e[t],a=jQuery("<li/>").appendTo(i).append("<a/>").children("a:first").attr("href",l.href||"#").attr("title",l.title||"").text(l.text||"").end();if(l.menu)a.addClass("slide-menu").append(SlideMenu.buildMenu(l.menu,n+1)).children("a:first").click(SlideMenu.click);else{a.addClass("slide-item");var r,u=a.children("a:first");if(l.target&&u.attr("target",l.target),l.onclick)r="string"==XPLAN.util.getType(l.onclick)?new Function(l.onclick):l.onclick,u.click(r)}}return i},click:function(e){var n;if("string"==typeof e){if(null==(n=document.getElementById(e)))return}else n=e.currentTarget;(n=jQuery(n)).hasClass("slide-title")?n.parent().toggleClass("slide-open"):n.next("ul").parent().parent().toggleClass("slide-open"),e.preventDefault(),e.stopPropagation()},init:function(){jQuery("#mf-navigator").length&&(jQuery("#mf-navigatorbox").on("click","div.slidemenu li.slide-menu > div > a",SlideMenu.click),jQuery("#mf-navigatorbox").on("click","div.slidemenu > div.slide-title",SlideMenu.click),jQuery("#mf-navgrip").click(function(){jQuery(document.body).toggleClass("hasnav"),XMLRPC.call("today.autohide",[!jQuery(document.body).hasClass("hasnav")],function(e){setTimeout(function(){jQuery("#mf-contentinner").trigger("resize")},200)},HttpRequest.onerror)}))},loadMenu:function(e){var n=jQuery(".slidemenu").eq(0),i=n.attr("class");n.replaceWith(e.menuhtml),jQuery(".slidemenu").eq(0).attr("class",i),window.XPLAN&&XPLAN.instasearch&&XPLAN.instasearch.addSideMenu&&XPLAN.instasearch.addSideMenu(e.cfg,e.menudata)}},jQuery(SlideMenu.init);
;Dependency._js['slidemenu']=true;

;
!function(e){"undefined"==typeof e.fn.each2&&e.fn.extend({each2:function(t){for(var s=e([0]),i=-1,n=this.length;++i<n&&(s.context=s[0]=this[i])&&!1!==t.call(s[0],i,s););return this}})}(jQuery),function(e,t){"use strict";function s(e,t){for(var s=0,n=t.length;s<n;s+=1)if(i(e,t[s]))return s;return-1}function i(e,s){return e===s||e!==t&&s!==t&&(null!==e&&null!==s&&(e.constructor===String?e+""==s+"":s.constructor===String&&s+""==e+""))}function n(t,s){var i,n,o;if(null===t||t.length<1)return[];for(n=0,o=(i=t.split(s)).length;n<o;n+=1)i[n]=e.trim(i[n]);return i}function o(e){return e.outerWidth(!1)-e.width()}function a(s){var i="keyup-change-value";s.on("keydown",function(){e.data(s,i)===t&&e.data(s,i,s.val())}),s.on("keyup",function(){var n=e.data(s,i);n!==t&&s.val()!==n&&(e.removeData(s,i),s.trigger("keyup-change"))})}function c(e,s,i){var n;return i=i||t,function(){var t=arguments;window.clearTimeout(n),n=window.setTimeout(function(){s.apply(i,t)},e)}}function l(e){e.preventDefault(),e.stopPropagation()}function r(t,s,i){var n,o=[];(n=t.attr("class"))&&e((n=""+n).split(" ")).each2(function(){0===this.indexOf("select2-")&&o.push(this)}),(n=s.attr("class"))&&e((n=""+n).split(" ")).each2(function(){0!==this.indexOf("select2-")&&i(this)&&o.push(this)}),t.attr("class",o.join(" "))}function h(e,t,s,i){var n=e.toUpperCase().indexOf(t.toUpperCase()),o=t.length;n<0?s.push(i(e)):(s.push(i(e.substring(0,n))),s.push("<span class='select2-match'>"),s.push(i(e.substring(n,n+o))),s.push("</span>"),s.push(i(e.substring(n+o,e.length))))}function d(s){var i,n=0,o=null,a=s.quietMillis||100,c=s.url,l=this;return function(r){window.clearTimeout(i),i=window.setTimeout(function(){var i=n+=1,a=s.data,h=c,d=s.transport||e.fn.select2.ajaxDefaults.transport,u={type:s.type||"GET",cache:s.cache||!1,jsonpCallback:s.jsonpCallback||t,dataType:s.dataType||"json"},p=e.extend({},e.fn.select2.ajaxDefaults.params,u);a=a?a.call(l,r.term,r.page,r.context):null,h="function"==typeof h?h.call(l,r.term,r.page,r.context):h,null!==o&&o.abort(),s.params&&(e.isFunction(s.params)?e.extend(p,s.params.call(l)):e.extend(p,s.params)),e.extend(p,{url:h,dataType:s.dataType,data:a,success:function(e){if(!(i<n)){var t=s.results(e,r.page);r.callback(t)}}}),o=d.call(l,p)},a)}}function u(t){var s,i,n=t,o=function(e){return""+e.text};e.isArray(n)&&(n={results:i=n}),!1===e.isFunction(n)&&(i=n,n=function(){return i});var a=n();return a.text&&(o=a.text,e.isFunction(o)||(s=a.text,o=function(e){return e[s]})),function(t){var s,i=t.term,a={results:[]};""!==i?(s=function(n,a){var c,l;if((n=n[0]).children){for(l in c={},n)n.hasOwnProperty(l)&&(c[l]=n[l]);c.children=[],e(n.children).each2(function(e,t){s(t,c.children)}),(c.children.length||t.matcher(i,o(c),n))&&a.push(c)}else t.matcher(i,o(n),n)&&a.push(n)},e(n().results).each2(function(e,t){s(t,a.results)}),t.callback(a)):t.callback(n())}}function p(s){var i=e.isFunction(s);return function(n){var o=n.term,a={results:[]};e(i?s():s).each(function(){var e=this.text!==t,s=e?this.text:this;(""===o||n.matcher(o,s))&&a.results.push(e?this:{id:this,text:this})}),n.callback(a)}}function f(t,s){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function g(t){return e.isFunction(t)?t():t}function m(t,s){var i=function(){};return(i.prototype=new t).constructor=i,i.prototype.parent=t.prototype,i.prototype=e.extend(i.prototype,s),i}if(window.Select2===t){var v,w,b,C,S,y,x,E,T,k={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case k.LEFT:case k.RIGHT:case k.UP:case k.DOWN:return!0}return!1},isControl:function(e){switch(e.which){case k.SHIFT:case k.CTRL:case k.ALT:return!0}return!!e.metaKey},isFunctionKey:function(e){return(e=e.which?e.which:e)>=112&&e<=123}},P="<div class='select2-measure-scrollbar'></div>";x=e(document),T=1,C=function(){return T++},x.on("mousemove",function(e){y={x:e.pageX,y:e.pageY}}),v=m(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(i){var n,o,h,d,u,p,f;this.opts=i=this.prepareOpts(i),this.id=i.id,i.element.data("select2")!==t&&null!==i.element.data("select2")&&this.destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(i.element.attr("id")||"autogen"+C()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=(h=function(){return i.element.closest("body")},u=!1,function(){return!1===u&&(d=h(),u=!0),d}),r(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(g(i.containerCss)),this.container.addClass(g(i.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(g(i.dropdownCssClass)),this.dropdown.data("select2",this),this.results=n=this.container.find(".select2-results"),this.search=o=this.container.find("input.select2-input"),this.resultsPage=0,this.context=null,this.initContainer(),this.results.on("mousemove",function(s){var i=y;i!==t&&i.x===s.pageX&&i.y===s.pageY||e(s.target).trigger("mousemove-filtered",s)}),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",".select2-results",this.bind(this.highlightUnderEvent)),function(e,t){var i=c(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){s(e.target,t.get())>=0&&i(e)})}(80,this.results),this.dropdown.on("scroll-debounced",".select2-results",this.bind(this.loadMoreIfNeeded)),e(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),e(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),e.fn.mousewheel&&n.mousewheel(function(e,t,s,i){var o=n.scrollTop();i>0&&o-i<=0?(n.scrollTop(0),l(e)):i<0&&n.get(0).scrollHeight-n.scrollTop()+i<=n.height()&&(n.scrollTop(n.get(0).scrollHeight-n.height()),l(e))}),a(o),o.on("keyup-change input paste",this.bind(this.updateResults)),o.on("focus",function(){o.addClass("select2-focused")}),o.on("blur",function(){o.removeClass("select2-focused")}),this.dropdown.on("mouseup",".select2-results",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==i.maximumInputLength&&this.search.attr("maxlength",i.maximumInputLength),(p=i.element.prop("disabled"))===t&&(p=!1),this.enable(!p),(f=i.element.prop("readonly"))===t&&(f=!1),this.readonly(f),E=E||function(){var t=e(P);t.appendTo("body");var s={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),s}(),this.autofocus=i.element.prop("autofocus"),i.element.prop("autofocus",!1),this.autofocus&&this.focus()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").off(".select2").attr({tabindex:this.elementTabIndex}).prop("autofocus",this.autofocus||!1).show())},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:i(e.attr("locked"),"locked")}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(s){var o,a,c,l,r=this;if("select"===(o=s.element).get(0).tagName.toLowerCase()&&(this.select=a=s.element),a&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in s)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),"function"!=typeof(s=e.extend({},{populateResults:function(i,n,o){var a,c=this.opts.id;(a=function(i,n,l){var h,d,u,p,f,g,m,v,w,b;for(h=0,d=(i=s.sortResults(i,n,o)).length;h<d;h+=1)p=!(f=!0===(u=i[h]).disabled)&&c(u)!==t,g=u.children&&u.children.length>0,(m=e("<li></li>")).addClass("select2-results-dept-"+l),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),f&&m.addClass("select2-disabled"),g&&m.addClass("select2-result-with-children"),m.addClass(r.opts.formatResultCssClass(u)),(v=e(document.createElement("div"))).addClass("select2-result-label"),(b=s.formatResult(u,v,o,r.opts.escapeMarkup))!==t&&v.html(b),m.append(v),g&&((w=e("<ul></ul>")).addClass("select2-result-sub"),a(u.children,w,l+1),m.append(w)),m.data("select2-data",u),n.append(m)})(n,i,0)}},e.fn.select2.defaults,s)).id&&(c=s.id,s.id=function(e){return e[c]}),e.isArray(s.element.data("select2Tags"))){if("tags"in s)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+s.element.attr("id");s.tags=s.element.data("select2Tags")}if(a?(s.query=this.bind(function(s){var i,n,a,c={results:[],more:!1},l=s.term;a=function(e,t){var i;e.is("option")?s.matcher(l,e.text(),e)&&t.push(r.optionToData(e)):e.is("optgroup")&&(i=r.optionToData(e),e.children().each2(function(e,t){a(t,i.children)}),i.children.length>0&&t.push(i))},i=o.children(),this.getPlaceholder()!==t&&i.length>0&&(n=i[0],""===e(n).text()&&(i=i.not(n))),i.each2(function(e,t){a(t,c.results)}),s.callback(c)}),s.id=function(e){return e.id},s.formatResultCssClass=function(e){return e.css}):"query"in s||("ajax"in s?((l=s.element.data("ajax-url"))&&l.length>0&&(s.ajax.url=l),s.query=d.call(s.element,s.ajax)):"data"in s?s.query=u(s.data):"tags"in s&&(s.query=p(s.tags),s.createSearchChoice===t&&(s.createSearchChoice=function(e){return{id:e,text:e}}),s.initSelection===t&&(s.initSelection=function(t,o){var a=[];e(n(t.val(),s.separator)).each(function(){var t=this,n=this,o=s.tags;e.isFunction(o)&&(o=o()),e(o).each(function(){if(i(this.id,t))return n=this.text,!1}),a.push({id:t,text:n})}),o(a)}))),"function"!=typeof s.query)throw"query function not defined for Select2 "+s.element.attr("id");return s},monitorSource:function(){var e,s=this.opts.element;s.on("change.select2",this.bind(function(e){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()})),e=this.bind(function(){var e,i=s.prop("disabled");i===t&&(i=!1),this.enable(!i),(e=s.prop("readonly"))===t&&(e=!1),this.readonly(e),r(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(g(this.opts.containerCssClass)),r(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(g(this.opts.dropdownCssClass))}),s.on("propertychange.select2 DOMAttrModified.select2",e),this.mutationCallback===t&&(this.mutationCallback=function(t){t.forEach(e)}),"undefined"!=typeof WebKitMutationObserver&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(this.mutationCallback),this.propertyObserver.observe(s.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var s=e.Event("select2-selecting",{val:this.id(t),object:t});return this.opts.element.trigger(s),!s.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){return e===t&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface(),!0)},readonly:function(e){return e===t&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface(),!0)},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,s,i,n,o=this.dropdown,a=this.container.offset(),c=this.container.outerHeight(!1),l=this.container.outerWidth(!1),r=o.outerHeight(!1),h=e(window).scrollLeft()+e(window).width(),d=e(window).scrollTop()+e(window).height(),u=a.top+c,p=a.left,f=u+r<=d,m=a.top-r>=this.body().scrollTop(),v=o.outerWidth(!1),w=p+v<=h,b=o.hasClass("select2-drop-above");this.opts.dropdownAutoWidth?(n=e(".select2-results",o)[0],o.addClass("select2-drop-auto-width"),o.css("width",""),(v=o.outerWidth(!1)+(n.scrollHeight===n.clientHeight?0:E.width))>l?l=v:v=l,w=p+v<=h):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body().css("position")&&(u-=(t=this.body().offset()).top,p-=t.left),b?(s=!0,!m&&f&&(s=!1)):(s=!1,!f&&m&&(s=!0)),w||(p=a.left+l-v),s?(u=a.top-r,this.container.addClass("select2-drop-above"),o.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),o.removeClass("select2-drop-above")),i=e.extend({top:u,left:p,width:l},g(this.opts.dropdownCss)),o.css(i)},shouldOpen:function(){var t;return!this.opened()&&(!1!==this._enabled&&!0!==this._readonly&&(t=e.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),!0)},opening:function(){function t(){return{width:Math.max(document.documentElement.scrollWidth,e(window).width()),height:Math.max(document.documentElement.scrollHeight,e(window).height())}}var s,i=this.containerId,n="scroll."+i,o="resize."+i,a="orientationchange."+i,c=this;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),0==(s=e("#select2-drop-mask",this.container[0].ownerDocument)).length&&((s=e(document.createElement("div"))).attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.on("mousedown touchstart",function(t){var s,i=c.dropdown;!i.is(":visible")&&c.body()&&(i=e("#select2-drop",c.body())),i.is(":visible")||(i=e("#select2-drop")),i.length>0&&((s=i.data("select2")).opts&&s.opts.selectOnBlur&&s.selectHighlighted({noFocus:!0}),s.close(),t.preventDefault(),t.stopPropagation())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css(t()),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible(),this.container.parents().add(window).each(function(){e(this).on(o+" "+n+" "+a,function(s){e("#select2-drop-mask",c.container[0].ownerDocument).css(t()),c.positionDropdown()})})},close:function(){if(this.opened()){var t=this.containerId,s="scroll."+t,i="resize."+t,n="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).off(s).off(i).off(n)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask",this.container[0].ownerDocument).hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(e.Event("select2-close"))}},clearSearch:function(){},getMaximumSelectionSize:function(){return g(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t,s,i,n,o,a,c,l=this.results;(s=this.highlight())<0||(0!=s?(t=this.findHighlightableChoices().find(".select2-result-label"),n=(i=e(t[s])).offset().top+i.outerHeight(!0),s===t.length-1&&(c=l.find("li.select2-more-results")).length>0&&(n=c.offset().top+c.outerHeight(!0)),n>(o=l.offset().top+l.outerHeight(!0))&&l.scrollTop(l.scrollTop()+(n-o)),(a=i.offset().top-l.offset().top)<0&&"none"!=i.css("display")&&l.scrollTop(l.scrollTop()+a)):l.scrollTop(0))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){for(var s=this.findHighlightableChoices(),i=this.highlight();i>-1&&i<s.length;){var n=e(s[i+=t]);if(n.hasClass("select2-result-selectable")&&!n.hasClass("select2-disabled")&&!n.hasClass("select2-selected")){this.highlight(i);break}}},highlight:function(t){var i,n,o=this.findHighlightableChoices();if(0===arguments.length)return s(o.filter(".select2-highlighted")[0],o.get());t>=o.length&&(t=o.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),(i=e(o[t])).addClass("select2-highlighted"),this.ensureHighlightVisible(),(n=i.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(n),choice:n})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var s=e(t.target).closest(".select2-result-selectable");if(s.length>0&&!s.is(".select2-highlighted")){var i=this.findHighlightableChoices();this.highlight(i.index(s))}else 0==s.length&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),s=this.resultsPage+1,i=this,n=this.search.val(),o=this.context;0!==t.length&&t.offset().top-e.offset().top-e.height()<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:n,page:s,context:o,matcher:this.opts.matcher,callback:this.bind(function(a){i.opened()&&(i.opts.populateResults.call(this,e,a.results,{term:n,page:s,context:o}),i.postprocessResults(a,!1,!1),!0===a.more?(t.detach().appendTo(e).text(i.opts.formatLoadMore(s+1)),window.setTimeout(function(){i.loadMoreIfNeeded()},10)):t.remove(),i.positionDropdown(),i.resultsPage=s,i.context=a.context)})}))},tokenize:function(){},updateResults:function(s){function n(){r.scrollTop(0),l.removeClass("select2-active"),d.positionDropdown()}function o(e){r.html(e),n()}var a,c,l=this.search,r=this.results,h=this.opts,d=this,u=l.val(),p=e.data(this.container,"select2-last-term");if((!0===s||!p||!i(u,p))&&(e.data(this.container,"select2-last-term",u),!0===s||!1!==this.showSearchInput&&this.opened())){var g=this.getMaximumSelectionSize();if(!(g>=1&&(a=this.data(),e.isArray(a)&&a.length>=g&&f(h.formatSelectionTooBig))))return l.val().length<h.minimumInputLength?(f(h.formatInputTooShort)?o("<li class='select2-no-results'>"+h.formatInputTooShort(l.val(),h.minimumInputLength)+"</li>"):o(""),void(s&&this.showSearch(!0))):void(h.maximumInputLength&&l.val().length>h.maximumInputLength?f(h.formatInputTooLong)?o("<li class='select2-no-results'>"+h.formatInputTooLong(l.val(),h.maximumInputLength)+"</li>"):o(""):(h.formatSearching&&0===this.findHighlightableChoices().length&&o("<li class='select2-searching'>"+h.formatSearching()+"</li>"),l.addClass("select2-active"),(c=this.tokenize())!=t&&null!=c&&l.val(c),this.resultsPage=1,h.query({element:h.element,term:l.val(),page:this.resultsPage,context:null,matcher:h.matcher,callback:this.bind(function(a){var c;this.opened()?(this.context=a.context===t?null:a.context,this.opts.createSearchChoice&&""!==l.val()&&(c=this.opts.createSearchChoice.call(null,l.val(),a.results))!==t&&null!==c&&d.id(c)!==t&&null!==d.id(c)&&0===e(a.results).filter(function(){return i(d.id(this),d.id(c))}).length&&a.results.unshift(c),0===a.results.length&&f(h.formatNoMatches)?o("<li class='select2-no-results'>"+h.formatNoMatches(l.val())+"</li>"):(r.empty(),d.opts.populateResults.call(this,r,a.results,{term:l.val(),page:this.resultsPage,context:null}),!0===a.more&&f(h.formatLoadMore)&&(r.append("<li class='select2-more-results'>"+d.opts.escapeMarkup(h.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){d.loadMoreIfNeeded()},10)),this.postprocessResults(a,s),n(),this.opts.element.trigger({type:"select2-loaded",data:a}))):this.search.removeClass("select2-active")})})));o("<li class='select2-selection-limit'>"+h.formatSelectionTooBig(g)+"</li>")}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){var e;(e=this.search)[0]!==document.activeElement&&window.setTimeout(function(){var t,s=e[0],i=e.val().length;e.focus(),e.is(":visible")&&s===document.activeElement&&(s.setSelectionRange?s.setSelectionRange(i,i):s.createTextRange&&((t=s.createTextRange()).collapse(!1),t.select()))},0)},selectHighlighted:function(e){var t=this.highlight(),s=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data");s&&(this.highlight(t),this.onSelect(s,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){var s=function(){var s,i,n,o,a;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if((s=this.opts.element.attr("style"))!==t)for(o=0,a=(i=s.split(";")).length;o<a;o+=1)if(null!==(n=i[o].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&n.length>=1)return n[1];return(s=this.opts.element.css("width"))&&s.length>0?s:"resolve"===this.opts.width?0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px":null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}.call(this);null!==s&&this.container.css("width",s)}}),w=m(v,{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>","   <span>&nbsp;</span><abbr class='select2-search-choice-close'></abbr>","   <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <input type='text' autocomplete='off' autocorrect='off' autocapitilize='off' spellcheck='false' class='select2-input'/>","   </div>","   <ul class='select2-results'>","   </ul>","</div>"].join(""))},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var t,s;this.parent.opening.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.search.focus(),(t=this.search.get(0)).createTextRange&&((s=t.createTextRange()).collapse(!1),s.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var t,s=this.container,i=this.dropdown;this.showSearch(!1),this.selection=t=s.find(".select2-choice"),this.focusser=s.find(".select2-focusser"),this.focusser.attr("id","s2id_autogen"+C()),e("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id")),this.focusser.attr("tabindex",this.elementTabIndex),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled())if(e.which!==k.PAGE_UP&&e.which!==k.PAGE_DOWN)switch(e.which){case k.UP:case k.DOWN:return this.moveHighlight(e.which===k.UP?-1:1),void l(e);case k.ENTER:return this.selectHighlighted(),void l(e);case k.TAB:return void this.selectHighlighted({noFocus:!0});case k.ESC:return this.cancel(e),void l(e)}else l(e)})),this.search.on("blur",this.bind(function(e){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==k.TAB&&!k.isControl(e)&&!k.isFunctionKey(e)&&e.which!==k.ESC){if(!1!==this.opts.openOnEnter||e.which!==k.ENTER)return e.which==k.DOWN||e.which==k.UP||e.which==k.ENTER&&this.opts.openOnEnter?(this.open(),void l(e)):e.which==k.DELETE||e.which==k.BACKSPACE?(this.opts.allowClear&&this.clear(),void l(e)):void 0;l(e)}})),a(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){e.stopPropagation(),this.opened()||this.open()})),t.on("mousedown","abbr",this.bind(function(e){var t;this.isInterfaceEnabled()&&(this.clear(),(t=e).preventDefault(),t.stopImmediatePropagation(),this.close(),this.selection.focus())})),t.on("mousedown",this.bind(function(t){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),l(t)})),i.on("mousedown",this.bind(function(){this.search.focus()})),t.on("focus",this.bind(function(e){l(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(e){var t=this.selection.data("select2-data");t&&(this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==e&&(this.opts.element.trigger({type:"select2-removed",val:this.id(t),choice:t}),this.triggerChange({removed:t})))},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text())this.updateSelection([]),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,function(s){s!==t&&null!==s&&(e.updateSelection(s),e.close(),e.setPlaceholder())})}},prepareOpts:function(){var s=this.parent.prepareOpts.apply(this,arguments),n=this;return"select"===s.element.get(0).tagName.toLowerCase()?s.initSelection=function(e,t){var s=e.find(":selected");t(n.optionToData(s))}:"data"in s&&s.initSelection===t&&(s.initSelection=function(t,n){var o=t.val(),a=null;s.query({matcher:function(e,t,n){var c=i(o,s.id(n));return c&&(a=n),c},callback:e.isFunction(n)?function(){n(a)}:e.noop})}),s},getPlaceholder:function(){return this.select&&""!==this.select.find("option").first().text()?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(""===this.opts.element.val()&&e!==t){if(this.select&&""!==this.select.find("option:first").text())return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(t,s,n){var o=0,a=this;if(this.findHighlightableChoices().each2(function(e,t){if(i(a.id(t.data("select2-data")),a.opts.element.val()))return o=e,!1}),!1!==n&&this.highlight(o),!0===s&&!1===this.showSearchInput){var c=this.opts.minimumResultsForSearch;c>=0&&this.showSearch(function t(s){var i=0;return e.each(s,function(e,s){s.children?i+=t(s.children):i++}),i}(t.results)>=c)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t)},onSelect:function(e,t){if(this.triggerSelect(e)){var s=this.opts.element.val(),n=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.close(),t&&t.noFocus||this.selection.focus(),i(s,this.id(e))||this.triggerChange({added:e,removed:n})}},updateSelection:function(e){var s,i=this.selection.find("span");this.selection.data("select2-data",e),i.empty(),(s=this.opts.formatSelection(e,i))!==t&&i.append(this.opts.escapeMarkup(s)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,s=!1,i=null,n=this,o=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(s=arguments[1]),this.select)this.select.val(e).find(":selected").each2(function(e,t){return i=n.optionToData(t),!1}),this.updateSelection(i),this.setPlaceholder(),s&&this.triggerChange({added:i,removed:o});else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&0!==e)return void this.clear(s);this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){n.opts.element.val(e?n.id(e):""),n.updateSelection(e),n.setPlaceholder(),s&&n.triggerChange({added:e,removed:o})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e,s){var i;if(0===arguments.length)return(i=this.selection.data("select2-data"))==t&&(i=null),i;e&&""!==e?(i=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),s&&this.triggerChange({added:e,removed:i})):this.clear(s)}}),b=m(v,{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["    <ul class='select2-choices'>","  <li class='select2-search-field'>","    <input type='text' autocomplete='off' autocorrect='off' autocapitilize='off' spellcheck='false' class='select2-input'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""))},prepareOpts:function(){var s=this.parent.prepareOpts.apply(this,arguments),o=this;return"select"===s.element.get(0).tagName.toLowerCase()?s.initSelection=function(e,t){var s=[];e.find(":selected").each2(function(e,t){s.push(o.optionToData(t))}),t(s)}:"data"in s&&s.initSelection===t&&(s.initSelection=function(t,o){var a=n(t.val(),s.separator),c=[];s.query({matcher:function(t,n,o){var l=e.grep(a,function(e){return i(e,s.id(o))}).length;return l&&c.push(o),l},callback:e.isFunction(o)?function(){for(var e=[],t=0;t<a.length;t++)for(var n=a[t],l=0;l<c.length;l++){var r=c[l];if(i(n,s.id(r))){e.push(r),c.splice(l,1);break}}o(e)}:e.noop})}),s},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},initContainer:function(){var t,s=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(s);var i=this;this.selection.on("mousedown",".select2-search-choice",function(t){i.search[0].focus(),i.selectChoice(e(this))}),this.search.attr("id","s2id_autogen"+C()),e("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(s){if(this.isInterfaceEnabled()){++this.keydowns;var i=t.find(".select2-search-choice-focus"),n=i.prev(".select2-search-choice:not(.select2-locked)"),o=i.next(".select2-search-choice:not(.select2-locked)"),a=function(t){var s=0,i=0;if("selectionStart"in(t=e(t)[0]))s=t.selectionStart,i=t.selectionEnd-s;else if("selection"in document){t.focus();var n=document.selection.createRange();i=document.selection.createRange().text.length,n.moveStart("character",-t.value.length),s=n.text.length-i}return{offset:s,length:i}}(this.search);if(i.length&&(s.which==k.LEFT||s.which==k.RIGHT||s.which==k.BACKSPACE||s.which==k.DELETE||s.which==k.ENTER)){var c=i;return s.which==k.LEFT&&n.length?c=n:s.which==k.RIGHT?c=o.length?o:null:s.which===k.BACKSPACE?(this.unselect(i.first()),this.search.width(10),c=n.length?n:o):s.which==k.DELETE?(this.unselect(i.first()),this.search.width(10),c=o.length?o:null):s.which==k.ENTER&&(c=null),this.selectChoice(c),l(s),void(c&&c.length||this.open())}if((s.which===k.BACKSPACE&&1==this.keydowns||s.which==k.LEFT)&&0==a.offset&&!a.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),void l(s);if(this.selectChoice(null),this.opened())switch(s.which){case k.UP:case k.DOWN:return this.moveHighlight(s.which===k.UP?-1:1),void l(s);case k.ENTER:return this.selectHighlighted(),void l(s);case k.TAB:return void this.selectHighlighted({noFocus:!0});case k.ESC:return this.cancel(s),void l(s)}if(s.which!==k.TAB&&!k.isControl(s)&&!k.isFunctionKey(s)&&s.which!==k.BACKSPACE&&s.which!==k.ESC){if(s.which===k.ENTER){if(!1===this.opts.openOnEnter)return;if(s.altKey||s.ctrlKey||s.shiftKey||s.metaKey)return}this.open(),s.which!==k.PAGE_UP&&s.which!==k.PAGE_DOWN||l(s),s.which===k.ENTER&&l(s)}}})),this.search.on("keyup",this.bind(function(e){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(e.Event("select2-blur"))})),this.container.on("mousedown",s,this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",s,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,function(s){s!==t&&null!==s&&(e.updateSelection(s),e.close(),e.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),s=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(e).addClass("select2-default"),this.search.width(s>0?s:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.updateResults(!0),this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var i=[],n=[],o=this;e(t).each(function(){s(o.id(this),i)<0&&(i.push(o.id(this)),n.push(this))}),t=n,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){o.addSelectedChoice(this)}),o.postprocessResults()},tokenize:function(){var e=this.search.val();null!=(e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts))&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.triggerSelect(e)&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),!this.select&&this.opts.closeOnSelect||this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),t&&t.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(s){var i,n=!s.locked,o=e("<li class='select2-search-choice'>    <div></div>    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),a=e("<li class='select2-search-choice select2-locked'><div></div></li>"),c=n?o:a,r=this.id(s),h=this.getVal();(i=this.opts.formatSelection(s,c.find("div")))!=t&&c.find("div").replaceWith("<div title='"+this.opts.escapeMarkup(i)+"'>"+this.opts.escapeMarkup(i)+"</div>"),n&&c.find(".select2-search-choice-close").on("mousedown",l).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),l(t))})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),c.data("select2-data",s),c.insertBefore(this.searchContainer),h.push(r),this.setVal(h)},unselect:function(e){var t,i,n=this.getVal();if(0===(e=e.closest(".select2-search-choice")).length)throw"Invalid argument: "+e+". Must be .select2-search-choice";(t=e.data("select2-data"))&&((i=s(this.id(t),n))>=0&&(n.splice(i,1),this.setVal(n),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(t),choice:t}),this.triggerChange({removed:t}))},postprocessResults:function(e,t,i){var n=this.getVal(),o=this.results.find(".select2-result"),a=this.results.find(".select2-result-with-children"),c=this;o.each2(function(e,t){s(c.id(t.data("select2-data")),n)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),a.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&!1!==i&&c.highlight(0),!this.opts.createSearchChoice&&!o.filter(".select2-result:not(.select2-selected)").length>0&&this.results.append("<li class='select2-no-results'>"+c.opts.formatNoMatches(c.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-o(this.search)},resizeSearch:function(){var t,s,i,n,a=o(this.search);t=function(t){if(!S){var s=t[0].currentStyle||window.getComputedStyle(t[0],null);(S=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:s.fontSize,fontFamily:s.fontFamily,fontStyle:s.fontStyle,fontWeight:s.fontWeight,letterSpacing:s.letterSpacing,textTransform:s.textTransform,whiteSpace:"nowrap"})).attr("class","select2-sizer"),e("body").append(S)}return S.text(t.val()),S.width()}(this.search)+10,s=this.search.offset().left,(n=(i=this.selection.width())-(s-this.selection.offset().left)-a)<t&&(n=i-a),n<40&&(n=i-a),n<=0&&(n=t),this.search.width(n)},getVal:function(){var e;return this.select?null===(e=this.select.val())?[]:e:n(e=this.opts.element.val(),this.opts.separator)},setVal:function(t){var i;this.select?this.select.val(t):(i=[],e(t).each(function(){s(this,i)<0&&i.push(this)}),this.opts.element.val(0===i.length?"":i.join(this.opts.separator)))},buildChangeDetails:function(e,t){t=t.slice(0),e=e.slice(0);for(var s=0;s<t.length;s++)for(var n=0;n<e.length;n++)i(this.opts.id(t[s]),this.opts.id(e[n]))&&(t.splice(s,1),s--,e.splice(n,1),n--);return{added:t,removed:e}},val:function(s,i){var n,o=this;if(0===arguments.length)return this.getVal();if((n=this.data()).length||(n=[]),!s&&0!==s)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(i&&this.triggerChange({added:this.data(),removed:n}));if(this.setVal(s),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),i&&this.triggerChange(this.buildChangeDetails(n,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var s=e(t).map(o.id);o.setVal(s),o.updateSelection(t),o.clearSearch(),i&&o.triggerChange(this.buildChangeDetails(n,this.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],s=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(s.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,s){var i,n,o=this;if(0===arguments.length)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();n=this.data(),t||(t=[]),i=e.map(t,function(e){return o.opts.id(e)}),this.setVal(i),this.updateSelection(t),this.clearSearch(),s&&this.triggerChange(this.buildChangeDetails(n,this.data()))}}),e.fn.select2=function(){var i,n,o,a,c=Array.prototype.slice.call(arguments,0),l=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","readonly","positionDropdown","data"],r=["val","opened","isFocused","container","data"];return this.each(function(){if(0===c.length||"object"==typeof c[0])(i=0===c.length?{}:e.extend({},c[0])).element=e(this),"select"===i.element.get(0).tagName.toLowerCase()?a=i.element.prop("multiple"):(a=i.multiple||!1,"tags"in i&&(i.multiple=a=!0)),(n=a?new b:new w).init(i);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(s(c[0],l)<0)throw"Unknown method: "+c[0];if(o=t,(n=e(this).data("select2"))===t)return;if(o="container"===c[0]?n.container:n[c[0]].apply(n,c.slice(1)),s(c[0],r)>=0)return!1}}),o===t?this:o},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,s,i){var n=[];return h(e.text,s.term,n,i),n.join("")},formatSelection:function(e,s){return e?e.text:t},sortResults:function(e,t,s){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var s=t-e.length;return"Please enter "+s+" more character"+(1==s?"":"s")},formatInputTooLong:function(e,t){var s=e.length-t;return"Please delete "+s+" character"+(1==s?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return(""+t).toUpperCase().indexOf((""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:function(e,s,n,o){var a,c,l,r,h,d=e,u=!1;if(!o.createSearchChoice||!o.tokenSeparators||o.tokenSeparators.length<1)return t;for(;;){for(c=-1,l=0,r=o.tokenSeparators.length;l<r&&(h=o.tokenSeparators[l],!((c=e.indexOf(h))>=0));l++);if(c<0)break;if(a=e.substring(0,c),e=e.substring(c+h.length),a.length>0&&(a=o.createSearchChoice(a,s))!==t&&null!==a&&o.id(a)!==t&&null!==o.id(a)){for(u=!1,l=0,r=s.length;l<r;l++)if(i(o.id(a),o.id(s[l]))){u=!0;break}u||n(a)}}return d!==e?e:void 0},escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}},e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:d,local:u,tags:p},util:{debounce:c,markMatch:h},class:{abstract:v,single:w,multi:b},jQuery:e}}}(jQuery);
;Dependency._js['lib/jquery/plugins/select2/select2']=true;

;
!function(){function e(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function t(e){return"keypress"==e.type?String.fromCharCode(e.which):h[e.which]?h[e.which]:p[e.which]?p[e.which]:String.fromCharCode(e.which).toLowerCase()}function n(e,t){e=e||{};var n,r=!1;for(n in k)e[n]&&k[n]>t?r=!0:k[n]=0;r||(v=!1)}function r(e,t,n,r,o){var i,c,s,u,f=[],l=n.type;if(!y[e])return[];for("keyup"==l&&a(e)&&(t=[e]),i=0;i<y[e].length;++i)(c=y[e][i]).seq&&k[c.seq]!=c.level||l==c.action&&(("keypress"!=l||n.metaKey||n.ctrlKey)&&(s=t,u=c.modifiers,s.sort().join(",")!==u.sort().join(","))||(r&&c.combo==o&&y[e].splice(i,1),f.push(c)));return f}function o(e,t,n){E.stopCallback(t,t.target||t.srcElement,n)||!1===e(t,n)&&(t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.returnValue=!1,t.cancelBubble=!0)}function i(e){"number"!=typeof e.which&&(e.which=e.keyCode);var i=t(e);i&&("keyup"!=e.type||b!=i?function(e,t){var i,c=r(e,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(t),t),s={},u=0,f=!1;for(i=0;i<c.length;++i)c[i].seq?(f=!0,u=Math.max(u,c[i].level),s[c[i].seq]=1,o(c[i].callback,t,c[i].combo)):f||v||o(c[i].callback,t,c[i].combo);t.type!=v||a(e)||n(s,u)}(i,e):b=!1)}function a(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function c(e,t,n){return n||(n=function(){if(!f)for(var e in f={},h)e>95&&e<112||h.hasOwnProperty(e)&&(f[h[e]]=e);return f}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function s(e,r,i,a){k[e]=0,a||(a=c(r[0],[]));var s,f=function(t){v=a,++k[e],clearTimeout(l),l=setTimeout(n,1e3)},h=function(r){o(i,r,e),"keyup"!==a&&(b=t(r)),setTimeout(n,10)};for(s=0;s<r.length;++s)u(r[s],s<r.length-1?f:h,a,e,s)}function u(e,t,n,o,i){var u,f,l,h=(e=e.replace(/\s+/g," ")).split(" "),p=[];if(h.length>1)s(e,h,t,n);else{for(l="+"===e?["+"]:e.split("+"),u=0;u<l.length;++u)f=l[u],d[f]&&(f=d[f]),n&&"keypress"!=n&&m[f]&&(f=m[f],p.push("shift")),a(f)&&p.push(f);n=c(f,p,n),y[f]||(y[f]=[]),r(f,p,{type:n},!o,e),y[f][o?"unshift":"push"]({callback:t,modifiers:p,action:n,seq:o,level:i,combo:e})}}for(var f,l,h={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},p={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},m={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},d={option:"alt",command:"meta",return:"enter",escape:"esc"},y={},g={},k={},b=!1,v=!1,w=1;w<20;++w)h[111+w]="f"+w;for(w=0;w<=9;++w)h[w+96]=w;e(document,"keypress",i),e(document,"keydown",i),e(document,"keyup",i);var E={bind:function(e,t,n){return function(e,t,n){for(var r=0;r<e.length;++r)u(e[r],t,n)}(e instanceof Array?e:[e],t,n),g[e+":"+n]=t,this},unbind:function(e,t){return g[e+":"+t]&&(delete g[e+":"+t],this.bind(e,function(){},t)),this},trigger:function(e,t){return g[e+":"+t](),this},reset:function(){return y={},g={},this},stopCallback:function(e,t,n){return!((" "+t.className+" ").indexOf(" mousetrap ")>-1)&&("INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.contentEditable&&"true"==t.contentEditable)}};window.Mousetrap=E,"function"==typeof define&&define.amd&&define(E)}();
;Dependency._js['lib/mousetrap']=true;

;
XPLAN.namespace("instasearch"),function($){var instaDATA=[],currentQuery=null,showTip,showSearch=function(e){e.preventDefault&&e.preventDefault();var t="keydown"==e.type;showTip(t),XPLAN.instasearch.indexMenus(),$(".instasearch.overlay").show(),$(".smoothener").addClass("fromhide"),window.setTimeout(function(){$(".smoothener").removeClass("fromhide")},0),window.setTimeout(function(){$("#queryselect2").select2("focus")},1),$("#queryselect2").select2("enable",!0),$("#queryselect2").select2("focus")},hideSearch=function(){currentQuery=null,$(".instasearch.overlay").hide(),$("#queryselect2").select2("close"),$("#queryselect2").select2("enable",!1),$("#queryselect2").select2("val",[]),$(".instasearch.overlay").hide()};showTip=function(e){var t=["Type a function name, e.g. <span class=example>Add client</span> or <span class=example>Diary</span> and press <span class=key>Enter</span>","Type what you want to do, e.g. <span class=example>Risk</span> or <span class=example>Super</span>","Type your Client's name and see what happens. (Only works for recent clients)"];e?t.push("You are using keyboard shortcuts. You are awesome!"):(t.push("You can close Instant Search (this white window) by pressing <span class=key>Esc</span>"),t.push("Make Captain Productivity proud - use hotkey: <span class=key>Ctrl</span> + <span class=key>Shift</span> + <span class=key>F</span>"));var n=t[Math.floor(t.length*Math.random())];$(".instasearch .instatip").html(n)};var hilite=function(e,t){var n=e.toLowerCase(),s=t.toLowerCase().split(" "),a=new Array(n.length);underscore.each(s,function(e){var t=n.indexOf(e);if(e.length>0&&t>=0)for(var s=0;s<e.length;s++)a[t+s]=!0});for(var i="",r=0;r<n.length;r++)a[r]?i+='<span class="select2-match">'+XPLAN.util.escape(e[r])+"</span>":i+=XPLAN.util.escape(e[r]);return i},updateResults=function(){currentQuery&&queryFn(currentQuery)},queryFn=function(e){if(currentQuery=e,""!==e.term){var t,n="",s={results:[]},a=s.results;for(t=0;t<instaDATA.length;t++){var i=instaDATA[t];itemMatch(i,e.term)&&(i.category!=n&&(n=i.category,a.push({iscat:1,catname:n,text:"<strong>"+hilite(n,e.term)+"</strong>"})),a.push({id:i.id,name:i.name,text:"<span class=subbullet></span>"+hilite(i.name,e.term)}))}var r=0;for(underscore.each(a,function(e){e.iscat&&r++}),t=0;t<a.length&&r>3;t++){var l;if(a[t].iscat&&(t+1>=a.length||t+2>=a.length||a[t+2].iscat)){!0;var c=a[t].catname;for(l=t+1;l<a.length&&!a[l].iscat;l++)a[l].text=hilite(c,e.term)+" > <strong>"+hilite(a[l].name,e.term)+"</strong>";for(l=t+1;l<a.length;l++)a[l-1]=a[l];a=a.slice(0,a.length-1)}}s.results=a,e.callback(s)}else{e.callback({results:[{id:1,text:"Type in a command or a client name"}]})}},instaPUT=function(e,t,n){n=n||0;var s={id:instaDATA.length,searchstr:e.join(" > "),name:e.slice(n,1e4).join(" > "),category:e.slice(0,n).join(" > "),url:t,hint:"",path:e.slice(0)};return instaDATA.push(s),s},itemMatch=function(e,t){t=t.toLowerCase();var n=e.searchstr.toLowerCase(),s=!0,a=0,i=0;return underscore.each(t.split(" "),function(e){a++,n.indexOf(e)<0&&(e.length<3?i++:s=!1)}),2*i<a&&s};XPLAN.instasearch.addSideMenu=function(e,t){var n=[];e.title&&""!==e.title&&n.push(e.title);for(var s=0;s<t.length;s++)findSideItems(t[s],n)};var findSideItems=function(e,t,n){var s=sumArs(t,e[0]);"#"!=e[1]&&instaPUT(s,e[1],s.length-1);var a=e[3];if(a&&a.length)for(var i=0;i<a.length;i++)findSideItems(a[i],s,n)},instaTaken=function(e){if(e.val&&0!==e.val.length){var url=instaDATA[e.val[0]].url,jsregex=/^javascript:/;if(url.search(jsregex)>=0){var evalstr=url.replace(jsregex,"");eval(evalstr)}else XPLAN.util.form_redirect(XPLAN.util.getURL(url,[],!0));hideSearch()}},sumArs=function(e,t){var n=e.slice(0);if("string"==typeof t||0!==t.length&&!t[0])n.push(t);else for(var s=0;s<t.length;s++)n.push(t[s]);return n},indexHomeMenu=function(e){var t=["XPLAN"];instaPUT(sumArs(t,"Dashboard"),getBaseURL()+"/dashboard/mainhtml",1);for(var n=0;n<e.length;n++)processMenuItem(t,e[n],2)},processMenuItem=function(e,t,n){var s=sumArs(e,[t.title]);if(t.script&&!t.url&&(t.url="javascript:(function(){"+t.script+";})();"),t.url&&(0!==t.url.indexOf("javascript:")&&(t.url=getBaseURL()+t.url),instaPUT(s,t.url,n)),t.functions&&t.functions.length)for(var a=0;a<t.functions.length;a++)processMenuItem(s,t.functions[a],n)};XPLAN.instasearch.menusIndexed=!1,XPLAN.instasearch.indexMenus=function(){if(!XPLAN.instasearch.menusIndexed){XPLAN.instasearch.menusIndexed=!0;var e=top.location.href;endswith=function(t){return e.length==e.indexOf(t)+t.length};var t=getBaseURL();endswith(t+"/home")||endswith(t+"/home/")||endswith(t+"/home/logoff")||endswith(t+"/home/login")||window.XPLAN&&XPLAN.login_role&&""!==XPLAN.login_role&&(XMLRPC.call("today.getBlocks",[],function(e){indexHomeMenu(e),updateResults()}),XMLRPC.call("today.get_add_links",[],function(e){indexAddMenu(e),updateResults()}),XMLRPC.call("today.get_quicklinks",[],function(e){indexAddQuicklinks(e),updateResults()}),XMLRPC.call("factfind.getRecentEntities",["client"],function(e){indexRecentClients(e)}))}};var indexAddMenu=function(e){for(var t=["Add"],n=0;n<e.length;n++){e[n].title&&0===e[n].title.indexOf("Add ")&&(e[n].title=e[n].title.substr("Add ".length)),processMenuItem(t,e[n],1)}},indexAddQuicklinks=function(e){for(var t=["Quicklinks"],n=0;n<e.length;n++)processMenuItem(t,e[n],1);instaPUT(sumArs(t,"Edit Quicklinks"),"javascript:XPLAN.framemain.editQuicklinks()",1)},indexRecentClients=function(e){for(var t=["Recent Clients"],n=0;n<e.length;n++){var s=e[n];if(s.visible)!function(e,t){XMLRPC.call("factfind.getPageMenu",["client",s.entityid],function(n){if(s.email){var a=getBaseURL()+"/email/edit?new=client&add_to_note=1&client="+t+"&no_egg_timer=1";instaPUT(sumArs(e,"Send Email"),a,2)}underscore.each(n,function(n){addSubUserEntry(e,t,n,2)}),updateResults()})}(sumArs(t,s.name),s.entityid)}},addSubUserEntry=function(e,t,n,s){var a,i=sumArs(e,n.title);n.page&&""!=n.page&&(a=0===n.page.indexOf("/")?getBaseURL()+n.page:getBaseURL()+"/factfind/view/"+t+"?role=client&refresh=1&page="+n.page,instaPUT(i,a,s));n.submenu&&n.submenu.length&&underscore.each(n.submenu,function(e){addSubUserEntry(i,t,e,s)})};$(function(){var e=$("#queryselect2");e&&e.select2&&(e.select2({placeholder:"",multiple:!0,query:queryFn,formatResult:function(e,t,n){return e.text},formatSelection:function(e,t){return e.text},initSelection:function(e,t){t(null)}}).on("change",instaTaken),$("#ta-instasearch a").click(showSearch),$(".instasearch.overlay").click(hideSearch),Mousetrap.bind(["ctrl+shift+f","command+shift+f"],showSearch),Mousetrap.bind("esc",hideSearch),Mousetrap.stopCallback=function(e,t,n){return!1})})}(jQuery);
;Dependency._js['instasearch']=true;
