/*!
 * jQuery JavaScript Library v1.6.2
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Thu Jun 30 14:16:56 2011 -0400
 */
(function(a,b){function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function D(){return!1}function E(){return!0}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")return;a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function bh(a,b){if(b.nodeType!==1||!f.hasData(a))return;var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}function bi(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0)return c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0}),d+"px";d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;return d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)}),d+"px"}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));return(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g)),l}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j)return j!==f[0]&&f.unshift(j),d[j]}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cp(){return setTimeout(cq,0),cn=f.now()}function cq(){cn=b}function cr(a,b){var c={};return f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a}),c}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(e.isReady)return;try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};return e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(a==="body"&&!d&&c.body)return this.context=c,this[0]=c.body,this.selector=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?g=[null,a,null]:g=i.exec(a);if(g&&(g[1]||!d)){if(g[1])return d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes),e.merge(this,a);h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}return this.context=c,this.selector=a,this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}return e.isFunction(a)?f.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),e.makeArray(a,this))},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();return e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return e.each(this,a,b)},ready:function(a){return e.bindReady(),A.done(a),this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){return a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f),e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(A)return;A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){return a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b),c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":a.toString().replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];return a.length=d,a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};return g.guid=a.guid=a.guid||g.guid||e.guid++,g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function d(c,d){return d&&d instanceof e&&!(d instanceof a)&&(d=a(d)),e.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())}),e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){return e.resolveWith(this,arguments),this},isResolved:function(){return!!c||!!b},cancel:function(){return d=1,a=[],this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;return f.extend(b,{then:function(a,c){return b.done(a).fail(c),this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b),b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;return o=l=g=h=m=j=a=i=null,k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?f.cache[a[f.expando]]:a[f.expando],!!a&&!l(a)},data:function(a,c,d,e){if(!f.acceptData(a))return;var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);return i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d),c==="events"&&!i[c]?i[g]&&i[g].events:h?i[f.camelCase(c)]||i[c]:i},removeData:function(b,c,d){if(!f.acceptData(b))return;var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");return j[1]=j[1]?"."+j[1]:"",c===b?(d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d)),d===b&&j[1]?this.data(j[0]):d):this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);return d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d)),e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){return typeof a!="string"&&(c=a,a="fx"),c===b?f.queue(this[0],a):this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){return a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);return m(),d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){return a=f.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return f.isFunction(a)?this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length)return e?(c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type],c&&"get"in c&&(d=c.get(e,"value"))!==b?d:(d=e.value,typeof d=="string"?d.replace(p,""):d==null?"":d)):b;var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType!==1)return;g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}return g&&!d.length&&e.length?f(e[c]).val():d},set:function(a,b){var c=f.makeArray(b);return f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if("getAttribute"in a){var h,i,j=g!==1||!f.isXMLDoc(a);return j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v))),d!==b?d===null?(f.removeAttr(a,c),b):i&&"set"in i&&j&&(h=i.set(a,d,c))!==b?h:(a.setAttribute(c,""+d),d):i&&"get"in i&&j&&(h=i.get(a,c))!==null?h:(h=a.getAttribute(c),h===null?b:h)}return f.prop(a,c,d)},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){return v&&f.nodeName(a,"button")?v.get(a,b):b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);return i&&(c=f.propFix[c]||c,h=f.propHooks[c]),d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d)return d.nodeValue=b,b}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType===3||a.nodeType===8)return;if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null},global:{},remove:function(a,c,d,e){if(a.nodeType===3||a.nodeType===8)return;d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof 
c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}return a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0),a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;return b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex),c},J=function(a){var c=a.target,d,e;if(!y.test(c.nodeName)||c.readOnly)return;d=f._data(c,"_change_data"),e=I(c),(a.type!=="focusout"||c.type!=="radio")&&f._data(c,"_change_data",e);if(d===b||e===d)return;if(d!=null||e)a.type="change",a.liveFired=b,f.event.trigger(a,arguments[1],c)};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){return f.event.remove(this,".specialChange"),y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){return f(this).unbind(a,g),e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;return f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)===".")return n.unbind(g),this;if(d===!1||f.isFunction(d))e=d||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){return h=!1,0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);return o&&(k(o,h,f,g),k.uniqueSort(f)),f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}return d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]),{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);return a[0]=d++,a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");return!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" "),a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);return d||e.push.apply(e,g),!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){return a.unshift(!0),a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){return a=Array.prototype.slice.call(a,0),b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){return a===b?(g=!0,0):!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition?-1:1:a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b)return g=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(b.querySelectorAll&&b.querySelectorAll(".TEST").length===0)return;k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!a.getElementsByClassName||a.getElementsByClassName("e").length===0)return;a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}return c=c.length>1?f.unique(c):c,this.pushStack(c,"closest",a)},index:function(a){return!a||typeof a=="string"?f.inArray(this[0],a?f(a):this.parent().children()):f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);return O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse()),this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.isFunction(a)?this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))}):typeof a!="object"&&a!==b?this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a)):f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return f.isFunction(a)?this.each(function(b){f(this).wrapInner(a.call(this,b))}):this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);return a.push.apply(a,this.toArray()),this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);return a.push.apply(a,f(arguments[0]).toArray()),a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){return this[0]&&this[0].parentNode?f.isFunction(a)?this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=f(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})):this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;return b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1),{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1)return e[b](this[0]),this;for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked
)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}return e=g=null,d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){return arguments.length===2&&c===b?this:f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b)return k&&"get"in k&&(g=k.get(a,!1,e))!==b?g:j[c];h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c)return a.offsetWidth!==0?bA(a,b,d):(f.swap(a,bu,function(){e=bA(a,b,d)}),e)},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;return f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight}),c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;return!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e)),d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;return f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}}),this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){return f.isFunction(d)&&(g=g||e,e=d,d=b),f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s===2)return;s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return s||(d.mimeType=a),this},abort:function(a){return a=a||"abort",p&&p.abort(a),w(0,a),this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(!d.beforeSend||d.beforeSend.call(e,v,d)!==!1&&s!==2){for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v}return v.abort(),!1},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";return b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){return g||f.error(h+" was not called"),g[0]},b.dataTypes[0]="json","script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return f.globalEval(a),a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cr("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";return f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c),this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);return f.isEmptyObject(a)?this.each(e.complete,[!1]):(a=f.extend({},a),this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0}))},stop:function(a,b){return a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue(),this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};return d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)},d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]==null||!!this.elem.style&&this.elem.style[this.prop]!=null){var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a}return this.elem[this.prop]},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}return e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;return f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft)),{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;return c===b?(e=this[0],e?(g=cv(e),g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]):null):this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window),function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.14",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})}(jQuery),function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)a(e).triggerHandler("remove");c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e=this.options[b];c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),d=d||{};if(c.originalEvent)for(var f=a.event.props.length,g;f;)g=a.event.props[--f],c
[g]=c.originalEvent[g];return this.element.trigger(c,d),!(a.isFunction(e)&&e.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}}(jQuery),function(a,b){var c=!1;a(document).mousedown(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})}(jQuery),function(a,b){a.widget("ui.draggable",a.ui.mouse,{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(){this.options.helper=="original"&&!/^(?: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(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<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(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.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},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.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 b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.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(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.14"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).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 c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!e.length)return;var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})}(jQuery),function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);return this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"),this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance))return e=!0,!1}),e?!1:this.accept.call(this.element[0],d.currentItem||d.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d)),this.element):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.14"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var h=0;h<d.length;h++){if(d[h].options.disabled||b&&!d[h].accept.call(d[h].element[0],b.currentItem||b.element))continue;for(var i=0;i<f.length;i++)if(f[i]==d[h].element[0]){d[h].proportions.height=0;continue g}d[h].visible=d[h].element.css("display")!="none";if(!d[h].visible)continue;e=="mousedown"&&d[h]._activate.call(d[h],c),d[h].offset=d[h].element.offset(),d[h].proportions={width:d[h].element[0].offsetWidth,height:d[h].element[0].offsetHeight}}},drop:function(b,c){var d=!1;return a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=d||this._drop.call(this,c)),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c))}),d},dragStart:function(b,c){b.element.parentsUntil("body").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))})},dragStop:function(b,c){b.element.parentsUntil("body").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}}(jQuery),function(a,b){a.widget("ui.resizable",a.ui.mouse,{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 b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(/relative/.test(this.element.css("position"))&&a.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"}),this.element.wrap(a('<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=c.handles||(a(".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");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){if(c.disabled)return;a(this).removeClass("ui-resizable-autohide"),b._handles.show()},function(){if(c.disabled)return;b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement),this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),a.browser.opera&&/relative/.test(f.css("position"))&&f.css({position:"relative",top:"auto",left:"auto"}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");return a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||
b.shiftKey)l=this._updateRatio(l,b);return l=this._respectSize(l,b),this._propagate("resize",b),c.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(l),this._trigger("resize",b,this.ui()),!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}return a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;return d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width)),a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;return p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null),a},_proportionallyResize:function(){var b=this.options;if(!this._proportionallyResizeElements.length)return;var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(!a.browser.msie||!a(c).is(":hidden")&&!a(c).parents(":hidden").length)e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0});else continue}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,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}}}),a.extend(a.ui.resizable,{version:"1.8.14"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10),position:b.css("position")})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,e){a(b).each(function(){var b=a(this),f=a(this).data("resizable-alsoresize"),g={},i=e&&e.length?e:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(i,function(a,b){var c=(f[b]||0)+(h[b]||0);c&&c>=0&&(g[b]=c||null)}),a.browser.opera&&/relative/.test(b.css("position"))&&(d._revertToRelativePosition=!0,b.css({position:"absolute",top:"auto",left:"auto"})),b.css(g)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};d._revertToRelativePosition&&(d._revertToRelativePosition=!1,typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)),a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!i)return;e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}}(jQuery),function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,b.metaKey||(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey||!d.$element.hasClass("ui-selected");return d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element}),!1}})},_mouseDrag:function(b){var c=this;this.dragged=!0;if(this.options.disabled)return;var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}return this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!i||i.element==c.element[0])return;var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&(b.metaKey&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}),!1},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;return a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove(),!1}}),a.extend(a.ui.selectable,{version:"1.8.14"})}(jQuery),function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",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 a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable"),this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var d=null,e=this,f=a(b.target).parents().each(function(){if(a.data(this,"sortable-item")==e)return d=a(this),!1});a.data(b.target,"sortable-item")==e&&(d=a(b.target));if(!d)return!1;if(this.options.handle&&!c){var g=!1;a(this.options.handle,d).find("*").andSelf().each(function(){this==b.target&&(g=!0)});if(!g)return!1}return this.currentItem=d,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),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},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return e?this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1):!1},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],"sortable");j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data(sortable-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],"sortable");j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data("sortable-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i])}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[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")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.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 b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.14"})}(jQuery),jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array&&b.length==3?b:(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))?[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)]:(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))?[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55]:(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))?[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]:(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))?[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]:(c=/rgba\(0, 0, 0, 0\)/.exec(b))?e.transparent:e[a.trim(b).toLowerCase()]}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};return a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete,[b,c,d,e]}function l(b){return!b||typeof b=="number"||a.fx.speeds[b]?!0:typeof b=="string"&&!a.effects[b]?!0:!1}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){return a.isFunction(d)&&(e=d,d=null),this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.14",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){return b=="toggle"&&(b=a.is(":hidden")?"show":"hide"),b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});return b.wrap(d),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),d.css(c).show()},removeWrapper:function(a){return a.parent().is(".ui-effects-wrapper")?a.parent().replaceWith(a):a},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])}),e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];return a.fx.off||!i?h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)}):i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="show",this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="hide",this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);return c[1].mode="toggle",this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return b<1?-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c:h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,f,g){return g==b&&(g=1.70158),e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){return g==b&&(g=1.70158),e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){return g==b&&(g=1.70158),(c/=f/2)<1?e/2*c*c*(((g*=1.525)+1)*c-g)+d:e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){return c<f/2?a.easing.easeInBounce(b,c*2,0,e,f)*.5+d:a.easing.easeOutBounce(b,c*2-f,0,e,f)*.5+e*.5+d}})}(jQuery),function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}}(jQuery),function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight({margin:!0})/3:c.outerWidth({margin:!0})/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing),g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g,c.animate(l,i/2,b.options.easing,function(){c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()}),c.dequeue()})}}(jQuery),function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();e=="show"&&(h.css(i.size,0),h.css(i.position,j/2));var k={};k[i.size]=e=="show"?j:0,k[i.position]=e=="show"?0:j/2,h.animate(k,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0})/2:c.outerWidth({margin:!0})/2);e=="show"&&c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3,d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);for(var i=0;i<c;i++)for(var j=0;j<d;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}}(jQuery),function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}}(jQuery),function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&&times--;for(var e=0;e<times;e++)c.animate({opacity:animateTo},duration,b.options.easing),animateTo=(animateTo+1)%2;c.animate({opacity:animateTo},duration,b.options.easing,function(){animateTo==0&&c.hide(),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}).dequeue()})}}(jQuery),function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:!0,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}}),c.effect("scale",b.options,b.duration,b.callback),c.dequeue()})},a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),e=="hide"&&(c.from.opacity=1,c.to.opacity=0)),d.from=c.from,d.to=c.to,d.mode=e,c.effect("size",d,b.duration,b.callback),c.dequeue()})},a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,n={height:c.height(),width:c.width()};c.from=b.options.from||n,c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y,c.from.left=(n.width-c.from.width)*p.x,c.to.top=(n.height-c.to.height)*p.y,c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both")q.from.y!=q.to.y&&(d=d.concat(h),c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(d=d.concat(i),c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to));(l=="content"||l=="both")&&q.from.y!=q.to.y&&(d=d.concat(g),c.from=a.effects.setTransition(c,g,q.from.y,c.from),c.to=a.effects.setTransition(c,g,q.to.y,c.to)),a.effects.save(c,k?d:e),c.show(),a.effects.createWrapper(c),c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both")h=h.concat(["marginTop","marginBottom"]).concat(g),i=i.concat(["marginLeft","marginRight"]),f=d.concat(h).concat(i),c.find("*[width]").each(function(){child=a(this),k&&a.effects.save(child,f);var c={height:child.height(),width:child.width()};child.from={height:c.height*q.from.y,width:c.width*q.from.x},child.to={height:c.height*q.to.y,width:c.width*q.to.x},q.from.y!=q.to.y&&(child.from=a.effects.setTransition(child,h,q.from.y,child.from),child.to=a.effects.setTransition(child,h,q.to.y,child.to)),q.from.x!=q.to.x&&(child.from=a.effects.setTransition(child,i,q.from.x,child.from),child.to=a.effects.setTransition(child,i,q.to.x,child.to)),child.css(child.from),child.animate(child.to,b.duration,b.options.easing,function(){k&&a.effects.restore(child,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,i=b.duration||b.options.duration||140;a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g,m[j]=(k=="pos"?"+=":"-=")+g*2,n[j]=(k=="pos"?"-=":"+=")+g*2,c.animate(l,i,b.options.easing);for(var p=1;p<h;p++)c.animate(m,i,b.options.easing).animate(n,i,b.options.easing);c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}),c.dequeue()})}}(jQuery),function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"show"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0}):c.outerWidth({margin:!0}));e=="show"&&c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}}(jQuery),function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected
),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");return(b.autoHeight||b.fillHeight)&&c.css("height",""),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(this.options.disabled||b.altKey||b.ctrlKey)return;var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}return f?(a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus(),!1):!0},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];return this._clickHandler({target:b},b),this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(d.disabled)return;if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!g)return;return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(this.running)return;this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data)}}),a.extend(a.ui.accordion,{version:"1.8.14",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size()){b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);return}if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(parseInt(j.parent().width(),10)-parseInt(j.css("paddingLeft"),10)-parseInt(j.css("paddingRight"),10)-(parseInt(j.css("borderLeftWidth"),10)||0)-(parseInt(j.css("borderRightWidth"),10)||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})}(jQuery),function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.attr("readonly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",autocompleteRequest:++c,success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)===!1)return;return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this.response)},_response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close(),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})}(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery),function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="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",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);return c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form})),e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"&&(this.options.disabled=this.element.attr("disabled")),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.element.is(":disabled")&&(h.disabled=!0),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){if(h.disabled)return;a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active")}).bind("mouseleave.button",function(){if(h.disabled)return;a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){if(f)return;b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){if(h.disabled)return;f=!1,d=a.pageX,e=a.pageY}).bind("mouseup.button",function(a){if(h.disabled)return;if(d!==a.pageX||e!==a.pageY)f=!0})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed",!0);var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",!1)}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for="+this.element.attr("id")+"]";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled"){c?this.element.attr("disabled",!0):this.element.removeAttr("disabled");return}this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",!0):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",!1)}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",!0):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",!1))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var b=this.buttonElement.removeClass(i),c=a("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(b?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})}(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},$.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(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length)return;c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length)return;d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover")})}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.14"}});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(a){return extendRemove(this._defaults,a||{}),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(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);if(c.hasClass(this.markerClassName))return;this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._showDatepicker(a[0]),!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName))return;c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.dpDiv.show()},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);return c&&!c.inline&&this._setDateFromField(c,b),c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+
$.datepicker._currentClass+")",b.dpDiv);return e[0]?$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]):$.datepicker._hideDatepicker(),!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._datepickerShowing&&$.datepicker._triggerOnClose($.datepicker._curInst),$.datepicker._curInst.dpDiv.stop(!0,!0));var c=$.datepicker._get(b,"beforeShow");extendRemove(b.settings,c?c.apply(a,[a,b]):{}),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var d=!1;$(a).parents().each(function(){return d|=$(this).css("position")=="fixed",!d}),d&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var e={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),e=$.datepicker._checkOffset(b,e,d),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":d?"fixed":"absolute",display:"none",left:e.left+"px",top:e.top+"px"});if(!b.inline){var f=$.datepicker._get(b,"showAnim"),g=$.datepicker._get(b,"duration"),h=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[f]?b.dpDiv.show(f,$.datepicker._get(b,"showOptions"),g,h):b.dpDiv[f||"show"](f?g:null,h),(!f||!g)&&h(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();return b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0),b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");b&&b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME))return;if(this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b),this._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),$.datepicker._triggerOnClose(b),this._datepickerShowing=!1,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(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target);b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)&&$.datepicker._hideDatepicker()},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0]))return;this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e._selectingMonthYear=!1,e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_clickMonthYear:function(a){var b=$(a),c=this._getInst(b[0]);c.input&&c._selectingMonthYear&&setTimeout(function(){c.input.focus()},0),c._selectingMonthYear=!c._selectingMonthYear},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0]))return;var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;return c&&s++,c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;return r+=f[0].length,parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase())return f=c[0],r+=d.length,!1});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}while(!0)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},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:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;return c&&m++,c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;return c&&e++,c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()==a.lastVal)return;var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;return b.setDate(b.getDate()+a),b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());return f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0)),this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+'onclick="DP_jQuery_'+dpuuid+".datepicker._clickMonthYear('#"+a.id+"');\""+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+'onclick="DP_jQuery_'+dpuuid+".datepicker._clickMonthYear('#"+a.id+"');\""+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;return e=d&&e>d?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.14",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{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",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||"&#160;",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){return b.close(a),!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;return a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle),a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1===c._trigger("beforeClose",b))return;return c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d),c},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;return e.modal&&!b||!e.stack&&!e.modal?d._trigger("focus",c):(e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c),d)},open:function(){if(this._isOpen)return;var b=this,c=b.options,d=b.uiDialog;return b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keypress.ui-dialog",function(b){if(b.keyCode!==a.ui.keyCode.TAB)return;var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey)return d.focus(1),!1;if(b.target===d[0]&&b.shiftKey)return e.focus(1),!1}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open"),b},_createButtons:function(b){var c=this,d=!1,e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){if(a==="click")return;a in f?e[a](b):e.attr(a,b)}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&
(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||"&#160;"))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.14",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");return b||(this.uuid+=1,b=this.uuid),"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}),a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize));var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return a.fn.bgiframe&&c.bgiframe(),this.instances.push(c),c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;return a.browser.msie&&a.browser.version<7?(b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),b<c?a(window).height()+"px":b+"px"):a(document).height()+"px"},width:function(){var b,c;return a.browser.msie?(b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),b<c?a(window).width()+"px":b+"px"):a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)}),b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}}),a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})}(jQuery),function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f=a.fn.position,g=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return f.apply(this,arguments);b=a.extend({},b);var g=a(b.of),h=g[0],i=(b.collision||"flip").split(" "),j=b.offset?b.offset.split(" "):[0,0],k,l,m;return h.nodeType===9?(k=g.width(),l=g.height(),m={top:0,left:0}):h.setTimeout?(k=g.width(),l=g.height(),m={top:g.scrollTop(),left:g.scrollLeft()}):h.preventDefault?(b.at="left top",k=l=0,m={top:b.of.pageY,left:b.of.pageX}):(k=g.outerWidth(),l=g.outerHeight(),m=g.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),i.length===1&&(i[1]=i[0]),j[0]=parseInt(j[0],10)||0,j.length===1&&(j[1]=j[0]),j[1]=parseInt(j[1],10)||0,b.at[0]==="right"?m.left+=k:b.at[0]===e&&(m.left+=k/2),b.at[1]==="bottom"?m.top+=l:b.at[1]===e&&(m.top+=l/2),m.left+=j[0],m.top+=j[1],this.each(function(){var c=a(this),d=c.outerWidth(),f=c.outerHeight(),g=parseInt(a.curCSS(this,"marginLeft",!0))||0,h=parseInt(a.curCSS(this,"marginTop",!0))||0,n=d+g+(parseInt(a.curCSS(this,"marginRight",!0))||0),o=f+h+(parseInt(a.curCSS(this,"marginBottom",!0))||0),p=a.extend({},m),q;b.my[0]==="right"?p.left-=d:b.my[0]===e&&(p.left-=d/2),b.my[1]==="bottom"?p.top-=f:b.my[1]===e&&(p.top-=f/2),p.left=Math.round(p.left),p.top=Math.round(p.top),q={left:p.left-g,top:p.top-h},a.each(["left","top"],function(c,e){a.ui.position[i[c]]&&a.ui.position[i[c]][e](p,{targetWidth:k,targetHeight:l,elemWidth:d,elemHeight:f,collisionPosition:q,collisionWidth:n,collisionHeight:o,offset:j,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(p,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?this.each(function(){a.offset.setOffset(this,b)}):g.call(this)})}(jQuery),function(a,b){a.widget("ui.progressbar",{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=a("<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(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){return a===b?this._value():(this._setOption("value",a),this)},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;return typeof a!="number"&&(a=0),Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.14"})}(jQuery),function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];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"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=!0,f=a(this).data("index.ui-slider-handle"),g,h,i,j;if(b.options.disabled)return;switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:e=!1;if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),g=b._start(d,f);if(g===!1)return}}j=b.options.step,b.options.values&&b.options.values.length?h=i=b.values(f):h=i=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:i=b._valueMin();break;case a.ui.keyCode.END:i=b._valueMax();break;case a.ui.keyCode.PAGE_UP:i=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:i=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(h===b._valueMax())return;i=b._trimAlignValue(h+j);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(h===b._valueMin())return;i=b._trimAlignValue(h-j)}return b._slide(d,f,i),e}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return 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").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i),j===!1?!1:(this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0,!0))},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);return}if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.attr("disabled","disabled"),this.element.addClass("ui-disabled")):(this.handles.removeAttr("disabled"),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":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a),a},_values:function(a){var b,c,d;if(arguments.length)return b=this.options.values[a],b=this._trimAlignValue(b),b;c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;return alignValue=a-c,Math.abs(c)*2>=b&&(alignValue+=c>0?b:-b),parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.14"})}(jQuery),function(a,b){function e(){return++c}function f(){return++d}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return e.selected=a,!1}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1)return this.blur(),!1;e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected"))return e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur(),!1}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){return typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]"))),a},destroy:function(){var b=this.options;return this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie),this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);return j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e])),this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();return d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0])),this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1)return;return this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b])),this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;return a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))),this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;return this.anchors.eq(a).trigger(this.options.event+".tabs"),this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}return this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(a,b){return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b),this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.14"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){t=d.selected,e()}:function(a){a.clientX&&c.rotate(null)});return a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate),this}})}(jQuery),function(a,b){var c;a.rails=c={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input:file",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(b){var c=a('meta[name="csrf-token"]').attr("content");c&&b.setRequestHeader("X-CSRF-Token",c)},fire:function(b,c,d){var e=a.Event(c);return b.trigger(e,d),e.result!==!1},confirm:function(a){return confirm(a)},ajax:function(b){return a.ajax(b)},handleRemote:function(d){var e,f,g,h=d.data("cross-domain")||null,i=d.data("type")||a.ajaxSettings&&a.ajaxSettings.dataType,j;if(c.fire(d,"ajax:before")){if(d.is("form")){e=d.attr("method"),f=d.attr("action"),g=d.serializeArray();var k=d.data("ujs:submit-button");k&&(g.push(k),d.data("ujs:submit-button",null))}else d.is(c.inputChangeSelector)?(e=d.data("method"),f=d.data("url"),g=d.serialize(),d.data("params")&&(g=g+"&"+d.data("params"))):(e=d.data("method"),f=d.attr("href"),g=d.data("params")||null);j={type:e||"GET",data:g,dataType:i,crossDomain:h,beforeSend:function(a,e){return e.dataType===b&&a.setRequestHeader("accept","*/*;q=0.5, "+e.accepts.script),c.fire(d,"ajax:beforeSend",[a,e])},success:function(a,b,c){d.trigger("ajax:success",[a,b,c])},complete:function(a,b){d.trigger("ajax:complete",[a,b])},error:function(a,b,c){d.trigger("ajax:error",[a,b,c])}},f&&(j.url=f),c.ajax(j)}},handleMethod:function(c){var d=c.attr("href"),e=c.data("method"),f=a("meta[name=csrf-token]").attr("content"),g=a("meta[name=csrf-param]").attr("content"),h=a('<form method="post" action="'+d+'"></form>'),i='<input name="_method" value="'+e+'" type="hidden" />';g!==b&&f!==b&&(i+='<input name="'+g+'" value="'+f+'" type="hidden" />'),h.hide().append(i).appendTo("body"),h.submit()},disableFormElements:function(b){b.find(c.disableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with",b[c]()),b[c](b.data("disable-with")),b.attr("disabled","disabled")})},enableFormElements:function(b){b.find(c.enableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with")&&b[c](b.data("ujs:enable-with")),b.removeAttr("disabled")})},allowAction:function(a){var b=a.data
("confirm"),d=!1,e;return b?(c.fire(a,"confirm")&&(d=c.confirm(b),e=c.fire(a,"confirm:complete",[d])),d&&e):!0},blankInputs:function(b,c,d){var e=a(),f,g=c||"input,textarea";return b.find(g).each(function(){f=a(this);if(d?f.val():!f.val())e=e.add(f)}),e.length?e:!1},nonBlankInputs:function(a,b){return c.blankInputs(a,b,!0)},stopEverything:function(b){return a(b.target).trigger("ujs:everythingStopped"),b.stopImmediatePropagation(),!1},callFormSubmitBindings:function(c){var d=c.data("events"),e=!0;return d!==b&&d.submit!==b&&a.each(d.submit,function(a,b){if(typeof b.handler=="function")return e=b.handler(b.data)}),e},disableElement:function(a){a.data("ujs:enable-with",a.html()),a.html(a.data("disable-with")),a.bind("click.railsDisable",function(a){return c.stopEverything(a)})},enableElement:function(a){a.data("ujs:enable-with")!==b&&(a.html(a.data("ujs:enable-with")),a.data("ujs:enable-with",!1)),a.unbind("click.railsDisable")}},a.ajaxPrefilter(function(a,b,d){a.crossDomain||c.CSRFProtection(d)}),a(c.linkDisableSelector).live("ajax:complete",function(){c.enableElement(a(this))}),a(c.linkClickSelector).live("click.rails",function(d){var e=a(this);if(!c.allowAction(e))return c.stopEverything(d);e.is(c.linkDisableSelector)&&c.disableElement(e);if(e.data("remote")!==b)return c.handleRemote(e),!1;if(e.data("method"))return c.handleMethod(e),!1}),a(c.inputChangeSelector).live("change.rails",function(b){var d=a(this);return c.allowAction(d)?(c.handleRemote(d),!1):c.stopEverything(b)}),a(c.formSubmitSelector).live("submit.rails",function(d){var e=a(this),f=e.data("remote")!==b,g=c.blankInputs(e,c.requiredInputSelector),h=c.nonBlankInputs(e,c.fileInputSelector);if(!c.allowAction(e))return c.stopEverything(d);if(g&&e.attr("novalidate")==b&&c.fire(e,"ajax:aborted:required",[g]))return c.stopEverything(d);if(f)return h?c.fire(e,"ajax:aborted:file",[h]):!a.support.submitBubbles&&c.callFormSubmitBindings(e)===!1?c.stopEverything(d):(c.handleRemote(e),!1);setTimeout(function(){c.disableFormElements(e)},13)}),a(c.formInputClickSelector).live("click.rails",function(b){var d=a(this);if(!c.allowAction(d))return c.stopEverything(b);var e=d.attr("name"),f=e?{name:e,value:d.val()}:null;d.closest("form").data("ujs:submit-button",f)}),a(c.formSubmitSelector).live("ajax:beforeSend.rails",function(b){this==b.target&&c.disableFormElements(a(this))}),a(c.formSubmitSelector).live("ajax:complete.rails",function(b){this==b.target&&c.enableFormElements(a(this))})}(jQuery),function(a,b){function z(a){return typeof a=="string"}function A(a){var b=d.call(arguments,1);return function(){return a.apply(this,b.concat(d.call(arguments)))}}function B(a){return a.replace(/^[^#]*#?(.*)$/,"$1")}function C(a){return a.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function D(d,g,i,j,k){var l,m,n,o,r;return j!==c?(n=i.match(d?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/),r=n[3]||"",k===2&&z(j)?m=j.replace(d?w:v,""):(o=h(n[2]),j=z(j)?h[d?q:p](j):j,m=k===2?j:k===1?a.extend({},j,o):a.extend({},o,j),m=f(m),d&&(m=m.replace(x,e))),l=n[1]+(d?"#":m||!n[1]?"?":"")+m+r):l=g(i!==c?i:b[s][t]),l}function E(a,b,d){return b===c||typeof b=="boolean"?(d=b,b=f[a?q:p]()):b=z(b)?b.replace(a?w:v,""):b,h(b,d)}function F(b,d,e,g){return!z(e)&&typeof e!="object"&&(g=e,e=d,d=c),this.each(function(){var c=a(this),h=d||m()[(this.nodeName||"").toLowerCase()]||"",i=h&&c.attr(h)||"";c.attr(h,f[b](i,e,g))})}var c,d=Array.prototype.slice,e=decodeURIComponent,f=a.param,g,h,i,j=a.bbq=a.bbq||{},k,l,m,n=a.event.special,o="hashchange",p="querystring",q="fragment",r="elemUrlAttr",s="location",t="href",u="src",v=/^.*\?|#.*$/g,w=/^.*\#/,x,y={};f[p]=A(D,0,C),f[q]=g=A(D,1,B),g.noEscape=function(b){b=b||"";var c=a.map(b.split(""),encodeURIComponent);x=new RegExp(c.join("|"),"g")},g.noEscape(",/"),a.deparam=h=function(b,d){var f={},g={"true":!0,"false":!1,"null":null};return a.each(b.replace(/\+/g," ").split("&"),function(b,h){var i=h.split("="),j=e(i[0]),k,l=f,m=0,n=j.split("]["),o=n.length-1;/\[/.test(n[0])&&/\]$/.test(n[o])?(n[o]=n[o].replace(/\]$/,""),n=n.shift().split("[").concat(n),o=n.length-1):o=0;if(i.length===2){k=e(i[1]),d&&(k=k&&!isNaN(k)?+k:k==="undefined"?c:g[k]!==c?g[k]:k);if(o)for(;m<=o;m++)j=n[m]===""?l.length:n[m],l=l[j]=m<o?l[j]||(n[m+1]&&isNaN(n[m+1])?{}:[]):k;else a.isArray(f[j])?f[j].push(k):f[j]!==c?f[j]=[f[j],k]:f[j]=k}else j&&(f[j]=d?c:"")}),f},h[p]=A(E,0),h[q]=i=A(E,1),a[r]||(a[r]=function(b){return a.extend(y,b)})({a:t,base:t,iframe:u,img:u,input:u,form:"action",link:t,script:u}),m=a[r],a.fn[p]=A(F,p),a.fn[q]=A(F,q),j.pushState=k=function(a,d){z(a)&&/^#/.test(a)&&d===c&&(d=2);var e=a!==c,f=g(b[s][t],e?a:{},e?d:2);b[s][t]=f+(/#/.test(f)?"":"#")},j.getState=l=function(a,b){return a===c||typeof a=="boolean"?i(a):i(b)[a]},j.removeState=function(b){var d={};b!==c&&(d=l(),a.each(a.isArray(b)?b:arguments,function(a,b){delete d[b]})),k(d,2)},n[o]=a.extend(n[o],{add:function(b){function e(a){var b=a[q]=g();a.getState=function(a,d){return a===c||typeof a=="boolean"?h(b,a):h(b,d)[a]},d.apply(this,arguments)}var d;if(a.isFunction(b))return d=b,e;d=b.handler,b.handler=e}})}(jQuery,this),function(a,b,c){function m(a){return a=a||b[f][h],a.replace(/^[^#]*#?(.*)$/,"$1")}var d,e=a.event.special,f="location",g="hashchange",h="href",i=a.browser,j=document.documentMode,k=i.msie&&(j===c||j<8),l="on"+g in b&&!k;a[g+"Delay"]=100,e[g]=a.extend(e[g],{setup:function(){if(l)return!1;a(d.start)},teardown:function(){if(l)return!1;a(d.stop)}}),d=function(){function l(){i=j=function(a){return a},k&&(e=a('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow,j=function(){return m(e.document[f][h])},i=function(a,b){if(a!==b){var c=e.document;c.open().close(),c[f].hash="#"+a}},i(m()))}var c={},d,e,i,j;return c.start=function(){if(d)return;var c=m();i||l(),function e(){var k=m(),l=j(c);k!==c?(i(c=k,l),a(b).trigger(g)):l!==c&&(b[f][h]=b[f][h].replace(/#.*/,"")+"#"+l),d=setTimeout(e,a[g+"Delay"])}()},c.stop=function(){e||(d&&clearTimeout(d),d=0)},c}()}(jQuery,this),jQuery.cookie=function(a,b,c){if(arguments.length>1&&String(b)!=="[object Object]"){c=jQuery.extend({},c);if(b===null||b===undefined)c.expires=-1;if(typeof c.expires=="number"){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}return b=String(b),document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};var f,g=c.raw?function(a){return a}:decodeURIComponent;return(f=(new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)")).exec(document.cookie))?g(f[1]):null},function(a){function c(b){a.fn.cycle.debug&&d(b)}function d(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function e(b,c,d){var e=a(b).data("cycle.opts"),f=!!b.cyclePause;f&&e.paused?e.paused(b,e,c,d):!f&&e.resumed&&e.resumed(b,e,c,d)}function f(b,c,f){function j(b,c,e){if(!b&&c===!0){var f=a(e).data("cycle.opts");if(!f)return d("options not found, can not resume"),!1;e.cycleTimeout&&(clearTimeout(e.cycleTimeout),e.cycleTimeout=0),m(f.elements,f,1,!f.backwards)}}b.cycleStop==undefined&&(b.cycleStop=0);if(c===undefined||c===null)c={};if(c.constructor==String){switch(c){case"destroy":case"stop":var g=a(b).data("cycle.opts");if(!g)return!1;return b.cycleStop++,b.cycleTimeout&&clearTimeout(b.cycleTimeout),b.cycleTimeout=0,g.elements&&a(g.elements).stop(),a(b).removeData("cycle.opts"),c=="destroy"&&h(g),!1;case"toggle":return b.cyclePause=b.cyclePause===1?0:1,j(b.cyclePause,f,b),e(b),!1;case"pause":return b.cyclePause=1,e(b),!1;case"resume":return b.cyclePause=0,j(!1,f,b),e(b),!1;case"prev":case"next":var g=a(b).data("cycle.opts");if(!g)return d('options not found, "prev/next" ignored'),!1;return a.fn.cycle[c](g),!1;default:c={fx:c}}return c}if(c.constructor==Number){var i=c;return c=a(b).data("cycle.opts"),c?i<0||i>=c.elements.length?(d("invalid slide index: "+i),!1):(c.nextSlide=i,b.cycleTimeout&&(clearTimeout(b.cycleTimeout),b.cycleTimeout=0),typeof f=="string"&&(c.oneTimeFx=f),m(c.elements,c,1,i>=c.currSlide),!1):(d("options not found, can not advance slide"),!1)}return c}function g(b,c){if(!a.support.opacity&&c.cleartype&&b.style.filter)try{b.style.removeAttribute("filter")}catch(d){}}function h(b){b.next&&a(b.next).unbind(b.prevNextEvent),b.prev&&a(b.prev).unbind(b.prevNextEvent),(b.pager||b.pagerAnchorBuilder)&&a.each(b.pagerAnchors||[],function(){this.unbind().remove()}),b.pagerAnchors=null,b.destroy&&b.destroy(b)}function i(b,c,f,h,i){var n=a.extend({},a.fn.cycle.defaults,h||{},a.metadata?b.metadata():a.meta?b.data():{}),p=a.isFunction(b.data)?b.data(n.metaAttr):null;p&&(n=a.extend(n,p)),n.autostop&&(n.countdown=n.autostopCount||f.length);var s=b[0];b.data("cycle.opts",n),n.$cont=b,n.stopCount=s.cycleStop,n.elements=f,n.before=n.before?[n.before]:[],n.after=n.after?[n.after]:[],!a.support.opacity&&n.cleartype&&n.after.push(function(){g(this,n)}),n.continuous&&n.after.push(function(){m(f,n,0,!n.backwards)}),j(n),!a.support.opacity&&n.cleartype&&!n.cleartypeNoBg&&r(c),b.css("position")=="static"&&b.css("position","relative"),n.width&&b.width(n.width),n.height&&n.height!="auto"&&b.height(n.height),n.startingSlide?n.startingSlide=parseInt(n.startingSlide,10):n.backwards&&(n.startingSlide=f.length-1);if(n.random){n.randomMap=[];for(var t=0;t<f.length;t++)n.randomMap.push(t);n.randomMap.sort(function(a,b){return Math.random()-.5}),n.randomIndex=1,n.startingSlide=n.randomMap[1]}else n.startingSlide>=f.length&&(n.startingSlide=0);n.currSlide=n.startingSlide||0;var u=n.startingSlide;c.css({position:"absolute",top:0,left:0}).hide().each(function(b){var c;n.backwards?c=u?b<=u?f.length+(b-u):u-b:f.length-b:c=u?b>=u?f.length-(b-u):u-b:f.length-b,a(this).css("z-index",c)}),a(f[u]).css("opacity",1).show(),g(f[u],n),n.fit&&(n.aspect?c.each(function(){var b=a(this),c=n.aspect===!0?b.width()/b.height():n.aspect;n.width&&b.width()!=n.width&&(b.width(n.width),b.height(n.width/c)),n.height&&b.height()<n.height&&(b.height(n.height),b.width(n.height*c))}):(n.width&&c.width(n.width),n.height&&n.height!="auto"&&c.height(n.height))),n.center&&(!n.fit||n.aspect)&&c.each(function(){var b=a(this);b.css({"margin-left":n.width?(n.width-b.width())/2+"px":0,"margin-top":n.height?(n.height-b.height())/2+"px":0})}),n.center&&!n.fit&&!n.slideResize&&c.each(function(){var b=a(this);b.css({"margin-left":n.width?(n.width-b.width())/2+"px":0,"margin-top":n.height?(n.height-b.height())/2+"px":0})});var v=n.containerResize&&!b.innerHeight();if(v){var w=0,x=0;for(var y=0;y<f.length;y++){var z=a(f[y]),A=z[0],B=z.outerWidth(),C=z.outerHeight();B||(B=A.offsetWidth||A.width||z.attr("width")),C||(C=A.offsetHeight||A.height||z.attr("height")),w=B>w?B:w,x=C>x?C:x}w>0&&x>0&&b.css({width:w+"px",height:x+"px"})}var D=!1;n.pause&&b.hover(function(){D=!0,this.cyclePause++,e(s,!0)},function(){D&&this.cyclePause--,e(s,!0)});if(k(n)===!1)return!1;var E=!1;h.requeueAttempts=h.requeueAttempts||0,c.each(function(){var b=a(this);this.cycleH=n.fit&&n.height?n.height:b.height()||this.offsetHeight||this.height||b.attr("height")||0,this.cycleW=n.fit&&n.width?n.width:b.width()||this.offsetWidth||this.width||b.attr("width")||0;if(b.is("img")){var c=a.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete,e=a.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete,f=a.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete,g=this.cycleH==0&&this.cycleW==0&&!this.complete;if(c||e||f||g){if(i.s&&n.requeueOnImageNotLoaded&&++h.requeueAttempts<100)return d(h.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH),setTimeout(function(){a(i.s,i.c).cycle(h)},n.requeueTimeout),E=!0,!1;d("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}return!0});if(E)return!1;n.cssBefore=n.cssBefore||{},n.cssAfter=n.cssAfter||{},n.cssFirst=n.cssFirst||{},n.animIn=n.animIn||{},n.animOut=n.animOut||{},c.not(":eq("+u+")").css(n.cssBefore),a(c[u]).css(n.cssFirst);if(n.timeout){n.timeout=parseInt(n.timeout,10),n.speed.constructor==String&&(n.speed=a.fx.speeds[n.speed]||parseInt(n.speed,10)),n.sync||(n.speed=n.speed/2);var F=n.fx=="none"?0:n.fx=="shuffle"?500:250;while(n.timeout-n.speed<F)n.timeout+=n.speed}n.easing&&(n.easeIn=n.easeOut=n.easing),n.speedIn||(n.speedIn=n.speed),n.speedOut||(n.speedOut=n.speed),n.slideCount=f.length,n.currSlide=n.lastSlide=u,n.random?(++n.randomIndex==f.length&&(n.randomIndex=0),n.nextSlide=n.randomMap[n.randomIndex]):n.backwards?n.nextSlide=n.startingSlide==0?f.length-1:n.startingSlide-1:n.nextSlide=n.startingSlide>=f.length-1?0:n.startingSlide+1;if(!n.multiFx){var G=a.fn.cycle.transitions[n.fx];if(a.isFunction(G))G(b,c,n);else if(n.fx!="custom"&&!n.multiFx)return d("unknown transition: "+n.fx,"; slideshow terminating"),!1}var H=c[u];return n.skipInitializationCallbacks||(n.before.length&&n.before[0].apply(H,[H,H,n,!0]),n.after.length&&n.after[0].apply(H,[H,H,n,!0])),n.next&&a(n.next).bind(n.prevNextEvent,function(){return o(n,1)}),n.prev&&a(n.prev).bind(n.prevNextEvent,function(){return o(n,0)}),(n.pager||n.pagerAnchorBuilder)&&q(f,n),l(n,f),n}function j(b){b.original={before:[],after:[]},b.original.cssBefore=a.extend({},b.cssBefore),b.original.cssAfter=a.extend({},b.cssAfter),b.original.animIn=a.extend({},b.animIn),b.original.animOut=a.extend({},b.animOut),a.each(b.before,function(){b.original.before.push(this)}),a.each(b.after,function(){b.original.after.push(this)})}function k(b){var e,f,g=a.fn.cycle.transitions;if(b.fx.indexOf(",")>0){b.multiFx=!0,b.fxs=b.fx.replace(/\s*/g,"").split(",");for(e=0;e<b.fxs.length;e++){var h=b.fxs[e];f=g[h];if(!f||!g.hasOwnProperty(h)||!a.isFunction(f))d("discarding unknown transition: ",h),b.fxs.splice(e,1),e--}if(!b.fxs.length)return d("No valid transitions named; slideshow terminating."),!1}else if(b.fx=="all"){b.multiFx=!0,b.fxs=[];for(p in g)f=g[p],g.hasOwnProperty(p)&&a.isFunction(f)&&b.fxs.push(p)}if(b.multiFx&&b.randomizeEffects){var i=Math.floor(Math.random()*20)+30;for(e=0;e<i;e++){var j=Math.floor(Math.random()*b.fxs.length);b.fxs.push(b.fxs.splice(j,1)[0])}c("randomized fx sequence: ",b.fxs)}return!0}function l(b,c){b.addSlide=function(d,e){var f=a(d),g=f[0];b.autostopCount||b.countdown++,c[e?"unshift":"push"](g),b.els&&b.els[e?"unshift":"push"](g),b.slideCount=c.length,f.css("position","absolute"),f[e?"prependTo":"appendTo"](b.$cont),e&&(b.currSlide++,b.nextSlide++),!a.support.opacity&&b.cleartype&&!b.cleartypeNoBg&&r(f),b.fit&&b.width&&f.width(b.width),b.fit&&b.height&&b.height!="auto"&&f.height(b.height),g.cycleH=b.fit&&b.height?b.height:f.height(),g.cycleW=b.fit&&b.width?b.width:f.width(),f.css(b.cssBefore),(b.pager||b.pagerAnchorBuilder)&&a.fn.cycle.createPagerAnchor(c.length-1,g,a(b.pager),c,b),a.isFunction(b.onAddSlide)?b.onAddSlide(f):f.hide()}}function m(b,d,e,f){e&&d.busy&&d.manualTrump&&(c("manualTrump in go(), stopping active transition"),a(b).stop(!0,!0),d.busy=0);if(d.busy){c("transition active, ignoring new tx request");return}var g=d.$cont[0],h=b[d.currSlide],i=b[d.nextSlide];if(g.cycleStop!=d.stopCount||g.cycleTimeout===0&&!e)return;if(!e&&!g.cyclePause&&!d.bounce&&(d.autostop&&--d.countdown<=0||d.nowrap&&!d.random&&d.nextSlide<d.currSlide)){d.end&&d.end(d);return}var j=!1;if((e||!g.cyclePause)&&d.nextSlide!=d.currSlide){j=!0;var k=d.fx;h.cycleH=h.cycleH||a(h).height(),h.cycleW=h.cycleW||a(h).width(),i.cycleH=i.cycleH||a(i).height(),i.cycleW=i.cycleW||a(i).width(),d.multiFx&&(f&&(d.lastFx==undefined||++d.lastFx>=d.fxs.length)?d.lastFx=0:!f&&(d.lastFx==undefined||--d.lastFx<0)&&(d.lastFx=d.fxs.length-1),k=d.fxs[d.lastFx]),d.oneTimeFx&&(k=d.oneTimeFx,d.oneTimeFx=null),a.fn.cycle.resetState(d,k),d.before.length&&a.each(d.before,function(a,b){if(g.cycleStop!=d.stopCount)return;b.apply(i,[h,i,d,f])});var l=function(){d.busy=0,a.each(d.after,function(a,b){if(g.cycleStop!=d.stopCount)return;b.apply(i,[h,i,d,f])})};c("tx firing("+k+"); currSlide: "+d.currSlide+"; nextSlide: "+d.nextSlide),d.busy=1,d.fxFn?d.fxFn(h,i,d,l,f,e&&d.fastOnEvent):a.isFunction(a.fn.cycle[d.fx])?a.fn.cycle[d.fx](h,i,d,l,f,e&&d.fastOnEvent):a.fn.cycle.custom(h,i,d,l,f,e&&d.fastOnEvent)}if(j||d.nextSlide==d.currSlide){d.lastSlide=d.currSlide;if(d.random)d.currSlide=d.nextSlide,++d.randomIndex==b.length&&(d.randomIndex=0),d.nextSlide=d.randomMap[d.randomIndex],d.nextSlide==d.currSlide&&(d.nextSlide=d.currSlide==d.slideCount-1?0:d.currSlide+1);else if(d.backwards){var o=d.nextSlide-1<0;o&&d.bounce?(d.backwards=!d.backwards,d.nextSlide=1,d.currSlide=0):(d.nextSlide=o?b.length-1:d.nextSlide-1,d.currSlide=o?0:d.nextSlide+1)}else{var o=d.nextSlide+1==b.length;o&&d.bounce?(d.backwards=!d.backwards,d.nextSlide=b.length-2,d.currSlide=b.length-1):(d.nextSlide=o?0:d.nextSlide+1,d.currSlide=o?b.length-1:d.nextSlide-1)}}j&&d.pager&&d.updateActivePagerLink(d.pager,d.currSlide,d.activePagerClass);var p=0;d.timeout&&!d.continuous?p=n(b[d.currSlide],b[d.nextSlide],d,f):d.continuous&&g.cyclePause&&(p=10),p>0&&(g.cycleTimeout=setTimeout(function(){m(b,d,0,!d.backwards)},p))}function n(a,b,d,e){if(d.timeoutFn){var f=d.timeoutFn.call(a,a,b,d,e);while(d.fx!="none"&&f-d.speed<250)f+=d.speed;c("calculated timeout: "+f+"; speed: "+d.speed);if(f!==!1)return f}return d.timeout}function o(b,c){var d=c?1:-1,e=b.elements,f=b.$cont[0],g=f.cycleTimeout;g&&(clearTimeout(g),f.cycleTimeout=0);if(b.random&&d<0)b.randomIndex--,--b.randomIndex==-2?b.randomIndex=e.length-2:b.randomIndex==-1&&(b.randomIndex=e.length-1),b.nextSlide=b.randomMap[b.randomIndex];else if(b.random)b.nextSlide=b.randomMap[b.randomIndex];else{b.nextSlide=b.currSlide+d;if(b.nextSlide<0){if(b.nowrap)return!1;b.nextSlide=e.length-1}else if(b.nextSlide>=e.length){if(b.nowrap)return!1;b.nextSlide=0}}var h=b.onPrevNextEvent||b.prevNextClick;return a.isFunction(h)&&h(d>0,b.nextSlide,e[b.nextSlide]),m(e,b,1,c),!1}function q(b,c){var d=a(c.pager);a.each(b,function(e,f){a.fn.cycle.createPagerAnchor(e,f,d,b,c)}),c.updateActivePagerLink(c.pager,c.startingSlide,c.activePagerClass)}function r(b){function d(a){return a=parseInt(a,10).toString(16),a.length<2?"0"+a:a}function e(b){for(;b&&b.nodeName.toLowerCase()!="html";b=b.parentNode){var c=a.css(b,"background-color");if(c&&c.indexOf("rgb")>=0){var e=c.match(/\d+/g);return"#"+d(e[0])+d(e[1])+d(e[2])}if(c&&c!="transparent")return c}return"#ffffff"}c("applying clearType background-color hack"),b.each(function(){a(this).css("background-color",e(this))})}var b="2.9995";a.support==undefined&&(a.support={opacity:!a.browser.msie}),a.expr[":"].paused=function(a){return a.cyclePause},a.fn.cycle=function(b,e){var g={s:this.selector,c:this.context};return this.length===0&&b!="stop"?!a.isReady&&g.s?(d("DOM not ready, queuing slideshow"),a(function(){a(g.s,g.c).cycle(b,e)}),this):(d("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)")),this):this.each(function(){var h=f(this,b,e);if(h===!1)return;h.updateActivePagerLink=h.updateActivePagerLink||a.fn.cycle.updateActivePagerLink,this.cycleTimeout&&clearTimeout(this.cycleTimeout),this.cycleTimeout=this.cyclePause=0;var j=a(this),k=h.slideExpr?a(h.slideExpr,this):j.children(),l=k.get(),o=i(j,k,l,h,g);if(o===!1)return;if(l.length<2){d("terminating; too few slides: "+l.length);return}var p=o.continuous?10:n(l[o.currSlide],l[o.nextSlide],o,!o.backwards);p&&(p+=o.delay||0,p<10&&(p=10),c("first timeout: "+p),this.cycleTimeout=setTimeout(function(){m(l,o,0,!h.backwards)},p))})},a.fn.cycle.resetState=function(b,c){c=c||b.fx,b.before=[],b.after=[],b.cssBefore=a.extend({},b.original.cssBefore),b.cssAfter=a.extend({},b.original.cssAfter),b.animIn=a.extend({},b.original.animIn),b.animOut=a.extend({},b.original.animOut),b.fxFn=null,a.each(b.original.before,function(){b.before.push(this)}),a.each(b.original.after,function(){b.after.push(this)});var d=a.fn.cycle.transitions[c];a.isFunction(d)&&d(b.$cont,a(b.elements),b)},a.fn.cycle.updateActivePagerLink=function(b,c,d){a(b).each(function(){a(this).children().removeClass(d).eq(c).addClass(d)})},a.fn.cycle.next=function(a){o(a,1)},a.fn.cycle.prev=function(a){o(a,0)},a.fn.cycle.createPagerAnchor=function(b,d,f,g,h){var i;a.isFunction(h.pagerAnchorBuilder)?(i=h.pagerAnchorBuilder(b,d),c("pagerAnchorBuilder("+b+", el) returned: "+i)):i='<a href="#">'+(b+1)+"</a>";if(!i)return;var j=a(i);if(j.parents("body").length===0){var k=[];f.length>1?(f.each(function(){var b=j.clone(!0);a(this).append(b),k.push(b[0])}),j=a(k)):j.appendTo(f)}h.pagerAnchors=h.pagerAnchors||[],h.pagerAnchors.push(j);var l=function(c){c.preventDefault(),h.nextSlide=b;var d=h.$cont[0],e=d.cycleTimeout;e&&(clearTimeout(e),d.cycleTimeout=0);var f=h.onPagerEvent||h.pagerClick;a.isFunction(f)&&f(h.nextSlide,g[h.nextSlide]),m(g,h,1,h.currSlide<b)};/mouseenter|mouseover/i.test(h.pagerEvent)?j.hover(l,function(){}):j.bind(h.pagerEvent,l),!/^click/.test(h.pagerEvent)&&!h.allowPagerClickBubble&&j.bind("click.cycle",function(){return!1});var n=h.$cont[0],o=!1;h.pauseOnPagerHover&&j.hover(function(){o=!0,n.cyclePause++,e(n,!0,!0)},function(){o&&n.cyclePause--,e(n,!0,!0)})},a.fn.cycle.hopsFromLast=function(a,b){var c,d=a.lastSlide,e=a.currSlide;return b?c=e>d?e-d:a.slideCount-d:c=e<d?d-e:d+a.slideCount-e,c},a.fn.cycle.commonReset=function(b,c,d,e,f,g){a(d.elements).not(b).hide(),typeof d.cssBefore.opacity=="undefined"&&(d.cssBefore.opacity=1),d.cssBefore.display="block",d.slideResize&&e!==!1&&c.cycleW>0&&(d.cssBefore.width=c.cycleW),d.slideResize&&f!==!1&&c.cycleH>0&&(d.cssBefore.height=c.cycleH),d.cssAfter=d.cssAfter||{},d.cssAfter.display="none",a(b).css("zIndex",d.slideCount+(g===!0?1:0)),a(c).css("zIndex",d.slideCount+(g===!0?0:1))},a.fn.cycle.custom=function(b,c,d,e,f,g){var h=a(b),i=a(c),j=d.speedIn,k=d.speedOut,l=d.easeIn,m=d.easeOut;i.css(d.cssBefore),g&&(typeof g=="number"?j=k=g:j=k=1,l=m=null);var n=function(){i.animate(d.animIn,j,l,function(){e()})};h.animate(d.animOut,k,m,function(){h.css(d.cssAfter),d.sync||n()}),d.sync&&n()},a.fn.cycle.transitions={fade:function(b,c,d){c.not(":eq("+d.currSlide+")").css("opacity",0),d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),d.cssBefore.opacity=0}),d.animIn={opacity:1},d.animOut={opacity:0},d.cssBefore={top:0,left:0}}},a.fn.cycle.ver=function(){return b},a.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:!1,animIn:null,animOut:null,aspect:!1,autostop:0,autostopCount:0,backwards:!1,before:null,center:null,cleartype:!a.support.opacity,cleartypeNoBg:!1,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:!0,metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:!0,requeueTimeout:250,rev:0,shuffle:null,skipInitializationCallbacks:!1,slideExpr:null,slideResize:1,speed:1e3,speedIn:null,speedOut:null,startingSlide:0,sync:1,timeout:4e3,timeoutFn:null,updateActivePagerLink:null,width:null}}(jQuery),function(a){a.fn.cycle.transitions.none=function(b,c,d){d.fxFn=function(b,c,d,e){a(c).show(),a(b).hide(),e()}},a.fn.cycle.transitions.fadeout=function(b,c,d){c.not(":eq("+d.currSlide+")").css({display:"block",opacity:1}),d.before.push(function(b,c,d,e,f,g){a(b).css("zIndex",d.slideCount+(!g==!0?1:0)),a(c).css("zIndex",d.slideCount+(!g==!0?0:1))}),d.animIn.opacity=1,d.animOut.opacity=0,d.cssBefore.opacity=1,d.cssBefore.display="block",d.cssAfter.zIndex=0},a.fn.cycle.transitions.scrollUp=function(b,c,d){b.css("overflow","hidden"),d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssBefore.top=e,d.cssBefore.left=0,d.cssFirst.top=0,d.animIn.top=0,d.animOut.top=-e},a.fn.cycle.transitions.scrollDown=function(b,c,d){b.css("overflow","hidden"),d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssFirst.top=0,d.cssBefore.top=-e,d.cssBefore.left=0,d.animIn.top=0,d.animOut.top=e},a.fn.cycle.transitions.scrollLeft=function(b,c,d){b.css("overflow","hidden"),d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0,d.cssBefore.left=e,d.cssBefore.top=0,d.animIn.left=0,d.animOut.left=0-e},a.fn.cycle.transitions.scrollRight=function(b,c,d){b.css("overflow","hidden"),d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0,d.cssBefore.left=-e,d.cssBefore.top=0,d.animIn.left=0,d.animOut.left=e},a.fn.cycle.transitions.scrollHorz=function(b,c,d){b.css("overflow","hidden").width(),d.before.push(function(b,c,d,e){d.rev&&(e=!e),a.fn.cycle.commonReset(b,c,d),d.cssBefore.left=e?c.cycleW-1:1-c.cycleW,d.animOut.left=e?-b.cycleW:b.cycleW}),d.cssFirst.left=0,d.cssBefore.top=0,d.animIn.left=0,d.animOut.top=0},a.fn.cycle.transitions.scrollVert=function(b,c,d){b.css("overflow","hidden"),d.before.push(function(b,c,d,e){d.rev&&(e=!e),a.fn.cycle.commonReset(b,c,d),d.cssBefore.top=e?1-c.cycleH:c.cycleH-1,d.animOut.top=e?b.cycleH:-b.cycleH}),d.cssFirst.top=0,d.cssBefore.left=0,d.animIn.top=0,d.animOut.left=0},a.fn.cycle.transitions.slideX=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide(),a.fn.cycle.commonReset(b,c,d,!1,!0),d.animIn.width=c.cycleW}),d.cssBefore.left=0,d.cssBefore.top=0,d.cssBefore.width=0,d.animIn.width="show",d.animOut.width=0},a.fn.cycle.transitions.slideY=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide(),a.fn.cycle.commonReset(b,c,d,!0,!1),d.animIn.height=c.cycleH}),d.cssBefore.left=0,d.cssBefore.top=0,d.cssBefore.height=0,d.animIn.height="show",d.animOut.height=0},a.fn.cycle.transitions.shuffle=function(b,c,d){var e,f=b.css("overflow","visible").width();c.css({left:0,top:0}),d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!0,!0)}),d.speedAdjusted||(d.speed=d.speed/2,d.speedAdjusted=!0),d.random=0,d.shuffle=d.shuffle||{left:-f,top:15},d.els=[];for(e=0;e<c.length;e++)d.els.push(c[e]);for(e=0;e<d.currSlide;e++)d.els.push(d.els.shift());d.fxFn=function(b,c,d,e,f){d.rev&&(f=!f);var g=f?a(b):a(c);a(c).css(d.cssBefore);var h=d.slideCount;g.animate(d.shuffle,d.speedIn,d.easeIn,function(){var c=a.fn.cycle.hopsFromLast(d,f);for(var i=0;i<c;i++)f?d.els.push(d.els.shift()):d.els.unshift(d.els.pop());if(f)for(var j=0,k=d.els.length;j<k;j++)a(d.els[j]).css("z-index",k-j+h);else{var l=a(b).css("z-index");g.css("z-index",parseInt(l,10)+1+h)}g.animate({left:0,top:0},d.speedOut,d.easeOut,function(){a(f?this:b).hide(),e&&e()})})},a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0})},a.fn.cycle.transitions.turnUp=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!1),d.cssBefore.top=c.cycleH,d.animIn.height=c.cycleH,d.animOut.width=c.cycleW}),d.cssFirst.top=0,d.cssBefore.left=0,d.cssBefore.height=0,d.animIn.top=0,d.animOut.height=0},a.fn.cycle.transitions.turnDown=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!1),d.animIn.height=c.cycleH,d.animOut.top=b.cycleH}),d.cssFirst.top=0,d.cssBefore.left=0,d.cssBefore.top=0,d.cssBefore.height=0,d.animOut.height=0},a.fn.cycle.transitions.turnLeft=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!0),d.cssBefore.left=c.cycleW,d.animIn.width=c.cycleW}),d.cssBefore.top=0,d.cssBefore.width=0,d.animIn.left=0,d.animOut.width=0},a.fn.cycle.transitions.turnRight=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!0),d.animIn.width=c.cycleW,d.animOut.left=b.cycleW}),a.extend(d.cssBefore,{top:0,left:0,width:0}),d.animIn.left=0,d.animOut.width=0},a.fn.cycle.transitions.zoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!1,!0),d.cssBefore.top=c.cycleH/2,d.cssBefore.left=c.cycleW/2,a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH}),a.extend(d.animOut,{width:0,height:0,top:b.cycleH/2,left:b.cycleW/2})}),d.cssFirst.top=0,d.cssFirst.left=0,d.cssBefore.width=0,d.cssBefore.height=0},a.fn.cycle.transitions.fadeZoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!1),d.cssBefore.left=c.cycleW/2,d.cssBefore.top=c.cycleH/2,a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH})}),d.cssBefore.width=0,d.cssBefore.height=0,d.animOut.opacity=0},a.fn.cycle.transitions.blindX=function(b,c,d){var e=b.css("overflow","hidden").width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),d.animIn.width=c.cycleW,d.animOut.left=b.cycleW}),d.cssBefore.left=e,d.cssBefore.top=0,d.animIn.left=0,d.animOut.left=e},a.fn.cycle.transitions.blindY=function(b,c,d){var e=b.css("overflow","hidden").height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),d.animIn.height=c.cycleH,d.animOut.top=b.cycleH}),d.cssBefore.top=e,d.cssBefore.left=0,d.animIn.top=0,d.animOut.top=e},a.fn.cycle.transitions.blindZ=function(b,c,d){var e=b.css("overflow","hidden").height(),f=b.width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),d.animIn.height=c.cycleH,d.animOut.top=b.cycleH}),d.cssBefore.top=e,d.cssBefore.left=f,d.animIn.top=0,d.animIn.left=0,d.animOut.top=e,d.animOut.left=f},a.fn.cycle.transitions.growX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!0),d.cssBefore.left=this.cycleW/2,d.animIn.left=0,d.animIn.width=this.cycleW,d.animOut.left=0}),d.cssBefore.top=0,d.cssBefore.width=0},a.fn.cycle.transitions.growY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!1),d.cssBefore.top=this.cycleH/2,d.animIn.top=0,d.animIn.height=this.cycleH,d.animOut.top=0}),d.cssBefore.height=0,d.cssBefore.left=0},a.fn.cycle.transitions.curtainX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!0,!0),d.cssBefore.left=c.cycleW/2,d.animIn.left=0,d.animIn.width=this.cycleW,d.animOut.left=b.cycleW/2,d.animOut.width=0}),d.cssBefore.top=0,d.cssBefore.width=0},a.fn.cycle.transitions.curtainY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!1,!0),d.cssBefore.top=c.cycleH/2,d.animIn.top=0,d.animIn.height=c.cycleH,d.animOut.top=b.cycleH/2,d.animOut.height=0}),d.cssBefore.height=0,d.cssBefore.left=0},a.fn.cycle.transitions.cover=function(b,c,d){var e=d.direction||"left",f=b.css("overflow","hidden").width(),g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),e=="right"?d.cssBefore.left=-f:e=="up"?d.cssBefore.top=g:e=="down"?d.cssBefore.top=-g:d.cssBefore.left=f}),d.animIn.left=0,d.animIn.top=0,d.cssBefore.top=0,d.cssBefore.left=0},a.fn.cycle.transitions.uncover=function(b,c,d){var e=d.direction||"left",f=b.css("overflow","hidden").width(),g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!0,!0),e=="right"?d.animOut.left=f:e=="up"?d.animOut.top=-g:e=="down"?d.animOut.top=g:d.animOut.left=-f}),d.animIn.left=0,d.animIn.top=0,d.cssBefore.top=0,d.cssBefore.left=0},a.fn.cycle.transitions.toss=function(b,c,d){var e=b.css("overflow","visible").width(),f=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!0,!0),!d.animOut.left&&!d.animOut.top?a.extend(d.animOut,{left:e*2,top:-f/2,opacity:0}):d.animOut.opacity=0}),d.cssBefore.left=0,d.cssBefore.top=0,d.animIn.left=0},a.fn.cycle.transitions.wipe=function(b,c,d){var e=b.css("overflow","hidden").width(),f=b.height();d.cssBefore=d.cssBefore||{};var g;if(d.clip)if(/l2r/.test(d.clip))g="rect(0px 0px "+f+"px 0px)";else if(/r2l/.test(d.clip))g="rect(0px "+e+"px "+f+"px "+e+"px)";else if(/t2b/.test(d.clip))g="rect(0px "+e+"px 0px 0px)";else if(/b2t/.test(d.clip))g="rect("+f+"px "+e+"px "+f+"px 0px)";else if(/zoom/.test(d.clip)){var h=parseInt(f/2,10),i=parseInt(e/2,10);g="rect("+h+"px "+i+"px "+h+"px "+i+"px)"}d.cssBefore.clip=d.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var j=d.cssBefore.clip.match(/(\d+)/g),k=parseInt(j[0],10),l=parseInt(j[1],10),m=parseInt(j[2],10),n=parseInt(j[3],10);d.before.push(function(b,c,d){if(b==c)return;var g=a(b),h=a(c);a.fn.cycle.commonReset(b,c,d,!0,!0,!1),d.cssAfter.display="block";var i=1,j=parseInt(d.speedIn/13,10)-1;(function o(){var a=k?k-parseInt(i*(k/j),10):0,b=n?n-parseInt(i*(n/j),10):0,c=m<f?m+parseInt(i*((f-m)/j||1),10):f,d=l<e?l+parseInt(i*((e-l)/j||1),10):e;h.css({clip:"rect("+a+"px "+d+"px "+c+"px "+b+"px)"}),i++<=j?setTimeout(o,13):g.css("display","none")})()}),a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0}),d.animIn={left:0},d.animOut={left:0}}}(jQuery),jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(
a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return b<1?-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c:h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){return f==undefined&&(f=1.70158),d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){return f==undefined&&(f=1.70158),d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){return f==undefined&&(f=1.70158),(b/=e/2)<1?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(a,b,c,d,e){return b<e/2?jQuery.easing.easeInBounce(a,b*2,0,d,e)*.5+c:jQuery.easing.easeOutBounce(a,b*2-e,0,d,e)*.5+d*.5+c}}),function(a){a.ga={},a.ga.load=function(d,e){jQuery.ajax({type:"GET",url:(document.location.protocol=="https:"?"https://ssl":"http://www")+".google-analytics.com/ga.js",cache:!0,success:function(){if(typeof _gat==undefined)throw"_gat has not been defined";b=_gat._getTracker(d),c(),a.isFunction(e)&&e(b),b._trackPageview()},dataType:"script",data:null})};var b,c=function(){if(d())throw"pageTracker has not been defined";for(var c in b){if(c.charAt(0)!="_")continue;a.ga[c.substr(1)]=b[c]}},d=function(){return b==undefined}}(jQuery),jQuery.fn.extend({getUrlParam:function(a){a=escape(unescape(a));var b=[],c=null;if($(this).attr("nodeName")=="#document")window.location.search.search(a)>-1&&(c=window.location.search.substr(1,window.location.search.length).split("&"));else if($(this).attr("src")!="undefined"){var d=$(this).attr("src");if(d.indexOf("?")>-1){var e=d.substr(d.indexOf("?")+1);c=e.split("&")}}else{if($(this).attr("href")=="undefined")return null;var d=$(this).attr("href");if(d.indexOf("?")>-1){var e=d.substr(d.indexOf("?")+1);c=e.split("&")}}if(c==null)return null;for(var f=0;f<c.length;f++)escape(unescape(c[f].split("=")[0]))==a&&b.push(c[f].split("=")[1]);return b.length==0?null:b.length==1?b[0]:b}}),function($){var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};$.toJSON=typeof JSON=="object"&&JSON.stringify?JSON.stringify:function(a){if(a===null)return"null";var b=typeof a;if(b==="undefined")return undefined;if(b==="number"||b==="boolean")return""+a;if(b==="string")return $.quoteString(a);if(b==="object"){if(typeof a.toJSON=="function")return $.toJSON(a.toJSON());if(a.constructor===Date){var c=a.getUTCMonth()+1,d=a.getUTCDate(),e=a.getUTCFullYear(),f=a.getUTCHours(),g=a.getUTCMinutes(),h=a.getUTCSeconds(),i=a.getUTCMilliseconds();return c<10&&(c="0"+c),d<10&&(d="0"+d),f<10&&(f="0"+f),g<10&&(g="0"+g),h<10&&(h="0"+h),i<100&&(i="0"+i),i<10&&(i="0"+i),'"'+e+"-"+c+"-"+d+"T"+f+":"+g+":"+h+"."+i+'Z"'}if(a.constructor===Array){var j=[];for(var k=0;k<a.length;k++)j.push($.toJSON(a[k])||"null");return"["+j.join(",")+"]"}var l,m,n=[];for(var o in a){b=typeof o;if(b==="number")l='"'+o+'"';else if(b==="string")l=$.quoteString(o);else continue;b=typeof a[o];if(b==="function"||b==="undefined")continue;m=$.toJSON(a[o]),n.push(l+":"+m)}return"{"+n.join(",")+"}"}},$.evalJSON=typeof JSON=="object"&&JSON.parse?JSON.parse:function(src){return eval("("+src+")")},$.secureEvalJSON=typeof JSON=="object"&&JSON.parse?JSON.parse:function(src){var filtered=src.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(filtered))return eval("("+src+")");throw new SyntaxError("Error parsing JSON, source is not valid.")},$.quoteString=function(a){return a.match(escapeable)?'"'+a.replace(escapeable,function(a){var b=meta[a];return typeof b=="string"?b:(b=a.charCodeAt(),"\\u00"+Math.floor(b/16).toString(16)+(b%16).toString(16))})+'"':'"'+a+'"'}}(jQuery);var GENTICS_Aloha_base="/assets/aloha/";window.undefined=window.undefined,Ext={version:"3.2.1",versionDetail:{major:3,minor:2,patch:1}},Ext.apply=function(a,b,c){c&&Ext.apply(a,c);if(a&&b&&typeof b=="object")for(var d in b)a[d]=b[d];return a},function(){var a=0,b=Object.prototype.toString,c=navigator.userAgent.toLowerCase(),d=function(a){return a.test(c)},e=document,f=e.compatMode=="CSS1Compat",g=d(/opera/),h=d(/\bchrome\b/),i=d(/webkit/),j=!h&&d(/safari/),k=j&&d(/applewebkit\/4/),l=j&&d(/version\/3/),m=j&&d(/version\/4/),n=!g&&d(/msie/),o=n&&d(/msie 7/),p=n&&d(/msie 8/),q=n&&!o&&!p,r=!i&&d(/gecko/),s=r&&d(/rv:1\.8/),t=r&&d(/rv:1\.9/),u=n&&!f,v=d(/windows|win32/),w=d(/macintosh|mac os x/),x=d(/adobeair/),y=d(/linux/),z=/^https/i.test(window.location.protocol);if(q)try{e.execCommand("BackgroundImageCache",!1,!0)}catch(A){}Ext.apply(Ext,{SSL_SECURE_URL:z&&n?'javascript:""':"about:blank",isStrict:f,isSecure:z,isReady:!1,enableGarbageCollector:!0,enableListenerCollection:!1,enableNestedListenerRemoval:!1,USE_NATIVE_JSON:!1,applyIf:function(a,b){if(a)for(var c in b)Ext.isDefined(a[c])||(a[c]=b[c]);return a},id:function(b,c){return b=Ext.getDom(b,!0)||{},b.id||(b.id=(c||"ext-gen")+ ++a),b.id},extend:function(){var a=function(a){for(var b in a)this[b]=a[b]},b=Object.prototype.constructor;return function(c,d,e){typeof d=="object"&&(e=d,d=c,c=e.constructor!=b?e.constructor:function(){d.apply(this,arguments)});var f=function(){},g,h=d.prototype;return f.prototype=h,g=c.prototype=new f,g.constructor=c,c.superclass=h,h.constructor==b&&(h.constructor=d),c.override=function(a){Ext.override(c,a)},g.superclass=g.supr=function(){return h},g.override=a,Ext.override(c,e),c.extend=function(a){return Ext.extend(c,a)},c}}(),override:function(a,b){if(b){var c=a.prototype;Ext.apply(c,b),Ext.isIE&&b.hasOwnProperty("toString")&&(c.toString=b.toString)}},namespace:function(){var a,b;return Ext.each(arguments,function(c){b=c.split("."),a=window[b[0]]=window[b[0]]||{},Ext.each(b.slice(1),function(b){a=a[b]=a[b]||{}})}),a},urlEncode:function(a,b){var c,d=[],e=encodeURIComponent;return Ext.iterate(a,function(a,b){c=Ext.isEmpty(b),Ext.each(c?a:b,function(b){d.push("&",e(a),"=",!Ext.isEmpty(b)&&(b!=a||!c)?Ext.isDate(b)?Ext.encode(b).replace(/"/g,""):e(b):"")})}),b||(d.shift(),b=""),b+d.join("")},urlDecode:function(a,b){if(Ext.isEmpty(a))return{};var c={},d=a.split("&"),e=decodeURIComponent,f,g;return Ext.each(d,function(a){a=a.split("="),f=e(a[0]),g=e(a[1]),c[f]=b||!c[f]?g:[].concat(c[f]).concat(g)}),c},urlAppend:function(a,b){return Ext.isEmpty(b)?a:a+(a.indexOf("?")===-1?"?":"&")+b},toArray:function(){return n?function(a,b,c,d){d=[];for(var e=0,f=a.length;e<f;e++)d.push(a[e]);return d.slice(b||0,c||d.length)}:function(a,b,c){return Array.prototype.slice.call(a,b||0,c||a.length)}}(),isIterable:function(a){return Ext.isArray(a)||a.callee?!0:/NodeList|HTMLCollection/.test(b.call(a))?!0:(typeof a.nextNode!="undefined"||a.item)&&Ext.isNumber(a.length)},each:function(a,b,c){if(Ext.isEmpty(a,!0))return;if(!Ext.isIterable(a)||Ext.isPrimitive(a))a=[a];for(var d=0,e=a.length;d<e;d++)if(b.call(c||a[d],a[d],d,a)===!1)return d},iterate:function(a,b,c){if(Ext.isEmpty(a))return;if(Ext.isIterable(a)){Ext.each(a,b,c);return}if(typeof a=="object")for(var d in a)if(a.hasOwnProperty(d)&&b.call(c||a,d,a[d],a)===!1)return},getDom:function(a,b){if(!a||!e)return null;if(a.dom)return a.dom;if(typeof a=="string"){var c=e.getElementById(a);return c&&n&&b?a==c.getAttribute("id")?c:null:c}return a},getBody:function(){return Ext.get(e.body||e.documentElement)},removeNode:n&&!p?function(){var a;return function(b){b&&b.tagName!="BODY"&&(Ext.enableNestedListenerRemoval?Ext.EventManager.purgeElement(b,!0):Ext.EventManager.removeAll(b),a=a||e.createElement("div"),a.appendChild(b),a.innerHTML="",delete Ext.elCache[b.id])}}():function(a){a&&a.parentNode&&a.tagName!="BODY"&&(Ext.enableNestedListenerRemoval?Ext.EventManager.purgeElement(a,!0):Ext.EventManager.removeAll(a),a.parentNode.removeChild(a),delete Ext.elCache[a.id])},isEmpty:function(a,b){return a===null||a===undefined||Ext.isArray(a)&&!a.length||(b?!1:a==="")},isArray:function(a){return b.apply(a)==="[object Array]"},isDate:function(a){return b.apply(a)==="[object Date]"},isObject:function(a){return!!a&&Object.prototype.toString.call(a)==="[object Object]"},isPrimitive:function(a){return Ext.isString(a)||Ext.isNumber(a)||Ext.isBoolean(a)},isFunction:function(a){return b.apply(a)==="[object Function]"},isNumber:function(a){return typeof a=="number"&&isFinite(a)},isString:function(a){return typeof a=="string"},isBoolean:function(a){return typeof a=="boolean"},isElement:function(a){return a?!!a.tagName:!1},isDefined:function(a){return typeof a!="undefined"},isOpera:g,isWebKit:i,isChrome:h,isSafari:j,isSafari3:l,isSafari4:m,isSafari2:k,isIE:n,isIE6:q,isIE7:o,isIE8:p,isGecko:r,isGecko2:s,isGecko3:t,isBorderBox:u,isLinux:y,isWindows:v,isMac:w,isAir:x}),Ext.ns=Ext.namespace}(),Ext.ns("Ext.util","Ext.lib","Ext.data"),Ext.elCache={},Ext.apply(Function.prototype,{createInterceptor:function(a,b){var c=this;return Ext.isFunction(a)?function(){var d=this,e=arguments;return a.target=d,a.method=c,a.apply(b||d||window,e)!==!1?c.apply(d||window,e):null}:this},createCallback:function(){var a=arguments,b=this;return function(){return b.apply(window,a)}},createDelegate:function(a,b,c){var d=this;return function(){var e=b||arguments;if(c===!0)e=Array.prototype.slice.call(arguments,0),e=e.concat(b);else if(Ext.isNumber(c)){e=Array.prototype.slice.call(arguments,0);var f=[c,0].concat(b);Array.prototype.splice.apply(e,f)}return d.apply(a||window,e)}},defer:function(a,b,c,d){var e=this.createDelegate(b,c,d);return a>0?setTimeout(e,a):(e(),0)}}),Ext.applyIf(String,{format:function(a){var b=Ext.toArray(arguments,1);return a.replace(/\{(\d+)\}/g,function(a,c){return b[c]})}}),Ext.applyIf(Array.prototype,{indexOf:function(a,b){var c=this.length;b=b||0,b+=b<0?c:0;for(;b<c;++b)if(this[b]===a)return b;return-1},remove:function(a){var b=this.indexOf(a);return b!=-1&&this.splice(b,1),this}}),Ext.ns("Ext.grid","Ext.list","Ext.dd","Ext.tree","Ext.form","Ext.menu","Ext.state","Ext.layout","Ext.app","Ext.ux","Ext.chart","Ext.direct"),Ext.apply(Ext,function(){var a=Ext,b=0,c=null;return{emptyFn:function(){},BLANK_IMAGE_URL:Ext.isIE6||Ext.isIE7||Ext.isAir?"http://www.extjs.com/s.gif":"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",extendX:function(a,b){return Ext.extend(a,b(a.prototype))},getDoc:function(){return Ext.get(document)},num:function(a,b){return a=Number(Ext.isEmpty(a)||Ext.isArray(a)||typeof a=="boolean"||typeof a=="string"&&a.trim().length==0?NaN:a),isNaN(a)?b:a},value:function(a,b,c){return Ext.isEmpty(a,c)?b:a},escapeRe:function(a){return a.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},sequence:function(a,b,c,d){a[b]=a[b].createSequence(c,d)},addBehaviors:function(a){if(!Ext.isReady)Ext.onReady(function(){Ext.addBehaviors(a)});else{var b={},c,d,e;for(d in a)(c=d.split("@"))[1]&&(e=c[0],b[e]||(b[e]=Ext.select(e)),b[e].on(c[1],a[d]));b=null}},getScrollBarWidth:function(a){if(!Ext.isReady)return 0;if(a===!0||c===null){var b=Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),d=b.child("div",!0),e=d.offsetWidth;b.setStyle("overflow",Ext.isWebKit||Ext.isGecko?"auto":"scroll");var f=d.offsetWidth;b.remove(),c=e-f+2}return c},combine:function(){var a=arguments,b=a.length,c=[];for(var d=0;d<b;d++){var e=a[d];Ext.isArray(e)?c=c.concat(e):e.length!==undefined&&!e.substr?c=c.concat(Array.prototype.slice.call(e,0)):c.push(e)}return c},copyTo:function(a,b,c){return typeof c=="string"&&(c=c.split(/[,;\s]/)),Ext.each(c,function(c){b.hasOwnProperty(c)&&(a[c]=b[c])},this),a},destroy:function(){Ext.each(arguments,function(a){a&&(Ext.isArray(a)?this.destroy.apply(this,a):typeof a.destroy=="function"?a.destroy():a.dom&&a.remove())},this)},destroyMembers:function(a,b,c,d){for(var e=1,f=arguments,g=f.length;e<g;e++)Ext.destroy(a[f[e]]),delete a[f[e]]},clean:function(a){var b=[];return Ext.each(a,function(a){!a||b.push(a)}),b},unique:function(a){var b=[],c={};return Ext.each(a,function(a){c[a]||b.push(a),c[a]=!0}),b},flatten:function(a){function c(a){return Ext.each(a,function(a){Ext.isArray(a)?c(a):b.push(a)}),b}var b=[];return c(a)},min:function(a,b){var c=a[0];return b=b||function(a,b){return a<b?-1:1},Ext.each(a,function(a){c=b(c,a)==-1?c:a}),c},max:function(a,b){var c=a[0];return b=b||function(a,b){return a>b?1:-1},Ext.each(a,function(a){c=b(c,a)==1?c:a}),c},mean:function(a){return a.length>0?Ext.sum(a)/a.length:undefined},sum:function(a){var b=0;return Ext.each(a,function(a){b+=a}),b},partition:function(a,b){var c=[[],[]];return Ext.each(a,function(a,d,e){c[b&&b(a,d,e)||!b&&a?0:1].push(a)}),c},invoke:function(a,b){var c=[],d=Array.prototype.slice.call(arguments,2);return Ext.each(a,function(a,e){a&&typeof a[b]=="function"?c.push(a[b].apply(a,d)):c.push(undefined)}),c},pluck:function(a,b){var c=[];return Ext.each(a,function(a){c.push(a[b])}),c},zip:function(){var a=Ext.partition(arguments,function(a){return typeof a!="function"}),b=a[0],c=a[1][0],d=Ext.max(Ext.pluck(b,"length")),e=[];for(var f=0;f<d;f++){e[f]=[];if(c)e[f]=c.apply(c,Ext.pluck(b,f));else for(var g=0,h=b.length;g<h;g++)e[f].push(b[g][f])}return e},getCmp:function(a){return Ext.ComponentMgr.get(a)},useShims:a.isIE6||a.isMac&&a.isGecko2,type:function(a){if(a===undefined||a===null)return!1;if(a.htmlElement)return"element";var b=typeof a;if(b=="object"&&a.nodeName)switch(a.nodeType){case 1:return"element";case 3:return/\S/.test(a.nodeValue)?"textnode":"whitespace"}if(b=="object"||b=="function"){switch(a.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof a.length=="number"&&typeof a.item=="function")return"nodelist"}return b},intercept:function(a,b,c,d){a[b]=a[b].createInterceptor(c,d)},callback:function(a,b,c,d){typeof a=="function"&&(d?a.defer(d,b,c||[]):a.apply(b,c||[]))}}}()),Ext.apply(Function.prototype,{createSequence:function(a,b){var c=this;return typeof a!="function"?this:function(){var d=c.apply(this||window,arguments);return a.apply(b||this||window,arguments),d}}}),Ext.applyIf(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(a,b,c){var d=String(a);c||(c=" ");while(d.length<b)d=c+d;return d}}),String.prototype.toggle=function(a,b){return this==a?b:a},String.prototype.trim=function(){var a=/^\s+|\s+$/g;return function(){return this.replace(a,"")}}(),Date.prototype.getElapsed=function(a){return Math.abs((a||new Date).getTime()-this.getTime())},Ext.applyIf(Number.prototype,{constrain:function(a,b){return Math.min(Math.max(this,a),b)}}),Ext.util.TaskRunner=function(a){a=a||10;var b=[],c=[],d=0,e=!1,f=function(){e=!1,clearInterval(d),d=0},g=function(){e||(e=!0,d=setInterval(i,a))},h=function(a){c.push(a),a.onStop&&a.onStop.apply(a.scope||a)},i=function(){var a=c.length,d=(new Date).getTime();if(a>0){for(var e=0;e<a;e++)b.remove(c[e]);c=[];if(b.length<1){f();return}}for(var e=0,g,i,j,k=b.length;e<k;++e){g=b[e],i=d-g.taskRunTime;if(g.interval<=i){j=g.run.apply(g.scope||g,g.args||[++g.taskRunCount]),g.taskRunTime=d;if(j===!1||g.taskRunCount===g.repeat){h(g);return}}g.duration&&g.duration<=d-g.taskStartTime&&h(g)}};this.start=function(a){return b.push(a),a.taskStartTime=(new Date).getTime(),a.taskRunTime=0,a.taskRunCount=0,g(),a},this.stop=function(a){return h(a),a},this.stopAll=function(){f();for(var a=0,d=b.length;a<d;a++)b[a].onStop&&b[a].onStop();b=[],c=[]}},Ext.TaskMgr=new Ext.util.TaskRunner;if(typeof jQuery=="undefined")throw"Unable to load Ext, jQuery not found.";(function(){function b(b){return a||(a=new Ext.Element.Flyweight),a.dom=b,a}var a;Ext.lib.Dom={getViewWidth:function(a){return a?Math.max(jQuery(document).width(),jQuery(window).width()):jQuery(window).width()},getViewHeight:function(a){return a?Math.max(jQuery(document).height(),jQuery(window).height()):jQuery(window).height()},isAncestor:function(a,b){var c=!1;a=Ext.getDom(a),b=Ext.getDom(b);if(a&&b){if(a.contains)return a.contains(b);if(a.compareDocumentPosition)return!!(a.compareDocumentPosition(b)&16);while(b=b.parentNode)c=b==a||c}return c},getRegion:function(a){return Ext.lib.Region.getRegion(a)},getY:function(a){return this.getXY(a)[1]},getX:function(a){return this.getXY(a)[0]},getXY:function(a){var c,d,e,f,g=document.body||document.documentElement;a=Ext.getDom(a);if(a==g)return[0,0];if(a.getBoundingClientRect)return e=a.getBoundingClientRect(),f=b(document).getScroll(),[Math.round(e.left+f.left),Math.round(e.top+f.top)];var h=0,i=0;c=a;var j=b(a).getStyle("position")=="absolute";while(c){h+=c.offsetLeft,i+=c.offsetTop,!j&&b(c).getStyle("position")=="absolute"&&(j=!0);if(Ext.isGecko){d=b(c);var k=parseInt(d.getStyle("borderTopWidth"),10)||0,l=parseInt(d.getStyle("borderLeftWidth"),10)||0;h+=l,i+=k,c!=a&&d.getStyle("overflow")!="visible"&&(h+=l,i+=k)}c=c.offsetParent}Ext.isSafari&&j&&(h-=g.offsetLeft,i-=g.offsetTop);if(Ext.isGecko&&!j){var m=b(g);h+=parseInt(m.getStyle("borderLeftWidth"),10)||0,i+=parseInt(m.getStyle("borderTopWidth"),10)||0}c=a.parentNode;while(c&&c!=g){if(!Ext.isOpera||c.tagName!="TR"&&b(c).getStyle("display")!="inline")h-=c.scrollLeft,i-=c.scrollTop;c=c.parentNode}return[h,i]},setXY:function(a,b){a=Ext.fly(a,"_setXY"),a.position();var c=a.translatePoints(b);b[0]!==!1&&(a.dom.style.left=c.left+"px"),b[1]!==!1&&(a.dom.style.top=c.top+"px")},setX:function(a,b){this.setXY(a,[b,!1])},setY:function(a,b){this.setXY(a,[!1,b])}},Ext.lib.Event={getPageX:function(a){return a=a.browserEvent||a,a.pageX},getPageY:function(a){return a=a.browserEvent||a,a.pageY},getXY:function(a){return a=a.browserEvent||a,[a.pageX,a.pageY]},getTarget:function(a){return a.target},on:function(a,b,c,d,e){jQuery(a).bind(b,c)},un:function(a,b,c){jQuery(a).unbind(b,c)},purgeElement:function(a){jQuery(a).unbind()},preventDefault:function(a){a=a.browserEvent||a,a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(a){a=a.browserEvent||a,a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},stopEvent:function(a){this.preventDefault(a),this.stopPropagation(a)},onAvailable:function(a,b,c){var d=new Date,e=function(){d.getElapsed()>1e4&&clearInterval(f);var e=document.getElementById(a);e&&(clearInterval(f),b.call(c||window,e))},f=setInterval(e,50)},resolveTextNode:Ext.isGecko?function(a){if(!a)return;var b=HTMLElement.prototype.toString.call(a);if(b=="[xpconnect wrapped native prototype]"||b=="[object XULElement]")return;return a.nodeType==3?a.parentNode:a}:function(a){return a&&a.nodeType==3?a.parentNode:a},getRelatedTarget:function(a){a=a.browserEvent||a;var b=a.relatedTarget;return b||(a.type=="mouseout"?b=a.toElement:a.type=="mouseover"&&(b=a.fromElement)),this.resolveTextNode(b)}},Ext.lib.Ajax=function(){var a=function(a){return function(c,d){d!="error"&&d!="timeout"||!a.failure?a.success&&a.success.call(a.scope||window,b(a,c)):a.failure.call(a.scope||window,b(a,c))}},b=function(a,b){var c={},d,e,f;try{d=b.getAllResponseHeaders(),Ext.each(d.replace(/\r\n/g,"\n").split("\n"),function(a){e=a.indexOf(":"),e>=0&&(f=a.substr(0,e).toLowerCase(),a.charAt(e+1)==" "&&++e,c[f]=a.substr(e+1))})}catch(g){}return{responseText:b.responseText,responseXML:b.responseXML,argument:a.argument,status:b.status,statusText:b.statusText,getResponseHeader:function(a){return c[a.toLowerCase()]},getAllResponseHeaders:function(){return d}}};return{request:function(b,c,d,e,f){var g={type:b,url:c,data:e,timeout:d.timeout,complete:a(d)};if(f){var h=f.headers;if(f.xmlData){g.data=f.xmlData,g.processData=!1,g.type=b?b:f.method?f.method:"POST";if(!h||!h["Content-Type"])g.contentType="text/xml"}else if(f.jsonData){g.data=typeof f.jsonData=="object"?Ext.encode(f.jsonData):f.jsonData,g.processData=!1,g.type=b?b:f.method?f.method:"POST";if(!h||!h["Content-Type"])g.contentType="application/json"}h&&(g.beforeSend=function(a){for(var b in h)h.hasOwnProperty(b)&&a.setRequestHeader(b,h[b])})}jQuery.ajax(g)},formRequest:function(b,c,d,e,f,g){jQuery.ajax({type:Ext.getDom(b).method||"POST",url:c,data:jQuery(b).serialize()+(e?"&"+e:""),timeout:d.timeout,complete:a(d)})},isCallInProgress:function(a){return!1},abort:function(a){return!1},serializeForm:function(a){return jQuery(a.dom||a).serialize()}}}(),Ext.lib.Anim=function(){var a=function(a,b){var c=!0;return{stop:function(a){},isAnimated:function(){return c},proxyCallback:function(){c=!1,Ext.callback(a,b)}}};return{scroll:function(b,c,d,e,f,g){var h=a(f,g);return b=Ext.getDom(b),typeof c.scroll.to[0]=="number"&&(b.scrollLeft=c.scroll.to[0]),typeof c.scroll.to[1]=="number"&&(b.scrollTop=c.scroll.to[1]),h.proxyCallback(),h},motion:function(a,b,c,d,e,f){return this.run(a,b,c,d,e,f)},color:function(b,c,d,e,f,g){var h=a(f,g);return h.proxyCallback(),h},run:function(b,c,d,e,f,g,h){var i=a(f,g),j=Ext.fly(b,"_animrun"),k={};for(var l in c)switch(l){case"points":var m,n;j.position();if(m=c.points.by){var o=j.getXY();n=j.translatePoints([o[0]+m[0],o[1]+m[1]])}else n=j.translatePoints(c.points.to);k.left=n.left,k.top=n.top,parseInt(j.getStyle("left"),10)||j.setLeft(0),parseInt(j.getStyle("top"),10)||j.setTop(0),c.points.from&&j.setXY(c.points.from);break;case"width":k.width=c.width.to,c.width.from&&j.setWidth(c.width.from);break;case"height":k.height=c.height.to,c.height.from&&j.setHeight(c.height.from);break;case"opacity":k.opacity=c.opacity.to,c.opacity.from&&j.setOpacity(c.opacity.from);break;case"left":k.left=c.left.to,c.left.from&&j.setLeft(c.left.from);break;case"top":k.top=c.top.to,c.top.from&&j.setTop(c.top.from);break;case"callback":case"scope":case"xy":break;default:k[l]=c[l].to,c[l].from&&j.setStyle(l,c[l].from)}return jQuery(b).animate(k,d*1e3,undefined,i.proxyCallback),i}}}(),Ext.lib.Region=function(a,b,c,d){this.top=a,this[1]=a,this.right=b,this.bottom=c,this.left=d,this[0]=d},Ext.lib.Region.prototype={contains:function(a){return a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom},getArea:function(){return(this.bottom-this.top)*(this.right-this.left)},intersect:function(a){var b=Math.max(this.top,a.top),c=Math.min(this.right,a.right),d=Math.min(this.bottom,a.bottom),e=Math.max(this.left,a.left);return d>=b&&c>=e?new Ext.lib.Region(b,c,d,e):null},union:function(a){var b=Math.min(this.top,a.top),c=Math.max(this.right,a.right),d=Math.max(this.bottom,a.bottom),e=Math.min(this.left,a.left);return new Ext.lib.Region(b,c,d,e)},constrainTo:function(a){return this.top=this.top.constrain(a.top,a.bottom),this.bottom=this.bottom.constrain(a.top,a.bottom),this.left=this.left.constrain(a.left,a.right),this.right=this.right.constrain(a.left,a.right),this},adjust:function(a,b,c,d){return this.top+=a,this.left+=b,this.right+=d,this.bottom+=c,this}},Ext.lib.Region.getRegion=function(a){var b=Ext.lib.Dom.getXY(a),c=b[1],d=b[0]+a.offsetWidth,e=b[1]+a.offsetHeight,f=b[0];return new Ext.lib.Region(c,d,e,f)},Ext.lib.Point=function(a,b){Ext.isArray(a)&&(b=a[1],a=a[0]),this.x=this.right=this.left=this[0]=a,this.y=this.top=this.bottom=this[1]=b},Ext.lib.Point.prototype=new Ext.lib.Region;if(Ext.isIE){function c(){var a=Function.prototype;delete a.createSequence,delete a.defer,delete a.createDelegate,delete a.createCallback,delete a.createInterceptor,window.detachEvent("onunload",c)}window.attachEvent("onunload",c)}})(),Ext.DomHelper=function(){function s(a,b,c,d,e,f){var g=h.insertHtml(d,Ext.getDom(a),t(b));return c?Ext.get(g,!0):g}function t(a){var c="",e,f,g,h,i;if(typeof a=="string")c=a;else if(Ext.isArray(a))for(var j=0;j<a.length;j++)a[j]&&(c+=t(a[j]));else{c+="<"+(a.tag=a.tag||"div");for(e in a){f=a[e];if(!d.test(e))if(typeof f=="object"){c+=" "+e+'="';for(g in f)c+=g+":"+f[g]+";";c+='"'}else c+=" "+({cls:"class",htmlFor:"for"}[e]||e)+'="'+f+'"'}b.test(a.tag)?c+="/>":(c+=">",(i=a.children||a.cn)?c+=t(i):a.html&&(c+=a.html),c+="</"+a.tag+">")}return c}function u(b,c,d,e){a.innerHTML=[c,d,e].join("");var f=-1,g=a,h;while(++f<b)g=g.firstChild;if(h=g.nextSibling){var i=document.createDocumentFragment();while(g)h=g.nextSibling,i.appendChild(g),g=h;g=i}return g}function v(b,c,d,f){var g,h;a=a||document.createElement("div");if(b=="td"&&(c==i||c==l)||!e.test(b)&&(c==k||c==j))return;h=c==k?d:c==j?d.nextSibling:c==i?d.firstChild:null;if(c==k||c==j)d=d.parentNode;return b=="td"||b=="tr"&&(c==l||c==i)?g=u(4,q,f,r):b=="tbody"&&(c==l||c==i)||b=="tr"&&(c==k||c==j)?g=u(3,o,f,p):g=u(2,m,f,n),d.insertBefore(g,h),g}var a=null,b=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,c=/^table|tbody|tr|td$/i,d=/tag|children|cn|html$/i,e=/td|tr|tbody/i,f=/([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi,g=/end/i,h,i="afterbegin",j="afterend",k="beforebegin",l="beforeend",m="<table>",n="</table>",o=m+"<tbody>",p="</tbody>"+n,q=o+"<tr>",r="</tr>"+p;return h={markup:function(a){return t(a)},applyStyles:function(a,b){if(b){var c=0,d,e,g;a=Ext.fly(a),typeof b=="function"&&(b=b.call());if(typeof b=="string")while(g=f.exec(b))a.setStyle(g[1],g[2]);else typeof b=="object"&&a.setStyle(b)}},insertHtml:function(a,b,d){var e={},f,h,m,n,o,p;a=a.toLowerCase(),e[k]=["BeforeBegin","previousSibling"],e[j]=["AfterEnd","nextSibling"];if(!b.insertAdjacentHTML)return m=b.ownerDocument.createRange(),h="setStart"+(g.test(a)?"After":"Before"),e[a]?(m[h](b),n=m.createContextualFragment(d),b.parentNode.insertBefore(n,a==k?b:b.nextSibling),b[(a==k?"previous":"next")+"Sibling"]):(o=(a==i?"first":"last")+"Child",b.firstChild?(m[h](b[o]),n=m.createContextualFragment(d),a==i?b.insertBefore(n,b.firstChild):b.appendChild(n)):b.innerHTML=d,b[o]);if(c.test(b.tagName)&&(p=v(b.tagName.toLowerCase(),a,b,d)))return p;e[i]=["AfterBegin","firstChild"],e[l]=["BeforeEnd","lastChild"];if(f=e[a])return b.insertAdjacentHTML(f[0],d),b[f[1]];throw'Illegal insertion point -> "'+a+'"'},insertBefore:function(a,b,c){return s(a,b,c,k)},insertAfter:function(a,b,c){return s(a,b,c,j,"nextSibling")},insertFirst:function(a,b,c){return s(a,b,c,i,"firstChild")},append:function(a,b,c){return s(a,b,c,l,"",!0)},overwrite:function(a,b,c){return a=Ext.getDom(a),a.innerHTML=t(b),c?Ext.get(a.firstChild):a.firstChild},createHtml:t},h}(),Ext.apply(Ext.DomHelper,function(){function g(b,c,d,e,f,g){b=Ext.getDom(b);var i;return a.useDom?(i=h(c,null),g?b.appendChild(i):(f=="firstChild"?b:b.parentNode).insertBefore(i,b[f]||b)):i=Ext.DomHelper.insertHtml(e,b,Ext.DomHelper.createHtml(c)),d?Ext.get(i,!0):i}function h(a,b){var c,d=document,e,g,i,j;if(Ext.isArray(a)){c=d.createDocumentFragment();for(var k=0,l=a.length;k<l;k++)h(a[k],c)}else if(typeof a=="string")c=d.createTextNode(a);else{c=d.createElement(a.tag||"div"),e=!!c.setAttribute;for(var g in a)f.test(g)||(i=a[g],g=="cls"?c.className=i:e?c.setAttribute(g,i):c[g]=i);Ext.DomHelper.applyStyles(c,a.style),(j=a.children||a.cn)?h(j,c):a.html&&(c.innerHTML=a.html)}return b&&b.appendChild(c),c}var a,b="afterbegin",c="afterend",d="beforebegin",e="beforeend",f=/tag|children|cn|html$/i;return a={createTemplate:function(a){var b=Ext.DomHelper.createHtml(a);return new Ext.Template(b)},useDom:!1,insertBefore:function(a,b,c){return g(a,b,c,d)},insertAfter:function(a,b,d){return g(a,b,d,c,"nextSibling")},insertFirst:function(a,c,d){return g(a,c,d,b,"firstChild")},append:function(a,b,c){return g(a,b,c,e,"",!0)},createDom:h},a}()),Ext.Template=function(a){var b=this,c=arguments,d=[],e;if(Ext.isArray(a))a=a.join("");else if(c.length>1){for(var f=0,g=c.length;f<g;f++)e=c[f],typeof e=="object"?Ext.apply(b,e):d.push(e);a=d.join("")}b.html=a,b.compiled&&b.compile()},Ext.Template.prototype={re:/\{([\w-]+)\}/g,applyTemplate:function(a){var b=this;return b.compiled?b.compiled(a):b.html.replace(b.re,function(b,c){return a[c]!==undefined?a[c]:""})},set:function(a,b){var c=this;return c.html=a,c.compiled=null,b?c.compile():c},compile:function(){function fn(a,b){return b="values['"+b+"']","'"+sep+"("+b+" == undefined ? '' : "+b+")"+sep+"'"}var me=this,sep=Ext.isGecko?"+":",";return eval("this.compiled = function(values){ return "+(Ext.isGecko?"'":"['")+me.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+(Ext.isGecko?"';};":"'].join('');};")),me},insertFirst:function(a,b,c){return this.doInsert("afterBegin",a,b,c)},insertBefore:function(a,b,c){return this.doInsert("beforeBegin",a,b,c)},insertAfter:function(a,b,c){return this.doInsert("afterEnd",a,b,c)},append:function(a,b,c){return this.doInsert("beforeEnd",a,b,c)},doInsert:function(a,b,c,d){b=Ext.getDom(b);var e=Ext.DomHelper.insertHtml(a,b,this.applyTemplate(c));return d?Ext.get(e,!0):e},overwrite:function(a,b,c){return a=Ext.getDom(a),a.innerHTML=this.applyTemplate(b),c?Ext.get(a.firstChild,!0):a.firstChild}},Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate,Ext.Template.from=function(a,b){return a=Ext.getDom(a),new Ext.Template(a.value||a.innerHTML,b||"")},Ext.apply(Ext.Template.prototype,{disableFormats:!1,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,argsRe:/^\s*['"](.*)["']\s*$/,compileARe:/\\/g,compileBRe:/(\r\n|\n)/g,compileCRe:/'/g,applyTemplate:function(a){function f(f,g,h,i){if(h&&c){if(h.substr(0,5)=="this.")return e.call(h.substr(5),a[g],a);if(i){var j=b.argsRe;i=i.split(",");for(var k=0,l=i.length;k<l;k++)i[k]=i[k].replace(j,"$1");i=[a[g]].concat(i)}else i=[a[g]];return d[h].apply(d,i)}return a[g]!==undefined?a[g]:""}var b=this,c=b.disableFormats!==!0,d=Ext.util.Format,e=b;return b.compiled?b.compiled(a):b.html.replace(b.re,f)},compile:function(){function fn(a,b,c,d){return c&&useF?(d=d?","+d:"",c.substr(0,5)!="this."?c="fm."+c+"(":(c='this.call("'+c.substr(5)+'", ',d=", values")):(d="",c="(values['"+b+"'] == undefined ? '' : "),"'"+sep+c+"values['"+b+"']"+d+")"+sep+"'"}var me=this,fm=Ext.util.Format,useF=me.disableFormats!==!0,sep=Ext.isGecko?"+":",",body;return Ext.isGecko?body="this.compiled = function(values){ return '"+me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn)+"';};":(body=["this.compiled = function(values){ return ['"],body.push(me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn)),body.push("'].join('');};"),body=body.join("")),eval(body),me},call:function(a,b,c){return this[a](b,c)}}),Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate,Ext.DomQuery=function(){function child(a,b){var c=0,d=a.firstChild;while(d){if(d.nodeType==1&&++c==b)return d;d=d.nextSibling}return null}function next(a){while((a=a.nextSibling)&&a.nodeType!=1);return a}function prev(a){while((a=a.previousSibling)&&a.nodeType!=1);return a}function children
(a){var b=a.firstChild,c=-1,d;while(b)d=b.nextSibling,b.nodeType==3&&!nonSpace.test(b.nodeValue)?a.removeChild(b):b.nodeIndex=++c,b=d;return this}function byClassName(a,b){if(!b)return a;var c=[],d=-1;for(var e=0,f;f=a[e];e++)(" "+f.className+" ").indexOf(b)!=-1&&(c[++d]=f);return c}function attrValue(a,b){return!a.tagName&&typeof a.length!="undefined"&&(a=a[0]),a?b=="for"?a.htmlFor:b=="class"||b=="className"?a.className:a.getAttribute(b)||a[b]:null}function getNodes(a,b,c){var d=[],e=-1,f;if(!a)return d;c=c||"*",typeof a.getElementsByTagName!="undefined"&&(a=[a]);if(!b)for(var g=0,h;h=a[g];g++){f=h.getElementsByTagName(c);for(var i=0,j;j=f[i];i++)d[++e]=j}else if(b=="/"||b==">"){var k=c.toUpperCase();for(var g=0,h,l;h=a[g];g++){l=h.childNodes;for(var i=0,m;m=l[i];i++)if(m.nodeName==k||m.nodeName==c||c=="*")d[++e]=m}}else if(b=="+"){var k=c.toUpperCase();for(var g=0,n;n=a[g];g++){while((n=n.nextSibling)&&n.nodeType!=1);n&&(n.nodeName==k||n.nodeName==c||c=="*")&&(d[++e]=n)}}else if(b=="~"){var k=c.toUpperCase();for(var g=0,n;n=a[g];g++)while(n=n.nextSibling)if(n.nodeName==k||n.nodeName==c||c=="*")d[++e]=n}return d}function concat(a,b){if(b.slice)return a.concat(b);for(var c=0,d=b.length;c<d;c++)a[a.length]=b[c];return a}function byTag(a,b){if(a.tagName||a==document)a=[a];if(!b)return a;var c=[],d=-1;b=b.toLowerCase();for(var e=0,f;f=a[e];e++)f.nodeType==1&&f.tagName.toLowerCase()==b&&(c[++d]=f);return c}function byId(a,b){if(a.tagName||a==document)a=[a];if(!b)return a;var c=[],d=-1;for(var e=0,f;f=a[e];e++)if(f&&f.id==b)return c[++d]=f,c;return c}function byAttribute(a,b,c,d,e){var f=[],g=-1,h=e=="{",i=Ext.DomQuery.operators[d],j,k;for(var l=0,m;m=a[l];l++){if(m.nodeType!=1)continue;k=m.innerHTML,k!==null&&k!==undefined?h?j=Ext.DomQuery.getStyle(m,b):b=="class"||b=="className"?j=m.className:b=="for"?j=m.htmlFor:b=="href"?j=m.getAttribute("href",2):j=m.getAttribute(b):j=m.getAttribute(b);if(i&&i(j,c)||!i&&j)f[++g]=m}return f}function byPseudo(a,b,c){return Ext.DomQuery.pseudos[b](a,c)}function nodupIEXml(a){var b=++key,c;a[0].setAttribute("_nodup",b),c=[a[0]];for(var d=1,e=a.length;d<e;d++){var f=a[d];!f.getAttribute("_nodup")!=b&&(f.setAttribute("_nodup",b),c[c.length]=f)}for(var d=0,e=a.length;d<e;d++)a[d].removeAttribute("_nodup");return c}function nodup(a){if(!a)return[];var b=a.length,c,d,e=a,f,g=-1;if(!b||typeof a.nodeType!="undefined"||b==1)return a;if(isIE&&typeof a[0].selectSingleNode!="undefined")return nodupIEXml(a);var h=++key;a[0]._nodup=h;for(d=1;c=a[d];d++)if(c._nodup!=h)c._nodup=h;else{e=[];for(var i=0;i<d;i++)e[++g]=a[i];for(i=d+1;f=a[i];i++)f._nodup!=h&&(f._nodup=h,e[++g]=f);return e}return e}function quickDiffIEXml(a,b){var c=++key,d=[];for(var e=0,f=a.length;e<f;e++)a[e].setAttribute("_qdiff",c);for(var e=0,f=b.length;e<f;e++)b[e].getAttribute("_qdiff")!=c&&(d[d.length]=b[e]);for(var e=0,f=a.length;e<f;e++)a[e].removeAttribute("_qdiff");return d}function quickDiff(a,b){var c=a.length,d=++key,e=[];if(!c)return b;if(isIE&&typeof a[0].selectSingleNode!="undefined")return quickDiffIEXml(a,b);for(var f=0;f<c;f++)a[f]._qdiff=d;for(var f=0,g=b.length;f<g;f++)b[f]._qdiff!=d&&(e[e.length]=b[f]);return e}function quickId(a,b,c,d){if(a==c){var e=c.ownerDocument||c;return e.getElementById(d)}return a=getNodes(a,b,"*"),byId(a,d)}var cache={},simpleCache={},valueCache={},nonSpace=/\S/,trimRe=/^\s+|\s+$/g,tplRe=/\{(\d+)\}/g,modeRe=/^(\s?[\/>+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?!0:!1,key=30803;return eval("var batch = 30803;"),{getStyle:function(a,b){return Ext.fly(a).getStyle(b)},compile:function(path,type){type=type||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],mode,lastPath,matchers=Ext.DomQuery.matchers,matchersLn=matchers.length,modeMatch,lmode=path.match(modeRe);lmode&&lmode[1]&&(fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";',path=path.replace(lmode[1],""));while(path.substr(0,1)=="/")path=path.substr(1);while(path&&lastPath!=path){lastPath=path;var tokenMatch=path.match(tagTokenRe);type=="select"?tokenMatch?(tokenMatch[1]=="#"?fn[fn.length]='n = quickId(n, mode, root, "'+tokenMatch[2]+'");':fn[fn.length]='n = getNodes(n, mode, "'+tokenMatch[2]+'");',path=path.replace(tokenMatch[0],"")):path.substr(0,1)!="@"&&(fn[fn.length]='n = getNodes(n, mode, "*");'):tokenMatch&&(tokenMatch[1]=="#"?fn[fn.length]='n = byId(n, "'+tokenMatch[2]+'");':fn[fn.length]='n = byTag(n, "'+tokenMatch[2]+'");',path=path.replace(tokenMatch[0],""));while(!(modeMatch=path.match(modeRe))){var matched=!1;for(var j=0;j<matchersLn;j++){var t=matchers[j],m=path.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(a,b){return m[b]}),path=path.replace(m[0],""),matched=!0;break}}if(!matched)throw'Error parsing selector, parsing failed at "'+path+'"'}modeMatch[1]&&(fn[fn.length]='mode="'+modeMatch[1].replace(trimRe,"")+'";',path=path.replace(modeMatch[1],""))}return fn[fn.length]="return nodup(n);\n}",eval(fn.join("")),f},jsSelect:function(a,b,c){b=b||document,typeof b=="string"&&(b=document.getElementById(b));var d=a.split(","),e=[];for(var f=0,g=d.length;f<g;f++){var h=d[f].replace(trimRe,"");if(!cache[h]){cache[h]=Ext.DomQuery.compile(h);if(!cache[h])throw h+" is not a valid selector"}var i=cache[h](b);i&&i!=document&&(e=e.concat(i))}return d.length>1?nodup(e):e},isXml:function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1},select:document.querySelectorAll?function(a,b,c){b=b||document;if(!Ext.DomQuery.isXml(b))try{var d=b.querySelectorAll(a);return Ext.toArray(d)}catch(e){}return Ext.DomQuery.jsSelect.call(this,a,b,c)}:function(a,b,c){return Ext.DomQuery.jsSelect.call(this,a,b,c)},selectNode:function(a,b){return Ext.DomQuery.select(a,b)[0]},selectValue:function(a,b,c){a=a.replace(trimRe,""),valueCache[a]||(valueCache[a]=Ext.DomQuery.compile(a,"select"));var d=valueCache[a](b),e;return d=d[0]?d[0]:d,typeof d.normalize=="function"&&d.normalize(),e=d&&d.firstChild?d.firstChild.nodeValue:null,e===null||e===undefined||e===""?c:e},selectNumber:function(a,b,c){var d=Ext.DomQuery.selectValue(a,b,c||0);return parseFloat(d)},is:function(a,b){typeof a=="string"&&(a=document.getElementById(a));var c=Ext.isArray(a),d=Ext.DomQuery.filter(c?a:[a],b);return c?d.length==a.length:d.length>0},filter:function(a,b,c){b=b.replace(trimRe,""),simpleCache[b]||(simpleCache[b]=Ext.DomQuery.compile(b,"simple"));var d=simpleCache[b](a);return c?quickDiff(d,a):d},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,b){return a==b},"!=":function(a,b){return a!=b},"^=":function(a,b){return a&&a.substr(0,b.length)==b},"$=":function(a,b){return a&&a.substr(a.length-b.length)==b},"*=":function(a,b){return a&&a.indexOf(b)!==-1},"%=":function(a,b){return a%b==0},"|=":function(a,b){return a&&(a==b||a.substr(0,b.length+1)==b+"-")},"~=":function(a,b){return a&&(" "+a+" ").indexOf(" "+b+" ")!=-1}},pseudos:{"first-child":function(a){var b=[],c=-1,d;for(var e=0,f;f=d=a[e];e++){while((d=d.previousSibling)&&d.nodeType!=1);d||(b[++c]=f)}return b},"last-child":function(a){var b=[],c=-1,d;for(var e=0,f;f=d=a[e];e++){while((d=d.nextSibling)&&d.nodeType!=1);d||(b[++c]=f)}return b},"nth-child":function(a,b){var c=[],d=-1,e=nthRe.exec(b=="even"&&"2n"||b=="odd"&&"2n+1"||!nthRe2.test(b)&&"n+"+b||b),f=(e[1]||1)-0,g=e[2]-0;for(var h=0,i;i=a[h];h++){var j=i.parentNode;if(batch!=j._batch){var k=0;for(var l=j.firstChild;l;l=l.nextSibling)l.nodeType==1&&(l.nodeIndex=++k);j._batch=batch}if(f==1){if(g==0||i.nodeIndex==g)c[++d]=i}else(i.nodeIndex+g)%f==0&&(c[++d]=i)}return c},"only-child":function(a){var b=[],c=-1;for(var d=0,e;e=a[d];d++)!prev(e)&&!next(e)&&(b[++c]=e);return b},empty:function(a){var b=[],c=-1;for(var d=0,e;e=a[d];d++){var f=e.childNodes,g=0,h,i=!0;while(h=f[g]){++g;if(h.nodeType==1||h.nodeType==3){i=!1;break}}i&&(b[++c]=e)}return b},contains:function(a,b){var c=[],d=-1;for(var e=0,f;f=a[e];e++)(f.textContent||f.innerText||"").indexOf(b)!=-1&&(c[++d]=f);return c},nodeValue:function(a,b){var c=[],d=-1;for(var e=0,f;f=a[e];e++)f.firstChild&&f.firstChild.nodeValue==b&&(c[++d]=f);return c},checked:function(a){var b=[],c=-1;for(var d=0,e;e=a[d];d++)e.checked==!0&&(b[++c]=e);return b},not:function(a,b){return Ext.DomQuery.filter(a,b,!0)},any:function(a,b){var c=b.split("|"),d=[],e=-1,f;for(var g=0,h;h=a[g];g++)for(var i=0;f=c[i];i++)if(Ext.DomQuery.is(h,f)){d[++e]=h;break}return d},odd:function(a){return this["nth-child"](a,"odd")},even:function(a){return this["nth-child"](a,"even")},nth:function(a,b){return a[b-1]||[]},first:function(a){return a[0]||[]},last:function(a){return a[a.length-1]||[]},has:function(a,b){var c=Ext.DomQuery.select,d=[],e=-1;for(var f=0,g;g=a[f];f++)c(b,g).length>0&&(d[++e]=g);return d},next:function(a,b){var c=Ext.DomQuery.is,d=[],e=-1;for(var f=0,g;g=a[f];f++){var h=next(g);h&&c(h,b)&&(d[++e]=g)}return d},prev:function(a,b){var c=Ext.DomQuery.is,d=[],e=-1;for(var f=0,g;g=a[f];f++){var h=prev(g);h&&c(h,b)&&(d[++e]=g)}return d}}}}(),Ext.query=Ext.DomQuery.select,Ext.util.DelayedTask=function(a,b,c){var d=this,e,f=function(){clearInterval(e),e=null,a.apply(b,c||[])};d.delay=function(g,h,i,j){d.cancel(),a=h||a,b=i||b,c=j||c,e=setInterval(f,g)},d.cancel=function(){e&&(clearInterval(e),e=null)}},function(){function f(a,b,c){return function(){b.target==arguments[0]&&a.apply(c,Array.prototype.slice.call(arguments,0))}}function g(b,c,d,e){return d.task=new a.DelayedTask,function(){d.task.delay(c.buffer,b,e,Array.prototype.slice.call(arguments,0))}}function h(a,b,c,d){return function(){return b.removeListener(c,d),a.apply(d,arguments)}}function i(b,c,d,e){return function(){var f=new a.DelayedTask;d.tasks||(d.tasks=[]),d.tasks.push(f),f.delay(c.delay||10,b,e,Array.prototype.slice.call(arguments,0))}}var a=Ext.util,b=Ext.each,c=!0,d=!1;a.Observable=function(){var a=this,b=a.events;a.listeners&&(a.on(a.listeners),delete a.listeners),a.events=b||{}},a.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var a=Array.prototype.slice.call(arguments,0),b=a[0].toLowerCase(),e=this,f=c,g=e.events[b],h,i,j;if(e.eventsSuspended===c)(i=e.eventQueue)&&i.push(a);else if(typeof g=="object")if(g.bubble){if(g.fire.apply(g,a.slice(1))===d)return d;j=e.getBubbleTarget&&e.getBubbleTarget();if(j&&j.enableBubble)return h=j.events[b],(!h||typeof h!="object"||!h.bubble)&&j.enableBubble(b),j.fireEvent.apply(j,a)}else a.shift(),f=g.fire.apply(g,a);return f},addListener:function(b,d,e,f){var g=this,h,i,j,k;if(typeof b=="object"){f=b;for(h in f)i=f[h],g.filterOptRe.test(h)||g.addListener(h,i.fn||i,i.scope||f.scope,i.fn?i:f)}else b=b.toLowerCase(),k=g.events[b]||c,typeof k=="boolean"&&(g.events[b]=k=new a.Event(g,b)),k.addListener(d,e,typeof f=="object"?f:{})},removeListener:function(a,b,c){var d=this.events[a.toLowerCase()];typeof d=="object"&&d.removeListener(b,c)},purgeListeners:function(){var a=this.events,b,c;for(c in a)b=a[c],typeof b=="object"&&b.clearListeners()},addEvents:function(a){var b=this;b.events=b.events||{};if(typeof a=="string"){var d=arguments,e=d.length;while(e--)b.events[d[e]]=b.events[d[e]]||c}else Ext.applyIf(b.events,a)},hasListener:function(a){var b=this.events[a.toLowerCase()];return typeof b=="object"&&b.listeners.length>0},suspendEvents:function(a){this.eventsSuspended=c,a&&!this.eventQueue&&(this.eventQueue=[])},resumeEvents:function(){var a=this,c=a.eventQueue||[];a.eventsSuspended=d,delete a.eventQueue,b(c,function(b){a.fireEvent.apply(a,b)})}};var e=a.Observable.prototype;e.on=e.addListener,e.un=e.removeListener,a.Observable.releaseCapture=function(a){a.fireEvent=e.fireEvent},a.Event=function(a,b){this.name=b,this.obj=a,this.listeners=[]},a.Event.prototype={addListener:function(a,b,c){var d=this,e;b=b||d.obj,d.isListening(a,b)||(e=d.createListener(a,b,c),d.firing&&(d.listeners=d.listeners.slice(0)),d.listeners.push(e))},createListener:function(a,b,c){c=c||{},b=b||this.obj;var d={fn:a,scope:b,options:c},e=a;return c.target&&(e=f(e,c,b)),c.delay&&(e=i(e,c,d,b)),c.single&&(e=h(e,this,a,b)),c.buffer&&(e=g(e,c,d,b)),d.fireFn=e,d},findListener:function(a,b){var c=this.listeners,d=c.length,e;b=b||this.obj;while(d--){e=c[d];if(e&&e.fn==a&&e.scope==b)return d}return-1},isListening:function(a,b){return this.findListener(a,b)!=-1},removeListener:function(a,b){var e,f,g,h=this,i=d;if((e=h.findListener(a,b))!=-1){h.firing&&(h.listeners=h.listeners.slice(0)),f=h.listeners[e],f.task&&(f.task.cancel(),delete f.task),g=f.tasks&&f.tasks.length;if(g){while(g--)f.tasks[g].cancel();delete f.tasks}h.listeners.splice(e,1),i=c}return i},clearListeners:function(){var a=this,b=a.listeners,c=b.length;while(c--)a.removeListener(b[c].fn,b[c].scope)},fire:function(){var a=this,b=a.listeners,e=b.length,f=0,g;if(e>0){a.firing=c;var h=Array.prototype.slice.call(arguments,0);for(;f<e;f++){g=b[f];if(g&&g.fireFn.apply(g.scope||a.obj||window,h)===d)return a.firing=d}}return a.firing=d,c}}}(),Ext.apply(Ext.util.Observable.prototype,function(){function a(a){var b=(this.methodEvents=this.methodEvents||{})[a],c,d,e,f=this;if(!b){this.methodEvents[a]=b={},b.originalFn=this[a],b.methodName=a,b.before=[],b.after=[];var g=function(a,b,g){(d=a.apply(b||f,g))!==undefined&&(typeof d=="object"?(d.returnValue!==undefined?c=d.returnValue:c=d,e=!!d.cancel):d===!1?e=!0:c=d)};this[a]=function(){var a=Array.prototype.slice.call(arguments,0),h;c=d=undefined,e=!1;for(var i=0,j=b.before.length;i<j;i++){h=b.before[i],g(h.fn,h.scope,a);if(e)return c}(d=b.originalFn.apply(f,a))!==undefined&&(c=d);for(var i=0,j=b.after.length;i<j;i++){h=b.after[i],g(h.fn,h.scope,a);if(e)return c}return c}}return b}return{beforeMethod:function(b,c,d){a.call(this,b).before.push({fn:c,scope:d})},afterMethod:function(b,c,d){a.call(this,b).after.push({fn:c,scope:d})},removeMethodListener:function(a,b,c){var d=this.getMethodEvent(a);for(var e=0,f=d.before.length;e<f;e++)if(d.before[e].fn==b&&d.before[e].scope==c){d.before.splice(e,1);return}for(var e=0,f=d.after.length;e<f;e++)if(d.after[e].fn==b&&d.after[e].scope==c){d.after.splice(e,1);return}},relayEvents:function(a,b){function d(a){return function(){return c.fireEvent.apply(c,[a].concat(Array.prototype.slice.call(arguments,0)))}}var c=this;for(var e=0,f=b.length;e<f;e++){var g=b[e];c.events[g]=c.events[g]||!0,a.on(g,d(g),c)}},enableBubble:function(a){var b=this;if(!Ext.isEmpty(a)){a=Ext.isArray(a)?a:Array.prototype.slice.call(arguments,0);for(var c=0,d=a.length;c<d;c++){var e=a[c];e=e.toLowerCase();var f=b.events[e]||!0;typeof f=="boolean"&&(f=new Ext.util.Event(b,e),b.events[e]=f),f.bubble=!0}}}}}()),Ext.util.Observable.capture=function(a,b,c){a.fireEvent=a.fireEvent.createInterceptor(b,c)},Ext.util.Observable.observeClass=function(a,b){if(a)return a.fireEvent||(Ext.apply(a,new Ext.util.Observable),Ext.util.Observable.capture(a.prototype,a.fireEvent,a)),typeof b=="object"&&a.on(b),a},Ext.EventManager=function(){function m(a){var b=!1,c=0,d=l.length,b=!1,e=!1,f;if(a){if(a.getElementById||a.navigator){for(;c<d;++c){f=l[c];if(f.el===a){b=f.id;break}}b||(b=Ext.id(a),l.push({id:b,el:a}),e=!0)}else b=Ext.id(a);Ext.elCache[b]||(Ext.Element.addToCache(new Ext.Element(a),b),e&&(Ext.elCache[b].skipGC=!0))}return b}function n(a,b,c,d,f,i){a=Ext.getDom(a);var j=m(a),k=Ext.elCache[j].events,l;l=e.on(a,b,f),k[b]=k[b]||[],k[b].push([c,f,i,l,d]);if(a.addEventListener&&b=="mousewheel"){var n=["DOMMouseScroll",f,!1];a.addEventListener.apply(a,n),Ext.EventManager.addListener(h,"unload",function(){a.removeEventListener.apply(a,n)})}a==g&&b=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.addListener(f)}function o(){if(window!=top)return!1;try{g.documentElement.doScroll("left")}catch(a){return!1}return t(),!0}function p(a){return Ext.isIE&&o()?!0:g.readyState==j?(t(),!0):(c||(b=setTimeout(arguments.callee,2)),!1)}function r(a){return q||(q=Ext.query("style, link[rel=stylesheet]")),q.length==g.styleSheets.length?(t(),!0):(c||(b=setTimeout(arguments.callee,2)),!1)}function s(a){g.removeEventListener(i,arguments.callee,!1),r()}function t(f){c||(c=!0,b&&clearTimeout(b),d&&g.removeEventListener(i,t,!1),Ext.isIE&&p.bindIE&&g.detachEvent("onreadystatechange",p),e.un(h,"load",arguments.callee)),a&&!Ext.isReady&&(Ext.isReady=!0,a.fire(),a.listeners=[])}function u(){a||(a=new Ext.util.Event),d&&g.addEventListener(i,t,!1),Ext.isIE?p()||(p.bindIE=!0,g.attachEvent("onreadystatechange",p)):Ext.isOpera?g.readyState==j&&r()||g.addEventListener(i,s,!1):Ext.isWebKit&&p(),e.on(h,"load",t)}function v(a,b){return function(){var c=Ext.toArray(arguments);b.target==Ext.EventObject.setEvent(c[0]).target&&a.apply(this,c)}}function w(a,b,c){return function(d){c.delay(b.buffer,a,null,[new Ext.EventObjectImpl(d)])}}function x(a,b,c,d,e){return function(f){Ext.EventManager.removeListener(b,c,d,e),a(f)}}function y(a,b,c){return function(d){var e=new Ext.util.DelayedTask(a);c.tasks||(c.tasks=[]),c.tasks.push(e),e.delay(b.delay||10,a,null,[new Ext.EventObjectImpl(d)])}}function z(a,b,c,d,e){function i(a){if(!Ext)return;a=Ext.EventObject.setEvent(a);var b;if(f.delegate){if(!(b=a.getTarget(f.delegate,g)))return}else b=a.target;f.stopEvent&&a.stopEvent(),f.preventDefault&&a.preventDefault(),f.stopPropagation&&a.stopPropagation(),f.normalized&&(a=a.browserEvent),d.call(e||g,a,b,f)}var f=!c||typeof c=="boolean"?{}:c,g=Ext.getDom(a),h;d=d||f.fn,e=e||f.scope;if(!g)throw'Error listening for "'+b+'". Element "'+a+"\" doesn't exist.";return f.target&&(i=v(i,f)),f.delay&&(i=y(i,f,d)),f.single&&(i=x(i,g,b,d,e)),f.buffer&&(h=new Ext.util.DelayedTask(i),i=w(i,f,h)),n(g,b,d,h,i,e),i}var a,b,c=!1,d=Ext.isGecko||Ext.isWebKit||Ext.isSafari,e=Ext.lib.Event,f=Ext.lib.Dom,g=document,h=window,i="DOMContentLoaded",j="complete",k=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,l=[],q,A={addListener:function(a,b,c,d,e){if(typeof b=="object"){var f=b,g,h;for(g in f)h=f[g],k.test(g)||(Ext.isFunction(h)?z(a,g,f,h,f.scope):z(a,g,h))}else z(a,b,e,c,d)},removeListener:function(a,b,c,d){a=Ext.getDom(a);var f=m(a),h=a&&Ext.elCache[f].events[b]||[],i,j,k,l,n,o;for(j=0,n=h.length;j<n;j++)if(Ext.isArray(o=h[j])&&o[0]==c&&(!d||o[2]==d)){o[4]&&o[4].cancel(),l=c.tasks&&c.tasks.length;if(l){while(l--)c.tasks[l].cancel();delete c.tasks}i=o[1],e.un(a,b,e.extAdapter?o[3]:i),i&&a.addEventListener&&b=="mousewheel"&&a.removeEventListener("DOMMouseScroll",i,!1),i&&a==g&&b=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.removeListener(i),h.splice(j,1),h.length===0&&delete Ext.elCache[f].events[b];for(l in Ext.elCache[f].events)return!1;return Ext.elCache[f].events={},!1}},removeAll:function(a){a=Ext.getDom(a);var b=m(a),c=Ext.elCache[b]||{},d=c.events||{},f,h,i,j,k,l,n;for(j in d)if(d.hasOwnProperty(j)){f=d[j];for(h=0,i=f.length;h<i;h++){k=f[h],k[4]&&k[4].cancel();if(k[0].tasks&&(l=k[0].tasks.length)){while(l--)k[0].tasks[l].cancel();delete k.tasks}n=k[1],e.un(a,j,e.extAdapter?k[3]:n),a.addEventListener&&n&&j=="mousewheel"&&a.removeEventListener("DOMMouseScroll",n,!1),n&&a==g&&j=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.removeListener(n)}}Ext.elCache[b]&&(Ext.elCache[b].events={})},getListeners:function(a,b){a=Ext.getDom(a);var c=m(a),d=Ext.elCache[c]||{},e=d.events||{},f=[];return e&&e[b]?e[b]:null},purgeElement:function(a,b,c){a=Ext.getDom(a);var d=m(a),e=Ext.elCache[d]||{},f=e.events||{},g,h,i;if(c){if(f&&f.hasOwnProperty(c)){h=f[c];for(g=0,i=h.length;g<i;g++)Ext.EventManager.removeListener(a,c,h[g][0])}}else Ext.EventManager.removeAll(a);if(b&&a&&a.childNodes)for(g=0,i=a.childNodes.length;g<i;g++)Ext.EventManager.purgeElement(a.childNodes[g],b,c)},_unload:function(){var a;for(a in Ext.elCache)Ext.EventManager.removeAll(a);delete Ext.elCache,delete Ext.Element._flyweights;var b,c,d,e=Ext.lib.Ajax;typeof e.conn=="object"?c=e.conn:c={};for(d in c)b=c[d],b&&e.abort({conn:b,tId:d})},onDocumentReady:function(b,c,d){Ext.isReady?(a||(a=new Ext.util.Event),a.addListener(b,c,d),a.fire(),a.listeners=[]):(a||u(),d=d||{},d.delay=d.delay||1,a.addListener(b,c,d))},fireDocReady:t};return A.on=A.addListener,A.un=A.removeListener,A.stoppedMouseDownEvent=new Ext.util.Event,A}(),Ext.onReady=Ext.EventManager.onDocumentReady,function(){var a=function(){var a=document.body||document.getElementsByTagName("body")[0];if(!a)return!1;var b=[" ",Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":Ext.isIE7?"ext-ie7":"ext-ie8"):Ext.isGecko?"ext-gecko "+(Ext.isGecko2?"ext-gecko2":"ext-gecko3"):Ext.isOpera?"ext-opera":Ext.isWebKit?"ext-webkit":""];Ext.isSafari?b.push("ext-safari "+(Ext.isSafari2?"ext-safari2":Ext.isSafari3?"ext-safari3":"ext-safari4")):Ext.isChrome&&b.push("ext-chrome"),Ext.isMac&&b.push("ext-mac"),Ext.isLinux&&b.push("ext-linux");if(Ext.isStrict||Ext.isBorderBox){var c=a.parentNode;c&&(c.className+=Ext.isStrict?" ext-strict":" ext-border-box")}return a.className+=b.join(" "),!0};a()||Ext.onReady(a)}(),Ext.EventObject=function(){var a=Ext.lib.Event,b={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35},c=Ext.isIE?{1:0,4:1,2:2}:Ext.isWebKit?{1:0,2:1,3:2}:{0:0,1:1,2:2};return Ext.EventObjectImpl=function(a){a&&this.setEvent(a.browserEvent||a)},Ext.EventObjectImpl.prototype={setEvent:function(b){var d=this;return b==d||b&&b.browserEvent?b:(d.browserEvent=b,b?(d.button=b.button?c[b.button]:b.which?b.which-1:-1,b.type=="click"&&d.button==-1&&(d.button=0),d.type=b.type,d.shiftKey=b.shiftKey,d.ctrlKey=b.ctrlKey||b.metaKey||!1,d.altKey=b.altKey,d.keyCode=b.keyCode,d.charCode=b.charCode,d.target=a.getTarget(b),d.xy=a.getXY(b)):(d.button=-1,d.shiftKey=!1,d.ctrlKey=!1,d.altKey=!1,d.keyCode=0,d.charCode=0,d.target=null,d.xy=[0,0]),d)},stopEvent:function(){var b=this;b.browserEvent&&(b.browserEvent.type=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.fire(b),a.stopEvent(b.browserEvent))},preventDefault:function(){this.browserEvent&&a.preventDefault(this.browserEvent)},stopPropagation:function(){var b=this;b.browserEvent&&(b.browserEvent.type=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.fire(b),a.stopPropagation(b.browserEvent))},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){return this.normalizeKey(this.keyCode||this.charCode)},normalizeKey:function(a){return Ext.isSafari?b[a]||a:a},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},getTarget:function(a,b,c){return a?Ext.fly(this.target).findParent(a,b,c):c?Ext.get(this.target):this.target},getRelatedTarget:function(){return this.browserEvent?a.getRelatedTarget(this.browserEvent):null},getWheelDelta:function(){var a=this.browserEvent,b=0;return a.wheelDelta?b=a.wheelDelta/120:a.detail&&(b=-a.detail/3),b},within:function(a,b,c){if(a){var d=this[b?"getRelatedTarget":"getTarget"]();return d&&((c?d==Ext.getDom(a):!1)||Ext.fly(a).contains(d))}return!1}},new Ext.EventObjectImpl}(),Ext.apply(Ext.EventManager,function(){var a,b,c,d,e=Ext.lib.Dom,f=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,g=0,h=0,i=Ext.isWebKit?Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1])>=525:!(Ext.isGecko&&!Ext.isWindows||Ext.isOpera);return{doResizeEvent:function(){var b=e.getViewHeight(),c=e.getViewWidth();(h!=b||g!=c)&&a.fire(g=c,h=b)},onWindowResize:function(c,d,e){a||(a=new Ext.util.Event,b=new Ext.util.DelayedTask(this.doResizeEvent),Ext.EventManager.on(window,"resize",this.fireWindowResize,this)),a.addListener(c,d,e)},fireWindowResize:function(){a&&b.delay(100)},onTextResize:function(a,b,e){if(!c){c=new Ext.util.Event;var f=new Ext.Element(document.createElement("div"));f.dom.className="x-text-resize",f.dom.innerHTML="X",f.appendTo(document.body),d=f.dom.offsetHeight,setInterval(function(){f.dom.offsetHeight!=d&&c.fire(d,d=f.dom.offsetHeight)},this.textResizeInterval)}c.addListener(a,b,e)},removeResizeListener:function(b,c){a&&a.removeListener(b,c)},fireResize:function(){a&&a.fire(e.getViewWidth(),e.getViewHeight())},textResizeInterval:50,ieDeferSrc:!1,useKeydown:i}}()),Ext.EventManager.on=Ext.EventManager.addListener,Ext.apply(Ext.EventObjectImpl.prototype,{BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,isNavKeyPress:function(){var a=this,b=this.normalizeKey(a.keyCode);return b>=33&&b<=40||b==a.RETURN||b==a.TAB||b==a.ESC},isSpecialKey:function(){var a=this.normalizeKey(this.keyCode);return this.type=="keypress"&&this.ctrlKey||this.isNavKeyPress()||a==this.BACKSPACE||a>=16&&a<=20||a>=44&&a<=46},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])},hasModifier:function(){return this.ctrlKey||this.altKey||this.shiftKey}}),function(){function k(){if(!Ext.enableGarbageCollector)clearInterval(f.collectorThreadId);else{var b,c,d,e;for(b in g){e=g[b];if(e.skipGC)continue;c=e.el,d=c.dom;if(!d||!d.parentNode||!d.offsetParent&&!a.getElementById(b))Ext.enableListenerCollection&&Ext.EventManager.removeAll(d),delete g[b]}if(Ext.isIE){var h={};for(b in g)h[b]=g[b];g=Ext.elCache=h}}}var a=document;Ext.Element=function(b,c){var d=typeof b=="string"?a.getElementById(b):b,e;if(!d)return null;e=d.id;if(!c&&e&&Ext.elCache[e])return Ext.elCache[e].el;this.dom=d,this.id=e||Ext.id(d)};var b=Ext.lib.Dom,c=Ext.DomHelper,d=Ext.lib.Event,e=Ext.lib.Anim,f=Ext.Element,g=Ext.elCache;f.prototype={set:function(a,b){var d=this.dom,e,f,b=b!==!1&&!!d.setAttribute;for(e in a)a.hasOwnProperty(e)&&(f=a[e],e=="style"?c.applyStyles(d,f):e=="cls"?d.className=f:b?d.setAttribute(e,f):d[e]=f);return this},defaultUnit:"px",is:function(a){return Ext.DomQuery.is(this.dom,a)},focus:function(a,b){var c=this,b=b||c.dom;try{Number(a)?c.focus.defer(a,null,[null,b]):b.focus()}catch(d){}return c},blur:function(){try{this.dom.blur()}catch(a){}return this},getValue:function(a){var b=this.dom.value;return a?parseInt(b,10):b},addListener:function(a,b,c,d){return Ext.EventManager.on(this.dom,a,b,c||this,d),this},removeListener:function(a,b,c){return Ext.EventManager.removeListener(this.dom,a,b,c||this),this},removeAllListeners:function(){return Ext.EventManager.removeAll(this.dom),this},purgeAllListeners:function(){return Ext.EventManager.purgeElement(this,!0),this},addUnits:function(a){if(a===""||a=="auto"||a===undefined)a=a||"";else if(!isNaN(a)||!i.test(a))a=a+(this.defaultUnit||"px");return a},load:function(a,b,c){return Ext.Ajax.request(Ext.apply({params:b,url:a.url||a,callback:c,el:this.dom,indicatorText:a.indicatorText||""},Ext.isObject(a)?a:{})),this},isBorderBox:function(){return m[(this.dom.tagName||"").toLowerCase()]||Ext.isBorderBox},remove:function(){var a=this,b=a.dom;b&&(delete a.dom,Ext.removeNode(b))},hover:function(a,b,c,d){var e=this;return e.on("mouseenter",a,c||e.dom,d),e.on("mouseleave",b,c||e.dom,d),e},contains:function(a){return a?Ext.lib.Dom.isAncestor(this.dom,a.dom?a.dom:a):!1},getAttributeNS:function(a,b){return this.getAttribute(b,a)},getAttribute:Ext.isIE?function(a,b){var c=this.dom,d=typeof c[b+":"+a];return["undefined","unknown"].indexOf(d)==-1?c[b+":"+a]:c[a]}:function(a,b){var c=this.dom;return c.getAttributeNS(b,a)||c.getAttribute(b+":"+a)||c.getAttribute(a)||c[a]},update:function(a){return this.dom&&(this.dom.innerHTML=a),this}};var h=f.prototype;f.addMethods=function(a){Ext.apply(h,a)},h.on=h.addListener,h.un=h.removeListener,h.autoBoxAdjust=!0;var i=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,j;f.get=function(b){var c,d,e;if(!b)return null;if(typeof b=="string")return(d=a.getElementById(b))?(g[b]&&g[b].el?(c=g[b].el,c.dom=d):c=f.addToCache(new f(d)),c):null;if(b.tagName)return(e=b.id)||(e=Ext.id(b)),g[e]&&g[e].el?(c=g[e].el,c.dom=b):c=f.addToCache(new f(b)),c;if(b instanceof f)return b!=j&&(!Ext.isIE||b.id!=undefined&&b.id!=""?b.dom=a.getElementById(b.id)||b.dom:b.dom=b.dom),b;if(b.isComposite)return b;if(Ext.isArray(b))return f.select(b);if(b==a){if(!j){var h=function(){};h.prototype=f.prototype,j=new h,j.dom=a}return j}return null},f.addToCache=function(a,b){return b=b||a.id,g[b]={el:a,data:{},events:{}},a},f.data=function(a,b,c){a=f.get(a);if(!a)return null;var d=g[a.id].data;return arguments.length==2?d[b]:d[b]=c},f.collectorThreadId=setInterval(k,3e4);var l=function(){};l.prototype=f.prototype,f.Flyweight=function(a){this.dom=a},f.Flyweight.prototype=new l,f.Flyweight.prototype.isFlyweight=!0,f._flyweights={},f.fly=function(a,b){var c=null;b=b||"_global";if(a=Ext.getDom(a))(f._flyweights[b]=f._flyweights[b]||new f.Flyweight).dom=a,c=f._flyweights[b];return c},Ext.get=f.get,Ext.fly=f.fly;var m=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko)m.button=1}(),Ext.Element.addMethods({swallowEvent:function(a,b){function d(a){a.stopPropagation(),b&&a.preventDefault()}var c=this;return Ext.isArray(a)?(Ext.each(a,function(a){c.on(a,d)}),c):(c.on(a,d),c)},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(a){var b=this,c=b.dom,d=c.firstChild,e=-1;if(Ext.Element.data(c,"isCleaned")&&a!==!0)return b;while(d){var f=d.nextSibling;d.nodeType==3&&!/\S/.test(d.nodeValue)?c.removeChild(d):d.nodeIndex=++e,d=f}return Ext.Element.data(c,"isCleaned",!0),b},load:function(){var a=this.getUpdater();return a.update.apply(a,arguments),this},getUpdater:function(){return this.updateManager||(this.updateManager=new Ext.Updater(this))},update:function(a,b,c){if(!this.dom)return this;a=a||"";if(b!==!0)return this.dom.innerHTML=a,typeof c=="function"&&c(),this;var d=Ext.id(),e=this.dom;return a+='<span id="'+d+'"></span>',Ext.lib.Event.onAvailable(d,function(){var b=document,e=b.getElementsByTagName("head")[0],f=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,g=/\ssrc=([\'\"])(.*?)\1/i,h=/\stype=([\'\"])(.*?)\1/i,i,j,k,l,m,n;while(i=f.exec(a))j=i[1],k=j?j.match(g):!1,k&&k[2]?(n=b.createElement("script"),n.src=k[2],l=j.match(h),l&&l[2]&&(n.type=l[2]),e.appendChild(n)):i[2]&&i[2].length>0&&(window.execScript?window.execScript(i[2]):window.eval(i[2]));m=b.getElementById(d),m&&Ext.removeNode(m),typeof c=="function"&&c()}),e.innerHTML=a.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,""),this},removeAllListeners:function(){return this.removeAnchor(),Ext.EventManager.removeAll(this.dom),this},createProxy:function(a,b,c){a=typeof a=="object"?a:{tag:"div",cls:a};var d=this,e=b?Ext.DomHelper.append(b,a,!0):Ext.DomHelper.insertBefore(d.dom,a,!0);return c&&d.setBox&&d.getBox&&e.setBox(d.getBox()),e}}),Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater,Ext.Element.addMethods({getAnchorXY:function(a,b,c){a=(a||"tl").toLowerCase(),c=c||{};var d=this,e=d.dom==document.body||d.dom==document,f=c.width||e?Ext.lib.Dom.getViewWidth():d.getWidth(),g=c.height||e?Ext.lib.Dom.getViewHeight():d.getHeight(),h,i=Math.round,j=d.getXY(),k=d.getScroll(),l=e?k.left:b?0:j[0],m=e?k.top:b?0:j[1],n={c:[i(f*.5),i(g*.5)],t:[i(f*.5),0],l:[0,i(g*.5)],r:[f,i(g*.5)],b:[i(f*.5),g],tl:[0,0],bl:[0,g],br:[f,g],tr:[f,0]};return h=n[a],[h[0]+l,h[1]+m]},anchorTo:function(a,b,c,d,e,f){var g=this,h=g.dom,i=!Ext.isEmpty(e),j=function(){Ext.fly(h).alignTo(a,b,c,d),Ext.callback(f,Ext.fly(h))},k=this.getAnchor();return this.removeAnchor(),Ext.apply(k,{fn:j,scroll:i}),Ext.EventManager.onWindowResize(j,null),i&&Ext.EventManager.on(window,"scroll",j,null,{buffer:isNaN(e)?50:e}),j.call(g),g},removeAnchor:function(){var a=this,b=this.getAnchor();return b&&b.fn&&(Ext.EventManager.removeResizeListener(b.fn),b.scroll&&Ext.EventManager.un(window,"scroll",b.fn),delete b.fn),a},getAnchor:function(){var a=Ext.Element.data,b=this.dom;if(!b)return;var c=a(b,"_anchor");return c||(c=a(b,"_anchor",{})),c},getAlignToXY:function(a,b,c){a=Ext.get(a);if(!a||!a.dom)throw"Element.alignToXY with an element that doesn't exist";c=c||[0,0],b=(!b||b=="?"?"tl-bl?":!/-/.test(b)&&b!==""?"tl-"+b:b||"tl-bl"
).toLowerCase();var d=this,e=d.dom,f,g,h,i,j,k,l,m=Ext.lib.Dom.getViewWidth()-10,n=Ext.lib.Dom.getViewHeight()-10,o,p,q,r,s,t,u=document,v=u.documentElement,w=u.body,x=(v.scrollLeft||w.scrollLeft||0)+5,y=(v.scrollTop||w.scrollTop||0)+5,z=!1,A="",B="",C=b.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!C)throw"Element.alignTo with an invalid alignment "+b;return A=C[1],B=C[2],z=!!C[3],f=d.getAnchorXY(A,!0),g=a.getAnchorXY(B,!1),h=g[0]-f[0]+c[0],i=g[1]-f[1]+c[1],z&&(j=d.getWidth(),k=d.getHeight(),l=a.getRegion(),o=A.charAt(0),p=A.charAt(A.length-1),q=B.charAt(0),r=B.charAt(B.length-1),s=o=="t"&&q=="b"||o=="b"&&q=="t",t=p=="r"&&r=="l"||p=="l"&&r=="r",h+j>m+x&&(h=t?l.left-j:m+x-j),h<x&&(h=t?l.right:x),i+k>n+y&&(i=s?l.top-k:n+y-k),i<y&&(i=s?l.bottom:y)),[h,i]},alignTo:function(a,b,c,d){var e=this;return e.setXY(e.getAlignToXY(a,b,c),e.preanim&&!!d?e.preanim(arguments,3):!1)},adjustForConstraints:function(a,b,c){return this.getConstrainToXY(b||document,!1,c,a)||a},getConstrainToXY:function(a,b,c,d){var e={top:0,left:0,bottom:0,right:0};return function(a,b,c,d){a=Ext.get(a),c=c?Ext.applyIf(c,e):e;var f,g,h=0,i=0;if(a.dom==document.body||a.dom==document)f=Ext.lib.Dom.getViewWidth(),g=Ext.lib.Dom.getViewHeight();else{f=a.dom.clientWidth,g=a.dom.clientHeight;if(!b){var j=a.getXY();h=j[0],i=j[1]}}var k=a.getScroll();h+=c.left+k.left,i+=c.top+k.top,f-=c.right,g-=c.bottom;var l=h+f,m=i+g,n=d||(b?[this.getLeft(!0),this.getTop(!0)]:this.getXY()),o=n[0],p=n[1],q=this.dom.offsetWidth,r=this.dom.offsetHeight,s=!1;return o+q>l&&(o=l-q,s=!0),p+r>m&&(p=m-r,s=!0),o<h&&(o=h,s=!0),p<i&&(p=i,s=!0),s?[o,p]:!1}}(),getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(a){return this.alignTo(a||document,"c-c")}}),Ext.Element.addMethods(function(){var a="parentNode",b="nextSibling",c="previousSibling",d=Ext.DomQuery,e=Ext.get;return{findParent:function(a,b,c){var f=this.dom,g=document.body,h=0,i;if(Ext.isGecko&&Object.prototype.toString.call(f)=="[object XULElement]")return null;b=b||50,isNaN(b)&&(i=Ext.getDom(b),b=Number.MAX_VALUE);while(f&&f.nodeType==1&&h<b&&f!=g&&f!=i){if(d.is(f,a))return c?e(f):f;h++,f=f.parentNode}return null},findParentNode:function(a,b,c){var d=Ext.fly(this.dom.parentNode,"_internal");return d?d.findParent(a,b,c):null},up:function(a,b){return this.findParentNode(a,b,!0)},select:function(a){return Ext.Element.select(a,this.dom)},query:function(a){return d.select(a,this.dom)},child:function(a,b){var c=d.selectNode(a,this.dom);return b?c:e(c)},down:function(a,b){var c=d.selectNode(" > "+a,this.dom);return b?c:e(c)},parent:function(b,c){return this.matchNode(a,a,b,c)},next:function(a,c){return this.matchNode(b,b,a,c)},prev:function(a,b){return this.matchNode(c,c,a,b)},first:function(a,c){return this.matchNode(b,"firstChild",a,c)},last:function(a,b){return this.matchNode(c,"lastChild",a,b)},matchNode:function(a,b,c,f){var g=this.dom[b];while(g){if(g.nodeType==1&&(!c||d.is(g,c)))return f?g:e(g);g=g[a]}return null}}}()),Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}}),Ext.Element.addMethods(function(){var a=Ext.getDom,b=Ext.get,c=Ext.DomHelper;return{appendChild:function(a){return b(a).appendTo(this)},appendTo:function(b){return a(b).appendChild(this.dom),this},insertBefore:function(b){return(b=a(b)).parentNode.insertBefore(this.dom,b),this},insertAfter:function(b){return(b=a(b)).parentNode.insertBefore(this.dom,b.nextSibling),this},insertFirst:function(c,d){return c=c||{},c.nodeType||c.dom||typeof c=="string"?(c=a(c),this.dom.insertBefore(c,this.dom.firstChild),d?c:b(c)):this.createChild(c,this.dom.firstChild,d)},replace:function(a){return a=b(a),this.insertBefore(a),a.remove(),this},replaceWith:function(b){var d=this;return b.nodeType||b.dom||typeof b=="string"?(b=a(b),d.dom.parentNode.insertBefore(b,d.dom)):b=c.insertBefore(d.dom,b),delete Ext.elCache[d.id],Ext.removeNode(d.dom),d.id=Ext.id(d.dom=b),Ext.Element.addToCache(d.isFlyweight?new Ext.Element(d.dom):d),d},createChild:function(a,b,d){return a=a||{tag:"div"},b?c.insertBefore(b,a,d!==!0):c[this.dom.firstChild?"append":"overwrite"](this.dom,a,d!==!0)},wrap:function(a,b){var d=c.insertBefore(this.dom,a||{tag:"div"},!b);return d.dom?d.dom.appendChild(this.dom):d.appendChild(this.dom),d},insertHtml:function(a,b,d){var e=c.insertHtml(a,this.dom,b);return d?Ext.get(e):e}}}()),Ext.apply(Ext.Element.prototype,function(){var a=Ext.getDom,b=Ext.get,c=Ext.DomHelper;return{insertSibling:function(d,e,f){var g=this,h,i=(e||"before").toLowerCase()=="after",j;return Ext.isArray(d)?(j=g,Ext.each(d,function(a){h=Ext.fly(j,"_internal").insertSibling(a,e,f),i&&(j=h)}),h):(d=d||{},d.nodeType||d.dom?(h=g.dom.parentNode.insertBefore(a(d),i?g.dom.nextSibling:g.dom),f||(h=b(h))):i&&!g.dom.nextSibling?h=c.append(g.dom.parentNode,d,!f):h=c[i?"insertAfter":"insertBefore"](g.dom,d,!f),h)}}}()),Ext.Element.addMethods(function(){function D(a,b){return b.charAt(1).toUpperCase()}function E(c){return a[c]||(a[c]=c=="float"?e:c.replace(b,D))}var a={},b=/(-[a-z])/gi,c={},d=document.defaultView,e=Ext.isIE?"styleFloat":"cssFloat",f=/alpha\(opacity=(.*)\)/i,g=/^\s+|\s+$/g,h=/\s+/,i=/\w/g,j=Ext.Element,k="padding",l="margin",m="border",n="-left",o="-right",p="-top",q="-bottom",r="-width",s=Math,t="hidden",u="isClipped",v="overflow",w="overflow-x",x="overflow-y",y="originalClip",z={l:m+n+r,r:m+o+r,t:m+p+r,b:m+q+r},A={l:k+n,r:k+o,t:k+p,b:k+q},B={l:l+n,r:l+o,t:l+p,b:l+q},C=Ext.Element.data;return{adjustWidth:function(a){var b=this,c=typeof a=="number";return c&&b.autoBoxAdjust&&!b.isBorderBox()&&(a-=b.getBorderWidth("lr")+b.getPadding("lr")),c&&a<0?0:a},adjustHeight:function(a){var b=this,c=typeof a=="number";return c&&b.autoBoxAdjust&&!b.isBorderBox()&&(a-=b.getBorderWidth("tb")+b.getPadding("tb")),c&&a<0?0:a},addClass:function(a){var b=this,c,d,e,f=[];if(!Ext.isArray(a))typeof a=="string"&&!this.hasClass(a)&&(b.dom.className+=" "+a);else{for(c=0,d=a.length;c<d;c++)e=a[c],typeof e=="string"&&(" "+b.dom.className+" ").indexOf(" "+e+" ")==-1&&f.push(e);f.length&&(b.dom.className+=" "+f.join(" "))}return b},removeClass:function(a){var b=this,c,d,e,f,i;Ext.isArray(a)||(a=[a]);if(b.dom&&b.dom.className){i=b.dom.className.replace(g,"").split(h);for(c=0,e=a.length;c<e;c++)f=a[c],typeof f=="string"&&(f=f.replace(g,""),d=i.indexOf(f),d!=-1&&i.splice(d,1));b.dom.className=i.join(" ")}return b},radioClass:function(a){var b=this.dom.parentNode.childNodes,c,d,e;a=Ext.isArray(a)?a:[a];for(d=0,e=b.length;d<e;d++)c=b[d],c&&c.nodeType==1&&Ext.fly(c,"_internal").removeClass(a);return this.addClass(a)},toggleClass:function(a){return this.hasClass(a)?this.removeClass(a):this.addClass(a)},hasClass:function(a){return a&&(" "+this.dom.className+" ").indexOf(" "+a+" ")!=-1},replaceClass:function(a,b){return this.removeClass(a).addClass(b)},isStyle:function(a,b){return this.getStyle(a)==b},getStyle:function(){return d&&d.getComputedStyle?function(a){var b=this.dom,c,e,f,g,h=Ext.isWebKit,g;return b==document?null:(a=E(a),h&&/marginRight/.test(a)&&(g=this.getStyle("display"),b.style.display="inline-block"),f=(c=b.style[a])?c:(e=d.getComputedStyle(b,""))?e[a]:null,h&&(f=="rgba(0, 0, 0, 0)"?f="transparent":g&&(b.style.display=g)),f)}:function(a){var b=this.dom,c,d;if(b==document)return null;if(a=="opacity"){if(b.style.filter.match)if(c=b.style.filter.match(f)){var e=parseFloat(c[1]);if(!isNaN(e))return e?e/100:0}return 1}return a=E(a),b.style[a]||((d=b.currentStyle)?d[a]:null)}}(),getColor:function(a,b,c){var d=this.getStyle(a),e=typeof c!="undefined"?c:"#",f;return!d||/transparent|inherit/.test(d)?b:(/^r/.test(d)?Ext.each(d.slice(4,d.length-1).split(","),function(a){f=parseInt(a,10),e+=(f<16?"0":"")+f.toString(16)}):(d=d.replace("#",""),e+=d.length==3?d.replace(/^(\w)(\w)(\w)$/,"$1$1$2$2$3$3"):d),e.length>5?e.toLowerCase():b)},setStyle:function(a,b){var c,d,e;typeof a!="object"&&(c={},c[a]=b,a=c);for(d in a)b=a[d],d=="opacity"?this.setOpacity(b):this.dom.style[E(d)]=b;return this},setOpacity:function(a,b){var c=this,d=c.dom.style;if(!b||!c.anim)if(Ext.isIE){var e=a<1?"alpha(opacity="+a*100+")":"",h=d.filter.replace(f,"").replace(g,"");d.zoom=1,d.filter=h+(h.length>0?" ":"")+e}else d.opacity=a;else c.anim({opacity:{to:a}},c.preanim(arguments,1),null,.35,"easeIn");return c},clearOpacity:function(){var a=this.dom.style;return Ext.isIE?Ext.isEmpty(a.filter)||(a.filter=a.filter.replace(f,"").replace(g,"")):a.opacity=a["-moz-opacity"]=a["-khtml-opacity"]="",this},getHeight:function(a){var b=this,c=b.dom,d=Ext.isIE&&b.isStyle("display","none"),e=s.max(c.offsetHeight,d?0:c.clientHeight)||0;return e=a?e-b.getBorderWidth("tb")-b.getPadding("tb"):e,e<0?0:e},getWidth:function(a){var b=this,c=b.dom,d=Ext.isIE&&b.isStyle("display","none"),e=s.max(c.offsetWidth,d?0:c.clientWidth)||0;return e=a?e-b.getBorderWidth("lr")-b.getPadding("lr"):e,e<0?0:e},setWidth:function(a,b){var c=this;return a=c.adjustWidth(a),!b||!c.anim?c.dom.style.width=c.addUnits(a):c.anim({width:{to:a}},c.preanim(arguments,1)),c},setHeight:function(a,b){var c=this;return a=c.adjustHeight(a),!b||!c.anim?c.dom.style.height=c.addUnits(a):c.anim({height:{to:a}},c.preanim(arguments,1)),c},getBorderWidth:function(a){return this.addStyles(a,z)},getPadding:function(a){return this.addStyles(a,A)},clip:function(){var a=this,b=a.dom;return C(b,u)||(C(b,u,!0),C(b,y,{o:a.getStyle(v),x:a.getStyle(w),y:a.getStyle(x)}),a.setStyle(v,t),a.setStyle(w,t),a.setStyle(x,t)),a},unclip:function(){var a=this,b=a.dom;if(C(b,u)){C(b,u,!1);var c=C(b,y);c.o&&a.setStyle(v,c.o),c.x&&a.setStyle(w,c.x),c.y&&a.setStyle(x,c.y)}return a},addStyles:function(a,b){var c=0,d=a.match(i),e,f,g,h=d.length;for(g=0;g<h;g++)e=d[g],f=e&&parseInt(this.getStyle(b[e]),10),f&&(c+=s.abs(f));return c},margins:B}}()),Ext.Element.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>',Ext.Element.addMethods(function(){var a="_internal",b=/(\d+\.?\d+)px/;return{applyStyles:function(a){return Ext.DomHelper.applyStyles(this.dom,a),this},getStyles:function(){var a={};return Ext.each(arguments,function(b){a[b]=this.getStyle(b)},this),a},setOverflow:function(a){var b=this.dom;a=="auto"&&Ext.isMac&&Ext.isGecko2?(b.style.overflow="hidden",function(){b.style.overflow="auto"}.defer(1)):b.style.overflow=a},boxWrap:function(a){a=a||"x-box";var b=Ext.get(this.insertHtml("beforeBegin","<div class='"+a+"'>"+String.format(Ext.Element.boxMarkup,a)+"</div>"));return Ext.DomQuery.selectNode("."+a+"-mc",b.dom).appendChild(this.dom),b},setSize:function(a,b,c){var d=this;return typeof a=="object"&&(b=a.height,a=a.width),a=d.adjustWidth(a),b=d.adjustHeight(b),!c||!d.anim?(d.dom.style.width=d.addUnits(a),d.dom.style.height=d.addUnits(b)):d.anim({width:{to:a},height:{to:b}},d.preanim(arguments,2)),d},getComputedHeight:function(){var a=this,b=Math.max(a.dom.offsetHeight,a.dom.clientHeight);return b||(b=parseFloat(a.getStyle("height"))||0,a.isBorderBox()||(b+=a.getFrameWidth("tb"))),b},getComputedWidth:function(){var a=Math.max(this.dom.offsetWidth,this.dom.clientWidth);return a||(a=parseFloat(this.getStyle("width"))||0,this.isBorderBox()||(a+=this.getFrameWidth("lr"))),a},getFrameWidth:function(a,b){return b&&this.isBorderBox()?0:this.getPadding(a)+this.getBorderWidth(a)},addClassOnOver:function(b){return this.hover(function(){Ext.fly(this,a).addClass(b)},function(){Ext.fly(this,a).removeClass(b)}),this},addClassOnFocus:function(b){return this.on("focus",function(){Ext.fly(this,a).addClass(b)},this.dom),this.on("blur",function(){Ext.fly(this,a).removeClass(b)},this.dom),this},addClassOnClick:function(b){var c=this.dom;return this.on("mousedown",function(){Ext.fly(c,a).addClass(b);var d=Ext.getDoc(),e=function(){Ext.fly(c,a).removeClass(b),d.removeListener("mouseup",e)};d.on("mouseup",e)}),this},getViewSize:function(){var a=document,b=this.dom,c=b==a||b==a.body;if(c){var d=Ext.lib.Dom;return{width:d.getViewWidth(),height:d.getViewHeight()}}return{width:b.clientWidth,height:b.clientHeight}},getStyleSize:function(){var a=this,b,c,d=document,e=this.dom,f=e==d||e==d.body,g=e.style;if(f){var h=Ext.lib.Dom;return{width:h.getViewWidth(),height:h.getViewHeight()}}return g.width&&g.width!="auto"&&(b=parseFloat(g.width),a.isBorderBox()&&(b-=a.getFrameWidth("lr"))),g.height&&g.height!="auto"&&(c=parseFloat(g.height),a.isBorderBox()&&(c-=a.getFrameWidth("tb"))),{width:b||a.getWidth(!0),height:c||a.getHeight(!0)}},getSize:function(a){return{width:this.getWidth(a),height:this.getHeight(a)}},repaint:function(){var a=this.dom;return this.addClass("x-repaint"),setTimeout(function(){Ext.fly(a).removeClass("x-repaint")},1),this},unselectable:function(){return this.dom.unselectable="on",this.swallowEvent("selectstart",!0).applyStyles("-moz-user-select:none;-khtml-user-select:none;").addClass("x-unselectable")},getMargins:function(a){var b=this,c,d={t:"top",l:"left",r:"right",b:"bottom"},e={};if(!a){for(c in b.margins)e[d[c]]=parseFloat(b.getStyle(b.margins[c]))||0;return e}return b.addStyles.call(b,a,b.margins)}}}()),function(){var a=Ext.lib.Dom,b="left",c="right",d="top",e="bottom",f="position",g="static",h="relative",i="auto",j="z-index";Ext.Element.addMethods({getX:function(){return a.getX(this.dom)},getY:function(){return a.getY(this.dom)},getXY:function(){return a.getXY(this.dom)},getOffsetsTo:function(a){var b=this.getXY(),c=Ext.fly(a,"_internal").getXY();return[b[0]-c[0],b[1]-c[1]]},setX:function(a,b){return this.setXY([a,this.getY()],this.animTest(arguments,b,1))},setY:function(a,b){return this.setXY([this.getX(),a],this.animTest(arguments,b,1))},setLeft:function(a){return this.setStyle(b,this.addUnits(a)),this},setTop:function(a){return this.setStyle(d,this.addUnits(a)),this},setRight:function(a){return this.setStyle(c,this.addUnits(a)),this},setBottom:function(a){return this.setStyle(e,this.addUnits(a)),this},setXY:function(b,c){var d=this;return!c||!d.anim?a.setXY(d.dom,b):d.anim({points:{to:b}},d.preanim(arguments,1),"motion"),d},setLocation:function(a,b,c){return this.setXY([a,b],this.animTest(arguments,c,2))},moveTo:function(a,b,c){return this.setXY([a,b],this.animTest(arguments,c,2))},getLeft:function(a){return a?parseInt(this.getStyle(b),10)||0:this.getX()},getRight:function(a){var b=this;return a?b.getLeft(!0)+b.getWidth()||0:b.getX()+b.getWidth()},getTop:function(a){return a?parseInt(this.getStyle(d),10)||0:this.getY()},getBottom:function(a){var b=this;return a?b.getTop(!0)+b.getHeight()||0:b.getY()+b.getHeight()},position:function(a,b,c,d){var e=this;!a&&e.isStyle(f,g)?e.setStyle(f,h):a&&e.setStyle(f,a),b&&e.setStyle(j,b),(c||d)&&e.setXY([c||!1,d||!1])},clearPositioning:function(a){return a=a||"",this.setStyle({left:a,right:a,top:a,bottom:a,"z-index":"",position:g}),this},getPositioning:function(){var a=this.getStyle(b),g=this.getStyle(d);return{position:this.getStyle(f),left:a,right:a?"":this.getStyle(c),top:g,bottom:g?"":this.getStyle(e),"z-index":this.getStyle(j)}},setPositioning:function(a){var b=this,c=b.dom.style;return b.setStyle(a),a.right==i&&(c.right=""),a.bottom==i&&(c.bottom=""),b},translatePoints:function(a,c){c=isNaN(a[1])?c:a[1],a=isNaN(a[0])?a:a[0];var e=this,g=e.isStyle(f,h),i=e.getXY(),j=parseInt(e.getStyle(b),10),k=parseInt(e.getStyle(d),10);return j=isNaN(j)?g?0:e.dom.offsetLeft:j,k=isNaN(k)?g?0:e.dom.offsetTop:k,{left:a-i[0]+j,top:c-i[1]+k}},animTest:function(a,b,c){return!!b&&this.preanim?this.preanim(a,c):!1}})}(),Ext.Element.addMethods({setBox:function(a,b,c){var d=this,e=a.width,f=a.height;return b&&!d.autoBoxAdjust&&!d.isBorderBox()&&(e-=d.getBorderWidth("lr")+d.getPadding("lr"),f-=d.getBorderWidth("tb")+d.getPadding("tb")),d.setBounds(a.x,a.y,e,f,d.animTest.call(d,arguments,c,2)),d},getBox:function(a,b){var c=this,d,e,f,g=c.getBorderWidth,h=c.getPadding,i,j,k,l;b?(e=parseInt(c.getStyle("left"),10)||0,f=parseInt(c.getStyle("top"),10)||0,d=[e,f]):d=c.getXY();var m=c.dom,n=m.offsetWidth,o=m.offsetHeight,p;return a?(i=g.call(c,"l")+h.call(c,"l"),j=g.call(c,"r")+h.call(c,"r"),k=g.call(c,"t")+h.call(c,"t"),l=g.call(c,"b")+h.call(c,"b"),p={x:d[0]+i,y:d[1]+k,0:d[0]+i,1:d[1]+k,width:n-(i+j),height:o-(k+l)}):p={x:d[0],y:d[1],0:d[0],1:d[1],width:n,height:o},p.right=p.x+p.width,p.bottom=p.y+p.height,p},move:function(a,b,c){var d=this,e=d.getXY(),f=e[0],g=e[1],h=[f-b,g],i=[f+b,g],j=[f,g-b],k=[f,g+b],l={l:h,left:h,r:i,right:i,t:j,top:j,up:j,b:k,bottom:k,down:k};a=a.toLowerCase(),d.moveTo(l[a][0],l[a][1],d.animTest.call(d,arguments,c,2))},setLeftTop:function(a,b){var c=this,d=c.dom.style;return d.left=c.addUnits(a),d.top=c.addUnits(b),c},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(a,b,c,d,e){var f=this;return!e||!f.anim?(f.setSize(c,d),f.setLocation(a,b)):f.anim({points:{to:[a,b]},width:{to:f.adjustWidth(c)},height:{to:f.adjustHeight(d)}},f.preanim(arguments,4),"motion"),f},setRegion:function(a,b){return this.setBounds(a.left,a.top,a.right-a.left,a.bottom-a.top,this.animTest.call(this,arguments,b,1))}}),Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){return this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b,this},getScroll:function(){var a=this.dom,b=document,c=b.body,d=b.documentElement,e,f,g;return a==b||a==c?(Ext.isIE&&Ext.isStrict?(e=d.scrollLeft,f=d.scrollTop):(e=window.pageXOffset,f=window.pageYOffset),g={left:e||(c?c.scrollLeft:0),top:f||(c?c.scrollTop:0)}):g={left:a.scrollLeft,top:a.scrollTop},g}}),Ext.Element.addMethods({scrollTo:function(a,b,c){var d=/top/i.test(a),e=this,f=e.dom,g;return!c||!e.anim?(g="scroll"+(d?"Top":"Left"),f[g]=b):(g="scroll"+(d?"Left":"Top"),e.anim({scroll:{to:d?[f[g],b]:[b,f[g]]}},e.preanim(arguments,2),"scroll")),e},scrollIntoView:function(a,b){var c=Ext.getDom(a)||Ext.getBody().dom,d=this.dom,e=this.getOffsetsTo(c),f=e[0]+c.scrollLeft,g=e[1]+c.scrollTop,h=g+d.offsetHeight,i=f+d.offsetWidth,j=c.clientHeight,k=parseInt(c.scrollTop,10),l=parseInt(c.scrollLeft,10),m=k+j,n=l+c.clientWidth;return d.offsetHeight>j||g<k?c.scrollTop=g:h>m&&(c.scrollTop=h-j),c.scrollTop=c.scrollTop,b!==!1&&(d.offsetWidth>c.clientWidth||f<l?c.scrollLeft=f:i>n&&(c.scrollLeft=i-c.clientWidth),c.scrollLeft=c.scrollLeft),this},scrollChildIntoView:function(a,b){Ext.fly(a,"_scrollChildIntoView").scrollIntoView(this,b)},scroll:function(a,b,c){if(!this.isScrollable())return;var d=this.dom,e=d.scrollLeft,f=d.scrollTop,g=d.scrollWidth,h=d.scrollHeight,i=d.clientWidth,j=d.clientHeight,k=!1,l,m={l:Math.min(e+b,g-i),r:l=Math.max(e-b,0),t:Math.max(f-b,0),b:Math.min(f+b,h-j)};return m.d=m.b,m.u=m.t,a=a.substr(0,1),(l=m[a])>-1&&(k=!0,this.scrollTo(a=="l"||a=="r"?"left":"top",l,this.preanim(arguments,2))),k}}),Ext.Element.VISIBILITY=1,Ext.Element.DISPLAY=2,Ext.Element.addMethods(function(){var a="visibility",b="display",c="hidden",d="offsets",e="none",f="originalDisplay",g="visibilityMode",h=Ext.Element.DISPLAY,i=Ext.Element.data,j=function(a){var b=i(a,f);return b===undefined&&i(a,f,b=""),b},k=function(a){var b=i(a,g);return b===undefined&&i(a,g,b=1),b};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(a){return i(this.dom,g,a),this},animate:function(a,b,c,d,e){return this.anim(a,{duration:b,callback:c,easing:d},e),this},anim:function(a,b,c,d,e,f){c=c||"run",b=b||{};var g=this,h=Ext.lib.Anim[c](g.dom,a,b.duration||d||.35,b.easing||e||"easeOut",function(){f&&f.call(g),b.callback&&b.callback.call(b.scope||g,g,b)},g);return b.anim=h,h},preanim:function(a,b){return a[b]?typeof a[b]=="object"?a[b]:{duration:a[b+1],callback:a[b+2],easing:a[b+3]}:!1},isVisible:function(){return!this.isStyle(a,c)&&!this.isStyle(b,e)},setVisible:function(f,g){var i=this,j,l,m,n=i.dom;return typeof g=="string"?(j=g==b,l=g==a,m=g==d,g=!1):(j=k(this.dom)==h,l=!j),!g||!i.anim?j?i.setDisplayed(f):m?f?i.applyStyles(i.hideModeStyles||{position:"",top:"",left:""}):(i.hideModeStyles={position:i.getStyle("position"),top:i.getStyle("top"),left:i.getStyle("left")},i.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})):(i.fixDisplay(),n.style.visibility=f?"visible":c):(f&&(i.setOpacity(.01),i.setVisible(!0)),i.anim({opacity:{to:f?1:0}},i.preanim(arguments,1),null,.35,"easeIn",function(){f||(n.style[j?b:a]=j?e:c,Ext.fly(n).setOpacity(1))})),i},toggle:function(a){var b=this;return b.setVisible(!b.isVisible(),b.preanim(arguments,0)),b},setDisplayed:function(a){return typeof a=="boolean"&&(a=a?j(this.dom):e),this.setStyle(b,a),this},fixDisplay:function(){var d=this;d.isStyle(b,e)&&(d.setStyle(a,c),d.setStyle(b,j(this.dom)),d.isStyle(b,e)&&d.setStyle(b,"block"))},hide:function(a){return typeof a=="string"?(this.setVisible(!1,a),this):(this.setVisible(!1,this.preanim(arguments,0)),this)},show:function(a){return typeof a=="string"?(this.setVisible(!0,a),this):(this.setVisible(!0,this.preanim(arguments,0)),this)}}}()),Ext.Element.addMethods(function(){var a="visibility",b="display",c="hidden",d="none",e="x-masked",f="x-masked-relative",g=Ext.Element.data;return{isVisible:function(e){var f=!this.isStyle(a,c)&&!this.isStyle(b,d),g=this.dom.parentNode;if(e!==!0||!f)return f;while(g&&!/^body/i.test(g.tagName)){if(!Ext.fly(g,"_isVisible").isVisible())return!1;g=g.parentNode}return!0},isDisplayed:function(){return!this.isStyle(b,d)},enableDisplayMode:function(a){return this.setVisibilityMode(Ext.Element.DISPLAY),Ext.isEmpty(a)||g(this.dom,"originalDisplay",a),this},mask:function(a,b){var c=this,d=c.dom,h=Ext.DomHelper,i="ext-el-mask-msg",j,k;!/^body/i.test(d.tagName)&&c.getStyle("position")=="static"&&c.addClass(f),(j=g(d,"maskMsg"))&&j.remove(),(j=g(d,"mask"))&&j.remove(),k=h.append(d,{cls:"ext-el-mask"},!0),g(d,"mask",k),c.addClass(e),k.setDisplayed(!0);if(typeof a=="string"){var l=h.append(d,{cls:i,cn:{tag:"div"}},!0);g(d,"maskMsg",l),l.dom.className=b?i+" "+b:i,l.dom.firstChild.innerHTML=a,l.setDisplayed(!0),l.center(c)}return Ext.isIE&&(!Ext.isIE7||!Ext.isStrict)&&c.getStyle("height")=="auto"&&k.setSize(undefined,c.getHeight()),k},unmask:function(){var a=this,b=a.dom,c=g(b,"mask"),d=g(b,"maskMsg");c&&(d&&(d.remove(),g(b,"maskMsg",undefined)),c.remove(),g(b,"mask",undefined)),a.removeClass([e,f])},isMasked:function(){var a=g(this.dom,"mask");return a&&a.isVisible()},createShim:function(){var a=document.createElement("iframe"),b;return a.frameBorder="0",a.className="ext-shim",a.src=Ext.SSL_SECURE_URL,b=Ext.get(this.dom.parentNode.insertBefore(a,this.dom)),b.autoBoxAdjust=!1,b}}}()),Ext.Element.addMethods({addKeyListener:function(a,b,c){var d;return typeof a!="object"||Ext.isArray(a)?d={key:a,fn:b,scope:c}:d={key:a.key,shift:a.shift,ctrl:a.ctrl,alt:a.alt,fn:b,scope:c},new Ext.KeyMap(this,d)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}}),function(){var a=null,b=undefined,c=!0,d=!1,e="setX",f="setY",g="setXY",h="left",i="bottom",j="top",k="right",l="height",m="width",n="points",o="hidden",p="absolute",q="visible",r="motion",s="position",t="easeOut",u=new Ext.Element.Flyweight,v={},w=function(a){return a||{}},x=function(a){return u.dom=a,u.id=Ext.id(a),u},y=function(a){return v[a]||(v[a]=[]),v[a]},z=function(a,b){v[a]=b};Ext.enableFx=c,Ext.Fx={switchStatements:function(a,b,c){return b.apply(this,c[a])},slideIn:function(b,c){c=w(c);var d=this,l=d.dom,m=l.style,n,s,u,v,y,m,z,A,B,C;return b=b||"t",d.queueFx(c,function(){function d(){x(l).fxUnwrap(v,s.pos,c),m.width=s.width,m.height=s.height,x(l).afterFx(c)}function w(a,b,c,d,e,f,g,h,i,j,k){var l={};return x(a).setWidth(c).setHeight(d),x(a)[e]&&x(a)[e](f),b[g]=b[h]="0",i&&(l.width=i),j&&(l.height=j),k&&(l.points=k),l}n=x(l).getXY(),x(l).fixDisplay(),s=x(l).getFxRestore(),u={x:n[0],y:n[1],0:n[0],1:n[1],width:l.offsetWidth,height:l.offsetHeight},u.right=u.x+u.width,u.bottom=u.y+u.height,x(l).setWidth(u.width).setHeight(u.height),v=x(l).fxWrap(s.pos,c,o),m.visibility=q,m.position=p,A={to:[u.x,u.y]},B={to:u.width},C={to:u.height},z=x(l).switchStatements(b.toLowerCase(),w,{t:[v,m,u.width,0,a,a,h,i,a,C,a],l:[v,m,0,u.height,a,a,k,j,B,a,a],r:[v,m,u.width,u.height,e,u.right,h,j,a,a,A],b:[v,m,u.width,u.height,f,u.bottom,h,j,a,C,A],tl:[v,m,0,0,a,a,k,i,B,C,A],bl:[v,m,0,0,f,u.y+u.height,k,j,B,C,A],br:[v,m,0,0,g,[u.right,u.bottom],h,j,B,C,A],tr:[v,m,0,0,e,u.x+u.width,h,i,B,C,A]}),m.visibility=q,x(v).show(),arguments.callee.anim=x(v).fxanim(z,c,r,.5,t,d)}),d},slideOut:function(a,b){b=w(b);var c=this,e=c.dom,f=e.style,g=c.getXY(),o,s,u,v,y={to:0};return a=a||"t",c.queueFx(b,function(){function c(){b.useDisplay?x(e).setDisplayed(d):x(e).hide(),x(e).fxUnwrap(o,s.pos,b),f.width=s.width,f.height=s.height,x(e).afterFx(b)}function w(a,b,c,d,e,f,g,h,i){var j={};return a[b]=a[c]="0",j[d]=e,f&&(j[f]=g),h&&(j[h]=i),j}s=x(e).getFxRestore(),u={x:g[0],y:g[1],0:g[0],1:g[1],width:e.offsetWidth,height:e.offsetHeight},u.right=u.x+u.width,u.bottom=u.y+u.height,x(e).setWidth(u.width).setHeight(u.height),o=x(e).fxWrap(s.pos,b,q),f.visibility=q,f.position=p,x(o).setWidth(u.width).setHeight(u.height),v=x(e).switchStatements(a.toLowerCase(),w,{t:[f,h,i,l,y],l:[f,k,j,m,y],r:[f,h,j,m,y,n,{to:[u.right,u.y]}],b:[f,h,j,l,y,n,{to:[u.x,u.bottom]}],tl:[f,k,i,m,y,l,y],bl:[f,k,j,m,y,l,y,n,{to:[u.x,u.bottom]}],br:[f,h,j,m,y,l,y,n,{to:[u.x+u.width,u.bottom]}],tr:[f,h,i,m,y,l,y,n,{to:[u.right,u.y]}]}),arguments.callee.anim=x(o).fxanim(v,b,r,.5,t,c)}),c},puff:function(a){a=w(a);var b=this,c=b.dom,e=c.style,f,g,h;return b.queueFx(a,function(){function b(){a.useDisplay?x(c).setDisplayed(d):x(c).hide(),x(c).clearOpacity(),x(c).setPositioning(h.pos),e.width=h.width,e.height=h.height,e.fontSize="",x(c).afterFx(a)}f=x(c).getWidth(),g=x(c).getHeight(),x(c).clearOpacity(),x(c).show(),h=x(c).getFxRestore(),arguments.callee.anim=x(c).fxanim({width:{to:x(c).adjustWidth(f*2)},height:{to:x(c).adjustHeight(g*2)},points:{by:[-f*.5,-g*.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},a,r,.5,t,b)}),b},switchOff:function(b){b=w(b);var c=this,e=c.dom,f=e.style,g;return c.queueFx(b,function(){function c(){b.useDisplay?x(e).setDisplayed(d):x(e).hide(),x(e).clearOpacity(),x(e).setPositioning(g.pos),f.width=g.width,f.height=g.height,x(e).afterFx(b)}x(e).clearOpacity(),x(e).clip(),g=x(e).getFxRestore(),x(e).fxanim({opacity:{to:.3}},a,a,.1,a,function(){x(e).clearOpacity(),function(){x(e).fxanim({height:{to:1},points:{by:[0,x(e).getHeight()*.5]}},b,r,.3,"easeIn",c)}.defer(100)})}),c},highlight:function(a,b){b=w(b);var c=this,d=c.dom,e=b.attr||"backgroundColor",f={},g;return c.queueFx(b,function(){function c(){d.style[e]=g,x(d).afterFx(b)}x(d).clearOpacity(),x(d).show(),g=d.style[e],f[e]={from:a||"ffff9c",to:b.endColor||x(d).getColor(e)||"ffffff"},arguments.callee.anim=x(d).fxanim(f,b,"color",1,"easeIn",c)}),c},frame:function(a,b,c){c=w(c);var d=this,e=d.dom,f,g;return d.queueFx(c,function(){function j(){var a=Ext.isBorderBox?2:1;g=f.anim({top:{from:h.y,to:h.y-20},left:{from:h.x,to:h.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:h.height,to:h.height+20*a},width:{from:h.width,to:h.width+20*a}},{duration:c.duration||1,callback:function(){f.remove(),--b>0?i():x(e).afterFx(c)}}),arguments.callee.anim={isAnimated:!0,stop:function(){g.stop()}}}a=a||"#C3DAF9",a.length==6&&(a="#"+a),b=b||1,x(e).show();var d=x(e).getXY(),h={x:d[0],y:d[1],0:d[0],1:d[1],width:e.offsetWidth,height:e.offsetHeight},i=function(){return f=x(document.body||document.documentElement).createChild({style:{position:p,"z-index":35e3,border:"0px solid "+a}}),f.queueFx({},j)};arguments.callee.anim={isAnimated:!0,stop:function(){b=0,f.stopFx()}},i()}),d},pause:function(a){var b=this.dom,c;return this.queueFx({},function(){c=setTimeout(function(){x(b).afterFx({})},a*1e3),arguments.callee.anim={isAnimated:!0,stop:function(){clearTimeout(c),x(b).afterFx({})}}}),this},fadeIn:function(b){b=w(b);var c=this,d=c.dom,e=b.endOpacity||1;return c.queueFx(b,function(){x(d).setOpacity(0),x(d).fixDisplay(),d.style.visibility=q,arguments.callee.anim=x(d).fxanim({opacity:{to:e}},b,a,.5,t,function(){e==1&&x(d).clearOpacity(),x(d).afterFx(b)})}),c},fadeOut:function(b){b=w(b);var c=this,d=c.dom,e=d.style,f=b.endOpacity||0;return c.queueFx(b,function(){arguments.callee.anim=x(d).fxanim({opacity:{to:f}},b,a,.5,t,function(){f==0&&(Ext.Element.data(d,"visibilityMode")==Ext.Element.DISPLAY||b.useDisplay?e.display="none":e.visibility=o,x(d).clearOpacity()),x(d).afterFx(b)})}),c},scale:function(a,b,c){return this.shift(Ext.apply({},c,{width:a,height:b})),this},shift:function(a){a=w(a);var c=this.dom,d={};return this.queueFx(a,function(){for(var e in a)a[e]!=b&&(d[e]={to:a[e]});d.width?d.width.to=x(c).adjustWidth(a.width):d,d.height?d.height.to=x(c).adjustWidth(a.height):d;if(d.x||d.y||d.xy)d.points=d.xy||{to:[d.x?d.x.to:x(c).getX(),d.y?d.y.to:x(c).getY()]};arguments.callee.anim=x(c).fxanim(d,a,r,.35,t,function(){x(c).afterFx(a)})}),this},ghost:function(a,b){b=w(b);var c=this,e=c.dom,f=e.style,g={opacity:{to:0},points:{}},h=g.points,i,j,k;return a=a||"b",c.queueFx(b,function(){function c(){b.useDisplay?x(e).setDisplayed(d):x(e).hide(),x(e).clearOpacity(),x(e).setPositioning(i.pos),f.width=i.width,f.height=i.height,x(e).afterFx(b)}i=x(e).getFxRestore(),j=x(e).getWidth(),k=x(e).getHeight(),h.by=x(e).switchStatements(a.toLowerCase(),function(a,b){return[a,b]},{t:[0,-k],l:[-j,0],r:[j,0],b:[0,k],tl:[-j,-k],bl:[-j,k],br:[j,k],tr:[j,-k]}),arguments.callee.anim=x(e).fxanim(g,b,r,.5,t,c)}),c},syncFx:function(){var a=this;return a.fxDefaults=Ext.apply(a.fxDefaults||{},{block:d,concurrent:c,stopFx:d}),a},sequenceFx:function(){var a=this;return a.fxDefaults=Ext.apply(a.fxDefaults||{},{block:d,concurrent:d,stopFx:d}),a},nextFx:function(){var a=y(this.dom.id)[0];a&&a.call(this)},hasActiveFx:function(){return y(this.dom.id)[0]},stopFx:function(a){var b=this,d=b.dom.id;if(b.hasActiveFx()){var e=y(d)[0];e&&e.anim&&(e.anim.isAnimated?(z(d,[e]),e.anim.stop(a!==undefined?a:c)):z(d,[]))}return b},beforeFx:function(a){return this.hasActiveFx()&&!a.concurrent?a.stopFx?(this.stopFx(),c):d:c},hasFxBlock:function(){var a=y(this.dom.id);return a&&a[0]&&a[0].block},queueFx:function(a,b){var c=x(this.dom);if(!c.hasFxBlock()){Ext.applyIf(a,c.fxDefaults);if(!a.concurrent){var d=c.beforeFx(a);b.block=a.block,y(c.dom.id).push(b),d&&c.nextFx()}else b.call(c)}return c},fxWrap:function(a,b,c){var d=this.dom,e,f;if(!b.wrap||!(e=Ext.getDom(b.wrap))){b.fixPosition&&(f=x(d).getXY());var g=document.createElement("div");g.style.visibility=c,e=d.parentNode.insertBefore(g,d),x(e).setPositioning(a),x(e).isStyle(s,"static")&&x(e).position("relative"),x(d).clearPositioning("auto"),x(e).clip(),e.appendChild(d),f&&x(e).setXY(f)}return e},fxUnwrap:function(a,b,c){var d=this.dom;x(d).clearPositioning(),x(d).setPositioning(b);if(!c.wrap){var e=x(a).dom.parentNode;e.insertBefore(d,a),x(a).remove()}},getFxRestore:function(){var a=this.dom.style;return{pos:this.getPositioning(),width:a.width,height:a.height}},afterFx:function(a){var b=this.dom,d=b.id;a.afterStyle&&x(b).setStyle(a.afterStyle),a.afterCls&&x(b).addClass(a.afterCls),a.remove==c&&x(b).remove(),a.callback&&a.callback.call(a.scope,x(b)),a.concurrent||(y(d).shift(),x(b).nextFx())},fxanim:function(a,b,c,d,e,f){c=c||"run",b=b||{};var g=Ext.lib.Anim[c](this.dom,a,b.duration||d||.35,b.easing||e||t,f,this);return b.anim=g,g}},Ext.Fx.resize=Ext.Fx.scale,Ext.Element.addMethods(Ext.Fx)}(),Ext.CompositeElementLite=function(a,b){this.elements=[],this.add(a,b),this.el=new Ext.Element.Flyweight},Ext.CompositeElementLite.prototype={isComposite:!0,getElement:function(a){var b=this.el;return b.dom=a,b.id=a.id,b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(a,b){var c=this,d=c.elements;if(!a)return this;typeof a=="string"?a=Ext.Element.selectorFunction(a,b):a.isComposite?a=a.elements:Ext.isIterable(a)||(a=[a]);for(var e=0,f=a.length;e<f;++e)d.push(c.transformElement(a[e]));return c},invoke:function(a,b){var c=this,d=c.elements,e=d.length,f,g;for(g=0;g<e;g++)f=d[g],f&&Ext.Element.prototype[a].apply(c.getElement(f),b);return c},item:function(a){var b=this,c=b.elements[a],d=null;return c&&(d=b.getElement(c)),d},addListener:function(a,b,c,d){var e=this.elements,f=e.length,g,h;for(g=0;g<f;g++)h=e[g],h&&Ext.EventManager.on(h,a,b,c||h,d);return this},each:function(a,b){var c=this,d=c.elements,e=d.length,f,g;for(f=0;f<e;f++){g=d[f];if(g){g=this.getElement(g);if(a.call(b||g,g,c,f)===!1)break}}return c},fill:function(a){var b=this;return b.elements=[],b.add(a),b},filter:function(a){var b=[],c=this,d=c.elements,e=Ext.isFunction(a)?a:function(b){return b.is(a)};return c.each(function(a,d,f){e(a,f)!==!1&&(b[b.length]=c.transformElement(a))}),c.elements=b,c},indexOf:function(a){return this.elements.indexOf(this.transformElement(a))},replaceElement:function(
a,b,c){var d=isNaN(a)?this.indexOf(a):a,e;return d>-1&&(b=Ext.getDom(b),c&&(e=this.elements[d],e.parentNode.insertBefore(b,e),Ext.removeNode(e)),this.elements.splice(d,1,b)),this},clear:function(){this.elements=[]}},Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener,function(){var a,b=Ext.Element.prototype,c=Ext.CompositeElementLite.prototype;for(a in b)Ext.isFunction(b[a])&&function(a){c[a]=c[a]||function(){return this.invoke(a,arguments)}}.call(c,a)}(),Ext.DomQuery&&(Ext.Element.selectorFunction=Ext.DomQuery.select),Ext.Element.select=function(a,b){var c;if(typeof a=="string")c=Ext.Element.selectorFunction(a,b);else if(a.length!==undefined)c=a;else throw"Invalid selector";return new Ext.CompositeElementLite(c)},Ext.select=Ext.Element.select,Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(a,b){if(!a)return this;typeof a=="string"&&(a=Ext.Element.selectorFunction(a,b));var c=this.elements;return Ext.each(a,function(a){c.push(Ext.get(a))}),this},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},removeElement:function(a,b){var c=this,d=this.elements,e;return Ext.each(a,function(a){if(e=d[a]||d[a=c.indexOf(a)])b&&(e.dom?e.remove():Ext.removeNode(e)),d.splice(a,1)}),this}}),Ext.CompositeElement=Ext.extend(Ext.CompositeElementLite,{constructor:function(a,b){this.elements=[],this.add(a,b)},getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}}),Ext.Element.select=function(a,b,c){var d;if(typeof a=="string")d=Ext.Element.selectorFunction(a,c);else if(a.length!==undefined)d=a;else throw"Invalid selector";return b===!0?new Ext.CompositeElement(d):new Ext.CompositeElementLite(d)},Ext.select=Ext.Element.select,function(){var a="beforerequest",b="requestcomplete",c="requestexception",d=undefined,e="load",f="POST",g="GET",h=window;Ext.data.Connection=function(d){Ext.apply(this,d),this.addEvents(a,b,c),Ext.data.Connection.superclass.constructor.call(this)},Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:3e4,autoAbort:!1,disableCaching:!0,disableCachingParam:"_dc",request:function(b){var c=this;if(c.fireEvent(a,c,b)){b.el&&(Ext.isEmpty(b.indicatorText)||(c.indicatorText='<div class="loading-indicator">'+b.indicatorText+"</div>"),c.indicatorText&&(Ext.getDom(b.el).innerHTML=c.indicatorText),b.success=(Ext.isFunction(b.success)?b.success:function(){}).createInterceptor(function(a){Ext.getDom(b.el).innerHTML=a.responseText}));var e=b.params,i=b.url||c.url,j,k={success:c.handleResponse,failure:c.handleFailure,scope:c,argument:{options:b},timeout:b.timeout||c.timeout},l,m;Ext.isFunction(e)&&(e=e.call(b.scope||h,b)),e=Ext.urlEncode(c.extraParams,Ext.isObject(e)?Ext.urlEncode(e):e),Ext.isFunction(i)&&(i=i.call(b.scope||h,b));if(l=Ext.getDom(b.form)){i=i||l.action;if(b.isUpload||/multipart\/form-data/i.test(l.getAttribute("enctype")))return c.doFormUpload.call(c,b,e,i);m=Ext.lib.Ajax.serializeForm(l),e=e?e+"&"+m:m}j=b.method||c.method||(e||b.xmlData||b.jsonData?f:g);if(j===g&&c.disableCaching&&b.disableCaching!==!1||b.disableCaching===!0){var n=b.disableCachingParam||c.disableCachingParam;i=Ext.urlAppend(i,n+"="+(new Date).getTime())}return b.headers=Ext.apply(b.headers||{},c.defaultHeaders||{}),(b.autoAbort===!0||c.autoAbort)&&c.abort(),(j==g||b.xmlData||b.jsonData)&&e&&(i=Ext.urlAppend(i,e),e=""),c.transId=Ext.lib.Ajax.request(j,i,k,e,b)}return b.callback?b.callback.apply(b.scope,[b,d,d]):null},isLoading:function(a){return a?Ext.lib.Ajax.isCallInProgress(a):!!this.transId},abort:function(a){(a||this.isLoading())&&Ext.lib.Ajax.abort(a||this.transId)},handleResponse:function(a){this.transId=!1;var c=a.argument.options;a.argument=c?c.argument:null,this.fireEvent(b,this,a,c),c.success&&c.success.call(c.scope,a,c),c.callback&&c.callback.call(c.scope,c,!0,a)},handleFailure:function(a,b){this.transId=!1;var d=a.argument.options;a.argument=d?d.argument:null,this.fireEvent(c,this,a,d,b),d.failure&&d.failure.call(d.scope,a,d),d.callback&&d.callback.call(d.scope,d,!1,a)},doFormUpload:function(a,c,d){function p(){function l(a,b,c){Ext.isFunction(a)&&a.apply(b,c)}var c=this,d={responseText:"",responseXML:null,argument:a.argument},f,i;try{f=j.contentWindow.document||j.contentDocument||h.frames[g].document,f&&(f.body&&(/textarea/i.test((i=f.body.firstChild||{}).tagName)?d.responseText=i.value:d.responseText=f.body.innerHTML),d.responseXML=f.XMLDocument||f)}catch(k){}Ext.EventManager.removeListener(j,e,p,c),c.fireEvent(b,c,d,a),l(a.success,a.scope,[d,a]),l(a.callback,a.scope,[a,!0,d]),c.debugUploads||setTimeout(function(){Ext.removeNode(j)},100)}var g=Ext.id(),i=document,j=i.createElement("iframe"),k=Ext.getDom(a.form),l=[],m,n="multipart/form-data",o={target:k.target,method:k.method,encoding:k.encoding,enctype:k.enctype,action:k.action};Ext.fly(j).set({id:g,name:g,cls:"x-hidden",src:Ext.SSL_SECURE_URL}),i.body.appendChild(j),Ext.isIE&&(document.frames[g].name=g),Ext.fly(k).set({target:g,method:f,enctype:n,encoding:n,action:d||o.action}),Ext.iterate(Ext.urlDecode(c,!1),function(a,b){m=i.createElement("input"),Ext.fly(m).set({type:"hidden",value:b,name:a}),k.appendChild(m),l.push(m)}),Ext.EventManager.on(j,e,p,this),k.submit(),Ext.fly(k).set(o),Ext.each(l,function(a){Ext.removeNode(a)})}})}(),Ext.Ajax=new Ext.data.Connection({autoAbort:!1,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}}),Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){function d(a){var b=this;b.transaction=null;if(a.argument.form&&a.argument.reset)try{a.argument.form.reset()}catch(c){}b.loadScripts?b.renderer.render(b.el,a,b,e.createDelegate(b,[a])):(b.renderer.render(b.el,a,b),e.call(b,a))}function e(a,c,d){this.fireEvent(c||b,this.el,a),Ext.isFunction(a.argument.callback)&&a.argument.callback.call(a.argument.scope,this.el,Ext.isEmpty(d)?!0:!1,a,a.argument.options)}function f(a){e.call(this,a,c,!!(this.transaction=null))}var a="beforeupdate",b="update",c="failure";return{constructor:function(d,e){var f=this;d=Ext.get(d);if(!e&&d.updateManager)return d.updateManager;f.el=d,f.defaultUrl=null,f.addEvents(a,b,c),Ext.apply(f,Ext.Updater.defaults),f.transaction=null,f.refreshDelegate=f.refresh.createDelegate(f),f.updateDelegate=f.update.createDelegate(f),f.formUpdateDelegate=(f.formUpdate||function(){}).createDelegate(f),f.renderer=f.renderer||f.getDefaultRenderer(),Ext.Updater.superclass.constructor.call(f)},setRenderer:function(a){this.renderer=a},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer},setDefaultUrl:function(a){this.defaultUrl=a},getEl:function(){return this.el},update:function(b,c,e,g){var h=this,i,j;if(h.fireEvent(a,h.el,b,c)!==!1){Ext.isObject(b)&&(i=b,b=i.url,c=c||i.params,e=e||i.callback,g=g||i.discardUrl,j=i.scope,Ext.isEmpty(i.nocache)||(h.disableCaching=i.nocache),Ext.isEmpty(i.text)||(h.indicatorText='<div class="loading-indicator">'+i.text+"</div>"),Ext.isEmpty(i.scripts)||(h.loadScripts=i.scripts),Ext.isEmpty(i.timeout)||(h.timeout=i.timeout)),h.showLoading(),g||(h.defaultUrl=b),Ext.isFunction(b)&&(b=b.call(h));var k=Ext.apply({},{url:b,params:Ext.isFunction(c)&&j?c.createDelegate(j):c,success:d,failure:f,scope:h,callback:undefined,timeout:h.timeout*1e3,disableCaching:h.disableCaching,argument:{options:i,url:b,form:null,callback:e,scope:j||window,params:c}},i);h.transaction=Ext.Ajax.request(k)}},formUpdate:function(b,c,e,g){var h=this;h.fireEvent(a,h.el,b,c)!==!1&&(Ext.isFunction(c)&&(c=c.call(h)),b=Ext.getDom(b),h.transaction=Ext.Ajax.request({form:b,url:c,success:d,failure:f,scope:h,timeout:h.timeout*1e3,argument:{url:c,form:b,callback:g,reset:e}}),h.showLoading.defer(1,h))},startAutoRefresh:function(a,b,c,d,e){var f=this;e&&f.update(b||f.defaultUrl,c,d,!0),f.autoRefreshProcId&&clearInterval(f.autoRefreshProcId),f.autoRefreshProcId=setInterval(f.update.createDelegate(f,[b||f.defaultUrl,c,d,!0]),a*1e3)},stopAutoRefresh:function(){this.autoRefreshProcId&&(clearInterval(this.autoRefreshProcId),delete this.autoRefreshProcId)},isAutoRefreshing:function(){return!!this.autoRefreshProcId},showLoading:function(){this.showLoadIndicator&&(this.el.dom.innerHTML=this.indicatorText)},abort:function(){this.transaction&&Ext.Ajax.abort(this.transaction)},isUpdating:function(){return this.transaction?Ext.Ajax.isLoading(this.transaction):!1},refresh:function(a){this.defaultUrl&&this.update(this.defaultUrl,null,a,!0)}}}()),Ext.Updater.defaults={timeout:30,disableCaching:!1,showLoadIndicator:!0,indicatorText:'<div class="loading-indicator">Loading...</div>',loadScripts:!1,sslBlankUrl:Ext.SSL_SECURE_URL},Ext.Updater.updateElement=function(a,b,c,d){var e=Ext.get(a).getUpdater();Ext.apply(e,d),e.update(b,c,d?d.callback:null)},Ext.Updater.BasicRenderer=function(){},Ext.Updater.BasicRenderer.prototype={render:function(a,b,c,d){a.update(b.responseText,c.loadScripts,d)}},function(){function a(a){var b=Array.prototype.slice.call(arguments,1);return a.replace(/\{(\d+)\}/g,function(a,c){return b[c]})}Date.useStrict=!1,Date.formatCodeToRegex=function(b,c){var d=Date.parseCodes[b];return d&&(d=typeof d=="function"?d():d,Date.parseCodes[b]=d),d?Ext.applyIf({c:d.c?a(d.c,c||"{0}"):d.c},d):{g:0,c:null,s:Ext.escapeRe(b)}};var b=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{M$:function(a,b){var c=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/"),d=(a||"").match(c);return d?new Date(((d[1]||"")+d[2])*1):null}},parseRegexes:[],formatFunctions:{M$:function(){return"\\/Date("+this.getTime()+")\\/"}},y2kYear:50,MILLI:"ms",SECOND:"s",MINUTE:"mi",HOUR:"h",DAY:"d",MONTH:"mo",YEAR:"y",defaults:{},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNumbers:{Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},getShortMonthName:function(a){return Date.monthNames[a].substring(0,3)},getShortDayName:function(a){return Date.dayNames[a].substring(0,3)},getMonthNumber:function(a){return Date.monthNumbers[a.substring(0,1).toUpperCase()+a.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var a="Y-m-dTH:i:sP",b=[],c=0,d=a.length;c<d;++c){var e=a.charAt(c);b.push(e=="T"?"'T'":Date.getFormatCode(e))}return b.join(" + ")},U:"Math.round(this.getTime() / 1000)"},isValid:function(a,b,c,d,e,f,g){d=d||0,e=e||0,f=f||0,g=g||0;var h=new Date(a,b-1,c,d,e,f,g);return a==h.getFullYear()&&b==h.getMonth()+1&&c==h.getDate()&&d==h.getHours()&&e==h.getMinutes()&&f==h.getSeconds()&&g==h.getMilliseconds()},parseDate:function(a,b,c){var d=Date.parseFunctions;return d[b]==null&&Date.createParser(b),d[b](a,Ext.isDefined(c)?c:Date.useStrict)},getFormatCode:function(a){var b=Date.formatCodes[a];return b&&(b=typeof b=="function"?b():b,Date.formatCodes[a]=b),b||"'"+String.escape(a)+"'"},createFormat:function(a){var b=[],c=!1,d="";for(var e=0;e<a.length;++e)d=a.charAt(e),!c&&d=="\\"?c=!0:c?(c=!1,b.push("'"+String.escape(d)+"'")):b.push(Date.getFormatCode(d));Date.formatFunctions[a]=new Function("return "+b.join("+"))},createParser:function(){var c=["var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,","def = Date.defaults,","results = String(input).match(Date.parseRegexes[{0}]);","if(results){","{1}","if(u != null){","v = new Date(u * 1000);","}else{","dt = (new Date()).clearTime();","y = Ext.num(y, Ext.num(def.y, dt.getFullYear()));","m = Ext.num(m, Ext.num(def.m - 1, dt.getMonth()));","d = Ext.num(d, Ext.num(def.d, dt.getDate()));","h  = Ext.num(h, Ext.num(def.h, dt.getHours()));","i  = Ext.num(i, Ext.num(def.i, dt.getMinutes()));","s  = Ext.num(s, Ext.num(def.s, dt.getSeconds()));","ms = Ext.num(ms, Ext.num(def.ms, dt.getMilliseconds()));","if(z >= 0 && y >= 0){","v = new Date(y, 0, 1, h, i, s, ms);","v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);","}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","v = new Date(y, m, d, h, i, s, ms);","}","}","}","if(v){","if(zz != null){","v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");return function(d){var e=Date.parseRegexes.length,f=1,g=[],h=[],i=!1,j="";for(var k=0;k<d.length;++k){j=d.charAt(k);if(!i&&j=="\\")i=!0;else if(i)i=!1,h.push(String.escape(j));else{var l=b(j,f);f+=l.g,h.push(l.s),l.g&&l.c&&g.push(l.c)}}Date.parseRegexes[e]=new RegExp("^"+h.join("")+"$"),Date.parseFunctions[d]=new Function("input","strict",a(c,e,g.join("")))}}(),parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},D:function(){for(var a=[],b=0;b<7;a.push(Date.getShortDayName(b)),++b);return{g:0,c:null,s:"(?:"+a.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:1,c:"z = parseInt(results[{0}], 10);\n",s:"(\\d{1,3})"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return{g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var a=[],c=0;c<12;a.push(Date.getShortMonthName(c)),++c);return Ext.applyIf({s:"("+a.join("|")+")"},b("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return b("Y")},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM)"},g:function(){return b("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return b("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var a=[],c=[b("Y",1),b("m",2),b("d",3),b("h",4),b("i",5),b("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",b("P",8).c,"}else{",b("O",8).c,"}","}"].join("\n")}];for(var d=0,e=c.length;d<e;++d)a.push(c[d].c);return{g:1,c:a.join(""),s:[c[0].s,"(?:","-",c[1].s,"(?:","-",c[2].s,"(?:","(?:T| )?",c[3].s,":",c[4].s,"(?::",c[5].s,")?","(?:(?:\\.|,)(\\d+))?","(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",")?",")?",")?"].join("")}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}}})}(),Ext.apply(Date.prototype,{dateFormat:function(a){return Date.formatFunctions[a]==null&&Date.createFormat(a),Date.formatFunctions[a].call(this)},getTimezone:function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(a){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(a?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var a=0,b=this.clone(),c=this.getMonth(),d;for(d=0,b.setDate(1),b.setMonth(0);d<c;b.setMonth(++d))a+=b.getDaysInMonth();return a+this.getDate()-1},getWeekOfYear:function(){var a=864e5,b=7*a;return function(){var c=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/a,d=Math.floor(c/7),e=(new Date(d*b)).getUTCFullYear();return d-Math.floor(Date.UTC(e,0,7)/b)+1}}(),isLeapYear:function(){var a=this.getFullYear();return(a&3)==0&&!!(a%100||a%400==0&&a)},getFirstDayOfMonth:function(){var a=(this.getDay()-(this.getDate()-1))%7;return a<0?a+7:a},getLastDayOfMonth:function(){return this.getLastDateOfMonth().getDay()},getFirstDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},getLastDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())},getDaysInMonth:function(){var a=[31,28,31,30,31,30,31,31,30,31,30,31];return function(){var b=this.getMonth();return b==1&&this.isLeapYear()?29:a[b]}}(),getSuffix:function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},clone:function(){return new Date(this.getTime())},isDST:function(){return(new Date(this.getFullYear(),0,1)).getTimezoneOffset()!=this.getTimezoneOffset()},clearTime:function(a){if(a)return this.clone().clearTime();var b=this.getDate();this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0);if(this.getDate()!=b){for(var c=1,d=this.add(Date.HOUR,c);d.getDate()!=b;c++,d=this.add(Date.HOUR,c));this.setDate(b),this.setHours(d.getHours())}return this},add:function(a,b){var c=this.clone();if(!a||b===0)return c;switch(a.toLowerCase()){case Date.MILLI:c.setMilliseconds(this.getMilliseconds()+b);break;case Date.SECOND:c.setSeconds(this.getSeconds()+b);break;case Date.MINUTE:c.setMinutes(this.getMinutes()+b);break;case Date.HOUR:c.setHours(this.getHours()+b);break;case Date.DAY:c.setDate(this.getDate()+b);break;case Date.MONTH:var d=this.getDate();d>28&&(d=Math.min(d,this.getFirstDateOfMonth().add("mo",b).getLastDateOfMonth().getDate())),c.setDate(d),c.setMonth(this.getMonth()+b);break;case Date.YEAR:c.setFullYear(this.getFullYear()+b)}return c},between:function(a,b){var c=this.getTime();return a.getTime()<=c&&c<=b.getTime()}}),Date.prototype.format=Date.prototype.dateFormat,Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420&&Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var b=Math.ceil(-a),c=Math.ceil(b/12),d=b%12?12-b%12:0;return this.setFullYear(this.getFullYear()-c),this._xMonth(d)}return this._xMonth(a)},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*864e5)}}),Ext.util.MixedCollection=function(a,b){this.items=[],this.map={},this.keys=[],this.length=0,this.addEvents("clear","add","replace","remove","sort"),this.allowFunctions=a===!0,b&&(this.getKey=b),Ext.util.MixedCollection.superclass.constructor.call(this)},Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:!1,add:function(a,b){arguments.length==1&&(b=arguments[0],a=this.getKey(b));if(typeof a!="undefined"&&a!==null){var c=this.map[a];if(typeof c!="undefined")return this.replace(a,b);this.map[a]=b}return this.length++,this.items.push(b),this.keys.push(a),this.fireEvent("add",this.length-1,b,a),b},getKey:function(a){return a.id},replace:function(a,b){arguments.length==1&&(b=arguments[0],a=this.getKey(b));var c=this.map[a];if(typeof a=="undefined"||a===null||typeof c=="undefined")return this.add(a,b);var d=this.indexOfKey(a);return this.items[d]=b,this.map[a]=b,this.fireEvent("replace",a,c,b),b},addAll:function(a){if(arguments.length>1||Ext.isArray(a)){var b=arguments.length>1?arguments:a;for(var c=0,d=b.length;c<d;c++)this.add(b[c])}else for(var e in a)(this.allowFunctions||typeof a[e]!="function")&&this.add(e,a[e])},each:function(a,b){var c=[].concat(this.items);for(var d=0,e=c.length;d<e;d++)if(a.call(b||c[d],c[d],d,e)===!1)break},eachKey:function(a,b){for(var c=0,d=this.keys.length;c<d;c++)a.call(b||window,this.keys[c],this.items[c],c,d)},find:function(a,b){for(var c=0,d=this.items.length;c<d;c++)if(a.call(b||window,this.items[c],this.keys[c]))return this.items[c];return null},insert:function(a,b,c){return arguments.length==2&&(c=arguments[1],b=this.getKey(c)),this.containsKey(b)&&(this.suspendEvents(),this.removeKey(b),this.resumeEvents()),a>=this.length?this.add(b,c):(this.length++,this.items.splice(a,0,c),typeof b!="undefined"&&b!==null&&(this.map[b]=c),this.keys.splice(a,0,b),this.fireEvent("add",a,c,b),c)},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a<this.length&&a>=0){this.length--;var b=this.items[a];this.items.splice(a,1);var c=this.keys[a];return typeof c!="undefined"&&delete this.map[c],this.keys.splice(a,1),this.fireEvent("remove",b,c),b}return!1},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(a){var b=this.map[a],c=b!==undefined?b:typeof a=="number"?this.items[a]:undefined;return typeof c!="function"||this.allowFunctions?c:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0,this.items=[],this.keys=[],this.map={},this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(a,b,c){var d,e,f=String(b).toUpperCase()=="DESC"?-1:1,g=[],h=this.keys,i=this.items;c=c||function(a,b){return a-b};for(d=0,e=i.length;d<e;d++)g[g.length]={key:h[d],value:i[d],index:d};g.sort(function(b,d){var e=c(b[a],d[a])*f;return e===0&&(e=b.index<d.index?-1:1),e});for(d=0,e=g.length;d<e;d++)i[d]=g[d].value,h[d]=g[d].key;this.fireEvent("sort",this)},sort:function(a,b){this._sort("value",a,b)},reorder:function(a){this.suspendEvents();var b=this.items,c=0,d=b.length,e=[],f=[];for(oldIndex in a)e[a[oldIndex]]=b[oldIndex];for(c=0;c<d;c++)a[c]==undefined&&f.push(b[c]);for(c=0;c<d;c++)e[c]==undefined&&(e[c]=f.shift());this.clear(),this.addAll(e),this.resumeEvents(),this.fireEvent("sort",this)},keySort:function(a,b){this._sort("key",a,b||function(a,b){var c=String(a).toUpperCase(),d=String(b).toUpperCase();return c>d?1:c<d?-1:0})},getRange:function(a,b){var c=this.items;if(c.length<1)return[];a=a||0,b=Math.min(typeof b=="undefined"?this.length-1:b,this.length-1);var d,e=[];if(a<=b)for(d=a;d<=b;d++)e[e.length]=c[d];else for(d=a;d>=b;d--)e[e.length]=c[d];return e},filter:function(a,b,c,d){return Ext.isEmpty(b,!1)?this.clone():(b=this.createValueMatcher(b,c,d),this.filterBy(function(c){return c&&b.test(c[a])}))},filterBy:function(a,b){var c=new Ext.util.MixedCollection;c.getKey=this.getKey;var d=this.keys,e=this.items;for(var f=0,g=e.length;f<g;f++)a.call(b||this,e[f],d[f])&&c.add(d[f],e[f]);return c},findIndex:function(a,b,c,d,e){return Ext.isEmpty(b,!1)?-1:(b=this.createValueMatcher(b,d,e),this.findIndexBy(function(c){return c&&b.test(c[a])},null,c))},findIndexBy:function(a,b,c){var d=this.keys,e=this.items;for(var f=c||0,g=e.length;f<g;f++)if(a.call(b||this,e[f],d[f]))return f;return-1},createValueMatcher:function(a,b,c,d){if(!a.exec){var e=Ext.escapeRe;a=String(a),b===!0?a=e(a):(a="^"+e(a),d===!0&&(a+="$")),a=new RegExp(a,c?"":"i")}return a},clone:function(){var a=new Ext.util.MixedCollection,b=this.keys,c=this.items;for(var d=0,e=c.length;d<e;d++)a.add(b[d],c[d]);return a.getKey=this.getKey,a}}),Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item,Ext.util.JSON=new function(){var useHasOwn=!!{}.hasOwnProperty,isNative=function(){var a=null;return function(){return a===null&&(a=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=="[object JSON]"),a}}(),pad=function(a){return a<10?"0"+a:a},doDecode=function(json){return eval("("+json+")")},doEncode=function(a){if(!Ext.isDefined(a)||a===null)return"null";if(Ext.isArray(a))return encodeArray(a);if(Ext.isDate(a))return Ext.util.JSON.encodeDate(a);if(Ext.isString(a))return encodeString(a);if(typeof a=="number")return isFinite(a)?String(a):"null";if(Ext.isBoolean(a))return String(a);var b=["{"],c,d,e;for(d in a)if(!a.getElementsByTagName)if(!useHasOwn||a.hasOwnProperty(d)){e=a[d];switch(typeof e){case"undefined":case"function":case"unknown":break;default:c&&b.push(","),b.push(doEncode(d),":",e===null?"null":doEncode(e)),c=!0}}return b.push("}"),b.join("")},m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(a){return/["\\\x00-\x1f]/.test(a)?'"'+a.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];return c?c:(c=b.charCodeAt(),"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16))})+'"':'"'+a+'"'},encodeArray=function(a){var b=["["],c,d,e=a.length,f;for(d=0;d<e;d+=1){f=a[d];switch(typeof f){case"undefined":case"function":case"unknown":break;default:c&&b.push(","),b.push(f===null?"null":Ext.util.JSON.encode(f)),c=!0}}return b.push("]"),b.join("")};this.encodeDate=function(a){return'"'+a.getFullYear()+"-"+pad(a.getMonth()+1)+"-"+pad(a.getDate())+"T"+pad(a.getHours())+":"+pad(a.getMinutes())+":"+pad(a.getSeconds())+'"'},this.encode=function(){var a;return function(b){return a||(a=isNative()?JSON.stringify:doEncode),a(b)}}(),this.decode=function(){var a;return function(b){return a||(a=isNative()?JSON.parse:doDecode),a(b)}}()},Ext.encode=Ext.util.JSON.encode,Ext.decode=Ext.util.JSON.decode,Ext.util.Format=function(){var trimRe=/^\s+|\s+$/g,stripTagsRE=/<\/?[^>]+>/gi,stripScriptsRe=/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,nl2brRe=/\r?\n/g;return{ellipsis:function(a,b,c){if(a&&a.length>b){if(c){var d=a.substr(0,b-2),e=Math.max(d.lastIndexOf(" "),d.lastIndexOf("."),d.lastIndexOf("!"),d.lastIndexOf("?"));return e==-1||e<b-15?a.substr(0,b-3)+"...":d.substr(0,e)+"..."}return a.substr(0,b-3)+"..."}return a},undef:function(a){return a!==undefined?a:""},defaultValue:function(a,b){return a!==undefined&&a!==""?a:b},htmlEncode:function(a){return a?String(a).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;"):a},htmlDecode:function(a){return a?String(a).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&"):a},trim:function(a){return String(a).replace(trimRe,"")},substr:function(a,b,c){return String(a).substr(b,c)},lowercase:function(a){return String(a).toLowerCase()},uppercase:function(a){return String(a).toUpperCase()},capitalize:function(a){return a?a.charAt(0).toUpperCase()+a.substr(1).toLowerCase():a},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);return args.unshift(value),eval(fn).apply(window,args)}return eval(fn).call(window,value)},usMoney:function(a){a=Math.round((a-0)*100)/100,a=a==Math.floor(a)?a+".00":a*10==Math.floor(a*10)?a+"0":a,a=String(a);var b=a.split("."),c=b[0],d=b[1]?"."+b[1]:".00",e=/(\d+)(\d{3})/;while(e.test(c))c=c.replace(e,"$1,$2");return a=c+d,a.charAt(0)=="-"?"-$"+a.substr(1):"$"+a},date:function(a,b){return a?(Ext.isDate(a)||(a=new Date(Date.parse(a))),a.dateFormat(b||"m/d/Y")):""},dateRenderer:function(a){return function(b){return Ext.util.Format.date(b,a)}},stripTags:function(a){return a?String(a).replace(stripTagsRE,""):a},stripScripts:function(a){return a?String(a).replace(stripScriptsRe,""):a},fileSize:function(a){return a<1024?a+" bytes":a<1048576?Math.round(a*10/1024)/10+" KB":Math.round(a*10/1048576)/10+" MB"},math:function(){var a={};return function(b,c){return a[c]||(a[c]=new Function("v","return v "+c+";")),a[c](b)}}(),round:function(a,b){var c=Number(a);return typeof b=="number"&&(b=Math.pow(10,b),c=Math.round(a*b)/b),c},number:function(a,b){if(!b)return a;a=Ext.num(a,NaN);if(isNaN(a))return"";var c=",",d=".",e=!1,f=a<0;a=Math.abs(a),b.substr(b.length-2)=="/i"&&(b=b.substr(0,b.length-2),e=!0,c=".",d=",");var g=b.indexOf(c)!=-1,h=(e?b.replace(/[^\d\,]/g,""):b.replace(/[^\d\.]/g,"")).split(d);if(1<h.length)a=a.toFixed(h[1].length);else{if(2<h.length)throw"NumberFormatException: invalid format, formats should have no more than 1 period: "+b;a=a.toFixed(0)}var i=a.toString();h=i.split(".");if(g){var j=h[0],k=[],l=j.length,m=Math.floor(l/3),n=j.length%3||3;for(var o=0;o<l;o+=n)o!=0&&(n=3),k[k.length]=j.substr(o,n),m-=1;i=k.join(c),h[1]&&(i+=d+h[1])}else h[1]&&(i=h[0]+d+h[1]);return(f?"-":"")+b.replace(/[\d,?\.?]+/,i)},numberRenderer:function(a){return function(b){return Ext.util.Format.number(b,a)}},plural:function(a,b,c){return a+" "+(a==1?b:c?c:b+"s")},nl2br:function(a){return Ext.isEmpty(a)?"":a.replace(nl2brRe,"<br/>")}}}(),Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var a=this,b=a.html,c=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^<tpl\b[^>]*?for="(.*?)"/,e=/^<tpl\b[^>]*?if="(.*?)"/,f=/^<tpl\b[^>]*?exec="(.*?)"/,g,h=0,i=[],j="values",k="parent",l="xindex",m="xcount",n="return ",o="with(values){ ";b=["<tpl>",b,"</tpl>"].join("");while(g=b.match(c)){var p=g[0].match(d),q=g[0].match(e),r=g[0].match(f),s=null,t=null,u=null,v=p&&p[1]?p[1]:"";q&&(s=q&&q[1]?q[1]:null,s&&(t=new Function(j,k,l,m,o+n+Ext.util.Format.htmlDecode(s)+"; }"))),r&&(s=r&&r[1]?r[1]:null,s&&(u=new Function(j,k,l,m,o+Ext.util.Format.htmlDecode(s)+"; }")));if(v)switch(v){case".":v=new Function(j,k,o+n+j+"; }");break;case"..":v=new Function(j,k,o+n+k+"; }");break;default:v=new Function(j,k,o+n+v+"; }")}i.push({id:h,target:v,exec:u,test:t,body:g[1]||""}),b=b.replace(g[0],"{xtpl"+h+"}"),++h}for(var w=i.length-1;w>=0;--w)a.compileTpl(i[w]);a.master=i[i.length-1],a.tpls=i},Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,b,c,d,e){var f=this,g,h=f.tpls[a],i,j=[];if(h.test&&!h.test.call(f,b,c,d,e)||h.exec&&h.exec.call(f,b,c,d,e))return"";i=h.target?h.target.call(f,b,c):b,g=i.length,c=h.target?b:c;if(h.target&&Ext.isArray(i)){for(var k=0,g=i.length;k<g;k++)j[j.length]=h.compiled.call(f,i[k],c,k+1,g);return j.join("")}return h.compiled.call(f,i,c,d,e)},compileTpl:function(tpl){function fn(a,b,c,d,e){if(b.substr(0,4)=="xtpl")return"'"+sep+"this.applySubTemplate("+b.substr(4)+", values, parent, xindex, xcount)"+sep+"'";var f;return b==="."?f="values":b==="#"?f="xindex":b.indexOf(".")!=-1?f=b:f="values['"+b+"']",e&&(f="("+f+e+")"),c&&useF?(d=d?","+d:"",c.substr(0,5)!="this."?c="fm."+c+"(":(c='this.call("'+c.substr(5)+'", ',d=", values")):(d="",c="("+f+" === undefined ? '' : "),"'"+sep+c+f+d+")"+sep+"'"}function codeFn(a,b){return"'"+sep+"("+b.replace(/\\'/g,"'")+")"+sep+"'"}var fm=Ext.util.Format,useF=this.disableFormats!==!0,sep=Ext.isGecko?"+":",",body;return Ext.isGecko?body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn
)+"';};":(body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"],body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)),body.push("'].join('');};"),body=body.join("")),eval(body),this},applyTemplate:function(a){return this.master.compiled.call(this,a,{},1,1)},compile:function(){return this}}),Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate,Ext.XTemplate.from=function(a){return a=Ext.getDom(a),new Ext.XTemplate(a.value||a.innerHTML)},Ext.util.CSS=function(){var a=null,b=document,c=/(-[a-z])/gi,d=function(a,b){return b.charAt(1).toUpperCase()};return{createStyleSheet:function(a,c){var d,e=b.getElementsByTagName("head")[0],f=b.createElement("style");f.setAttribute("type","text/css"),c&&f.setAttribute("id",c);if(Ext.isIE)e.appendChild(f),d=f.styleSheet,d.cssText=a;else{try{f.appendChild(b.createTextNode(a))}catch(g){f.cssText=a}e.appendChild(f),d=f.styleSheet?f.styleSheet:f.sheet||b.styleSheets[b.styleSheets.length-1]}return this.cacheStyleSheet(d),d},removeStyleSheet:function(a){var c=b.getElementById(a);c&&c.parentNode.removeChild(c)},swapStyleSheet:function(a,c){this.removeStyleSheet(a);var d=b.createElement("link");d.setAttribute("rel","stylesheet"),d.setAttribute("type","text/css"),d.setAttribute("id",a),d.setAttribute("href",c),b.getElementsByTagName("head")[0].appendChild(d)},refreshCache:function(){return this.getRules(!0)},cacheStyleSheet:function(b){a||(a={});try{var c=b.cssRules||b.rules;for(var d=c.length-1;d>=0;--d)a[c[d].selectorText.toLowerCase()]=c[d]}catch(e){}},getRules:function(c){if(a===null||c){a={};var d=b.styleSheets;for(var e=0,f=d.length;e<f;e++)try{this.cacheStyleSheet(d[e])}catch(g){}}return a},getRule:function(a,b){var c=this.getRules(b);if(!Ext.isArray(a))return c[a.toLowerCase()];for(var d=0;d<a.length;d++)if(c[a[d]])return c[a[d].toLowerCase()];return null},updateRule:function(a,b,e){if(!Ext.isArray(a)){var f=this.getRule(a);if(f)return f.style[b.replace(c,d)]=e,!0}else for(var g=0;g<a.length;g++)if(this.updateRule(a[g],b,e))return!0;return!1}}}(),Ext.util.ClickRepeater=function(a,b){this.el=Ext.get(a),this.el.unselectable(),Ext.apply(this,b),this.addEvents("mousedown","click","mouseup"),this.disabled||(this.disabled=!0,this.enable()),this.handler&&this.on("click",this.handler,this.scope||this),Ext.util.ClickRepeater.superclass.constructor.call(this)},Ext.extend(Ext.util.ClickRepeater,Ext.util.Observable,{interval:20,delay:250,preventDefault:!0,stopDefault:!1,timer:0,enable:function(){this.disabled&&(this.el.on("mousedown",this.handleMouseDown,this),Ext.isIE&&this.el.on("dblclick",this.handleDblClick,this),(this.preventDefault||this.stopDefault)&&this.el.on("click",this.eventOptions,this)),this.disabled=!1},disable:function(a){if(a||!this.disabled)clearTimeout(this.timer),this.pressClass&&this.el.removeClass(this.pressClass),Ext.getDoc().un("mouseup",this.handleMouseUp,this),this.el.removeAllListeners();this.disabled=!0},setDisabled:function(a){this[a?"disable":"enable"]()},eventOptions:function(a){this.preventDefault&&a.preventDefault(),this.stopDefault&&a.stopEvent()},destroy:function(){this.disable(!0),Ext.destroy(this.el),this.purgeListeners()},handleDblClick:function(){clearTimeout(this.timer),this.el.blur(),this.fireEvent("mousedown",this),this.fireEvent("click",this)},handleMouseDown:function(){clearTimeout(this.timer),this.el.blur(),this.pressClass&&this.el.addClass(this.pressClass),this.mousedownTime=new Date,Ext.getDoc().on("mouseup",this.handleMouseUp,this),this.el.on("mouseout",this.handleMouseOut,this),this.fireEvent("mousedown",this),this.fireEvent("click",this),this.accelerate&&(this.delay=400),this.timer=this.click.defer(this.delay||this.interval,this)},click:function(){this.fireEvent("click",this),this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12e3):this.interval,this)},easeOutExpo:function(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},handleMouseOut:function(){clearTimeout(this.timer),this.pressClass&&this.el.removeClass(this.pressClass),this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this),this.pressClass&&this.el.addClass(this.pressClass),this.click()},handleMouseUp:function(){clearTimeout(this.timer),this.el.un("mouseover",this.handleMouseReturn,this),this.el.un("mouseout",this.handleMouseOut,this),Ext.getDoc().un("mouseup",this.handleMouseUp,this),this.el.removeClass(this.pressClass),this.fireEvent("mouseup",this)}}),Ext.KeyNav=function(a,b){this.el=Ext.get(a),Ext.apply(this,b),this.disabled||(this.disabled=!0,this.enable())},Ext.KeyNav.prototype={disabled:!1,defaultEventAction:"stopEvent",forceKeyDown:!1,relay:function(a){var b=a.getKey(),c=this.keyToHandler[b];c&&this[c]&&this.doRelay(a,this[c],c)!==!0&&a[this.defaultEventAction]()},doRelay:function(a,b,c){return b.call(this.scope||this,a)},enter:!1,left:!1,right:!1,up:!1,down:!1,tab:!1,esc:!1,pageUp:!1,pageDown:!1,del:!1,home:!1,end:!1,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},stopKeyUp:function(a){var b=a.getKey();b>=37&&b<=40&&a.stopEvent()},destroy:function(){this.disable()},enable:function(){this.disabled&&(Ext.isSafari2&&this.el.on("keyup",this.stopKeyUp,this),this.el.on(this.isKeydown()?"keydown":"keypress",this.relay,this),this.disabled=!1)},disable:function(){this.disabled||(Ext.isSafari2&&this.el.un("keyup",this.stopKeyUp,this),this.el.un(this.isKeydown()?"keydown":"keypress",this.relay,this),this.disabled=!0)},setDisabled:function(a){this[a?"disable":"enable"]()},isKeydown:function(){return this.forceKeyDown||Ext.EventManager.useKeydown}},Ext.KeyMap=function(a,b,c){this.el=Ext.get(a),this.eventName=c||"keydown",this.bindings=[],b&&this.addBinding(b),this.enable()},Ext.KeyMap.prototype={stopEvent:!1,addBinding:function(a){if(Ext.isArray(a)){Ext.each(a,function(a){this.addBinding(a)},this);return}var b=a.key,c=a.fn||a.handler,d=a.scope;a.stopEvent&&(this.stopEvent=a.stopEvent);if(typeof b=="string"){var e=[],f=b.toUpperCase();for(var g=0,h=f.length;g<h;g++)e.push(f.charCodeAt(g));b=e}var i=Ext.isArray(b),j=function(e){if(this.checkModifiers(a,e)){var f=e.getKey();if(i){for(var g=0,h=b.length;g<h;g++)if(b[g]==f){this.stopEvent&&e.stopEvent(),c.call(d||window,f,e);return}}else f==b&&(this.stopEvent&&e.stopEvent(),c.call(d||window,f,e))}};this.bindings.push(j)},checkModifiers:function(a,b){var c,d,e=["shift","ctrl","alt"];for(var f=0,g=e.length;f<g;++f){d=e[f],c=a[d];if(c!==undefined&&c!==b[d+"Key"])return!1}return!0},on:function(a,b,c){var d,e,f,g;typeof a=="object"&&!Ext.isArray(a)?(d=a.key,e=a.shift,f=a.ctrl,g=a.alt):d=a,this.addBinding({key:d,shift:e,ctrl:f,alt:g,fn:b,scope:c})},handleKeyDown:function(a){if(this.enabled){var b=this.bindings;for(var c=0,d=b.length;c<d;c++)b[c].call(this,a)}},isEnabled:function(){return this.enabled},enable:function(){this.enabled||(this.el.on(this.eventName,this.handleKeyDown,this),this.enabled=!0)},disable:function(){this.enabled&&(this.el.removeListener(this.eventName,this.handleKeyDown,this),this.enabled=!1)},setDisabled:function(a){this[a?"disable":"enable"]()}},Ext.util.TextMetrics=function(){var a;return{measure:function(b,c,d){return a||(a=Ext.util.TextMetrics.Instance(b,d)),a.bind(b),a.setFixedWidth(d||"auto"),a.getSize(c)},createInstance:function(a,b){return Ext.util.TextMetrics.Instance(a,b)}}}(),Ext.util.TextMetrics.Instance=function(a,b){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom),c.position("absolute"),c.setLeftTop(-1e3,-1e3),c.hide(),b&&c.setWidth(b);var d={getSize:function(a){c.update(a);var b=c.getSize();return c.update(""),b},bind:function(a){c.setStyle(Ext.fly(a).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(a){c.setWidth(a)},getWidth:function(a){return c.dom.style.width="auto",this.getSize(a).width},getHeight:function(a){return this.getSize(a).height}};return d.bind(a),d},Ext.Element.addMethods({getTextWidth:function(a,b,c){return Ext.util.TextMetrics.measure(this.dom,Ext.value(a,this.dom.innerHTML,!0)).width.constrain(b||0,c||1e6)}}),Ext.util.Cookies={set:function(a,b){var c=arguments,d=arguments.length,e=d>2?c[2]:null,f=d>3?c[3]:"/",g=d>4?c[4]:null,h=d>5?c[5]:!1;document.cookie=a+"="+escape(b)+(e===null?"":"; expires="+e.toGMTString())+(f===null?"":"; path="+f)+(g===null?"":"; domain="+g)+(h===!0?"; secure":"")},get:function(a){var b=a+"=",c=b.length,d=document.cookie.length,e=0,f=0;while(e<d){f=e+c;if(document.cookie.substring(e,f)==b)return Ext.util.Cookies.getCookieVal(f);e=document.cookie.indexOf(" ",e)+1;if(e===0)break}return null},clear:function(a){Ext.util.Cookies.get(a)&&(document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT")},getCookieVal:function(a){var b=document.cookie.indexOf(";",a);return b==-1&&(b=document.cookie.length),unescape(document.cookie.substring(a,b))}},Ext.handleError=function(a){throw a},Ext.Error=function(a){this.message=this.lang[a]?this.lang[a]:a},Ext.Error.prototype=new Error,Ext.apply(Ext.Error.prototype,{lang:{},name:"Ext.Error",getName:function(){return this.name},getMessage:function(){return this.message},toJson:function(){return Ext.encode(this)}}),Ext.ComponentMgr=function(){var a=new Ext.util.MixedCollection,b={},c={};return{register:function(b){a.add(b)},unregister:function(b){a.remove(b)},get:function(b){return a.get(b)},onAvailable:function(b,c,d){a.on("add",function(e,f){f.id==b&&(c.call(d||f,f),a.un("add",c,d))})},all:a,types:b,ptypes:c,isRegistered:function(a){return b[a]!==undefined},isPluginRegistered:function(a){return c[a]!==undefined},registerType:function(a,c){b[a]=c,c.xtype=a},create:function(a,c){return a.render?a:new b[a.xtype||c](a)},registerPlugin:function(a,b){c[a]=b,b.ptype=a},createPlugin:function(a,b){var d=c[a.ptype||b];return d.init?d:new d(a)}}}(),Ext.reg=Ext.ComponentMgr.registerType,Ext.preg=Ext.ComponentMgr.registerPlugin,Ext.create=Ext.ComponentMgr.create,Ext.Component=function(a){a=a||{};if(a.initialConfig)a.isAction&&(this.baseAction=a),a=a.initialConfig;else if(a.tagName||a.dom||Ext.isString(a))a={applyTo:a,id:a.id||a};this.initialConfig=a,Ext.apply(this,a),this.addEvents("added","disable","enable","beforeshow","show","beforehide","hide","removed","beforerender","render","afterrender","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave"),this.getId(),Ext.ComponentMgr.register(this),Ext.Component.superclass.constructor.call(this),this.baseAction&&this.baseAction.addComponent(this),this.initComponent();if(this.plugins)if(Ext.isArray(this.plugins))for(var b=0,c=this.plugins.length;b<c;b++)this.plugins[b]=this.initPlugin(this.plugins[b]);else this.plugins=this.initPlugin(this.plugins);this.stateful!==!1&&this.initState(),this.applyTo?(this.applyToMarkup(this.applyTo),delete this.applyTo):this.renderTo&&(this.render(this.renderTo),delete this.renderTo)},Ext.Component.AUTO_ID=1e3,Ext.extend(Ext.Component,Ext.util.Observable,{disabled:!1,hidden:!1,autoEl:"div",disabledClass:"x-item-disabled",allowDomMove:!0,autoShow:!1,hideMode:"display",hideParent:!1,rendered:!1,tplWriteMode:"overwrite",bubbleEvents:[],ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(a){return a.ptype&&!Ext.isFunction(a.init)?a=Ext.ComponentMgr.createPlugin(a):Ext.isString(a)&&(a=Ext.ComponentMgr.createPlugin({ptype:a})),a.init(this),a},initComponent:function(){this.listeners&&(this.on(this.listeners),delete this.listeners),this.enableBubble(this.bubbleEvents)},render:function(a,b){if(!this.rendered&&this.fireEvent("beforerender",this)!==!1){!a&&this.el&&(this.el=Ext.get(this.el),a=this.el.dom.parentNode,this.allowDomMove=!1),this.container=Ext.get(a),this.ctCls&&this.container.addClass(this.ctCls),this.rendered=!0,b!==undefined&&(Ext.isNumber(b)?b=this.container.dom.childNodes[b]:b=Ext.getDom(b)),this.onRender(this.container,b||null),this.autoShow&&this.el.removeClass(["x-hidden","x-hide-"+this.hideMode]),this.cls&&(this.el.addClass(this.cls),delete this.cls),this.style&&(this.el.applyStyles(this.style),delete this.style),this.overCls&&this.el.addClassOnOver(this.overCls),this.fireEvent("render",this);var c=this.getContentTarget();this.html&&(c.update(Ext.DomHelper.markup(this.html)),delete this.html);if(this.contentEl){var d=Ext.getDom(this.contentEl);Ext.fly(d).removeClass(["x-hidden","x-hide-display"]),c.appendChild(d)}this.tpl&&(this.tpl.compile||(this.tpl=new Ext.XTemplate(this.tpl)),this.data&&(this.tpl[this.tplWriteMode](c,this.data),delete this.data)),this.afterRender(this.container),this.hidden&&this.doHide(),this.disabled&&this.disable(!0),this.stateful!==!1&&this.initStateEvents(),this.fireEvent("afterrender",this)}return this},update:function(a,b,c){var d=this.getContentTarget();if(this.tpl&&typeof a!="string")this.tpl[this.tplWriteMode](d,a||{});else{var e=Ext.isObject(a)?Ext.DomHelper.markup(a):a;d.update(e,b,c)}},onAdded:function(a,b){this.ownerCt=a,this.initRef(),this.fireEvent("added",this,a,b)},onRemoved:function(){this.removeRef(),this.fireEvent("removed",this,this.ownerCt),delete this.ownerCt},initRef:function(){if(this.ref&&!this.refOwner){var a=this.ref.split("/"),b=a.length,c=0,d=this;while(d&&c<b)d=d.ownerCt,++c;d&&(d[this.refName=a[--c]]=this,this.refOwner=d)}},removeRef:function(){this.refOwner&&this.refName&&(delete this.refOwner[this.refName],delete this.refOwner)},initState:function(){if(Ext.state.Manager){var a=this.getStateId();if(a){var b=Ext.state.Manager.get(a);b&&this.fireEvent("beforestaterestore",this,b)!==!1&&(this.applyState(Ext.apply({},b)),this.fireEvent("staterestore",this,b))}}},getStateId:function(){return this.stateId||(/^(ext-comp-|ext-gen)/.test(String(this.id))?null:this.id)},initStateEvents:function(){if(this.stateEvents)for(var a=0,b;b=this.stateEvents[a];a++)this.on(b,this.saveState,this,{delay:100})},applyState:function(a){a&&Ext.apply(this,a)},getState:function(){return null},saveState:function(){if(Ext.state.Manager&&this.stateful!==!1){var a=this.getStateId();if(a){var b=this.getState();this.fireEvent("beforestatesave",this,b)!==!1&&(Ext.state.Manager.set(a,b),this.fireEvent("statesave",this,b))}}},applyToMarkup:function(a){this.allowDomMove=!1,this.el=Ext.get(a),this.render(this.el.dom.parentNode)},addClass:function(a){return this.el?this.el.addClass(a):this.cls=this.cls?this.cls+" "+a:a,this},removeClass:function(a){return this.el?this.el.removeClass(a):this.cls&&(this.cls=this.cls.split(" ").remove(a).join(" ")),this},onRender:function(a,b){if(!this.el&&this.autoEl){if(Ext.isString(this.autoEl))this.el=document.createElement(this.autoEl);else{var c=document.createElement("div");Ext.DomHelper.overwrite(c,this.autoEl),this.el=c.firstChild}this.el.id||(this.el.id=this.getId())}this.el&&(this.el=Ext.get(this.el),this.allowDomMove!==!1&&(a.dom.insertBefore(this.el.dom,b),c&&(Ext.removeNode(c),c=null)))},getAutoCreate:function(){var a=Ext.isObject(this.autoCreate)?this.autoCreate:Ext.apply({},this.defaultAutoCreate);return this.id&&!a.id&&(a.id=this.id),a},afterRender:Ext.emptyFn,destroy:function(){this.isDestroyed||this.fireEvent("beforedestroy",this)!==!1&&(this.destroying=!0,this.beforeDestroy(),this.ownerCt&&this.ownerCt.remove&&this.ownerCt.remove(this,!1),this.rendered&&(this.el.remove(),(this.actionMode=="container"||this.removeMode=="container")&&this.container.remove()),this.focusTask&&this.focusTask.cancel&&this.focusTask.cancel(),this.onDestroy(),Ext.ComponentMgr.unregister(this),this.fireEvent("destroy",this),this.purgeListeners(),this.destroying=!1,this.isDestroyed=!0)},deleteMembers:function(){var a=arguments;for(var b=0,c=a.length;b<c;++b)delete this[a[b]]},beforeDestroy:Ext.emptyFn,onDestroy:Ext.emptyFn,getEl:function(){return this.el},getContentTarget:function(){return this.el},getId:function(){return this.id||(this.id="ext-comp-"+ ++Ext.Component.AUTO_ID)},getItemId:function(){return this.itemId||this.getId()},focus:function(a,b){if(b){this.focusTask=new Ext.util.DelayedTask(this.focus,this,[a,!1]),this.focusTask.delay(Ext.isNumber(b)?b:10);return}return this.rendered&&!this.isDestroyed&&(this.el.focus(),a===!0&&this.el.dom.select()),this},blur:function(){return this.rendered&&this.el.blur(),this},disable:function(a){return this.rendered&&this.onDisable(),this.disabled=!0,a!==!0&&this.fireEvent("disable",this),this},onDisable:function(){this.getActionEl().addClass(this.disabledClass),this.el.dom.disabled=!0},enable:function(){return this.rendered&&this.onEnable(),this.disabled=!1,this.fireEvent("enable",this),this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass),this.el.dom.disabled=!1},setDisabled:function(a){return this[a?"disable":"enable"]()},show:function(){return this.fireEvent("beforeshow",this)!==!1&&(this.hidden=!1,this.autoRender&&this.render(Ext.isBoolean(this.autoRender)?Ext.getBody():this.autoRender),this.rendered&&this.onShow(),this.fireEvent("show",this)),this},onShow:function(){this.getVisibilityEl().removeClass("x-hide-"+this.hideMode)},hide:function(){return this.fireEvent("beforehide",this)!==!1&&(this.doHide(),this.fireEvent("hide",this)),this},doHide:function(){this.hidden=!0,this.rendered&&this.onHide()},onHide:function(){this.getVisibilityEl().addClass("x-hide-"+this.hideMode)},getVisibilityEl:function(){return this.hideParent?this.container:this.getActionEl()},setVisible:function(a){return this[a?"show":"hide"]()},isVisible:function(){return this.rendered&&this.getVisibilityEl().isVisible()},cloneConfig:function(a){a=a||{};var b=a.id||Ext.id(),c=Ext.applyIf(a,this.initialConfig);return c.id=b,new this.constructor(c)},getXType:function(){return this.constructor.xtype},isXType:function(a,b){return Ext.isFunction(a)?a=a.xtype:Ext.isObject(a)&&(a=a.constructor.xtype),b?this.constructor.xtype==a:("/"+this.getXTypes()+"/").indexOf("/"+a+"/")!=-1},getXTypes:function(){var a=this.constructor;if(!a.xtypes){var b=[],c=this;while(c&&c.constructor.xtype)b.unshift(c.constructor.xtype),c=c.constructor.superclass;a.xtypeChain=b,a.xtypes=b.join("/")}return a.xtypes},findParentBy:function(a){for(var b=this.ownerCt;b!=null&&!a(b,this);b=b.ownerCt);return b||null},findParentByType:function(a){return Ext.isFunction(a)?this.findParentBy(function(b){return b.constructor===a}):this.findParentBy(function(b){return b.constructor.xtype===a})},getPositionEl:function(){return this.positionEl||this.el},purgeListeners:function(){Ext.Component.superclass.purgeListeners.call(this),this.mons&&this.on("beforedestroy",this.clearMons,this,{single:!0})},clearMons:function(){Ext.each(this.mons,function(a){a.item.un(a.ename,a.fn,a.scope)},this),this.mons=[]},createMons:function(){this.mons||(this.mons=[],this.on("beforedestroy",this.clearMons,this,{single:!0}))},mon:function(a,b,c,d,e){this.createMons();if(Ext.isObject(b)){var f=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,g=b;for(var h in g){if(f.test(h))continue;Ext.isFunction(g[h])?(this.mons.push({item:a,ename:h,fn:g[h],scope:g.scope}),a.on(h,g[h],g.scope,g)):(this.mons.push({item:a,ename:h,fn:g[h],scope:g.scope}),a.on(h,g[h]))}return}this.mons.push({item:a,ename:b,fn:c,scope:d}),a.on(b,c,d,e)},mun:function(a,b,c,d){var e,f;this.createMons();for(var g=0,h=this.mons.length;g<h;++g){f=this.mons[g];if(a===f.item&&b==f.ename&&c===f.fn&&d===f.scope){this.mons.splice(g,1),a.un(b,c,d),e=!0;break}}return e},nextSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a!=-1&&a+1<this.ownerCt.items.getCount())return this.ownerCt.items.itemAt(a+1)}return null},previousSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a>0)return this.ownerCt.items.itemAt(a-1)}return null},getBubbleTarget:function(){return this.ownerCt}}),Ext.reg("component",Ext.Component),Ext.Action=Ext.extend(Object,{constructor:function(a){this.initialConfig=a,this.itemId=a.itemId=a.itemId||a.id||Ext.id(),this.items=[]},isAction:!0,setText:function(a){this.initialConfig.text=a,this.callEach("setText",[a])},getText:function(){return this.initialConfig.text},setIconClass:function(a){this.initialConfig.iconCls=a,this.callEach("setIconClass",[a])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(a){this.initialConfig.disabled=a,this.callEach("setDisabled",[a])},enable:function(){this.setDisabled(!1)},disable:function(){this.setDisabled(!0)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(a){this.initialConfig.hidden=a,this.callEach("setVisible",[!a])},show:function(){this.setHidden(!1)},hide:function(){this.setHidden(!0)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(a,b){this.initialConfig.handler=a,this.initialConfig.scope=b,this.callEach("setHandler",[a,b])},each:function(a,b){Ext.each(this.items,a,b)},callEach:function(a,b){var c=this.items;for(var d=0,e=c.length;d<e;d++)c[d][a].apply(c[d],b)},addComponent:function(a){this.items.push(a),a.on("destroy",this.removeComponent,this)},removeComponent:function(a){this.items.remove(a)},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments)}}),function(){Ext.Layer=function(a,b){a=a||{};var c=Ext.DomHelper,d=a.parentEl,e=d?Ext.getDom(d):document.body;b&&(this.dom=Ext.getDom(b));if(!this.dom){var f=a.dh||{tag:"div",cls:"x-layer"};this.dom=c.append(e,f)}a.cls&&this.addClass(a.cls),this.constrain=a.constrain!==!1,this.setVisibilityMode(Ext.Element.VISIBILITY),a.id?this.id=this.dom.id=a.id:this.id=Ext.id(this.dom),this.zindex=a.zindex||this.getZIndex(),this.position("absolute",this.zindex),a.shadow?(this.shadowOffset=a.shadowOffset||4,this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:a.shadow})):this.shadowOffset=0,this.useShim=a.shim!==!1&&Ext.useShims,this.useDisplay=a.useDisplay,this.hide()};var a=Ext.Element.prototype,b=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt((this.getShim()||this).getStyle("z-index"),10)||11e3},getShim:function(){if(!this.useShim)return null;if(this.shim)return this.shim;var a=b.shift();a||(a=this.createShim(),a.enableDisplayMode("block"),a.dom.style.display="none",a.dom.style.visibility="visible");var c=this.dom.parentNode;return a.dom.parentNode!=c&&c.insertBefore(a.dom,this.dom),a.setStyle("z-index",this.getZIndex()-2),this.shim=a,a},hideShim:function(){this.shim&&(this.shim.setDisplayed(!1),b.push(this.shim),delete this.shim)},disableShadow:function(){this.shadow&&(this.shadowDisabled=!0,this.shadow.hide(),this.lastShadowOffset=this.shadowOffset,this.shadowOffset=0)},enableShadow:function(a){this.shadow&&(this.shadowDisabled=!1,this.shadowOffset=this.lastShadowOffset,delete this.lastShadowOffset,a&&this.sync(!0))},sync:function(a){var b=this.shadow;if(!this.updating&&this.isVisible()&&(b||this.useShim)){var c=this.getShim(),d=this.getWidth(),e=this.getHeight(),f=this.getLeft(!0),g=this.getTop(!0);if(b&&!this.shadowDisabled){a&&!b.isVisible()?b.show(this):b.realign(f,g,d,e);if(c){a&&c.show();var h=b.el.getXY(),i=c.dom.style,j=b.el.getSize();i.left=h[0]+"px",i.top=h[1]+"px",i.width=j.width+"px",i.height=j.height+"px"}}else c&&(a&&c.show(),c.setSize(d,e),c.setLeftTop(f,g))}},destroy:function(){this.hideShim(),this.shadow&&this.shadow.hide(),this.removeAllListeners(),Ext.removeNode(this.dom),delete this.dom},remove:function(){this.destroy()},beginUpdate:function(){this.updating=!0},endUpdate:function(){this.updating=!1,this.sync(!0)},hideUnders:function(a){this.shadow&&this.shadow.hide(),this.hideShim()},constrainXY:function(){if(this.constrain){var b=Ext.lib.Dom.getViewWidth(),c=Ext.lib.Dom.getViewHeight(),d=Ext.getDoc().getScroll(),e=this.getXY(),f=e[0],g=e[1],h=this.shadowOffset,i=this.dom.offsetWidth+h,j=this.dom.offsetHeight+h,k=!1;f+i>b+d.left&&(f=b-i-h,k=!0),g+j>c+d.top&&(g=c-j-h,k=!0),f<d.left&&(f=d.left,k=!0),g<d.top&&(g=d.top,k=!0);if(k){if(this.avoidY){var l=this.avoidY;g<=l&&g+j>=l&&(g=l-j-5)}e=[f,g],this.storeXY(e),a.setXY.call(this,e),this.sync()}}return this},isVisible:function(){return this.visible},showAction:function(){this.visible=!0,this.useDisplay===!0?this.setDisplayed(""):this.lastXY?a.setXY.call(this,this.lastXY):this.lastLT&&a.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])},hideAction:function(){this.visible=!1,this.useDisplay===!0?this.setDisplayed(!1):this.setLeftTop(-1e4,-1e4)},setVisible:function(b,c,d,e,f){b&&this.showAction();if(c&&b){var g=function(){this.sync(!0),e&&e()}.createDelegate(this);a.setVisible.call(this,!0,!0,d,g,f)}else{b||this.hideUnders(!0);var g=e;c&&(g=function(){this.hideAction(),e&&e()}.createDelegate(this)),a.setVisible.call(this,b,c,d,g,f),b?this.sync(!0):c||this.hideAction()}return this},storeXY:function(a){delete this.lastLT,this.lastXY=a},storeLeftTop:function(a,b){delete this.lastXY,this.lastLT=[a,b]},beforeFx:function(){return this.beforeAction(),Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments),this.sync(this.isVisible())},beforeAction:function(){!this.updating&&this.shadow&&this.shadow.hide()},setLeft:function(b){return this.storeLeftTop(b,this.getTop(!0)),a.setLeft.apply(this,arguments),this.sync(),this},setTop:function(b){return this.storeLeftTop(this.getLeft(!0),b),a.setTop.apply(this,arguments),this.sync(),this},setLeftTop:function(b,c){return this.storeLeftTop(b,c),a.setLeftTop.apply(this,arguments),this.sync(),this},setXY:function(b,c,d,e,f){this.fixDisplay(),this.beforeAction(),this.storeXY(b);var g=this.createCB(e);return a.setXY.call(this,b,c,d,g,f),c||g(),this},createCB:function(a){var b=this;return function(){b.constrainXY(),b.sync(!0),a&&a()}},setX:function(a,b,c,d,e){return this.setXY([a,this.getY()],b,c,d,e),this},setY:function(a,b,c,d,e){return this.setXY([this.getX(),a],b,c,d,e),this},setSize:function(b,c,d,e,f,g){this.beforeAction();var h=this.createCB(f);return a.setSize.call(this,b,c,d,e,h,g),d||h(),this},setWidth:function(b,c,d,e,f){this.beforeAction();var g=this.createCB(e);return a.setWidth.call(this,b,c,d,g,f),c||g(),this},setHeight:function(b,c,d,e,f){this.beforeAction();var g=this.createCB(e);return a.setHeight.call(this,b,c,d,g,f),c||g(),this},setBounds:function(b,c,d,e,f,g,h,i){this.beforeAction();var j=this.createCB(h);return f?a.setBounds.call(this,b,c,d,e,f,g,j,i):(this.storeXY([b,c]),a.setXY.call(this,[b,c]),a.setSize.call(this,d,e,f,g,j,i),j()),this},setZIndex:function(a){return this.zindex=a,this.setStyle("z-index",a+2),this.shadow&&this.shadow.setZIndex(a+1),this.shim&&this.shim.setStyle("z-index",a),this}})}(),Ext.Shadow=function(a){Ext.apply(this,a),typeof this.mode!="string"&&(this.mode=this.defaultMode);var b=this.offset,c={h:0},d=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":c.w=0,c.l=c.t=b,c.t-=1,Ext.isIE&&(c.l-=this.offset+d,c.t-=this.offset+d,c.w-=d,c.h-=d,c.t+=1);break;case"sides":c.w=b*2,c.l=-b,c.t=b-1,Ext.isIE&&(c.l-=this.offset-d,c.t-=this.offset+d,c.l+=1,c.w-=(this.offset-d)*2,c.w-=d+1,c.h-=1);break;case"frame":c.w=c.h=b*2,c.l=c.t=-b,c.t+=1,c.h-=2,Ext.isIE&&(c.l-=this.offset-d,c.t-=this.offset-d,c.l+=1,c.w-=this.offset+d+1,c.h-=this.offset+d,c.h+=1)}this.adjusts=c},Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(a){a=Ext.get(a),this.el||(this.el=Ext.Shadow.Pool.pull(),this.el.dom.nextSibling!=a.dom&&this.el.insertBefore(a)),this.el.setStyle("z-index",this.zIndex||parseInt(a.getStyle("z-index"),10)-1),Ext.isIE&&(this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+this.offset+")"),this.realign(a.getLeft(!0),a.getTop(!0),a.getWidth(),a.getHeight()),this.el.dom.style.display="block"},isVisible:function(){return this.el?!0:!1},realign:function(a,b,c,d){if(!this.el)return;var e=this.adjusts,f=this.el.dom,g=f.style,h=0;g.left=a+e.l+"px",g.top=b+e.t+"px";var i=c+e.w,j=d+e.h,k=i+"px",l=j+"px";if(g.width!=k||g.height!=l){g.width=k,g.height=l;if(!Ext.isIE){var m=f.childNodes,n=Math.max(0,i-12)+"px";m[0].childNodes[1].style.width=n,m[1].childNodes[1].style.width=n,m[2].childNodes[1].style.width=n,m[1].style.height=Math.max(0,j-12)+"px"}}},hide:function(){this.el&&(this.el.dom.style.display="none",Ext.Shadow.Pool.push(this.el),delete this.el)},setZIndex:function(a){this.zIndex=a,this.el&&this.el.setStyle("z-index",a)}},Ext.Shadow.Pool=function(){var a=[],b=Ext.isIE?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';return{pull:function(){var c=a.shift();return c||(c=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,b)),c.autoBoxAdjust=!1),c},push:function(b){a.push(b)}}}(),Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this),this.addEvents("resize","move")},boxReady:!1,deferHeight:!1,setSize:function(a,b){typeof a=="object"&&(b=a.height,a=a.width),Ext.isDefined(a)&&Ext.isDefined(this.boxMinWidth)&&a<this.boxMinWidth&&(a=this.boxMinWidth),Ext.isDefined(b)&&Ext.isDefined(this.boxMinHeight)&&b<this.boxMinHeight&&(b=this.boxMinHeight),Ext.isDefined(a)&&Ext.isDefined(this.boxMaxWidth)&&a>this.boxMaxWidth&&(a=this.boxMaxWidth),Ext.isDefined(b)&&Ext.isDefined(this.boxMaxHeight)&&b>this.boxMaxHeight&&(b=this.boxMaxHeight);if(!this.boxReady)return this.width=a,this.height=b,this;if(this.cacheSizes!==!1&&this.lastSize&&this.lastSize.width==a&&this.lastSize.height==b)return this;this.lastSize={width:a,height:b};var c=this.adjustSize(a,b),d=c.width,e=c.height,f;if(d!==undefined||e!==undefined)f=this.getResizeEl(),!this.deferHeight&&d!==undefined&&e!==undefined?f.setSize(d,e):!this.deferHeight&&e!==undefined?f.setHeight(e):d!==undefined&&f.setWidth(d),this.onResize(d,e,a,b),this.fireEvent("resize",this,d,e,a,b);return this},setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.getResizeEl().getSize()},getWidth:function(){return this.getResizeEl().getWidth()},getHeight:function(){return this.getResizeEl().getHeight()},getOuterSize:function(){var a=this.getResizeEl();return{width:a.getWidth()+a.getMargins("lr"),height:a.getHeight()+a.getMargins("tb")}},getPosition:function(a){var b=this.getPositionEl();return a===!0?[b.getLeft(!0),b.getTop(!0)]:this.xy||b.getXY()},getBox:function(a){var b=this.getPosition(a),c=this.getSize();return c.x=b[0],c.y=b[1],c},updateBox:function(a){return this.setSize(a.width,a.height),this.setPagePosition(a.x,a.y),this},getResizeEl:function(){return this.resizeEl||this.el},setAutoScroll:function(a){return this.rendered&&this.getContentTarget().setOverflow(a?"auto":""),this.autoScroll=a,this},setPosition:function(a,b){a&&typeof a[1]=="number"&&(b=a[1],a=a[0]),this.x=a,this.y=b;if(!this.boxReady)return this;var c=this.adjustPosition(a,b),d=c.x,e=c.y,f=this.getPositionEl();if(d!==undefined||e!==undefined)d!==undefined&&e!==undefined?f.setLeftTop(d,e):d!==undefined?f.setLeft(d):e!==undefined&&f.setTop(e),this.onPosition(d,e),this.fireEvent("move",this,d,e);return this},setPagePosition:function(a,b){a&&typeof a[1]=="number"&&(b=a[1],a=a[0]),this.pageX=a,this.pageY=b;if(!this.boxReady)return;if(a===undefined||b===undefined)return;var c=this.getPositionEl().translatePoints(a,b);return this.setPosition(c.left,c.top),this},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this),this.resizeEl&&(this.resizeEl=Ext.get(this.resizeEl)),this.positionEl&&(this.positionEl=Ext.get(this.positionEl)),this.boxReady=!0,Ext.isDefined(this.autoScroll)&&this.setAutoScroll(this.autoScroll),this.setSize(this.width,this.height),this.x||this.y?this.setPosition(this.x,this.y):(this.pageX||this.pageY)&&this.setPagePosition(this.pageX,this.pageY)},syncSize:function(){return delete this.lastSize,this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight()),this},onResize:function(a,b,c,d){},onPosition:function(a,b){},adjustSize:function(a,b){return this.autoWidth&&(a="auto"),this.autoHeight&&(b="auto"),{width:a,height:b}},adjustPosition:function(a,b){return{x:a,y:b}}}),Ext.reg("box",Ext.BoxComponent),Ext.Spacer=Ext.extend(Ext.BoxComponent,{autoEl:"div"}),Ext.reg("spacer",Ext.Spacer),Ext.SplitBar=function(a,b,c,d,e){this.el=Ext.get(a,!0),this.
el.dom.unselectable="on",this.resizingEl=Ext.get(b,!0),this.orientation=c||Ext.SplitBar.HORIZONTAL,this.minSize=0,this.maxSize=2e3,this.animate=!1,this.useShim=!1,this.shim=null,e?this.proxy=Ext.get(e).dom:this.proxy=Ext.SplitBar.createProxy(this.orientation),this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id}),this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this),this.dd.endDrag=this.onEndProxyDrag.createDelegate(this),this.dragSpecs={},this.adapter=new Ext.SplitBar.BasicLayoutAdapter,this.adapter.init(this),this.orientation==Ext.SplitBar.HORIZONTAL?(this.placement=d||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT),this.el.addClass("x-splitbar-h")):(this.placement=d||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM),this.el.addClass("x-splitbar-v")),this.addEvents("resize","moved","beforeresize","beforeapply"),Ext.SplitBar.superclass.constructor.call(this)},Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(a,b){this.fireEvent("beforeresize",this),this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:"&#160;"},!0),this.overlay.unselectable(),this.overlay.setSize(Ext.lib.Dom.getViewWidth(!0),Ext.lib.Dom.getViewHeight(!0)),this.overlay.show(),Ext.get(this.proxy).setDisplayed("block");var c=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize(),this.activeMaxSize=this.getMaximumSize();var d=c-this.activeMinSize,e=Math.max(this.activeMaxSize-c,0);this.orientation==Ext.SplitBar.HORIZONTAL?(this.dd.resetConstraints(),this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?d:e,this.placement==Ext.SplitBar.LEFT?e:d,this.tickSize),this.dd.setYConstraint(0,0)):(this.dd.resetConstraints(),this.dd.setXConstraint(0,0),this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?d:e,this.placement==Ext.SplitBar.TOP?e:d,this.tickSize)),this.dragSpecs.startSize=c,this.dragSpecs.startPoint=[a,b],Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,a,b)},onEndProxyDrag:function(a){Ext.get(this.proxy).setDisplayed(!1);var b=Ext.lib.Event.getXY(a);this.overlay&&(Ext.destroy(this.overlay),delete this.overlay);var c;this.orientation==Ext.SplitBar.HORIZONTAL?c=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?b[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-b[0]):c=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?b[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-b[1]),c=Math.min(Math.max(c,this.activeMinSize),this.activeMaxSize),c!=this.dragSpecs.startSize&&this.fireEvent("beforeapply",this,c)!==!1&&(this.adapter.setElementSize(this,c),this.fireEvent("moved",this,c),this.fireEvent("resize",this,c))},getAdapter:function(){return this.adapter},setAdapter:function(a){this.adapter=a,this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(a){this.minSize=a},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(a){this.maxSize=a},setCurrentSize:function(a){var b=this.animate;this.animate=!1,this.adapter.setElementSize(this,a),this.animate=b},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy)),this.dd.unreg(),a&&this.el.remove(),this.purgeListeners()}}),Ext.SplitBar.createProxy=function(a){var b=new Ext.Element(document.createElement("div"));document.body.appendChild(b.dom),b.unselectable();var c="x-splitbar-proxy";return b.addClass(c+" "+(a==Ext.SplitBar.HORIZONTAL?c+"-h":c+"-v")),b.dom},Ext.SplitBar.BasicLayoutAdapter=function(){},Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(a){},getElementSize:function(a){return a.orientation==Ext.SplitBar.HORIZONTAL?a.resizingEl.getWidth():a.resizingEl.getHeight()},setElementSize:function(a,b,c){a.orientation==Ext.SplitBar.HORIZONTAL?a.animate?a.resizingEl.setWidth(b,!0,.1,c,"easeOut"):(a.resizingEl.setWidth(b),c&&c(a,b)):a.animate?a.resizingEl.setHeight(b,!0,.1,c,"easeOut"):(a.resizingEl.setHeight(b),c&&c(a,b))}},Ext.SplitBar.AbsoluteLayoutAdapter=function(a){this.basic=new Ext.SplitBar.BasicLayoutAdapter,this.container=Ext.get(a)},Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(a){this.basic.init(a)},getElementSize:function(a){return this.basic.getElementSize(a)},setElementSize:function(a,b,c){this.basic.setElementSize(a,b,this.moveSplitter.createDelegate(this,[a]))},moveSplitter:function(a){var b=Ext.SplitBar;switch(a.placement){case b.LEFT:a.el.setX(a.resizingEl.getRight());break;case b.RIGHT:a.el.setStyle("right",this.container.getWidth()-a.resizingEl.getLeft()+"px");break;case b.TOP:a.el.setY(a.resizingEl.getBottom());break;case b.BOTTOM:a.el.setY(a.resizingEl.getTop()-a.el.getHeight())}}},Ext.SplitBar.VERTICAL=1,Ext.SplitBar.HORIZONTAL=2,Ext.SplitBar.LEFT=1,Ext.SplitBar.RIGHT=2,Ext.SplitBar.TOP=3,Ext.SplitBar.BOTTOM=4,Ext.Container=Ext.extend(Ext.BoxComponent,{bufferResize:50,autoDestroy:!0,forceLayout:!1,defaultType:"panel",resizeEvent:"resize",bubbleEvents:["add","remove"],initComponent:function(){Ext.Container.superclass.initComponent.call(this),this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var a=this.items;a&&(delete this.items,this.add(a))},initItems:function(){this.items||(this.items=new Ext.util.MixedCollection(!1,this.getComponentId),this.getLayout())},setLayout:function(a){this.layout&&this.layout!=a&&this.layout.setContainer(null),this.layout=a,this.initItems(),a.setContainer(this)},afterRender:function(){Ext.Container.superclass.afterRender.call(this),this.layout||(this.layout="auto"),Ext.isObject(this.layout)&&!this.layout.layout&&(this.layoutConfig=this.layout,this.layout=this.layoutConfig.type),Ext.isString(this.layout)&&(this.layout=new(Ext.Container.LAYOUTS[this.layout.toLowerCase()])(this.layoutConfig)),this.setLayout(this.layout);if(this.activeItem!==undefined){var a=this.activeItem;delete this.activeItem,this.layout.setActiveItem(a)}this.ownerCt||this.doLayout(!1,!0),this.monitorResize===!0&&Ext.EventManager.onWindowResize(this.doLayout,this,[!1])},getLayoutTarget:function(){return this.el},getComponentId:function(a){return a.getItemId()},add:function(a){this.initItems();var b=arguments.length>1;if(b||Ext.isArray(a)){var c=[];return Ext.each(b?arguments:a,function(a){c.push(this.add(a))},this),c}var d=this.lookupComponent(this.applyDefaults(a)),e=this.items.length;return this.fireEvent("beforeadd",this,d,e)!==!1&&this.onBeforeAdd(d)!==!1&&(this.items.add(d),d.onAdded(this,e),this.onAdd(d),this.fireEvent("add",this,d,e)),d},onAdd:function(a){},onAdded:function(a,b){this.ownerCt=a,this.initRef(),this.cascade(function(a){a.initRef()}),this.fireEvent("added",this,a,b)},insert:function(a,b){this.initItems();var c=arguments,d=c.length;if(d>2){var e=[];for(var f=d-1;f>=1;--f)e.push(this.insert(a,c[f]));return e}var g=this.lookupComponent(this.applyDefaults(b));return a=Math.min(a,this.items.length),this.fireEvent("beforeadd",this,g,a)!==!1&&this.onBeforeAdd(g)!==!1&&(g.ownerCt==this&&this.items.remove(g),this.items.insert(a,g),g.onAdded(this,a),this.onAdd(g),this.fireEvent("add",this,g,a)),g},applyDefaults:function(a){var b=this.defaults;return b&&(Ext.isFunction(b)&&(b=b.call(this,a)),Ext.isString(a)?(a=Ext.ComponentMgr.get(a),Ext.apply(a,b)):a.events?Ext.apply(a,b):Ext.applyIf(a,b)),a},onBeforeAdd:function(a){a.ownerCt&&a.ownerCt.remove(a,!1),this.hideBorders===!0&&(a.border=a.border===!0)},remove:function(a,b){this.initItems();var c=this.getComponent(a);return c&&this.fireEvent("beforeremove",this,c)!==!1&&(this.doRemove(c,b),this.fireEvent("remove",this,c)),c},onRemove:function(a){},doRemove:function(a,b){var c=this.layout,d=c&&this.rendered;d&&c.onRemove(a),this.items.remove(a),a.onRemoved(),this.onRemove(a),(b===!0||b!==!1&&this.autoDestroy)&&a.destroy(),d&&c.afterRemove(a)},removeAll:function(a){this.initItems();var b,c=[],d=[];this.items.each(function(a){c.push(a)});for(var e=0,f=c.length;e<f;++e)b=c[e],this.remove(b,a),b.ownerCt!==this&&d.push(b);return d},getComponent:function(a){return Ext.isObject(a)&&(a=a.getItemId()),this.items.get(a)},lookupComponent:function(a){return Ext.isString(a)?Ext.ComponentMgr.get(a):a.events?a:this.createComponent(a)},createComponent:function(a,b){if(a.render)return a;var c=Ext.create(Ext.apply({ownerCt:this},a),b||this.defaultType);return delete c.initialConfig.ownerCt,delete c.ownerCt,c},canLayout:function(){var a=this.getVisibilityEl();return a&&a.dom&&!a.isStyle("display","none")},doLayout:function(a,b){var c=this.rendered,d=b||this.forceLayout;if(this.collapsed||!this.canLayout()){this.deferLayout=this.deferLayout||!a;if(!d)return;a=a&&!this.deferLayout}else delete this.deferLayout;c&&this.layout&&this.layout.layout();if(a!==!0&&this.items){var e=this.items.items;for(var f=0,g=e.length;f<g;f++){var h=e[f];h.doLayout&&h.doLayout(!1,d)}}c&&this.onLayout(a,d),this.hasLayout=!0,delete this.forceLayout},onLayout:Ext.emptyFn,shouldBufferLayout:function(){var a=this.hasLayout;return this.ownerCt?a?!this.hasLayoutPending():!1:a},hasLayoutPending:function(){var a=!1;return this.ownerCt.bubble(function(b){if(b.layoutPending)return a=!0,!1}),a},onShow:function(){Ext.Container.superclass.onShow.call(this),Ext.isDefined(this.deferLayout)&&(delete this.deferLayout,this.doLayout(!0))},getLayout:function(){if(!this.layout){var a=new Ext.layout.AutoLayout(this.layoutConfig);this.setLayout(a)}return this.layout},beforeDestroy:function(){var a;if(this.items)while(a=this.items.first())this.doRemove(a,!0);this.monitorResize&&Ext.EventManager.removeResizeListener(this.doLayout,this),Ext.destroy(this.layout),Ext.Container.superclass.beforeDestroy.call(this)},bubble:function(a,b,c){var d=this;while(d){if(a.apply(b||d,c||[d])===!1)break;d=d.ownerCt}return this},cascade:function(a,b,c){if(a.apply(b||this,c||[this])!==!1&&this.items){var d=this.items.items;for(var e=0,f=d.length;e<f;e++)d[e].cascade?d[e].cascade(a,b,c):a.apply(b||d[e],c||[d[e]])}return this},findById:function(a){var b,c=this;return this.cascade(function(d){if(c!=d&&d.id===a)return b=d,!1}),b||null},findByType:function(a,b){return this.findBy(function(c){return c.isXType(a,b)})},find:function(a,b){return this.findBy(function(c){return c[a]===b})},findBy:function(a,b){var c=[],d=this;return this.cascade(function(e){d!=e&&a.call(b||e,e,d)===!0&&c.push(e)}),c},get:function(a){return this.items.get(a)}}),Ext.Container.LAYOUTS={},Ext.reg("container",Ext.Container),Ext.layout.ContainerLayout=Ext.extend(Object,{monitorResize:!1,activeItem:null,constructor:function(a){this.id=Ext.id(null,"ext-layout-"),Ext.apply(this,a)},type:"container",IEMeasureHack:function(a,b){var c=a.dom.childNodes,d=c.length,e,f=[],g,h,i;for(h=0;h<d;h++)e=c[h],g=Ext.get(e),g&&(f[h]=g.getStyle("display"),g.setStyle({display:"none"}));i=a?a.getViewSize(b):{};for(h=0;h<d;h++)e=c[h],g=Ext.get(e),g&&g.setStyle({display:f[h]});return i},getLayoutTargetSize:Ext.EmptyFn,layout:function(){var a=this.container,b=a.getLayoutTarget();!this.hasLayout&&!Ext.isEmpty(this.targetCls)&&b.addClass(this.targetCls),this.onLayout(a,b),a.fireEvent("afterlayout",a,this)},onLayout:function(a,b){this.renderAll(a,b)},isValidParent:function(a,b){return b&&a.getPositionEl().dom.parentNode==(b.dom||b)},renderAll:function(a,b){var c=a.items.items,d,e,f=c.length;for(d=0;d<f;d++)e=c[d],e&&(!e.rendered||!this.isValidParent(e,b))&&this.renderItem(e,d,b)},renderItem:function(a,b,c){a&&(a.rendered?this.isValidParent(a,c)||(Ext.isNumber(b)&&(b=c.dom.childNodes[b]),c.dom.insertBefore(a.getPositionEl().dom,b||null),a.container=c,this.configureItem(a,b)):(a.render(c,b),this.configureItem(a,b)))},getRenderedItems:function(a){var b=a.getLayoutTarget(),c=a.items.items,d=c.length,e,f,g=[];for(e=0;e<d;e++)(f=c[e]).rendered&&this.isValidParent(f,b)&&g.push(f);return g},configureItem:function(a,b){if(this.extraCls){var c=a.getPositionEl?a.getPositionEl():a;c.addClass(this.extraCls)}a.doLayout&&this.forceLayout&&a.doLayout(),this.renderHidden&&a!=this.activeItem&&a.hide()},onRemove:function(a){this.activeItem==a&&delete this.activeItem;if(a.rendered&&this.extraCls){var b=a.getPositionEl?a.getPositionEl():a;b.removeClass(this.extraCls)}},afterRemove:function(a){a.removeRestore&&(a.removeMode="container",delete a.removeRestore)},onResize:function(){var a=this.container,b;if(a.collapsed)return;(b=a.bufferResize&&a.shouldBufferLayout())?(this.resizeTask||(this.resizeTask=new Ext.util.DelayedTask(this.runLayout,this),this.resizeBuffer=Ext.isNumber(b)?b:50),a.layoutPending=!0,this.resizeTask.delay(this.resizeBuffer)):this.runLayout()},runLayout:function(){var a=this.container;this.layout(),a.onLayout(),delete a.layoutPending},setContainer:function(a){if(this.monitorResize&&a!=this.container){var b=this.container;b&&b.un(b.resizeEvent,this.onResize,this),a&&a.on(a.resizeEvent,this.onResize,this)}this.container=a},parseMargins:function(a){Ext.isNumber(a)&&(a=a.toString());var b=a.split(" "),c=b.length;return c==1?b[1]=b[2]=b[3]=b[0]:c==2?(b[2]=b[0],b[3]=b[1]):c==3&&(b[3]=b[1]),{top:parseInt(b[0],10)||0,right:parseInt(b[1],10)||0,bottom:parseInt(b[2],10)||0,left:parseInt(b[3],10)||0}},fieldTpl:function(){var a=new Ext.Template('<div class="x-form-item {itemCls}" tabIndex="-1">','<label for="{id}" style="{labelStyle}" class="x-form-item-label">{label}{labelSeparator}</label>','<div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">','</div><div class="{clearCls}"></div>',"</div>");return a.disableFormats=!0,a.compile()}(),destroy:function(){this.resizeTask&&this.resizeTask.cancel&&this.resizeTask.cancel();if(!Ext.isEmpty(this.targetCls)){var a=this.container.getLayoutTarget();a&&a.removeClass(this.targetCls)}}}),Ext.layout.AutoLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"auto",monitorResize:!0,onLayout:function(a,b){Ext.layout.AutoLayout.superclass.onLayout.call(this,a,b);var c=this.getRenderedItems(a),d=c.length,e,f;for(e=0;e<d;e++)f=c[e],f.doLayout&&f.doLayout(!0)}}),Ext.Container.LAYOUTS.auto=Ext.layout.AutoLayout,Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:!0,type:"fit",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();return a?a.getStyleSize():{}},onLayout:function(a,b){Ext.layout.FitLayout.superclass.onLayout.call(this,a,b),a.collapsed||this.setItemSize(this.activeItem||a.items.itemAt(0),this.getLayoutTargetSize())},setItemSize:function(a,b){a&&b.height>0&&a.setSize(b)}}),Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout,Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:!1,layoutOnCardChange:!1,renderHidden:!0,type:"card",setActiveItem:function(a){var b=this.activeItem,c=this.container;a=c.getComponent(a);if(a&&b!=a){if(b){b.hide();if(b.hidden!==!0)return!1;b.fireEvent("deactivate",b)}var d=a.doLayout&&(this.layoutOnCardChange||!a.rendered);this.activeItem=a,delete a.deferLayout,a.show(),this.layout(),d&&a.doLayout(),a.fireEvent("activate",a)}},renderAll:function(a,b){this.deferredRender?this.renderItem(this.activeItem,undefined,b):Ext.layout.CardLayout.superclass.renderAll.call(this,a,b)}}),Ext.Container.LAYOUTS.card=Ext.layout.CardLayout,Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:!0,type:"anchor",defaultAnchor:"100%",parseAnchorRE:/^(r|right|b|bottom)$/i,getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();return a?a.getStyleSize():{}},onLayout:function(a,b){Ext.layout.AnchorLayout.superclass.onLayout.call(this,a,b);var c=this.getLayoutTargetSize(),d=c.width,e=c.height;if(d<20&&e<20)return;var f,g;a.anchorSize?typeof a.anchorSize=="number"?f=a.anchorSize:(f=a.anchorSize.width,g=a.anchorSize.height):(f=a.initialConfig.width,g=a.initialConfig.height);var h=this.getRenderedItems(a),i=h.length,j,k,l,m,n,o,p,q=[];for(j=0;j<i;j++)k=h[j],o=k.getPositionEl(),!k.anchor&&k.items&&!Ext.isNumber(k.width)&&(!Ext.isIE6||!Ext.isStrict)&&(k.anchor=this.defaultAnchor),k.anchor&&(l=k.anchorSpec,l||(p=k.anchor.split(" "),k.anchorSpec=l={right:this.parseAnchor(p[0],k.initialConfig.width,f),bottom:this.parseAnchor(p[1],k.initialConfig.height,g)}),m=l.right?this.adjustWidthAnchor(l.right(d)-o.getMargins("lr"),k):undefined,n=l.bottom?this.adjustHeightAnchor(l.bottom(e)-o.getMargins("tb"),k):undefined,(m||n)&&q.push({comp:k,width:m||undefined,height:n||undefined}));for(j=0,i=q.length;j<i;j++)k=q[j],k.comp.setSize(k.width,k.height)},parseAnchor:function(a,b,c){if(a&&a!="none"){var d;if(this.parseAnchorRE.test(a)){var e=c-b;return function(a){if(a!==d)return d=a,a-e}}if(a.indexOf("%")!=-1){var f=parseFloat(a.replace("%",""))*.01;return function(a){if(a!==d)return d=a,Math.floor(a*f)}}a=parseInt(a,10);if(!isNaN(a))return function(b){if(b!==d)return d=b,b+a}}return!1},adjustWidthAnchor:function(a,b){return a},adjustHeightAnchor:function(a,b){return a}}),Ext.Container.LAYOUTS.anchor=Ext.layout.AnchorLayout,Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:!0,type:"column",extraCls:"x-column",scrollOffset:0,targetCls:"x-column-layout-ct",isValidParent:function(a,b){return this.innerCt&&a.getPositionEl().dom.parentNode==this.innerCt.dom},getLayoutTargetSize:function(){var a=this.container.getLayoutTarget(),b;return a&&(b=a.getViewSize(),Ext.isIE&&Ext.isStrict&&b.width==0&&(b=a.getStyleSize()),b.width-=a.getPadding("lr"),b.height-=a.getPadding("tb")),b},renderAll:function(a,b){this.innerCt||(this.innerCt=b.createChild({cls:"x-column-inner"}),this.innerCt.createChild({cls:"x-clear"})),Ext.layout.ColumnLayout.superclass.renderAll.call(this,a,this.innerCt)},onLayout:function(a,b){var c=a.items.items,d=c.length,e,f,g,h=[];this.renderAll(a,b);var i=this.getLayoutTargetSize();if(i.width<1&&i.height<1)return;var j=i.width-this.scrollOffset,k=i.height,l=j;this.innerCt.setWidth(j);for(f=0;f<d;f++)e=c[f],g=e.getPositionEl().getMargins("lr"),h[f]=g,e.columnWidth||(l-=e.getWidth()+g);l=l<0?0:l;for(f=0;f<d;f++)e=c[f],g=h[f],e.columnWidth&&e.setSize(Math.floor(e.columnWidth*l)-g);if(Ext.isIE)if(f=b.getStyle("overflow")&&f!="hidden"&&!this.adjustmentPass){var m=this.getLayoutTargetSize();m.width!=i.width&&(this.adjustmentPass=!0,this.onLayout(a,b))}delete this.adjustmentPass}}),Ext.Container.LAYOUTS.column=Ext.layout.ColumnLayout,Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:!0,rendered:!1,type:"border",targetCls:"x-border-layout-ct",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();return a?a.getViewSize():{}},onLayout:function(a,b){var c,d,e,f,g=a.items.items,h=g.length;if(!this.rendered){c=[];for(d=0;d<h;d++)e=g[d],f=e.region,e.collapsed&&c.push(e),e.collapsed=!1,e.rendered||(e.render(b,d),e.getPositionEl().addClass("x-border-panel")),this[f]=f!="center"&&e.split?new Ext.layout.BorderLayout.SplitRegion(this,e.initialConfig,f):new Ext.layout.BorderLayout.Region(this,e.initialConfig,f),this[f].render(b,e);this.rendered=!0}var i=this.getLayoutTargetSize();if(i.width<20||i.height<20){c&&(this.restoreCollapsed=c);return}this.restoreCollapsed&&(c=this.restoreCollapsed,delete this.restoreCollapsed);var j=i.width,k=i.height,l=j,m=k,n=0,o=0,p=this.north,q=this.south,r=this.west,s=this.east,e=this.center,t,u,v,w;if(!e&&Ext.layout.BorderLayout.WARN!==!1)throw"No center region defined in BorderLayout "+a.id;p&&p.isVisible()&&(t=p.getSize(),u=p.getMargins(),t.width=j-(u.left+u.right),t.x=u.left,t.y=u.top,n=t.height+t.y+u.bottom,m-=n,p.applyLayout(t)),q&&q.isVisible()&&(t=q.getSize(),u=q.getMargins(),t.width=j-(u.left+u.right),t.x=u.left,w=t.height+u.top+u.bottom,t.y=k-w+u.top,m-=w,q.applyLayout(t)),r&&r.isVisible()&&(t=r.getSize(),u=r.getMargins(),t.height=m-(u.top+u.bottom),t.x=u.left,t.y=n+u.top,v=t.width+u.left+u.right,o+=v,l-=v,r.applyLayout(t)),s&&s.isVisible()&&(t=s.getSize(),u=s.getMargins(),t.height=m-(u.top+u.bottom),v=t.width+u.left+u.right,t.x=j-v+u.left,t.y=n+u.top,l-=v,s.applyLayout(t));if(e){u=e.getMargins();var x={x:o+u.left,y:n+u.top,width:l-(u.left+u.right),height:m-(u.top+u.bottom)};e.applyLayout(x)}if(c)for(d=0,h=c.length;d<h;d++)c[d].collapse(!1);Ext.isIE&&Ext.isStrict&&b.repaint();if(d=b.getStyle("overflow")&&d!="hidden"&&!this.adjustmentPass){var y=this.getLayoutTargetSize();if(y.width!=i.width||y.height!=i.height)this.adjustmentPass=!0,this.onLayout(a,b)}delete this.adjustmentPass},destroy:function(){var a=["north","south","east","west"],b,c;for(b=0;b<a.length;b++)c=this[a[b]],c&&(c.destroy?c.destroy():c.split&&c.split.destroy(!0));Ext.layout.BorderLayout.superclass.destroy.call(this)}}),Ext.layout.BorderLayout.Region=function(a,b,c){Ext.apply(this,b),this.layout=a,this.position=c,this.state={},typeof this.margins=="string"&&(this.margins=this.layout.parseMargins(this.margins)),this.margins=Ext.applyIf(this.margins||{},this.defaultMargins),this.collapsible&&(typeof this.cmargins=="string"&&(this.cmargins=this.layout.parseMargins(this.cmargins)),this.collapseMode=="mini"&&!this.cmargins?this.cmargins={left:0,top:0,right:0,bottom:0}:this.cmargins=Ext.applyIf(this.cmargins||{},c=="north"||c=="south"?this.defaultNSCMargins:this.defaultEWCMargins))},Ext.layout.BorderLayout.Region.prototype={collapsible:!1,split:!1,floatable:!0,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},floatingZIndex:100,isCollapsed:!1,render:function(a,b){this.panel=b,b.el.enableDisplayMode(),this.targetEl=a,this.el=b.el;var c=b.getState,d=this.position;b.getState=function(){return Ext.apply(c.call(b)||{},this.state)}.createDelegate(this);if(d!="center"){b.allowQueuedExpand=!1,b.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible||this.floatable)b.collapseEl="el",b.slideAnchor=this.getSlideAnchor();b.tools&&b.tools.toggle&&(b.tools.toggle.addClass("x-tool-collapse-"+d),b.tools.toggle.addClassOnOver("x-tool-collapse-"+d+"-over"))}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var a=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');a.disableFormats=!0,a.compile(),Ext.layout.BorderLayout.Region.prototype.toolTemplate=a}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"}),this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini")this.collapsedEl.addClass("x-layout-cmini-"+this.position),this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:"&#160;"}),this.miniCollapsedEl.addClassOnOver("x-layout-mini-over"),this.collapsedEl.addClassOnOver("x-layout-collapsed-over"),this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:!0});else{if(this.collapsible!==!1&&!this.hideCollapseTool){var b=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},!0);b.addClassOnOver("x-tool-expand-"+this.position+"-over"),b.on("click",this.onExpandClick,this,{stopEvent:!0})}if(this.floatable!==!1||this.titleCollapse)this.collapsedEl.addClassOnOver("x-layout-collapsed-over"),this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}return this.collapsedEl},onExpandClick:function(a){this.isSlid?this.panel.expand(!1):this.panel.expand()},onCollapseClick:function(a){this.panel.collapse()},beforeCollapse:function(a,b){this.lastAnim=b,this.splitEl&&this.splitEl.hide(),this.getCollapsedEl().show();var c=this.panel.getEl();this.originalZIndex=c.getStyle("z-index"),c.setStyle("z-index",100),this.isCollapsed=!0,this.layout.layout()},onCollapse:function(a){this.panel.el.setStyle("z-index",1),this.lastAnim===!1||this.panel.animCollapse===!1?this.getCollapsedEl().dom.style.visibility="visible":this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:.2}),this.state.collapsed=!0,this.panel.saveState()},beforeExpand:function(a){this.isSlid&&this.afterSlideIn();var b=this.getCollapsedEl();this.el.show(),this.position=="east"||this.position=="west"?this.panel.setSize(undefined,b.getHeight()):this.panel.setSize(b.getWidth(),undefined),b.hide(),b.dom.style.visibility="hidden",this.panel.el.setStyle("z-index",this.floatingZIndex)},onExpand:function(){this.isCollapsed=!1,this.splitEl&&this.splitEl.show(),this.layout.layout(),this.panel.el.setStyle("z-index",this.originalZIndex),this.state.collapsed=!1,this.panel.saveState()},collapseClick:function(a){this.isSlid?(a.stopPropagation(),this.slideIn()):(a.stopPropagation(),this.slideOut())},onHide:function(){this.isCollapsed?this.getCollapsedEl().hide():this.splitEl&&this.splitEl.hide()},onShow:function(){this.isCollapsed?this.getCollapsedEl().show():this.splitEl&&this.splitEl.show()},isVisible:function(){return!this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(a){this.panel=a},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(a){var b=this.getCollapsedEl();b.setLeftTop(a.x,a.y),b.setSize(a.width,a.height)},applyLayout:function(a){this.isCollapsed?this.applyLayoutCollapsed(a):(this.panel.setPosition(a.x,a.y),this.panel.setSize(a.width,a.height))},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){this.autoHide!==!1&&(this.autoHideHd||(this.autoHideSlideTask=new Ext.util.DelayedTask(this.slideIn,this),this.autoHideHd={mouseout:function(a){a.within(this.el,!0)||this.autoHideSlideTask.delay(500)},mouseover:function(a){this.autoHideSlideTask.cancel()},scope:this}),this.el.on(this.autoHideHd),this.collapsedEl.on(this.autoHideHd))},clearAutoHide:function(){this.autoHide!==!1&&(this.el.un("mouseout",this.autoHideHd.mouseout),this.el.un("mouseover",this.autoHideHd.mouseover),this.collapsedEl.un("mouseout",this.autoHideHd.mouseout),this.collapsedEl.un("mouseover",this.autoHideHd.mouseover))},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx())return;this.isSlid=!0;var a=this.panel.tools,b,c;a&&a.toggle&&a.toggle.hide(),this.el.show(),c=this.panel.collapsed,this.panel.collapsed=!1,this.position=="east"||this.position=="west"?(b=this.panel.deferHeight,this.panel.deferHeight=!1,this.panel.setSize(undefined,this.collapsedEl.getHeight()),this.panel.deferHeight=b):this.panel.setSize(this.collapsedEl.getWidth(),undefined),this.panel.collapsed=c,this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top],this.el.alignTo(this.collapsedEl,this.getCollapseAnchor()),this.el.setStyle("z-index",this.floatingZIndex+2),this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating"),this.animFloat!==!1?(this.beforeSlide(),this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide(),this.initAutoHide(),Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:!0})):(this.initAutoHide(),Ext.getDoc().on("click",this.slideInIf,this))},afterSlideIn:function(){this.clearAutoHide(),this.isSlid=!1,this.clearMonitor(),this.el.setStyle("z-index",""),this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed"),this.el.dom.style.left=this.restoreLT[0],this.el.dom.style.top=this.restoreLT[1];var a=this.panel.tools;a&&a.toggle&&a.toggle.show()},slideIn:function(a){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(a);return}this.isSlid=!1,this.animFloat!==!1?(this.beforeSlide(),this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide(),this.afterSlide(),this.afterSlideIn(),Ext.callback(a)},scope:this,block:!0})):(this.el.hide(),this.afterSlideIn())},slideInIf:function(a){a.within(this.el)||this.slideIn()},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var a=this.cmargins;switch(this.position){case"west":return[0,0];case"east":return[0,0];case"north":return[0,0];case"south":return[0,0]}},getExpandAdj:function(){var a=this.collapsedEl,b=this.cmargins;switch(this.position){case"west":return[-(b.right+a.getWidth()+b.left),0];case"east":return[b.right+a.getWidth()+b.left,0];case"north":return[0,-(b.top+b.bottom+a.getHeight())];case"south":return[0,b.top+b.bottom+a.getHeight()]}},destroy:function(){this.autoHideSlideTask&&this.autoHideSlideTask.cancel&&this.autoHideSlideTask.cancel(),Ext.destroy(this.miniCollapsedEl,this.collapsedEl)}},Ext.layout.BorderLayout.SplitRegion=function(a,b,c){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,a,b,c),this.applyLayout=this.applyFns[c]},Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:!1,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);var b=this.splitEl.dom,c=b.style;this.panel.setPosition(a.x,a.y);var d=b.offsetWidth;c.left=a.x+a.width-d+"px",c.top=a.y+"px",c.height=Math.max(0,a.height)+"px",this.panel.setSize(a.width-d,a.height)},east:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);var b=this.splitEl.dom,c=b.style,d=b.offsetWidth;this.panel.setPosition(a.x+d,a.y),c.left=a.x+"px",c.top=a.y+"px",c.height=Math.max(0,a.height)+"px",this.panel.setSize(a.width-d,a.height)},north:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);var b=this.splitEl.dom,c=b.style,d=b.offsetHeight;this.panel.setPosition(a.x,a.y),c.left=a.x+"px",c.top=a.y+a.height-d+"px",c.width=Math.max(0,a.width)+"px",this.panel.setSize(a.width,a.height-d)},south:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);var b=this.splitEl.dom,c=b.style,d=b.offsetHeight;this.panel.setPosition(a.x,a.y+d),c.left=a.x+"px",c.top=a.y+"px",c.width=Math.max(0,a.width)+"px",this.panel.setSize(a.width,a.height-d)}},render:function(a,b){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,a,b);var c=this.position;this.splitEl=a.createChild({cls:"x-layout-split x-layout-split-"+c,html:"&#160;",id:this.panel.id+"-xsplit"}),this.collapseMode=="mini"&&(this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+c,html:"&#160;"}),this.miniSplitEl.addClassOnOver("x-layout-mini-over"),this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:!0}));var d=this.splitSettings[c];this.split=new Ext.SplitBar(this.splitEl.dom,b.el,d.orientation),this.split.tickSize=this.tickSize,this.split.placement=d.placement,this.split.getMaximumSize=this[d.maxFn].createDelegate(this),this.split.minSize=this.minSize||this[d.minProp],this.split.on("beforeapply",this.onSplitMove,this),this.split.useShim=this.useShim===!0,this.maxSize=this.maxSize||this[d.maxProp],b.hidden&&this.splitEl.hide(),this.useSplitTips&&(this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip),this.collapsible&&this.splitEl.on("dblclick",this.onCollapseClick,this)},getSize:function(){if(this.isCollapsed)return this.collapsedEl.getSize();var a=this.panel.getSize();return this.position=="north"||this.position=="south"?a.height+=this.splitEl.dom.offsetHeight:a.width+=this.splitEl.dom.offsetWidth,a},getHMaxSize:function(){var a=this.maxSize||1e4,b=this.layout.center;return Math.min(a,this.el.getWidth()+b.el.getWidth()-b.getMinWidth())},getVMaxSize:function(){var a=this.maxSize||1e4,b=this.layout.center;return Math.min(a,this.el.getHeight()+b.el.getHeight()-b.getMinHeight())},onSplitMove:function(a,b){var c=this.panel.getSize();return this.lastSplitSize=b,this.position=="north"||this.position=="south"?(this.panel.setSize(c.width,b),this.state.height=b):(this.panel.setSize(b,c.height),this.state.width=b),this.layout.layout(),this.panel.saveState(),!1},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl),Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this)}}),Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout,Ext.layout
.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",trackLabels:!1,type:"form",onRemove:function(a){Ext.layout.FormLayout.superclass.onRemove.call(this,a),this.trackLabels&&(a.un("show",this.onFieldShow,this),a.un("hide",this.onFieldHide,this));var b=a.getPositionEl(),c=a.getItemCt&&a.getItemCt();a.rendered&&c&&(b&&b.dom&&b.insertAfter(c),Ext.destroy(c),Ext.destroyMembers(a,"label","itemCt"),a.customItemCt&&Ext.destroyMembers(a,"getItemCt","customItemCt"))},setContainer:function(a){Ext.layout.FormLayout.superclass.setContainer.call(this,a),a.labelAlign&&a.addClass("x-form-label-"+a.labelAlign);if(a.hideLabels)Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0});else{this.labelSeparator=a.labelSeparator||this.labelSeparator,a.labelWidth=a.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=Ext.isNumber(a.labelPad)?a.labelPad:5;Ext.apply(this,{labelAdjust:a.labelWidth+b,labelStyle:"width:"+a.labelWidth+"px;",elementStyle:"padding-left:"+(a.labelWidth+b)+"px"})}a.labelAlign=="top"&&Ext.apply(this,{labelStyle:"width:auto;",labelAdjust:0,elementStyle:"padding-left:0;"})}},isHide:function(a){return a.hideLabel||this.container.hideLabels},onFieldShow:function(a){a.getItemCt().removeClass("x-hide-"+a.hideMode),a.isComposite&&a.doLayout()},onFieldHide:function(a){a.getItemCt().addClass("x-hide-"+a.hideMode)},getLabelStyle:function(a){var b="",c=[this.labelStyle,a];for(var d=0,e=c.length;d<e;++d)c[d]&&(b+=c[d],b.substr(-1,1)!=";"&&(b+=";"));return b},renderItem:function(a,b,c){if(a&&(a.isFormField||a.fieldLabel)&&a.inputType!="hidden"){var d=this.getTemplateArgs(a);Ext.isNumber(b)&&(b=c.dom.childNodes[b]||null),b?a.itemCt=this.fieldTpl.insertBefore(b,d,!0):a.itemCt=this.fieldTpl.append(c,d,!0),a.getItemCt||Ext.apply(a,{getItemCt:function(){return a.itemCt},customItemCt:!0}),a.label=a.getItemCt().child("label.x-form-item-label"),a.rendered?this.isValidParent(a,c)||Ext.fly("x-form-el-"+a.id).appendChild(a.getPositionEl()):a.render("x-form-el-"+a.id),this.trackLabels&&(a.hidden&&this.onFieldHide(a),a.on({scope:this,show:this.onFieldShow,hide:this.onFieldHide})),this.configureItem(a)}else Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)},getTemplateArgs:function(a){var b=!a.fieldLabel||a.hideLabel;return{id:a.id,label:a.fieldLabel,itemCls:(a.itemCls||this.container.itemCls||"")+(a.hideLabel?" x-hide-label":""),clearCls:a.clearCls||"x-form-clear-left",labelStyle:this.getLabelStyle(a.labelStyle),elementStyle:this.elementStyle||"",labelSeparator:b?"":Ext.isDefined(a.labelSeparator)?a.labelSeparator:this.labelSeparator}},adjustWidthAnchor:function(a,b){if(b.label&&!this.isHide(b)&&this.container.labelAlign!="top"){var c=Ext.isIE6||Ext.isIE&&!Ext.isStrict;return a-this.labelAdjust+(c?-3:0)}return a},adjustHeightAnchor:function(a,b){return b.label&&!this.isHide(b)&&this.container.labelAlign=="top"?a-b.label.getHeight():a},isValidParent:function(a,b){return b&&this.container.getEl().contains(a.getPositionEl())}}),Ext.Container.LAYOUTS.form=Ext.layout.FormLayout,Ext.layout.AccordionLayout=Ext.extend(Ext.layout.FitLayout,{fill:!0,autoWidth:!0,titleCollapse:!0,hideCollapseTool:!1,collapseFirst:!1,animate:!1,sequence:!1,activeOnTop:!1,type:"accordion",renderItem:function(a){this.animate===!1&&(a.animCollapse=!1),a.collapsible=!0,this.autoWidth&&(a.autoWidth=!0),this.titleCollapse&&(a.titleCollapse=!0),this.hideCollapseTool&&(a.hideCollapseTool=!0),this.collapseFirst!==undefined&&(a.collapseFirst=this.collapseFirst),!this.activeItem&&!a.collapsed?this.setActiveItem(a,!0):this.activeItem&&this.activeItem!=a&&(a.collapsed=!0),Ext.layout.AccordionLayout.superclass.renderItem.apply(this,arguments),a.header.addClass("x-accordion-hd"),a.on("beforeexpand",this.beforeExpand,this)},onRemove:function(a){Ext.layout.AccordionLayout.superclass.onRemove.call(this,a),a.rendered&&a.header.removeClass("x-accordion-hd"),a.un("beforeexpand",this.beforeExpand,this)},beforeExpand:function(a,b){var c=this.activeItem;if(c)if(this.sequence){delete this.activeItem;if(!c.collapsed)return c.collapse({callback:function(){a.expand(b||!0)},scope:this}),!1}else c.collapse(this.animate);this.setActive(a),this.activeOnTop&&a.el.dom.parentNode.insertBefore(a.el.dom,a.el.dom.parentNode.firstChild),this.layout()},setItemSize:function(a,b){if(this.fill&&a){var c=0,d,e=this.getRenderedItems(this.container),f=e.length,g;for(d=0;d<f;d++)(g=e[d])!=a&&!g.hidden&&(c+=g.header.getHeight());b.height-=c,a.setSize(b)}},setActiveItem:function(a){this.setActive(a,!0)},setActive:function(a,b){var c=this.activeItem;a=this.container.getComponent(a),c!=a&&(a.rendered&&a.collapsed&&b?a.expand():(c&&c.fireEvent("deactivate",c),this.activeItem=a,a.fireEvent("activate",a)))}}),Ext.Container.LAYOUTS.accordion=Ext.layout.AccordionLayout,Ext.layout.Accordion=Ext.layout.AccordionLayout,Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:!1,type:"table",targetCls:"x-table-layout-ct",tableAttrs:null,setContainer:function(a){Ext.layout.TableLayout.superclass.setContainer.call(this,a),this.currentRow=0,this.currentColumn=0,this.cells=[]},onLayout:function(a,b){var c=a.items.items,d=c.length,e,f;this.table||(b.addClass("x-table-layout-ct"),this.table=b.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,!0)),this.renderAll(a,b)},getRow:function(a){var b=this.table.tBodies[0].childNodes[a];return b||(b=document.createElement("tr"),this.table.tBodies[0].appendChild(b)),b},getNextCell:function(a){var b=this.getNextNonSpan(this.currentColumn,this.currentRow),c=this.currentColumn=b[0],d=this.currentRow=b[1];for(var e=d;e<d+(a.rowspan||1);e++){this.cells[e]||(this.cells[e]=[]);for(var f=c;f<c+(a.colspan||1);f++)this.cells[e][f]=!0}var g=document.createElement("td");a.cellId&&(g.id=a.cellId);var h="x-table-layout-cell";return a.cellCls&&(h+=" "+a.cellCls),g.className=h,a.colspan&&(g.colSpan=a.colspan),a.rowspan&&(g.rowSpan=a.rowspan),this.getRow(d).appendChild(g),g},getNextNonSpan:function(a,b){var c=this.columns;while(c&&a>=c||this.cells[b]&&this.cells[b][a])c&&a>=c?(b++,a=0):a++;return[a,b]},renderItem:function(a,b,c){this.table||(this.table=c.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,!0));if(a&&!a.rendered)a.render(this.getNextCell(a)),this.configureItem(a,b);else if(a&&!this.isValidParent(a,c)){var d=this.getNextCell(a);d.insertBefore(a.getPositionEl().dom,null),a.container=Ext.get(d),this.configureItem(a,b)}},isValidParent:function(a,b){return a.getPositionEl().up("table",5).dom.parentNode===(b.dom||b)}}),Ext.Container.LAYOUTS.table=Ext.layout.TableLayout,Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(a,b){b.position(),this.paddingLeft=b.getPadding("l"),this.paddingTop=b.getPadding("t"),Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,a,b)},adjustWidthAnchor:function(a,b){return a?a-b.getPosition(!0)[0]+this.paddingLeft:a},adjustHeightAnchor:function(a,b){return a?a-b.getPosition(!0)[1]+this.paddingTop:a}}),Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout,Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{defaultMargins:{left:0,top:0,right:0,bottom:0},padding:"0",pack:"start",monitorResize:!0,type:"box",scrollOffset:0,extraCls:"x-box-item",targetCls:"x-box-layout-ct",innerCls:"x-box-inner",constructor:function(a){Ext.layout.BoxLayout.superclass.constructor.call(this,a),Ext.isString(this.defaultMargins)&&(this.defaultMargins=this.parseMargins(this.defaultMargins))},onLayout:function(a,b){Ext.layout.BoxLayout.superclass.onLayout.call(this,a,b);var c=this.getVisibleItems(a),d=this.getLayoutTargetSize();this.layoutTargetLastSize=d,this.childBoxCache=this.calculateChildBoxes(c,d),this.updateInnerCtSize(d,this.childBoxCache),this.updateChildBoxes(this.childBoxCache.boxes),this.handleTargetOverflow(d,a,b)},updateChildBoxes:function(a){for(var b=0,c=a.length;b<c;b++){var d=a[b],e=d.component;d.dirtySize&&e.setSize(d.width,d.height);if(isNaN(d.left)||isNaN(d.top))continue;e.setPosition(d.left,d.top)}},updateInnerCtSize:Ext.emptyFn,handleTargetOverflow:function(a,b,c){var d=c.getStyle("overflow");if(d&&d!="hidden"&&!this.adjustmentPass){var e=this.getLayoutTargetSize();if(e.width!=a.width||e.height!=a.height)this.adjustmentPass=!0,this.onLayout(b,c)}delete this.adjustmentPass},isValidParent:function(a,b){return this.innerCt&&a.getPositionEl().dom.parentNode==this.innerCt.dom},getVisibleItems:function(a){var a=a||this.container,b=a.getLayoutTarget(),c=a.items.items,d=c.length,e,f,g=[];for(e=0;e<d;e++)(f=c[e]).rendered&&this.isValidParent(f,b)&&f.hidden!==!0&&f.collapsed!==!0&&g.push(f);return g},renderAll:function(a,b){this.innerCt||(this.innerCt=b.createChild({cls:this.innerCls}),this.padding=this.parseMargins(this.padding)),Ext.layout.BoxLayout.superclass.renderAll.call(this,a,this.innerCt)},getLayoutTargetSize:function(){var a=this.container.getLayoutTarget(),b;return a&&(b=a.getViewSize(),Ext.isIE&&Ext.isStrict&&b.width==0&&(b=a.getStyleSize()),b.width-=a.getPadding("lr"),b.height-=a.getPadding("tb")),b},renderItem:function(a){Ext.isString(a.margins)?a.margins=this.parseMargins(a.margins):a.margins||(a.margins=this.defaultMargins),Ext.layout.BoxLayout.superclass.renderItem.apply(this,arguments)}}),Ext.layout.VBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"left",type:"vbox",updateInnerCtSize:function(a,b){var c=a.height,d=b.meta.maxWidth+this.padding.left+this.padding.right;this.align=="stretch"?d=a.width:this.align=="center"&&(d=Math.max(a.width,d)),this.innerCt.setSize(d||undefined,c||undefined)},calculateChildBoxes:function(a,b){var c=a.length,d=this.padding,e=d.top,f=d.left,g=e+d.bottom,h=f+d.right,i=b.width-this.scrollOffset,j=b.height,k=Math.max(0,i-h),l=this.pack=="start",m=this.pack=="center",n=this.pack=="end",o=0,p=0,q=0,r=[],s,t,u,v,w,x,y,z,A,B,C;for(y=0;y<c;y++)s=a[y],u=s.height,t=s.width,x=!s.hasLayout&&Ext.isFunction(s.doLayout),Ext.isNumber(u)||(s.flex&&!u?q+=s.flex:(!u&&x&&s.doLayout(),v=s.getSize(),t=v.width,u=v.height)),w=s.margins,o+=(u||0)+w.top+w.bottom,Ext.isNumber(t)||(x&&s.doLayout(),t=s.getWidth()),p=Math.max(p,t+w.left+w.right),r.push({component:s,height:u||undefined,width:t||undefined});var D=Math.max(0,j-o-g);m?e+=D/2:n&&(e+=D);var E=D,F=q;for(y=0;y<c;y++){s=a[y],z=r[y],w=s.margins,B=w.left+w.right,e+=w.top,l&&s.flex&&!s.height&&(A=Math.ceil(s.flex/F*E),E-=A,F-=s.flex,z.height=A,z.dirtySize=!0),z.left=f+w.left,z.top=e;switch(this.align){case"stretch":C=k-B,z.width=C.constrain(s.minWidth||0,s.maxWidth||1e6),z.dirtySize=!0;break;case"stretchmax":C=p-B,z.width=C.constrain(s.minWidth||0,s.maxWidth||1e6),z.dirtySize=!0;break;case"center":var G=k-z.width-B;G>0&&(z.left=f+B+G/2)}e+=z.height+w.bottom}return{boxes:r,meta:{maxWidth:p}}}}),Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout,Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",updateInnerCtSize:function(a,b){var c=a.width,d=b.meta.maxHeight+this.padding.top+this.padding.bottom;this.align=="stretch"?d=a.height:this.align=="middle"&&(d=Math.max(a.height,d)),this.innerCt.setSize(c||undefined,d||undefined)},calculateChildBoxes:function(a,b){var c=a.length,d=this.padding,e=d.top,f=d.left,g=e+d.bottom,h=f+d.right,i=b.width-this.scrollOffset,j=b.height,k=Math.max(0,j-g),l=this.pack=="start",m=this.pack=="center",n=this.pack=="end",o=0,p=0,q=0,r=[],s,t,u,v,w,x,y,z,A,B,C;for(y=0;y<c;y++)s=a[y],u=s.height,t=s.width,x=!s.hasLayout&&Ext.isFunction(s.doLayout),Ext.isNumber(t)||(s.flex&&!t?q+=s.flex:(!t&&x&&s.doLayout(),v=s.getSize(),t=v.width,u=v.height)),w=s.margins,o+=(t||0)+w.left+w.right,Ext.isNumber(u)||(x&&s.doLayout(),u=s.getHeight()),p=Math.max(p,u+w.top+w.bottom),r.push({component:s,height:u||undefined,width:t||undefined});var D=Math.max(0,i-o-h);m?f+=D/2:n&&(f+=D);var E=D,F=q;for(y=0;y<c;y++){s=a[y],z=r[y],w=s.margins,B=w.top+w.bottom,f+=w.left,l&&s.flex&&!s.width&&(A=Math.ceil(s.flex/F*E),E-=A,F-=s.flex,z.width=A,z.dirtySize=!0),z.left=f,z.top=e+w.top;switch(this.align){case"stretch":C=k-B,z.height=C.constrain(s.minHeight||0,s.maxHeight||1e6),z.dirtySize=!0;break;case"stretchmax":C=p-B,z.height=C.constrain(s.minHeight||0,s.maxHeight||1e6),z.dirtySize=!0;break;case"middle":var G=k-z.height-B;G>0&&(z.top=e+B+G/2)}f+=z.width+w.right}return{boxes:r,meta:{maxHeight:p}}}}),Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout,Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:!0,type:"toolbar",triggerWidth:18,noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',lastOverflow:!1,tableHTML:['<table cellspacing="0" class="x-toolbar-ct">',"<tbody>","<tr>",'<td class="x-toolbar-left" align="{0}">','<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-left-row"></tr>',"</tbody>","</table>","</td>",'<td class="x-toolbar-right" align="right">','<table cellspacing="0" class="x-toolbar-right-ct">',"<tbody>","<tr>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-right-row"></tr>',"</tbody>","</table>","</td>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-extras-row"></tr>',"</tbody>","</table>","</td>","</tr>","</tbody>","</table>","</td>","</tr>","</tbody>","</table>"].join(""),onLayout:function(a,b){if(!this.leftTr){var c=a.buttonAlign=="center"?"center":"left";b.addClass("x-toolbar-layout-ct"),b.insertHtml("beforeEnd",String.format(this.tableHTML,c)),this.leftTr=b.child("tr.x-toolbar-left-row",!0),this.rightTr=b.child("tr.x-toolbar-right-row",!0),this.extrasTr=b.child("tr.x-toolbar-extras-row",!0),this.hiddenItem==undefined&&(this.hiddenItems=[])}var d=a.buttonAlign=="right"?this.rightTr:this.leftTr,e=a.items.items,f=0;for(var g=0,h=e.length,i;g<h;g++,f++){i=e[g];if(i.isFill)d=this.rightTr,f=-1;else if(!i.rendered)i.render(this.insertCell(i,d,f));else if(!i.xtbHidden&&!this.isValidParent(i,d.childNodes[f])){var j=this.insertCell(i,d,f);j.appendChild(i.getPositionEl().dom),i.container=Ext.get(j)}}this.cleanup(this.leftTr),this.cleanup(this.rightTr),this.cleanup(this.extrasTr),this.fitToSize(b)},cleanup:function(a){var b=a.childNodes,c,d;for(c=b.length-1;c>=0&&(d=b[c]);c--)d.firstChild||a.removeChild(d)},insertCell:function(a,b,c){var d=document.createElement("td");return d.className="x-toolbar-cell",b.insertBefore(d,b.childNodes[c]||null),d},hideItem:function(a){this.hiddenItems.push(a),a.xtbHidden=!0,a.xtbWidth=a.getPositionEl().dom.parentNode.offsetWidth,a.hide()},unhideItem:function(a){a.show(),a.xtbHidden=!1,this.hiddenItems.remove(a)},getItemWidth:function(a){return a.hidden?a.xtbWidth||0:a.getPositionEl().dom.parentNode.offsetWidth},fitToSize:function(a){if(this.container.enableOverflow===!1)return;var b=a.dom.clientWidth,c=a.dom.firstChild.offsetWidth,d=b-this.triggerWidth,e=this.lastWidth||0,f=this.hiddenItems,g=f.length!=0,h=b>=e;this.lastWidth=b;if(c>b||g&&h){var i=this.container.items.items,j=i.length,k=0,l;for(var m=0;m<j;m++)l=i[m],l.isFill||(k+=this.getItemWidth(l),k>d?!l.hidden&&!l.xtbHidden&&this.hideItem(l):l.xtbHidden&&this.unhideItem(l))}g=f.length!=0,g?(this.initMore(),this.lastOverflow||(this.container.fireEvent("overflowchange",this.container,!0),this.lastOverflow=!0)):this.more&&(this.clearMenu(),this.more.destroy(),delete this.more,this.lastOverflow&&(this.container.fireEvent("overflowchange",this.container,!1),this.lastOverflow=!1))},createMenuConfig:function(a,b){var c=Ext.apply({},a.initialConfig),d=a.toggleGroup;return Ext.copyTo(c,a,["iconCls","icon","itemId","disabled","handler","scope","menu"]),Ext.apply(c,{text:a.overflowText||a.text,hideOnClick:b}),(d||a.enableToggle)&&Ext.apply(c,{group:d,checked:a.pressed,listeners:{checkchange:function(b,c){a.toggle(c)}}}),delete c.ownerCt,delete c.xtype,delete c.id,c},addComponentToMenu:function(a,b){b instanceof Ext.Toolbar.Separator?a.add("-"):Ext.isFunction(b.isXType)&&(b.isXType("splitbutton")?a.add(this.createMenuConfig(b,!0)):b.isXType("button")?a.add(this.createMenuConfig(b,!b.menu)):b.isXType("buttongroup")&&b.items.each(function(b){this.addComponentToMenu(a,b)},this))},clearMenu:function(){var a=this.moreMenu;a&&a.items&&a.items.each(function(a){delete a.menu})},beforeMoreShow:function(a){var b=this.container.items.items,c=b.length,d,e,f=function(a,b){return a.isXType("buttongroup")&&!(b instanceof Ext.Toolbar.Separator)};this.clearMenu(),a.removeAll();for(var g=0;g<c;g++)d=b[g],d.xtbHidden&&(e&&(f(d,e)||f(e,d))&&a.add("-"),this.addComponentToMenu(a,d),e=d);a.items.length<1&&a.add(this.noItemsMenuText)},initMore:function(){if(!this.more){this.moreMenu=new Ext.menu.Menu({ownerCt:this.container,listeners:{beforeshow:this.beforeMoreShow,scope:this}}),this.more=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.moreMenu,ownerCt:this.container});var a=this.insertCell(this.more,this.extrasTr,100);this.more.render(a)}},destroy:function(){Ext.destroy(this.more,this.moreMenu),delete this.leftTr,delete this.rightTr,delete this.extrasTr,Ext.layout.ToolbarLayout.superclass.destroy.call(this)}}),Ext.Container.LAYOUTS.toolbar=Ext.layout.ToolbarLayout,Ext.layout.MenuLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:!0,type:"menu",setContainer:function(a){this.monitorResize=!a.floating,a.on("autosize",this.doAutoSize,this),Ext.layout.MenuLayout.superclass.setContainer.call(this,a)},renderItem:function(a,b,c){this.itemTpl||(this.itemTpl=Ext.layout.MenuLayout.prototype.itemTpl=new Ext.XTemplate('<li id="{itemId}" class="{itemCls}">','<tpl if="needsIcon">','<img src="{icon}" class="{iconCls}"/>',"</tpl>","</li>"));if(a&&!a.rendered){Ext.isNumber(b)&&(b=c.dom.childNodes[b]);var d=this.getItemArgs(a);a.render(a.positionEl=b?this.itemTpl.insertBefore(b,d,!0):this.itemTpl.append(c,d,!0)),a.positionEl.menuItemId=a.getItemId(),!d.isMenuItem&&d.needsIcon&&a.positionEl.addClass("x-menu-list-item-indent"),this.configureItem(a,b)}else a&&!this.isValidParent(a,c)&&(Ext.isNumber(b)&&(b=c.dom.childNodes[b]),c.dom.insertBefore(a.getActionEl().dom,b||null))},getItemArgs:function(a){var b=a instanceof Ext.menu.Item;return{isMenuItem:b,needsIcon:!b&&(a.icon||a.iconCls),icon:a.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(a.iconCls||""),itemId:"x-menu-el-"+a.id,itemCls:"x-menu-list-item "}},isValidParent:function(a,b){return a.el.up("li.x-menu-list-item",5).dom.parentNode===(b.dom||b)},onLayout:function(a,b){Ext.layout.MenuLayout.superclass.onLayout.call(this,a,b),this.doAutoSize()},doAutoSize:function(){var a=this.container,b=a.width;if(a.floating)if(b)a.setWidth(b);else if(Ext.isIE){a.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8)?"auto":a.minWidth);var c=a.getEl(),d=c.dom.offsetWidth;a.setWidth(a.getLayoutTarget().getWidth()+c.getFrameWidth("lr"))}}}),Ext.Container.LAYOUTS.menu=Ext.layout.MenuLayout,Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this),document.getElementsByTagName("html")[0].className+=" x-viewport",this.el=Ext.getBody(),this.el.setHeight=Ext.emptyFn,this.el.setWidth=Ext.emptyFn,this.el.setSize=Ext.emptyFn,this.el.dom.scroll="no",this.allowDomMove=!1,this.autoWidth=!0,this.autoHeight=!0,Ext.EventManager.onWindowResize(this.fireResize,this),this.renderTo=this.el},fireResize:function(a,b){this.fireEvent("resize",this,a,b,a,b)}}),Ext.reg("viewport",Ext.Viewport),Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:!0,animCollapse:Ext.enableFx,headerAsText:!0,buttonAlign:"right",collapsed:!1,collapseFirst:!0,minButtonWidth:75,elements:"body",preventBodyReset:!1,padding:undefined,resizeEvent:"bodyresize",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:!0,expandDefaults:{duration:.25},collapseDefaults:{duration:.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this),this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate"),this.unstyled&&(this.baseCls="x-plain"),this.toolbars=[],this.tbar&&(this.elements+=",tbar",this.topToolbar=this.createToolbar(this.tbar),this.tbar=null),this.bbar&&(this.elements+=",bbar",this.bottomToolbar=this.createToolbar(this.bbar),this.bbar=null);if(this.header===!0)this.elements+=",header",this.header=null;else if(this.headerCfg||this.title&&this.header!==!1)this.elements+=",header";if(this.footerCfg||this.footer===!0)this.elements+=",footer",this.footer=null;this.buttons&&(this.fbar=this.buttons,this.buttons=null),this.fbar&&this.createFbar(this.fbar),this.autoLoad&&this.on("render",this.doAutoLoad,this,{delay:10})},createFbar:function(a){var b=this.minButtonWidth;this.elements+=",footer",this.fbar=this.createToolbar(a,{buttonAlign:this.buttonAlign,toolbarCls:"x-panel-fbar",enableOverflow:!1,defaults:function(a){return{minWidth:a.minWidth||b}}}),this.fbar.items.each(function(a){a.minWidth=a.minWidth||this.minButtonWidth},this),this.buttons=this.fbar.items.items},createToolbar:function(a,b){var c;return Ext.isArray(a)&&(a={items:a}),c=a.events?Ext.apply(a,b):this.createComponent(Ext.apply({},a,b),"toolbar"),this.toolbars.push(c),c},createElement:function(a,b){if(this[a]){b.appendChild(this[a].dom);return}if(a==="bwrap"||this.elements.indexOf(a)!=-1){if(this[a+"Cfg"])this[a]=Ext.fly(b).createChild(this[a+"Cfg"]);else{var c=document.createElement("div");c.className=this[a+"Cls"],this[a]=Ext.get(b.appendChild(c))}this[a+"CssClass"]&&this[a].addClass(this[a+"CssClass"]),this[a+"Style"]&&this[a].applyStyles(this[a+"Style"])}},onRender:function(a,b){Ext.Panel.superclass.onRender.call(this,a,b),this.createClasses();var c=this.el,d=c.dom,e,f;this.collapsible&&!this.hideCollapseTool&&(this.tools=this.tools?this.tools.slice(0):[],this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})),this.tools&&(f=this.tools,this.elements+=this.header!==!1?",header":""),this.tools={},c.addClass(this.baseCls);if(d.firstChild){this.header=c.down("."+this.headerCls),this.bwrap=c.down("."+this.bwrapCls);var g=this.bwrap?this.bwrap:c;this.tbar=g.down("."+this.tbarCls),this.body=g.down("."+this.bodyCls),this.bbar=g.down("."+this.bbarCls),this.footer=g.down("."+this.footerCls),this.fromMarkup=!0}this.preventBodyReset===!0&&c.addClass("x-panel-reset"),this.cls&&c.addClass(this.cls),this.buttons&&(this.elements+=",footer");if(this.frame){c.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls)),this.createElement("header",d.firstChild.firstChild.firstChild),this.createElement("bwrap",d),e=this.bwrap.dom;var h=d.childNodes[1],i=d.childNodes[2];e.appendChild(h),e.appendChild(i);var j=e.firstChild.firstChild.firstChild;this.createElement("tbar",j),this.createElement("body",j),this.createElement("bbar",j),this.createElement("footer",e.lastChild.firstChild.firstChild),this.footer||(this.bwrap.dom.lastChild.className+=" x-panel-nofooter"),this.ft=Ext.get(this.bwrap.dom.lastChild),this.mc=Ext.get(j)}else this.createElement("header",d),this.createElement("bwrap",d),e=this.bwrap.dom,this.createElement("tbar",e),this.createElement("body",e),this.createElement("bbar",e),this.createElement("footer",e),this.header||(this.body.addClass(this.bodyCls+"-noheader"),this.tbar&&this.tbar.addClass(this.tbarCls+"-noheader"));Ext.isDefined(this.padding)&&this.body.setStyle("padding",this.body.addUnits(this.padding)),this.border===!1&&(this.el.addClass(this.baseCls+"-noborder"),this.body.addClass(this.bodyCls+"-noborder"),this.header&&this.header.addClass(this.headerCls+"-noborder"),this.footer&&this.footer.addClass(this.footerCls+"-noborder"),this.tbar&&this.tbar.addClass(this.tbarCls+"-noborder"),this.bbar&&this.bbar.addClass(this.bbarCls+"-noborder")),this.bodyBorder===!1&&this.body.addClass(this.bodyCls+"-noborder"),this.bwrap.enableDisplayMode("block"),this.header&&(this.header.unselectable(),this.headerAsText&&(this.header.dom.innerHTML='<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+"</span>",this.iconCls&&this.setIconClass(this.iconCls))),this.floating&&this.makeFloating(this.floating),this.collapsible&&this.titleCollapse&&this.header&&(this.mon(this.header,"click",this.toggleCollapse,this),this.header.setStyle("cursor","pointer")),f&&this.addTool.apply(this,f),this.fbar&&(this.footer.addClass("x-panel-btns"),this.fbar.ownerCt=this,this.fbar.render(this.footer),this.footer.createChild({cls:"x-clear"})),this.tbar&&this.topToolbar&&(this.topToolbar.ownerCt=this,this.topToolbar.render(this.tbar)),this.bbar&&this.bottomToolbar&&(this.bottomToolbar.ownerCt=this,this.bottomToolbar.render(this.bbar))},setIconClass:function(a){var b=this.iconCls;this.iconCls=a;if(this.rendered&&this.header)if(this.frame)this.header.addClass("x-panel-icon"),this.header.replaceClass(b,this.iconCls);else{var c=this.header,d=c.child("img.x-panel-inline-icon");if(d)Ext.fly(d).replaceClass(b,this.iconCls);else{var e=c.child("span."+this.headerTextCls);e&&Ext.DomHelper.insertBefore(e.dom,{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}this.fireEvent("iconchange",this,a,b)},makeFloating:function(a){this.floating=!0,this.el=new Ext.Layer(Ext.apply({},a,{shadow:Ext.isDefined(this.shadow)?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:!1,shim:this.shim===!1?!1:undefined}),this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},getFooterToolbar:function(){return this.fbar},addButton:function(a,b,c){return this.fbar||this.createFbar([]),b&&(Ext.isString(a)&&(a={text:a}),a=Ext.apply({handler:b,scope:c},a)),this.fbar.add(a)},addTool:function(){if(!this.rendered){this.tools||(this.tools=[]),Ext.each(arguments,function(a){this.tools.push(a)},this);return}if(!this[this.toolTarget])return;if(!this.toolTemplate){var a=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');a.disableFormats=!0,a.compile(),Ext.Panel.prototype.toolTemplate=a}for(var b=0,c=arguments,d=c.length;b<d;b++){var e=c[b];if(!this.tools[e.id]){var f="x-tool-"+e.id+"-over",g=this.toolTemplate.insertFirst(this[this.toolTarget],e,!0);this.tools[e.id]=g,g.enableDisplayMode("block"),this.mon(g,"click",this.createToolHandler(g,e,f,this)),e.on&&this.mon(g,e.on),e.hidden&&g.hide(),e.qtip&&(Ext.isObject(e.qtip)?Ext.QuickTips.register(Ext.apply({target:g.id},e.qtip)):g.dom.qtip=e.qtip),g.addClassOnOver(f)}}},onLayout:function(a,b){Ext.Panel.superclass.onLayout.apply(this,arguments),this.hasLayout&&this.toolbars.length>0&&(Ext.each(this.toolbars,function(a){a.doLayout(undefined,b)}),this.syncHeight())},syncHeight:function(){var a=this.toolbarHeight,b=this.body,c=this.lastSize.height,d;if(this.autoHeight||!Ext.isDefined(c)||c=="auto")return;a!=this.getToolbarHeight()&&(a=Math.max(0,c-this.getFrameHeight()),b.setHeight(a),d=b.getSize(),this.toolbarHeight=this.getToolbarHeight(),this.onBodyResize(d.width,d.height))},onShow:function(){if(this.floating)return this.el.show();Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating)return this.el.hide();Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(a,b,c,d){return function(e){a.removeClass(c),b.stopEvent!==!1&&e.stopEvent(),b.handler&&b.handler.call(b.scope||a,e,a,d,b)}},afterRender:function(){this.floating&&!this.hidden&&this.el.show(),this.title&&this.setTitle(this.title),Ext.Panel.superclass.afterRender.call(this),this.collapsed&&(this.collapsed=!1,this.collapse(!1)),this.initEvents()},getKeyMap:function(){return this.keyMap||(this.keyMap=new Ext.KeyMap(this.el,this.keys)),this.keyMap},initEvents:function(){this.keys&&this.getKeyMap(),this.draggable&&this.initDraggable(),this.toolbars.length>0&&(Ext.each(this.toolbars,function(a){a.doLayout(),a.on({scope:this,afterlayout:this.syncHeight,remove:this.syncHeight})},this),this.syncHeight())},initDraggable:function(){this.dd=new Ext.Panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)},beforeEffect:function(a){this.floating&&this.el.beforeAction(),a!==!1&&this.el.addClass("x-panel-animated")},afterEffect:function(a){this.syncShadow(),this.el.removeClass("x-panel-animated")},createEffect:function(a,b,c){var d={scope:c,block:!0};return a===!0?(d.callback=b,d):(a.callback?d.callback=function(){b.call(c),Ext.callback(a.callback,a.scope)}:d.callback=b,Ext.applyIf(d,a))},collapse:function(a){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,a)===!1)return;var b=a===!0||a!==!1&&this.animCollapse;return this.beforeEffect(b),this.onCollapse(b,a),this},onCollapse:function(a,b){a?this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(b||!0,this.afterCollapse,this),this.collapseDefaults)):(this[this.collapseEl].hide(this.hideMode),this.afterCollapse(!1))},afterCollapse:function(a){this.collapsed=!0,this.el.addClass(this.collapsedCls),a!==!1&&this[this.collapseEl].hide(this.hideMode),this.afterEffect(a),this.cascade(function(a){a.lastSize&&(a.lastSize={width:undefined,height:undefined})}),this.fireEvent("collapse",this)},expand:function(a){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,a)===!1)return;var b=a===!0||a!==!1&&this.animCollapse;return this.el.removeClass(this.collapsedCls),this.beforeEffect(b),this.onExpand(b,a),this},onExpand:function(a,b){a?this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(b||!0,this.afterExpand,this),this.expandDefaults)):(this[this.collapseEl].show(this.hideMode),this.afterExpand(!1))},afterExpand:function(a){this.collapsed=!1,a!==!1&&this[this.collapseEl].show(this.hideMode),this.afterEffect(a),this.deferLayout&&(delete this.deferLayout,this.doLayout(!0)),this.fireEvent("expand",this)},toggleCollapse:function(a){return this[this.collapsed?"expand":"collapse"](a),this},onDisable:function(){this.rendered&&this.maskDisabled&&this.el.mask(),Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){this.rendered&&this.maskDisabled&&this.el.unmask(),Ext.Panel.superclass.onEnable.call(this)},onResize:function(a,b,c,d){var e=a,f=b;if(Ext.isDefined(e)||Ext.isDefined(f))this.collapsed?(this.queuedBodySize={width:e,height:f},!this.queuedExpand&&this.allowQueuedExpand!==!1&&(this.queuedExpand=!0,this.on("expand",function(){delete this.queuedExpand,this.onResize(this.queuedBodySize.width,this.queuedBodySize.height)},this,{single:!0}))):(Ext.isNumber(e)?this.body.setWidth(e=this.adjustBodyWidth(e-this.getFrameWidth())):e=="auto"?e=this.body.setWidth("auto").dom.offsetWidth:e=this.body.dom.offsetWidth,this.tbar&&(this.tbar.setWidth(e),this.topToolbar&&this.topToolbar.setSize(e)),this.bbar&&(this.bbar.setWidth(e),this.bottomToolbar&&(this.bottomToolbar.setSize(e),Ext.isIE&&(this.bbar.setStyle("position","static"),this.bbar.setStyle("position","")))),this.footer&&(this.footer.setWidth(e),this.fbar&&this.fbar.setSize(Ext.isIE?e-this.footer.getFrameWidth("lr"):"auto")),Ext.isNumber(f)?(f=Math.max(0,f-this.getFrameHeight()),this.body.setHeight(f)):f=="auto"&&this.body.setHeight(f),this.disabled&&this.el._mask&&this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())),this.onBodyResize(e,f);this.syncShadow(),Ext.Panel.superclass.onResize.call(this,a,b,c,d)},onBodyResize:function(a,b){this.fireEvent("bodyresize",this,a,b)},getToolbarHeight:function(){var a=0;return this.rendered&&Ext.each(this.toolbars,function(b){a+=b.getHeight()},this),a},adjustBodyHeight:function(a){return a},adjustBodyWidth:function(a){return a},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var a=this.el.getFrameWidth("lr")+this.bwrap.getFrameWidth("lr");if(this.frame){var b=this.bwrap.dom.firstChild;a+=Ext.fly(b).getFrameWidth("l")+Ext.fly(b.firstChild).getFrameWidth("r"),a+=this.mc.getFrameWidth("lr")}return a},getFrameHeight:function(){var a=Math.max(0,this.getHeight()-this.body.getHeight());return isNaN(a)&&(a=0),a},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.body.getHeight()},syncShadow:function(){this.floating&&this.el.sync(!0)},getLayoutTarget:function(){return this.body},getContentTarget:function(){return this.body},setTitle:function(a,b){return this.title=a,this.header&&this.headerAsText&&this.header.child("span").update(a),b&&this.setIconClass(b),this.fireEvent("titlechange",this,a),this},getUpdater:function(){return this.body.getUpdater()},load:function(){var a=this.body.getUpdater();return a.update.apply(a,arguments),this},beforeDestroy:function(){Ext.Panel.superclass.beforeDestroy.call(this),this.header&&this.header.removeAllListeners();if(this.tools)for(var a in this.tools)Ext.destroy(this.tools[a]);this.toolbars.length>0&&Ext.each(this.toolbars,function(a){a.un("afterlayout",this.syncHeight
,this),a.un("remove",this.syncHeight,this)},this);if(Ext.isArray(this.buttons))while(this.buttons.length)Ext.destroy(this.buttons[0]);this.rendered&&(Ext.destroy(this.ft,this.header,this.footer,this.tbar,this.bbar,this.body,this.mc,this.bwrap,this.dd),this.fbar&&Ext.destroy(this.fbar,this.fbar.el)),Ext.destroy(this.toolbars)},createClasses:function(){this.headerCls=this.baseCls+"-header",this.headerTextCls=this.baseCls+"-header-text",this.bwrapCls=this.baseCls+"-bwrap",this.tbarCls=this.baseCls+"-tbar",this.bodyCls=this.baseCls+"-body",this.bbarCls=this.baseCls+"-bbar",this.footerCls=this.baseCls+"-footer"},createGhost:function(a,b,c){var d=document.createElement("div");d.className="x-panel-ghost "+(a?a:""),this.header&&d.appendChild(this.el.dom.firstChild.cloneNode(!0)),Ext.fly(d.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight()),d.style.width=this.el.dom.offsetWidth+"px",c?Ext.getDom(c).appendChild(d):this.container.dom.appendChild(d);if(b!==!1&&this.el.useShim!==!1){var e=new Ext.Layer({shadow:!1,useDisplay:!0,constrain:!1},d);return e.show(),e}return new Ext.Element(d)},doAutoLoad:function(){var a=this.body.getUpdater();this.renderer&&a.setRenderer(this.renderer),a.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad})},getTool:function(a){return this.tools[a]}}),Ext.reg("panel",Ext.Panel),Ext.Editor=function(a,b){a.field?(this.field=Ext.create(a.field,"textfield"),b=Ext.apply({},a),delete b.field):this.field=a,Ext.Editor.superclass.constructor.call(this,b)},Ext.extend(Ext.Editor,Ext.Component,{allowBlur:!0,value:"",alignment:"c-c?",offsets:[0,0],shadow:"frame",constrain:!1,swallowKeys:!0,completeOnEnter:!0,cancelOnEsc:!0,updateEl:!1,initComponent:function(){Ext.Editor.superclass.initComponent.call(this),this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(a,b){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:a,shim:this.shim,shadowOffset:this.shadowOffset||4,id:this.id,constrain:this.constrain}),this.zIndex&&this.el.setZIndex(this.zIndex),this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden"),this.field.msgTarget!="title"&&(this.field.msgTarget="qtip"),this.field.inEditor=!0,this.mon(this.field,{scope:this,blur:this.onBlur,specialkey:this.onSpecialKey}),this.field.grow&&this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1}),this.field.render(this.el).show(),this.field.getEl().dom.name="",this.swallowKeys&&this.field.el.swallowEvent(["keypress","keydown"])},onSpecialKey:function(a,b){var c=b.getKey(),d=this.completeOnEnter&&c==b.ENTER,e=this.cancelOnEsc&&c==b.ESC;if(d||e)b.stopEvent(),d?this.completeEdit():this.cancelEdit(),a.triggerBlur&&a.triggerBlur();this.fireEvent("specialkey",a,b)},startEdit:function(a,b){this.editing&&this.completeEdit(),this.boundEl=Ext.get(a);var c=b!==undefined?b:this.boundEl.dom.innerHTML;this.rendered||this.render(this.parentEl||document.body),this.fireEvent("beforestartedit",this,this.boundEl,c)!==!1&&(this.startValue=c,this.field.reset(),this.field.setValue(c),this.realign(!0),this.editing=!0,this.show())},doAutoSize:function(){if(this.autoSize){var a=this.boundEl.getSize(),b=this.field.getSize();switch(this.autoSize){case"width":this.setSize(a.width,b.height);break;case"height":this.setSize(b.width,a.height);break;case"none":this.setSize(b.width,b.height);break;default:this.setSize(a.width,a.height)}}},setSize:function(a,b){delete this.field.lastSize,this.field.setSize(a,b),this.el&&((Ext.isGecko2||Ext.isOpera)&&this.el.setSize(a,b),this.el.sync())},realign:function(a){a===!0&&this.doAutoSize(),this.el.alignTo(this.boundEl,this.alignment,this.offsets)},completeEdit:function(a){if(!this.editing)return;this.field.assertValue&&this.field.assertValue();var b=this.getValue();if(!this.field.isValid()){this.revertInvalid!==!1&&this.cancelEdit(a);return}if(String(b)===String(this.startValue)&&this.ignoreNoChange){this.hideEdit(a);return}this.fireEvent("beforecomplete",this,b,this.startValue)!==!1&&(b=this.getValue(),this.updateEl&&this.boundEl&&this.boundEl.update(b),this.hideEdit(a),this.fireEvent("complete",this,b,this.startValue))},onShow:function(){this.el.show(),this.hideEl!==!1&&this.boundEl.hide(),this.field.show().focus(!1,!0),this.fireEvent("startedit",this.boundEl,this.startValue)},cancelEdit:function(a){if(this.editing){var b=this.getValue();this.setValue(this.startValue),this.hideEdit(a),this.fireEvent("canceledit",this,b,this.startValue)}},hideEdit:function(a){a!==!0&&(this.editing=!1,this.hide())},onBlur:function(){this.allowBlur===!0&&this.editing&&this.selectSameEditor!==!0&&this.completeEdit()},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur(),this.field.collapse&&this.field.collapse(),this.el.hide(),this.hideEl!==!1&&this.boundEl.show()},setValue:function(a){this.field.setValue(a)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroyMembers(this,"field"),delete this.parentEl,delete this.boundEl}}),Ext.reg("editor",Ext.Editor),Ext.ColorPalette=Ext.extend(Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:!1,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],initComponent:function(){Ext.ColorPalette.superclass.initComponent.call(this),this.addEvents("select"),this.handler&&this.on("select",this.handler,this.scope,!0)},onRender:function(a,b){this.autoEl={tag:"div",cls:this.itemCls},Ext.ColorPalette.superclass.onRender.call(this,a,b);var c=this.tpl||new Ext.XTemplate('<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>');c.overwrite(this.el,this.colors),this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:"a"}),this.clickEvent!="click"&&this.mon(this.el,"click",Ext.emptyFn,this,{delegate:"a",preventDefault:!0})},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var a=this.value;this.value=null,this.select(a,!0)}},handleClick:function(a,b){a.preventDefault();if(!this.disabled){var c=b.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(c.toUpperCase())}},select:function(a,b){a=a.replace("#","");if(a!=this.value||this.allowReselect){var c=this.el;this.value&&c.child("a.color-"+this.value).removeClass("x-color-palette-sel"),c.child("a.color-"+a).addClass("x-color-palette-sel"),this.value=a,b!==!0&&this.fireEvent("select",this,a)}}}),Ext.reg("colorpalette",Ext.ColorPalette),Ext.DatePicker=Ext.extend(Ext.BoxComponent,{todayText:"Today",okText:"&#160;OK&#160;",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:!0,focusOnSelect:!0,initHour:12,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this),this.value=this.value?this.value.clearTime(!0):(new Date).clearTime(),this.addEvents("select"),this.handler&&this.on("select",this.handler,this.scope||this),this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var a=this.disabledDates,b=a.length-1,c="(?:";Ext.each(a,function(d,e){c+=Ext.isDate(d)?"^"+Ext.escapeRe(d.dateFormat(this.format))+"$":a[e],e!=b&&(c+="|")},this),this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){Ext.isArray(a)?(this.disabledDates=a,this.disabledDatesRE=null):this.disabledDatesRE=a,this.initDisabledDays(),this.update(this.value,!0)},setDisabledDays:function(a){this.disabledDays=a,this.update(this.value,!0)},setMinDate:function(a){this.minDate=a,this.update(this.value,!0)},setMaxDate:function(a){this.maxDate=a,this.update(this.value,!0)},setValue:function(a){this.value=a.clearTime(!0),this.update(this.value)},getValue:function(){return this.value},focus:function(){this.update(this.activeDate)},onEnable:function(a){Ext.DatePicker.superclass.onEnable.call(this),this.doDisabled(!1),this.update(a?this.value:this.activeDate),Ext.isIE&&this.el.repaint()},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this),this.doDisabled(!0),Ext.isIE&&!Ext.isIE8&&Ext.each([].concat(this.textNodes,this.el.query("th span")),function(a){Ext.fly(a).repaint()})},doDisabled:function(a){this.keyNav.setDisabled(a),this.prevRepeater.setDisabled(a),this.nextRepeater.setDisabled(a),this.showToday&&(this.todayKeyListener.setDisabled(a),this.todayBtn.setDisabled(a))},onRender:function(a,b){var c=['<table cellspacing="0">','<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>','<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],d=this.dayNames,e;for(e=0;e<7;e++){var f=this.startDay+e;f>6&&(f=f-7),c.push("<th><span>",d[f].substr(0,1),"</span></th>")}c[c.length]="</tr></thead><tbody><tr>";for(e=0;e<42;e++)e%7===0&&e!==0&&(c[c.length]="</tr><tr>"),c[c.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>';c.push("</tr></tbody></table></td></tr>",this.showToday?'<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>':"",'</table><div class="x-date-mp"></div>');var g=document.createElement("div");g.className="x-date-picker",g.innerHTML=c.join(""),a.dom.insertBefore(g,b),this.el=Ext.get(g),this.eventEl=Ext.get(g.firstChild),this.prevRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:!0,stopDefault:!0}),this.nextRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:!0,stopDefault:!0}),this.monthPicker=this.el.down("div.x-date-mp"),this.monthPicker.enableDisplayMode("block"),this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(a){a.ctrlKey?this.showPrevMonth():this.update(this.activeDate.add("d",-1))},right:function(a){a.ctrlKey?this.showNextMonth():this.update(this.activeDate.add("d",1))},up:function(a){a.ctrlKey?this.showNextYear():this.update(this.activeDate.add("d",-7))},down:function(a){a.ctrlKey?this.showPrevYear():this.update(this.activeDate.add("d",7))},pageUp:function(a){this.showNextMonth()},pageDown:function(a){this.showPrevMonth()},enter:function(a){return a.stopPropagation(),!0},scope:this}),this.el.unselectable(),this.cells=this.el.select("table.x-date-inner tbody td"),this.textNodes=this.el.query("table.x-date-inner tbody span"),this.mbtn=new Ext.Button({text:"&#160;",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",!0)}),this.mbtn.el.child("em").addClass("x-btn-arrow");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var h=(new Date).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",!0),text:String.format(this.todayText,h),tooltip:String.format(this.todayTip,h),handler:this.selectToday,scope:this})}this.mon(this.eventEl,"mousewheel",this.handleMouseWheel,this),this.mon(this.eventEl,"click",this.handleDateClick,this,{delegate:"a.x-date-date"}),this.mon(this.mbtn,"click",this.showMonthPicker,this),this.onEnable(!0)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var a=['<table border="0" cellspacing="0">'];for(var b=0;b<6;b++)a.push('<tr><td class="x-date-mp-month"><a href="#">',Date.getShortMonthName(b),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',Date.getShortMonthName(b+6),"</a></td>",b===0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>');a.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>"),this.monthPicker.update(a.join("")),this.mon(this.monthPicker,"click",this.onMonthClick,this),this.mon(this.monthPicker,"dblclick",this.onMonthDblClick,this),this.mpMonths=this.monthPicker.select("td.x-date-mp-month"),this.mpYears=this.monthPicker.select("td.x-date-mp-year"),this.mpMonths.each(function(a,b,c){c+=1,c%2===0?a.dom.xmonth=5+Math.round(c*.5):a.dom.xmonth=Math.round((c-1)*.5)})}},showMonthPicker:function(){if(!this.disabled){this.createMonthPicker();var a=this.el.getSize();this.monthPicker.setSize(a),this.monthPicker.child("table").setSize(a),this.mpSelMonth=(this.activeDate||this.value).getMonth(),this.updateMPMonth(this.mpSelMonth),this.mpSelYear=(this.activeDate||this.value).getFullYear(),this.updateMPYear(this.mpSelYear),this.monthPicker.slideIn("t",{duration:.2})}},updateMPYear:function(a){this.mpyear=a;var b=this.mpYears.elements;for(var c=1;c<=10;c++){var d=b[c-1],e;c%2===0?(e=a+Math.round(c*.5),d.firstChild.innerHTML=e,d.xyear=e):(e=a-(5-Math.round(c*.5)),d.firstChild.innerHTML=e,d.xyear=e),this.mpYears.item(c-1)[e==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(a){this.mpMonths.each(function(b,c,d){b[b.dom.xmonth==a?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(a){},onMonthClick:function(a,b){a.stopEvent();var c=new Ext.Element(b),d;if(c.is("button.x-date-mp-cancel"))this.hideMonthPicker();else if(c.is("button.x-date-mp-ok")){var e=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());e.getMonth()!=this.mpSelMonth&&(e=(new Date(this.mpSelYear,this.mpSelMonth,1)).getLastDateOfMonth()),this.update(e),this.hideMonthPicker()}else(d=c.up("td.x-date-mp-month",2))?(this.mpMonths.removeClass("x-date-mp-sel"),d.addClass("x-date-mp-sel"),this.mpSelMonth=d.dom.xmonth):(d=c.up("td.x-date-mp-year",2))?(this.mpYears.removeClass("x-date-mp-sel"),d.addClass("x-date-mp-sel"),this.mpSelYear=d.dom.xyear):c.is("a.x-date-mp-prev")?this.updateMPYear(this.mpyear-10):c.is("a.x-date-mp-next")&&this.updateMPYear(this.mpyear+10)},onMonthDblClick:function(a,b){a.stopEvent();var c=new Ext.Element(b),d;if(d=c.up("td.x-date-mp-month",2))this.update(new Date(this.mpSelYear,d.dom.xmonth,(this.activeDate||this.value).getDate())),this.hideMonthPicker();else if(d=c.up("td.x-date-mp-year",2))this.update(new Date(d.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate())),this.hideMonthPicker()},hideMonthPicker:function(a){this.monthPicker&&(a===!0?this.monthPicker.hide():this.monthPicker.slideOut("t",{duration:.2}))},showPrevMonth:function(a){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(a){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(a){a.stopEvent();if(!this.disabled){var b=a.getWheelDelta();b>0?this.showPrevMonth():b<0&&this.showNextMonth()}},handleDateClick:function(a,b){a.stopEvent(),!this.disabled&&b.dateValue&&!Ext.fly(b.parentNode).hasClass("x-date-disabled")&&(this.cancelFocus=this.focusOnSelect===!1,this.setValue(new Date(b.dateValue)),delete this.cancelFocus,this.fireEvent("select",this,this.value))},selectToday:function(){this.todayBtn&&!this.todayBtn.disabled&&(this.setValue((new Date).clearTime()),this.fireEvent("select",this,this.value))},update:function(a,b){if(this.rendered){var c=this.activeDate,d=this.isVisible();this.activeDate=a;if(!b&&c&&this.el){var e=a.getTime();if(c.getMonth()==a.getMonth()&&c.getFullYear()==a.getFullYear()){this.cells.removeClass("x-date-selected"),this.cells.each(function(a){if(a.dom.firstChild.dateValue==e)return a.addClass("x-date-selected"),d&&!this.cancelFocus&&Ext.fly(a.dom.firstChild).focus(50),!1},this);return}}var f=a.getDaysInMonth(),g=a.getFirstDateOfMonth(),h=g.getDay()-this.startDay;h<0&&(h+=7),f+=h;var i=a.add("mo",-1),j=i.getDaysInMonth()-h,k=this.cells.elements,l=this.textNodes,m=new Date(i.getFullYear(),i.getMonth(),j,this.initHour),n=(new Date).clearTime().getTime(),o=a.clearTime(!0).getTime(),p=this.minDate?this.minDate.clearTime(!0):Number.NEGATIVE_INFINITY,q=this.maxDate?this.maxDate.clearTime(!0):Number.POSITIVE_INFINITY,r=this.disabledDatesRE,s=this.disabledDatesText,t=this.disabledDays?this.disabledDays.join(""):!1,u=this.disabledDaysText,v=this.format;if(this.showToday){var w=(new Date).clearTime(),x=w<p||w>q||r&&v&&r.test(w.dateFormat(v))||t&&t.indexOf(w.getDay())!=-1;this.disabled||(this.todayBtn.setDisabled(x),this.todayKeyListener[x?"disable":"enable"]())}var y=function(a,b){b.title="";var c=m.clearTime(!0).getTime();b.firstChild.dateValue=c,c==n&&(b.className+=" x-date-today",b.title=a.todayText),c==o&&(b.className+=" x-date-selected",d&&Ext.fly(b.firstChild).focus(50));if(c<p){b.className=" x-date-disabled",b.title=a.minText;return}if(c>q){b.className=" x-date-disabled",b.title=a.maxText;return}t&&t.indexOf(m.getDay())!=-1&&(b.title=u,b.className=" x-date-disabled");if(r&&v){var e=m.dateFormat(v);r.test(e)&&(b.title=s.replace("%0",e),b.className=" x-date-disabled")}},z=0;for(;z<h;z++)l[z].innerHTML=++j,m.setDate(m.getDate()+1),k[z].className="x-date-prevday",y(this,k[z]);for(;z<f;z++){var A=z-h+1;l[z].innerHTML=A,m.setDate(m.getDate()+1),k[z].className="x-date-active",y(this,k[z])}var B=0;for(;z<42;z++)l[z].innerHTML=++B,m.setDate(m.getDate()+1),k[z].className="x-date-nextday",y(this,k[z]);this.mbtn.setText(this.monthNames[a.getMonth()]+" "+a.getFullYear());if(!this.internalRender){var C=this.el.dom.firstChild,D=C.offsetWidth;this.el.setWidth(D+this.el.getBorderWidth("lr")),Ext.fly(C).setWidth(D),this.internalRender=!0,Ext.isOpera&&!this.secondPass&&(C.rows[0].cells[1].style.width=D-(C.rows[0].cells[0].offsetWidth+C.rows[0].cells[2].offsetWidth)+"px",this.secondPass=!0,this.update.defer(10,this,[a]))}}},beforeDestroy:function(){this.rendered&&(Ext.destroy(this.keyNav,this.monthPicker,this.eventEl,this.mbtn,this.nextRepeater,this.prevRepeater,this.cells.el,this.todayBtn),delete this.textNodes,delete this.cells.elements)}}),Ext.reg("datepicker",Ext.DatePicker),Ext.LoadMask=function(a,b){this.el=Ext.get(a),Ext.apply(this,b);if(this.store)this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.onLoad}),this.removeMask=Ext.value(this.removeMask,!1);else{var c=this.el.getUpdater();c.showLoadIndicator=!1,c.on({scope:this,beforeupdate:this.onBeforeLoad,update:this.onLoad,failure:this.onLoad}),this.removeMask=Ext.value(this.removeMask,!0)}},Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:!1,disable:function(){this.disabled=!0},enable:function(){this.disabled=!1},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){this.disabled||this.el.mask(this.msg,this.msgCls)},show:function(){this.onBeforeLoad()},hide:function(){this.onLoad()},destroy:function(){if(this.store)this.store.un("beforeload",this.onBeforeLoad,this),this.store.un("load",this.onLoad,this),this.store.un("exception",this.onLoad,this);else{var a=this.el.getUpdater();a.un("beforeupdate",this.onBeforeLoad,this),a.un("update",this.onLoad,this),a.un("failure",this.onLoad,this)}}},Ext.ns("Ext.slider"),Ext.slider.Thumb=Ext.extend(Object,{constructor:function(a){Ext.apply(this,a||{},{cls:"x-slider-thumb",constrain:!1}),Ext.slider.Thumb.superclass.constructor.call(this,a),this.slider.vertical&&Ext.apply(this,Ext.slider.Thumb.Vertical)},render:function(){this.el=this.slider.innerEl.insertFirst({cls:this.cls}),this.initEvents()},enable:function(){this.disabled=!1,this.el.removeClass(this.slider.disabledClass)},disable:function(){this.disabled=!0,this.el.addClass(this.slider.disabledClass)},initEvents:function(){var a=this.el;a.addClassOnOver("x-slider-thumb-over"),this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeDragStart.createDelegate(this),onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300}),this.tracker.initEl(a)},onBeforeDragStart:function(a){return this.disabled?!1:(this.slider.promoteThumb(this),!0)},onDragStart:function(a){this.el.addClass("x-slider-thumb-drag"),this.dragging=!0,this.dragStartValue=this.value,this.slider.fireEvent("dragstart",this.slider,a,this)},onDrag:function(a){var b=this.slider,c=this.index,d=this.getNewValue();if(this.constrain){var e=b.thumbs[c+1],f=b.thumbs[c-1];f!=undefined&&d<=f.value&&(d=f.value),e!=undefined&&d>=e.value&&(d=e.value)}b.setValue(c,d,!1),b.fireEvent("drag",b,a,this)},getNewValue:function(){var a=this.slider,b=a.innerEl.translatePoints(this.tracker.getXY());return Ext.util.Format.round(a.reverseValue(b.left),a.decimalPrecision)},onDragEnd:function(a){var b=this.slider,c=this.value;this.el.removeClass("x-slider-thumb-drag"),this.dragging=!1,b.fireEvent("dragend",b,a),this.dragStartValue!=c&&b.fireEvent("changecomplete",b,c,this)}}),Ext.slider.MultiSlider=Ext.extend(Ext.BoxComponent,{vertical:!1,minValue:0,maxValue:100,decimalPrecision:0,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:!0,animate:!0,dragging:!1,constrainThumbs:!0,topThumbZIndex:1e4,initComponent:function(){Ext.isDefined(this.value)||(this.value=this.minValue),this.thumbs=[],Ext.slider.MultiSlider.superclass.initComponent.call(this),this.keyIncrement=Math.max(this.increment,this.keyIncrement),this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.values==undefined||Ext.isEmpty(this.values))this.values=[0];var a=this.values;for(var b=0;b<a.length;b++)this.addThumb(a[b]);this.vertical&&Ext.apply(this,Ext.slider.Vertical)},addThumb:function(a){var b=new Ext.slider.Thumb({value:a,slider:this,index:this.thumbs.length,constrain:this.constrainThumbs});this.thumbs.push(b),this.rendered&&b.render()},promoteThumb:function(a){var b=this.thumbs,c,d;for(var e=0,f=b.length;e<f;e++)d=b[e],d==a?c=this.topThumbZIndex:c="",d.el.setStyle("zIndex",c)},onRender:function(){this.autoEl={cls:"x-slider "+(this.vertical?"x-slider-vert":"x-slider-horz"),cn:{cls:"x-slider-end",cn:{cls:"x-slider-inner",cn:[{tag:"a",cls:"x-slider-focus",href:"#",tabIndex:"-1",hidefocus:"on"}]}}},Ext.slider.MultiSlider.superclass.onRender.apply(this,arguments),this.endEl=this.el.first(),this.innerEl=this.endEl.first(),this.focusEl=this.innerEl.child(".x-slider-focus");for(var a=0;a<this.thumbs.length;a++)this.thumbs[a].render();var b=this.innerEl.child(".x-slider-thumb");this.halfThumb=(this.vertical?b.getHeight():b.getWidth())/2,this.initEvents()},initEvents:function(){this.mon(this.el,{scope:this,mousedown:this.onMouseDown,keydown:this.onKeyDown}),this.focusEl.swallowEvent("click",!0)},onMouseDown:function(a){if(this.disabled)return;var b=!1;for(var c=0;c<this.thumbs.length;c++)b=b||a.target==this.thumbs[c].el.dom;if(this.clickToChange&&!b){var d=this.innerEl.translatePoints(a.getXY());this.onClickChange(d)}this.focus()},onClickChange:function(a){if(a.top>this.clickRange[0]&&a.top<this.clickRange[1]){var b=this.getNearest(a,"left"),c=b.index;this.setValue(c,Ext.util.Format.round(this.reverseValue(a.left),this.decimalPrecision),undefined,!0)}},getNearest:function(a,b){var c=b=="top"?this.innerEl.getHeight()-a[b]:a[b],d=this.reverseValue(c),e=this.maxValue-this.minValue+5,f=0,g=null;for(var h=0;h<this.thumbs.length;h++){var i=this.thumbs[h],j=i.value,k=Math.abs(j-d);Math.abs(k<=e)&&(g=i,f=h,e=k)}return g},onKeyDown:function(a){if(this.disabled||this.thumbs.length!==1){a.preventDefault();return}var b=a.getKey(),c;switch(b){case a.UP:case a.RIGHT:a.stopEvent(),c=a.ctrlKey?this.maxValue:this.getValue(0)+this.keyIncrement,this.setValue(0,c,undefined,!0);break;case a.DOWN:case a.LEFT:a.stopEvent(),c=a.ctrlKey?this.minValue:this.getValue(0)-this.keyIncrement,this.setValue(0,c,undefined,!0);break;default:a.preventDefault()}},doSnap:function(a){if(!this.increment||!a)return a;var b=a,c=this.increment,d=a%c;return d!=0&&(b-=d,d*2>=c?b+=c:d*2<-c&&(b-=c)),b.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.slider.MultiSlider.superclass.afterRender.apply(this,arguments);for(var a=0;a<this.thumbs.length;a++){var b=this.thumbs[a];if(b.value!==undefined){var c=this.normalizeValue(b.value);c!==b.value?this.setValue(a,c,!1):this.moveThumb(a,this.translateValue(c),!1)}}},getRatio:function(){var a=this.innerEl.getWidth(),b=this.maxValue-this.minValue;return b==0?a:a/b},normalizeValue:function(a){return a=this.doSnap(a),a=Ext.util.Format.round(a,this.decimalPrecision),a=a.constrain(this.minValue,this.maxValue),a},setMinValue:function(a){this.minValue=a;var b=0,c=this.thumbs,d=c.length,e;for(;b<d;++b)e=c[b],e.value=e.value<a?a:e.value;this.syncThumb()},setMaxValue:function(a){this.maxValue=a;var b=0,c=this.thumbs,d=c.length,e;for(;b<d;++b)e=c[b],e.value=e.value>a?a:e.value;this.syncThumb()},setValue:function(a,b,c,d){var e=this.thumbs[a],f=e.el;b=this.normalizeValue(b),b!==e.value&&this.fireEvent("beforechange",this,b,e.value,e)!==!1&&(e.value=b,this.rendered&&(this.moveThumb(a,this.translateValue(b),c!==!1),this.fireEvent("change",this,b,e),d&&this.fireEvent("changecomplete",this,b,e)))},translateValue:function(a){var b=this.getRatio();return a*b-this.minValue*b-this.halfThumb},reverseValue:function(a){var b=this.getRatio();return(a+this.minValue*b)/b},moveThumb:function(a,b,c){var d=this.thumbs[a].el;!c||this.animate===!1?d.setLeft(b):d.shift({left:b,stopFx:!0,duration:.35})},focus:function(){this.focusEl.focus(10)},onResize:function(a,b){var c=this.thumbs,d=c.length,e=0;for(;e<d;++e)c[e].el.stopFx();this.innerEl.setWidth(a-(this.el.getPadding("l")+this.endEl.getPadding("r"))),this.syncThumb(),Ext.slider.MultiSlider.superclass.onResize.apply(this,arguments)},onDisable:function(){Ext.slider.MultiSlider.superclass.onDisable.call(this);for(var a=0;a<this.thumbs.length;a++){var b=this.thumbs[a],c=b.el;b.disable();if(Ext.isIE){var d=c.getXY();c.hide(),this.innerEl.addClass(this.disabledClass).dom.disabled=!0,this.thumbHolder||(this.thumbHolder=this.endEl.createChild({cls:"x-slider-thumb "+this.disabledClass})),this.thumbHolder.show().setXY(d)}}},onEnable:function(){Ext.slider.MultiSlider.superclass.onEnable.call(this);for(var a=0;a<this.thumbs.length;a++){var b=this.thumbs[a],c=b.el;b.enable(),Ext.isIE&&(this.innerEl.removeClass(this.disabledClass).dom.disabled=!1,this.thumbHolder&&this.thumbHolder.hide(),c.show(),this.syncThumb())}},syncThumb:function(){if(this.rendered)for(var a=0;a<this.thumbs.length;a++)this.moveThumb(a,this.translateValue(this.thumbs[a].value))},getValue:function(a){return this.thumbs[a].value},getValues:function(){var a=[];for(var b=0;b<this.thumbs.length;b++)a.push(this.thumbs[b].value);return a},beforeDestroy:function(){Ext.destroyMembers(this,"endEl","innerEl","thumb","halfThumb","focusEl","tracker","thumbHolder"),Ext.slider.MultiSlider.superclass.beforeDestroy.call(this)}}),Ext.reg("multislider",Ext.slider.MultiSlider),Ext.slider.SingleSlider=Ext.extend(Ext.slider.MultiSlider,{constructor:function(a){a=a||{},Ext.applyIf(a,{values:[a.value||0]}),Ext.slider.SingleSlider.superclass.constructor.call(this,a)},getValue:function(){return Ext.slider.SingleSlider.superclass.getValue.call(this,0)},setValue:function(a,b){var c=Ext.toArray(arguments),d=c.length;return(d==1||d<=3&&typeof arguments[1]!="number")&&c.unshift(0),Ext.slider.SingleSlider.superclass.setValue.apply(this,c)},syncThumb:function(){return Ext.slider.SingleSlider.superclass.syncThumb.apply(this,[0].concat(arguments))},getNearest:function(){return this.thumbs[0]}}),Ext.Slider=Ext.slider.SingleSlider,Ext.reg("slider",Ext.slider.SingleSlider),Ext.slider.Vertical={onResize:function(a,b){this.innerEl.setHeight(b-(this.el.getPadding("t")+this.endEl.getPadding("b"))),this.syncThumb()},getRatio:function(){var a=this.innerEl.getHeight(),b=this.maxValue-this.minValue;return a/b},moveThumb:function(a,b,c){var d=this.thumbs[a],e=d.el;!c||this.animate===!1?e.setBottom(b):e.shift({bottom:b,stopFx:!0,duration:.35})},onClickChange:function(a){if(a.left>this.clickRange[0]&&a.left<this.clickRange[1]){var b=this.getNearest(a,"top"),c=b.index,d=this.minValue+this.reverseValue(this.innerEl.getHeight()-a.top);this.setValue(c,Ext.util.Format.round(d,this.decimalPrecision),undefined,!0)}}},Ext.slider.Thumb.Vertical={getNewValue:function(){var a=this.slider,b=a.innerEl,c=b.translatePoints(this.tracker.getXY()),d=b.getHeight()-c.top;return a.minValue+Ext.util.Format.round(d/a.getRatio(),a.decimalPrecision)}},Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{baseCls:"x-progress",animate:!1,waitTimer:null,initComponent:function(){Ext.ProgressBar.superclass.initComponent.call(this),this.addEvents("update")},onRender:function(a,b){var c=new Ext.Template('<div class="{cls}-wrap">','<div class="{cls}-inner">','<div class="{cls}-bar">','<div class="{cls}-text">',"<div>&#160;</div>","</div>","</div>",'<div class="{cls}-text {cls}-text-back">',"<div>&#160;</div>","</div>","</div>","</div>");this.el=b?c.insertBefore(b,{cls:this.baseCls},!0):c.append(a,{cls:this.baseCls},!0),this.id&&(this.el.dom.id=this.id);var d=this.el.dom.firstChild;this.progressBar=Ext.get(d.firstChild);if(this.textEl)this.textEl=Ext.get(this.textEl),delete this.textTopEl;else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var e=Ext.get(d.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden"),this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,e.dom.firstChild]),this.textEl.setWidth(d.offsetWidth)}this.progressBar.setHeight(d.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this),this.value?this.updateProgress(this.value,this.text):this.updateText(this.text)},updateProgress:function(a,b,c){this.value=a||0,b&&this.updateText(b);if(this.rendered&&!this.isDestroyed){var d=Math.floor(a*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(d,c===!0||c!==!1&&this.animate),this.textTopEl&&this.textTopEl.removeClass("x-hidden").setWidth(d)}return this.fireEvent("update",this,a,b),this},wait:function(a){if(!this.waitTimer){var b=this;a=a||{},this.updateText(a.text),this.waitTimer=Ext.TaskMgr.start({run:function(b){var c=a.increment||10;b-=1,this.updateProgress(((b+c)%c+1)*(100/c)*.01,null,a.animate)},interval:a.interval||1e3,duration:a.duration,onStop:function(){a.fn&&a.fn.apply(a.scope||this),this.reset()},scope:b})}return this},isWaiting:function(){return this.waitTimer!==null},updateText:function(a){return this.text=a||"&#160;",this.rendered&&this.textEl.update(this.text),this},syncProgressBar:function(){return this.value&&this.updateProgress(this.value,this.text),this},setSize:function(a,b){Ext.ProgressBar.superclass.setSize.call(this,a,b);if(this.textTopEl){var c=this.el.dom.firstChild;this.textEl.setSize(c.offsetWidth,c.offsetHeight)}return this.syncProgressBar(),this},reset:function(a){return this.updateProgress(0),this.textTopEl&&this.textTopEl.addClass("x-hidden"),this.clearTimer(),a===!0&&this.hide(),this},clearTimer:function(){this.waitTimer&&(this.waitTimer.onStop=null,Ext.TaskMgr.stop(this.waitTimer),this.waitTimer=null)},onDestroy:function(){this.clearTimer(),this.rendered&&(this.textEl.isComposite&&this.textEl.clear(),Ext.destroyMembers(this,"textEl","progressBar","textTopEl")),Ext.ProgressBar.superclass.onDestroy.call(this)}}),Ext.reg("progress",Ext.ProgressBar),Ext.data.Api=function(){var a={};return{actions:{create:"create",read:"read",update:"update",destroy:"destroy"},restActions:{create:"POST",read:"GET",update:"PUT",destroy:"DELETE"},isAction:function(a){return Ext.data.Api.actions[a]?!0:!1},getVerb:function(b){if(a[b])return a[b];for(var c in this.actions)if(this.actions[c]===b){a[b]=c;break}return a[b]!==undefined?a[b]:null},isValid:function(a){var b=[],c=this.actions;for(var d in a)d in c||b.push(d);return b.length?b:!0},hasUniqueUrl:function(a,b){var c=a.api[b]?a.api[b].url:null,d=!0;for(var e in a.api)if((d=e===b?!0:a.api[e].url!=c?!0:!1)==!1)break;return d},prepare:function(a){a.api||(a.api={});for(var b in this.actions){var c=this.actions[b];a.api[c]=a.api[c]||a.url||a.directFn,typeof a.api[c]=="string"&&(a.api[c]={url:a.api[c],method:a
.restful===!0?Ext.data.Api.restActions[c]:undefined})}},restify:function(a){a.restful=!0;for(var b in this.restActions)a.api[this.actions[b]].method||(a.api[this.actions[b]].method=this.restActions[b]);a.onWrite=a.onWrite.createInterceptor(function(a,b,c,d){var e=b.reader,f=new Ext.data.Response({action:a,raw:c});switch(c.status){case 200:return!0;case 201:if(Ext.isEmpty(f.raw.responseText))f.success=!0;else return!0;break;case 204:f.success=!0,f.data=null;break;default:return!0}return f.success===!0?this.fireEvent("write",this,a,f.data,f,d,b.request.arg):this.fireEvent("exception",this,"remote",a,b,f,d),b.request.callback.call(b.request.scope,f.data,f,f.success),!1},a)}}}(),Ext.data.Response=function(a,b){Ext.apply(this,a,{raw:b})},Ext.data.Response.prototype={message:null,success:!1,status:null,root:null,raw:null,getMessage:function(){return this.message},getSuccess:function(){return this.success},getStatus:function(){return this.status},getRoot:function(){return this.root},getRawResponse:function(){return this.raw}},Ext.data.Api.Error=Ext.extend(Ext.Error,{constructor:function(a,b){this.arg=b,Ext.Error.call(this,a)},name:"Ext.data.Api"}),Ext.apply(Ext.data.Api.Error.prototype,{lang:{"action-url-undefined":"No fallback url defined for this action.  When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.",invalid:"received an invalid API-configuration.  Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions","invalid-url":"Invalid url.  Please review your proxy configuration.",execute:'Attempted to execute an unknown action.  Valid API actions are defined in Ext.data.Api.actions"'}}),Ext.data.SortTypes={none:function(a){return a},stripTagsRE:/<\/?[^>]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){return a?Ext.isDate(a)?a.getTime():Date.parse(String(a)):0},asFloat:function(a){var b=parseFloat(String(a).replace(/,/g,""));return isNaN(b)?0:b},asInt:function(a){var b=parseInt(String(a).replace(/,/g,""),10);return isNaN(b)?0:b}},Ext.data.Record=function(a,b){this.id=b||b===0?b:Ext.data.Record.id(this),this.data=a||{}},Ext.data.Record.create=function(a){var b=Ext.extend(Ext.data.Record,{}),c=b.prototype;c.fields=new Ext.util.MixedCollection(!1,function(a){return a.name});for(var d=0,e=a.length;d<e;d++)c.fields.add(new Ext.data.Field(a[d]));return b.getField=function(a){return c.fields.get(a)},b},Ext.data.Record.PREFIX="ext-record",Ext.data.Record.AUTO_ID=1,Ext.data.Record.EDIT="edit",Ext.data.Record.REJECT="reject",Ext.data.Record.COMMIT="commit",Ext.data.Record.id=function(a){return a.phantom=!0,[Ext.data.Record.PREFIX,"-",Ext.data.Record.AUTO_ID++].join("")},Ext.data.Record.prototype={dirty:!1,editing:!1,error:null,modified:null,phantom:!1,join:function(a){this.store=a},set:function(a,b){var c=Ext.isPrimitive(b)?String:Ext.encode;if(c(this.data[a])==c(b))return;this.dirty=!0,this.modified||(this.modified={}),this.modified[a]===undefined&&(this.modified[a]=this.data[a]),this.data[a]=b,this.editing||this.afterEdit()},afterEdit:function(){this.store!=undefined&&typeof this.store.afterEdit=="function"&&this.store.afterEdit(this)},afterReject:function(){this.store&&this.store.afterReject(this)},afterCommit:function(){this.store&&this.store.afterCommit(this)},get:function(a){return this.data[a]},beginEdit:function(){this.editing=!0,this.modified=this.modified||{}},cancelEdit:function(){this.editing=!1,delete this.modified},endEdit:function(){this.editing=!1,this.dirty&&this.afterEdit()},reject:function(a){var b=this.modified;for(var c in b)typeof b[c]!="function"&&(this.data[c]=b[c]);this.dirty=!1,delete this.modified,this.editing=!1,a!==!0&&this.afterReject()},commit:function(a){this.dirty=!1,delete this.modified,this.editing=!1,a!==!0&&this.afterCommit()},getChanges:function(){var a=this.modified,b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=this.data[c]);return b},hasError:function(){return this.error!==null},clearError:function(){this.error=null},copy:function(a){return new this.constructor(Ext.apply({},this.data),a||this.id)},isModified:function(a){return!!this.modified&&!!this.modified.hasOwnProperty(a)},isValid:function(){return this.fields.find(function(a){return a.allowBlank===!1&&Ext.isEmpty(this.data[a.name])?!0:!1},this)?!1:!0},markDirty:function(){this.dirty=!0,this.modified||(this.modified={}),this.fields.each(function(a){this.modified[a.name]=this.data[a.name]},this)}},Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection,{register:function(){for(var a=0,b;b=arguments[a];a++)this.add(b)},unregister:function(){for(var a=0,b;b=arguments[a];a++)this.remove(this.lookup(b))},lookup:function(a){if(Ext.isArray(a)){var b=["field1"],c=!Ext.isArray(a[0]);if(!c)for(var d=2,e=a[0].length;d<=e;++d)b.push("field"+d);return new Ext.data.ArrayStore({fields:b,data:a,expandData:c,autoDestroy:!0,autoCreated:!0})}return Ext.isObject(a)?a.events?a:Ext.create(a,"store"):this.get(a)},getKey:function(a){return a.storeId}}),Ext.data.Store=Ext.extend(Ext.util.Observable,{writer:undefined,remoteSort:!1,autoDestroy:!1,pruneModifiedRecords:!1,lastOptions:null,autoSave:!0,batch:!0,restful:!1,paramNames:undefined,defaultParamNames:{start:"start",limit:"limit",sort:"sort",dir:"dir"},isDestroyed:!1,hasMultiSort:!1,batchKey:"_ext_batch_",constructor:function(a){this.data=new Ext.util.MixedCollection(!1),this.data.getKey=function(a){return a.id},this.removed=[],a&&a.data&&(this.inlineData=a.data,delete a.data),Ext.apply(this,a),this.baseParams=Ext.isObject(this.baseParams)?this.baseParams:{},this.paramNames=Ext.applyIf(this.paramNames||{},this.defaultParamNames),(this.url||this.api)&&!this.proxy&&(this.proxy=new Ext.data.HttpProxy({url:this.url,api:this.api})),this.restful===!0&&this.proxy&&(this.batch=!1,Ext.data.Api.restify(this.proxy)),this.reader&&(this.recordType||(this.recordType=this.reader.recordType),this.reader.onMetaChange&&(this.reader.onMetaChange=this.reader.onMetaChange.createSequence(this.onMetaChange,this)),this.writer&&(this.writer instanceof Ext.data.DataWriter==!1&&(this.writer=this.buildWriter(this.writer)),this.writer.meta=this.reader.meta,this.pruneModifiedRecords=!0)),this.recordType&&(this.fields=this.recordType.prototype.fields),this.modified=[],this.addEvents("datachanged","metachange","add","remove","update","clear","exception","beforeload","load","loadexception","beforewrite","write","beforesave","save"),this.proxy&&this.relayEvents(this.proxy,["loadexception","exception"]),this.writer&&this.on({scope:this,add:this.createRecords,remove:this.destroyRecord,update:this.updateRecord,clear:this.onClear}),this.sortToggle={},this.sortField?this.setDefaultSort(this.sortField,this.sortDir):this.sortInfo&&this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction),Ext.data.Store.superclass.constructor.call(this),this.id&&(this.storeId=this.id,delete this.id),this.storeId&&Ext.StoreMgr.register(this),this.inlineData?(this.loadData(this.inlineData),delete this.inlineData):this.autoLoad&&this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined]),this.batchCounter=0,this.batches={}},buildWriter:function(a){var b=undefined,c=(a.format||"json").toLowerCase();switch(c){case"json":b=Ext.data.JsonWriter;break;case"xml":b=Ext.data.XmlWriter;break;default:b=Ext.data.JsonWriter}return new b(a)},destroy:function(){this.isDestroyed||(this.storeId&&Ext.StoreMgr.unregister(this),this.clearData(),this.data=null,Ext.destroy(this.proxy),this.reader=this.writer=null,this.purgeListeners(),this.isDestroyed=!0)},add:function(a){a=[].concat(a);if(a.length<1)return;for(var b=0,c=a.length;b<c;b++)a[b].join(this);var d=this.data.length;this.data.addAll(a),this.snapshot&&this.snapshot.addAll(a),this.fireEvent("add",this,a,d)},addSorted:function(a){var b=this.findInsertIndex(a);this.insert(b,a)},remove:function(a){if(Ext.isArray(a)){Ext.each(a,function(a){this.remove(a)},this);return}var b=this.data.indexOf(a);b>-1&&(a.join(null),this.data.removeAt(b)),this.pruneModifiedRecords&&this.modified.remove(a),this.snapshot&&this.snapshot.remove(a),b>-1&&this.fireEvent("remove",this,a,b)},removeAt:function(a){this.remove(this.getAt(a))},removeAll:function(a){var b=[];this.each(function(a){b.push(a)}),this.clearData(),this.snapshot&&this.snapshot.clear(),this.pruneModifiedRecords&&(this.modified=[]),a!==!0&&this.fireEvent("clear",this,b)},onClear:function(a,b){Ext.each(b,function(a,b){this.destroyRecord(this,a,b)},this)},insert:function(a,b){b=[].concat(b);for(var c=0,d=b.length;c<d;c++)this.data.insert(a,b[c]),b[c].join(this);this.snapshot&&this.snapshot.addAll(b),this.fireEvent("add",this,b,a)},indexOf:function(a){return this.data.indexOf(a)},indexOfId:function(a){return this.data.indexOfKey(a)},getById:function(a){return(this.snapshot||this.data).key(a)},getAt:function(a){return this.data.itemAt(a)},getRange:function(a,b){return this.data.getRange(a,b)},storeOptions:function(a){a=Ext.apply({},a),delete a.callback,delete a.scope,this.lastOptions=a},clearData:function(){this.data.each(function(a){a.join(null)}),this.data.clear()},load:function(a){a=Ext.apply({},a),this.storeOptions(a);if(this.sortInfo&&this.remoteSort){var b=this.paramNames;a.params=Ext.apply({},a.params),a.params[b.sort]=this.sortInfo.field,a.params[b.dir]=this.sortInfo.direction}try{return this.execute("read",null,a)}catch(c){return this.handleException(c),!1}},updateRecord:function(a,b,c){c==Ext.data.Record.EDIT&&this.autoSave===!0&&(!b.phantom||b.phantom&&b.isValid())&&this.save()},createRecords:function(a,b,c){for(var d=0,e=b.length;d<e;d++)b[d].phantom&&b[d].isValid()&&(b[d].markDirty(),this.modified.push(b[d]));this.autoSave===!0&&this.save()},destroyRecord:function(a,b,c){this.modified.indexOf(b)!=-1&&this.modified.remove(b),b.phantom||(this.removed.push(b),b.lastIndex=c,this.autoSave===!0&&this.save())},execute:function(a,b,c,d){if(!Ext.data.Api.isAction(a))throw new Ext.data.Api.Error("execute",a);c=Ext.applyIf(c||{},{params:{}}),d!==undefined&&this.addToBatch(d);var e=!0;return a==="read"?(e=this.fireEvent("beforeload",this,c),Ext.applyIf(c.params,this.baseParams)):(this.writer.listful===!0&&this.restful!==!0?b=Ext.isArray(b)?b:[b]:Ext.isArray(b)&&b.length==1&&(b=b.shift()),(e=this.fireEvent("beforewrite",this,a,b,c))!==!1&&this.writer.apply(c.params,this.baseParams,a,b)),e!==!1&&(this.writer&&this.proxy.url&&!this.proxy.restful&&!Ext.data.Api.hasUniqueUrl(this.proxy,a)&&(c.params.xaction=a),this.proxy.request(Ext.data.Api.actions[a],b,c.params,this.reader,this.createCallback(a,b,d),this,c)),e},save:function(){if(!this.writer)throw new Ext.data.Store.Error("writer-undefined");var a=[],b,c,d,e={};this.removed.length&&a.push(["destroy",this.removed]);var f=[].concat(this.getModifiedRecords());if(f.length){var g=[];for(var h=f.length-1;h>=0;h--)if(f[h].phantom===!0){var i=f.splice(h,1).shift();i.isValid()&&g.push(i)}else f[h].isValid()||f.splice(h,1);g.length&&a.push(["create",g]),f.length&&a.push(["update",f])}b=a.length;if(b){d=++this.batchCounter;for(var h=0;h<b;++h)c=a[h],e[c[0]]=c[1];if(this.fireEvent("beforesave",this,e)!==!1){for(var h=0;h<b;++h)c=a[h],this.doTransaction(c[0],c[1],d);return d}}return-1},doTransaction:function(a,b,c){function d(b){try{this.execute(a,b,undefined,c)}catch(d){this.handleException(d)}}if(this.batch===!1)for(var e=0,f=b.length;e<f;e++)d.call(this,b[e]);else d.call(this,b)},addToBatch:function(a){var b=this.batches,c=this.batchKey+a,d=b[c];d||(b[c]=d={id:a,count:0,data:{}}),++d.count},removeFromBatch:function(a,b,c){var d=this.batches,e=this.batchKey+a,f=d[e],c,g;f&&(g=f.data[b]||[],f.data[b]=g.concat(c),f.count===1?(c=f.data,delete d[e],this.fireEvent("save",this,a,c)):--f.count)},createCallback:function(a,b,c){var d=Ext.data.Api.actions;return a=="read"?this.loadRecords:function(d,e,f){this["on"+Ext.util.Format.capitalize(a)+"Records"](f,b,[].concat(d)),f===!0&&this.fireEvent("write",this,a,d,e,b),this.removeFromBatch(c,a,d)}},clearModified:function(a){if(Ext.isArray(a))for(var b=a.length-1;b>=0;b--)this.modified.splice(this.modified.indexOf(a[b]),1);else this.modified.splice(this.modified.indexOf(a),1)},reMap:function(a){if(Ext.isArray(a))for(var b=0,c=a.length;b<c;b++)this.reMap(a[b]);else{delete this.data.map[a._phid],this.data.map[a.id]=a;var d=this.data.keys.indexOf(a._phid);this.data.keys.splice(d,1,a.id),delete a._phid}},onCreateRecords:function(a,b,c){if(a===!0)try{this.reader.realize(b,c),this.reMap(b)}catch(d){this.handleException(d),Ext.isArray(b)&&this.onCreateRecords(a,b,c)}},onUpdateRecords:function(a,b,c){if(a===!0)try{this.reader.update(b,c)}catch(d){this.handleException(d),Ext.isArray(b)&&this.onUpdateRecords(a,b,c)}},onDestroyRecords:function(a,b,c){b=b instanceof Ext.data.Record?[b]:[].concat(b);for(var d=0,e=b.length;d<e;d++)this.removed.splice(this.removed.indexOf(b[d]),1);if(a===!1)for(d=b.length-1;d>=0;d--)this.insert(b[d].lastIndex,b[d])},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(a,b,c){if(this.isDestroyed===!0)return;if(!a||c===!1){c!==!1&&this.fireEvent("load",this,[],b),b.callback&&b.callback.call(b.scope||this,[],b,!1,a);return}var d=a.records,e=a.totalRecords||d.length;if(!b||b.add!==!0){this.pruneModifiedRecords&&(this.modified=[]);for(var f=0,g=d.length;f<g;f++)d[f].join(this);this.snapshot&&(this.data=this.snapshot,delete this.snapshot),this.clearData(),this.data.addAll(d),this.totalLength=e,this.applySort(),this.fireEvent("datachanged",this)}else this.totalLength=Math.max(e,this.data.length+d.length),this.add(d);this.fireEvent("load",this,d,b),b.callback&&b.callback.call(b.scope||this,d,b,!0)},loadData:function(a,b){var c=this.reader.readRecords(a);this.loadRecords(c,{add:b},!0)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){(this.sortInfo||this.multiSortInfo)&&!this.remoteSort&&this.sortData()},sortData:function(){var a=this.hasMultiSort?this.multiSortInfo:this.sortInfo,b=a.direction||"ASC",c=a.sorters,d=[];this.hasMultiSort||(c=[{direction:b,field:a.field}]);for(var e=0,f=c.length;e<f;e++)d.push(this.createSortFunction(c[e].field,c[e].direction));if(d.length==0)return;var g=b.toUpperCase()=="DESC"?-1:1,h=function(a,b){var c=d[0].call(this,a,b);if(d.length>1)for(var e=1,f=d.length;e<f;e++)c=c||d[e].call(this,a,b);return g*c};this.data.sort(b,h),this.snapshot&&this.snapshot!=this.data&&this.snapshot.sort(b,h)},createSortFunction:function(a,b){b=b||"ASC";var c=b.toUpperCase()=="DESC"?-1:1,d=this.fields.get(a).sortType;return function(b,e){var f=d(b.data[a]),g=d(e.data[a]);return c*(f>g?1:f<g?-1:0)}},setDefaultSort:function(a,b){b=b?b.toUpperCase():"ASC",this.sortInfo={field:a,direction:b},this.sortToggle[a]=b},sort:function(a,b){return Ext.isArray(arguments[0])?this.multiSort.call(this,a,b):this.singleSort(a,b)},singleSort:function(a,b){var c=this.fields.get(a);if(!c)return!1;var d=c.name,e=this.sortInfo||null,f=this.sortToggle?this.sortToggle[d]:null;b||(e&&e.field==d?b=(this.sortToggle[d]||"ASC").toggle("ASC","DESC"):b=c.sortDir),this.sortToggle[d]=b,this.sortInfo={field:d,direction:b},this.hasMultiSort=!1,this.remoteSort?this.load(this.lastOptions)||(f&&(this.sortToggle[d]=f),e&&(this.sortInfo=e)):(this.applySort(),this.fireEvent("datachanged",this))},multiSort:function(a,b){this.hasMultiSort=!0,b=b||"ASC",this.multiSortInfo&&b==this.multiSortInfo.direction&&(b=b.toggle("ASC","DESC")),this.multiSortInfo={sorters:a,direction:b},this.remoteSort?this.singleSort(a[0].field,a[0].direction):(this.applySort(),this.fireEvent("datachanged",this))},each:function(a,b){this.data.each(a,b)},getModifiedRecords:function(){return this.modified},sum:function(a,b,c){var d=this.data.items,e=0;b=b||0,c=c||c===0?c:d.length-1;for(var f=b;f<=c;f++)e+=d[f].data[a]||0;return e},createFilterFn:function(a,b,c,d,e){return Ext.isEmpty(b,!1)?!1:(b=this.data.createValueMatcher(b,c,d,e),function(c){return b.test(c.data[a])})},createMultipleFilterFn:function(a){return function(b){var c=!0;for(var d=0,e=a.length;d<e;d++){var f=a[d],g=f.fn,h=f.scope;c=c&&g.call(h,b)}return c}},filter:function(a,b,c,d,e){Ext.isObject(a)&&(a=[a]);if(Ext.isArray(a)){var f=[];for(var g=0,h=a.length;g<h;g++){var i=a[g],j=i.fn,k=i.scope||this;Ext.isFunction(j)||(j=this.createFilterFn(i.property,i.value,i.anyMatch,i.caseSensitive,i.exactMatch)),f.push({fn:j,scope:k})}var l=this.createMultipleFilterFn(f)}else var l=this.createFilterFn(a,b,c,d,e);return l?this.filterBy(l):this.clearFilter()},filterBy:function(a,b){this.snapshot=this.snapshot||this.data,this.data=this.queryBy(a,b||this),this.fireEvent("datachanged",this)},clearFilter:function(a){this.isFiltered()&&(this.data=this.snapshot,delete this.snapshot,a!==!0&&this.fireEvent("datachanged",this))},isFiltered:function(){return!!this.snapshot&&this.snapshot!=this.data},query:function(a,b,c,d){var e=this.createFilterFn(a,b,c,d);return e?this.queryBy(e):this.data.clone()},queryBy:function(a,b){var c=this.snapshot||this.data;return c.filterBy(a,b||this)},find:function(a,b,c,d,e){var f=this.createFilterFn(a,b,d,e);return f?this.data.findIndexBy(f,null,c):-1},findExact:function(a,b,c){return this.data.findIndexBy(function(c){return c.get(a)===b},this,c)},findBy:function(a,b,c){return this.data.findIndexBy(a,b,c)},collect:function(a,b,c){var d=c===!0&&this.snapshot?this.snapshot.items:this.data.items,e,f,g=[],h={};for(var i=0,j=d.length;i<j;i++)e=d[i].data[a],f=String(e),(b||!Ext.isEmpty(e))&&!h[f]&&(h[f]=!0,g[g.length]=e);return g},afterEdit:function(a){this.modified.indexOf(a)==-1&&this.modified.push(a),this.fireEvent("update",this,a,Ext.data.Record.EDIT)},afterReject:function(a){this.modified.remove(a),this.fireEvent("update",this,a,Ext.data.Record.REJECT)},afterCommit:function(a){this.modified.remove(a),this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},commitChanges:function(){var a=this.modified.slice(0);this.modified=[];for(var b=0,c=a.length;b<c;b++)a[b].commit()},rejectChanges:function(){var a=this.modified.slice(0);this.modified=[];for(var b=0,c=a.length;b<c;b++)a[b].reject();var a=this.removed.slice(0).reverse();this.removed=[];for(var b=0,c=a.length;b<c;b++)this.insert(a[b].lastIndex||0,a[b]),a[b].reject()},onMetaChange:function(a){this.recordType=this.reader.recordType,this.fields=this.recordType.prototype.fields,delete this.snapshot,this.reader.meta.sortInfo?this.sortInfo=this.reader.meta.sortInfo:this.sortInfo&&!this.fields.get(this.sortInfo.field)&&delete this.sortInfo,this.writer&&(this.writer.meta=this.reader.meta),this.modified=[],this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(a){this.suspendEvents();var b=this.data.clone();this.data.add(a),this.applySort();var c=this.data.indexOf(a);return this.data=b,this.resumeEvents(),c},setBaseParam:function(a,b){this.baseParams=this.baseParams||{},this.baseParams[a]=b}}),Ext.reg("store",Ext.data.Store),Ext.data.Store.Error=Ext.extend(Ext.Error,{name:"Ext.data.Store"}),Ext.apply(Ext.data.Store.Error.prototype,{lang:{"writer-undefined":"Attempted to execute a write-action without a DataWriter installed."}}),Ext.data.Field=Ext.extend(Object,{constructor:function(a){Ext.isString(a)&&(a={name:a}),Ext.apply(this,a);var b=Ext.data.Types,c=this.sortType,d;this.type?Ext.isString(this.type)&&(this.type=Ext.data.Types[this.type.toUpperCase()]||b.AUTO):this.type=b.AUTO,Ext.isString(c)?this.sortType=Ext.data.SortTypes[c]:Ext.isEmpty(c)&&(this.sortType=this.type.sortType),this.convert||(this.convert=this.type.convert)},dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC",allowBlank:!0}),Ext.data.DataReader=function(a,b){this.meta=a,this.recordType=Ext.isArray(b)?Ext.data.Record.create(b):b,this.recordType&&this.buildExtractors()},Ext.data.DataReader.prototype={getTotal:Ext.emptyFn,getRoot:Ext.emptyFn,getMessage:Ext.emptyFn,getSuccess:Ext.emptyFn,getId:Ext.emptyFn,buildExtractors:Ext.emptyFn,extractValues:Ext.emptyFn,realize:function(a,b){if(Ext.isArray(a))for(var c=a.length-1;c>=0;c--)Ext.isArray(b)?this.realize(a.splice(c,1).shift(),b.splice(c,1).shift()):this.realize(a.splice(c,1).shift(),b);else{Ext.isArray(b)&&b.length==1&&(b=b.shift());if(!this.isData(b))throw new Ext.data.DataReader.Error("realize",a);a.phantom=!1,a._phid=a.id,a.id=this.getId(b),a.data=b,a.commit()}},update:function(a,b){if(Ext.isArray(a))for(var c=a.length-1;c>=0;c--)Ext.isArray(b)?this.update(a.splice(c,1).shift(),b.splice(c,1).shift()):this.update(a.splice(c,1).shift(),b);else Ext.isArray(b)&&b.length==1&&(b=b.shift()),this.isData(b)&&(a.data=Ext.apply(a.data,b)),a.commit()},extractData:function(a,b){var c=this instanceof Ext.data.JsonReader?"json":"node",d=[];this.isData(a)&&!(this instanceof Ext.data.XmlReader)&&(a=[a]);var e=this.recordType.prototype.fields,f=e.items,g=e.length,d=[];if(b===!0){var h=this.recordType;for(var i=0;i<a.length;i++){var j=a[i],k=new h(this.extractValues(j,f,g),this.getId(j));k[c]=j,d.push(k)}}else for(var i=0;i<a.length;i++){var l=this.extractValues(a[i],f,g);l[this.meta.idProperty]=this.getId(a[i]),d.push(l)}return d},isData:function(a){return a&&Ext.isObject(a)&&!Ext.isEmpty(this.getId(a))?!0:!1},onMetaChange:function(a){delete this.ef,this.meta=a,this.recordType=Ext.data.Record.create(a.fields),this.buildExtractors()}},Ext.data.DataReader.Error=Ext.extend(Ext.Error,{constructor:function(a,b){this.arg=b,Ext.Error.call(this,a)},name:"Ext.data.DataReader"}),Ext.apply(Ext.data.DataReader.Error.prototype,{lang:{update:"#update received invalid data from server.  Please see docs for DataReader#update and review your DataReader configuration.",realize:"#realize was called with invalid remote-data.  Please see the docs for DataReader#realize and review your DataReader configuration.","invalid-response":"#readResponse received an invalid response from the server."}}),Ext.data.DataWriter=function(a){Ext.apply(this,a)},Ext.data.DataWriter.prototype={writeAllFields:!1,listful:!1,apply:function(a,b,c,d){var e=[],f=c+"Record";Ext.isArray(d)?Ext.each(d,function(a){e.push(this[f](a))},this):d instanceof Ext.data.Record&&(e=this[f](d)),this.render(a,b,e)},render:Ext.emptyFn,updateRecord:Ext.emptyFn,createRecord:Ext.emptyFn,destroyRecord:Ext.emptyFn,toHash:function(a,b){var c=a.fields.map,d={},e=this.writeAllFields===!1&&a.phantom===!1?a.getChanges():a.data,f;return Ext.iterate(e,function(a,b){if(f=c[a])d[f.mapping?f.mapping:f.name]=b}),a.phantom?a.fields.containsKey(this.meta.idProperty)&&Ext.isEmpty(a.data[this.meta.idProperty])&&delete d[this.meta.idProperty]:d[this.meta.idProperty]=a.id,d},toArray:function(a){var b=[];return Ext.iterate(a,function(a,c){b.push({name:a,value:c})},this),b}},Ext.data.DataProxy=function(a){a=a||{},this.api=a.api,this.url=a.url,this.restful=a.restful,this.listeners=a.listeners,this.prettyUrls=a.prettyUrls,this.addEvents("exception","beforeload","load","loadexception","beforewrite","write"),Ext.data.DataProxy.superclass.constructor.call(this);try{Ext.data.Api.prepare(this)}catch(b){b instanceof Ext.data.Api.Error&&b.toConsole()}Ext.data.DataProxy.relayEvents(this,["beforewrite","write","exception"])},Ext.extend(Ext.data.DataProxy,Ext.util.Observable,{restful:!1,setApi:function(){if(arguments.length==1){var a=Ext.data.Api.isValid(arguments[0]);if(a===!0)this.api=arguments[0];else throw new Ext.data.Api.Error("invalid",a)}else if(arguments.length==2){if(!Ext.data.Api.isAction(arguments[0]))throw new Ext.data.Api.Error("invalid",arguments[0]);this.api[arguments[0]]=arguments[1]}Ext.data.Api.prepare(this)},isApiAction:function(a){return this.api[a]?!0:!1},request:function(a,b,c,d,e,f,g){if(!this.api[a]&&!this.load)throw new Ext.data.DataProxy.Error("action-undefined",a);c=c||{},(a===Ext.data.Api.actions.read?this.fireEvent("beforeload",this,c):this.fireEvent("beforewrite",this,a,b,c)!==!1)?this.doRequest.apply(this,arguments):e.call(f||this,null,g,!1)},load:null,doRequest:function(a,b,c,d,e,f,g){this.load(c,d,e,f,g)},onRead:Ext.emptyFn,onWrite:Ext.emptyFn,buildUrl:function(a,b){b=b||null;var c=this.conn&&this.conn.url?this.conn.url:this.api[a]?this.api[a].url:this.url;if(!c)throw new Ext.data.Api.Error("invalid-url",a);var d=null,e=c.match(/(.*)(\.json|\.xml|\.html)$/);return e&&(d=e[2],c=e[1]),(this.restful===!0||this.prettyUrls===!0)&&b instanceof Ext.data.Record&&!b.phantom&&(c+="/"+b.id),d===null?c:c+d},destroy:function(){this.purgeListeners()}}),Ext.apply(Ext.data.DataProxy,Ext.util.Observable.prototype),Ext.util.Observable.call(Ext.data.DataProxy),Ext.data.DataProxy.Error=Ext.extend(Ext.Error,{constructor:function(a,b){this.arg=b,Ext.Error.call(this,a)},name:"Ext.data.DataProxy"}),Ext.apply(Ext.data.DataProxy.Error.prototype,{lang:{"action-undefined":"DataProxy attempted to execute an API-action but found an undefined url / function.  Please review your Proxy url/api-configuration.","api-invalid":"Recieved an invalid API-configuration.  Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions."}}),Ext.data.Request=function(a){Ext.apply(this,a)},Ext.data.Request.prototype={action:undefined,rs:undefined,params:undefined,callback:Ext.emptyFn,scope:undefined,reader:undefined},Ext.data.Response=function(a){Ext.apply(this,a)},Ext.data.Response.prototype={action:undefined,success:undefined,message:undefined,data:undefined,raw:undefined,records:undefined},Ext.data.ScriptTagProxy=function(a){Ext.apply(this,a),Ext.data.ScriptTagProxy.superclass.constructor.call(this,a),this.head=document.getElementsByTagName("head")[0]},Ext.data.ScriptTagProxy.TRANS_ID=1e3,Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:3e4,callbackParam:"callback",nocache:!0,doRequest:function(a,b,c,d,e,f,g){var h=Ext.urlEncode(Ext.apply(c,this.extraParams)),i=this.buildUrl(a,b);if(!i)throw new Ext.data.Api.Error("invalid-url",i);i=Ext.urlAppend(i,h),this.nocache&&(i=Ext.urlAppend(i,"_dc="+(new Date).getTime()));var j=++Ext.data.ScriptTagProxy.TRANS_ID,k={id:j,action:a,cb:"stcCallback"+j,scriptId:"stcScript"+j,params:c,arg:g,url:i,callback:e,scope:f,reader:d};window[k.cb]=this.createCallback(a,b,k),i+=String.format("&{0}={1}",this.callbackParam,k.cb),this.autoAbort!==!1&&this.abort(),k.timeoutId=this.handleFailure.defer(this.timeout,this,[k]);var l=document.createElement("script");l.setAttribute("src",i),l.setAttribute("type","text/javascript"),l.setAttribute("id",k.scriptId),this.head.appendChild(l),this.trans=k},createCallback:function(a,b,c){var d=this;return function(e){d.trans=!1,d.destroyTrans(c,!0),a===Ext.data.Api.actions.read?d.onRead.call(d,a,c,e):d.onWrite.call(d,a,c,e,b)}},onRead:function(a,b,c){var d;try{d=b.reader.readRecords(c)}catch(e){this.fireEvent("loadexception",this,b,c,e),this.fireEvent("exception",this,"response",a,b,c,e),b.callback.call(b.scope||window,null,b.arg,!1);return}d.success===!1?(this.fireEvent("loadexception",this,b,c),this.fireEvent("exception",this,"remote",a,b,c,null)):this.fireEvent("load",this,c,b.arg),b.callback.call(b.scope||window,d,b.arg,d.success)},onWrite:function(a,b,c,d){var e=b.reader;try{var f=e.readResponse(a,c)}catch(g){this.fireEvent("exception",this,"response",a,b,f,g),b.callback.call(b.scope||window,null,f,!1);return}if(!f.success==!0){this.fireEvent("exception",this,"remote",a,b,f,d),b.callback.call(b.scope||window,null,f,!1);return}this.fireEvent("write",this,a,f.data,f,d,b.arg),b.callback.call(b.scope||window,f.data,f,!0)},isLoading:function(){return this.trans?!0:!1},abort:function(){this.isLoading()&&this.destroyTrans(this.trans)},destroyTrans:function(a,b){this.head.removeChild(document.getElementById(a.scriptId)),clearTimeout(a.timeoutId);if(b){window[a.cb]=undefined;try{delete window[a.cb]}catch(c){}}else window[a.cb]=function(){window[a.cb]=undefined;try{delete window[a.cb]}catch(b){}}},handleFailure:function(a){this.trans=!1,this.destroyTrans(a,!1),a.action===Ext.data.Api.actions.read&&this.fireEvent("loadexception",this,null,a.arg),this.fireEvent("exception",this,"response",a.action,{response:null,options:a.arg}),a.callback.call(a.scope||window,null,a.arg,!1)},destroy:function(){this.abort(),Ext.data.ScriptTagProxy.superclass.destroy.call(this)}}),Ext.data.HttpProxy=function(a){Ext.data.HttpProxy.superclass.constructor.call(this,a),this.conn=a,this.conn.url=null,this.useAjax=!a||!a.events;var b=Ext.data.Api.actions;this.activeRequest={};for(var c in b)this.activeRequest[b[c]]=undefined},Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},setUrl:function(a,b){this.conn.url=a,b===!0&&(this.url=a,this.api=null,Ext.data.Api.prepare(this))},doRequest:function(a,b,c,d,e,f,g){var h={method:this.api[a]?this.api[a].method:undefined,request:{callback:e,scope:f,arg:g},reader:d,callback:this.createCallback(a,b),scope:this};c.jsonData?h.jsonData=c.jsonData:c.xmlData?h.xmlData=c.xmlData:h.params=c||{},this.conn.url=this.buildUrl(a,b),this.useAjax?(Ext.applyIf(h,this.conn),!this.activeRequest[a],this.activeRequest[a]=Ext.Ajax.request(h)):this.conn.request(h),this.conn.url=null},createCallback:function(a,b){return function(c,d,e){this.activeRequest[a]=undefined;if(!d){a===Ext.data.Api.actions.read&&this.fireEvent("loadexception",this,c,e),this.fireEvent("exception",this,"response",a,c,e),c.request.callback.call(c.request.scope,null,c.request.arg,!1);return}a===Ext.data.Api.actions.read?this.onRead(a,c,e):this.onWrite(a,c,e,b)}},onRead:function(a,b,c){var d;try{d=b.reader.read(c)}catch(e){this.fireEvent("loadexception",this,b,c,e),this.fireEvent("exception",this,"response",a,b,c,e),b.request.callback.call(b.request.scope,null,b.request.arg,!1);return}if(d.success===!1){this.fireEvent("loadexception",this,b,c);var f=b.reader.readResponse(a,c);this.fireEvent("exception",this,"remote",a,b,f,null)}else this.fireEvent("load",this,b,b.request.arg);b.request.callback.call(b.request.scope,d,b.request.arg,d.success)},onWrite:function(a,b,c,d){var e=b.reader,f;try{f=e.readResponse(a,c)}catch(g){this.fireEvent("exception",this,"response",a,b,c,g),b.request.callback.call(b.request.scope,null,b.request.arg,!1);return}f.success===!0?this.fireEvent("write",this,a,f.data,f,d,b.request.arg):this.fireEvent("exception",this,"remote",a,b,f,d),b.request.callback.call(b.request.scope,f.data,f,f.success)},destroy:function(){if(!this.useAjax)this.conn.abort();else if(this.activeRequest){var a=Ext.data.Api.actions;for(var b in a)this.activeRequest[a[b]]&&Ext.Ajax.abort(this.activeRequest[a[b]])}Ext.data.HttpProxy.superclass.destroy.call(this)}}),Ext.data.MemoryProxy=function(a){var b={};b[Ext.data.Api.actions.read]=!0,Ext.data.MemoryProxy.superclass.constructor.call(this,{api:b}),this.data=a},Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{doRequest:function(a,b,c,d,e,f,g){c=c||{};var h;try{h=d.readRecords(this.data)}catch(i){this.fireEvent("loadexception",this,null,g,i),this.fireEvent("exception",this,"response",a,g,null,i),e.call(f,null,g,!1);return}e.call(f,h,g,!0)}}),Ext.data.Types=new function(){var a=Ext.data.SortTypes;Ext.apply(this,{stripRe:/[\$,%]/g,AUTO:{convert:function(a){return a},sortType:a.none,type:"auto"},STRING:{convert:function(a){return a===undefined||a===null?"":String(a)},sortType:a.asUCString,type:"string"},INT:{convert:function(a){return a!==undefined&&a!==null&&a!==""?parseInt(String(a).replace(Ext.data.Types.stripRe,""),10):0},sortType:a.none,type:"int"},FLOAT:{convert:function(a){return a!==undefined&&a!==null&&a!==""?parseFloat(String(a).replace(Ext.data.Types.stripRe,""),10):0},sortType:a.none,type:"float"},BOOL:{convert:function(a){return a===!0||a==="true"||a==1},sortType:a.none,type:"bool"},DATE:{convert:function(a){var b=this.dateFormat;if(!a)return null;if(Ext.isDate(a))return a;if(b)return b=="timestamp"?new Date(a*1e3):b=="time"?new Date(parseInt(a,10)):Date.parseDate(a,b);var c=Date.parse(a);return c?new Date(c):null},sortType:a.asDate,type:"date"}}),Ext.apply(this,{BOOLEAN:this.BOOL,INTEGER:this.INT,NUMBER:this.FLOAT})},Ext.data.JsonWriter=Ext.extend(Ext.data.DataWriter,{encode:!0,encodeDelete:!1,constructor:function(a){Ext.data.JsonWriter.superclass.constructor.call(this,a)},render:function(a,b,c){if(this.encode===!0)Ext.apply(a,b),a[this.meta.root]=Ext.encode(c);else{var d=Ext.apply({},b);d[this.meta.root]=c,a.jsonData=d}},createRecord:function(a){return this.toHash(a)},updateRecord:function(a){return this.toHash(a)},destroyRecord:function(a){if(this.encodeDelete){var b={};return b[this.meta.idProperty]=a.id,b}return a
.id}}),Ext.data.JsonReader=function(a,b){a=a||{},Ext.applyIf(a,{idProperty:"id",successProperty:"success",totalProperty:"total"}),Ext.data.JsonReader.superclass.constructor.call(this,a,b||a.fields)},Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(a){var b=a.responseText,c=Ext.decode(b);if(!c)throw{message:"JsonReader.read: Json object not found"};return this.readRecords(c)},readResponse:function(a,b){var c=b.responseText!==undefined?Ext.decode(b.responseText):b;if(!c)throw new Ext.data.JsonReader.Error("response");var d=this.getRoot(c);if(a===Ext.data.Api.actions.create){var e=Ext.isDefined(d);if(e&&Ext.isEmpty(d))throw new Ext.data.JsonReader.Error("root-empty",this.meta.root);if(!e)throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}var f=new Ext.data.Response({action:a,success:this.getSuccess(c),data:d?this.extractData(d,!1):[],message:this.getMessage(c),raw:c});if(Ext.isEmpty(f.success))throw new Ext.data.JsonReader.Error("successProperty-response",this.meta.successProperty);return f},readRecords:function(a){this.jsonData=a,a.metaData&&this.onMetaChange(a.metaData);var b=this.meta,c=this.recordType,d=c.prototype.fields,e=d.items,f=d.length,g,h=this.getRoot(a),i=h.length,j=i,k=!0;b.totalProperty&&(g=parseInt(this.getTotal(a),10),isNaN(g)||(j=g));if(b.successProperty){g=this.getSuccess(a);if(g===!1||g==="false")k=!1}return{success:k,records:this.extractData(h,!0),totalRecords:j}},buildExtractors:function(){if(this.ef)return;var a=this.meta,b=this.recordType,c=b.prototype.fields,d=c.items,e=c.length;a.totalProperty&&(this.getTotal=this.createAccessor(a.totalProperty)),a.successProperty&&(this.getSuccess=this.createAccessor(a.successProperty)),a.messageProperty&&(this.getMessage=this.createAccessor(a.messageProperty)),this.getRoot=a.root?this.createAccessor(a.root):function(a){return a};if(a.id||a.idProperty){var f=this.createAccessor(a.id||a.idProperty);this.getId=function(a){var b=f(a);return b===undefined||b===""?null:b}}else this.getId=function(){return null};var g=[];for(var h=0;h<e;h++){c=d[h];var i=c.mapping!==undefined&&c.mapping!==null?c.mapping:c.name;g.push(this.createAccessor(i))}this.ef=g},simpleAccess:function(a,b){return a[b]},createAccessor:function(){var a=/[\[\.]/;return function(b){if(Ext.isEmpty(b))return Ext.emptyFn;if(Ext.isFunction(b))return b;var c=String(b).search(a);return c>=0?new Function("obj","return obj"+(c>0?".":"")+b):function(a){return a[b]}}}(),extractValues:function(a,b,c){var d,e={};for(var f=0;f<c;f++){d=b[f];var g=this.ef[f](a);e[d.name]=d.convert(g!==undefined?g:d.defaultValue,a)}return e}}),Ext.data.JsonReader.Error=Ext.extend(Ext.Error,{constructor:function(a,b){this.arg=b,Ext.Error.call(this,a)},name:"Ext.data.JsonReader"}),Ext.apply(Ext.data.JsonReader.Error.prototype,{lang:{response:"An error occurred while json-decoding your server response","successProperty-response":'Could not locate your "successProperty" in your server response.  Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response.  See the JsonReader docs.',"root-undefined-config":'Your JsonReader was configured without a "root" property.  Please review your JsonReader config and make sure to define the root property.  See the JsonReader docs.',"idProperty-undefined":'Your JsonReader was configured without an "idProperty"  Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id").  See the JsonReader docs.',"root-empty":'Data was expected to be returned by the server in the "root" property of the response.  Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response.  See JsonReader docs.'}}),Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(a){this.arrayData=a;var b=this.meta,c=b?Ext.num(b.idIndex,b.id):null,d=this.recordType,e=d.prototype.fields,f=[],g=!0,h,i=this.getRoot(a);for(var j=0,k=i.length;j<k;j++){var l=i[j],m={},n=(c||c===0)&&l[c]!==undefined&&l[c]!==""?l[c]:null;for(var o=0,p=e.length;o<p;o++){var q=e.items[o],r=q.mapping!==undefined&&q.mapping!==null?q.mapping:o;h=l[r]!==undefined?l[r]:q.defaultValue,h=q.convert(h,l),m[q.name]=h}var s=new d(m,n);s.json=l,f[f.length]=s}var t=f.length;b.totalProperty&&(h=parseInt(this.getTotal(a),10),isNaN(h)||(t=h));if(b.successProperty){h=this.getSuccess(a);if(h===!1||h==="false")g=!1}return{success:g,records:f,totalRecords:t}}}),Ext.data.ArrayStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.ArrayStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.ArrayReader(a)}))},loadData:function(a,b){if(this.expandData===!0){var c=[];for(var d=0,e=a.length;d<e;d++)c[c.length]=[a[d]];a=c}Ext.data.ArrayStore.superclass.loadData.call(this,a,b)}}),Ext.reg("arraystore",Ext.data.ArrayStore),Ext.data.SimpleStore=Ext.data.ArrayStore,Ext.reg("simplestore",Ext.data.SimpleStore),Ext.data.JsonStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.JsonReader(a)}))}}),Ext.reg("jsonstore",Ext.data.JsonStore),Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:!0,trackOver:!1,blockRefresh:!1,last:!1,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(Ext.isString(this.tpl)||Ext.isArray(this.tpl))this.tpl=new Ext.XTemplate(this.tpl);this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","containercontextmenu","selectionchange","beforeselect"),this.store=Ext.StoreMgr.lookup(this.store),this.all=new Ext.CompositeElementLite,this.selected=new Ext.CompositeElementLite},afterRender:function(){Ext.DataView.superclass.afterRender.call(this),this.mon(this.getTemplateTarget(),{click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu,scope:this}),(this.overClass||this.trackOver)&&this.mon(this.getTemplateTarget(),{mouseover:this.onMouseOver,mouseout:this.onMouseOut,scope:this}),this.store&&this.bindStore(this.store,!0)},refresh:function(){this.clearSelections(!1,!0);var a=this.getTemplateTarget();a.update("");var b=this.store.getRange();b.length<1?((!this.deferEmptyText||this.hasSkippedEmptyText)&&a.update(this.emptyText),this.all.clear()):(this.tpl.overwrite(a,this.collectData(b,0)),this.all.fill(Ext.query(this.itemSelector,a.dom)),this.updateIndexes(0)),this.hasSkippedEmptyText=!0},getTemplateTarget:function(){return this.el},prepareData:function(a){return a},collectData:function(a,b){var c=[];for(var d=0,e=a.length;d<e;d++)c[c.length]=this.prepareData(a[d].data,b+d,a[d]);return c},bufferRender:function(a){var b=document.createElement("div");return this.tpl.overwrite(b,this.collectData(a)),Ext.query(this.itemSelector,b)},onUpdate:function(a,b){var c=this.store.indexOf(b);if(c>-1){var d=this.isSelected(c),e=this.all.elements[c],f=this.bufferRender([b],c)[0];this.all.replaceElement(c,f,!0),d&&(this.selected.replaceElement(e,f),this.all.item(c).addClass(this.selectedClass)),this.updateIndexes(c,c)}},onAdd:function(a,b,c){if(this.all.getCount()===0){this.refresh();return}var d=this.bufferRender(b,c),e,f=this.all.elements;c<this.all.getCount()?(e=this.all.item(c).insertSibling(d,"before",!0),f.splice.apply(f,[c,0].concat(d))):(e=this.all.last().insertSibling(d,"after",!0),f.push.apply(f,d)),this.updateIndexes(c)},onRemove:function(a,b,c){this.deselect(c),this.all.removeElement(c,!0),this.updateIndexes(c),this.store.getCount()===0&&this.refresh()},refreshNode:function(a){this.onUpdate(this.store,this.store.getAt(a))},updateIndexes:function(a,b){var c=this.all.elements;a=a||0,b=b||(b===0?0:c.length-1);for(var d=a;d<=b;d++)c[d].viewIndex=d},getStore:function(){return this.store},bindStore:function(a,b){!b&&this.store&&(a!==this.store&&this.store.autoDestroy?this.store.destroy():(this.store.un("beforeload",this.onBeforeLoad,this),this.store.un("datachanged",this.onDataChanged,this),this.store.un("add",this.onAdd,this),this.store.un("remove",this.onRemove,this),this.store.un("update",this.onUpdate,this),this.store.un("clear",this.refresh,this)),a||(this.store=null)),a&&(a=Ext.StoreMgr.lookup(a),a.on({scope:this,beforeload:this.onBeforeLoad,datachanged:this.onDataChanged,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.refresh})),this.store=a,a&&this.refresh()},onDataChanged:function(){this.blockRefresh!==!0&&this.refresh.apply(this,arguments)},findItemFromChild:function(a){return Ext.fly(a).findParent(this.itemSelector,this.getTemplateTarget())},onClick:function(a){var b=a.getTarget(this.itemSelector,this.getTemplateTarget());if(b){var c=this.indexOf(b);this.onItemClick(b,c,a)!==!1&&this.fireEvent("click",this,c,b,a)}else this.fireEvent("containerclick",this,a)!==!1&&this.onContainerClick(a)},onContainerClick:function(a){this.clearSelections()},onContextMenu:function(a){var b=a.getTarget(this.itemSelector,this.getTemplateTarget());b?this.fireEvent("contextmenu",this,this.indexOf(b),b,a):this.fireEvent("containercontextmenu",this,a)},onDblClick:function(a){var b=a.getTarget(this.itemSelector,this.getTemplateTarget());b&&this.fireEvent("dblclick",this,this.indexOf(b),b,a)},onMouseOver:function(a){var b=a.getTarget(this.itemSelector,this.getTemplateTarget());b&&b!==this.lastItem&&(this.lastItem=b,Ext.fly(b).addClass(this.overClass),this.fireEvent("mouseenter",this,this.indexOf(b),b,a))},onMouseOut:function(a){this.lastItem&&(a.within(this.lastItem,!0,!0)||(Ext.fly(this.lastItem).removeClass(this.overClass),this.fireEvent("mouseleave",this,this.indexOf(this.lastItem),this.lastItem,a),delete this.lastItem))},onItemClick:function(a,b,c){return this.fireEvent("beforeclick",this,b,a,c)===!1?!1:(this.multiSelect?(this.doMultiSelection(a,b,c),c.preventDefault()):this.singleSelect&&(this.doSingleSelection(a,b,c),c.preventDefault()),!0)},doSingleSelection:function(a,b,c){c.ctrlKey&&this.isSelected(b)?this.deselect(b):this.select(b,!1)},doMultiSelection:function(a,b,c){if(c.shiftKey&&this.last!==!1){var d=this.last;this.selectRange(d,b,c.ctrlKey),this.last=d}else(c.ctrlKey||this.simpleSelect)&&this.isSelected(b)?this.deselect(b):this.select(b,c.ctrlKey||c.shiftKey||this.simpleSelect)},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){var a=[],b=this.selected.elements;for(var c=0,d=b.length;c<d;c++)a.push(b[c].viewIndex);return a},getSelectedRecords:function(){var a=[],b=this.selected.elements;for(var c=0,d=b.length;c<d;c++)a[a.length]=this.store.getAt(b[c].viewIndex);return a},getRecords:function(a){var b=[],c=a;for(var d=0,e=c.length;d<e;d++)b[b.length]=this.store.getAt(c[d].viewIndex);return b},getRecord:function(a){return this.store.getAt(a.viewIndex)},clearSelections:function(a,b){(this.multiSelect||this.singleSelect)&&this.selected.getCount()>0&&(b||this.selected.removeClass(this.selectedClass),this.selected.clear(),this.last=!1,a||this.fireEvent("selectionchange",this,this.selected.elements))},isSelected:function(a){return this.selected.contains(this.getNode(a))},deselect:function(a){this.isSelected(a)&&(a=this.getNode(a),this.selected.removeElement(a),this.last==a.viewIndex&&(this.last=!1),Ext.fly(a).removeClass(this.selectedClass),this.fireEvent("selectionchange",this,this.selected.elements))},select:function(a,b,c){if(Ext.isArray(a)){b||this.clearSelections(!0);for(var d=0,e=a.length;d<e;d++)this.select(a[d],!0,!0);c||this.fireEvent("selectionchange",this,this.selected.elements)}else{var f=this.getNode(a);b||this.clearSelections(!0),f&&!this.isSelected(f)&&this.fireEvent("beforeselect",this,f,this.selected.elements)!==!1&&(Ext.fly(f).addClass(this.selectedClass),this.selected.add(f),this.last=f.viewIndex,c||this.fireEvent("selectionchange",this,this.selected.elements))}},selectRange:function(a,b,c){c||this.clearSelections(!0),this.select(this.getNodes(a,b),!0)},getNode:function(a){if(Ext.isString(a))return document.getElementById(a);if(Ext.isNumber(a))return this.all.elements[a];if(a instanceof Ext.data.Record){var b=this.store.indexOf(a);return this.all.elements[b]}return a},getNodes:function(a,b){var c=this.all.elements;a=a||0,b=Ext.isDefined(b)?b:Math.max(c.length-1,0);var d=[],e;if(a<=b)for(e=a;e<=b&&c[e];e++)d.push(c[e]);else for(e=a;e>=b&&c[e];e--)d.push(c[e]);return d},indexOf:function(a){return a=this.getNode(a),Ext.isNumber(a.viewIndex)?a.viewIndex:this.all.indexOf(a)},onBeforeLoad:function(){this.loadingText&&(this.clearSelections(!1,!0),this.getTemplateTarget().update('<div class="loading-indicator">'+this.loadingText+"</div>"),this.all.clear())},onDestroy:function(){this.all.clear(),this.selected.clear(),Ext.DataView.superclass.onDestroy.call(this),this.bindStore(null)}}),Ext.DataView.prototype.setStore=Ext.DataView.prototype.bindStore,Ext.reg("dataview",Ext.DataView),Ext.list.ListView=Ext.extend(Ext.DataView,{itemSelector:"dl",selectedClass:"x-list-selected",overClass:"x-list-over",scrollOffset:undefined,columnResize:!0,columnSort:!0,maxWidth:Ext.isIE?99:100,initComponent:function(){this.columnResize&&(this.colResizer=new Ext.list.ColumnResizer(this.colResizer),this.colResizer.init(this)),this.columnSort&&(this.colSorter=new Ext.list.Sorter(this.columnSort),this.colSorter.init(this)),this.internalTpl||(this.internalTpl=new Ext.XTemplate('<div class="x-list-header"><div class="x-list-header-inner">','<tpl for="columns">','<div style="width:{[values.width*100]}%;text-align:{align};"><em unselectable="on" id="',this.id,'-xlhd-{#}">',"{header}","</em></div>","</tpl>",'<div class="x-clear"></div>',"</div></div>",'<div class="x-list-body"><div class="x-list-body-inner">',"</div></div>")),this.tpl||(this.tpl=new Ext.XTemplate('<tpl for="rows">',"<dl>",'<tpl for="parent.columns">','<dt style="width:{[values.width*100]}%;text-align:{align};">','<em unselectable="on"<tpl if="cls"> class="{cls}</tpl>">',"{[values.tpl.apply(parent)]}","</em></dt>","</tpl>",'<div class="x-clear"></div>',"</dl>","</tpl>"));var a=this.columns,b=0,c=0,d=a.length,e=[];for(var f=0;f<d;f++){var g=a[f];g.isColumn||(g.xtype=g.xtype?/^lv/.test(g.xtype)?g.xtype:"lv"+g.xtype:"lvcolumn",g=Ext.create(g)),g.width&&(b+=g.width*100,c++),e.push(g)}a=this.columns=e;if(c<d){var h=d-c;if(b<this.maxWidth){var i=(this.maxWidth-b)/h/100;for(var j=0;j<d;j++){var g=a[j];g.width||(g.width=i)}}}Ext.list.ListView.superclass.initComponent.call(this)},onRender:function(){this.autoEl={cls:"x-list-wrap"},Ext.list.ListView.superclass.onRender.apply(this,arguments),this.internalTpl.overwrite(this.el,{columns:this.columns}),this.innerBody=Ext.get(this.el.dom.childNodes[1].firstChild),this.innerHd=Ext.get(this.el.dom.firstChild.firstChild),this.hideHeaders&&(this.el.dom.firstChild.style.display="none")},getTemplateTarget:function(){return this.innerBody},collectData:function(){var a=Ext.list.ListView.superclass.collectData.apply(this,arguments);return{columns:this.columns,rows:a}},verifyInternalSize:function(){this.lastSize&&this.onResize(this.lastSize.width,this.lastSize.height)},onResize:function(a,b){var c=this.innerBody.dom,d=this.innerHd.dom;if(!c)return;var e=c.parentNode;if(Ext.isNumber(a)){var f=a-Ext.num(this.scrollOffset,Ext.getScrollBarWidth());this.reserveScrollOffset||e.offsetWidth-e.clientWidth>10?(c.style.width=f+"px",d.style.width=f+"px"):(c.style.width=a+"px",d.style.width=a+"px",setTimeout(function(){e.offsetWidth-e.clientWidth>10&&(c.style.width=f+"px",d.style.width=f+"px")},10))}Ext.isNumber(b)&&(e.style.height=b-d.parentNode.offsetHeight+"px")},updateIndexes:function(){Ext.list.ListView.superclass.updateIndexes.apply(this,arguments),this.verifyInternalSize()},findHeaderIndex:function(a){a=a.dom||a;var b=a.parentNode,c=b.parentNode.childNodes;for(var d=0,e;e=c[d];d++)if(e==b)return d;return-1},setHdWidths:function(){var a=this.innerHd.dom.getElementsByTagName("div");for(var b=0,c=this.columns,d=c.length;b<d;b++)a[b].style.width=c[b].width*100+"%"}}),Ext.reg("listview",Ext.list.ListView),Ext.ListView=Ext.list.ListView,Ext.list.Column=Ext.extend(Object,{isColumn:!0,align:"left",header:"",width:null,cls:"",constructor:function(a){a.tpl?Ext.isString(a.tpl)&&(a.tpl=new Ext.XTemplate(a.tpl)):a.tpl=new Ext.XTemplate("{"+a.dataIndex+"}"),Ext.apply(this,a)}}),Ext.reg("lvcolumn",Ext.list.Column),Ext.list.NumberColumn=Ext.extend(Ext.list.Column,{format:"0,000.00",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':number("'+(a.format||this.format)+'")}'),Ext.list.NumberColumn.superclass.constructor.call(this,a)}}),Ext.reg("lvnumbercolumn",Ext.list.NumberColumn),Ext.list.DateColumn=Ext.extend(Ext.list.Column,{format:"m/d/Y",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':date("'+(a.format||this.format)+'")}'),Ext.list.DateColumn.superclass.constructor.call(this,a)}}),Ext.reg("lvdatecolumn",Ext.list.DateColumn),Ext.list.BooleanColumn=Ext.extend(Ext.list.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+":this.format}");var b=this.trueText,c=this.falseText,d=this.undefinedText;a.tpl.format=function(a){return a===undefined?d:!a||a==="false"?c:b},Ext.list.DateColumn.superclass.constructor.call(this,a)}}),Ext.reg("lvbooleancolumn",Ext.list.BooleanColumn),Ext.list.ColumnResizer=Ext.extend(Ext.util.Observable,{minPct:.05,constructor:function(a){Ext.apply(this,a),Ext.list.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.view=a,a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this),this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),tolerance:3,autoStart:300}),this.tracker.initEl(a.innerHd),a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(a,b){var c=5,d=a.getPageX(),e=a.getTarget("em",3,!0);if(e){var f=e.getRegion(),g=e.dom.style,h=e.dom.parentNode;d-f.left<=c&&h!=h.parentNode.firstChild?(this.activeHd=Ext.get(h.previousSibling.firstChild),g.cursor=Ext.isWebKit?"e-resize":"col-resize"):f.right-d<=c&&h!=h.parentNode.lastChild.previousSibling?(this.activeHd=e,g.cursor=Ext.isWebKit?"w-resize":"col-resize"):(delete this.activeHd,g.cursor="")}},onBeforeStart:function(a){return this.dragHd=this.activeHd,!!this.dragHd},onStart:function(a){this.view.disableHeaders=!0,this.proxy=this.view.el.createChild({cls:"x-list-resizer"}),this.proxy.setHeight(this.view.el.getHeight());var b=this.tracker.getXY()[0],c=this.view.innerHd.getWidth();this.hdX=this.dragHd.getX(),this.hdIndex=this.view.findHeaderIndex(this.dragHd),this.proxy.setX(this.hdX),this.proxy.setWidth(b-this.hdX),this.minWidth=c*this.minPct,this.maxWidth=c-this.minWidth*(this.view.columns.length-1-this.hdIndex)},onDrag:function(a){var b=this.tracker.getXY()[0];this.proxy.setWidth((b-this.hdX).constrain(this.minWidth,this.maxWidth))},onEnd:function(a){var b=this.proxy.getWidth();this.proxy.remove();var c=this.hdIndex,d=this.view,e=d.columns,f=e.length,g=this.view.innerHd.getWidth(),h=this.minPct*100,i=Math.ceil(b*d.maxWidth/g),j=e[c].width*100-i,k=Math.floor(j/(f-1-c)),l=j-k*(f-1-c);for(var m=c+1;m<f;m++){var n=e[m].width*100+k,o=Math.max(h,n);n!=o&&(l+=n-o),e[m].width=o/100}e[c].width=i/100,e[c+1].width+=l/100,delete this.dragHd,d.setHdWidths(),d.refresh(),setTimeout(function(){d.disableHeaders=!1},100)}}),Ext.ListView.ColumnResizer=Ext.list.ColumnResizer,Ext.list.Sorter=Ext.extend(Ext.util.Observable,{sortClasses:["sort-asc","sort-desc"],constructor:function(a){Ext.apply(this,a),Ext.list.Sorter.superclass.constructor.call(this)},init:function(a){this.view=a,a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"click",this.onHdClick,this),a.innerHd.setStyle("cursor","pointer"),a.mon(a.store,"datachanged",this.updateSortState,this),this.updateSortState.defer(10,this,[a.store])},updateSortState:function(a){var b=a.getSortState();if(!b)return;this.sortState=b;var c=this.view.columns,d=-1;for(var e=0,f=c.length;e<f;e++)if(c[e].dataIndex==b.field){d=e;break}if(d!=-1){var g=b.direction;this.updateSortIcon(d,g)}},updateSortIcon:function(a,b){var c=this.sortClasses,d=this.view.innerHd.select("em").removeClass(c);d.item(a).addClass(c[b=="DESC"?1:0])},onHdClick:function(a){var b=a.getTarget("em",3);if(b&&!this.view.disableHeaders){var c=this.view.findHeaderIndex(b);this.view.store.sort(this.view.columns[c].dataIndex)}}}),Ext.ListView.Sorter=Ext.list.Sorter,function(){var a=Ext.EventManager,b=Ext.lib.Dom;Ext.dd.DragDrop=function(a,b,c){a&&this.init(a,b,c)},Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:!1,lock:function(){this.locked=!0},moveOnly:!1,unlock:function(){this.locked=!1},isTarget:!0,padding:null,_domRef:null,__ygDragDrop:!0,constrainX:!1,constrainY:!1,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:!1,xTicks:null,yTicks:null,primaryButtonOnly:!0,available:!1,hasOuterHandles:!1,b4StartDrag:function(a,b){},startDrag:function(a,b){},b4Drag:function(a){},onDrag:function(a){},onDragEnter:function(a,b){},b4DragOver:function(a){},onDragOver:function(a,b){},b4DragOut:function(a){},onDragOut:function(a,b){},b4DragDrop:function(a){},onDragDrop:function(a,b){},onInvalidDrop:function(a){},b4EndDrag:function(a){},endDrag:function(a){},b4MouseDown:function(a){},onMouseDown:function(a){},onMouseUp:function(a){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(a,b,c){Ext.isNumber(b)&&(b={left:b,right:b,top:b,bottom:b}),b=b||this.defaultPadding;var d=Ext.get(this.getEl()).getBox(),e=Ext.get(a),f=e.getScroll(),g,h=e.dom;if(h==document.body)g={x:f.left,y:f.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()};else{var i=e.getXY();g={x:i[0],y:i[1],width:h.clientWidth,height:h.clientHeight}}var j=d.y-g.y,k=d.x-g.x;this.resetConstraints(),this.setXConstraint(k-(b.left||0),g.width-k-d.width-(b.right||0),this.xTickSize),this.setYConstraint(j-(b.top||0),g.height-j-d.height-(b.bottom||0),this.yTickSize)},getEl:function(){return this._domRef||(this._domRef=Ext.getDom(this.id)),this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(b,c,d){this.initTarget(b,c,d),a.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(a,b,c){this.config=c||{},this.DDM=Ext.dd.DDM,this.groups={},typeof a!="string"&&(a=Ext.id(a)),this.id=a,this.addToGroup(b?b:"default"),this.handleElId=a,this.setDragElId(a),this.invalidHandleTypes={A:"A"},this.invalidHandleIds={},this.invalidHandleClasses=[],this.applyConfig(),this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0],this.isTarget=this.config.isTarget!==!1,this.maintainOffset=this.config.maintainOffset,this.primaryButtonOnly=this.config.primaryButtonOnly!==!1},handleOnAvailable:function(){this.available=!0,this.resetConstraints(),this.onAvailable()},setPadding:function(a,b,c,d){!b&&0!==b?this.padding=[a,a,a,a]:!c&&0!==c?this.padding=[a,b,a,b]:this.padding=[a,b,c,d]},setInitPosition:function(a,c){var d=this.getEl();if(!this.DDM.verifyEl(d))return;var e=a||0,f=c||0,g=b.getXY(d);this.initPageX=g[0]-e,this.initPageY=g[1]-f,this.lastPageX=g[0],this.lastPageY=g[1],this.setStartPosition(g)},setStartPosition:function(a){var c=a||b.getXY(this.getEl());this.deltaSetXY=null,this.startPageX=c[0],this.startPageY=c[1]},addToGroup:function(a){this.groups[a]=!0,this.DDM.regDragDrop(this,a)},removeFromGroup:function(a){this.groups[a]&&delete this.groups[a],this.DDM.removeDDFromGroup(this,a)},setDragElId:function(a){this.dragElId=a},setHandleElId:function(a){typeof a!="string"&&(a=Ext.id(a)),this.handleElId=a,this.DDM.regHandle(this.id,a)},setOuterHandleElId:function(b){typeof b!="string"&&(b=Ext.id(b)),a.on(b,"mousedown",this.handleMouseDown,this),this.setHandleElId(b),this.hasOuterHandles=!0},unreg:function(){a.un(this.id,"mousedown",this.handleMouseDown),this._domRef=null,this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return this.DDM.isLocked()||this.locked},handleMouseDown:function(a,b){if(this.primaryButtonOnly&&a.button!=0)return;if(this.isLocked())return;this.DDM.refreshCache(this.groups);var c=new Ext.lib.Point(Ext.lib.Event.getPageX(a),Ext.lib.Event.getPageY(a));(!!this.hasOuterHandles||!!this.DDM.isOverTarget(c,this))&&this.clickValidator(a)&&(this.setStartPosition(),this.b4MouseDown(a),this.onMouseDown(a),this.DDM.handleMouseDown(a,this),this.DDM.stopEvent(a))},clickValidator:function(a){var b=a.getTarget();return this.isValidHandleChild(b)&&(this.id==this.handleElId||this.DDM.handleWasClicked(b,this.id))},addInvalidHandleType:function(a){var b=a.toUpperCase();this.invalidHandleTypes[b]=b},addInvalidHandleId:function(a){typeof a!="string"&&(a=Ext.id(a)),this.invalidHandleIds[a]=a},addInvalidHandleClass:function(a){this.invalidHandleClasses.push(a)},removeInvalidHandleType:function(a){var b=a.toUpperCase();delete this.invalidHandleTypes[b]},removeInvalidHandleId:function(a){typeof a!="string"&&(a=Ext.id(a)),delete this.invalidHandleIds[a]},removeInvalidHandleClass:function(a){for(var b=0,c=this.invalidHandleClasses.length;b<c;++b)this.invalidHandleClasses[b]==a&&delete this.invalidHandleClasses[b]},isValidHandleChild:function(a){var b=!0,c;try{c=a.nodeName.toUpperCase()}catch(d){c=a.nodeName}b=b&&!this.invalidHandleTypes[c],b=b&&!this.invalidHandleIds[a.id];for(var e=0,f=this.invalidHandleClasses.length;b&&e<f;++e)b=!Ext.fly(a).hasClass(this.invalidHandleClasses[e]);return b},setXTicks:function(a,b){this.xTicks=[],this.xTickSize=b;var c={};for(var d=this.initPageX;d>=this.minX;d=d-b)c[d]||(this.xTicks[this.xTicks.length]=d,c[d]=!0);for(d=this.initPageX;d<=this.maxX;d=d+b)c[d]||(this.xTicks[this.xTicks.length]=d,c[d]=!0);this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(a,b){this.yTicks=[],this.yTickSize=b;var c={};for(var d=this.initPageY;d>=this.minY;d=d-b)c[d]||(this.yTicks[this.yTicks.length]=d,c[d]=!0);for(d=this.initPageY;d<=this.maxY;d=d+b)c[d]||(this.yTicks[this.yTicks.length]=d,c[d]=!0);this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(a,b,c){this.leftConstraint=a,this.rightConstraint=b,this.minX=this.initPageX-a,this.maxX=this.initPageX+b,c&&this.setXTicks(this.initPageX,c),this.constrainX=!0},clearConstraints:function(){this.constrainX=!1,this.constrainY=!1,this.clearTicks()},clearTicks:function(){this.xTicks=null,this.yTicks=null,this.xTickSize=0,this.yTickSize=0},setYConstraint:function(a,b,c){this.topConstraint=a,this.bottomConstraint=b,this.minY=this.initPageY-a,this.maxY=this.initPageY+b,c&&this.setYTicks(this.initPageY,c),this.constrainY=!0},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var a=this.maintainOffset?this.lastPageX-this.initPageX:0,b=this.maintainOffset?this.lastPageY-this.initPageY:0;this.setInitPosition(a,b)}else this.setInitPosition();this.constrainX&&this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize),this.constrainY&&this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)},getTick:function(a,b){if(!b)return a;if(b[0]>=a)return b[0];for(var c=0,d=b.length;c<d;++c){var e=c+1;if(b[e]&&b[e]>=a){var f=a-b[c],g=b[e]-a;return g>f?b[c]:b[e]}}return b[b.length-1]},toString:function(){return"DragDrop "+this.id}}}(),Ext.dd.DragDropMgr||(Ext.dd.DragDropMgr=function(){var a=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:!0,stopPropagation:!0,initialized:!1,locked:!1,init:function(){this.initialized=!0},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(a,b){for(var c in this.ids)for(var d in this.ids[c]){var e=this.ids[c][d];if(!this.isTypeOfDD(e))continue;e[a].apply(e,b)}},_onLoad:function(){this.init(),a.on(document,"mouseup",this.handleMouseUp,this,!0),a.on(document,"mousemove",this.handleMouseMove,this,!0),a.on(window,"unload",this._onUnload,this,!0),a.on(window,"resize",this._onResize,this,!0)},_onResize:function(a){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=!0},unlock:function(){this.locked=!1},isLocked:function(){return this.locked},locationCache:{},useCache:!0,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:!1,clickTimeout:null,startX:0,startY:0,regDragDrop:function(a,b){this.initialized||this.init(),this.ids[b]||(this.ids[b]={}),this.ids[b][a.id]=a},removeDDFromGroup:function(a,b){this.ids[b]||(this.ids[b]={});var c=this.ids[b];c&&c[a.id]&&delete c[a.id]},_remove:function(a){for(var b in a.groups)b&&this.ids[b]&&this.ids[b][a.id]&&delete this.ids[b][a.id];delete this.handleIds[a.id]},regHandle:function(a,b){this.handleIds[a]||(this.handleIds[a]={}),this.handleIds[a][b]=b},isDragDrop:function(a){return this.getDDById(a)?!0:!1},getRelated:function(a,b){var c=[];for(var d in a.groups)for(var e in this.ids[d]){var f=this.ids[d][e];if(!this.isTypeOfDD(f))continue;if(!b||f.isTarget)c[c.length]=f}return c},isLegalTarget:function(a,b){var c=this.getRelated(a,!0);for(var d=0,e=c.length;d<e;++d)if(c[d].id==b.id)return!0;return!1},isTypeOfDD:function(a){return a&&a.__ygDragDrop},isHandle:function(a,b){return this.handleIds[a]&&this.handleIds[a][b]},getDDById:function(a){for(var b in this.ids)if(this.ids[b][a])return this.ids[b][a];return null},handleMouseDown:function(a,b){Ext.QuickTips&&Ext.QuickTips.disable(),this.dragCurrent&&this.handleMouseUp(a),this.currentTarget=a.getTarget(),this.dragCurrent=b;var c=b.getEl();this.startX=a.getPageX(),this.startY=a.getPageY(),this.deltaX=this.startX-c.offsetLeft,this.deltaY=this.startY-c.offsetTop,this.dragThreshMet=!1,this.clickTimeout=setTimeout(function(){var a=Ext.dd.DDM;a.startDrag(a.startX,a.startY)},this.clickTimeThresh)},startDrag:function(a,b){clearTimeout(this.clickTimeout),this.dragCurrent&&(this.dragCurrent.b4StartDrag(a,b),this.dragCurrent.startDrag(a,b)),this.dragThreshMet=!0},handleMouseUp:function(a){Ext.QuickTips&&Ext.QuickTips.enable();if(!this.dragCurrent)return;clearTimeout(this.clickTimeout),this.dragThreshMet&&this.fireEvents(a,!0),this.stopDrag(a),this.stopEvent(a)},stopEvent:function(a){this.stopPropagation&&a.stopPropagation(),this.preventDefault&&a.preventDefault()},stopDrag:function(a){this.dragCurrent&&(this.dragThreshMet&&(this.dragCurrent.b4EndDrag(a),this.dragCurrent.endDrag(a)),this.dragCurrent.onMouseUp(a)),this.dragCurrent=null,this.dragOvers={}},handleMouseMove:function(a){if(!this.dragCurrent)return!0;if(Ext.isIE&&a.button!==0&&a.button!==1&&a.button!==2)return this.stopEvent(a),this.handleMouseUp(a);if(!this.dragThreshMet){var b=Math.abs(this.startX-a.getPageX()),c=Math.abs(this.startY-a.getPageY());(b>this.clickPixelThresh||c>this.clickPixelThresh)&&this.startDrag(this.startX,this.startY)}return this.dragThreshMet&&(this.dragCurrent.b4Drag(a),this.dragCurrent.onDrag(a),this.dragCurrent.moveOnly||this.fireEvents(a,!1)),this.stopEvent(a),!0},fireEvents:function(a,b){var c=this.dragCurrent;if(!c||c.isLocked())return;var d=a.getPoint(),e=[],f=[],g=[],h=[],i=[];for(var j in this.dragOvers){var k=this.dragOvers[j];if(!this.isTypeOfDD(k))continue;this.isOverTarget(d,k,this.mode)||f.push(k),e[j]=!0,delete this.dragOvers[j]}for(var l in c.groups){if("string"!=typeof l)continue;for(j in this.ids[l]){var m=this.ids[l][j];if(!this.isTypeOfDD(m))continue;m.isTarget&&!m.isLocked()&&(m!=c||c.ignoreSelf===!1)&&this.isOverTarget(d,m,this.mode)&&(b?h.push(m):(e[m.id]?g.push(m):i.push(m),this.dragOvers[m.id]=m))}}if(this.mode)f.length&&(c.b4DragOut(a,f),c.onDragOut(a,f)),i.length&&c.onDragEnter(a,i),g.length&&(c.b4DragOver(a,g),c.onDragOver(a,g)),h.length&&(c.b4DragDrop(a,h),c.onDragDrop(a,h));else{var n=0;for(j=0,n=f.length;j<n;++j)c.b4DragOut(a,f[j].id),c.onDragOut(a,f[j].id);for(j=0,n=i.length;j<n;++j)c.onDragEnter(a,i[j].id);for(j=0,n=g.length;j<n;++j)c.b4DragOver(a,g[j].id),c.onDragOver(a,g[j].id);for(j=0,n=h.length;j<n;++j)c.b4DragDrop(a,h[j].id),c.onDragDrop(a,h[j].id)}b&&!h.length&&c.onInvalidDrop(a)},getBestMatch:function(a){var b=null,c=a.length;if(c==1)b=a[0];else for(var d=0;d<c;++d){var e=a[d];if(e.cursorIsOver){b=e;break}if(!b||b.overlap.getArea()<e.overlap.getArea())b=e}return b},refreshCache:function(a){for(var b in a){if("string"!=typeof b)continue;for(var c in this.ids[b]){var d=this.ids[b][c];if(this.isTypeOfDD(d)){var e=this.getLocation(d);e?this.locationCache[d.id]=e:delete this.locationCache[d.id]}}}},verifyEl:function(a){if(a){var b;if(Ext.isIE)try{b=a.offsetParent}catch(c){}else b=a.offsetParent;if(b)return!0}return!1},getLocation:function(
a){if(!this.isTypeOfDD(a))return null;var b=a.getEl(),c,d,e,f,g,h,i,j,k;try{c=Ext.lib.Dom.getXY(b)}catch(l){}return c?(d=c[0],e=d+b.offsetWidth,f=c[1],g=f+b.offsetHeight,h=f-a.padding[0],i=e+a.padding[1],j=g+a.padding[2],k=d-a.padding[3],new Ext.lib.Region(h,i,j,k)):null},isOverTarget:function(a,b,c){var d=this.locationCache[b.id];if(!d||!this.useCache)d=this.getLocation(b),this.locationCache[b.id]=d;if(!d)return!1;b.cursorIsOver=d.contains(a);var e=this.dragCurrent;if(!e||!e.getTargetCoord||!c&&!e.constrainX&&!e.constrainY)return b.cursorIsOver;b.overlap=null;var f=e.getTargetCoord(a.x,a.y),g=e.getDragEl(),h=new Ext.lib.Region(f.y,f.x+g.offsetWidth,f.y+g.offsetHeight,f.x),i=h.intersect(d);return i?(b.overlap=i,c?!0:b.cursorIsOver):!1},_onUnload:function(a,b){Ext.dd.DragDropMgr.unregAll()},unregAll:function(){this.dragCurrent&&(this.stopDrag(),this.dragCurrent=null),this._execOnAll("unreg",[]);for(var a in this.elementCache)delete this.elementCache[a];this.elementCache={},this.ids={}},elementCache:{},getElWrapper:function(a){var b=this.elementCache[a];if(!b||!b.el)b=this.elementCache[a]=new this.ElementWrapper(Ext.getDom(a));return b},getElement:function(a){return Ext.getDom(a)},getCss:function(a){var b=Ext.getDom(a);return b?b.style:null},ElementWrapper:function(a){this.el=a||null,this.id=this.el&&a.id,this.css=this.el&&a.style},getPosX:function(a){return Ext.lib.Dom.getX(a)},getPosY:function(a){return Ext.lib.Dom.getY(a)},swapNode:function(a,b){if(a.swapNode)a.swapNode(b);else{var c=b.parentNode,d=b.nextSibling;d==a?c.insertBefore(a,b):b==a.nextSibling?c.insertBefore(b,a):(a.parentNode.replaceChild(b,a),c.insertBefore(a,d))}},getScroll:function(){var a,b,c=document.documentElement,d=document.body;return c&&(c.scrollTop||c.scrollLeft)?(a=c.scrollTop,b=c.scrollLeft):d&&(a=d.scrollTop,b=d.scrollLeft),{top:a,left:b}},getStyle:function(a,b){return Ext.fly(a).getStyle(b)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(a,b){var c=Ext.lib.Dom.getXY(b);Ext.lib.Dom.setXY(a,c)},numericSort:function(a,b){return a-b},_timeoutCount:0,_addListeners:function(){var a=Ext.dd.DDM;Ext.lib.Event&&document?a._onLoad():a._timeoutCount>2e3||(setTimeout(a._addListeners,10),document&&document.body&&(a._timeoutCount+=1))},handleWasClicked:function(a,b){if(this.isHandle(b,a.id))return!0;var c=a.parentNode;while(c){if(this.isHandle(b,c.id))return!0;c=c.parentNode}return!1}}}(),Ext.dd.DDM=Ext.dd.DragDropMgr,Ext.dd.DDM._addListeners()),Ext.dd.DD=function(a,b,c){a&&this.init(a,b,c)},Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:!0,autoOffset:function(a,b){var c=a-this.startPageX,d=b-this.startPageY;this.setDelta(c,d)},setDelta:function(a,b){this.deltaX=a,this.deltaY=b},setDragElPos:function(a,b){var c=this.getDragEl();this.alignElWithMouse(c,a,b)},alignElWithMouse:function(a,b,c){var d=this.getTargetCoord(b,c),e=a.dom?a:Ext.fly(a,"_dd");if(!this.deltaSetXY){var f=[d.x,d.y];e.setXY(f);var g=e.getLeft(!0),h=e.getTop(!0);this.deltaSetXY=[g-d.x,h-d.y]}else e.setLeftTop(d.x+this.deltaSetXY[0],d.y+this.deltaSetXY[1]);return this.cachePosition(d.x,d.y),this.autoScroll(d.x,d.y,a.offsetHeight,a.offsetWidth),d},cachePosition:function(a,b){if(a)this.lastPageX=a,this.lastPageY=b;else{var c=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=c[0],this.lastPageY=c[1]}},autoScroll:function(a,b,c,d){if(this.scroll){var e=Ext.lib.Dom.getViewHeight(),f=Ext.lib.Dom.getViewWidth(),g=this.DDM.getScrollTop(),h=this.DDM.getScrollLeft(),i=c+b,j=d+a,k=e+g-b-this.deltaY,l=f+h-a-this.deltaX,m=40,n=document.all?80:30;i>e&&k<m&&window.scrollTo(h,g+n),b<g&&g>0&&b-g<m&&window.scrollTo(h,g-n),j>f&&l<m&&window.scrollTo(h+n,g),a<h&&h>0&&a-h<m&&window.scrollTo(h-n,g)}},getTargetCoord:function(a,b){var c=a-this.deltaX,d=b-this.deltaY;return this.constrainX&&(c<this.minX&&(c=this.minX),c>this.maxX&&(c=this.maxX)),this.constrainY&&(d<this.minY&&(d=this.minY),d>this.maxY&&(d=this.maxY)),c=this.getTick(c,this.xTicks),d=this.getTick(d,this.yTicks),{x:c,y:d}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this),this.scroll=this.config.scroll!==!1},b4MouseDown:function(a){this.autoOffset(a.getPageX(),a.getPageY())},b4Drag:function(a){this.setDragElPos(a.getPageX(),a.getPageY())},toString:function(){return"DD "+this.id}}),Ext.dd.DDProxy=function(a,b,c){a&&(this.init(a,b,c),this.initFrame())},Ext.dd.DDProxy.dragElId="ygddfdiv",Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:!0,centerFrame:!1,createFrame:function(){var a=this,b=document.body;if(!b||!b.firstChild){setTimeout(function(){a.createFrame()},50);return}var c=this.getDragEl();if(!c){c=document.createElement("div"),c.id=this.dragElId;var d=c.style;d.position="absolute",d.visibility="hidden",d.cursor="move",d.border="2px solid #aaa",d.zIndex=999,b.insertBefore(c,b.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this),this.resizeFrame=this.config.resizeFrame!==!1,this.centerFrame=this.config.centerFrame,this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(a,b){var c=this.getEl(),d=this.getDragEl(),e=d.style;this._resizeProxy(),this.centerFrame&&this.setDelta(Math.round(parseInt(e.width,10)/2),Math.round(parseInt(e.height,10)/2)),this.setDragElPos(a,b),Ext.fly(d).show()},_resizeProxy:function(){if(this.resizeFrame){var a=this.getEl();Ext.fly(this.getDragEl()).setSize(a.offsetWidth,a.offsetHeight)}},b4MouseDown:function(a){var b=a.getPageX(),c=a.getPageY();this.autoOffset(b,c),this.setDragElPos(b,c)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(a){Ext.fly(this.getDragEl()).hide()},endDrag:function(a){var b=this.getEl(),c=this.getDragEl();c.style.visibility="",this.beforeMove(),b.style.visibility="hidden",Ext.dd.DDM.moveToEl(b,c),c.style.visibility="hidden",b.style.visibility="",this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return"DDProxy "+this.id}}),Ext.dd.DDTarget=function(a,b,c){a&&this.initTarget(a,b,c)},Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return"DDTarget "+this.id}}),Ext.dd.DragTracker=Ext.extend(Ext.util.Observable,{active:!1,tolerance:5,autoStart:!1,constructor:function(a){Ext.apply(this,a),this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag"),this.dragRegion=new Ext.lib.Region(0,0,0,0),this.el&&this.initEl(this.el),Ext.dd.DragTracker.superclass.constructor.call(this,a)},initEl:function(a){this.el=Ext.get(a),a.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this)},onMouseDown:function(a,b){if(this.fireEvent("mousedown",this,a)!==!1&&this.onBeforeStart(a)!==!1){this.startXY=this.lastXY=a.getXY(),this.dragTarget=this.delegate?b:this.el.dom,this.preventDefault!==!1&&a.preventDefault();var c=Ext.getDoc();c.on("mouseup",this.onMouseUp,this),c.on("mousemove",this.onMouseMove,this),c.on("selectstart",this.stopSelect,this),this.autoStart&&(this.timer=this.triggerStart.defer(this.autoStart===!0?1e3:this.autoStart,this))}},onMouseMove:function(a,b){if(this.active&&Ext.isIE&&!a.browserEvent.button){a.preventDefault(),this.onMouseUp(a);return}a.preventDefault();var c=a.getXY(),d=this.startXY;this.lastXY=c;if(!this.active)if(Math.abs(d[0]-c[0])>this.tolerance||Math.abs(d[1]-c[1])>this.tolerance)this.triggerStart();else return;this.fireEvent("mousemove",this,a),this.onDrag(a),this.fireEvent("drag",this,a)},onMouseUp:function(a){var b=Ext.getDoc();b.un("mousemove",this.onMouseMove,this),b.un("mouseup",this.onMouseUp,this),b.un("selectstart",this.stopSelect,this),a.preventDefault(),this.clearStart();var c=this.active;this.active=!1,delete this.elRegion,this.fireEvent("mouseup",this,a),c&&(this.onEnd(a),this.fireEvent("dragend",this,a))},triggerStart:function(a){this.clearStart(),this.active=!0,this.onStart(this.startXY),this.fireEvent("dragstart",this,this.startXY)},clearStart:function(){this.timer&&(clearTimeout(this.timer),delete this.timer)},stopSelect:function(a){return a.stopEvent(),!1},onBeforeStart:function(a){},onStart:function(a){},onDrag:function(a){},onEnd:function(a){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(a){return a?this.constrainModes[a].call(this,this.lastXY):this.lastXY},getOffset:function(a){var b=this.getXY(a),c=this.startXY;return[c[0]-b[0],c[1]-b[1]]},constrainModes:{point:function(a){this.elRegion||(this.elRegion=this.getDragCt().getRegion());var b=this.dragRegion;return b.left=a[0],b.top=a[1],b.right=a[0],b.bottom=a[1],b.constrainTo(this.elRegion),[b.left,b.top]}}}),Ext.dd.ScrollManager=function(){var a=Ext.dd.DragDropMgr,b={},c=null,d={},e=function(a){c=null,h()},f=function(){a.dragCurrent&&a.refreshCache(a.dragCurrent.groups)},g=function(){if(a.dragCurrent){var b=Ext.dd.ScrollManager,c=d.el.ddScrollConfig?d.el.ddScrollConfig.increment:b.increment;b.animate?d.el.scroll(d.dir,c,!0,b.animDuration,f):d.el.scroll(d.dir,c)&&f()}},h=function(){d.id&&clearInterval(d.id),d.id=0,d.el=null,d.dir=""},i=function(a,b){h(),d.el=a,d.dir=b;var c=a.ddScrollConfig&&a.ddScrollConfig.frequency?a.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;d.id=setInterval(g,c)},j=function(e,f){if(f||!a.dragCurrent)return;var g=Ext.dd.ScrollManager;if(!c||c!=a.dragCurrent)c=a.dragCurrent,g.refreshCache();var j=Ext.lib.Event.getXY(e),k=new Ext.lib.Point(j[0],j[1]);for(var l in b){var m=b[l],n=m._region,o=m.ddScrollConfig?m.ddScrollConfig:g;if(n&&n.contains(k)&&m.isScrollable()){if(n.bottom-k.y<=o.vthresh){d.el!=m&&i(m,"down");return}if(n.right-k.x<=o.hthresh){d.el!=m&&i(m,"left");return}if(k.y-n.top<=o.vthresh){d.el!=m&&i(m,"up");return}if(k.x-n.left<=o.hthresh){d.el!=m&&i(m,"right");return}}}h()};return a.fireEvents=a.fireEvents.createSequence(j,a),a.stopDrag=a.stopDrag.createSequence(e,a),{register:function(a){if(Ext.isArray(a))for(var c=0,d=a.length;c<d;c++)this.register(a[c]);else a=Ext.get(a),b[a.id]=a},unregister:function(a){if(Ext.isArray(a))for(var c=0,d=a.length;c<d;c++)this.unregister(a[c]);else a=Ext.get(a),delete b[a.id]},vthresh:25,hthresh:25,increment:100,frequency:500,animate:!0,animDuration:.4,refreshCache:function(){for(var a in b)typeof b[a]=="object"&&(b[a]._region=b[a].getRegion())}}}(),Ext.dd.Registry=function(){var a={},b={},c=0,d=function(a,b){if(typeof a=="string")return a;var d=a.id;return!d&&b!==!1&&(d="extdd-"+ ++c,a.id=d),d};return{register:function(c,e){e=e||{},typeof c=="string"&&(c=document.getElementById(c)),e.ddel=c,a[d(c)]=e,e.isHandle!==!1&&(b[e.ddel.id]=e);if(e.handles){var f=e.handles;for(var g=0,h=f.length;g<h;g++)b[d(f[g])]=e}},unregister:function(c){var e=d(c,!1),f=a[e];if(f){delete a[e];if(f.handles){var g=f.handles;for(var h=0,i=g.length;h<i;h++)delete b[d(g[h],!1)]}}},getHandle:function(a){return typeof a!="string"&&(a=a.id),b[a]},getHandleFromEvent:function(a){var c=Ext.lib.Event.getTarget(a);return c?b[c.id]:null},getTarget:function(b){return typeof b!="string"&&(b=b.id),a[b]},getTargetFromEvent:function(c){var d=Ext.lib.Event.getTarget(c);return d?a[d.id]||b[d.id]:null}}}(),Ext.dd.StatusProxy=function(a){Ext.apply(this,a),this.id=this.id||Ext.id(),this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!a||a.shadow!==!1}),this.ghost=Ext.get(this.el.dom.childNodes[1]),this.dropStatus=this.dropNotAllowed},Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(a){a=a||this.dropNotAllowed,this.dropStatus!=a&&(this.el.replaceClass(this.dropStatus,a),this.dropStatus=a)},reset:function(a){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed,this.dropStatus=this.dropNotAllowed,a&&this.ghost.update("")},update:function(a){typeof a=="string"?this.ghost.update(a):(this.ghost.update(""),a.style.margin="0",this.ghost.dom.appendChild(a));var b=this.ghost.dom.firstChild;b&&Ext.fly(b).setStyle("float","none")},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(a){this.el.hide(),a&&this.reset(!0)},stop:function(){this.anim&&this.anim.isAnimated&&this.anim.isAnimated()&&this.anim.stop()},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(a,b,c){this.callback=b,this.scope=c,a&&this.animRepair!==!1?(this.el.addClass("x-dd-drag-repair"),this.el.hideUnders(!0),this.anim=this.el.shift({duration:this.repairDuration||.5,easing:"easeOut",xy:a,stopFx:!0,callback:this.afterRepair,scope:this})):this.afterRepair()},afterRepair:function(){this.hide(!0),typeof this.callback=="function"&&this.callback.call(this.scope||this),this.callback=null,this.scope=null},destroy:function(){Ext.destroy(this.ghost,this.el)}},Ext.dd.DragSource=function(a,b){this.el=Ext.get(a),this.dragData||(this.dragData={}),Ext.apply(this,b),this.proxy||(this.proxy=new Ext.dd.StatusProxy),Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:!1,isTarget:!1,scroll:this.scroll===!0}),this.dragging=!1},Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(a){return this.dragData},onDragEnter:function(a,b){var c=Ext.dd.DragDropMgr.getDDById(b);this.cachedTarget=c;if(this.beforeDragEnter(c,a,b)!==!1){if(c.isNotifyTarget){var d=c.notifyEnter(this,a,this.dragData);this.proxy.setStatus(d)}else this.proxy.setStatus(this.dropAllowed);this.afterDragEnter&&this.afterDragEnter(c,a,b)}},beforeDragEnter:function(a,b,c){return!0},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments),this.proxy.sync()},onDragOver:function(a,b){var c=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(b);if(this.beforeDragOver(c,a,b)!==!1){if(c.isNotifyTarget){var d=c.notifyOver(this,a,this.dragData);this.proxy.setStatus(d)}this.afterDragOver&&this.afterDragOver(c,a,b)}},beforeDragOver:function(a,b,c){return!0},onDragOut:function(a,b){var c=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(b);this.beforeDragOut(c,a,b)!==!1&&(c.isNotifyTarget&&c.notifyOut(this,a,this.dragData),this.proxy.reset(),this.afterDragOut&&this.afterDragOut(c,a,b)),this.cachedTarget=null},beforeDragOut:function(a,b,c){return!0},onDragDrop:function(a,b){var c=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(b);this.beforeDragDrop(c,a,b)!==!1&&(c.isNotifyTarget?c.notifyDrop(this,a,this.dragData)?this.onValidDrop(c,a,b):this.onInvalidDrop(c,a,b):this.onValidDrop(c,a,b),this.afterDragDrop&&this.afterDragDrop(c,a,b)),delete this.cachedTarget},beforeDragDrop:function(a,b,c){return!0},onValidDrop:function(a,b,c){this.hideProxy(),this.afterValidDrop&&this.afterValidDrop(a,b,c)},getRepairXY:function(a,b){return this.el.getXY()},onInvalidDrop:function(a,b,c){this.beforeInvalidDrop(a,b,c),this.cachedTarget&&(this.cachedTarget.isNotifyTarget&&this.cachedTarget.notifyOut(this,b,this.dragData),this.cacheTarget=null),this.proxy.repair(this.getRepairXY(b,this.dragData),this.afterRepair,this),this.afterInvalidDrop&&this.afterInvalidDrop(b,c)},afterRepair:function(){Ext.enableFx&&this.el.highlight(this.hlColor||"c3daf9"),this.dragging=!1},beforeInvalidDrop:function(a,b,c){return!0},handleMouseDown:function(a){if(this.dragging)return;var b=this.getDragData(a);b&&this.onBeforeDrag(b,a)!==!1&&(this.dragData=b,this.proxy.stop(),Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments))},onBeforeDrag:function(a,b){return!0},onStartDrag:Ext.emptyFn,startDrag:function(a,b){this.proxy.reset(),this.dragging=!0,this.proxy.update(""),this.onInitDrag(a,b),this.proxy.show()},onInitDrag:function(a,b){var c=this.el.dom.cloneNode(!0);return c.id=Ext.id(),this.proxy.update(c),this.onStartDrag(a,b),!0},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide(),this.proxy.reset(!0),this.dragging=!1},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(a){},endDrag:function(a){this.onEndDrag(this.dragData,a)},onEndDrag:function(a,b){},autoOffset:function(a,b){this.setDelta(-12,-20)},destroy:function(){Ext.dd.DragSource.superclass.destroy.call(this),Ext.destroy(this.proxy)}}),Ext.dd.DropTarget=function(a,b){this.el=Ext.get(a),Ext.apply(this,b),this.containerScroll&&Ext.dd.ScrollManager.register(this.el),Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:!0})},Ext.extend(Ext.dd.DropTarget,Ext.dd.DDTarget,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:!0,isNotifyTarget:!0,notifyEnter:function(a,b,c){return this.overClass&&this.el.addClass(this.overClass),this.dropAllowed},notifyOver:function(a,b,c){return this.dropAllowed},notifyOut:function(a,b,c){this.overClass&&this.el.removeClass(this.overClass)},notifyDrop:function(a,b,c){return!1}}),Ext.dd.DragZone=function(a,b){Ext.dd.DragZone.superclass.constructor.call(this,a,b),this.containerScroll&&Ext.dd.ScrollManager.register(this.el)},Ext.extend(Ext.dd.DragZone,Ext.dd.DragSource,{getDragData:function(a){return Ext.dd.Registry.getHandleFromEvent(a)},onInitDrag:function(a,b){return this.proxy.update(this.dragData.ddel.cloneNode(!0)),this.onStartDrag(a,b),!0},afterRepair:function(){Ext.enableFx&&Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9"),this.dragging=!1},getRepairXY:function(a){return Ext.Element.fly(this.dragData.ddel).getXY()}}),Ext.dd.DropZone=function(a,b){Ext.dd.DropZone.superclass.constructor.call(this,a,b)},Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(a){return Ext.dd.Registry.getTargetFromEvent(a)},onNodeEnter:function(a,b,c,d){},onNodeOver:function(a,b,c,d){return this.dropAllowed},onNodeOut:function(a,b,c,d){},onNodeDrop:function(a,b,c,d){return!1},onContainerOver:function(a,b,c){return this.dropNotAllowed},onContainerDrop:function(a,b,c){return!1},notifyEnter:function(a,b,c){return this.dropNotAllowed},notifyOver:function(a,b,c){var d=this.getTargetFromEvent(b);return d?(this.lastOverNode!=d&&(this.lastOverNode&&this.onNodeOut(this.lastOverNode,a,b,c),this.onNodeEnter(d,a,b,c),this.lastOverNode=d),this.onNodeOver(d,a,b,c)):(this.lastOverNode&&(this.onNodeOut(this.lastOverNode,a,b,c),this.lastOverNode=null),this.onContainerOver(a,b,c))},notifyOut:function(a,b,c){this.lastOverNode&&(this.onNodeOut(this.lastOverNode,a,b,c),this.lastOverNode=null)},notifyDrop:function(a,b,c){this.lastOverNode&&(this.onNodeOut(this.lastOverNode,a,b,c),this.lastOverNode=null);var d=this.getTargetFromEvent(b);return d?this.onNodeDrop(d,a,b,c):this.onContainerDrop(a,b,c)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}}),Ext.Element.addMethods({initDD:function(a,b,c){var d=new Ext.dd.DD(Ext.id(this.dom),a,b);return Ext.apply(d,c)},initDDProxy:function(a,b,c){var d=new Ext.dd.DDProxy(Ext.id(this.dom),a,b);return Ext.apply(d,c)},initDDTarget:function(a,b,c){var d=new Ext.dd.DDTarget(Ext.id(this.dom),a,b);return Ext.apply(d,c)}}),Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:!0,draggable:!0,closable:!0,closeAction:"close",constrain:!1,constrainHeader:!1,plain:!1,minimizable:!1,maximizable:!1,minHeight:100,minWidth:200,expandOnShow:!0,collapsible:!1,initHidden:undefined,hidden:!0,elements:"header,body",frame:!0,floating:!0,initComponent:function(){this.initTools(),Ext.Window.superclass.initComponent.call(this),this.addEvents("resize","maximize","minimize","restore"),Ext.isDefined(this.initHidden)&&(this.hidden=this.initHidden),this.hidden===!1&&(this.hidden=!0,this.show())},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox(!0))},onRender:function(a,b){Ext.Window.superclass.onRender.call(this,a,b),this.plain&&this.el.addClass("x-window-plain"),this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:"&#160;"}),this.focusEl.swallowEvent("click",!0),this.proxy=this.el.createProxy("x-window-proxy"),this.proxy.enableDisplayMode("block"),this.modal&&(this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom),this.mask.enableDisplayMode("block"),this.mask.hide(),this.mon(this.mask,"click",this.focus,this)),this.maximizable&&this.mon(this.header,"dblclick",this.toggleMaximize,this)},initEvents:function(){Ext.Window.superclass.initEvents.call(this),this.animateTarget&&this.setAnimateTarget(this.animateTarget),this.resizable&&(this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:!0,resizeElement:this.resizerAction,handleCls:"x-window-handle"}),this.resizer.window=this,this.mon(this.resizer,"beforeresize",this.beforeResize,this)),this.draggable&&this.header.addClass("x-window-draggable"),this.mon(this.el,"mousedown",this.toFront,this),this.manager=this.manager||Ext.WindowMgr,this.manager.register(this),this.maximized&&(this.maximized=!1,this.maximize());if(this.closable){var a=this.getKeyMap();a.on(27,this.onEsc,this),a.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(a,b){b.stopEvent(),this[this.closeAction]()},beforeDestroy:function(){this.rendered&&(this.hide(),this.clearAnchor(),Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask)),Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){this.manager&&this.manager.unregister(this),Ext.Window.superclass.onDestroy.call(this)},initTools:function(){this.minimizable&&this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])}),this.maximizable&&(this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])}),this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:!0})),this.closable&&this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})},resizerAction:function(){var a=this.proxy.getBox();return this.proxy.hide(),this.window.handleResize(a),a},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40),this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40),this.resizeBox=this.el.getBox()},updateHandles:function(){Ext.isIE&&this.resizer&&(this.resizer.syncHandleHeight(),this.el.repaint())},handleResize:function(a){var b=this.resizeBox;b.x!=a.x||b.y!=a.y?this.updateBox(a):(this.setSize(a),Ext.isIE6&&Ext.isStrict&&this.doLayout()),this.focus(),this.updateHandles(),this.saveState()},focus:function(){var a=this.focusEl,b=this.defaultButton,c=typeof b,d,e;if(Ext.isDefined(b)){Ext.isNumber(b)&&this.fbar?a=this.fbar.items.get(b):Ext.isString(b)?a=Ext.getCmp(b):a=b,d=a.getEl(),e=Ext.getDom(this.container);if(d&&e&&!Ext.lib.Region.getRegion(e).contains(Ext.lib.Region.getRegion(d.dom)))return}a=a||this.focusEl,a.focus.defer(10,a)},setAnimateTarget:function(a){a=Ext.get(a),this.animateTarget=a},beforeShow:function(){delete this.el.lastXY,delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var a=this.el.getAlignToXY(this.container,"c-c"),b=this.el.translatePoints(a[0],a[1]);this.x=this.x===undefined?b.left:this.x,this.y=this.y===undefined?b.top:this.y}this.el.setLeftTop(this.x,this.y),this.expandOnShow&&this.expand(!1),this.modal&&(Ext.getBody().addClass("x-body-masked"),this.mask.setSize(Ext.lib.Dom.getViewWidth(!0),Ext.lib.Dom.getViewHeight(!0)),this.mask.show())},show:function(a,b,c){return this.rendered||this.render(Ext.getBody()),this.hidden===!1?(this.toFront(),this):this.fireEvent("beforeshow",this)===!1?this:(b&&this.on("show",b,c,{single:!0}),this.hidden=!1,Ext.isDefined(a)&&this.setAnimateTarget(a),this.beforeShow(),this.animateTarget?this.animShow():this.afterShow(),this)},afterShow:function(a){if(this.isDestroyed)return!1;this.proxy.hide(),this.el.setStyle("display","block"),this.el.show(),this.maximized&&this.fitContainer(),Ext.isMac&&Ext.isGecko2&&this.cascade(this.setAutoScroll),(this.monitorResize||this.modal||this.constrain||this.constrainHeader)&&Ext.EventManager.onWindowResize(this.onWindowResize,this),this.doConstrain(),this.doLayout(),this.keyMap&&this.keyMap.enable(),this.toFront(),this.updateHandles();if(a&&(Ext.isIE||Ext.isWebKit)){var b=this.getSize();this.onResize(b.width,b.height)}this.onShow(),this.fireEvent("show",this)},animShow:function(){this.proxy.show(),this.proxy.setBox(this.animateTarget.getBox()),this.proxy.setOpacity(0);var a=this.getBox();this.el.setStyle("display","none"),this.proxy.shift(Ext.apply(a,{callback:this.afterShow.createDelegate(this,[!0],!1),scope:this,easing:"easeNone",duration:.25,opacity:.5}))},hide:function(a,b,c){return this.hidden||this.fireEvent("beforehide",this)===!1?this:(b&&this.on("hide",b,c,{single:!0}),this.hidden=!0,a!==undefined&&this.setAnimateTarget(a),this.modal&&(this.mask.hide(),Ext.getBody().removeClass("x-body-masked")),this.animateTarget?this.animHide():(this.el.hide(),this.afterHide()),this)},afterHide:function(){this.proxy.hide(),(this.monitorResize||this.modal||this.constrain||this.constrainHeader)&&Ext.EventManager.removeResizeListener(this.onWindowResize,this),this.keyMap&&this.keyMap.disable(),this.onHide(),this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(.5),this.proxy.show();var a=this.getBox(!1);this.proxy.setBox(a),this.el.hide(),this.proxy.shift(Ext.apply(this.animateTarget.getBox(),{callback:this.afterHide,scope:this,duration:.25,easing:"easeNone",opacity:0}))},onShow:Ext.emptyFn,onHide:Ext.emptyFn,onWindowResize:function(){this.maximized&&this.fitContainer();if(this.modal){this.mask.setSize("100%","100%");var a=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(!0),Ext.lib.Dom.getViewHeight(!0))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var a;if(this.constrain)a={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset};else{var b=this.getSize();a={right:-(b.width-100),bottom:-(b.height-25)}}var c=this.el.getConstrainToXY(this.container,!0,a);c&&this.setPosition(c[0],c[1])}},ghost:function(a){var b=this.createGhost(a),c=this.getBox(!0);return b.setLeftTop(c.x,c.y),b.setWidth(c.width),this.el.hide(),this.activeGhost=b,b},unghost:function(a,b){if(!this.activeGhost)return;a!==!1&&(this.el.show(),this.focus.defer(10,this),Ext.isMac&&Ext.isGecko2&&this.cascade(this.setAutoScroll)),b!==!1&&this.setPosition(this.activeGhost.getLeft(!0),this.activeGhost.getTop(!0)),this.activeGhost.hide(),this.activeGhost.remove(),delete this.activeGhost},minimize:function(){return this.fireEvent("minimize",this),this},close:function(){this.fireEvent("beforeclose",this)!==!1&&(this.hidden?this.doClose():this.hide(null,this.doClose,this))},doClose:function(){this.fireEvent("close",this),this.destroy()},maximize:function(){return this.maximized||(this.expand(!1),this.restoreSize=this.getSize(),this.restorePos=this.getPosition(!0),this.maximizable&&(this.tools.maximize.hide(),this.tools.restore.show()),this.maximized=!0,this.el.disableShadow(),this.dd&&this.dd.lock(),this.collapsible&&this.tools.toggle.hide(),this.el.addClass("x-window-maximized"),this.container.addClass("x-window-maximized-ct"),this.setPosition(0,0),this.fitContainer(),this.fireEvent("maximize",this)),this},restore:function(){if(this.maximized){var a=this.tools;this.el.removeClass("x-window-maximized"),a.restore&&a.restore.hide(),a.maximize&&a.maximize.show(),this.setPosition(this.restorePos[0],this.restorePos[1]),this.setSize(this.restoreSize.width,this.restoreSize.height),delete this.restorePos,delete this.restoreSize,this.maximized=!1,this.el.enableShadow(!0),this.dd&&this.dd.unlock(),this.collapsible&&a.toggle&&a.toggle.show(),this.container.removeClass("x-window-maximized-ct"),this.doConstrain(),this.fireEvent("restore",this)}return this},toggleMaximize:function(){return this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var a=this.container.getViewSize(!1);this.setSize(a.width,a.height)},setZIndex:function(a){this.modal&&this.mask.setStyle("z-index",a),this.el.setZIndex(++a),a+=5,this.resizer&&this.resizer.proxy.setStyle("z-index",++a),this.lastZIndex=a},alignTo:function(a,b,c){var d=this.el.getAlignToXY(a,b,c);return this.setPagePosition(d[0],d[1]),this},anchorTo:function(a,b,c,d){this.clearAnchor(),this.anchorTarget={el:a,alignment:b,offsets:c},Ext.EventManager.onWindowResize(this.doAnchor,this);var e=typeof d;return e!="undefined"&&Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:e=="number"?d:50}),this.doAnchor()},doAnchor:function(){var a=this.anchorTarget;return this.alignTo(a.el,a.alignment,a.offsets),this},clearAnchor:function(){return this.anchorTarget&&(Ext.EventManager.removeResizeListener(this.doAnchor,this),Ext.EventManager.un(window,"scroll",this.doAnchor,this),delete this.anchorTarget),this},toFront:function(a){return this.manager.bringToFront(this)&&(!a||!a.getTarget().focus)&&this.focus(),this},setActive:function(a){a?(this.maximized||this.el.enableShadow(!0),this.fireEvent("activate",this)):(this.el.disableShadow(),this.fireEvent("deactivate",this))},toBack:function(){return this.manager.sendToBack(this),this},center:function(){var a=this.el.getAlignToXY(this.container,"c-c");return this.setPagePosition(a[0],a[1]),this}}),Ext.reg("window",Ext.Window),Ext.Window.DD=function(a){this.win=a,Ext.Window.DD.superclass.constructor.call(this,a.el.id,"WindowDD-"+a.id),this.setHandleElId(a.header.id),this.scroll=!1},Ext.extend(Ext.Window.DD,Ext.dd.DD,{moveOnly:!0,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost();if(a.constrain!==!1){var b=a.el.shadowOffset;this.constrainTo(a.container,{right:b,left:b,bottom:b})}else if(a.constrainHeader!==!1){var c=this.proxy.getSize();this.constrainTo(a.container,{right:-(c.width-this.headerOffsets[0]),bottom:-(c.height-this.headerOffsets[1])})}},b4Drag:Ext.emptyFn,onDrag:function(a){this.alignElWithMouse(this.proxy,a.getPageX(),a.getPageY())},endDrag:function(a){this.win.unghost(),this.win.saveState()}}),Ext.WindowGroup=function(){var a={},b=[],c=null,d=function(a,b){return!a._lastAccess||a._lastAccess<b._lastAccess?-1:1},e=function(){var a=b,c=a.length;if(c>0){a.sort(d);var e=a[0].manager.zseed;for(var f=0;f<c;f++){var h=a[f];h&&!h.hidden&&h.setZIndex(e+f*10)}}g()},f=function(a){a!=c&&(c&&c.setActive(!1),c=a,a&&a.setActive(!0))},g=function(){for(var a=b.length-1;a>=0;--a)if(!b[a].hidden){f(b[a]);return}f(null)};return{zseed:9e3,register:function(c){c.manager&&c.manager.unregister(c),c.manager=this,a[c.id]=c,b.push(c),c.on("hide",g)},unregister:function(c){delete c.manager,delete a[c.id],c.un("hide",g),b.remove(c)},get:function(b){return typeof b=="object"?b:a[b]},bringToFront:function(a){return a=this.get(a),a!=c?(a._lastAccess=(new Date).getTime(),e(),!0):!1},sendToBack:function(a){return a=this.get(a),a._lastAccess=-(new Date).getTime(),e(),a},hideAll:function(){for(var b in a)a[b]&&typeof a[b]!="function"&&a[b].isVisible()&&a[b].hide()},getActive:function(){return c},getBy:function(a,c){var d=[];for(var e=b.length-1;e>=0;--e){var f=b[e];a.call(c||f,f)!==!1&&d.push(f)}return d},each:function(b,c){for(var d in a)if(a[d]&&typeof a[d]!="function"&&b.call(c||a[d],a[d])===!1)return}}},Ext.WindowMgr=new Ext.WindowGroup,Ext.MessageBox=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p="",q="",r=["ok","yes","no","cancel"],s=function(c){m[c].blur(),a.isVisible()&&(a.hide(),t(),Ext.callback(b.fn,b.scope||window,[c,n.dom.value,b],1))},t=function(){b&&b.cls&&a.el.removeClass(b.cls),i.reset()},u=function(c,d,e){b&&b.closable!==!1&&(a.hide(),t()),e&&e.stopEvent()},v=function(b){var c=0,d;return b?(a.footer.dom.style.display="",Ext.iterate(m,function(a,e){d=b[a],d?(e.show(),e.setText(Ext.isString(d)?d:Ext.MessageBox.buttonText[a]),c+=e.getEl().getWidth()+15):e.hide()}),c):(Ext.each(r,function(a){m[a].hide()}),c)};return{getDialog:function(d){if(!a){var j=[];m={},Ext.each(r,function(a){j.push(m[a]=new Ext.Button({text:this.buttonText[a],handler:s.createCallback(a),hideMode:"offsets"}))},this),a=new Ext.Window({autoCreate:!0,title:d,
resizable:!1,constrain:!0,constrainHeader:!0,minimizable:!1,maximizable:!1,stateful:!1,modal:!0,shim:!0,buttonAlign:"center",width:400,height:100,minHeight:80,plain:!0,footer:!0,closable:!0,close:function(){b&&b.buttons&&b.buttons.no&&!b.buttons.cancel?s("no"):s("cancel")},fbar:new Ext.Toolbar({items:j,enableOverflow:!1})}),a.render(document.body),a.getEl().addClass("x-window-dlg"),c=a.mask,e=a.body.createChild({html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'}),k=Ext.get(e.dom.firstChild);var l=e.dom.childNodes[1];f=Ext.get(l.firstChild),g=Ext.get(l.childNodes[2].firstChild),g.enableDisplayMode(),g.addKeyListener([10,13],function(){a.isVisible()&&b&&b.buttons&&(b.buttons.ok?s("ok"):b.buttons.yes&&s("yes"))}),h=Ext.get(l.childNodes[2].childNodes[1]),h.enableDisplayMode(),i=new Ext.ProgressBar({renderTo:e}),e.createChild({cls:"x-clear"})}return a},updateText:function(c){!a.isVisible()&&!b.width&&a.setSize(this.maxWidth,100),f.update(c||"&#160;");var d=q!=""?k.getWidth()+k.getMargins("lr"):0,e=f.getWidth()+f.getMargins("lr"),g=a.getFrameWidth("lr"),h=a.body.getFrameWidth("lr"),j;return Ext.isIE&&d>0&&(d+=3),j=Math.max(Math.min(b.width||d+e+g+h,b.maxWidth||this.maxWidth),Math.max(b.minWidth||this.minWidth,o||0)),b.prompt===!0&&n.setWidth(j-d-g-h),(b.progress===!0||b.wait===!0)&&i.setSize(j-d-g-h),Ext.isIE&&j==o&&(j+=4),a.setSize(j,"auto").center(),this},updateProgress:function(a,b,c){return i.updateProgress(a,b),c&&this.updateText(c),this},isVisible:function(){return a&&a.isVisible()},hide:function(){var b=a?a.activeGhost:null;if(this.isVisible()||b)a.hide(),t(),b&&a.unghost(!1,!1);return this},show:function(d){this.isVisible()&&this.hide(),b=d;var e=this.getDialog(b.title||"&#160;");e.setTitle(b.title||"&#160;");var f=b.closable!==!1&&b.progress!==!0&&b.wait!==!0;e.tools.close.setDisplayed(f),n=g,b.prompt=b.prompt||(b.multiline?!0:!1),b.prompt?b.multiline?(g.hide(),h.show(),h.setHeight(Ext.isNumber(b.multiline)?b.multiline:this.defaultTextHeight),n=h):(g.show(),h.hide()):(g.hide(),h.hide()),n.dom.value=b.value||"";if(b.prompt)e.focusEl=n;else{var j=b.buttons,k=null;j&&j.ok?k=m.ok:j&&j.yes&&(k=m.yes),k&&(e.focusEl=k)}return b.iconCls&&e.setIconClass(b.iconCls),this.setIcon(Ext.isDefined(b.icon)?b.icon:p),o=v(b.buttons),i.setVisible(b.progress===!0||b.wait===!0),this.updateProgress(0,b.progressText),this.updateText(b.msg),b.cls&&e.el.addClass(b.cls),e.proxyDrag=b.proxyDrag===!0,e.modal=b.modal!==!1,e.mask=b.modal!==!1?c:!1,e.isVisible()||(document.body.appendChild(a.el.dom),e.setAnimateTarget(b.animEl),e.on("show",function(){f===!0?e.keyMap.enable():e.keyMap.disable()},this,{single:!0}),e.show(b.animEl)),b.wait===!0&&i.wait(b.waitConfig),this},setIcon:function(b){if(!a){p=b;return}return p=undefined,b&&b!=""?(k.removeClass("x-hidden"),k.replaceClass(q,b),e.addClass("x-dlg-icon"),q=b):(k.replaceClass(q,"x-hidden"),e.removeClass("x-dlg-icon"),q=""),this},progress:function(a,b,c){return this.show({title:a,msg:b,buttons:!1,progress:!0,closable:!1,minWidth:this.minProgressWidth,progressText:c}),this},wait:function(a,b,c){return this.show({title:b,msg:a,buttons:!1,closable:!1,wait:!0,modal:!0,minWidth:this.minProgressWidth,waitConfig:c}),this},alert:function(a,b,c,d){return this.show({title:a,msg:b,buttons:this.OK,fn:c,scope:d,minWidth:this.minWidth}),this},confirm:function(a,b,c,d){return this.show({title:a,msg:b,buttons:this.YESNO,fn:c,scope:d,icon:this.QUESTION,minWidth:this.minWidth}),this},prompt:function(a,b,c,d,e,f){return this.show({title:a,msg:b,buttons:this.OKCANCEL,fn:c,minWidth:this.minPromptWidth,scope:d,prompt:!0,multiline:e,value:f}),this},OK:{ok:!0},CANCEL:{cancel:!0},OKCANCEL:{ok:!0,cancel:!0},YESNO:{yes:!0,no:!0},YESNOCANCEL:{yes:!0,no:!0,cancel:!0},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,minPromptWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}(),Ext.Msg=Ext.MessageBox,Ext.dd.PanelProxy=function(a,b){this.panel=a,this.id=this.panel.id+"-ddproxy",Ext.apply(this,b)},Ext.dd.PanelProxy.prototype={insertProxy:!0,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){this.ghost&&(this.proxy&&(this.proxy.remove(),delete this.proxy),this.panel.el.dom.style.display="",this.ghost.remove(),delete this.ghost)},show:function(){this.ghost||(this.ghost=this.panel.createGhost(undefined,undefined,Ext.getBody()),this.ghost.setXY(this.panel.el.getXY()),this.insertProxy&&(this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"}),this.proxy.setSize(this.panel.getSize())),this.panel.el.dom.style.display="none")},repair:function(a,b,c){this.hide(),typeof b=="function"&&b.call(c||this)},moveProxy:function(a,b){this.proxy&&a.insertBefore(this.proxy.dom,b)}},Ext.Panel.DD=function(a,b){this.panel=a,this.dragData={panel:a},this.proxy=new Ext.dd.PanelProxy(a,b),Ext.Panel.DD.superclass.constructor.call(this,a.el,b);var c=a.header;c&&this.setHandleElId(c.id),(c?c:this.panel.body).setStyle("cursor","move"),this.scroll=!1},Ext.extend(Ext.Panel.DD,Ext.dd.DragSource,{showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(a,b){this.proxy.show()},b4MouseDown:function(a){var b=a.getPageX(),c=a.getPageY();this.autoOffset(b,c)},onInitDrag:function(a,b){return this.onStartDrag(a,b),!0},createFrame:Ext.emptyFn,getDragEl:function(a){return this.proxy.ghost.dom},endDrag:function(a){this.proxy.hide(),this.panel.saveState()},autoOffset:function(a,b){a-=this.startPageX,b-=this.startPageY,this.setDelta(a,b)}}),Ext.Resizable=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.el=Ext.get(a);if(b&&b.wrap){b.resizeChild=this.el,this.el=this.el.wrap(typeof b.wrap=="object"?b.wrap:{cls:"xresizable-wrap"}),this.el.id=this.el.dom.id=b.resizeChild.id+"-rzwrap",this.el.setStyle("overflow","hidden"),this.el.setPositioning(b.resizeChild.getPositioning()),b.resizeChild.clearPositioning();if(!b.width||!b.height){var c=b.resizeChild.getSize();this.el.setSize(c.width,c.height)}b.pinned&&!b.adjustments&&(b.adjustments="auto")}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody()),this.proxy.unselectable(),this.proxy.enableDisplayMode("block"),Ext.apply(this,b),this.pinned&&(this.disableTrackOver=!0,this.el.addClass("x-resizable-pinned"));var d=this.el.getStyle("position");d!="absolute"&&d!="fixed"&&this.el.setStyle("position","relative"),this.handles||(this.handles="s,e,se",this.multiDirectional&&(this.handles+=",n,w")),this.handles=="all"&&(this.handles="n s e w ne nw se sw");var e=this.handles.split(/\s*?[,;]\s*?| /),f=Ext.Resizable.positions;for(var g=0,h=e.length;g<h;g++)if(e[g]&&f[e[g]]){var i=f[e[g]];this[i]=new Ext.Resizable.Handle(this,i,this.disableTrackOver,this.transparent,this.handleCls)}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1)this.updateBox=!0;this.activeHandle=null,this.resizeChild&&(typeof this.resizeChild=="boolean"?this.resizeChild=Ext.get(this.el.dom.firstChild,!0):this.resizeChild=Ext.get(this.resizeChild,!0));if(this.adjustments=="auto"){var j=this.resizeChild,k=this.west,l=this.east,m=this.north,e=this.south;j&&(k||m)&&(j.position("relative"),j.setLeft(k?k.el.getWidth():0),j.setTop(m?m.el.getHeight():0)),this.adjustments=[(l?-l.el.getWidth():0)+(k?-k.el.getWidth():0),(m?-m.el.getHeight():0)+(e?-e.el.getHeight():0)-1]}this.draggable&&(this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id}),this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id),this.constrainTo&&this.dd.constrainTo(this.constrainTo)),this.addEvents("beforeresize","resize"),this.width!==null&&this.height!==null?this.resizeTo(this.width,this.height):this.updateChildSize(),Ext.isIE&&(this.el.dom.style.zoom=1),Ext.Resizable.superclass.constructor.call(this)},adjustments:[0,0],animate:!1,disableTrackOver:!1,draggable:!1,duration:.35,dynamic:!1,easing:"easeOutStrong",enabled:!0,handles:!1,multiDirectional:!1,height:null,width:null,heightIncrement:0,widthIncrement:0,minHeight:5,minWidth:5,maxHeight:1e4,maxWidth:1e4,minX:0,minY:0,pinned:!1,preserveRatio:!1,resizeChild:!1,transparent:!1,resizeTo:function(a,b){this.el.setSize(a,b),this.updateChildSize(),this.fireEvent("resize",this,a,b,null)},startSizing:function(a,b){this.fireEvent("beforeresize",this,a);if(this.enabled){this.overlay||(this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody()),this.overlay.unselectable(),this.overlay.enableDisplayMode("block"),this.overlay.on({scope:this,mousemove:this.onMouseMove,mouseup:this.onMouseUp})),this.overlay.setStyle("cursor",b.el.getStyle("cursor")),this.resizing=!0,this.startBox=this.el.getBox(),this.startPoint=a.getXY(),this.offsets=[this.startBox.x+this.startBox.width-this.startPoint[0],this.startBox.y+this.startBox.height-this.startPoint[1]],this.overlay.setSize(Ext.lib.Dom.getViewWidth(!0),Ext.lib.Dom.getViewHeight(!0)),this.overlay.show();if(this.constrainTo){var c=Ext.get(this.constrainTo);this.resizeRegion=c.getRegion().adjust(c.getFrameWidth("t"),c.getFrameWidth("l"),-c.getFrameWidth("b"),-c.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden"),this.proxy.show(),this.proxy.setBox(this.startBox),this.dynamic||this.proxy.setStyle("visibility","visible")}},onMouseDown:function(a,b){this.enabled&&(b.stopEvent(),this.activeHandle=a,this.startSizing(b,a))},onMouseUp:function(a){this.activeHandle=null;var b=this.resizeElement();this.resizing=!1,this.handleOut(),this.overlay.hide(),this.proxy.hide(),this.fireEvent("resize",this,b.width,b.height,a)},updateChildSize:function(){if(this.resizeChild){var a=this.el,b=this.resizeChild,c=this.adjustments;if(a.dom.offsetWidth){var d=a.getSize(!0);b.setSize(d.width+c[0],d.height+c[1])}Ext.isIE&&setTimeout(function(){if(a.dom.offsetWidth){var d=a.getSize(!0);b.setSize(d.width+c[0],d.height+c[1])}},10)}},snap:function(a,b,c){if(!b||!a)return a;var d=a,e=a%b;return e>0&&(e>b/2?d=a+(b-e):d=a-e),Math.max(c,d)},resizeElement:function(){var a=this.proxy.getBox();return this.updateBox?this.el.setBox(a,!1,this.animate,this.duration,null,this.easing):this.el.setSize(a.width,a.height,this.animate,this.duration,null,this.easing),this.updateChildSize(),this.dynamic||this.proxy.hide(),this.draggable&&this.constrainTo&&(this.dd.resetConstraints(),this.dd.constrainTo(this.constrainTo)),a},constrain:function(a,b,c,d){return a-b<c?b=a-c:a-b>d&&(b=a-d),b},onMouseMove:function(a){if(this.enabled&&this.activeHandle)try{if(this.resizeRegion&&!this.resizeRegion.contains(a.getPoint()))return;var b=this.curSize||this.startBox,c=this.startBox.x,d=this.startBox.y,e=c,f=d,g=b.width,h=b.height,i=g,j=h,k=this.minWidth,l=this.minHeight,m=this.maxWidth,n=this.maxHeight,o=this.widthIncrement,p=this.heightIncrement,q=a.getXY(),r=-(this.startPoint[0]-Math.max(this.minX,q[0])),s=-(this.startPoint[1]-Math.max(this.minY,q[1])),t=this.activeHandle.position,u,v;switch(t){case"east":g+=r,g=Math.min(Math.max(k,g),m);break;case"south":h+=s,h=Math.min(Math.max(l,h),n);break;case"southeast":g+=r,h+=s,g=Math.min(Math.max(k,g),m),h=Math.min(Math.max(l,h),n);break;case"north":s=this.constrain(h,s,l,n),d+=s,h-=s;break;case"west":r=this.constrain(g,r,k,m),c+=r,g-=r;break;case"northeast":g+=r,g=Math.min(Math.max(k,g),m),s=this.constrain(h,s,l,n),d+=s,h-=s;break;case"northwest":r=this.constrain(g,r,k,m),s=this.constrain(h,s,l,n),d+=s,h-=s,c+=r,g-=r;break;case"southwest":r=this.constrain(g,r,k,m),h+=s,h=Math.min(Math.max(l,h),n),c+=r,g-=r}var w=this.snap(g,o,k),x=this.snap(h,p,l);if(w!=g||x!=h){switch(t){case"northeast":d-=x-h;break;case"north":d-=x-h;break;case"southwest":c-=w-g;break;case"west":c-=w-g;break;case"northwest":c-=w-g,d-=x-h}g=w,h=x}if(this.preserveRatio)switch(t){case"southeast":case"east":h=j*(g/i),h=Math.min(Math.max(l,h),n),g=i*(h/j);break;case"south":g=i*(h/j),g=Math.min(Math.max(k,g),m),h=j*(g/i);break;case"northeast":g=i*(h/j),g=Math.min(Math.max(k,g),m),h=j*(g/i);break;case"north":u=g,g=i*(h/j),g=Math.min(Math.max(k,g),m),h=j*(g/i),c+=(u-g)/2;break;case"southwest":h=j*(g/i),h=Math.min(Math.max(l,h),n),u=g,g=i*(h/j),c+=u-g;break;case"west":v=h,h=j*(g/i),h=Math.min(Math.max(l,h),n),d+=(v-h)/2,u=g,g=i*(h/j),c+=u-g;break;case"northwest":u=g,v=h,h=j*(g/i),h=Math.min(Math.max(l,h),n),g=i*(h/j),d+=v-h,c+=u-g}this.proxy.setBounds(c,d,g,h),this.dynamic&&this.resizeElement()}catch(y){}},handleOver:function(){this.enabled&&this.el.addClass("x-resizable-over")},handleOut:function(){this.resizing||this.el.removeClass("x-resizable-over")},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(a){Ext.destroy(this.dd,this.overlay,this.proxy),this.overlay=null,this.proxy=null;var b=Ext.Resizable.positions;for(var c in b)typeof b[c]!="function"&&this[b[c]]&&this[b[c]].destroy();a&&(this.el.update(""),Ext.destroy(this.el),this.el=null),this.purgeListeners()},syncHandleHeight:function(){var a=this.el.getHeight(!0);this.west&&this.west.el.setHeight(a),this.east&&this.east.el.setHeight(a)}}),Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"},Ext.Resizable.Handle=Ext.extend(Object,{constructor:function(a,b,c,d,e){if(!this.tpl){var f=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});f.compile(),Ext.Resizable.Handle.prototype.tpl=f}this.position=b,this.rz=a,this.el=this.tpl.append(a.el.dom,[this.position],!0),this.el.unselectable(),d&&this.el.setOpacity(0),Ext.isEmpty(e)||this.el.addClass(e),this.el.on("mousedown",this.onMouseDown,this),c||this.el.on({scope:this,mouseover:this.onMouseOver,mouseout:this.onMouseOut})},afterResize:function(a){},onMouseDown:function(a){this.rz.onMouseDown(this,a)},onMouseOver:function(a){this.rz.handleOver(this,a)},onMouseOut:function(a){this.rz.handleOut(this,a)},destroy:function(){Ext.destroy(this.el),this.el=null}}),Ext.Button=Ext.extend(Ext.BoxComponent,{hidden:!1,disabled:!1,pressed:!1,enableToggle:!1,menuAlign:"tl-bl?",type:"button",menuClassTarget:"tr:nth(2)",clickEvent:"click",handleMouseEvents:!0,tooltipType:"qtip",buttonSelector:"button:first-child",scale:"small",iconAlign:"left",arrowAlign:"right",initComponent:function(){Ext.Button.superclass.initComponent.call(this),this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout"),this.menu&&(this.menu=Ext.menu.MenuMgr.get(this.menu)),Ext.isString(this.toggleGroup)&&(this.enableToggle=!0)},getTemplateArgs:function(){return[this.type,"x-btn-"+this.scale+" x-btn-icon-"+this.scale+"-"+this.iconAlign,this.getMenuClass(),this.cls,this.id]},setButtonClass:function(){this.useSetClass&&(Ext.isEmpty(this.oldCls)||this.el.removeClass([this.oldCls,"x-btn-pressed"]),this.oldCls=this.iconCls||this.icon?this.text?"x-btn-text-icon":"x-btn-icon":"x-btn-noicon",this.el.addClass([this.oldCls,this.pressed?"x-btn-pressed":null]))},getMenuClass:function(){return this.menu?this.arrowAlign!="bottom"?"x-btn-arrow":"x-btn-arrow-bottom":""},onRender:function(a,b){this.template||(Ext.Button.buttonTemplate||(Ext.Button.buttonTemplate=new Ext.Template('<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">','<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',"</tbody></table>"),Ext.Button.buttonTemplate.compile()),this.template=Ext.Button.buttonTemplate);var c,d=this.getTemplateArgs();b?c=this.template.insertBefore(b,d,!0):c=this.template.append(a,d,!0),this.btnEl=c.child(this.buttonSelector),this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur}),this.initButtonEl(c,this.btnEl),Ext.ButtonToggleMgr.register(this)},initButtonEl:function(a,b){this.el=a,this.setIcon(this.icon),this.setText(this.text),this.setIconClass(this.iconCls),Ext.isDefined(this.tabIndex)&&(b.dom.tabIndex=this.tabIndex),this.tooltip&&this.setTooltip(this.tooltip,!0),this.handleMouseEvents&&this.mon(a,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown}),this.menu&&this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide});if(this.repeat){var c=new Ext.util.ClickRepeater(a,Ext.isObject(this.repeat)?this.repeat:{});this.mon(c,"click",this.onClick,this)}this.mon(a,this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this),this.useSetClass=!0,this.setButtonClass(),this.doc=Ext.getDoc(),this.doAutoWidth()},setIconClass:function(a){return this.iconCls=a,this.el&&(this.btnEl.dom.className="",this.btnEl.addClass(["x-btn-text",a||""]),this.setButtonClass()),this},setTooltip:function(a,b){return this.rendered?(b||this.clearTip(),Ext.isObject(a)?(Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},a)),this.tooltip=a):this.btnEl.dom[this.tooltipType]=a):this.tooltip=a,this},clearTip:function(){Ext.isObject(this.tooltip)&&Ext.QuickTips.unregister(this.btnEl)},beforeDestroy:function(){this.rendered&&this.clearTip(),this.menu&&this.destroyMenu!==!1&&Ext.destroy(this.menu),Ext.destroy(this.repeater)},onDestroy:function(){this.rendered&&(this.doc.un("mouseover",this.monitorMouseOver,this),this.doc.un("mouseup",this.onMouseUp,this),delete this.doc,delete this.btnEl,Ext.ButtonToggleMgr.unregister(this)),Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.autoWidth!==!1&&this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var a=this.btnEl;a&&a.getWidth()>20&&(a.clip(),a.setWidth(Ext.util.TextMetrics.measure(a,this.text).width+a.getFrameWidth("lr")))}this.minWidth&&this.el.getWidth()<this.minWidth&&this.el.setWidth(this.minWidth)}},setHandler:function(a,b){return this.handler=a,this.scope=b,this},setText:function(a){return this.text=a,this.el&&(this.btnEl.update(a||"&#160;"),this.setButtonClass()),this.doAutoWidth(),this},setIcon:function(a){return this.icon=a,this.el&&(this.btnEl.setStyle("background-image",a?"url("+a+")":""),this.setButtonClass()),this},getText:function(){return this.text},toggle:function(a,b){return a=a===undefined?!this.pressed:!!a,a!=this.pressed&&(this.rendered&&this.el[a?"addClass":"removeClass"]("x-btn-pressed"),this.pressed=a,b||(this.fireEvent("toggle",this,a),this.toggleHandler&&this.toggleHandler.call(this.scope||this,this,a))),this},onDisable:function(){this.onDisableChange(!0)},onEnable:function(){this.onDisableChange(!1)},onDisableChange:function(a){this.el&&((!Ext.isIE6||!this.text)&&this.el[a?"addClass":"removeClass"](this.disabledClass),this.el.dom.disabled=a),this.disabled=a},showMenu:function(){return this.rendered&&this.menu&&(this.tooltip&&Ext.QuickTips.getQuickTip().cancelShow(this.btnEl),this.menu.isVisible()&&this.menu.hide(),this.menu.ownerCt=this,this.menu.show(this.el,this.menuAlign)),this},hideMenu:function(){return this.hasVisibleMenu()&&this.menu.hide(),this},hasVisibleMenu:function(){return this.menu&&this.menu.ownerCt==this&&this.menu.isVisible()},onClick:function(a){a&&a.preventDefault();if(a.button!==0)return;this.disabled||(this.enableToggle&&(this.allowDepress!==!1||!this.pressed)&&this.toggle(),this.menu&&!this.hasVisibleMenu()&&!this.ignoreNextClick&&this.showMenu(),this.fireEvent("click",this,a),this.handler&&this.handler.call(this.scope||this,this,a))},isMenuTriggerOver:function(a,b){return this.menu&&!b},isMenuTriggerOut:function(a,b){return this.menu&&!b},onMouseOver:function(a){if(!this.disabled){var b=a.within(this.el,!0);b||(this.el.addClass("x-btn-over"),this.monitoringMouseOver||(this.doc.on("mouseover",this.monitorMouseOver,this),this.monitoringMouseOver=!0),this.fireEvent("mouseover",this,a)),this.isMenuTriggerOver(a,b)&&this.fireEvent("menutriggerover",this,this.menu,a)}},monitorMouseOver:function(a){a.target!=this.el.dom&&!a.within(this.el)&&(this.monitoringMouseOver&&(this.doc.un("mouseover",this.monitorMouseOver,this),this.monitoringMouseOver=!1),this.onMouseOut(a))},onMouseOut:function(a){var b=a.within(this.el)&&a.target!=this.el.dom;this.el.removeClass("x-btn-over"),this.fireEvent("mouseout",this,a),this.isMenuTriggerOut(a,b)&&this.fireEvent("menutriggerout",this,this.menu,a)},focus:function(){this.btnEl.focus()},blur:function(){this.btnEl.blur()},onFocus:function(a){this.disabled||this.el.addClass("x-btn-focus")},onBlur:function(a){this.el.removeClass("x-btn-focus")},getClickEl:function(a,b){return this.el},onMouseDown:function(a){!this.disabled&&a.button===0&&(this.getClickEl(a).addClass("x-btn-click"),this.doc.on("mouseup",this.onMouseUp,this))},onMouseUp:function(a){a.button===0&&(this.getClickEl(a,!0).removeClass("x-btn-click"),this.doc.un("mouseup",this.onMouseUp,this))},onMenuShow:function(a){this.menu.ownerCt==this&&(this.menu.ownerCt=this,this.ignoreNextClick=0,this.el.addClass("x-btn-menu-active"),this.fireEvent("menushow",this,this.menu))},onMenuHide:function(a){this.menu.ownerCt==this&&(this.el.removeClass("x-btn-menu-active"),this.ignoreNextClick=this.restoreClick.defer(250,this),this.fireEvent("menuhide",this,this.menu),delete this.menu.ownerCt)},restoreClick:function(){this.ignoreNextClick=0}}),Ext.reg("button",Ext.Button),Ext.ButtonToggleMgr=function(){function b(b,c){if(c){var d=a[b.toggleGroup];for(var e=0,f=d.length;e<f;e++)d[e]!=b&&d[e].toggle(!1)}}var a={};return{register:function(c){if(!c.toggleGroup)return;var d=a[c.toggleGroup];d||(d=a[c.toggleGroup]=[]),d.push(c),c.on("toggle",b)},unregister:function(c){if(!c.toggleGroup)return;var d=a[c.toggleGroup];d&&(d.remove(c),c.un("toggle",b))},getPressed:function(b){var c=a[b];if(c)for(var d=0,e=c.length;d<e;d++)if(c[d].pressed===!0)return c[d];return null}}}(),Ext.SplitButton=Ext.extend(Ext.Button,{arrowSelector:"em",split:!0,initComponent:function(){Ext.SplitButton.superclass.initComponent.call(this),this.addEvents("arrowclick")},onRender:function(){Ext.SplitButton.superclass.onRender.apply(this,arguments),this.arrowTooltip&&(this.el.child(this.arrowSelector).dom[this.tooltipType]=this.arrowTooltip)},setArrowHandler:function(a,b){this.arrowHandler=a,this.scope=b},getMenuClass:function(){return"x-btn-split"+(this.arrowAlign=="bottom"?"-bottom":"")},isClickOnArrow:function(a){if(this.arrowAlign!="bottom"){var b=this.el.child("em.x-btn-split"),c=b.getRegion().right-b.getPadding("r");return a.getPageX()>c}return a.getPageY()>this.btnEl.getRegion().bottom},onClick:function(a,b){a.preventDefault(),this.disabled||(this.isClickOnArrow(a)?(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick&&this.showMenu(),this.fireEvent("arrowclick",this,a),this.arrowHandler&&this.arrowHandler.call(this.scope||this,this,a)):(this.enableToggle&&this.toggle(),this.fireEvent("click",this,a),this.handler&&this.handler.call(this.scope||this,this,a)))},isMenuTriggerOver:function(a){return this.menu&&a.target.tagName==this.arrowSelector},isMenuTriggerOut:function(a,b){return this.menu&&a.target.tagName!=this.arrowSelector}}),Ext.reg("splitbutton",Ext.SplitButton),Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(a){if(a&&this.showText===!0){var b="";return this.prependText&&(b+=this.prependText),b+=a.text,b}return undefined},setActiveItem:function(a,b){Ext.isObject(a)||(a=this.menu.getComponent(a));if(a){if(!this.rendered)this.text=this.getItemText(a),this.iconCls=a.iconCls;else{var c=this.getItemText(a);c&&this.setText(c),this.setIconClass(a.iconCls)}this.activeItem=a,a.checked||a.setChecked(!0,!1),this.forceIcon&&this.setIconClass(this.forceIcon),b||this.fireEvent("change",this,a)}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change"),this.changeHandler&&(this.on("change",this.changeHandler,this.scope||this),delete this.changeHandler),this.itemCount=this.items.length,this.menu={cls:"x-cycle-menu",items:[]};var a=0;Ext.each(this.items,function(b,c){Ext.apply(b,{group:b.group||this.id,itemIndex:c,checkHandler:this.checkHandler,scope:this,checked:b.checked||!1}),this.menu.items.push(b),b.checked&&(a=c)},this),Ext.CycleButton.superclass.initComponent.call(this),this.on("click",this.toggleSelected,this),this.setActiveItem(a,!0)},checkHandler:function(a,b){b&&this.setActiveItem(a)},toggleSelected:function(){var a=this.menu;a.render(),a.hasLayout||a.doLayout();var b,c;for(var d=1;d<this.itemCount;d++){b=(this.activeItem.itemIndex+d)%this.itemCount,c=a.items.itemAt(b);if(!c.disabled){c.setChecked(!0);break}}}}),Ext.reg("cycle",Ext.CycleButton),Ext.TabPanel=Ext.extend(Ext.Panel,{deferredRender:!0,tabWidth:120,minTabWidth:30,resizeTabs:!1,enableTabScroll:!1,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:.35,animScroll:!0,tabPosition:"top",baseCls:"x-tab-panel",autoTabs:!1,autoTabSelector:"div.x-tab",activeTab:undefined,tabMargin:2,plain:!1,wheelIncrement:20,idDelimiter:"__",itemCls:"x-tab-item",elements:"body",headerAsText:!1,frame:!1,hideBorders:!0,initComponent:function(){this.frame=!1,Ext.TabPanel.superclass.initComponent.call(this),this.addEvents("beforetabchange","tabchange","contextmenu"),this.setLayout(new Ext.layout.CardLayout(Ext.apply({layoutOnCardChange:this.layoutOnTabChange,deferredRender:this.deferredRender},this.layoutConfig))),this.tabPosition=="top"?(this.elements+=",header",this.stripTarget="header"):(this.elements+=",footer",this.stripTarget="footer"),this.stack||(this.stack=Ext.TabPanel.AccessStack()),this.initItems()},onRender:function(a,b){Ext.TabPanel.superclass.onRender.call(this,a,b);if(this.plain){var c=this.tabPosition=="top"?"header":"footer";this[c].addClass("x-tab-panel-"+c+"-plain")}var d=this[this.stripTarget];this.stripWrap=d.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});var e=this.tabPosition=="bottom"?this.stripWrap:null;d.createChild({cls:"x-tab-strip-spacer"},e),this.strip=new Ext.Element(this.stripWrap.dom.firstChild),this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge",cn:[{tag:"span",cls:"x-tab-strip-text",cn:"&#160;"}]}),this.strip.createChild({cls:"x-clear"}),this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var f=new Ext.Template('<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>','<a class="x-tab-right" href="#"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',"</em></a></li>");f.disableFormats=!0,f.compile(),Ext.TabPanel.prototype.itemTpl=f}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this),this.autoTabs&&this.readTabs(!1);if(this.activeTab!==undefined){var a=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab,this.setActiveTab(a)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this),this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu}),this.enableTabScroll&&this.mon(this.strip,"mousewheel",this.onWheel,this)},findTargets:function(a){var b=null,c=a.getTarget("li:not(.x-tab-edge)",this.strip);if(c){b=this.getComponent(c.id.split(this.idDelimiter)[1]);if(b.disabled)return{close:null,item:null,el:null}}return{close:a.getTarget(".x-tab-strip-close",this.strip),item:b,el:c}},onStripMouseDown:function(a){if(a.button!==0)return;a.preventDefault();var b=this.findTargets(a);if(b.close){b.item.fireEvent("beforeclose",b.item)!==!1&&(b.item.fireEvent("close",b.item),this.remove(b.item));return}b.item&&b.item!=this.activeTab&&this.setActiveTab(b.item)},onStripContextMenu:function(a){a.preventDefault();var b=this.findTargets(a);b.item&&this.fireEvent("contextmenu",this,b.item,a)},readTabs:function(a){a===!0&&this.items.each(function(a){this.remove(a)},this);var b=this.el.query(this.autoTabSelector);for(var c=0,d=b.length;c<d;c++){var e=b[c],f=e.getAttribute("title");e.removeAttribute("title"),this.add({title:f,contentEl:e})}},initTab:function(a,b){var c=this.strip.dom.childNodes[b],d=this.getTemplateArgs(a),e=c?this.itemTpl.insertBefore(c,d):this.itemTpl.append(this.strip,d),f="x-tab-strip-over",g=Ext.get(e);g.hover(function(){a.disabled||g.addClass(f)},function(){g.removeClass(f)}),a.tabTip&&(g.child("span.x-tab-strip-text",!0).qtip=a.tabTip),a.tabEl=e,g.select("a").on("click",function(a){a.getPageX()||this.onStripMouseDown(a)},this,{preventDefault:!0}),a.on({scope:this,disable:this.onItemDisabled,enable:this.onItemEnabled,titlechange:this.onItemTitleChanged,iconchange:this.onItemIconChanged,beforeshow:this.onBeforeShowItem})},getTemplateArgs:function(a){var b=a.closable?"x-tab-strip-closable":"";return a.disabled&&(b+=" x-item-disabled"),a.iconCls&&(b+=" x-tab-with-icon"),a.tabCls&&(b+=" "+a.tabCls),{id:this.id+this.idDelimiter+a.getItemId(),text:a.title,cls:b,iconCls:a.iconCls||""}},onAdd:function(a){Ext.TabPanel.superclass.onAdd.call(this,a);if(this.rendered){var b=this.items;this.initTab(a,b.indexOf(a)),this.delegateUpdates()}},onBeforeAdd:function(a){var b=a.events?this.items.containsKey(a.getItemId())?a:null:this.items.get(a);if(b)return this.setActiveTab(a),!1;Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var c=a.elements;a.elements=c?c.replace(",header",""):c,a.border=a.border===!0},onRemove:function(a){var b=Ext.get(a.tabEl);b&&(b.select("a").removeAllListeners(),Ext.destroy(b)),Ext.TabPanel.superclass.onRemove.call(this,a),this.stack.remove(a),delete a.tabEl,a.un("disable",this.onItemDisabled,this),a.un("enable",this.onItemEnabled,this),a.un("titlechange",this.onItemTitleChanged,this),a.un("iconchange",this.onItemIconChanged,this),a.un("beforeshow",this.onBeforeShowItem,this);if(a==this.activeTab){var c=this.stack.next();c?this.setActiveTab(c):this.items.getCount()>0?this.setActiveTab(0):this.setActiveTab(null)}this.destroying||this.delegateUpdates()},onBeforeShowItem:function(a){if(a!=this.activeTab)return this.setActiveTab(a),!1},onItemDisabled:function(a){var b=this.getTabEl(a);b&&Ext.fly(b).addClass("x-item-disabled"),this.stack.remove(a)},onItemEnabled:function(a){var b=this.getTabEl(a);b&&Ext.fly(b).removeClass("x-item-disabled")},onItemTitleChanged:function(a){var b=this.getTabEl(a);b&&(Ext.fly(b).child("span.x-tab-strip-text",!0).innerHTML=a.title)},onItemIconChanged:function(a,b,c){var d=this.getTabEl(a);d&&(d=Ext.get(d),d.child("span.x-tab-strip-text").replaceClass(c,b),d[Ext.isEmpty(b)?"removeClass":"addClass"]("x-tab-with-icon"))},getTabEl:function(a){var b=this.getComponent(a);return b?b.tabEl:null},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments),this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=!0},endUpdate:function(){this.suspendUpdates=!1,this.delegateUpdates()},hideTabStripItem:function(a){a=this.getComponent(a);var b=this.getTabEl(a);b&&(b.style.display="none",this.delegateUpdates()),this.stack.remove(a)},unhideTabStripItem:function(a){a=this.getComponent(a);var b=this.getTabEl(a);b&&(b.style.display="",this.delegateUpdates())},delegateUpdates:function(){if(this.suspendUpdates)return;this.resizeTabs&&this.rendered&&this.autoSizeTabs(),this.enableTabScroll&&this.rendered&&this.autoScrollTabs()},autoSizeTabs:function(){var a=this.items.length,b=this.tabPosition!="bottom"?"header":"footer",c=this[b].dom.offsetWidth,d=this[b].dom.clientWidth;if(!this.resizeTabs||a<1||!d)return;var e=Math.max(Math.min(Math.floor((d-4)/a)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=e;var f=this.strip.query("li:not(.x-tab-edge)");for(var g=0,h=f.length;g<h;g++){var i=f[g],j=Ext.fly(i).child(".x-tab-strip-inner",!0),k=i.offsetWidth,l=j.offsetWidth;j.style.width=e-(k-l)+"px"}},adjustBodyWidth:function(a){return this.header&&this.header.setWidth(a),this.footer&&this.footer.setWidth(a),a},setActiveTab:function(a){a=this.getComponent(a);if(this.fireEvent("beforetabchange",this,a,this.activeTab)===!1)return;if(!this.rendered){this.activeTab=a;return}if(this.activeTab!=a){if(this.activeTab){var b=this.getTabEl(this.activeTab);b&&Ext.fly(b).removeClass("x-tab-strip-active")}this.activeTab=a;if(a){var c=this.getTabEl(a);Ext.fly(c).addClass("x-tab-strip-active"),this.stack.add(a),this.layout.setActiveItem(a),this.scrolling&&this.scrollToTab(a,this.animScroll)}this.
fireEvent("tabchange",this,a)}},getActiveTab:function(){return this.activeTab||null},getItem:function(a){return this.getComponent(a)},autoScrollTabs:function(){this.pos=this.tabPosition=="bottom"?this.footer:this.header;var a=this.items.length,b=this.pos.dom.offsetWidth,c=this.pos.dom.clientWidth,d=this.stripWrap,e=d.dom,f=e.offsetWidth,g=this.getScrollPos(),h=this.edge.getOffsetsTo(this.stripWrap)[0]+g;if(!this.enableTabScroll||a<1||f<20)return;if(h<=c){e.scrollLeft=0,d.setWidth(c);if(this.scrolling){this.scrolling=!1,this.pos.removeClass("x-tab-scrolling"),this.scrollLeft.hide(),this.scrollRight.hide();if(Ext.isAir||Ext.isWebKit)e.style.marginLeft="",e.style.marginRight=""}}else{if(!this.scrolling){this.pos.addClass("x-tab-scrolling");if(Ext.isAir||Ext.isWebKit)e.style.marginLeft="18px",e.style.marginRight="18px"}c-=d.getMargins("lr"),d.setWidth(c>20?c:20),this.scrolling||(this.scrollLeft?(this.scrollLeft.show(),this.scrollRight.show()):this.createScrollers()),this.scrolling=!0,g>h-c?e.scrollLeft=h-c:this.scrollToTab(this.activeTab,!1),this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var a=this.stripWrap.dom.offsetHeight,b=this.pos.insertFirst({cls:"x-tab-scroller-left"});b.setHeight(a),b.addClassOnOver("x-tab-scroller-left-over"),this.leftRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this}),this.scrollLeft=b;var c=this.pos.insertFirst({cls:"x-tab-scroller-right"});c.setHeight(a),c.addClassOnOver("x-tab-scroller-right-over"),this.rightRepeater=new Ext.util.ClickRepeater(c,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this}),this.scrollRight=c},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(a,b){if(!a)return;var c=this.getTabEl(a),d=this.getScrollPos(),e=this.getScrollArea(),f=Ext.fly(c).getOffsetsTo(this.stripWrap)[0]+d,g=f+c.offsetWidth;f<d?this.scrollTo(f,b):g>d+e&&this.scrollTo(g-e,b)},scrollTo:function(a,b){this.stripWrap.scrollTo("left",a,b?this.getScrollAnim():!1),b||this.updateScrollButtons()},onWheel:function(a){var b=a.getWheelDelta()*this.wheelIncrement*-1;a.stopEvent();var c=this.getScrollPos(),d=c+b,e=this.getScrollWidth()-this.getScrollArea(),f=Math.max(0,Math.min(e,d));f!=c&&this.scrollTo(f,!1)},onScrollRight:function(){var a=this.getScrollWidth()-this.getScrollArea(),b=this.getScrollPos(),c=Math.min(a,b+this.getScrollIncrement());c!=b&&this.scrollTo(c,this.animScroll)},onScrollLeft:function(){var a=this.getScrollPos(),b=Math.max(0,a-this.getScrollIncrement());b!=a&&this.scrollTo(b,this.animScroll)},updateScrollButtons:function(){var a=this.getScrollPos();this.scrollLeft[a===0?"addClass":"removeClass"]("x-tab-scroller-left-disabled"),this.scrollRight[a>=this.getScrollWidth()-this.getScrollArea()?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){Ext.destroy(this.leftRepeater,this.rightRepeater),this.deleteMembers("strip","edge","scrollLeft","scrollRight","stripWrap"),this.activeTab=null,Ext.TabPanel.superclass.beforeDestroy.apply(this)}}),Ext.reg("tabpanel",Ext.TabPanel),Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab,Ext.TabPanel.AccessStack=function(){var a=[];return{add:function(b){a.push(b),a.length>10&&a.shift()},remove:function(b){var c=[];for(var d=0,e=a.length;d<e;d++)a[d]!=b&&c.push(a[d]);a=c},next:function(){return a.pop()}}},Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:!0,quickShowInterval:250,frame:!0,hidden:!0,baseCls:"x-tip",floating:{shadow:!0,shim:!0,useDisplay:!0,constrain:!1},autoHeight:!0,closeAction:"hide",initComponent:function(){Ext.Tip.superclass.initComponent.call(this),this.closable&&!this.title&&(this.elements+=",header")},afterRender:function(){Ext.Tip.superclass.afterRender.call(this),this.closable&&this.addTool({id:"close",handler:this[this.closeAction],scope:this})},showAt:function(a){Ext.Tip.superclass.show.call(this),this.measureWidth!==!1&&(!this.initialConfig||typeof this.initialConfig.width!="number")&&this.doAutoWidth(),this.constrainPosition&&(a=this.el.adjustForConstraints(a)),this.setPagePosition(a[0],a[1])},doAutoWidth:function(a){a=a||0;var b=this.body.getTextWidth();this.title&&(b=Math.max(b,this.header.child("span").getTextWidth(this.title))),b+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr")+a,this.setWidth(b.constrain(this.minWidth,this.maxWidth)),Ext.isIE7&&!this.repainted&&(this.el.repaint(),this.repainted=!0)},showBy:function(a,b){this.rendered||this.render(Ext.getBody()),this.showAt(this.el.getAlignToXY(a,b||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable),this.header.addClass("x-tip-draggable")}}),Ext.reg("tip",Ext.Tip),Ext.Tip.DD=function(a,b){Ext.apply(this,b),this.tip=a,Ext.Tip.DD.superclass.constructor.call(this,a.el.id,"WindowDD-"+a.id),this.setHandleElId(a.header.id),this.scroll=!1},Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:!0,scroll:!1,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(a){this.tip.el.enableShadow(!0)}}),Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5e3,trackMouse:!1,anchorToTarget:!0,anchorOffset:0,targetCounter:0,constrainPosition:!1,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this),this.lastActive=new Date,this.initTarget(this.target),this.origAnchor=this.anchor},onRender:function(a,b){Ext.ToolTip.superclass.onRender.call(this,a,b),this.anchorCls="x-tip-anchor-"+this.getAnchorPosition(),this.anchorEl=this.el.createChild({cls:"x-tip-anchor "+this.anchorCls})},afterRender:function(){Ext.ToolTip.superclass.afterRender.call(this),this.anchorEl.setStyle("z-index",this.el.getZIndex()+1)},initTarget:function(a){var b;if(b=Ext.get(a)){if(this.target){var c=Ext.get(this.target);this.mun(c,"mouseover",this.onTargetOver,this),this.mun(c,"mouseout",this.onTargetOut,this),this.mun(c,"mousemove",this.onMouseMove,this)}this.mon(b,{mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this}),this.target=b}this.anchor&&(this.anchorTarget=this.target)},onMouseMove:function(a){var b=this.delegate?a.getTarget(this.delegate):this.triggerElement=!0;b?(this.targetXY=a.getXY(),b===this.triggerElement?!this.hidden&&this.trackMouse&&this.setPagePosition(this.getTargetXY()):(this.hide(),this.lastActive=new Date(0),this.onTargetOver(a))):!this.closable&&this.isVisible()&&this.hide()},getTargetXY:function(){this.delegate&&(this.anchorTarget=this.triggerElement);if(this.anchor){this.targetCounter++;var a=this.getOffsets(),b=this.anchorToTarget&&!this.trackMouse?this.el.getAlignToXY(this.anchorTarget,this.getAnchorAlign()):this.targetXY,c=Ext.lib.Dom.getViewWidth()-5,d=Ext.lib.Dom.getViewHeight()-5,e=document.documentElement,f=document.body,g=(e.scrollLeft||f.scrollLeft||0)+5,h=(e.scrollTop||f.scrollTop||0)+5,i=[b[0]+a[0],b[1]+a[1]],j=this.getSize();this.anchorEl.removeClass(this.anchorCls);if(this.targetCounter<2){if(i[0]<g)return this.anchorToTarget&&(this.defaultAlign="l-r",this.mouseOffset&&(this.mouseOffset[0]*=-1)),this.anchor="left",this.getTargetXY();if(i[0]+j.width>c)return this.anchorToTarget&&(this.defaultAlign="r-l",this.mouseOffset&&(this.mouseOffset[0]*=-1)),this.anchor="right",this.getTargetXY();if(i[1]<h)return this.anchorToTarget&&(this.defaultAlign="t-b",this.mouseOffset&&(this.mouseOffset[1]*=-1)),this.anchor="top",this.getTargetXY();if(i[1]+j.height>d)return this.anchorToTarget&&(this.defaultAlign="b-t",this.mouseOffset&&(this.mouseOffset[1]*=-1)),this.anchor="bottom",this.getTargetXY()}return this.anchorCls="x-tip-anchor-"+this.getAnchorPosition(),this.anchorEl.addClass(this.anchorCls),this.targetCounter=0,i}var k=this.getMouseOffset();return[this.targetXY[0]+k[0],this.targetXY[1]+k[1]]},getMouseOffset:function(){var a=this.anchor?[0,0]:[15,18];return this.mouseOffset&&(a[0]+=this.mouseOffset[0],a[1]+=this.mouseOffset[1]),a},getAnchorPosition:function(){if(this.anchor)this.tipAnchor=this.anchor.charAt(0);else{var a=this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!a)throw"AnchorTip.defaultAlign is invalid";this.tipAnchor=a[1].charAt(0)}switch(this.tipAnchor){case"t":return"top";case"b":return"bottom";case"r":return"right"}return"left"},getAnchorAlign:function(){switch(this.anchor){case"top":return"tl-bl";case"left":return"tl-tr";case"right":return"tr-tl";default:return"bl-tl"}},getOffsets:function(){var a,b=this.getAnchorPosition().charAt(0);if(this.anchorToTarget&&!this.trackMouse)switch(b){case"t":a=[0,9];break;case"b":a=[0,-13];break;case"r":a=[-13,0];break;default:a=[9,0]}else switch(b){case"t":a=[-15-this.anchorOffset,30];break;case"b":a=[-19-this.anchorOffset,-13-this.el.dom.offsetHeight];break;case"r":a=[-15-this.el.dom.offsetWidth,-13-this.anchorOffset];break;default:a=[25,-13-this.anchorOffset]}var c=this.getMouseOffset();return a[0]+=c[0],a[1]+=c[1],a},onTargetOver:function(a){if(this.disabled||a.within(this.target.dom,!0))return;var b=a.getTarget(this.delegate);b&&(this.triggerElement=b,this.clearTimer("hide"),this.targetXY=a.getXY(),this.delayShow())},delayShow:function(){this.hidden&&!this.showTimer?this.lastActive.getElapsed()<this.quickShowInterval?this.show():this.showTimer=this.show.defer(this.showDelay,this):!this.hidden&&this.autoHide!==!1&&this.show()},onTargetOut:function(a){if(this.disabled||a.within(this.target.dom,!0))return;this.clearTimer("show"),this.autoHide!==!1&&this.delayHide()},delayHide:function(){!this.hidden&&!this.hideTimer&&(this.hideTimer=this.hide.defer(this.hideDelay,this))},hide:function(){this.clearTimer("dismiss"),this.lastActive=new Date,this.anchorEl&&this.anchorEl.hide(),Ext.ToolTip.superclass.hide.call(this),delete this.triggerElement},show:function(){this.anchor&&(this.showAt([-1e3,-1e3]),this.origConstrainPosition=this.constrainPosition,this.constrainPosition=!1,this.anchor=this.origAnchor),this.showAt(this.getTargetXY()),this.anchor?(this.syncAnchor(),this.anchorEl.show(),this.constrainPosition=this.origConstrainPosition):this.anchorEl.hide()},showAt:function(a){this.lastActive=new Date,this.clearTimers(),Ext.ToolTip.superclass.showAt.call(this,a),this.dismissDelay&&this.autoHide!==!1&&(this.dismissTimer=this.hide.defer(this.dismissDelay,this)),this.anchor&&!this.anchorEl.isVisible()&&(this.syncAnchor(),this.anchorEl.show())},syncAnchor:function(){var a,b,c;switch(this.tipAnchor.charAt(0)){case"t":a="b",b="tl",c=[20+this.anchorOffset,2];break;case"r":a="l",b="tr",c=[-2,11+this.anchorOffset];break;case"b":a="t",b="bl",c=[20+this.anchorOffset,-2];break;default:a="r",b="tl",c=[2,11+this.anchorOffset]}this.anchorEl.alignTo(this.el,a+"-"+b,c)},setPagePosition:function(a,b){Ext.ToolTip.superclass.setPagePosition.call(this,a,b),this.anchor&&this.syncAnchor()},clearTimer:function(a){a=a+"Timer",clearTimeout(this[a]),delete this[a]},clearTimers:function(){this.clearTimer("show"),this.clearTimer("dismiss"),this.clearTimer("hide")},onShow:function(){Ext.ToolTip.superclass.onShow.call(this),Ext.getDoc().on("mousedown",this.onDocMouseDown,this)},onHide:function(){Ext.ToolTip.superclass.onHide.call(this),Ext.getDoc().un("mousedown",this.onDocMouseDown,this)},onDocMouseDown:function(a){this.autoHide!==!0&&!this.closable&&!a.within(this.el.dom)&&(this.disable(),this.doEnable.defer(100,this))},doEnable:function(){this.isDestroyed||this.enable()},onDisable:function(){this.clearTimers(),this.hide()},adjustPosition:function(a,b){if(this.contstrainPosition){var c=this.targetXY[1],d=this.getSize().height;b<=c&&b+d>=c&&(b=c-d-5)}return{x:a,y:b}},beforeDestroy:function(){this.clearTimers(),Ext.destroy(this.anchorEl),delete this.anchorEl,delete this.target,delete this.anchorTarget,delete this.triggerElement,Ext.ToolTip.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.getDoc().un("mousedown",this.onDocMouseDown,this),Ext.ToolTip.superclass.onDestroy.call(this)}}),Ext.reg("tooltip",Ext.ToolTip),Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:!1,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign",anchor:"anchor"},initComponent:function(){this.target=this.target||Ext.getDoc(),this.targets=this.targets||{},Ext.QuickTip.superclass.initComponent.call(this)},register:function(a){var b=Ext.isArray(a)?a:arguments;for(var c=0,d=b.length;c<d;c++){var e=b[c],f=e.target;if(f)if(Ext.isArray(f))for(var g=0,h=f.length;g<h;g++)this.targets[Ext.id(f[g])]=e;else this.targets[Ext.id(f)]=e}},unregister:function(a){delete this.targets[Ext.id(a)]},cancelShow:function(a){var b=this.activeTarget;a=Ext.get(a).dom,this.isVisible()?b&&b.el==a&&this.hide():b&&b.el==a&&this.clearTimer("show")},getTipCfg:function(a){var b=a.getTarget(),c,d;return this.interceptTitles&&b.title&&Ext.isString(b.title)?(c=b.title,b.qtip=c,b.removeAttribute("title"),a.preventDefault()):(d=this.tagConfig,c=b.qtip||Ext.fly(b).getAttribute(d.attribute,d.namespace)),c},onTargetOver:function(a){if(this.disabled)return;this.targetXY=a.getXY();var b=a.getTarget();if(!b||b.nodeType!==1||b==document||b==document.body)return;if(this.activeTarget&&(b==this.activeTarget.el||Ext.fly(this.activeTarget.el).contains(b))){this.clearTimer("hide"),this.show();return}if(b&&this.targets[b.id]){this.activeTarget=this.targets[b.id],this.activeTarget.el=b,this.anchor=this.activeTarget.anchor,this.anchor&&(this.anchorTarget=b),this.delayShow();return}var c,d=Ext.fly(b),e=this.tagConfig,f=e.namespace;if(c=this.getTipCfg(a)){var g=d.getAttribute(e.hide,f);this.activeTarget={el:b,text:c,width:d.getAttribute(e.width,f),autoHide:g!="user"&&g!=="false",title:d.getAttribute(e.title,f),cls:d.getAttribute(e.cls,f),align:d.getAttribute(e.align,f)},this.anchor=d.getAttribute(e.anchor,f),this.anchor&&(this.anchorTarget=b),this.delayShow()}},onTargetOut:function(a){if(this.activeTarget&&a.within(this.activeTarget.el)&&!this.getTipCfg(a))return;this.clearTimer("show"),this.autoHide!==!1&&this.delayHide()},showAt:function(a){var b=this.activeTarget;b&&(this.rendered||(this.render(Ext.getBody()),this.activeTarget=b),b.width?(this.setWidth(b.width),this.body.setWidth(this.adjustBodyWidth(b.width-this.getFrameWidth())),this.measureWidth=!1):this.measureWidth=!0,this.setTitle(b.title||""),this.body.update(b.text),this.autoHide=b.autoHide,this.dismissDelay=b.dismissDelay||this.dismissDelay,this.lastCls&&(this.el.removeClass(this.lastCls),delete this.lastCls),b.cls&&(this.el.addClass(b.cls),this.lastCls=b.cls),this.anchor?this.constrainPosition=!1:b.align?(a=this.el.getAlignToXY(b.el,b.align),this.constrainPosition=!1):this.constrainPosition=!0),Ext.QuickTip.superclass.showAt.call(this,a)},hide:function(){delete this.activeTarget,Ext.QuickTip.superclass.hide.call(this)}}),Ext.reg("quicktip",Ext.QuickTip),Ext.QuickTips=function(){var a,b=[];return{init:function(b){if(!a){if(!Ext.isReady){Ext.onReady(function(){Ext.QuickTips.init(b)});return}a=new Ext.QuickTip({elements:"header,body"}),b!==!1&&a.render(Ext.getBody())}},enable:function(){a&&(b.pop(),b.length<1&&a.enable())},disable:function(){a&&a.disable(),b.push(1)},isEnabled:function(){return a!==undefined&&!a.disabled},getQuickTip:function(){return a},register:function(){a.register.apply(a,arguments)},unregister:function(){a.unregister.apply(a,arguments)},tips:function(){a.register.apply(a,arguments)}}}(),Ext.slider.Tip=Ext.extend(Ext.Tip,{minWidth:10,offsets:[0,-10],init:function(a){a.on({scope:this,dragstart:this.onSlide,drag:this.onSlide,dragend:this.hide,destroy:this.destroy})},onSlide:function(a,b,c){this.show(),this.body.update(this.getText(c)),this.doAutoWidth(),this.el.alignTo(c.el,"b-t?",this.offsets)},getText:function(a){return String(a.value)}}),Ext.ux.SliderTip=Ext.slider.Tip,Ext.tree.TreePanel=Ext.extend(Ext.Panel,{rootVisible:!0,animate:Ext.enableFx,lines:!0,enableDD:!1,hlDrop:Ext.enableFx,pathSeparator:"/",bubbleEvents:[],initComponent:function(){Ext.tree.TreePanel.superclass.initComponent.call(this),this.eventModel||(this.eventModel=new Ext.tree.TreeEventModel(this));var a=this.loader;a?Ext.isObject(a)&&!a.load&&(a=new Ext.tree.TreeLoader(a)):a=new Ext.tree.TreeLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod}),this.loader=a,this.nodeHash={};if(this.root){var b=this.root;delete this.root,this.setRootNode(b)}this.addEvents("append","remove","movenode","insert","beforeappend","beforeremove","beforemovenode","beforeinsert","beforeload","load","textchange","beforeexpandnode","beforecollapsenode","expandnode","disabledchange","collapsenode","beforeclick","click","containerclick","checkchange","beforedblclick","dblclick","containerdblclick","contextmenu","containercontextmenu","beforechildrenrendered","startdrag","enddrag","dragdrop","beforenodedrop","nodedrop","nodedragover"),this.singleExpand&&this.on("beforeexpandnode",this.restrictExpand,this)},proxyNodeEvent:function(a,b,c,d,e,f,g){if(a=="collapse"||a=="expand"||a=="beforecollapse"||a=="beforeexpand"||a=="move"||a=="beforemove")a=a+"node";return this.fireEvent(a,b,c,d,e,f,g)},getRootNode:function(){return this.root},setRootNode:function(a){this.destroyRoot(),a.render||(a=this.loader.createNode(a)),this.root=a,a.ownerTree=this,a.isRoot=!0,this.registerNode(a);if(!this.rootVisible){var b=a.attributes.uiProvider;a.ui=b?new b(a):new Ext.tree.RootTreeNodeUI(a)}return this.innerCt&&(this.clearInnerCt(),this.renderRoot()),a},clearInnerCt:function(){this.innerCt.update("")},renderRoot:function(){this.root.render(),this.rootVisible||this.root.renderChildren()},getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"},restrictExpand:function(a){var b=a.parentNode;b&&(b.expandedChild&&b.expandedChild.parentNode==b&&b.expandedChild.collapse(),b.expandedChild=a)},getChecked:function(a,b){b=b||this.root;var c=[],d=function(){this.attributes.checked&&c.push(a?a=="id"?this.id:this.attributes[a]:this)};return b.cascade(d),c},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(!0)},collapseAll:function(){this.root.collapse(!0)},getSelectionModel:function(){return this.selModel||(this.selModel=new Ext.tree.DefaultSelectionModel),this.selModel},expandPath:function(a,b,c){b=b||"id";var d=a.split(this.pathSeparator),e=this.root;if(e.attributes[b]!=d[1]){c&&c(!1,null);return}var f=1,g=function(){if(++f==d.length){c&&c(!0,e);return}var a=e.findChild(b,d[f]);if(!a){c&&c(!1,e);return}e=a,a.expand(!1,!1,g)};e.expand(!1,!1,g)},selectPath:function(a,b,c){b=b||"id";var d=a.split(this.pathSeparator),e=d.pop();if(d.length>1){var f=function(a,d){if(a&&d){var f=d.findChild(b,e);f?(f.select(),c&&c(!0,f)):c&&c(!1,f)}else c&&c(!1,f)};this.expandPath(d.join(this.pathSeparator),b,f)}else this.root.select(),c&&c(!0,this.root)},getTreeEl:function(){return this.body},onRender:function(a,b){Ext.tree.TreePanel.superclass.onRender.call(this,a,b),this.el.addClass("x-tree"),this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this),this.containerScroll&&Ext.dd.ScrollManager.register(this.body),(this.enableDD||this.enableDrop)&&!this.dropZone&&(this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===!0})),(this.enableDD||this.enableDrag)&&!this.dragZone&&(this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})),this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this),this.renderRoot()},beforeDestroy:function(){this.rendered&&(Ext.dd.ScrollManager.unregister(this.body),Ext.destroy(this.dropZone,this.dragZone)),this.destroyRoot(),Ext.destroy(this.loader),this.nodeHash=this.root=this.loader=null,Ext.tree.TreePanel.superclass.beforeDestroy.call(this)},destroyRoot:function(){this.root&&this.root.destroy&&this.root.destroy(!0)}}),Ext.tree.TreePanel.nodeTypes={},Ext.reg("treepanel",Ext.tree.TreePanel),Ext.tree.TreeEventModel=function(a){this.tree=a,this.tree.on("render",this.initEvents,this)},Ext.tree.TreeEventModel.prototype={initEvents:function(){var a=this.tree;a.trackMouseOver!==!1&&a.mon(a.innerCt,{scope:this,mouseover:this.delegateOver,mouseout:this.delegateOut}),a.mon(a.getTreeEl(),{scope:this,click:this.delegateClick,dblclick:this.delegateDblClick,contextmenu:this.delegateContextMenu})},getNode:function(a){var b;if(b=a.getTarget(".x-tree-node-el",10)){var c=Ext.fly(b,"_treeEvents").getAttribute("tree-node-id","ext");if(c)return this.tree.getNodeById(c)}return null},getNodeTarget:function(a){var b=a.getTarget(".x-tree-node-icon",1);return b||(b=a.getTarget(".x-tree-node-el",6)),b},delegateOut:function(a,b){if(!this.beforeEvent(a))return;if(a.getTarget(".x-tree-ec-icon",1)){var c=this.getNode(a);this.onIconOut(a,c),c==this.lastEcOver&&delete this.lastEcOver}(b=this.getNodeTarget(a))&&!a.within(b,!0)&&this.onNodeOut(a,this.getNode(a))},delegateOver:function(a,b){if(!this.beforeEvent(a))return;Ext.isGecko&&!this.trackingDoc&&(Ext.getBody().on("mouseover",this.trackExit,this),this.trackingDoc=!0),this.lastEcOver&&(this.onIconOut(a,this.lastEcOver),delete this.lastEcOver),a.getTarget(".x-tree-ec-icon",1)&&(this.lastEcOver=this.getNode(a),this.onIconOver(a,this.lastEcOver)),(b=this.getNodeTarget(a))&&this.onNodeOver(a,this.getNode(a))},trackExit:function(a){this.lastOverNode&&(this.lastOverNode.ui&&!a.within(this.lastOverNode.ui.getEl())&&this.onNodeOut(a,this.lastOverNode),delete this.lastOverNode,Ext.getBody().un("mouseover",this.trackExit,this),this.trackingDoc=!1)},delegateClick:function(a,b){this.beforeEvent(a)?a.getTarget("input[type=checkbox]",1)?this.onCheckboxClick(a,this.getNode(a)):a.getTarget(".x-tree-ec-icon",1)?this.onIconClick(a,this.getNode(a)):this.getNodeTarget(a)&&this.onNodeClick(a,this.getNode(a)):this.checkContainerEvent(a,"click")},delegateDblClick:function(a,b){this.beforeEvent(a)?this.getNodeTarget(a)&&this.onNodeDblClick(a,this.getNode(a)):this.checkContainerEvent(a,"dblclick")},delegateContextMenu:function(a,b){this.beforeEvent(a)?this.getNodeTarget(a)&&this.onNodeContextMenu(a,this.getNode(a)):this.checkContainerEvent(a,"contextmenu")},checkContainerEvent:function(a,b){if(this.disabled)return a.stopEvent(),!1;this.onContainerEvent(a,b)},onContainerEvent:function(a,b){this.tree.fireEvent("container"+b,this.tree,a)},onNodeClick:function(a,b){b.ui.onClick(a)},onNodeOver:function(a,b){this.lastOverNode=b,b.ui.onOver(a)},onNodeOut:function(a,b){b.ui.onOut(a)},onIconOver:function(a,b){b.ui.addClass("x-tree-ec-over")},onIconOut:function(a,b){b.ui.removeClass("x-tree-ec-over")},onIconClick:function(a,b){b.ui.ecClick(a)},onCheckboxClick:function(a,b){b.ui.onCheckChange(a)},onNodeDblClick:function(a,b){b.ui.onDblClick(a)},onNodeContextMenu:function(a,b){b.ui.onContextMenu(a)},beforeEvent:function(a){var b=this.getNode(a);return this.disabled||!b||!b.ui?(a.stopEvent(),!1):!0},disable:function(){this.disabled=!0},enable:function(){this.disabled=!1}},Ext.tree.DefaultSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNode=null,this.addEvents("selectionchange","beforeselect"),Ext.apply(this,a),Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a,a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this),a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){this.select(a)},select:function(a,b){if(!Ext.fly(a.ui.wrap).isVisible()&&b)return b.call(this,a);var c=this.selNode;return a==c?a.ui.onSelectedChange(!0):this.fireEvent("beforeselect",this,a,c)!==!1&&(c&&c.ui&&c.ui.onSelectedChange(!1),this.selNode=a,a.ui.onSelectedChange(!0),this.fireEvent("selectionchange",this,a,c)),a},unselect:function(a,b){this.selNode==a&&this.clearSelections(b)},clearSelections:function(a){var b=this.selNode;return b&&(b.ui.onSelectedChange(!1),this.selNode=null,a!==!0&&this.fireEvent("selectionchange",this,null)),b},getSelectedNode:function(){return this.selNode},isSelected:function(a){return this.selNode==a},selectPrevious:function(a){if(!(a=a||this.selNode||this.lastSelNode))return null;var b=a.previousSibling;if(b){if(!b.isExpanded()||b.childNodes.length<1)return this.select(b,this.selectPrevious);var c=b.lastChild;while(c&&c.isExpanded()&&Ext.fly(c.ui.wrap).isVisible()&&c.childNodes.length>0)c=c.lastChild;return this.select(c,this.selectPrevious)}return a.parentNode&&(this.tree.rootVisible||!a.parentNode.isRoot)?this.select(a.parentNode,this.selectPrevious):null},selectNext:function(a){if(!(a=a||this.selNode||this.lastSelNode))return null;if(a.firstChild&&a.isExpanded()&&Ext.fly(a.ui.wrap).isVisible())return this.select(a.firstChild,this.selectNext);if(a.nextSibling)return this.select(a.nextSibling,this.selectNext);if(a.parentNode){var b=null;return a.parentNode.bubble(function(){if(this.nextSibling)return b=this.getOwnerTree().selModel.select(this.nextSibling,this.selectNext),!1}),b}return null},onKeyDown:function(a){var b=this.selNode||this.lastSelNode,c=this;if(!b)return;var d=a.getKey();switch(d){case a.DOWN:a.stopEvent(),this.selectNext();break;case a.UP:a.stopEvent(),this.selectPrevious();break;case a.RIGHT:a.preventDefault(),b.hasChildNodes()&&(b.isExpanded()?b.firstChild&&this.select(b.firstChild,a):b.expand());break;case a.LEFT:a.preventDefault(),b.hasChildNodes()&&b.isExpanded()?b.collapse():b.parentNode&&(this.tree.rootVisible||b.parentNode!=this.tree.getRootNode())&&this.select(b.parentNode,a)}}}),Ext.tree.MultiSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNodes=[],this.selMap={},this.addEvents("selectionchange"),Ext.apply(this,a),Ext.tree.MultiSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a,a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this),a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){b.ctrlKey&&this.isSelected(a)?this.unselect(a):this.select(a,b,b.ctrlKey)},select:function(a,b,c){return c!==!0&&this.clearSelections(!0),this.isSelected(a)?(this.lastSelNode=a,a):(this.selNodes.push(a),this.selMap[a.id]=a,this.lastSelNode=a,a.ui.onSelectedChange(!0),this.fireEvent("selectionchange",this,this.selNodes),a)},unselect:function(a){if(this.selMap[a.id]){a.ui.onSelectedChange(!1);var b=this.selNodes,c=b.indexOf(a);c!=-1&&this.selNodes.splice(c,1),delete this.selMap[a.id],this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(a){var b=this.selNodes;if(b.length>0){for(var c=0,d=b.length;c<d;c++)b[c].ui.onSelectedChange(!1);this.selNodes=[],this.selMap={},a!==!0&&this.fireEvent("selectionchange",this,this.selNodes)}},isSelected:function(a){return this.selMap[a.id]?!0:!1},getSelectedNodes:function(){return this.selNodes.concat([])},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious}),Ext.data.Tree=function(a){this.nodeHash={},this.root=null,a&&this.setRootNode(a),this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert"),Ext.data.Tree.superclass.constructor.call(this)},Ext.extend(Ext.data.Tree,Ext.util.Observable,{pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(a){return this.root=a,a.ownerTree=this,a.isRoot=!0,this.registerNode(a),a},getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"}}),Ext.data.Node=function(a){this.attributes=a||{},this.leaf=this.attributes.leaf,this.id=this.attributes.id,this.id||(this.id=Ext.id(null,"xnode-"),this.attributes.id=this.id),this.childNodes=[],this.childNodes.indexOf||(this.childNodes.indexOf=function(a){for(var b=0,c=this.length;b<c;b++)if(this[b]==a)return b;return-1}),this.parentNode=null,this.firstChild=null,this.lastChild=null,this.previousSibling=null,this.nextSibling=null,this.addEvents({append:!0,remove:!0,move:!0,insert:!0,beforeappend:!0,beforeremove:!0,beforemove:!0,beforeinsert:!0}),this.listeners=this.attributes.listeners,Ext.data.Node.superclass.constructor.call(this)},Ext.extend(Ext.data.Node,Ext.util.Observable,{fireEvent:function(a){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===!1)return!1;var b=this.getOwnerTree();return b&&b.proxyNodeEvent.apply(b,arguments)===!1?!1:!0},isLeaf:function(){return this.leaf===!0},setFirstChild:function(a){this.firstChild=a},setLastChild:function(a){this.lastChild=a},isLast:function(){return this.parentNode?this.parentNode.lastChild==this:!0},isFirst:function(){return this.parentNode?this.parentNode.firstChild==this:!0},hasChildNodes:function(){return!this.isLeaf()&&this.childNodes.length>0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(a){var b=!1;Ext.isArray(a)?b=a:arguments.length>1&&(b=arguments);if(!b){if(this.fireEvent("beforeappend",this.ownerTree,this,a)===!1)return!1;var e=this.childNodes.length,f=a.parentNode;if(f){if(a.fireEvent("beforemove",a.getOwnerTree(),a,f,this,e)===!1)return!1;f.removeChild(a)}e=this.childNodes.length,e===0&&this.setFirstChild(a),this.childNodes.push(a),a.parentNode=this;var g=this.childNodes[e-1];return g?(a.previousSibling=g,g.nextSibling=a):a.previousSibling=null,a.nextSibling=null,this.setLastChild(a),a.setOwnerTree(this.getOwnerTree()),this.fireEvent("append",this.ownerTree,this,a,e),f&&a.fireEvent("move",this.ownerTree,a,f,this,e),a}for(var c=0,d=b.length;c<d;c++)this.appendChild(b[c])},removeChild:function(a,b){var c=this.childNodes.indexOf(a);return c==-1?!1:this.fireEvent("beforeremove",this.ownerTree,this,a)===!1?!1:(this.childNodes.splice(c,1),a.previousSibling&&(a.previousSibling.nextSibling=a.nextSibling),a.nextSibling&&(a.nextSibling.previousSibling=a.previousSibling),this.firstChild==a&&this.setFirstChild(a.nextSibling),this.lastChild==a&&this.setLastChild(a.previousSibling),this.fireEvent("remove",this.ownerTree,this,a),b?a.destroy(!0):a.clear(),a)},clear:function(a){this.setOwnerTree(null,a),this.parentNode=this.previousSibling=this.nextSibling=null,a&&(this.firstChild=this.lastChild=null)},destroy:function(a){a===!0?(this.purgeListeners(),this.clear(!0),Ext.each(this.childNodes,function(a){a.destroy(!0)}),this.childNodes=null):this.remove(!0)},insertBefore:function(a,b){if(!b)return this.appendChild(a);if(a==b)return!1;if(this.fireEvent("beforeinsert",this.ownerTree,this,a,b)===!1)return!1;var c=this.childNodes.indexOf(b),d=a.parentNode,e=c;d==this&&this.childNodes.indexOf(a)<c&&e--;if(d){if(a.fireEvent("beforemove",a.getOwnerTree(),a,d,this,c,b)===!1)return!1;d.removeChild(a)}e===0&&this.setFirstChild(a),this.childNodes.splice(e,0,a),a.parentNode=this;var f=this.childNodes[e-1];return f?(a.previousSibling=f,f.nextSibling=a):a.previousSibling=null,a.nextSibling=b,b.previousSibling=a,a.setOwnerTree(this.getOwnerTree()),this.fireEvent("insert",this.ownerTree,this,a,b),d&&a.fireEvent("move",this.ownerTree,a,d,this,e,b),a},remove:function(a){return this.parentNode&&this.parentNode.removeChild(this,a),this},removeAll:function(a){var b=this.childNodes,c;while(c=b[0])this.removeChild(c,a);return this},item:function(a){return this.childNodes[a]},replaceChild:function(a,b){var c=b?b.nextSibling:null;return this.removeChild(b),this.insertBefore(a,c),b},indexOf:function(a){return this.childNodes.indexOf(a)},getOwnerTree:function(){if(!this.ownerTree){var a=this;while(a){if(a.ownerTree){this.ownerTree=a.ownerTree;break}a=a.parentNode}}return this.ownerTree},getDepth:function(){var a=0,b=this;while(b.parentNode)++a,b=b.parentNode;return a},setOwnerTree:function(a,b){a!=this.ownerTree&&(this.ownerTree&&this.ownerTree.unregisterNode(this),this.ownerTree=a,b!==!0&&Ext.each(this.childNodes,function(b){b.setOwnerTree(a)}),a&&a.registerNode(this))},setId:function(a){if(a!==this.id){var b=this.ownerTree;b&&b.unregisterNode(this
),this.id=this.attributes.id=a,b&&b.registerNode(this),this.onIdChange(a)}},onIdChange:Ext.emptyFn,getPath:function(a){a=a||"id";var b=this.parentNode,c=[this.attributes[a]];while(b)c.unshift(b.attributes[a]),b=b.parentNode;var d=this.getOwnerTree().pathSeparator;return d+c.join(d)},bubble:function(a,b,c){var d=this;while(d){if(a.apply(b||d,c||[d])===!1)break;d=d.parentNode}},cascade:function(a,b,c){if(a.apply(b||this,c||[this])!==!1){var d=this.childNodes;for(var e=0,f=d.length;e<f;e++)d[e].cascade(a,b,c)}},eachChild:function(a,b,c){var d=this.childNodes;for(var e=0,f=d.length;e<f;e++)if(a.apply(b||this,c||[d[e]])===!1)break},findChild:function(a,b,c){return this.findChildBy(function(){return this.attributes[a]==b},null,c)},findChildBy:function(a,b,c){var d=this.childNodes,e=d.length,f=0,g,h;for(;f<e;f++){g=d[f];if(a.call(b||g,g)===!0)return g;if(c){h=g.findChildBy(a,b,c);if(h!=null)return h}}return null},sort:function(a,b){var c=this.childNodes,d=c.length;if(d>0){var e=b?function(){a.apply(b,arguments)}:a;c.sort(e);for(var f=0;f<d;f++){var g=c[f];g.previousSibling=c[f-1],g.nextSibling=c[f+1],f===0&&this.setFirstChild(g),f==d-1&&this.setLastChild(g)}}},contains:function(a){return a.isAncestor(this)},isAncestor:function(a){var b=this.parentNode;while(b){if(b==a)return!0;b=b.parentNode}return!1},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}}),Ext.tree.TreeNode=function(a){a=a||{},Ext.isString(a)&&(a={text:a}),this.childrenRendered=!1,this.rendered=!1,Ext.tree.TreeNode.superclass.constructor.call(this,a),this.expanded=a.expanded===!0,this.isTarget=a.isTarget!==!1,this.draggable=a.draggable!==!1&&a.allowDrag!==!1,this.allowChildren=a.allowChildren!==!1&&a.allowDrop!==!1,this.text=a.text,this.disabled=a.disabled===!0,this.hidden=a.hidden===!0,this.addEvents("textchange","beforeexpand","beforecollapse","expand","disabledchange","collapse","beforeclick","click","checkchange","beforedblclick","dblclick","contextmenu","beforechildrenrendered");var b=this.attributes.uiProvider||this.defaultUI||Ext.tree.TreeNodeUI;this.ui=new b(this)},Ext.extend(Ext.tree.TreeNode,Ext.data.Node,{preventHScroll:!0,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},getLoader:function(){var a;return this.loader||((a=this.getOwnerTree())&&a.loader?a.loader:this.loader=new Ext.tree.TreeLoader)},setFirstChild:function(a){var b=this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,a),this.childrenRendered&&b&&a!=b&&b.renderIndent(!0,!0),this.rendered&&this.renderIndent(!0,!0)},setLastChild:function(a){var b=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,a),this.childrenRendered&&b&&a!=b&&b.renderIndent(!0,!0),this.rendered&&this.renderIndent(!0,!0)},appendChild:function(a){!a.render&&!Ext.isArray(a)&&(a=this.getLoader().createNode(a));var b=Ext.tree.TreeNode.superclass.appendChild.call(this,a);return b&&this.childrenRendered&&b.render(),this.ui.updateExpandIcon(),b},removeChild:function(a,b){return this.ownerTree.getSelectionModel().unselect(a),Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments),b||(a.ui.rendered&&a.ui.remove(),this.childNodes.length<1?this.collapse(!1,!1):this.ui.updateExpandIcon(),!this.firstChild&&!this.isHiddenRoot()&&(this.childrenRendered=!1)),a},insertBefore:function(a,b){a.render||(a=this.getLoader().createNode(a));var c=Ext.tree.TreeNode.superclass.insertBefore.call(this,a,b);return c&&b&&this.childrenRendered&&a.render(),this.ui.updateExpandIcon(),c},setText:function(a){var b=this.text;this.text=this.attributes.text=a,this.rendered&&this.ui.onTextChange(this,a,b),this.fireEvent("textchange",this,a,b)},select:function(){var a=this.getOwnerTree();a&&a.getSelectionModel().select(this)},unselect:function(a){var b=this.getOwnerTree();b&&b.getSelectionModel().unselect(this,a)},isSelected:function(){var a=this.getOwnerTree();return a?a.getSelectionModel().isSelected(this):!1},expand:function(a,b,c,d){if(!this.expanded){if(this.fireEvent("beforeexpand",this,a,b)===!1)return;this.childrenRendered||this.renderChildren(),this.expanded=!0;if(!this.isHiddenRoot()&&this.getOwnerTree().animate&&b!==!1||b){this.ui.animExpand(function(){this.fireEvent("expand",this),this.runCallback(c,d||this,[this]),a===!0&&this.expandChildNodes(!0)}.createDelegate(this));return}this.ui.expand(),this.fireEvent("expand",this),this.runCallback(c,d||this,[this])}else this.runCallback(c,d||this,[this]);a===!0&&this.expandChildNodes(!0)},runCallback:function(a,b,c){Ext.isFunction(a)&&a.apply(b,c)},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(a,b,c,d){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,a,b)===!1)return;this.expanded=!1;if(this.getOwnerTree().animate&&b!==!1||b){this.ui.animCollapse(function(){this.fireEvent("collapse",this),this.runCallback(c,d||this,[this]),a===!0&&this.collapseChildNodes(!0)}.createDelegate(this));return}this.ui.collapse(),this.fireEvent("collapse",this),this.runCallback(c,d||this,[this])}else this.expanded||this.runCallback(c,d||this,[this]);if(a===!0){var e=this.childNodes;for(var f=0,g=e.length;f<g;f++)e[f].collapse(!0,!1)}},delayedExpand:function(a){this.expandProcId||(this.expandProcId=this.expand.defer(a,this))},cancelExpand:function(){this.expandProcId&&clearTimeout(this.expandProcId),this.expandProcId=!1},toggle:function(){this.expanded?this.collapse():this.expand()},ensureVisible:function(a,b){var c=this.getOwnerTree();c.expandPath(this.parentNode?this.parentNode.getPath():this.getPath(),!1,function(){var d=c.getNodeById(this.id);c.getTreeEl().scrollChildIntoView(d.ui.anchor),this.runCallback(a,b||this,[this])}.createDelegate(this))},expandChildNodes:function(a){var b=this.childNodes;for(var c=0,d=b.length;c<d;c++)b[c].expand(a)},collapseChildNodes:function(a){var b=this.childNodes;for(var c=0,d=b.length;c<d;c++)b[c].collapse(a)},disable:function(){this.disabled=!0,this.unselect(),this.rendered&&this.ui.onDisableChange&&this.ui.onDisableChange(this,!0),this.fireEvent("disabledchange",this,!0)},enable:function(){this.disabled=!1,this.rendered&&this.ui.onDisableChange&&this.ui.onDisableChange(this,!1),this.fireEvent("disabledchange",this,!1)},renderChildren:function(a){a!==!1&&this.fireEvent("beforechildrenrendered",this);var b=this.childNodes;for(var c=0,d=b.length;c<d;c++)b[c].render(!0);this.childrenRendered=!0},sort:function(a,b){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered){var c=this.childNodes;for(var d=0,e=c.length;d<e;d++)c[d].render(!0)}},render:function(a){this.ui.render(a),this.rendered||(this.getOwnerTree().registerNode(this),this.rendered=!0,this.expanded&&(this.expanded=!1,this.expand(!1,!1)))},renderIndent:function(a,b){b&&(this.ui.childIndent=null),this.ui.renderIndent();if(a===!0&&this.childrenRendered){var c=this.childNodes;for(var d=0,e=c.length;d<e;d++)c[d].renderIndent(!0,b)}},beginUpdate:function(){this.childrenRendered=!1},endUpdate:function(){this.expanded&&this.rendered&&this.renderChildren()},destroy:function(a){a===!0&&this.unselect(!0),Ext.tree.TreeNode.superclass.destroy.call(this,a),Ext.destroy(this.ui,this.loader),this.ui=this.loader=null},onIdChange:function(a){this.ui.onIdChange(a)}}),Ext.tree.TreePanel.nodeTypes.node=Ext.tree.TreeNode,Ext.tree.AsyncTreeNode=function(a){this.loaded=a&&a.loaded===!0,this.loading=!1,Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments),this.addEvents("beforeload","load")},Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(a,b,c,d){if(this.loading){var e,f=function(){this.loading||(clearInterval(e),this.expand(a,b,c,d))}.createDelegate(this);e=setInterval(f,200);return}if(!this.loaded){if(this.fireEvent("beforeload",this)===!1)return;this.loading=!0,this.ui.beforeLoad(this);var g=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(g){g.load(this,this.loadComplete.createDelegate(this,[a,b,c,d]),this);return}}Ext.tree.AsyncTreeNode.superclass.expand.call(this,a,b,c,d)},isLoading:function(){return this.loading},loadComplete:function(a,b,c,d){this.loading=!1,this.loaded=!0,this.ui.afterLoad(this),this.fireEvent("load",this),this.expand(a,b,c,d)},isLoaded:function(){return this.loaded},hasChildNodes:function(){return!this.isLeaf()&&!this.loaded?!0:Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)},reload:function(a,b){this.collapse(!1,!1);while(this.firstChild)this.removeChild(this.firstChild).destroy();this.childrenRendered=!1,this.loaded=!1,this.isHiddenRoot()&&(this.expanded=!1),this.expand(!1,!1,a,b)}}),Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode,Ext.tree.TreeNodeUI=function(a){this.node=a,this.rendered=!1,this.animating=!1,this.wasLeaf=!0,this.ecc="x-tree-ec-icon x-tree-elbow",this.emptyIcon=Ext.BLANK_IMAGE_URL},Ext.tree.TreeNodeUI.prototype={removeChild:function(a){this.rendered&&this.ctNode.removeChild(a.ui.getEl())},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(a,b,c){this.rendered&&(this.textNode.innerHTML=b)},onDisableChange:function(a,b){this.disabled=b,this.checkbox&&(this.checkbox.disabled=b),b?this.addClass("x-tree-node-disabled"):this.removeClass("x-tree-node-disabled")},onSelectedChange:function(a){a?(this.focus(),this.addClass("x-tree-selected")):this.removeClass("x-tree-selected")},onMove:function(a,b,c,d,e,f){this.childIndent=null;if(this.rendered){var g=d.ui.getContainer();if(!g){this.holder=document.createElement("div"),this.holder.appendChild(this.wrap);return}var h=f?f.ui.getEl():null;h?g.insertBefore(this.wrap,h):g.appendChild(this.wrap),this.node.renderIndent(!0,c!=d)}},addClass:function(a){this.elNode&&Ext.fly(this.elNode).addClass(a)},removeClass:function(a){this.elNode&&Ext.fly(this.elNode).removeClass(a)},remove:function(){this.rendered&&(this.holder=document.createElement("div"),this.holder.appendChild(this.wrap))},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this),this.node.disabled&&this.onDisableChange(this.node,!0),this.node.hidden&&this.hide();var a=this.node.getOwnerTree(),b=a.enableDD||a.enableDrag||a.enableDrop;b&&(!this.node.isRoot||a.rootVisible)&&Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:!1})},getDDHandles:function(){return[this.iconNode,this.textNode,this.elNode]},hide:function(){this.node.hidden=!0,this.wrap&&(this.wrap.style.display="none")},show:function(){this.node.hidden=!1,this.wrap&&(this.wrap.style.display="")},onContextMenu:function(a){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu"))a.preventDefault(),this.focus(),this.fireEvent("contextmenu",this.node,a)},onClick:function(a){if(this.dropping){a.stopEvent();return}if(this.fireEvent("beforeclick",this.node,a)!==!1){var b=a.getTarget("a");if(!this.disabled&&this.node.attributes.href&&b){this.fireEvent("click",this.node,a);return}b&&a.ctrlKey&&a.stopEvent(),a.preventDefault();if(this.disabled)return;this.node.attributes.singleClickExpand&&!this.animating&&this.node.isExpandable()&&this.node.toggle(),this.fireEvent("click",this.node,a)}else a.stopEvent()},onDblClick:function(a){a.preventDefault();if(this.disabled)return;this.fireEvent("beforedblclick",this.node,a)!==!1&&(this.checkbox&&this.toggleCheck(),!this.animating&&this.node.isExpandable()&&this.node.toggle(),this.fireEvent("dblclick",this.node,a))},onOver:function(a){this.addClass("x-tree-node-over")},onOut:function(a){this.removeClass("x-tree-node-over")},onCheckChange:function(){var a=this.checkbox.checked;this.checkbox.defaultChecked=a,this.node.attributes.checked=a,this.fireEvent("checkchange",this.node,a)},ecClick:function(a){!this.animating&&this.node.isExpandable()&&this.node.toggle()},startDrop:function(){this.dropping=!0},endDrop:function(){setTimeout(function(){this.dropping=!1}.createDelegate(this),50)},expand:function(){this.updateExpandIcon(),this.ctNode.style.display=""},focus:function(){if(!this.node.preventHScroll)try{this.anchor.focus()}catch(a){}else try{var b=this.node.getOwnerTree().getTreeEl().dom,c=b.scrollLeft;this.anchor.focus(),b.scrollLeft=c}catch(a){}},toggleCheck:function(a){var b=this.checkbox;b&&(b.checked=a===undefined?!b.checked:a,this.onCheckChange())},blur:function(){try{this.anchor.blur()}catch(a){}},animExpand:function(a){var b=Ext.get(this.ctNode);b.stopFx();if(!this.node.isExpandable()){this.updateExpandIcon(),this.ctNode.style.display="",Ext.callback(a);return}this.animating=!0,this.updateExpandIcon(),b.slideIn("t",{callback:function(){this.animating=!1,Ext.callback(a)},scope:this,duration:this.node.ownerTree.duration||.25})},highlight:function(){var a=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(a.hlColor||"C3DAF9",{endColor:a.hlBaseColor})},collapse:function(){this.updateExpandIcon(),this.ctNode.style.display="none"},animCollapse:function(a){var b=Ext.get(this.ctNode);b.enableDisplayMode("block"),b.stopFx(),this.animating=!0,this.updateExpandIcon(),b.slideOut("t",{callback:function(){this.animating=!1,Ext.callback(a)},scope:this,duration:this.node.ownerTree.duration||.25})},getContainer:function(){return this.ctNode},getEl:function(){return this.wrap},appendDDGhost:function(a){a.appendChild(this.elNode.cloneNode(!0))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(a){var b=this.node,c=b.attributes,d=b.parentNode?b.parentNode.ui.getContainer():b.ownerTree.innerCt.dom;this.rendered?a===!0&&d.appendChild(this.wrap):(this.rendered=!0,this.renderElements(b,c,d,a),c.qtip?this.textNode.setAttributeNS?(this.textNode.setAttributeNS("ext","qtip",c.qtip),c.qtipTitle&&this.textNode.setAttributeNS("ext","qtitle",c.qtipTitle)):(this.textNode.setAttribute("ext:qtip",c.qtip),c.qtipTitle&&this.textNode.setAttribute("ext:qtitle",c.qtipTitle)):c.qtipCfg&&(c.qtipCfg.target=Ext.id(this.textNode),Ext.QuickTips.register(c.qtipCfg)),this.initEvents(),this.node.expanded||this.updateExpandIcon(!0))},renderElements:function(a,b,c,d){this.indentMarkup=a.parentNode?a.parentNode.ui.getChildIndent():"";var e=Ext.isBoolean(b.checked),f,g=b.href?b.href:Ext.isGecko?"":"#",h=['<li class="x-tree-node"><div ext:tree-node-id="',a.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',b.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img src="',b.icon||this.emptyIcon,'" class="x-tree-node-icon',b.icon?" x-tree-node-inline-icon":"",b.iconCls?" "+b.iconCls:"",'" unselectable="on" />',e?'<input class="x-tree-node-cb" type="checkbox" '+(b.checked?'checked="checked" />':"/>"):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',g,'" tabIndex="1" ',b.hrefTarget?' target="'+b.hrefTarget+'"':"",'><span unselectable="on">',a.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join("");d!==!0&&a.nextSibling&&(f=a.nextSibling.ui.getEl())?this.wrap=Ext.DomHelper.insertHtml("beforeBegin",f,h):this.wrap=Ext.DomHelper.insertHtml("beforeEnd",c,h),this.elNode=this.wrap.childNodes[0],this.ctNode=this.wrap.childNodes[1];var i=this.elNode.childNodes;this.indentNode=i[0],this.ecNode=i[1],this.iconNode=i[2];var j=3;e&&(this.checkbox=i[3],this.checkbox.defaultChecked=this.checkbox.checked,j++),this.anchor=i[j],this.textNode=i[j].firstChild},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:!1},updateExpandIcon:function(){if(this.rendered){var a=this.node,b,c,d=a.isLast()?"x-tree-elbow-end":"x-tree-elbow",e=a.hasChildNodes();if(e||a.attributes.expandable){a.expanded?(d+="-minus",b="x-tree-node-collapsed",c="x-tree-node-expanded"):(d+="-plus",b="x-tree-node-expanded",c="x-tree-node-collapsed"),this.wasLeaf&&(this.removeClass("x-tree-node-leaf"),this.wasLeaf=!1);if(this.c1!=b||this.c2!=c)Ext.fly(this.elNode).replaceClass(b,c),this.c1=b,this.c2=c}else this.wasLeaf||(Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-collapsed"),delete this.c1,delete this.c2,this.wasLeaf=!0);var f="x-tree-ec-icon "+d;this.ecc!=f&&(this.ecNode.className=f,this.ecc=f)}},onIdChange:function(a){this.rendered&&this.elNode.setAttribute("ext:tree-node-id",a)},getChildIndent:function(){if(!this.childIndent){var a=[],b=this.node;while(b){if(!b.isRoot||b.isRoot&&b.ownerTree.rootVisible)b.isLast()?a.unshift('<img src="'+this.emptyIcon+'" class="x-tree-icon" />'):a.unshift('<img src="'+this.emptyIcon+'" class="x-tree-elbow-line" />');b=b.parentNode}this.childIndent=a.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var a="",b=this.node.parentNode;b&&(a=b.ui.getChildIndent()),this.indentMarkup!=a&&(this.indentNode.innerHTML=a,this.indentMarkup=a),this.updateExpandIcon()}},destroy:function(){this.elNode&&Ext.dd.Registry.unregister(this.elNode.id),Ext.each(["textnode","anchor","checkbox","indentNode","ecNode","iconNode","elNode","ctNode","wrap","holder"],function(a){this[a]&&(Ext.fly(this[a]).remove(),delete this[a])},this),delete this.node}},Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var a=this.node.ownerTree.innerCt.dom;this.node.expanded=!0,a.innerHTML='<div class="x-tree-root-node"></div>',this.wrap=this.ctNode=a.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn}),Ext.tree.TreeLoader=function(a){this.baseParams={},Ext.apply(this,a),this.addEvents("beforeload","load","loadexception"),Ext.tree.TreeLoader.superclass.constructor.call(this),Ext.isString(this.paramOrder)&&(this.paramOrder=this.paramOrder.split(/[\s,|]/))},Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:!0,paramOrder:undefined,paramsAsHash:!1,nodeParameter:"node",directFn:undefined,load:function(a,b,c){if(this.clearOnLoad)while(a.firstChild)a.removeChild(a.firstChild);this.doPreload(a)?this.runCallback(b,c||a,[a]):(this.directFn||this.dataUrl||this.url)&&this.requestData(a,b,c||a)},doPreload:function(a){if(a.attributes.children){if(a.childNodes.length<1){var b=a.attributes.children;a.beginUpdate();for(var c=0,d=b.length;c<d;c++){var e=a.appendChild(this.createNode(b[c]));this.preloadChildren&&this.doPreload(e)}a.endUpdate()}return!0}return!1},getParams:function(a){var b=Ext.apply({},this.baseParams),c=this.nodeParameter,d=this.paramOrder;c&&(b[c]=a.id);if(this.directFn){var e=[a.id];if(d){c&&d.indexOf(c)>-1&&(e=[]);for(var f=0,g=d.length;f<g;f++)e.push(b[d[f]])}else this.paramsAsHash&&(e=[b]);return e}return b},requestData:function(a,b,c){if(this.fireEvent("beforeload",this,a,b)!==!1)if(this.directFn){var d=this.getParams(a);d.push(this.processDirectResponse.createDelegate(this,[{callback:b,node:a,scope:c}],!0)),this.directFn.apply(window,d)}else this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:b,node:a,scope:c},params:this.getParams(a)});else this.runCallback(b,c||a,[])},processDirectResponse:function(a,b,c){b.status?this.handleResponse({responseData:Ext.isArray(a)?a:null,responseText:a,argument:c}):this.handleFailure({argument:c})},runCallback:function(a,b,c){Ext.isFunction(a)&&a.apply(b,c)},isLoading:function(){return!!this.transId},abort:function(){this.isLoading()&&Ext.Ajax.abort(this.transId)},createNode:function(attr){return this.baseAttrs&&Ext.applyIf(attr,this.baseAttrs),this.applyLoader!==!1&&!attr.loader&&(attr.loader=this),Ext.isString(attr.uiProvider)&&(attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider)),attr.nodeType?new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr):attr.leaf?new Ext.tree.TreeNode(attr):new Ext.tree.AsyncTreeNode(attr)},processResponse:function(a,b,c,d){var e=a.responseText;try{var f=a.responseData||Ext.decode(e);b.beginUpdate();for(var g=0,h=f.length;g<h;g++){var i=this.createNode(f[g]);i&&b.appendChild(i)}b.endUpdate(),this.runCallback(c,d||b,[b])}catch(j){this.handleFailure(a)}},handleResponse:function(a){this.transId=!1;var b=a.argument;this.processResponse(a,b.node,b.callback,b.scope),this.fireEvent("load",this,b.node,a)},handleFailure:function(a){this.transId=!1;var b=a.argument;this.fireEvent("loadexception",this,b.node,a),this.runCallback(b.callback,b.scope||b.node,[b.node])},destroy:function(){this.abort(),this.purgeListeners()}}),Ext.tree.TreeFilter=function(a,b){this.tree=a,this.filtered={},Ext.apply(this,b)},Ext.tree.TreeFilter.prototype={clearBlank:!1,reverse:!1,autoClear:!1,remove:!1,filter:function(a,b,c){b=b||"text";var d;if(typeof a=="string"){var e=a.length;if(e==0&&this.clearBlank){this.clear();return}a=a.toLowerCase(),d=function(c){return c.attributes[b].substr(0,e).toLowerCase()==a}}else if(a.exec)d=function(c){return a.test(c.attributes[b])};else throw"Illegal filter type, must be string or regex";this.filterBy(d,null,c)},filterBy:function(a,b,c){c=c||this.tree.root,this.autoClear&&this.clear();var d=this.filtered,e=this.reverse,f=function(f){if(f==c)return!0;if(d[f.id])return!1;var g=a.call(b||f,f);return!g||e?(d[f.id]=f,f.ui.hide(),!1):!0};c.cascade(f);if(this.remove)for(var g in d)if(typeof g!="function"){var h=d[g];h&&h.parentNode&&h.parentNode.removeChild(h)}},clear:function(){var a=this.tree,b=this.filtered;for(var c in b)if(typeof c!="function"){var d=b[c];d&&d.ui.show()}this.filtered={}}},Ext.tree.TreeSorter=function(a,b){Ext.apply(this,b),a.on("beforechildrenrendered",this.doSort,this),a.on("append",this.updateSort,this),a.on("insert",this.updateSort,this),a.on("textchange",this.updateSortParent,this);var c=this.dir&&this.dir.toLowerCase()=="desc",d=this.property||"text",e=this.sortType,f=this.folderSort,g=this.caseSensitive===!0,h=this.leafAttr||"leaf";this.sortFn=function(a,b){if(f){if(a.attributes[h]&&!b.attributes[h])return 1;if(!a.attributes[h]&&b.attributes[h])return-1}var i=e?e(a):g?a.attributes[d]:a.attributes[d].toUpperCase(),j=e?e(b):g?b.attributes[d]:b.attributes[d].toUpperCase();return i<j?c?1:-1:i>j?c?-1:1:0}},Ext.tree.TreeSorter.prototype={doSort:function(a){a.sort(this.sortFn)},compareNodes:function(a,b){return a.text.toUpperCase()>b.text.toUpperCase()?1:-1},updateSort:function(a,b){b.childrenRendered&&this.doSort.defer(1,this,[b])},updateSortParent:function(a){var b=a.parentNode;b&&b.childrenRendered&&this.doSort.defer(1,this,[b])}},Ext.dd.DropZone&&(Ext.tree.TreeDropZone=function(a,b){this.allowParentInsert=b.allowParentInsert||!1,this.allowContainerDrop=b.allowContainerDrop||!1,this.appendOnly=b.appendOnly||!1,Ext.tree.TreeDropZone.superclass.constructor.call(this,a.getTreeEl(),b),this.tree=a,this.dragOverData={},this.lastInsertClass="x-tree-no-status"},Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1e3,expandNode:function(a){a.hasChildNodes()&&!a.isExpanded()&&a.expand(!1,null,this.triggerCacheRefresh.createDelegate(this))},queueExpand:function(a){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[a])},cancelExpand:function(){this.expandProcId&&(clearTimeout(this.expandProcId),this.expandProcId=!1)},isValidDropPoint:function(a,b,c,d,e){if(!a||!e)return!1;var f=a.node,g=e.node;if(!(f&&f.isTarget&&b))return!1;if(b=="append"&&f.allowChildren===!1)return!1;if(b!="above"&&b!="below"||!f.parentNode||f.parentNode.allowChildren!==!1){if(g&&(f==g||g.contains(f)))return!1;var h=this.dragOverData;h.tree=this.tree,h.target=f,h.data=e,h.point=b,h.source=c,h.rawEvent=d,h.dropNode=g,h.cancel=!1;var i=this.tree.fireEvent("nodedragover",h);return h.cancel===!1&&i!==!1}return!1},getDropPoint:function(a,b,c){var d=b.node;if(d.isRoot)return d.allowChildren!==!1?"append":!1;var e=b.ddel,f=Ext.lib.Dom.getY(e),g=f+e.offsetHeight,h=Ext.lib.Event.getPageY(a),i=d.allowChildren===!1||d.isLeaf();if(this.appendOnly||d.parentNode.allowChildren===!1)return i?!1:"append";var j=!1;this.allowParentInsert||(j=d.hasChildNodes()&&d.isExpanded());var k=(g-f)/(i?2:3);return h>=f&&h<f+k?"above":!j&&(i||h>=g-k&&h<=g)?"below":"append"},onNodeEnter:function(a,b,c,d){this.cancelExpand()},onContainerOver:function(a,b,c){return this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,b,c)?this.dropAllowed:this.dropNotAllowed},onNodeOver:function(a,b,c,d){var e=this.getDropPoint(c,a,b),f=a.node;!this.expandProcId&&e=="append"&&f.hasChildNodes()&&!a.node.isExpanded()?this.queueExpand(f):e!="append"&&this.cancelExpand();var g=this.dropNotAllowed;if(this.isValidDropPoint(a,e,b,c,d)&&e){var h=a.ddel,i;e=="above"?(g=a.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between",i="x-tree-drag-insert-above"):e=="below"?(g=a.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between",i="x-tree-drag-insert-below"):(g="x-tree-drop-ok-append",i="x-tree-drag-append"),this.lastInsertClass!=i&&(Ext.fly(h).replaceClass(this.lastInsertClass,i),this.lastInsertClass=i)}return g},onNodeOut:function(a,b,c,d){this.cancelExpand(),this.removeDropIndicators(a)},onNodeDrop:function(a,b,c,d){var e=this.getDropPoint(c,a,b),f=a.node;f.ui.startDrop();if(!this.isValidDropPoint(a,e,b,c,d))return f.ui.endDrop(),!1;var g=d.node||(b.getTreeNode?b.getTreeNode(d,f,e,c):null);return this.processDrop(f,d,e,b,c,g)},onContainerDrop:function(a,b,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,b,c)){var d=this.tree.getRootNode();d.ui.startDrop();var e=c.node||(a.getTreeNode?a.getTreeNode(c,d,"append",b):null);return this.processDrop(d,c,"append",a,b,e)}return!1},processDrop:function(a,b,c,d,e,f){var g={tree:this.tree,target:a,data:b,point:c,source:d,rawEvent:e,dropNode:f,cancel:!f,dropStatus:!1},h=this.tree.fireEvent("beforenodedrop",g);return h===!1||g.cancel===!0||!g.dropNode?(a.ui.endDrop(),g.dropStatus):(a=g.target,c=="append"&&!a.isExpanded()?a.expand(!1,null,function(){this.completeDrop(g)}.createDelegate(this)):this.completeDrop(g),!0)},completeDrop:function(a){var b=a.dropNode,c=a.point,d=a.target;Ext.isArray(b)||(b=[b]);var e;for(var f=0,g=b.length;f<g;f++)e=b[f],c=="above"?d.parentNode.insertBefore(e,d):c=="below"?d.parentNode.insertBefore(e,d.nextSibling):d.appendChild(e);e.ui.focus(),Ext.enableFx&&this.tree.hlDrop&&e.ui.highlight(),d.ui.endDrop(),this.tree.fireEvent("nodedrop",a)},afterNodeMoved:function(a,b,c,d,e){Ext.enableFx&&this.tree.hlDrop&&(e.ui.focus(),e.ui.highlight()),this.tree.fireEvent("nodedrop",this.tree,d,b,a,c)},getTree:function(){return this.tree},removeDropIndicators:function(a){if(a&&a.ddel){var b=a.ddel;Ext.fly(b).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]),this.lastInsertClass="_noclass"}},beforeDragDrop:function(a,b,c){return this.cancelExpand(),!0},afterRepair:function(a){a&&Ext.enableFx&&a.node.ui.highlight(),this.hideProxy()}})),Ext.dd.DragZone&&(Ext.tree.TreeDragZone=function(a,b){Ext.tree.TreeDragZone.superclass.constructor.call(this,a.innerCt,b),this.tree=a},Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(a,b){var c=a.node;return c&&c.draggable&&!c.disabled},onInitDrag:function(a){var b=this.dragData;this.tree.getSelectionModel().select(b.node),this.tree.eventModel.disable(),this.proxy.update(""),b.node.ui.appendDDGhost(this.proxy.ghost.dom),this.tree.fireEvent("startdrag",this.tree,b.node,a)},getRepairXY:function(a,b){return b.node.ui.getDDRepairXY()},onEndDrag:function(a,b){this.tree.eventModel.enable.defer(100,this.tree.eventModel),this.tree.fireEvent("enddrag",this.tree,a.node,b)},onValidDrop:function(a,b,c){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,a,b),this.hideProxy()},beforeInvalidDrop:function(a,b){var c=this.tree.getSelectionModel();c.clearSelections(),c.select(this.dragData.node)},afterRepair:function(){Ext.enableFx&&this.tree.hlDrop&&Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9"),this.dragging=!1}})),Ext.tree.TreeEditor=function(a,b,c){b=b||{};var d=b.events?b:new Ext.form.TextField(b);Ext.tree.TreeEditor.superclass.constructor.call(this,d,c),this.tree=a,a.rendered?this.initEditor(a):a.on("render",this.initEditor,this)},Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:!1,hideEl:!1,cls:"x-small-editor x-tree-editor",shim:!1,shadow:"frame",maxWidth:250,editDelay:350,initEditor:function(a){a.on({scope:this,beforeclick:this.beforeNodeClick,dblclick:this.onNodeDblClick}),this.on({scope:this,complete:this.updateNode,beforestartedit:this.fitToTree,specialkey:this.onSpecialKey}),this.on("startedit",this.bindScroll,this,{delay:10})},fitToTree:function(a,b){var c=this.tree.getTreeEl().dom,d=b.dom;c.scrollLeft>d.offsetLeft&&(c.scrollLeft=d.offsetLeft);var e=Math.min(this.maxWidth,(c.clientWidth>20?c.clientWidth:c.offsetWidth)-Math.max(0,d.offsetLeft-c.scrollLeft)-5);this.setSize(e,"")},triggerEdit:function(a,b){this.completeEdit();if(a.attributes.editable!==!1){this.editNode=a,this.tree.autoScroll&&Ext.fly(a.ui.getEl()).scrollIntoView(this.tree.body);var c=a.text||"";return!Ext.isGecko&&Ext.isEmpty(a.text)&&a.setText("&#160;"),this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[a.ui.textNode,c]),!1}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(a,b){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(a))return b.stopEvent(),this.triggerEdit(a)},onNodeDblClick:function(a,b){clearTimeout(this.autoEditTimer)},updateNode:function(a,b){this.tree.getTreeEl().un("scroll",this.cancelEdit,this),this.editNode.setText(b)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this),this.editNode&&this.editNode.ui.focus.defer(50,this.editNode.ui)},onSpecialKey:function(a,b){var c=b.getKey();c==b.ESC?(b.stopEvent(),this.cancelEdit()):c==b.ENTER&&!b.hasModifier()&&(b.stopEvent(),this.completeEdit())},onDestroy:function(){clearTimeout(this.autoEditTimer),Ext.tree.TreeEditor.superclass.onDestroy.call(this);var a=this.tree;a.un("beforeclick",this.beforeNodeClick,this),a.un("dblclick",this.onNodeDblClick,this)}}),Ext.grid.GridPanel=Ext.extend(Ext.Panel,{autoExpandColumn:!1,autoExpandMax:1e3,autoExpandMin:50,columnLines:!1,ddText:"{0} selected row{1}",deferRowRender:!0,enableColumnHide:!0,enableColumnMove:!0,enableDragDrop:!1,enableHdMenu:!0,loadMask:!1,minColumnWidth:25,stripeRows:!1,trackMouseOver:!0,stateEvents:["columnmove","columnresize","sortchange","groupchange"],view:null,bubbleEvents:[],rendered:!1,viewReady:!1,initComponent:function(){Ext.grid.GridPanel.superclass.initComponent.call(this),this.columnLines&&(this.cls=(this.cls||"")+" x-grid-with-col-lines"),this.autoScroll=!1,this.autoWidth=!1,Ext.isArray(this.columns)&&(this.colModel=new Ext.grid.ColumnModel(this.columns),delete this.columns),this.ds&&(this.store=this.ds,delete this.ds),this.cm&&(this.colModel=this.cm,delete this.cm),this.sm&&(this.selModel=this.sm,delete this.sm),this.store=Ext.StoreMgr.lookup(this.store),this.addEvents("click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","keypress","keydown","cellmousedown","rowmousedown","headermousedown","groupmousedown","rowbodymousedown","containermousedown","cellclick","celldblclick","rowclick","rowdblclick","headerclick","headerdblclick","groupclick","groupdblclick","containerclick","containerdblclick","rowbodyclick","rowbodydblclick","rowcontextmenu","cellcontextmenu","headercontextmenu","groupcontextmenu","containercontextmenu","rowbodycontextmenu","bodyscroll","columnresize","columnmove","sortchange","groupchange","reconfigure","viewready")},onRender:function(a,b){Ext.grid.GridPanel.superclass.onRender.apply(this,arguments);var c=this.getGridEl();this.el.addClass("x-grid-panel"),this.mon(c,{scope:this,mousedown:this.onMouseDown,click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu}),this.relayEvents(c,["mousedown","mouseup","mouseover","mouseout","keypress","keydown"]);var d=this.getView();d.init(this),d.render(),this.getSelectionModel().init(this)},initEvents:function(){Ext.grid.GridPanel.superclass.initEvents.call(this),this.loadMask&&(this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:this.store},this.loadMask)))},initStateEvents:function(){Ext.grid.GridPanel.superclass.initStateEvents.call(this),this.mon(this.colModel,"hiddenchange",this.saveState,this,{delay:100})},applyState:function(a){var b=this.colModel,c=a.columns,d=this.store,e,f,g;if(c)for(var h=0,i=c.length;h<i;h++)e=c[h],f=b.getColumnById(e.id),f&&(f.hidden=e.hidden,f.width=e.width,g=b.getIndexById(e.id),g!=h&&b.moveColumn(g,h))
;d&&(e=a.sort,e&&d[d.remoteSort?"setDefaultSort":"sort"](e.field,e.direction),e=a.group,d.groupBy&&(e?d.groupBy(e):d.clearGrouping()));var j=Ext.apply({},a);delete j.columns,delete j.sort,Ext.grid.GridPanel.superclass.applyState.call(this,j)},getState:function(){var a={columns:[]},b=this.store,c,d;for(var e=0,f;f=this.colModel.config[e];e++)a.columns[e]={id:f.id,width:f.width},f.hidden&&(a.columns[e].hidden=!0);return b&&(c=b.getSortState(),c&&(a.sort=c),b.getGroupState&&(d=b.getGroupState(),d&&(a.group=d))),a},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);var a=this.view;this.on("bodyresize",a.layout,a),a.layout(),this.deferRowRender?(this.deferRowRenderTask||(this.deferRowRenderTask=new Ext.util.DelayedTask(a.afterRender,this.view)),this.deferRowRenderTask.delay(10)):a.afterRender(),this.viewReady=!0},reconfigure:function(a,b){var c=this.rendered;c&&this.loadMask&&(this.loadMask.destroy(),this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({},{store:a},this.initialConfig.loadMask))),this.view&&this.view.initData(a,b),this.store=a,this.colModel=b,c&&this.view.refresh(!0),this.fireEvent("reconfigure",this,a,b)},onDestroy:function(){this.deferRowRenderTask&&this.deferRowRenderTask.cancel&&this.deferRowRenderTask.cancel(),this.rendered?Ext.destroy(this.view,this.loadMask):this.store&&this.store.autoDestroy&&this.store.destroy(),Ext.destroy(this.colModel,this.selModel),this.store=this.selModel=this.colModel=this.view=this.loadMask=null,Ext.grid.GridPanel.superclass.onDestroy.call(this)},processEvent:function(a,b){this.view.processEvent(a,b)},onClick:function(a){this.processEvent("click",a)},onMouseDown:function(a){this.processEvent("mousedown",a)},onContextMenu:function(a,b){this.processEvent("contextmenu",a)},onDblClick:function(a){this.processEvent("dblclick",a)},walkCells:function(a,b,c,d,e){var f=this.colModel,g=f.getColumnCount(),h=this.store,i=h.getCount(),j=!0;if(c<0){b<0&&(a--,j=!1);while(a>=0){j||(b=g-1),j=!1;while(b>=0){if(d.call(e||this,a,b,f)===!0)return[a,b];b--}a--}}else{b>=g&&(a++,j=!1);while(a<i){j||(b=0),j=!1;while(b<g){if(d.call(e||this,a,b,f)===!0)return[a,b];b++}a++}}return null},getGridEl:function(){return this.body},stopEditing:Ext.emptyFn,getSelectionModel:function(){return this.selModel||(this.selModel=new Ext.grid.RowSelectionModel(this.disableSelection?{selectRow:Ext.emptyFn}:null)),this.selModel},getStore:function(){return this.store},getColumnModel:function(){return this.colModel},getView:function(){return this.view||(this.view=new Ext.grid.GridView(this.viewConfig)),this.view},getDragDropText:function(){var a=this.selModel.getCount();return String.format(this.ddText,a,a==1?"":"s")}}),Ext.reg("grid",Ext.grid.GridPanel),Ext.grid.GridView=Ext.extend(Ext.util.Observable,{deferEmptyText:!0,scrollOffset:undefined,autoFill:!1,forceFit:!1,sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",columnsText:"Columns",selectedRowClass:"x-grid3-row-selected",borderWidth:2,tdClass:"x-grid3-cell",hdCls:"x-grid3-hd",markDirty:!0,cellSelectorDepth:4,rowSelectorDepth:10,rowBodySelectorDepth:10,cellSelector:"td.x-grid3-cell",rowSelector:"div.x-grid3-row",rowBodySelector:"div.x-grid3-row-body",firstRowCls:"x-grid3-row-first",lastRowCls:"x-grid3-row-last",rowClsRe:/(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g,constructor:function(a){Ext.apply(this,a),this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh"),Ext.grid.GridView.superclass.constructor.call(this)},initTemplates:function(){var a=this.templates||{};a.master||(a.master=new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset" style="{ostyle}">{header}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller"><div class="x-grid3-body" style="{bstyle}">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',"</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>")),a.header||(a.header=new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">','<thead><tr class="x-grid3-hd-row">{cells}</tr></thead>',"</table>")),a.hcell||(a.hcell=new Ext.Template('<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}"><div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"",'{value}<img class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div></td>")),a.body||(a.body=new Ext.Template("{rows}")),a.row||(a.row=new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}"><table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr>",this.enableRowBody?'<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>':"","</tbody></table></div>")),a.cell||(a.cell=new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>','<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',"</td>"));for(var b in a){var c=a[b];c&&Ext.isFunction(c.compile)&&!c.compiled&&(c.disableFormats=!0,c.compile())}this.templates=a,this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(a){return this._flyweight||(this._flyweight=new Ext.Element.Flyweight(document.body)),this._flyweight.dom=a,this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var a=Ext.Element,b=this.grid.getGridEl().dom.firstChild,c=b.childNodes;this.el=new a(b),this.mainWrap=new a(c[0]),this.mainHd=new a(this.mainWrap.dom.firstChild),this.grid.hideHeaders&&this.mainHd.setDisplayed(!1),this.innerHd=this.mainHd.dom.firstChild,this.scroller=new a(this.mainWrap.dom.childNodes[1]),this.forceFit&&this.scroller.setStyle("overflow-x","hidden"),this.mainBody=new a(this.scroller.dom.firstChild),this.focusEl=new a(this.scroller.dom.childNodes[1]),this.focusEl.swallowEvent("click",!0),this.resizeMarker=new a(c[1]),this.resizeProxy=new a(c[2])},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(a){return a?this.fly(a).findParent(this.cellSelector,this.cellSelectorDepth):!1},findCellIndex:function(a,b){var c=this.findCell(a);return c&&(!b||this.fly(c).hasClass(b))?this.getCellIndex(c):!1},getCellIndex:function(a){if(a){var b=a.className.match(this.colRe);if(b&&b[1])return this.cm.getIndexById(b[1])}return!1},findHeaderCell:function(a){var b=this.findCell(a);return b&&this.fly(b).hasClass(this.hdCls)?b:null},findHeaderIndex:function(a){return this.findCellIndex(a,this.hdCls)},findRow:function(a){return a?this.fly(a).findParent(this.rowSelector,this.rowSelectorDepth):!1},findRowIndex:function(a){var b=this.findRow(a);return b?b.rowIndex:!1},findRowBody:function(a){return a?this.fly(a).findParent(this.rowBodySelector,this.rowBodySelectorDepth):!1},getRow:function(a){return this.getRows()[a]},getCell:function(a,b){return this.getRow(a).getElementsByTagName("td")[b]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(a,b){var c=this.getRow(a);c&&this.fly(c).addClass(b)},removeRowClass:function(a,b){var c=this.getRow(a);c&&this.fly(c).removeClass(b)},removeRow:function(a){Ext.removeNode(this.getRow(a)),this.syncFocusEl(a)},removeRows:function(a,b){var c=this.mainBody.dom;for(var d=a;d<=b;d++)Ext.removeNode(c.childNodes[a]);this.syncFocusEl(a)},getScrollState:function(){var a=this.scroller.dom;return{left:a.scrollLeft,top:a.scrollTop}},restoreScroll:function(a){var b=this.scroller.dom;b.scrollLeft=a.left,b.scrollTop=a.top},scrollToTop:function(){this.scroller.dom.scrollTop=0,this.scroller.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.scroller.dom;this.innerHd.scrollLeft=a.scrollLeft,this.innerHd.scrollLeft=a.scrollLeft},updateSortIcon:function(a,b){var c=this.sortClasses,d=this.mainHd.select("td").removeClass(c);d.item(a).addClass(c[b=="DESC"?1:0])},updateAllColumnWidths:function(){var a=this.getTotalWidth(),b=this.cm.getColumnCount(),c=[],d,e;for(e=0;e<b;e++)c[e]=this.getColumnWidth(e);this.innerHd.firstChild.style.width=this.getOffsetWidth(),this.innerHd.firstChild.firstChild.style.width=a,this.mainBody.dom.style.width=a;for(e=0;e<b;e++){var f=this.getHeaderCell(e);f.style.width=c[e]}var g=this.getRows(),h,i;for(e=0,d=g.length;e<d;e++){h=g[e],h.style.width=a;if(h.firstChild){h.firstChild.style.width=a,i=h.firstChild.rows[0];for(var j=0;j<b;j++)i.childNodes[j].style.width=c[j]}}this.onAllColumnWidthsUpdated(c,a)},updateColumnWidth:function(a,b){var c=this.getColumnWidth(a),d=this.getTotalWidth();this.innerHd.firstChild.style.width=this.getOffsetWidth(),this.innerHd.firstChild.firstChild.style.width=d,this.mainBody.dom.style.width=d;var e=this.getHeaderCell(a);e.style.width=c;var f=this.getRows(),g;for(var h=0,i=f.length;h<i;h++)g=f[h],g.style.width=d,g.firstChild&&(g.firstChild.style.width=d,g.firstChild.rows[0].childNodes[a].style.width=c);this.onColumnWidthUpdated(a,c,d)},updateColumnHidden:function(a,b){var c=this.getTotalWidth();this.innerHd.firstChild.style.width=this.getOffsetWidth(),this.innerHd.firstChild.firstChild.style.width=c,this.mainBody.dom.style.width=c;var d=b?"none":"",e=this.getHeaderCell(a);e.style.display=d;var f=this.getRows(),g;for(var h=0,i=f.length;h<i;h++)g=f[h],g.style.width=c,g.firstChild&&(g.firstChild.style.width=c,g.firstChild.rows[0].childNodes[a].style.display=d);this.onColumnHiddenUpdated(a,b,c),delete this.lastViewWidth,this.layout()},doRender:function(a,b,c,d,e,f){var g=this.templates,h=g.cell,i=g.row,j=e-1,k="width:"+this.getTotalWidth()+";",l=[],m=[],n={tstyle:k},o={},p,q;for(var r=0,s=b.length;r<s;r++){q=b[r],m=[];var t=r+d;for(var u=0;u<e;u++)p=a[u],o.id=p.id,o.css=u===0?"x-grid3-cell-first ":u==j?"x-grid3-cell-last ":"",o.attr=o.cellAttr="",o.style=p.style,o.value=p.renderer.call(p.scope,q.data[p.name],o,q,t,u,c),Ext.isEmpty(o.value)&&(o.value="&#160;"),this.markDirty&&q.dirty&&Ext.isDefined(q.modified[p.name])&&(o.css+=" x-grid3-dirty-cell"),m[m.length]=h.apply(o);var v=[];f&&(t+1)%2===0&&(v[0]="x-grid3-row-alt"),q.dirty&&(v[1]=" x-grid3-dirty-row"),n.cols=e,this.getRowClass&&(v[2]=this.getRowClass(q,t,n,c)),n.alt=v.join(" "),n.cells=m.join(""),l[l.length]=i.apply(n)}return l.join("")},processRows:function(a,b){if(!this.ds||this.ds.getCount()<1)return;var c=this.getRows(),d=c.length,e,f;b=b||!this.grid.stripeRows,a=a||0;for(e=0;e<d;e++)f=c[e],f&&(f.rowIndex=e,b||(f.className=f.className.replace(this.rowClsRe," "),(e+1)%2===0&&(f.className+=" x-grid3-row-alt")));a===0&&Ext.fly(c[0]).addClass(this.firstRowCls),Ext.fly(c[c.length-1]).addClass(this.lastRowCls)},afterRender:function(){if(!this.ds||!this.cm)return;this.mainBody.dom.innerHTML=this.renderRows()||"&#160;",this.processRows(0,!0),this.deferEmptyText!==!0&&this.applyEmptyText(),this.grid.fireEvent("viewready",this.grid)},renderUI:function(){var a=this.templates,b=this.renderHeaders(),c=a.body.apply({rows:"&#160;"}),d=a.master.apply({body:c,header:b,ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";"}),e=this.grid;e.getGridEl().dom.innerHTML=d,this.initElements(),Ext.fly(this.innerHd).on("click",this.handleHdDown,this),this.mainHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove}),this.scroller.on("scroll",this.syncScroll,this),e.enableColumnResize!==!1&&(this.splitZone=new Ext.grid.GridView.SplitDragZone(e,this.mainHd.dom)),e.enableColumnMove&&(this.columnDrag=new Ext.grid.GridView.ColumnDragZone(e,this.innerHd),this.columnDrop=new Ext.grid.HeaderDropZone(e,this.mainHd.dom)),e.enableHdMenu!==!1&&(this.hmenu=new Ext.menu.Menu({id:e.id+"-hctx"}),this.hmenu.add({itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"}),e.enableColumnHide!==!1&&(this.colMenu=new Ext.menu.Menu({id:e.id+"-hcols-menu"}),this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick}),this.hmenu.add("-",{itemId:"columns",hideOnClick:!1,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})),this.hmenu.on("itemclick",this.handleHdMenuClick,this)),e.trackMouseOver&&this.mainBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut});if(e.enableDragDrop||e.enableDrag)this.dragZone=new Ext.grid.GridDragZone(e,{ddGroup:e.ddGroup||"GridDD"});this.updateHeaderSortState()},processEvent:function(a,b){var c=b.getTarget(),d=this.grid,e=this.findHeaderIndex(c);d.fireEvent(a,b);if(e!==!1)d.fireEvent("header"+a,d,e,b);else{var f=this.findRowIndex(c),g,h;f!==!1?(d.fireEvent("row"+a,d,f,b),g=this.findCellIndex(c),g!==!1?d.fireEvent("cell"+a,d,f,g,b):(h=this.findRowBody(c),h&&d.fireEvent("rowbody"+a,d,f,b))):d.fireEvent("container"+a,d,b)}},layout:function(){if(!this.mainBody)return;var a=this.grid,b=a.getGridEl(),c=b.getSize(!0),d=c.width;if(!a.hideHeaders&&(d<20||c.height<20))return;if(a.autoHeight)this.scroller.dom.style.overflow="visible",Ext.isWebKit&&(this.scroller.dom.style.position="static");else{this.el.setSize(c.width,c.height);var e=this.mainHd.getHeight(),f=c.height-e;this.scroller.setSize(d,f),this.innerHd&&(this.innerHd.style.width=d+"px")}this.forceFit?this.lastViewWidth!=d&&(this.fitColumns(!1,!1),this.lastViewWidth=d):(this.autoExpand(),this.syncHeaderScroll()),this.onLayout(d,f)},onLayout:function(a,b){},onColumnWidthUpdated:function(a,b,c){},onAllColumnWidthsUpdated:function(a,b){},onColumnHiddenUpdated:function(a,b,c){},updateColumnText:function(a,b){},afterMove:function(a){},init:function(a){this.grid=a,this.initTemplates(),this.initData(a.store,a.colModel),this.initUI(a)},getColumnId:function(a){return this.cm.getColumnId(a)},getOffsetWidth:function(){return this.cm.getTotalWidth()+this.getScrollOffset()+"px"},getScrollOffset:function(){return Ext.num(this.scrollOffset,Ext.getScrollBarWidth())},renderHeaders:function(){var a=this.cm,b=this.templates,c=b.hcell,d=[],e={},f=a.getColumnCount(),g=f-1;for(var h=0;h<f;h++)e.id=a.getColumnId(h),e.value=a.getColumnHeader(h)||"",e.style=this.getColumnStyle(h,!0),e.tooltip=this.getColumnTooltip(h),e.css=h===0?"x-grid3-cell-first ":h==g?"x-grid3-cell-last ":"",a.config[h].align=="right"?e.istyle="padding-right:16px":delete e.istyle,d[d.length]=c.apply(e);return b.header.apply({cells:d.join(""),tstyle:"width:"+this.getTotalWidth()+";"})},getColumnTooltip:function(a){var b=this.cm.getColumnTooltip(a);return b?Ext.QuickTips.isEnabled()?'ext:qtip="'+b+'"':'title="'+b+'"':""},beforeUpdate:function(){this.grid.stopEditing(!0)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders(),this.innerHd.firstChild.style.width=this.getOffsetWidth(),this.innerHd.firstChild.firstChild.style.width=this.getTotalWidth()},focusRow:function(a){this.focusCell(a,0,!1)},focusCell:function(a,b,c){this.syncFocusEl(this.ensureVisible(a,b,c)),Ext.isGecko?this.focusEl.focus():this.focusEl.focus.defer(1,this.focusEl)},resolveCell:function(a,b,c){Ext.isNumber(a)||(a=a.rowIndex);if(!this.ds)return null;if(a<0||a>=this.ds.getCount())return null;b=b!==undefined?b:0;var d=this.getRow(a),e=this.cm,f=e.getColumnCount(),g;if(c!==!1||b!==0){while(b<f&&e.isHidden(b))b++;g=this.getCell(a,b)}return{row:d,cell:g}},getResolvedXY:function(a){if(!a)return null;var b=this.scroller.dom,c=a.cell,d=a.row;return c?Ext.fly(c).getXY():[this.el.getX(),Ext.fly(d).getY()]},syncFocusEl:function(a,b,c){var d=a;if(!Ext.isArray(d)){a=Math.min(a,Math.max(0,this.getRows().length-1));if(isNaN(a))return;d=this.getResolvedXY(this.resolveCell(a,b,c))}this.focusEl.setXY(d||this.scroller.getXY())},ensureVisible:function(a,b,c){var d=this.resolveCell(a,b,c);if(!d||!d.row)return;var e=d.row,f=d.cell,g=this.scroller.dom,h=0,i=e,j=this.el.dom;while(i&&i!=j)h+=i.offsetTop,i=i.offsetParent;h-=this.mainHd.dom.offsetHeight,j=parseInt(g.scrollTop,10);var k=h+e.offsetHeight,l=g.clientHeight,m=j+l;h<j?g.scrollTop=h:k>m&&(g.scrollTop=k-l);if(c!==!1){var n=parseInt(f.offsetLeft,10),o=n+f.offsetWidth,p=parseInt(g.scrollLeft,10),q=p+g.clientWidth;n<p?g.scrollLeft=n:o>q&&(g.scrollLeft=o-g.clientWidth)}return this.getResolvedXY(d)},insertRows:function(a,b,c,d){var e=a.getCount()-1;if(!d&&b===0&&c>=e)this.fireEvent("beforerowsinserted",this,b,c),this.refresh(),this.fireEvent("rowsinserted",this,b,c);else{d||this.fireEvent("beforerowsinserted",this,b,c);var f=this.renderRows(b,c),g=this.getRow(b);if(g)b===0&&Ext.fly(this.getRow(0)).removeClass(this.firstRowCls),Ext.DomHelper.insertHtml("beforeBegin",g,f);else{var h=this.getRow(e-1);h&&Ext.fly(h).removeClass(this.lastRowCls),Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,f)}d?(b===0||b>=e)&&Ext.fly(this.getRow(b)).addClass(b===0?this.firstRowCls:this.lastRowCls):(this.fireEvent("rowsinserted",this,b,c),this.processRows(b))}this.syncFocusEl(b)},deleteRows:function(a,b,c){a.getRowCount()<1?this.refresh():(this.fireEvent("beforerowsdeleted",this,b,c),this.removeRows(b,c),this.processRows(b),this.fireEvent("rowsdeleted",this,b,c))},getColumnStyle:function(a,b){var c=b?"":this.cm.config[a].css||"";c+="width:"+this.getColumnWidth(a)+";",this.cm.isHidden(a)&&(c+="display:none;");var d=this.cm.config[a].align;return d&&(c+="text-align:"+d+";"),c},getColumnWidth:function(a){var b=this.cm.getColumnWidth(a);return Ext.isNumber(b)?(Ext.isBorderBox||Ext.isWebKit&&!Ext.isSafari2?b:b-this.borderWidth>0?b-this.borderWidth:0)+"px":b},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(a,b,c){var d=this.cm,e,f=d.getTotalWidth(!1),g=this.grid.getGridEl().getWidth(!0)-this.getScrollOffset();if(g<20)return;var h=g-f;if(h===0)return!1;var i=d.getColumnCount(!0),j=i-(Ext.isNumber(c)?1:0);j===0&&(j=1,c=undefined);var k=d.getColumnCount(),l=[],m=0,n=0,o;for(e=0;e<k;e++)!d.isHidden(e)&&!d.isFixed(e)&&e!==c&&(o=d.getColumnWidth(e),l.push(e),m=e,l.push(o),n+=o);var p=(g-d.getTotalWidth())/n;while(l.length)o=l.pop(),e=l.pop(),d.setColumnWidth(e,Math.max(this.grid.minColumnWidth,Math.floor(o+o*p)),!0);if((f=d.getTotalWidth(!1))>g){var q=j!=i?c:m;d.setColumnWidth(q,Math.max(1,d.getColumnWidth(q)-(f-g)),!0)}return a!==!0&&this.updateAllColumnWidths(),!0},autoExpand:function(a){var b=this.grid,c=this.cm;if(!this.userResized&&b.autoExpandColumn){var d=c.getTotalWidth(!1),e=this.grid.getGridEl().getWidth(!0)-this.getScrollOffset();if(d!=e){var f=c.getIndexById(b.autoExpandColumn),g=c.getColumnWidth(f),h=Math.min(Math.max(e-d+g,b.autoExpandMin),b.autoExpandMax);h!=g&&(c.setColumnWidth(f,h,!0),a!==!0&&this.updateColumnWidth(f,h))}}},getColumnData:function(){var a=[],b=this.cm,c=b.getColumnCount();for(var d=0;d<c;d++){var e=b.getDataIndex(d);a[d]={name:Ext.isDefined(e)?e:this.ds.fields.get(d).name,renderer:b.getRenderer(d),scope:b.getRendererScope(d),id:b.getColumnId(d),style:this.getColumnStyle(d)}}return a},renderRows:function(a,b){var c=this.grid,d=c.colModel,e=c.store,f=c.stripeRows,g=d.getColumnCount();if(e.getCount()<1)return"";var h=this.getColumnData();a=a||0,b=Ext.isDefined(b)?b:e.getCount()-1;var i=e.getRange(a,b);return this.doRender(h,i,e,a,g,f)},renderBody:function(){var a=this.renderRows()||"&#160;";return this.templates.body.apply({rows:a})},refreshRow:function(a){var b=this.ds,c;if(Ext.isNumber(a)){c=a,a=b.getAt(c);if(!a)return}else{c=b.indexOf(a);if(c<0)return}this.insertRows(b,c,c,!0),this.getRow(c).rowIndex=c,this.onRemove(b,a,c+1,!0),this.fireEvent("rowupdated",this,c,a)},refresh:function(a){this.fireEvent("beforerefresh",this),this.grid.stopEditing(!0);var b=this.renderBody();this.mainBody.update(b).setWidth(this.getTotalWidth()),a===!0&&(this.updateHeaders(),this.updateHeaderSortState()),this.processRows(0,!0),this.layout(),this.applyEmptyText(),this.fireEvent("refresh",this)},applyEmptyText:function(){this.emptyText&&!this.hasRows()&&this.mainBody.update('<div class="x-grid-empty">'+this.emptyText+"</div>")},updateHeaderSortState:function(){var a=this.ds.getSortState();if(!a)return;(!this.sortState||this.sortState.field!=a.field||this.sortState.direction!=a.direction)&&this.grid.fireEvent("sortchange",this.grid,a),this.sortState=a;var b=this.cm.findColumnIndex(a.field);if(b!=-1){var c=a.direction;this.updateSortIcon(b,c)}},clearHeaderSortState:function(){if(!this.sortState)return;this.grid.fireEvent("sortchange",this.grid,null),this.mainHd.select("td").removeClass(this.sortClasses),delete this.sortState},destroy:function(){this.scrollToTopTask&&this.scrollToTopTask.cancel&&this.scrollToTopTask.cancel(),this.colMenu&&(Ext.menu.MenuMgr.unregister(this.colMenu),this.colMenu.destroy(),delete this.colMenu),this.hmenu&&(Ext.menu.MenuMgr.unregister(this.hmenu),this.hmenu.destroy(),delete this.hmenu),this.initData(null,null),this.purgeListeners(),Ext.fly(this.innerHd).un("click",this.handleHdDown,this),this.grid.enableColumnMove&&(Ext.destroy(this.columnDrag.el,this.columnDrag.proxy.ghost,this.columnDrag.proxy.el,this.columnDrop.el,this.columnDrop.proxyTop,this.columnDrop.proxyBottom,this.columnDrag.dragData.ddel,this.columnDrag.dragData.header),this.columnDrag.proxy.anim&&Ext.destroy(this.columnDrag.proxy.anim),delete this.columnDrag.proxy.ghost,delete this.columnDrag.dragData.ddel,delete this.columnDrag.dragData.header,this.columnDrag.destroy(),delete Ext.dd.DDM.locationCache[this.columnDrag.id],delete this.columnDrag._domRef,delete this.columnDrop.proxyTop,delete this.columnDrop.proxyBottom,this.columnDrop.destroy(),delete Ext.dd.DDM.locationCache["gridHeader"+this.grid.getGridEl().id],delete this.columnDrop._domRef,delete Ext.dd.DDM.ids[this.columnDrop.ddGroup]),this.splitZone&&(this.splitZone.destroy(),delete this.splitZone._domRef,delete Ext.dd.DDM.ids["gridSplitters"+this.grid.getGridEl().id]),Ext.fly(this.innerHd).removeAllListeners(),Ext.removeNode(this.innerHd),delete this.innerHd,Ext.destroy(this.el,this.mainWrap,this.mainHd,this.scroller,this.mainBody,this.focusEl,this.resizeMarker,this.resizeProxy,this.activeHdBtn,this.dragZone,this.splitZone,this._flyweight),delete this.grid.container,this.dragZone&&this.dragZone.destroy(),Ext.dd.DDM.currentTarget=null,delete Ext.dd.DDM.locationCache[this.grid.getGridEl().id],Ext.EventManager.removeResizeListener(this.onWindowResize,this)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;a&&a.getLayout()?a.on("afterlayout",function(){this.fitColumns(!0,!0),this.updateHeaders()},this,{single:!0}):this.fitColumns(!0,!0)}else this.forceFit?this.fitColumns(!0,!1):this.grid.autoExpandColumn&&this.autoExpand(!0);this.renderUI()},initData:function(a,b){this.ds&&(this.ds.un("load",this.onLoad,this),this.ds.un("datachanged",this.onDataChange,this),this.ds.un("add",this.onAdd,this),this.ds.un("remove",this.onRemove,this),this.ds.un("update",this.onUpdate,this),this.ds.un("clear",this.onClear,this),this.ds!==a&&this.ds.autoDestroy&&this.ds.destroy()),a&&a.on({scope:this,load:this.onLoad,datachanged:this.onDataChange,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.onClear}),this.ds=a,this.cm&&(this.cm.un("configchange",this.onColConfigChange,this),this.cm.un("widthchange",this.onColWidthChange,this),this.cm.un("headerchange",this.onHeaderChange,this),this.cm.un("hiddenchange",this.onHiddenChange,this),this.cm.un("columnmoved",this.onColumnMove,this)),b&&(delete this.lastViewWidth,b.on({scope:this,configchange:this.onColConfigChange,widthchange:this.onColWidthChange,headerchange:this.onHeaderChange,hiddenchange:this.onHiddenChange,columnmoved:this.onColumnMove})),this.cm=b},onDataChange:function(){this.refresh(),this.updateHeaderSortState(),this.syncFocusEl(0)},onClear:function(){this.refresh(),this.syncFocusEl(0)},onUpdate:function(a,b){this.refreshRow(b)},onAdd:function(a,b,c){this.insertRows(a,c,c+(b.length-1))},onRemove:function(a,b,c,d){d!==!0&&this.fireEvent("beforerowremoved",this,c,b),this.removeRow(c),d!==!0&&(this.processRows(c),this.applyEmptyText(),this.fireEvent("rowremoved",this,c,b))},onLoad:function(){Ext.isGecko?(this.scrollToTopTask||(this.scrollToTopTask=new Ext.util.DelayedTask(this.scrollToTop,this)),this.scrollToTopTask.delay(1)):this.scrollToTop()},onColWidthChange:function(a,b,c){this.updateColumnWidth(b,c)},onHeaderChange:function(a,b,c){this.updateHeaders()},onHiddenChange:function(a,b,c){this.updateColumnHidden(b,c)},onColumnMove:function(a,b,c){this.indexMap=null;var d=this.getScrollState();this.refresh(!0),this.restoreScroll(d),this.afterMove(c),this.grid.fireEvent("columnmove",b,c)},onColConfigChange:function(){delete this.lastViewWidth,this.indexMap=null,this.refresh(!0)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:function(){},onHeaderClick:function(a,b){if(this.headersDisabled||!this.cm.isSortable(b))return;a.stopEditing(!0),a.store.sort(this.cm.getDataIndex(b))},onRowOver:function(a,b){var c;(c=this.findRowIndex(b))!==!1&&this.addRowClass(c,"x-grid3-row-over")},onRowOut:function(a,b){var c;(c=this.findRowIndex(b))!==!1&&!a.within(this.getRow(c),!0)&&this.removeRowClass(c,"x-grid3-row-over")},handleWheel:function(a){a.stopPropagation()},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(a,b){var c=this.getCell(a,b);c&&this.fly(c).addClass("x-grid3-cell-selected")},onCellDeselect:function(a,b){var c=this.getCell(a,b);c&&this.fly(c).removeClass("x-grid3-cell-selected")},onColumnSplitterMoved:function(a,b){this.userResized=!0;var c=this.grid.colModel;c.setColumnWidth(a,b,!0),this.forceFit?(this.fitColumns(!0,!1,a),this.updateAllColumnWidths()):(this.updateColumnWidth(a,b),this.syncHeaderScroll()),this.grid.fireEvent("columnresize",a,b)},handleHdMenuClick:function(a){var b=this.hdCtxIndex,c=this.cm,d=this.ds,e=a.getItemId();switch(e){case"asc":d.sort(c.getDataIndex(b),"ASC");break;case"desc":d.sort(c.getDataIndex(b),"DESC");break;default:b=c.getIndexById(e.substr(4));if(b!=-1){if(a.checked&&c.getColumnsBy(this.isHideableColumn,this).length<=1)return this.onDenyColumnHide(),!1;c.setHidden(b,a.checked)}}return!0},isHideableColumn:function(a){return!a.hidden},beforeColMenuShow:function(){var a=this.cm,b=a.getColumnCount();this.colMenu.removeAll();for(var c=0;c<b;c++)a.config[c].hideable!==!1&&this.colMenu.add(new Ext.menu.CheckItem({itemId:"col-"+a.getColumnId(c),text:a.getColumnHeader(c),checked:!a.isHidden(c),hideOnClick:!1,disabled:a.config[c].hideable===!1}))},handleHdDown:function(a,b){if(Ext.fly(b).hasClass("x-grid3-hd-btn")){a.stopEvent();var c=this.findHeaderCell(b);Ext.fly(c).addClass("x-grid3-hd-menu-open");var d=this.getCellIndex(c);this.hdCtxIndex=d;var e=this.hmenu.items,f=this.cm;e.get("asc").setDisabled(!f.isSortable(d)),e.get("desc").setDisabled(!f.isSortable(d)),this.hmenu.on("hide",function(){Ext.fly(c).removeClass("x-grid3-hd-menu-open")},this,{single:!0}),this.hmenu.show(b,"tl-bl?")}},handleHdOver:function(a,b){var c=this.findHeaderCell(b);if(c&&!this.headersDisabled){this.activeHdRef=b,this.activeHdIndex=this.getCellIndex(c);var d=this.fly(c);this.activeHdRegion=d.getRegion(),this.cm.isMenuDisabled(this.activeHdIndex)||(d.addClass("x-grid3-hd-over"),this.activeHdBtn=d.child(".x-grid3-hd-btn"),this.activeHdBtn&&(this.activeHdBtn.dom.style.height=c.firstChild.offsetHeight-1+"px"))}},handleHdMove:function(a,b){var c=this.findHeaderCell(this.activeHdRef);if(c&&!this.headersDisabled){var d=this.splitHandleWidth||5,e=this.activeHdRegion,f=a.getPageX(),g=c.style,h="";this.grid.enableColumnResize!==!1&&(f-e.left<=d&&this.cm.isResizable(this.activeHdIndex-1)?h=Ext.isAir?"move":Ext.isWebKit?"e-resize":"col-resize":e.right-f<=(this.activeHdBtn?2:d)&&this.cm.isResizable(this.activeHdIndex)&&(h=Ext.isAir?"move":Ext.isWebKit?"w-resize":"col-resize")),g.cursor=h}},handleHdOut:function(a,b){var c=this.findHeaderCell(b);c&&(!Ext.isIE||!a.within(c,!0))&&(this.activeHdRef=null,this.fly(c).removeClass("x-grid3-hd-over"),c.style.cursor="")},hasRows:function(){var a=this.mainBody.dom.firstChild;return a&&a.nodeType==1&&a.className!="x-grid-empty"},bind:function(a,b){this.initData(a,b)}}),Ext.grid.GridView.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{constructor:function(a,b){this.grid=a,this.view=a.getView(),this.marker=this.view.resizeMarker,this.proxy=this.view.resizeProxy,Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,b,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:!1}),this.scroll=!1,this.hw=this.view.splitHandleWidth||5},b4StartDrag:function(a,b){this.dragHeadersDisabled=this.view.headersDisabled,this.view.headersDisabled=!0;var c=this.view.mainWrap.getHeight();this.marker.setHeight(c),this.marker.show(),this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]),this.proxy.setHeight(c);var d=this.cm.getColumnWidth(this.cellIndex),e=Math.max(d-this.grid.minColumnWidth,0);this.resetConstraints(),this.setXConstraint(e,1e3),this.setYConstraint(0,0),this.minX=a-e,this.maxX=a+1e3,this.startPos=a,Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,b)},allowHeaderDrag:function(a){return!0},handleMouseDown:function(a){var b=this.view.findHeaderCell(a.getTarget());if(b&&this.allowHeaderDrag(a)){var c=this.view.fly(b).getXY(),d=c[0],e=c[1],f=a.getXY(),g=f[0],h=b.offsetWidth,i=!1;g-d<=this.hw?i=-1:d+h-g<=this.hw&&(i=0);if(i!==!1){this.cm=this.grid.colModel;var j=this.view.getCellIndex(b);if(i==-1){if(j+i<0)return;while(this.cm.isHidden(j+i)){--i;if(j+i<0)return}}this.cellIndex=j+i,this.split=b.dom,this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)&&Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}else this.view.columnDrag&&this.view.columnDrag.callHandleMouseDown(a)}},endDrag:function(a){this.marker.hide();var b=this.view,c=Math.max(this.minX,a.getPageX()),d=c-this.startPos,e=this.dragHeadersDisabled;b.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+d),setTimeout(function(){b.headersDisabled=e},50)},autoOffset:function(){this.setDelta(0,0)}}),Ext.grid.HeaderDragZone=Ext.extend(Ext.dd.DragZone,{maxDragWidth:120,constructor:function(a,b,c){this.grid=a,this.view=a.getView(),this.ddGroup="gridHeader"+this.grid.getGridEl().id,Ext.grid.HeaderDragZone.superclass.constructor.call(this,b),c&&(this.setHandleElId(Ext.id(b)),this.setOuterHandleElId(Ext.id(c))),this.scroll=!1},getDragData:function(a){var b=Ext.lib.Event.getTarget(a),c=this.view.findHeaderCell(b);return c?{ddel:c.firstChild,header:c}:!1},onInitDrag:function(a){this.dragHeadersDisabled=this.view.headersDisabled,this.view.headersDisabled=!0;var b=this.dragData.ddel.cloneNode(!0);return b.id=Ext.id(),b.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px",this.proxy.update(b),!0},afterValidDrop:function(){this.completeDrop()},afterInvalidDrop:function(){this.completeDrop()},completeDrop:function(){var a=this.view,b=this.dragHeadersDisabled;setTimeout(function(){a.headersDisabled=b},50)}}),Ext.grid.HeaderDropZone=Ext.extend(Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,constructor:function(a,b,c){this.grid=a,this.view=a.getView(),this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},!0),this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},!0),this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100),this.setStyle("visibility","hidden")},this.ddGroup="gridHeader"+this.grid.getGridEl().id,Ext.grid.HeaderDropZone.superclass.constructor.call(this,a.getGridEl().dom)},getTargetFromEvent:function(a){var b=Ext.lib.Event.getTarget(a),c=this.view.findCellIndex(b);if(c!==!1)return this.view.getHeaderCell(c)},nextVisible:function(a){var b=this.view,c=this.grid.colModel;a=a.nextSibling;while(a){if(!c.isHidden(b.getCellIndex(a)))return a;a=a.nextSibling}return null},prevVisible:function(a){var b=this.view,c=this.grid.colModel;a=a.prevSibling;while(a){if(!c.isHidden(b.getCellIndex(a)))return a;a=a.prevSibling}return null},positionIndicator:function(a,b,c){var d=Ext.lib.Event.getPageX(c),e=Ext.lib.Dom.getRegion(b.firstChild),f,g,h=e.top+this.proxyOffsets[1];return e.right-d<=(e.right-e.left)/2?(f=e.right+this.view.borderWidth,g="after"):(f=e.left,g="before"),this.grid.colModel.isFixed(this.view.getCellIndex(b))?!1:(f+=this.proxyOffsets[0],this.proxyTop
.setLeftTop(f,h),this.proxyTop.show(),this.bottomOffset||(this.bottomOffset=this.view.mainHd.getHeight()),this.proxyBottom.setLeftTop(f,h+this.proxyTop.dom.offsetHeight+this.bottomOffset),this.proxyBottom.show(),g)},onNodeEnter:function(a,b,c,d){d.header!=a&&this.positionIndicator(d.header,a,c)},onNodeOver:function(a,b,c,d){var e=!1;return d.header!=a&&(e=this.positionIndicator(d.header,a,c)),e||(this.proxyTop.hide(),this.proxyBottom.hide()),e?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(a,b,c,d){this.proxyTop.hide(),this.proxyBottom.hide()},onNodeDrop:function(a,b,c,d){var e=d.header;if(e!=a){var f=this.grid.colModel,g=Ext.lib.Event.getPageX(c),h=Ext.lib.Dom.getRegion(a.firstChild),i=h.right-g<=(h.right-h.left)/2?"after":"before",j=this.view.getCellIndex(e),k=this.view.getCellIndex(a);return i=="after"&&k++,j<k&&k--,f.moveColumn(j,k),!0}return!1}}),Ext.grid.GridView.ColumnDragZone=Ext.extend(Ext.grid.HeaderDragZone,{constructor:function(a,b){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,a,b,null),this.proxy.el.addClass("x-grid3-col-dd")},handleMouseDown:function(a){},callHandleMouseDown:function(a){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,a)}}),Ext.grid.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{fly:Ext.Element.fly,constructor:function(a,b,c){this.grid=a,this.view=a.getView(),this.proxy=this.view.resizeProxy,Ext.grid.SplitDragZone.superclass.constructor.call(this,b,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:!1}),this.setHandleElId(Ext.id(b)),this.setOuterHandleElId(Ext.id(c)),this.scroll=!1},b4StartDrag:function(a,b){this.view.headersDisabled=!0,this.proxy.setHeight(this.view.mainWrap.getHeight());var c=this.cm.getColumnWidth(this.cellIndex),d=Math.max(c-this.grid.minColumnWidth,0);this.resetConstraints(),this.setXConstraint(d,1e3),this.setYConstraint(0,0),this.minX=a-d,this.maxX=a+1e3,this.startPos=a,Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,b)},handleMouseDown:function(a){var b=Ext.EventObject.setEvent(a),c=this.fly(b.getTarget());c.hasClass("x-grid-split")&&(this.cellIndex=this.view.getCellIndex(c.dom),this.split=c.dom,this.cm=this.grid.colModel,this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)&&Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments))},endDrag:function(a){this.view.headersDisabled=!1;var b=Math.max(this.minX,Ext.lib.Event.getPageX(a)),c=b-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+c)},autoOffset:function(){this.setDelta(0,0)}}),Ext.grid.GridDragZone=function(a,b){this.view=a.getView(),Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,b),this.scroll=!1,this.grid=a,this.ddel=document.createElement("div"),this.ddel.className="x-grid-dd-wrap"},Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(a){var b=Ext.lib.Event.getTarget(a),c=this.view.findRowIndex(b);if(c!==!1){var d=this.grid.selModel;return(!d.isSelected(c)||a.hasModifier())&&d.handleMouseDown(this.grid,c,a),{grid:this.grid,ddel:this.ddel,rowIndex:c,selections:d.getSelections()}}return!1},onInitDrag:function(a){var b=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText(),this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=!1},getRepairXY:function(a,b){return!1},onEndDrag:function(a,b){},onValidDrop:function(a,b,c){this.hideProxy()},beforeInvalidDrop:function(a,b){}}),Ext.grid.ColumnModel=Ext.extend(Ext.util.Observable,{defaultWidth:100,defaultSortable:!1,constructor:function(a){a.columns?(Ext.apply(this,a),this.setConfig(a.columns,!0)):this.setConfig(a,!0),this.addEvents("widthchange","headerchange","hiddenchange","columnmoved","configchange"),Ext.grid.ColumnModel.superclass.constructor.call(this)},getColumnId:function(a){return this.config[a].id},getColumnAt:function(a){return this.config[a]},setConfig:function(a,b){var c,d,e;if(!b){delete this.totalWidth;for(c=0,e=this.config.length;c<e;c++)d=this.config[c],d.setEditor&&d.setEditor(null)}this.defaults=Ext.apply({width:this.defaultWidth,sortable:this.defaultSortable},this.defaults),this.config=a,this.lookup={};for(c=0,e=a.length;c<e;c++){d=Ext.applyIf(a[c],this.defaults),Ext.isEmpty(d.id)&&(d.id=c);if(!d.isColumn){var f=Ext.grid.Column.types[d.xtype||"gridcolumn"];d=new f(d),a[c]=d}this.lookup[d.id]=d}b||this.fireEvent("configchange",this)},getColumnById:function(a){return this.lookup[a]},getIndexById:function(a){for(var b=0,c=this.config.length;b<c;b++)if(this.config[b].id==a)return b;return-1},moveColumn:function(a,b){var c=this.config[a];this.config.splice(a,1),this.config.splice(b,0,c),this.dataMap=null,this.fireEvent("columnmoved",this,a,b)},getColumnCount:function(a){if(a===!0){var b=0;for(var c=0,d=this.config.length;c<d;c++)this.isHidden(c)||b++;return b}return this.config.length},getColumnsBy:function(a,b){var c=[];for(var d=0,e=this.config.length;d<e;d++){var f=this.config[d];a.call(b||this,f,d)===!0&&(c[c.length]=f)}return c},isSortable:function(a){return!!this.config[a].sortable},isMenuDisabled:function(a){return!!this.config[a].menuDisabled},getRenderer:function(a){return this.config[a].renderer?this.config[a].renderer:Ext.grid.ColumnModel.defaultRenderer},getRendererScope:function(a){return this.config[a].scope},setRenderer:function(a,b){this.config[a].renderer=b},getColumnWidth:function(a){return this.config[a].width},setColumnWidth:function(a,b,c){this.config[a].width=b,this.totalWidth=null,c||this.fireEvent("widthchange",this,a,b)},getTotalWidth:function(a){if(!this.totalWidth){this.totalWidth=0;for(var b=0,c=this.config.length;b<c;b++)if(a||!this.isHidden(b))this.totalWidth+=this.getColumnWidth(b)}return this.totalWidth},getColumnHeader:function(a){return this.config[a].header},setColumnHeader:function(a,b){this.config[a].header=b,this.fireEvent("headerchange",this,a,b)},getColumnTooltip:function(a){return this.config[a].tooltip},setColumnTooltip:function(a,b){this.config[a].tooltip=b},getDataIndex:function(a){return this.config[a].dataIndex},setDataIndex:function(a,b){this.config[a].dataIndex=b},findColumnIndex:function(a){var b=this.config;for(var c=0,d=b.length;c<d;c++)if(b[c].dataIndex==a)return c;return-1},isCellEditable:function(a,b){var c=this.config[a],d=c.editable;return!!(d||!Ext.isDefined(d)&&c.editor)},getCellEditor:function(a,b){return this.config[a].getCellEditor(b)},setEditable:function(a,b){this.config[a].editable=b},isHidden:function(a){return!!this.config[a].hidden},isFixed:function(a){return!!this.config[a].fixed},isResizable:function(a){return a>=0&&this.config[a].resizable!==!1&&this.config[a].fixed!==!0},setHidden:function(a,b){var c=this.config[a];c.hidden!==b&&(c.hidden=b,this.totalWidth=null,this.fireEvent("hiddenchange",this,a,b))},setEditor:function(a,b){this.config[a].setEditor(b)},destroy:function(){var a;for(var b=0,c=this.config.length;b<c;b++)a=this.config[b],a.setEditor&&a.setEditor(null);this.purgeListeners()}}),Ext.grid.ColumnModel.defaultRenderer=function(a){return typeof a=="string"&&a.length<1?"&#160;":a},Ext.grid.AbstractSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(){this.locked=!1,Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)},init:function(a){this.grid=a,this.lockOnInit&&(delete this.lockOnInit,this.locked=!1,this.lock()),this.initEvents()},lock:function(){if(!this.locked){this.locked=!0;var a=this.grid;a?a.getView().on({scope:this,beforerefresh:this.sortUnLock,refresh:this.sortLock}):this.lockOnInit=!0}},sortLock:function(){this.locked=!0},sortUnLock:function(){this.locked=!1},unlock:function(){if(this.locked){this.locked=!1;var a=this.grid,b;a?(b=a.getView(),b.un("beforerefresh",this.sortUnLock,this),b.un("refresh",this.sortLock,this)):delete this.lockOnInit}},isLocked:function(){return this.locked},destroy:function(){this.unlock(),this.purgeListeners()}}),Ext.grid.RowSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{singleSelect:!1,constructor:function(a){Ext.apply(this,a),this.selections=new Ext.util.MixedCollection(!1,function(a){return a.id}),this.last=!1,this.lastActive=!1,this.addEvents("selectionchange","beforerowselect","rowselect","rowdeselect"),Ext.grid.RowSelectionModel.superclass.constructor.call(this)},initEvents:function(){!this.grid.enableDragDrop&&!this.grid.enableDrag&&this.grid.on("rowmousedown",this.handleMouseDown,this),this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{up:function(a){if(!a.shiftKey||this.singleSelect)this.selectPrevious(!1);else if(this.last!==!1&&this.lastActive!==!1){var b=this.last;this.selectRange(this.last,this.lastActive-1),this.grid.getView().focusRow(this.lastActive),b!==!1&&(this.last=b)}else this.selectFirstRow()},down:function(a){if(!a.shiftKey||this.singleSelect)this.selectNext(!1);else if(this.last!==!1&&this.lastActive!==!1){var b=this.last;this.selectRange(this.last,this.lastActive+1),this.grid.getView().focusRow(this.lastActive),b!==!1&&(this.last=b)}else this.selectFirstRow()},scope:this}),this.grid.getView().on({scope:this,refresh:this.onRefresh,rowupdated:this.onRowUpdated,rowremoved:this.onRemove})},onRefresh:function(){var a=this.grid.store,b,c=this.getSelections();this.clearSelections(!0);for(var d=0,e=c.length;d<e;d++){var f=c[d];(b=a.indexOfId(f.id))!=-1&&this.selectRow(b,!0)}c.length!=this.selections.getCount()&&this.fireEvent("selectionchange",this)},onRemove:function(a,b,c){this.selections.remove(c)!==!1&&this.fireEvent("selectionchange",this)},onRowUpdated:function(a,b,c){this.isSelected(c)&&a.onRowSelect(b)},selectRecords:function(a,b){b||this.clearSelections();var c=this.grid.store;for(var d=0,e=a.length;d<e;d++)this.selectRow(c.indexOf(a[d]),!0)},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(a){this.selectRow(this.grid.store.getCount()-1,a)},selectNext:function(a){return this.hasNext()?(this.selectRow(this.last+1,a),this.grid.getView().focusRow(this.last),!0):!1},selectPrevious:function(a){return this.hasPrevious()?(this.selectRow(this.last-1,a),this.grid.getView().focusRow(this.last),!0):!1},hasNext:function(){return this.last!==!1&&this.last+1<this.grid.store.getCount()},hasPrevious:function(){return!!this.last},getSelections:function(){return[].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},each:function(a,b){var c=this.getSelections();for(var d=0,e=c.length;d<e;d++)if(a.call(b||this,c[d],d)===!1)return!1;return!0},clearSelections:function(a){if(this.isLocked())return;if(a!==!0){var b=this.grid.store,c=this.selections;c.each(function(a){this.deselectRow(b.indexOfId(a.id))},this),c.clear()}else this.selections.clear();this.last=!1},selectAll:function(){if(this.isLocked())return;this.selections.clear();for(var a=0,b=this.grid.store.getCount();a<b;a++)this.selectRow(a,!0)},hasSelection:function(){return this.selections.length>0},isSelected:function(a){var b=Ext.isNumber(a)?this.grid.store.getAt(a):a;return b&&this.selections.key(b.id)?!0:!1},isIdSelected:function(a){return this.selections.key(a)?!0:!1},handleMouseDown:function(a,b,c){if(c.button!==0||this.isLocked())return;var d=this.grid.getView();if(c.shiftKey&&!this.singleSelect&&this.last!==!1){var e=this.last;this.selectRange(e,b,c.ctrlKey),this.last=e,d.focusRow(b)}else{var f=this.isSelected(b);if(c.ctrlKey&&f)this.deselectRow(b);else if(!f||this.getCount()>1)this.selectRow(b,c.ctrlKey||c.shiftKey),d.focusRow(b)}},selectRows:function(a,b){b||this.clearSelections();for(var c=0,d=a.length;c<d;c++)this.selectRow(a[c],!0)},selectRange:function(a,b,c){var d;if(this.isLocked())return;c||this.clearSelections();if(a<=b)for(d=a;d<=b;d++)this.selectRow(d,!0);else for(d=a;d>=b;d--)this.selectRow(d,!0)},deselectRange:function(a,b,c){if(this.isLocked())return;for(var d=a;d<=b;d++)this.deselectRow(d,c)},selectRow:function(a,b,c){if(this.isLocked()||a<0||a>=this.grid.store.getCount()||b&&this.isSelected(a))return;var d=this.grid.store.getAt(a);d&&this.fireEvent("beforerowselect",this,a,b,d)!==!1&&((!b||this.singleSelect)&&this.clearSelections(),this.selections.add(d),this.last=this.lastActive=a,c||this.grid.getView().onRowSelect(a),this.fireEvent("rowselect",this,a,d),this.fireEvent("selectionchange",this))},deselectRow:function(a,b){if(this.isLocked())return;this.last==a&&(this.last=!1),this.lastActive==a&&(this.lastActive=!1);var c=this.grid.store.getAt(a);c&&(this.selections.remove(c),b||this.grid.getView().onRowDeselect(a),this.fireEvent("rowdeselect",this,a,c),this.fireEvent("selectionchange",this))},restoreLast:function(){this._last&&(this.last=this._last)},acceptsNav:function(a,b,c){return!c.isHidden(b)&&c.isCellEditable(b,a)},onEditorKey:function(a,b){var c=b.getKey(),d,e=this.grid,f=e.lastEdit,g=e.activeEditor,h,f,i,j,k=b.shiftKey;c==b.TAB?(b.stopEvent(),g.completeEdit(),k?d=e.walkCells(g.row,g.col-1,-1,this.acceptsNav,this):d=e.walkCells(g.row,g.col+1,1,this.acceptsNav,this)):c==b.ENTER&&this.moveEditorOnEnter!==!1&&(k?d=e.walkCells(f.row-1,f.col,-1,this.acceptsNav,this):d=e.walkCells(f.row+1,f.col,1,this.acceptsNav,this)),d&&(i=d[0],j=d[1],f.row!=i&&this.selectRow(i),e.isEditor&&e.editing&&(h=e.activeEditor,h&&h.field.triggerBlur&&h.field.triggerBlur()),e.startEditing(i,j))},destroy:function(){this.rowNav&&(this.rowNav.disable(),this.rowNav=null),Ext.grid.RowSelectionModel.superclass.destroy.call(this)}}),Ext.grid.Column=Ext.extend(Object,{isColumn:!0,constructor:function(a){Ext.apply(this,a),Ext.isString(this.renderer)?this.renderer=Ext.util.Format[this.renderer]:Ext.isObject(this.renderer)&&(this.scope=this.renderer.scope,this.renderer=this.renderer.fn),this.scope||(this.scope=this);var b=this.editor;delete this.editor,this.setEditor(b)},renderer:function(a){return Ext.isString(a)&&a.length<1?"&#160;":a},getEditor:function(a){return this.editable!==!1?this.editor:null},setEditor:function(a){var b=this.editor;b&&(b.gridEditor?(b.gridEditor.destroy(),delete b.gridEditor):b.destroy()),this.editor=null,a&&(a.isXType||(a=Ext.create(a,"textfield")),this.editor=a)},getCellEditor:function(a){var b=this.getEditor(a);return b&&(b.startEdit||(b.gridEditor||(b.gridEditor=new Ext.grid.GridEditor(b)),b=b.gridEditor)),b}}),Ext.grid.BooleanColumn=Ext.extend(Ext.grid.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(a){Ext.grid.BooleanColumn.superclass.constructor.call(this,a);var b=this.trueText,c=this.falseText,d=this.undefinedText;this.renderer=function(a){return a===undefined?d:!a||a==="false"?c:b}}}),Ext.grid.NumberColumn=Ext.extend(Ext.grid.Column,{format:"0,000.00",constructor:function(a){Ext.grid.NumberColumn.superclass.constructor.call(this,a),this.renderer=Ext.util.Format.numberRenderer(this.format)}}),Ext.grid.DateColumn=Ext.extend(Ext.grid.Column,{format:"m/d/Y",constructor:function(a){Ext.grid.DateColumn.superclass.constructor.call(this,a),this.renderer=Ext.util.Format.dateRenderer(this.format)}}),Ext.grid.TemplateColumn=Ext.extend(Ext.grid.Column,{constructor:function(a){Ext.grid.TemplateColumn.superclass.constructor.call(this,a);var b=!Ext.isPrimitive(this.tpl)&&this.tpl.compile?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(a,c,d){return b.apply(d.data)},this.tpl=b}}),Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn},Ext.grid.RowNumberer=Ext.extend(Object,{header:"",width:23,sortable:!1,constructor:function(a){Ext.apply(this,a),this.rowspan&&(this.renderer=this.renderer.createDelegate(this))},fixed:!0,hideable:!1,menuDisabled:!0,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(a,b,c,d){return this.rowspan&&(b.cellAttr='rowspan="'+this.rowspan+'"'),d+1}}),Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'<div class="x-grid3-hd-checker">&#160;</div>',width:20,sortable:!1,menuDisabled:!0,fixed:!0,hideable:!1,dataIndex:"",id:"checker",constructor:function(){Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this,arguments),this.checkOnly&&(this.handleMouseDown=Ext.emptyFn)},initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this),this.grid.on("render",function(){var a=this.grid.getView();a.mainBody.on("mousedown",this.onMouseDown,this),Ext.fly(a.innerHd).on("mousedown",this.onHdMouseDown,this)},this)},handleMouseDown:function(){Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.apply(this,arguments),this.mouseHandled=!0},onMouseDown:function(a,b){if(a.button===0&&b.className=="x-grid3-row-checker"){a.stopEvent();var c=a.getTarget(".x-grid3-row");if(!this.mouseHandled&&c){var d=c.rowIndex;this.isSelected(d)?this.deselectRow(d):(this.selectRow(d,!0),this.grid.getView().focusRow(d))}}this.mouseHandled=!1},onHdMouseDown:function(a,b){if(b.className=="x-grid3-hd-checker"){a.stopEvent();var c=Ext.fly(b.parentNode),d=c.hasClass("x-grid3-hd-checker-on");d?(c.removeClass("x-grid3-hd-checker-on"),this.clearSelections()):(c.addClass("x-grid3-hd-checker-on"),this.selectAll())}},renderer:function(a,b,c){return'<div class="x-grid3-row-checker">&#160;</div>'}}),Ext.Toolbar=function(a){Ext.isArray(a)?a={items:a,layout:"toolbar"}:(a=Ext.apply({layout:"toolbar"},a),a.buttons&&(a.items=a.buttons)),Ext.Toolbar.superclass.constructor.call(this,a)},function(){var a=Ext.Toolbar;Ext.extend(a,Ext.Container,{defaultType:"button",enableOverflow:!1,trackMenus:!0,internalDefaults:{removeMode:"container",hideParent:!0},toolbarCls:"x-toolbar",initComponent:function(){a.superclass.initComponent.call(this),this.addEvents("overflowchange")},onRender:function(a,b){this.el||(this.autoCreate||(this.autoCreate={cls:this.toolbarCls+" x-small-editor"}),this.el=a.createChild(Ext.apply({id:this.id},this.autoCreate),b),Ext.Toolbar.superclass.onRender.apply(this,arguments))},lookupComponent:function(b){return Ext.isString(b)?(b=="-"?b=new a.Separator:b==" "?b=new a.Spacer:b=="->"?b=new a.Fill:b=new a.TextItem(b),this.applyDefaults(b)):b.isFormField||b.render?b=this.createComponent(b):b.tag?b=new a.Item({autoEl:b}):b.tagName?b=new a.Item({el:b}):Ext.isObject(b)&&(b=b.xtype?this.createComponent(b):this.constructButton(b)),b},applyDefaults:function(a){if(!Ext.isString(a)){a=Ext.Toolbar.superclass.applyDefaults.call(this,a);var b=this.internalDefaults;a.events?(Ext.applyIf(a.initialConfig,b),Ext.apply(a,b)):Ext.applyIf(a,b)}return a},addSeparator:function(){return this.add(new a.Separator)},addSpacer:function(){return this.add(new a.Spacer)},addFill:function(){this.add(new a.Fill)},addElement:function(b){return this.addItem(new a.Item({el:b}))},addItem:function(a){return this.add.apply(this,arguments)},addButton:function(a){if(Ext.isArray(a)){var b=[];for(var c=0,d=a.length;c<d;c++)b.push(this.addButton(a[c]));return b}return this.add(this.constructButton(a))},addText:function(b){return this.addItem(new a.TextItem(b))},addDom:function(b){return this.add(new a.Item({autoEl:b}))},addField:function(a){return this.add(a)},insertButton:function(a,b){if(Ext.isArray(b)){var c=[];for(var d=0,e=b.length;d<e;d++)c.push(this.insertButton(a+d,b[d]));return c}return Ext.Toolbar.superclass.insert.call(this,a,b)},trackMenu:function(a,b){if(this.trackMenus&&a.menu){var c=b?"mun":"mon";this[c](a,"menutriggerover",this.onButtonTriggerOver,this),this[c](a,"menushow",this.onButtonMenuShow,this),this[c](a,"menuhide",this.onButtonMenuHide,this)}},constructButton:function(a){var b=a.events?a:this.createComponent(a,a.split?"splitbutton":this.defaultType);return b},onAdd:function(a){Ext.Toolbar.superclass.onAdd.call(this),this.trackMenu(a),this.disabled&&a.disable()},onRemove:function(a){Ext.Toolbar.superclass.onRemove.call(this),this.trackMenu(a,!0)},onDisable:function(){this.items.each(function(a){a.disable&&a.disable()})},onEnable:function(){this.items.each(function(a){a.enable&&a.enable()})},onButtonTriggerOver:function(a){this.activeMenuBtn&&this.activeMenuBtn!=a&&(this.activeMenuBtn.hideMenu(),a.showMenu(),this.activeMenuBtn=a)},onButtonMenuShow:function(a){this.activeMenuBtn=a},onButtonMenuHide:function(a){delete this.activeMenuBtn}}),Ext.reg("toolbar",Ext.Toolbar),a.Item=Ext.extend(Ext.BoxComponent,{hideParent:!0,enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn}),Ext.reg("tbitem",a.Item),a.Separator=Ext.extend(a.Item,{onRender:function(a,b){this.el=a.createChild({tag:"span",cls:"xtb-sep"},b)}}),Ext.reg("tbseparator",a.Separator),a.Spacer=Ext.extend(a.Item,{onRender:function(a,b){this.el=a.createChild({tag:"div",cls:"xtb-spacer",style:this.width?"width:"+this.width+"px":""},b)}}),Ext.reg("tbspacer",a.Spacer),a.Fill=Ext.extend(a.Item,{render:Ext.emptyFn,isFill:!0}),Ext.reg("tbfill",a.Fill),a.TextItem=Ext.extend(a.Item,{constructor:function(b){a.TextItem.superclass.constructor.call(this,Ext.isString(b)?{text:b}:b)},onRender:function(b,c){this.autoEl={cls:"xtb-text",html:this.text||""},a.TextItem.superclass.onRender.call(this,b,c)},setText:function(a){this.rendered?this.el.update(a):this.text=a}}),Ext.reg("tbtext",a.TextItem),a.Button=Ext.extend(Ext.Button,{}),a.SplitButton=Ext.extend(Ext.SplitButton,{}),Ext.reg("tbbutton",a.Button),Ext.reg("tbsplit",a.SplitButton)}(),Ext.ButtonGroup=Ext.extend(Ext.Panel,{baseCls:"x-btn-group",layout:"table",defaultType:"button",frame:!0,internalDefaults:{removeMode:"container",hideParent:!0},initComponent:function(){this.layoutConfig=this.layoutConfig||{},Ext.applyIf(this.layoutConfig,{columns:this.columns}),this.title||this.addClass("x-btn-group-notitle"),this.on("afterlayout",this.onAfterLayout,this),Ext.ButtonGroup.superclass.initComponent.call(this)},applyDefaults:function(a){a=Ext.ButtonGroup.superclass.applyDefaults.call(this,a);var b=this.internalDefaults;return a.events?(Ext.applyIf(a.initialConfig,b),Ext.apply(a,b)):Ext.applyIf(a,b),a},onAfterLayout:function(){var a=this.body.getFrameWidth("lr")+this.body.dom.firstChild.offsetWidth;this.body.setWidth(a),this.el.setWidth(a+this.getFrameWidth())}}),Ext.reg("buttongroup",Ext.ButtonGroup),function(){var a=Ext.Toolbar;Ext.PagingToolbar=Ext.extend(Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",initComponent:function(){var b=[this.first=new a.Button({tooltip:this.firstText,overflowText:this.firstText,iconCls:"x-tbar-page-first",disabled:!0,handler:this.moveFirst,scope:this}),this.prev=new a.Button({tooltip:this.prevText,overflowText:this.prevText,iconCls:"x-tbar-page-prev",disabled:!0,handler:this.movePrevious,scope:this}),"-",this.beforePageText,this.inputItem=new Ext.form.NumberField({cls:"x-tbar-page-number",allowDecimals:!1,allowNegative:!1,enableKeyEvents:!0,selectOnFocus:!0,submitValue:!1,listeners:{scope:this,keydown:this.onPagingKeyDown,blur:this.onPagingBlur}}),this.afterTextItem=new a.TextItem({text:String.format(this.afterPageText,1)}),"-",this.next=new a.Button({tooltip:this.nextText,overflowText:this.nextText,iconCls:"x-tbar-page-next",disabled:!0,handler:this.moveNext,scope:this}),this.last=new a.Button({tooltip:this.lastText,overflowText:this.lastText,iconCls:"x-tbar-page-last",disabled:!0,handler:this.moveLast,scope:this}),"-",this.refresh=new a.Button({tooltip:this.refreshText,overflowText:this.refreshText,iconCls:"x-tbar-loading",handler:this.doRefresh,scope:this})],c=this.items||this.buttons||[];this.prependButtons?this.items=c.concat(b):this.items=b.concat(c),delete this.buttons,this.displayInfo&&(this.items.push("->"),this.items.push(this.displayItem=new a.TextItem({}))),Ext.PagingToolbar.superclass.initComponent.call(this),this.addEvents("change","beforechange"),this.on("afterlayout",this.onFirstLayout,this,{single:!0}),this.cursor=0,this.bindStore(this.store,!0)},onFirstLayout:function(){this.dsLoaded&&this.onLoad.apply(this,this.dsLoaded)},updateInfo:function(){if(this.displayItem){var a=this.store.getCount(),b=a==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+a,this.store.getTotalCount());this.displayItem.setText(b)}},onLoad:function(a,b,c){if(!this.rendered){this.dsLoaded=[a,b,c];return}var d=this.getParams();this.cursor=c.params&&c.params[d.start]?c.params[d.start]:0;var e=this.getPageData(),f=e.activePage,g=e.pages;this.afterTextItem.setText(String.format(this.afterPageText,e.pages)),this.inputItem.setValue(f),this.first.setDisabled(f==1),this.prev.setDisabled(f==1),this.next.setDisabled(f==g),this.last.setDisabled(f==g),this.refresh.enable(),this.updateInfo(),this.fireEvent("change",this,e)},getPageData:function(){var a=this.store.getTotalCount();return{total:a,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:a<this.pageSize?1:Math.ceil(a/this.pageSize)}},changePage:function(a){this.doLoad(((a-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onLoadError:function(){if(!this.rendered)return;this.refresh.enable()},readPage:function(a){var b=this.inputItem.getValue(),c;return!b||isNaN(c=parseInt(b,10))?(this.inputItem.setValue(a.activePage),!1):c},onPagingFocus:function(){this.inputItem.select()},onPagingBlur:function(a){this.inputItem.setValue(this.getPageData().activePage)},onPagingKeyDown:function(a,b){var c=b.getKey(),d=this.getPageData(),e;if(c==b.RETURN)b.stopEvent(),e=this.readPage(d),e!==!1&&(e=Math.min(Math.max(1,e),d.pages)-1,this.doLoad(e*this.pageSize));else if(c==b.HOME||c==b.END)b.stopEvent(),e=c==b.HOME?1:d.pages,a.setValue(e);else if(c==b.UP||c==b.PAGEUP||c==b.DOWN||c==b.PAGEDOWN){b.stopEvent();if(e=this.readPage(d)){var f=b.shiftKey?10:1;if(c==b.DOWN||c==b.PAGEDOWN)f*=-1;e+=f,e>=1&e<=d.pages&&a.setValue(e)}}},getParams:function(){return this.paramNames||this.store.paramNames},beforeLoad:function(){this.rendered&&this.refresh&&this.refresh.disable()},doLoad:function(a){var b={},c=this.getParams();b[c.start]=a,b[c.limit]=this.pageSize,this.fireEvent("beforechange",this,b)!==!1&&this.store.load({params:b})},moveFirst:function(){this.doLoad(0)},movePrevious:function(){this.doLoad(Math.max(0,this.cursor-this.pageSize))},moveNext:function(){this.doLoad(this.cursor+this.pageSize)},moveLast:function(){var a=this.store.getTotalCount(),b=a%this.pageSize;this.doLoad(b?a-b:a-this.pageSize)},doRefresh:function(){this.doLoad(this.cursor)},bindStore:function(a,b){var c;!b&&this.store&&(a!==this.store&&this.store.autoDestroy?this.store.destroy():(this.store.un("beforeload",this.beforeLoad,this),this.store.un("load",this.onLoad,this),this.store.un("exception",this.onLoadError,this)),a||(this.store=null)),a&&(a=Ext.StoreMgr.lookup(a),a.on({scope:this,beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError}),c=!0),this.store=a,c&&this.onLoad(a,null,{})},unbind:function(a){this.bindStore(null)},bind:function(a){this.bindStore(a)},onDestroy:function(){this.bindStore(null),Ext.PagingToolbar.superclass.onDestroy.call(this)}})}(),Ext.reg("paging",Ext.PagingToolbar),Ext.menu.Menu=Ext.extend(Ext.Container,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:!1,ignoreParentClicks:!1,enableScrolling:!0,maxHeight:null,scrollIncrement:24,showSeparator:!0,defaultOffsets:[0,0],plain:!1,floating:!0,zIndex:15e3,hidden:!0,layout:"menu",hideMode:"offsets",scrollerHeight:8,autoLayout:!0,defaultType:"menuitem",bufferResize:!1,initComponent:function(){Ext.isArray(this.initialConfig)&&Ext.apply(this,{items:this.initialConfig}),this.addEvents("click","mouseover","mouseout","itemclick"),Ext.menu.MenuMgr.register(this),this.floating?Ext.EventManager.onWindowResize(this.hide,this):(this.initialConfig.hidden!==!1&&(this.hidden=!1),this.internalDefaults={hideOnClick:!1}),Ext.menu.Menu.superclass.initComponent.call(this);if(this.autoLayout){var a=this.doLayout.createDelegate(this,[]);this.on({add:a,remove:a})}},getLayoutTarget:function(){return this.ul},onRender:function(a,b){a||(a=Ext.getBody());var c={id:this.getId(),cls:"x-menu "+(this.floating?"x-menu-floating x-layer ":"")+(this.cls||"")+(this.plain?" x-menu-plain":"")+(this.showSeparator?"":" x-menu-nosep"),style:this.style,cn:[{tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"},{tag:"ul",cls:"x-menu-list"}]};this.floating?this.el=new Ext.Layer({shadow:this.shadow,dh:c,constrain:!1,parentEl:a,zindex:this.zIndex}):this.el=a.createChild(c),Ext.menu.Menu.superclass.onRender.call(this,a,b),this.keyNav||(this.keyNav=new Ext.menu.MenuNav(this)),this.focusEl=this.el.child("a.x-menu-focus"),this.ul=this.el.child("ul.x-menu-list"),this.mon(this.ul,{scope:this,click:this.onClick,mouseover:this.onMouseOver,mouseout:this.onMouseOut}),this.enableScrolling&&this.mon(this.el,{scope:this,delegate:".x-menu-scroller",click:this.onScroll,mouseover:this.deactivateActive})},findTargetItem:function(a){var b=a.getTarget(".x-menu-list-item",this.ul,!0);if(b&&b.menuItemId)return this.items.get(b.menuItemId)},onClick:function(a){var b=this.findTargetItem(a);b&&(b.isFormField?this.setActiveItem(b):b instanceof Ext.menu.BaseItem&&(b.menu&&this.ignoreParentClicks?(b.expandMenu(),a.preventDefault()):b.onClick&&(b.onClick(a),this.fireEvent("click",this,b,a))))},setActiveItem:function(a,b){a!=this.activeItem?(this.deactivateActive(),(this.activeItem=a).isFormField?a.focus():a.activate(b)):b&&a.expandMenu()},deactivateActive:function(){var a=this.activeItem;a&&(a.isFormField?a.collapse&&a.collapse():a.deactivate(),delete this.activeItem)},tryActivate:function(a,b){var c=this.items;for(var d=a,e=c.length;d>=0&&d<e;d+=b){var f=c.get(d);if(!f.disabled&&(f.canActivate||f.isFormField))return this.setActiveItem(f,!1),f}return!1},onMouseOver:function(a){var b=this.findTargetItem(a);b&&b.canActivate&&!b.disabled&&this.setActiveItem(b,!0),this.over=!0,this.fireEvent("mouseover",this,a,b)},onMouseOut:function(a){var b=this.findTargetItem(a);b&&b==this.activeItem&&b.shouldDeactivate&&b.shouldDeactivate(a)&&(this.activeItem.deactivate(),delete this.activeItem),this.over=!1,this.fireEvent("mouseout",this,a,b)},onScroll:function(a,b){a&&a.stopEvent();var c=this.ul.dom,d=Ext.fly(b).is(".x-menu-scroller-top");c.scrollTop+=this.scrollIncrement*(d?-1:1),(d?c.scrollTop<=0:c.scrollTop+this.activeMax>=c.scrollHeight)&&this.onScrollerOut(null,b)},onScrollerIn:function(a,b){var c=this.ul.dom,d=Ext.fly(b).is(".x-menu-scroller-top");(d?c.scrollTop>0:c.scrollTop+this.activeMax<c.scrollHeight)&&Ext.fly(b).addClass(["x-menu-item-active","x-menu-scroller-active"])},onScrollerOut:function(a,b){Ext.fly(b).removeClass(["x-menu-item-active","x-menu-scroller-active"])},show:function(a,b,c){this.floating?(this.parentMenu=c,this.el||(this.render(),this.doLayout(!1,!0)),this.showAt(this.el.getAlignToXY(a,b||this.defaultAlign,this.defaultOffsets),c)):Ext.menu.Menu.superclass.show.call(this)},showAt:function(a,b){this.fireEvent("beforeshow",this)!==!1&&(this.parentMenu=b,this.el||this.render(),this.enableScrolling?(this.el.setXY(a),a[1]=this.constrainScroll(a[1]),a=[this.el.adjustForConstraints(a)[0],a[1]]):a=this.el.adjustForConstraints(a),this.el.setXY(a),this.el.show(),Ext.menu.Menu.superclass.onShow.call(this),Ext.isIE&&(this.fireEvent("autosize",this),Ext.isIE8||this.el.repaint()),this.hidden=!1,this.focus(),this.fireEvent("show",this))},constrainScroll:function(a){var b,c=this.ul.setHeight("auto").getHeight(),d=a,e,f,g,h;return this.floating?(f=Ext.fly(this.el.dom.parentNode),g=f.getScroll().top,h=f.getViewSize().height,e=a-g,b=this.maxHeight?this.maxHeight:h-e,c>h?(b=h,d=a-e):b<c&&(d=a-(c-b),b=c)):b=this.getHeight(),this.maxHeight&&(b=Math.min(this.maxHeight,b)),c>b&&b>0?(this.activeMax=b-this.scrollerHeight*2-this.el.getFrameWidth("tb")-Ext.num(this.el.shadowOffset,0),this.ul.setHeight(this.activeMax),this.createScrollers(),this.el.select(".x-menu-scroller").setDisplayed("")):(this.ul.setHeight(c),this.el.select(".x-menu-scroller").setDisplayed("none")),this.ul.dom.scrollTop=0,d},createScrollers:function(){this.scroller||(this.scroller={pos:0,top:this.el.insertFirst({tag:"div",cls:"x-menu-scroller x-menu-scroller-top",html:"&#160;"}),bottom:this.el.createChild({tag:"div",cls:"x-menu-scroller x-menu-scroller-bottom",html:"&#160;"})},this.scroller.top.hover(this.onScrollerIn,this.onScrollerOut,this),this.scroller.topRepeater=new Ext.util.ClickRepeater(this.scroller.top,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.top],!1)}}),this.scroller.bottom.hover(this.onScrollerIn,this.onScrollerOut,this),this.scroller.bottomRepeater=new Ext.util.ClickRepeater(this.scroller.bottom,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.bottom],!1)}}))},onLayout:function(){this.isVisible()&&(this.enableScrolling&&this.constrainScroll
(this.el.getTop()),this.floating&&this.el.sync())},focus:function(){this.hidden||this.doFocus.defer(50,this)},doFocus:function(){this.hidden||this.focusEl.focus()},hide:function(a){this.isDestroyed||(this.deepHide=a,Ext.menu.Menu.superclass.hide.call(this),delete this.deepHide)},onHide:function(){Ext.menu.Menu.superclass.onHide.call(this),this.deactivateActive(),this.el&&this.floating&&this.el.hide();var a=this.parentMenu;this.deepHide===!0&&a&&(a.floating?a.hide(!0):a.deactivateActive())},lookupComponent:function(a){if(Ext.isString(a))a=a=="separator"||a=="-"?new Ext.menu.Separator:new Ext.menu.TextItem(a),this.applyDefaults(a);else if(Ext.isObject(a))a=this.getMenuItem(a);else if(a.tagName||a.el)a=new Ext.BoxComponent({el:a});return a},applyDefaults:function(a){if(!Ext.isString(a)){a=Ext.menu.Menu.superclass.applyDefaults.call(this,a);var b=this.internalDefaults;b&&(a.events?(Ext.applyIf(a.initialConfig,b),Ext.apply(a,b)):Ext.applyIf(a,b))}return a},getMenuItem:function(a){return a.isXType?a:!a.xtype&&Ext.isBoolean(a.checked)?new Ext.menu.CheckItem(a):Ext.create(a,this.defaultType)},addSeparator:function(){return this.add(new Ext.menu.Separator)},addElement:function(a){return this.add(new Ext.menu.BaseItem({el:a}))},addItem:function(a){return this.add(a)},addMenuItem:function(a){return this.add(this.getMenuItem(a))},addText:function(a){return this.add(new Ext.menu.TextItem(a))},onDestroy:function(){Ext.EventManager.removeResizeListener(this.hide,this);var a=this.parentMenu;a&&a.activeChild==this&&delete a.activeChild,delete this.parentMenu,Ext.menu.Menu.superclass.onDestroy.call(this),Ext.menu.MenuMgr.unregister(this),this.keyNav&&this.keyNav.disable();var b=this.scroller;b&&Ext.destroy(b.topRepeater,b.bottomRepeater,b.top,b.bottom),Ext.destroy(this.el,this.focusEl,this.ul)}}),Ext.reg("menu",Ext.menu.Menu),Ext.menu.MenuNav=Ext.extend(Ext.KeyNav,function(){function a(a,b){b.tryActivate(b.items.indexOf(b.activeItem)-1,-1)||b.tryActivate(b.items.length-1,-1)}function b(a,b){b.tryActivate(b.items.indexOf(b.activeItem)+1,1)||b.tryActivate(0,1)}return{constructor:function(a){Ext.menu.MenuNav.superclass.constructor.call(this,a.el),this.scope=this.menu=a},doRelay:function(a,b){var c=a.getKey();return this.menu.activeItem&&this.menu.activeItem.isFormField&&c!=a.TAB?!1:!this.menu.activeItem&&a.isNavKeyPress()&&c!=a.SPACE&&c!=a.RETURN?(this.menu.tryActivate(0,1),!1):b.call(this.scope||this,a,this.menu)},tab:function(c,d){c.stopEvent(),c.shiftKey?a(c,d):b(c,d)},up:a,down:b,right:function(a,b){b.activeItem&&b.activeItem.expandMenu(!0)},left:function(a,b){b.hide(),b.parentMenu&&b.parentMenu.activeItem&&b.parentMenu.activeItem.activate()},enter:function(a,b){if(b.activeItem)return a.stopPropagation(),b.activeItem.onClick(a),b.fireEvent("click",this,b.activeItem),!0}}}()),Ext.menu.MenuMgr=function(){function f(){a={},b=new Ext.util.MixedCollection,Ext.getDoc().addKeyListener(27,function(){b.length>0&&g()})}function g(){if(b&&b.length>0){var a=b.clone();return a.each(function(a){a.hide()}),!0}return!1}function h(a){b.remove(a),b.length<1&&(Ext.getDoc().un("mousedown",l),d=!1)}function i(a){var c=b.last();e=new Date,b.add(a),d||(Ext.getDoc().on("mousedown",l),d=!0),a.parentMenu?(a.getEl().setZIndex(parseInt(a.parentMenu.getEl().getStyle("z-index"),10)+3),a.parentMenu.activeChild=a):c&&!c.isDestroyed&&c.isVisible()&&a.getEl().setZIndex(parseInt(c.getEl().getStyle("z-index"),10)+3)}function j(a){a.activeChild&&a.activeChild.hide(),a.autoHideTimer&&(clearTimeout(a.autoHideTimer),delete a.autoHideTimer)}function k(a){var b=a.parentMenu;!b&&!a.allowOtherMenus?g():b&&b.activeChild&&b.activeChild.hide()}function l(a){e.getElapsed()>50&&b.length>0&&!a.getTarget(".x-menu")&&g()}function m(a,b){if(b){var d=c[a.group];for(var e=0,f=d.length;e<f;e++)d[e]!=a&&d[e].setChecked(!1)}}var a,b,c={},d=!1,e=new Date;return{hideAll:function(){return g()},register:function(b){a||f(),a[b.id]=b,b.on({beforehide:j,hide:h,beforeshow:k,show:i})},get:function(b){return typeof b=="string"?a?a[b]:null:b.events?b:typeof b.length=="number"?new Ext.menu.Menu({items:b}):Ext.create(b,"menu")},unregister:function(b){delete a[b.id],b.un("beforehide",j),b.un("hide",h),b.un("beforeshow",k),b.un("show",i)},registerCheckable:function(a){var b=a.group;b&&(c[b]||(c[b]=[]),c[b].push(a),a.on("beforecheckchange",m))},unregisterCheckable:function(a){var b=a.group;b&&(c[b].remove(a),a.un("beforecheckchange",m))},getCheckedItem:function(a){var b=c[a];if(b)for(var d=0,e=b.length;d<e;d++)if(b[d].checked)return b[d];return null},setCheckedItem:function(a,b){var d=c[a];if(d)for(var e=0,f=d.length;e<f;e++)d[e].id==b&&d[e].setChecked(!0);return null}}}(),Ext.menu.BaseItem=Ext.extend(Ext.Component,{canActivate:!1,activeClass:"x-menu-item-active",hideOnClick:!0,clickHideDelay:1,ctype:"Ext.menu.BaseItem",actionMode:"container",initComponent:function(){Ext.menu.BaseItem.superclass.initComponent.call(this),this.addEvents("click","activate","deactivate"),this.handler&&this.on("click",this.handler,this.scope)},onRender:function(a,b){Ext.menu.BaseItem.superclass.onRender.apply(this,arguments),this.ownerCt&&this.ownerCt instanceof Ext.menu.Menu?this.parentMenu=this.ownerCt:(this.container.addClass("x-menu-list-item"),this.mon(this.el,{scope:this,click:this.onClick,mouseenter:this.activate,mouseleave:this.deactivate}))},setHandler:function(a,b){this.handler&&this.un("click",this.handler,this.scope),this.on("click",this.handler=a,this.scope=b)},onClick:function(a){!this.disabled&&this.fireEvent("click",this,a)!==!1&&this.parentMenu&&this.parentMenu.fireEvent("itemclick",this,a)!==!1?this.handleClick(a):a.stopEvent()},activate:function(){if(this.disabled)return!1;var a=this.container;return a.addClass(this.activeClass),this.region=a.getRegion().adjust(2,2,-2,-2),this.fireEvent("activate",this),!0},deactivate:function(){this.container.removeClass(this.activeClass),this.fireEvent("deactivate",this)},shouldDeactivate:function(a){return!this.region||!this.region.contains(a.getPoint())},handleClick:function(a){var b=this.parentMenu;this.hideOnClick&&(b.floating?b.hide.defer(this.clickHideDelay,b,[!0]):b.deactivateActive())},expandMenu:Ext.emptyFn,hideMenu:Ext.emptyFn}),Ext.reg("menubaseitem",Ext.menu.BaseItem),Ext.menu.TextItem=Ext.extend(Ext.menu.BaseItem,{hideOnClick:!1,itemCls:"x-menu-text",constructor:function(a){typeof a=="string"&&(a={text:a}),Ext.menu.TextItem.superclass.constructor.call(this,a)},onRender:function(){var a=document.createElement("span");a.className=this.itemCls,a.innerHTML=this.text,this.el=a,Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}}),Ext.reg("menutextitem",Ext.menu.TextItem),Ext.menu.Separator=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:!1,activeClass:"",onRender:function(a){var b=document.createElement("span");b.className=this.itemCls,b.innerHTML="&#160;",this.el=b,a.addClass("x-menu-sep-li"),Ext.menu.Separator.superclass.onRender.apply(this,arguments)}}),Ext.reg("menuseparator",Ext.menu.Separator),Ext.menu.Item=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:!0,showDelay:200,hideDelay:200,ctype:"Ext.menu.Item",initComponent:function(){Ext.menu.Item.superclass.initComponent.call(this),this.menu&&(this.menu=Ext.menu.MenuMgr.get(this.menu),this.menu.ownerCt=this)},onRender:function(a,b){this.itemTpl||(this.itemTpl=Ext.menu.Item.prototype.itemTpl=new Ext.XTemplate('<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}"','<tpl if="hrefTarget">',' target="{hrefTarget}"',"</tpl>",">",'<img src="{icon}" class="x-menu-item-icon {iconCls}"/>','<span class="x-menu-item-text">{text}</span>',"</a>"));var c=this.getTemplateArgs();this.el=b?this.itemTpl.insertBefore(b,c,!0):this.itemTpl.append(a,c,!0),this.iconEl=this.el.child("img.x-menu-item-icon"),this.textEl=this.el.child(".x-menu-item-text"),this.href||this.mon(this.el,"click",Ext.emptyFn,null,{preventDefault:!0}),Ext.menu.Item.superclass.onRender.call(this,a,b)},getTemplateArgs:function(){return{id:this.id,cls:this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:""),href:this.href||"#",hrefTarget:this.hrefTarget,icon:this.icon||Ext.BLANK_IMAGE_URL,iconCls:this.iconCls||"",text:this.itemText||this.text||"&#160;"}},setText:function(a){this.text=a||"&#160;",this.rendered&&(this.textEl.update(this.text),this.parentMenu.layout.doAutoSize())},setIconClass:function(a){var b=this.iconCls;this.iconCls=a,this.rendered&&this.iconEl.replaceClass(b,this.iconCls)},beforeDestroy:function(){this.menu&&(delete this.menu.ownerCt,this.menu.destroy()),Ext.menu.Item.superclass.beforeDestroy.call(this)},handleClick:function(a){this.href||a.stopEvent(),Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(a){return Ext.menu.Item.superclass.activate.apply(this,arguments)&&(this.focus(),a&&this.expandMenu()),!0},shouldDeactivate:function(a){return Ext.menu.Item.superclass.shouldDeactivate.call(this,a)?this.menu&&this.menu.isVisible()?!this.menu.getEl().getRegion().contains(a.getPoint()):!0:!1},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments),this.hideMenu()},expandMenu:function(a){!this.disabled&&this.menu&&(clearTimeout(this.hideTimer),delete this.hideTimer,!this.menu.isVisible()&&!this.showTimer?this.showTimer=this.deferExpand.defer(this.showDelay,this,[a]):this.menu.isVisible()&&a&&this.menu.tryActivate(0,1))},deferExpand:function(a){delete this.showTimer,this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu),a&&this.menu.tryActivate(0,1)},hideMenu:function(){clearTimeout(this.showTimer),delete this.showTimer,!this.hideTimer&&this.menu&&this.menu.isVisible()&&(this.hideTimer=this.deferHide.defer(this.hideDelay,this))},deferHide:function(){delete this.hideTimer,this.menu.over?this.parentMenu.setActiveItem(this,!1):this.menu.hide()}}),Ext.reg("menuitem",Ext.menu.Item),Ext.menu.CheckItem=Ext.extend(Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:!1,ctype:"Ext.menu.CheckItem",initComponent:function(){Ext.menu.CheckItem.superclass.initComponent.call(this),this.addEvents("beforecheckchange","checkchange"),this.checkHandler&&this.on("checkchange",this.checkHandler,this.scope),Ext.menu.MenuMgr.registerCheckable(this)},onRender:function(a){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments),this.group&&this.el.addClass(this.groupClass),this.checked&&(this.checked=!1,this.setChecked(!0,!0))},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this),Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(a,b){var c=b===!0;this.checked!=a&&(c||this.fireEvent("beforecheckchange",this,a)!==!1)&&(this.container&&this.container[a?"addClass":"removeClass"]("x-menu-item-checked"),this.checked=a,c||this.fireEvent("checkchange",this,a))},handleClick:function(a){!this.disabled&&(!this.checked||!this.group)&&this.setChecked(!this.checked),Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}}),Ext.reg("menucheckitem",Ext.menu.CheckItem),Ext.menu.DateMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:!1,hideOnClick:!0,pickerId:null,cls:"x-date-menu",initComponent:function(){this.on("beforeshow",this.onBeforeShow,this),(this.strict=Ext.isIE7&&Ext.isStrict)&&this.on("show",this.onShow,this,{single:!0,delay:20}),Ext.apply(this,{plain:!0,showSeparator:!1,items:this.picker=new Ext.DatePicker(Ext.applyIf({internalRender:this.strict||!Ext.isIE,ctCls:"x-menu-date-item",id:this.pickerId},this.initialConfig))}),this.picker.purgeListeners(),Ext.menu.DateMenu.superclass.initComponent.call(this),this.relayEvents(this.picker,["select"]),this.on("show",this.picker.focus,this.picker),this.on("select",this.menuHide,this),this.handler&&this.on("select",this.handler,this.scope||this)},menuHide:function(){this.hideOnClick&&this.hide(!0)},onBeforeShow:function(){this.picker&&this.picker.hideMonthPicker(!0)},onShow:function(){var a=this.picker.getEl();a.setWidth(a.getWidth())}}),Ext.reg("datemenu",Ext.menu.DateMenu),Ext.menu.ColorMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:!1,hideOnClick:!0,cls:"x-color-menu",paletteId:null,initComponent:function(){Ext.apply(this,{plain:!0,showSeparator:!1,items:this.palette=new Ext.ColorPalette(Ext.applyIf({id:this.paletteId},this.initialConfig))}),this.palette.purgeListeners(),Ext.menu.ColorMenu.superclass.initComponent.call(this),this.relayEvents(this.palette,["select"]),this.on("select",this.menuHide,this),this.handler&&this.on("select",this.handler,this.scope||this)},menuHide:function(){this.hideOnClick&&this.hide(!0)}}),Ext.reg("colormenu",Ext.menu.ColorMenu),Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:!0,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:!1,disabled:!1,submitValue:!0,isFormField:!0,msgDisplay:"",hasFocus:!1,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this),this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:this.name||this.id||""},onRender:function(a,b){if(!this.el){var c=this.getAutoCreate();c.name||(c.name=this.name||this.id),this.inputType&&(c.type=this.inputType),this.autoEl=c}Ext.form.Field.superclass.onRender.call(this,a,b),this.submitValue===!1&&this.el.dom.removeAttribute("name");var d=this.el.dom.type;d&&(d=="password"&&(d="text"),this.el.addClass("x-form-"+d)),this.readOnly&&this.setReadOnly(!0),this.tabIndex!==undefined&&this.el.dom.setAttribute("tabIndex",this.tabIndex),this.el.addClass([this.fieldClass,this.cls])},getItemCt:function(){return this.itemCt},initValue:function(){this.value!==undefined?this.setValue(this.value):!Ext.isEmpty(this.el.dom.value)&&this.el.dom.value!=this.emptyText&&this.setValue(this.el.dom.value),this.originalValue=this.getValue()},isDirty:function(){return this.disabled||!this.rendered?!1:String(this.getValue())!==String(this.originalValue)},setReadOnly:function(a){this.rendered&&(this.el.dom.readOnly=a),this.readOnly=a},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this),this.initEvents(),this.initValue()},fireKey:function(a){a.isSpecialKey()&&this.fireEvent("specialkey",this,a)},reset:function(){this.setValue(this.originalValue),this.clearInvalid()},initEvents:function(){this.mon(this.el,Ext.EventManager.useKeydown?"keydown":"keypress",this.fireKey,this),this.mon(this.el,"focus",this.onFocus,this),this.mon(this.el,"blur",this.onBlur,this,this.inEditor?{buffer:10}:null)},preFocus:Ext.emptyFn,onFocus:function(){this.preFocus(),this.focusClass&&this.el.addClass(this.focusClass),this.hasFocus||(this.hasFocus=!0,this.startValue=this.getValue(),this.fireEvent("focus",this))},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur(),this.focusClass&&this.el.removeClass(this.focusClass),this.hasFocus=!1,this.validationEvent!==!1&&(this.validateOnBlur||this.validationEvent=="blur")&&this.validate();var a=this.getValue();String(a)!==String(this.startValue)&&this.fireEvent("change",this,a,this.startValue),this.fireEvent("blur",this),this.postBlur()},postBlur:Ext.emptyFn,isValid:function(a){if(this.disabled)return!0;var b=this.preventMark;this.preventMark=a===!0;var c=this.validateValue(this.processValue(this.getRawValue()));return this.preventMark=b,c},validate:function(){return this.disabled||this.validateValue(this.processValue(this.getRawValue()))?(this.clearInvalid(),!0):!1},processValue:function(a){return a},validateValue:function(a){var b=this.getErrors(a)[0];return b==undefined?!0:(this.markInvalid(b),!1)},getErrors:function(){return[]},getActiveError:function(){return this.activeError||""},markInvalid:function(a){if(this.rendered&&!this.preventMark){a=a||this.invalidText;var b=this.getMessageHandler();if(b)b.mark(this,a);else if(this.msgTarget){this.el.addClass(this.invalidClass);var c=Ext.getDom(this.msgTarget);c&&(c.innerHTML=a,c.style.display=this.msgDisplay)}}this.setActiveError(a)},clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var a=this.getMessageHandler();if(a)a.clear(this);else if(this.msgTarget){this.el.removeClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);b&&(b.innerHTML="",b.style.display="none")}}this.unsetActiveError()},setActiveError:function(a,b){this.activeError=a,b!==!0&&this.fireEvent("invalid",this,a)},unsetActiveError:function(a){delete this.activeError,a!==!0&&this.fireEvent("valid",this)},getMessageHandler:function(){return Ext.form.MessageTargets[this.msgTarget]},getErrorCt:function(){return this.el.findParent(".x-form-element",5,!0)||this.el.findParent(".x-form-field-wrap",5,!0)},alignErrorEl:function(){this.errorEl.setWidth(this.getErrorCt().getWidth(!0)-20)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},getRawValue:function(){var a=this.rendered?this.el.getValue():Ext.value(this.value,"");return a===this.emptyText&&(a=""),a},getValue:function(){if(!this.rendered)return this.value;var a=this.el.getValue();if(a===this.emptyText||a===undefined)a="";return a},setRawValue:function(a){return this.rendered?this.el.dom.value=Ext.isEmpty(a)?"":a:""},setValue:function(a){return this.value=a,this.rendered&&(this.el.dom.value=Ext.isEmpty(a)?"":a,this.validate()),this},append:function(a){this.setValue([this.getValue(),a].join(""))}}),Ext.form.MessageTargets={qtip:{mark:function(a,b){a.el.addClass(a.invalidClass),a.el.dom.qtip=b,a.el.dom.qclass="x-form-invalid-tip",Ext.QuickTips&&Ext.QuickTips.enable()},clear:function(a){a.el.removeClass(a.invalidClass),a.el.dom.qtip=""}},title:{mark:function(a,b){a.el.addClass(a.invalidClass),a.el.dom.title=b},clear:function(a){a.el.dom.title=""}},under:{mark:function(a,b){a.el.addClass(a.invalidClass);if(!a.errorEl){var c=a.getErrorCt();if(!c){a.el.dom.title=b;return}a.errorEl=c.createChild({cls:"x-form-invalid-msg"}),a.on("resize",a.alignErrorEl,a),a.on("destroy",function(){Ext.destroy(this.errorEl)},a)}a.alignErrorEl(),a.errorEl.update(b),Ext.form.Field.msgFx[a.msgFx].show(a.errorEl,a)},clear:function(a){a.el.removeClass(a.invalidClass),a.errorEl?Ext.form.Field.msgFx[a.msgFx].hide(a.errorEl,a):a.el.dom.title=""}},side:{mark:function(a,b){a.el.addClass(a.invalidClass);if(!a.errorIcon){var c=a.getErrorCt();if(!c){a.el.dom.title=b;return}a.errorIcon=c.createChild({cls:"x-form-invalid-icon"}),a.ownerCt&&(a.ownerCt.on("afterlayout",a.alignErrorIcon,a),a.ownerCt.on("expand",a.alignErrorIcon,a)),a.on("resize",a.alignErrorIcon,a),a.on("destroy",function(){Ext.destroy(this.errorIcon)},a)}a.alignErrorIcon(),a.errorIcon.dom.qtip=b,a.errorIcon.dom.qclass="x-form-invalid-tip",a.errorIcon.show()},clear:function(a){a.el.removeClass(a.invalidClass),a.errorIcon?(a.errorIcon.dom.qtip="",a.errorIcon.hide()):a.el.dom.title=""}}},Ext.form.Field.msgFx={normal:{show:function(a,b){a.setDisplayed("block")},hide:function(a,b){a.setDisplayed(!1).update("")}},slide:{show:function(a,b){a.slideIn("t",{stopFx:!0})},hide:function(a,b){a.slideOut("t",{stopFx:!0,useDisplay:!0})}},slideRight:{show:function(a,b){a.fixDisplay(),a.alignTo(b.el,"tl-tr"),a.slideIn("l",{stopFx:!0})},hide:function(a,b){a.slideOut("l",{stopFx:!0,useDisplay:!0})}}},Ext.reg("field",Ext.form.Field),Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:!1,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:!1,allowBlank:!0,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:!1,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this),this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this),this.validationEvent=="keyup"?(this.validationTask=new Ext.util.DelayedTask(this.validate,this),this.mon(this.el,"keyup",this.filterValidation,this)):this.validationEvent!==!1&&this.validationEvent!="blur"&&this.mon(this.el,this.validationEvent,this.validate,this,{buffer:this.validationDelay});if(this.selectOnFocus||this.emptyText)this.mon(this.el,"mousedown",this.onMouseDown,this),this.emptyText&&this.applyEmptyText();(this.maskRe||this.vtype&&this.disableKeyFilter!==!0&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))&&this.mon(this.el,"keypress",this.filterKeys,this),this.grow&&(this.mon(this.el,"keyup",this.onKeyUpBuffered,this,{buffer:50}),this.mon(this.el,"click",this.autoSize,this)),this.enableKeyEvents&&this.mon(this.el,{scope:this,keyup:this.onKeyUp,keydown:this.onKeyDown,keypress:this.onKeyPress})},onMouseDown:function(a){this.hasFocus||this.mon(this.el,"mouseup",Ext.emptyFn,this,{single:!0,preventDefault:!0})},processValue:function(a){if(this.stripCharsRe){var b=a.replace(this.stripCharsRe,"");if(b!==a)return this.setRawValue(b),b}return a},filterValidation:function(a){a.isNavKeyPress()||this.validationTask.delay(this.validationDelay)},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this),Ext.isIE&&(this.el.dom.unselectable="on")},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this),Ext.isIE&&(this.el.dom.unselectable="")},onKeyUpBuffered:function(a){this.doAutoSize(a)&&this.autoSize()},doAutoSize:function(a){return!a.isNavKeyPress()},onKeyUp:function(a){this.fireEvent("keyup",this,a)},onKeyDown:function(a){this.fireEvent("keydown",this,a)},onKeyPress:function(a){this.fireEvent("keypress",this,a)},reset:function(){Ext.form.TextField.superclass.reset.call(this),this.applyEmptyText()},applyEmptyText:function(){this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus&&(this.setRawValue(this.emptyText),this.el.addClass(this.emptyClass))},preFocus:function(){var a=this.el;this.emptyText&&(a.dom.value==this.emptyText&&this.setRawValue(""),a.removeClass(this.emptyClass)),this.selectOnFocus&&a.dom.select()},postBlur:function(){this.applyEmptyText()},filterKeys:function(a){if(a.ctrlKey)return;var b=a.getKey();if(Ext.isGecko&&(a.isNavKeyPress()||b==a.BACKSPACE||b==a.DELETE&&a.button==-1))return;var c=String.fromCharCode(a.getCharCode());if(!Ext.isGecko&&a.isSpecialKey()&&!c)return;this.maskRe.test(c)||a.stopEvent()},setValue:function(a){return this.emptyText&&this.el&&!Ext.isEmpty(a)&&this.el.removeClass(this.emptyClass),Ext.form.TextField.superclass.setValue.apply(this,arguments),this.applyEmptyText(),this.autoSize(),this},getErrors:function(a){var b=Ext.form.TextField.superclass.getErrors.apply(this,arguments);a=a||this.processValue(this.getRawValue());if(Ext.isFunction(this.validator)){var c=this.validator(a);c!==!0&&b.push(c)}if(a.length<1||a===this.emptyText){if(this.allowBlank)return b;b.push(this.blankText)}!this.allowBlank&&(a.length<1||a===this.emptyText)&&b.push(this.blankText),a.length<this.minLength&&b.push(String.format(this.minLengthText,this.minLength)),a.length>this.maxLength&&b.push(String.format(this.maxLengthText,this.maxLength));if(this.vtype){var d=Ext.form.VTypes;d[this.vtype](a,this)||b.push(this.vtypeText||d[this.vtype+"Text"])}return this.regex&&!this.regex.test(a)&&b.push(this.regexText),b},selectText:function(a,b){var c=this.getRawValue(),d=!1;if(c.length>0){a=a===undefined?0:a,b=b===undefined?c.length:b;var e=this.el.dom;if(e.setSelectionRange)e.setSelectionRange(a,b);else if(e.createTextRange){var f=e.createTextRange();f.moveStart("character",a),f.moveEnd("character",b-c.length),f.select()}d=Ext.isGecko||Ext.isOpera}else d=!0;d&&this.focus()},autoSize:function(){if(!this.grow||!this.rendered)return;this.metrics||(this.metrics=Ext.util.TextMetrics.createInstance(this.el));var a=this.el,b=a.dom.value,c=document.createElement("div");c.appendChild(document.createTextNode(b)),b=c.innerHTML,Ext.removeNode(c),c=null,b+="&#160;";var d=Math.min(this.growMax,Math.max(this.metrics.getWidth(b)+10,this.growMin));this.el.setWidth(d),this.fireEvent("autosize",this,d)},onDestroy:function(){this.validationTask&&(this.validationTask.cancel(),this.validationTask=null),Ext.form.TextField.superclass.onDestroy.call(this)}}),Ext.reg("textfield",Ext.form.TextField),Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:!1,editable:!0,readOnly:!1,wrapFocusClass:"x-trigger-wrap-focus",autoSize:Ext.emptyFn,monitorTab:!0,deferHeight:!0,mimicing:!1,actionMode:"wrap",defaultTriggerWidth:17,onResize:function(a,b){Ext.form.TriggerField.superclass.onResize.call(this,a,b);var c=this.getTriggerWidth();Ext.isNumber(a)&&this.el.setWidth(a-c),this.wrap.setWidth(this.el.getWidth()+c)},getTriggerWidth:function(){var a=this.trigger.getWidth();return!this.hideTrigger&&!this.readOnly&&a===0&&(a=this.defaultTriggerWidth),a},alignErrorIcon:function(){this.wrap&&this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])},onRender:function(a,b){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc(),Ext.form.TriggerField.superclass.onRender.call(this,a,b),this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-field-trigger-wrap"}),this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass}),this.initTrigger(),this.width||this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth()),this.resizeEl=this.positionEl=this.wrap},getWidth:function(){return this.el.getWidth()+this.trigger.getWidth()},updateEditState:function(){this.rendered&&(this.readOnly?(this.el.dom.readOnly=!0,this.el.addClass("x-trigger-noedit"),this.mun(this.el,"click",this.onTriggerClick,this),this.trigger.setDisplayed(!1)):(this.editable?(this.el.dom.readOnly=!1,this.el.removeClass("x-trigger-noedit"),this.mun(this.el,"click",this.onTriggerClick,this)):(this.el.dom.readOnly=!0,this.el.addClass("x-trigger-noedit"),this.mon(this.el,"click",this.onTriggerClick,this)),this.trigger.setDisplayed(!this.hideTrigger)),this.onResize(this.width||this.wrap.getWidth()))},setHideTrigger:function(a){a!=this.hideTrigger&&(this.hideTrigger=a,this.updateEditState())},setEditable:function(a){a!=this.editable&&(this.editable=a,this.updateEditState())},setReadOnly:function(a){a!=this.readOnly&&(this.readOnly=a,this.updateEditState())},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this),this.updateEditState()},initTrigger:function(){this.mon(this.trigger,"click",this.onTriggerClick,this,{preventDefault:!0}),this.trigger.addClassOnOver("x-form-trigger-over"),this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){Ext.destroy(this.trigger,this.wrap),this.mimicing&&this.doc.un("mousedown",this.mimicBlur,this),delete this.doc,Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this),this.mimicing||(this.wrap.addClass(this.wrapFocusClass),this.mimicing=!0,this.doc.on("mousedown",this.mimicBlur,this,{delay:10}),this.monitorTab&&this.on("specialkey",this.checkTab,this))},checkTab:function(a,b){b.getKey()==b.TAB&&this.triggerBlur()},onBlur:Ext.emptyFn,mimicBlur:function(a){!this.isDestroyed&&!this.wrap.contains(a.target)&&this.validateBlur(a)&&this.triggerBlur()},triggerBlur:function(){this.mimicing=!1,this.doc.un("mousedown",this.mimicBlur,this),this.monitorTab&&this.el&&this.un("specialkey",this.checkTab,this),Ext.form.TriggerField.superclass.onBlur.call(this),this.wrap&&this.wrap.removeClass(this.wrapFocusClass)},beforeBlur:Ext.emptyFn,validateBlur:function(a){return!0},onTriggerClick:Ext.emptyFn}),Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this),this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",!0),b=this;a.each(function(a,c,d){var e="Trigger"+(d+1);a.hide=function(){var a=b.wrap.getWidth();this.dom.style.display="none",b.el.setWidth(a-b.trigger.getWidth()),this["hidden"+e]=!0},a.show=function(){var a=b.wrap.getWidth();this.dom.style.display="",b.el.setWidth(a-b.trigger.getWidth()),this["hidden"+e]=!1},this["hide"+e]&&(a.dom.style.display="none",this["hidden"+e]=!0),this.mon(a,"click",this["on"+e+"Click"],this,{preventDefault:!0}),a.addClassOnOver("x-form-trigger-over"),a.addClassOnClick("x-form-trigger-click")},this),this.triggers=a.elements},getTriggerWidth:function(){var a=0;return Ext.each(this.triggers,function(b,c){var d="Trigger"+(c+1),e=b.getWidth();e===0&&!this["hidden"+d]?a+=this.defaultTriggerWidth:a+=e},this),a},onDestroy:function(){Ext.destroy(this.triggers),Ext.form.TwinTriggerField.superclass.onDestroy.call(this)},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn}),Ext.reg("trigger",Ext.form.TriggerField),Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1e3,growAppend:"&#160;\n&#160;",enterIsSpecial:!1,preventScrollbars:!1,onRender:function(a,b){this.el||(this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}),Ext.form.TextArea.superclass.onRender.call(this,a,b),this.grow&&(this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"}),this.preventScrollbars&&this.el.setStyle("overflow","hidden"),this.el.setHeight(this.growMin))},onDestroy:function(){Ext.removeNode(this.textSizeEl),Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(a){a.isSpecialKey()&&(this.enterIsSpecial||a.getKey()!=a.ENTER||a.hasModifier())&&this.fireEvent("specialkey",this,a)},doAutoSize:function(a){return!a.isNavKeyPress()||a.getKey()==a.ENTER},autoSize:function(){if(!this.grow||!this.textSizeEl)return;var a=this.el,b=Ext.util.Format.htmlEncode(a.dom.value),c=this.textSizeEl,d;Ext.fly(c).setWidth(this.el.getWidth()),b.length<1?b="&#160;&#160;":(b+=this.growAppend,Ext.isIE&&(b=b.replace(/\n/g,"&#160;<br />"))),c.innerHTML=b,d=Math.min(this.growMax,Math.max(c.offsetHeight,this.growMin)),d!=this.lastHeight&&(this.lastHeight=d,this.el.setHeight(d),this.fireEvent("autosize",this,d))}}),Ext.reg("textarea",Ext.form.TextArea),Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:!0,decimalSeparator:".",decimalPrecision:2,allowNegative:!0,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",initEvents:function(){var a=this.baseChars+"";this.allowDecimals&&(a+=this.decimalSeparator),this.allowNegative&&(a+="-"),this.maskRe=new RegExp("["+Ext.escapeRe(a)+"]"),Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(a){var b=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);a=a||this.processValue(this.getRawValue());if(a.length<1)return b;a=String(a).replace(this.decimalSeparator,"."),isNaN(a)&&b.push(String.format(this.nanText,a));var c=this.parseValue(a);return c<this.minValue&&b.push(String.format(this.minText,this.minValue)),c>this.maxValue&&b.push(String.format(this.maxText,this.maxValue)),b},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(a){return a=Ext.isNumber(a)?a:parseFloat(String(a).replace(this.decimalSeparator,".")),a=isNaN(a)?"":String(a).replace(".",this.decimalSeparator),Ext.form.NumberField.superclass.setValue.call(this,a)},setMinValue:function(a){this.minValue=Ext.num(a,Number.NEGATIVE_INFINITY)},setMaxValue:function(a){this.maxValue=Ext.num(a,Number.MAX_VALUE)},parseValue:function(a){return a=parseFloat(String(a).replace(this.decimalSeparator,".")),isNaN(a)?"":a},fixPrecision:function(a){var b=isNaN(a);return!this.allowDecimals||this.decimalPrecision==-1||b||!a?b?"":a:parseFloat(parseFloat(a).toFixed(this.decimalPrecision))},beforeBlur:function(){var a=this.parseValue(this.getRawValue());Ext.isEmpty(a)||this.setValue(this.fixPrecision(a))}}),Ext.reg("numberfield",Ext.form.NumberField),Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}"
,triggerClass:"x-form-date-trigger",showToday:!0,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(a,b){if(/[gGhH]/.test(b.replace(/(\\.)/g,"")))return Date.parseDate(a,b);var c=Date.parseDate(a+" "+this.initTime,b+" "+this.initTimeFormat);if(c)return c.clearTime()},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this),this.addEvents("select"),Ext.isString(this.minValue)&&(this.minValue=this.parseDate(this.minValue)),Ext.isString(this.maxValue)&&(this.maxValue=this.parseDate(this.maxValue)),this.disabledDatesRE=null,this.initDisabledDays()},initEvents:function(){Ext.form.DateField.superclass.initEvents.call(this),this.keyNav=new Ext.KeyNav(this.el,{down:function(a){this.onTriggerClick()},scope:this,forceKeyDown:!0})},initDisabledDays:function(){if(this.disabledDates){var a=this.disabledDates,b=a.length-1,c="(?:";Ext.each(a,function(d,e){c+=Ext.isDate(d)?"^"+Ext.escapeRe(d.dateFormat(this.format))+"$":a[e],e!=b&&(c+="|")},this),this.disabledDatesRE=new RegExp(c+")")}},setDisabledDates:function(a){this.disabledDates=a,this.initDisabledDays(),this.menu&&this.menu.picker.setDisabledDates(this.disabledDatesRE)},setDisabledDays:function(a){this.disabledDays=a,this.menu&&this.menu.picker.setDisabledDays(a)},setMinValue:function(a){this.minValue=Ext.isString(a)?this.parseDate(a):a,this.menu&&this.menu.picker.setMinDate(this.minValue)},setMaxValue:function(a){this.maxValue=Ext.isString(a)?this.parseDate(a):a,this.menu&&this.menu.picker.setMaxDate(this.maxValue)},getErrors:function(a){var b=Ext.form.DateField.superclass.getErrors.apply(this,arguments);a=this.formatDate(a||this.processValue(this.getRawValue()));if(a.length<1)return b;var c=a;a=this.parseDate(a);if(!a)return b.push(String.format(this.invalidText,c,this.format)),b;var d=a.getTime();this.minValue&&d<this.minValue.getTime()&&b.push(String.format(this.minText,this.formatDate(this.minValue))),this.maxValue&&d>this.maxValue.getTime()&&b.push(String.format(this.maxText,this.formatDate(this.maxValue)));if(this.disabledDays){var e=a.getDay();for(var f=0;f<this.disabledDays.length;f++)if(e===this.disabledDays[f]){b.push(this.disabledDaysText);break}}var g=this.formatDate(a);return this.disabledDatesRE&&this.disabledDatesRE.test(g)&&b.push(String.format(this.disabledDatesText,g)),b},validateBlur:function(){return!this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""},setValue:function(a){return Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},parseDate:function(a){if(!a||Ext.isDate(a))return a;var b=this.safeParse(a,this.format),c=this.altFormats,d=this.altFormatsArray;if(!b&&c){d=d||c.split("|");for(var e=0,f=d.length;e<f&&!b;e++)b=this.safeParse(a,d[e])}return b},onDestroy:function(){Ext.destroy(this.menu,this.keyNav),Ext.form.DateField.superclass.onDestroy.call(this)},formatDate:function(a){return Ext.isDate(a)?a.dateFormat(this.format):a},onTriggerClick:function(){if(this.disabled)return;this.menu==null&&(this.menu=new Ext.menu.DateMenu({hideOnClick:!1,focusOnSelect:!1})),this.onFocus(),Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))}),this.menu.picker.setValue(this.getValue()||new Date),this.menu.show(this.el,"tl-bl?"),this.menuEvents("on")},menuEvents:function(a){this.menu[a]("select",this.onSelect,this),this.menu[a]("hide",this.onMenuHide,this),this.menu[a]("show",this.onFocus,this)},onSelect:function(a,b){this.setValue(b),this.fireEvent("select",this,b),this.menu.hide()},onMenuHide:function(){this.focus(!1,60),this.menuEvents("un")},beforeBlur:function(){var a=this.parseDate(this.getRawValue());a&&this.setValue(a)}}),Ext.reg("datefield",Ext.form.DateField),Ext.form.DisplayField=Ext.extend(Ext.form.Field,{validationEvent:!1,validateOnBlur:!1,defaultAutoCreate:{tag:"div"},fieldClass:"x-form-display-field",htmlEncode:!1,initEvents:Ext.emptyFn,isValid:function(){return!0},validate:function(){return!0},getRawValue:function(){var a=this.rendered?this.el.dom.innerHTML:Ext.value(this.value,"");return a===this.emptyText&&(a=""),this.htmlEncode&&(a=Ext.util.Format.htmlDecode(a)),a},getValue:function(){return this.getRawValue()},getName:function(){return this.name},setRawValue:function(a){return this.htmlEncode&&(a=Ext.util.Format.htmlEncode(a)),this.rendered?this.el.dom.innerHTML=Ext.isEmpty(a)?"":a:this.value=a},setValue:function(a){return this.setRawValue(a),this}}),Ext.reg("displayfield",Ext.form.DisplayField),Ext.form.ComboBox=Ext.extend(Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listClass:"",selectedClass:"x-combo-selected",listEmptyText:"",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,minHeight:90,triggerAction:"query",minChars:4,autoSelect:!0,typeAhead:!1,queryDelay:500,pageSize:0,selectOnFocus:!1,queryParam:"query",loadingText:"Loading...",resizable:!1,handleHeight:8,allQuery:"",mode:"remote",minListWidth:70,forceSelection:!1,typeAheadDelay:250,lazyInit:!0,clearFilterOnReset:!0,submitValue:undefined,initComponent:function(){Ext.form.ComboBox.superclass.initComponent.call(this),this.addEvents("expand","collapse","beforeselect","select","beforequery");if(this.transform){var a=Ext.getDom(this.transform);this.hiddenName||(this.hiddenName=a.name);if(!this.store){this.mode="local";var b=[],c=a.options;for(var d=0,e=c.length;d<e;d++){var f=c[d],g=(f.hasAttribute?f.hasAttribute("value"):f.getAttributeNode("value").specified)?f.value:f.text;f.selected&&Ext.isEmpty(this.value,!0)&&(this.value=g),b.push([g,f.text])}this.store=new Ext.data.ArrayStore({id:0,fields:["value","text"],data:b,autoDestroy:!0}),this.valueField="value",this.displayField="text"}a.name=Ext.id(),this.lazyRender||(this.target=!0,this.el=Ext.DomHelper.insertBefore(a,this.autoCreate||this.defaultAutoCreate),this.render(this.el.parentNode,a)),Ext.removeNode(a)}else this.store&&(this.store=Ext.StoreMgr.lookup(this.store),this.store.autoCreated&&(this.displayField=this.valueField="field1",this.store.expandData||(this.displayField="field2"),this.mode="local"));this.selectedIndex=-1,this.mode=="local"&&(Ext.isDefined(this.initialConfig.queryDelay)||(this.queryDelay=10),Ext.isDefined(this.initialConfig.minChars)||(this.minChars=0))},onRender:function(a,b){this.hiddenName&&!Ext.isDefined(this.submitValue)&&(this.submitValue=!1),Ext.form.ComboBox.superclass.onRender.call(this,a,b),this.hiddenName&&(this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:this.hiddenId||this.hiddenName},"before",!0)),Ext.isGecko&&this.el.dom.setAttribute("autocomplete","off"),this.lazyInit?this.on("focus",this.initList,this,{single:!0}):this.initList()},initValue:function(){Ext.form.ComboBox.superclass.initValue.call(this),this.hiddenField&&(this.hiddenField.value=Ext.value(Ext.isDefined(this.hiddenValue)?this.hiddenValue:this.value,""))},getParentZIndex:function(){var a;return this.ownerCt&&this.findParentBy(function(b){return a=parseInt(b.getPositionEl().getStyle("z-index"),10),!!a}),a},initList:function(){if(!this.list){var a="x-combo-list",b=Ext.getDom(this.getListParent()||Ext.getBody()),c=parseInt(Ext.fly(b).getStyle("z-index"),10);c||(c=this.getParentZIndex()),this.list=new Ext.Layer({parentEl:b,shadow:this.shadow,cls:[a,this.listClass].join(" "),constrain:!1,zindex:(c||12e3)+5});var d=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setSize(d,0),this.list.swallowEvent("mousewheel"),this.assetHeight=0,this.syncFont!==!1&&this.list.setStyle("font-size",this.el.getStyle("font-size")),this.title&&(this.header=this.list.createChild({cls:a+"-hd",html:this.title}),this.assetHeight+=this.header.getHeight()),this.innerList=this.list.createChild({cls:a+"-inner"}),this.mon(this.innerList,"mouseover",this.onViewOver,this),this.mon(this.innerList,"mousemove",this.onViewMove,this),this.innerList.setWidth(d-this.list.getFrameWidth("lr")),this.pageSize&&(this.footer=this.list.createChild({cls:a+"-ft"}),this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer}),this.assetHeight+=this.footer.getHeight()),this.tpl||(this.tpl='<tpl for="."><div class="'+a+'-item">{'+this.displayField+"}</div></tpl>"),this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:!0,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+a+"-item",emptyText:this.listEmptyText,deferEmptyText:!1}),this.mon(this.view,{containerclick:this.onViewClick,click:this.onViewClick,scope:this}),this.bindStore(this.store,!0),this.resizable&&(this.resizer=new Ext.Resizable(this.list,{pinned:!0,handles:"se"}),this.mon(this.resizer,"resize",function(a,b,c){this.maxHeight=c-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight,this.listWidth=b,this.innerList.setWidth(b-this.list.getFrameWidth("lr")),this.restrictHeight()},this),this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px"))}},getListParent:function(){return document.body},getStore:function(){return this.store},bindStore:function(a,b){this.store&&!b&&(this.store!==a&&this.store.autoDestroy?this.store.destroy():(this.store.un("beforeload",this.onBeforeLoad,this),this.store.un("load",this.onLoad,this),this.store.un("exception",this.collapse,this)),a||(this.store=null,this.view&&this.view.bindStore(null),this.pageTb&&this.pageTb.bindStore(null))),a&&(b||(this.lastQuery=null,this.pageTb&&this.pageTb.bindStore(a)),this.store=Ext.StoreMgr.lookup(a),this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.collapse}),this.view&&this.view.bindStore(a))},reset:function(){Ext.form.ComboBox.superclass.reset.call(this),this.clearFilterOnReset&&this.mode=="local"&&this.store.clearFilter()},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this),this.keyNav=new Ext.KeyNav(this.el,{up:function(a){this.inKeyMode=!0,this.selectPrev()},down:function(a){this.isExpanded()?(this.inKeyMode=!0,this.selectNext()):this.onTriggerClick()},enter:function(a){this.onViewClick()},esc:function(a){this.collapse()},tab:function(a){return this.forceSelection===!0?this.collapse():this.onViewClick(!1),!0},scope:this,doRelay:function(a,b,c){if(c=="down"||this.scope.isExpanded()){var d=Ext.KeyNav.prototype.doRelay.apply(this,arguments);return!Ext.isIE&&Ext.EventManager.useKeydown&&this.scope.fireKey(a),d}return!0},forceKeyDown:!0,defaultEventAction:"stopEvent"}),this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250),this.dqTask=new Ext.util.DelayedTask(this.initQuery,this),this.typeAhead&&(this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)),this.enableKeyEvents||this.mon(this.el,"keyup",this.onKeyUp,this)},onDestroy:function(){this.dqTask&&(this.dqTask.cancel(),this.dqTask=null),this.bindStore(null),Ext.destroy(this.resizer,this.view,this.pageTb,this.list),Ext.destroyMembers(this,"hiddenField"),Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(a){this.isExpanded()||Ext.form.ComboBox.superclass.fireKey.call(this,a)},onResize:function(a,b){Ext.form.ComboBox.superclass.onResize.apply(this,arguments),!isNaN(a)&&this.isVisible()&&this.list?this.doResize(a):this.bufferSize=a},doResize:function(a){if(!Ext.isDefined(this.listWidth)){var b=Math.max(a,this.minListWidth);this.list.setWidth(b),this.innerList.setWidth(b-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments),this.hiddenField&&(this.hiddenField.disabled=!1)},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments),this.hiddenField&&(this.hiddenField.disabled=!0)},onBeforeLoad:function(){if(!this.hasFocus)return;this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+"</div>":""),this.restrictHeight(),this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus)return;this.store.getCount()>0||this.listEmptyText?(this.expand(),this.restrictHeight(),this.lastQuery==this.allQuery?(this.editable&&this.el.dom.select(),this.autoSelect!==!1&&!this.selectByValue(this.value,!0)&&this.select(0,!0)):(this.autoSelect!==!1&&this.selectNext(),this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE&&this.taTask.delay(this.typeAheadDelay))):this.collapse()},onTypeAhead:function(){if(this.store.getCount()>0){var a=this.store.getAt(0),b=a.data[this.displayField],c=b.length,d=this.getRawValue().length;d!=c&&(this.setRawValue(b),this.selectText(d,b.length))}},assertValue:function(){var a=this.getRawValue(),b=this.findRecord(this.displayField,a);if(!b&&this.forceSelection)a.length>0&&a!=this.emptyText?(this.el.dom.value=Ext.value(this.lastSelectionText,""),this.applyEmptyText()):this.clearValue();else{if(b){if(a==b.get(this.displayField)&&this.value==b.get(this.valueField))return;a=b.get(this.valueField||this.displayField)}this.setValue(a)}},onSelect:function(a,b){this.fireEvent("beforeselect",this,a,b)!==!1&&(this.setValue(a.data[this.valueField||this.displayField]),this.collapse(),this.fireEvent("select",this,a,b))},getName:function(){var a=this.hiddenField;return a&&a.name?a.name:this.hiddenName||Ext.form.ComboBox.superclass.getName.call(this)},getValue:function(){return this.valueField?Ext.isDefined(this.value)?this.value:"":Ext.form.ComboBox.superclass.getValue.call(this)},clearValue:function(){this.hiddenField&&(this.hiddenField.value=""),this.setRawValue(""),this.lastSelectionText="",this.applyEmptyText(),this.value=""},setValue:function(a){var b=a;if(this.valueField){var c=this.findRecord(this.valueField,a);c?b=c.data[this.displayField]:Ext.isDefined(this.valueNotFoundText)&&(b=this.valueNotFoundText)}return this.lastSelectionText=b,this.hiddenField&&(this.hiddenField.value=Ext.value(a,"")),Ext.form.ComboBox.superclass.setValue.call(this,b),this.value=a,this},findRecord:function(a,b){var c;return this.store.getCount()>0&&this.store.each(function(d){if(d.data[a]==b)return c=d,!1}),c},onViewMove:function(a,b){this.inKeyMode=!1},onViewOver:function(a,b){if(this.inKeyMode)return;var c=this.view.findItemFromChild(b);if(c){var d=this.view.indexOf(c);this.select(d,!1)}},onViewClick:function(a){var b=this.view.getSelectedIndexes()[0],c=this.store,d=c.getAt(b);d?this.onSelect(d,b):this.collapse(),a!==!1&&this.el.focus()},restrictHeight:function(){this.innerList.dom.style.height="";var a=this.innerList.dom,b=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,c=Math.max(a.clientHeight,a.offsetHeight,a.scrollHeight),d=this.getPosition()[1]-Ext.getBody().getScroll().top,e=Ext.lib.Dom.getViewHeight()-d-this.getSize().height,f=Math.max(d,e,this.minHeight||0)-this.list.shadowOffset-b-5;c=Math.min(c,f,this.maxHeight),this.innerList.setHeight(c),this.list.beginUpdate(),this.list.setHeight(c+b),this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign)),this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(a,b){if(!Ext.isEmpty(a,!0)){var c=this.findRecord(this.valueField||this.displayField,a);if(c)return this.select(this.store.indexOf(c),b),!0}return!1},select:function(a,b){this.selectedIndex=a,this.view.select(a);if(b!==!1){var c=this.view.getNode(a);c&&this.innerList.scrollChildIntoView(c,!1)}},selectNext:function(){var a=this.store.getCount();a>0&&(this.selectedIndex==-1?this.select(0):this.selectedIndex<a-1&&this.select(this.selectedIndex+1))},selectPrev:function(){var a=this.store.getCount();a>0&&(this.selectedIndex==-1?this.select(0):this.selectedIndex!==0&&this.select(this.selectedIndex-1))},onKeyUp:function(a){var b=a.getKey();this.editable!==!1&&this.readOnly!==!0&&(b==a.BACKSPACE||!a.isSpecialKey())&&(this.lastKey=b,this.dqTask.delay(this.queryDelay)),Ext.form.ComboBox.superclass.onKeyUp.call(this,a)},validateBlur:function(){return!this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},beforeBlur:function(){this.assertValue()},postBlur:function(){Ext.form.ComboBox.superclass.postBlur.call(this),this.collapse(),this.inKeyMode=!1},doQuery:function(a,b){a=Ext.isEmpty(a)?"":a;var c={query:a,forceAll:b,combo:this,cancel:!1};if(this.fireEvent("beforequery",c)===!1||c.cancel)return!1;a=c.query,b=c.forceAll;if(b===!0||a.length>=this.minChars)this.lastQuery!==a?(this.lastQuery=a,this.mode=="local"?(this.selectedIndex=-1,b?this.store.clearFilter():this.store.filter(this.displayField,a),this.onLoad()):(this.store.baseParams[this.queryParam]=a,this.store.load({params:this.getParams(a)}),this.expand())):(this.selectedIndex=-1,this.onLoad())},getParams:function(a){var b={};return this.pageSize&&(b.start=0,b.limit=this.pageSize),b},collapse:function(){if(!this.isExpanded())return;this.list.hide(),Ext.getDoc().un("mousewheel",this.collapseIf,this),Ext.getDoc().un("mousedown",this.collapseIf,this),this.fireEvent("collapse",this)},collapseIf:function(a){!this.isDestroyed&&!a.within(this.wrap)&&!a.within(this.list)&&this.collapse()},expand:function(){if(this.isExpanded()||!this.hasFocus)return;if(this.title||this.pageSize)this.assetHeight=0,this.title&&(this.assetHeight+=this.header.getHeight()),this.pageSize&&(this.assetHeight+=this.footer.getHeight());this.bufferSize&&(this.doResize(this.bufferSize),delete this.bufferSize),this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));var a=Ext.getDom(this.getListParent()||Ext.getBody()),b=parseInt(Ext.fly(a).getStyle("z-index"),10);b||(b=this.getParentZIndex()),b&&this.list.setZIndex(b+5),this.list.show(),Ext.isGecko2&&this.innerList.setOverflow("auto"),this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf}),this.fireEvent("expand",this)},onTriggerClick:function(){if(this.readOnly||this.disabled)return;this.isExpanded()?(this.collapse(),this.el.focus()):(this.onFocus({}),this.triggerAction=="all"?this.doQuery(this.allQuery,!0):this.doQuery(this.getRawValue()),this.el.focus())}}),Ext.reg("combo",Ext.form.ComboBox),Ext.form.Checkbox=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:!1,boxLabel:"&#160;",defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},actionMode:"wrap",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this),this.addEvents("check")},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments),!this.boxLabel&&!this.fieldLabel&&this.el.alignTo(this.wrap,"c-c")},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this),this.mon(this.el,{scope:this,click:this.onClick,change:this.onClick})},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(a,b){Ext.form.Checkbox.superclass.onRender.call(this,a,b),this.inputValue!==undefined&&(this.el.dom.value=this.inputValue),this.wrap=this.el.wrap({cls:"x-form-check-wrap"}),this.boxLabel&&this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel}),this.checked?this.setValue(!0):this.checked=this.el.dom.checked,Ext.isIE&&this.wrap.repaint(),this.resizeEl=this.positionEl=this.wrap},onDestroy:function(){Ext.destroy(this.wrap),Ext.form.Checkbox.superclass.onDestroy.call(this)},initValue:function(){this.originalValue=this.getValue()},getValue:function(){return this.rendered?this.el.dom.checked:this.checked},onClick:function(){this.el.dom.checked!=this.checked&&this.setValue(this.el.dom.checked)},setValue:function(a){var b=this.checked;return this.checked=a===!0||a==="true"||a=="1"||String(a).toLowerCase()=="on",this.rendered&&(this.el.dom.checked=this.checked,this.el.dom.defaultChecked=this.checked),b!=this.checked&&(this.fireEvent("check",this,this.checked),this.handler&&this.handler.call(this.scope||this,this,this.checked)),this}}),Ext.reg("checkbox",Ext.form.Checkbox),Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:!1,allowBlank:!0,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",initComponent:function(){this.addEvents("change"),this.on("change",this.validate,this),Ext.form.CheckboxGroup.superclass.initComponent.call(this)},onRender:function(a,b){if(!this.el){var c={autoEl:{id:this.id},cls:this.groupCls,layout:"column",renderTo:a,bufferResize:!1},d={xtype:"container",defaultType:this.defaultType,layout:"form",defaults:{hideLabel:!0,anchor:"100%"}};if(this.items[0].items){Ext.apply(c,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=0,f=this.items.length;e<f;e++)Ext.applyIf(this.items[e],d)}else{var g,h=[];typeof this.columns=="string"&&(this.columns=this.items.length);if(!Ext.isArray(this.columns)){var i=[];for(var e=0;e<this.columns;e++)i.push(100/this.columns*.01);this.columns=i}g=this.columns.length;for(var e=0;e<g;e++){var j=Ext.apply({items:[]},d);j[this.columns[e]<=1?"columnWidth":"width"]=this.columns[e],this.defaults&&(j.defaults=Ext.apply(j.defaults||{},this.defaults)),h.push(j)}if(this.vertical){var k=Math.ceil(this.items.length/g),l=0;for(var e=0,f=this.items.length;e<f;e++)e>0&&e%k==0&&l++,this.items[e].fieldLabel&&(this.items[e].hideLabel=!1),h[l].items.push(this.items[e])}else for(var e=0,f=this.items.length;e<f;e++){var m=e%g;this.items[e].fieldLabel&&(this.items[e].hideLabel=!1),h[m].items.push(this.items[e])}Ext.apply(c,{layoutConfig:{columns:g},items:h})}this.panel=new Ext.Container(c),this.panel.ownerCt=this,this.el=this.panel.getEl();if(this.forId&&this.itemCls){var n=this.el.up(this.itemCls).child("label",!0);n&&n.setAttribute("htmlFor",this.forId)}var o=this.panel.findBy(function(a){return a.isFormField},this);this.items=new Ext.util.MixedCollection,this.items.addAll(o)}Ext.form.CheckboxGroup.superclass.onRender.call(this,a,b)},initValue:function(){this.value&&(this.setValue.apply(this,this.buffered?this.value:[this.value]),delete this.buffered,delete this.value)},afterRender:function(){Ext.form.CheckboxGroup.superclass.afterRender.call(this),this.eachItem(function(a){a.on("check",this.fireChecked,this),a.inGroup=!0})},doLayout:function(){this.rendered&&(this.panel.forceLayout=this.ownerCt.forceLayout,this.panel.doLayout())},fireChecked:function(){var a=[];this.eachItem(function(b){b.checked&&a.push(b)}),this.fireEvent("change",this,a)},getErrors:function(){var a=Ext.form.CheckboxGroup.superclass.getErrors.apply(this,arguments);if(!this.allowBlank){var b=!0;this.eachItem(function(a){if(a.checked)return b=!1}),b&&a.push(this.blankText)}return a},isDirty:function(){if(this.disabled||!this.rendered)return!1;var a=!1;return this.eachItem(function(b){if(b.isDirty())return a=!0,!1}),a},setReadOnly:function(a){this.rendered&&this.eachItem(function(b){b.setReadOnly(a)}),this.readOnly=a},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})},onResize:function(a,b){this.panel.setSize(a,b),this.panel.doLayout()},reset:function(){this.originalValue?(this.eachItem(function(a){a.setValue&&(a.setValue(!1),a.originalValue=a.getValue())}),this.resetOriginal=!0,this.setValue(this.originalValue),delete this.resetOriginal):this.eachItem(function(a){a.reset&&a.reset()}),function(){this.clearInvalid()}.defer(50,this)},setValue:function(){return this.rendered?this.onSetValue.apply(this,arguments):(this.buffered=!0,this.value=arguments),this},onSetValue:function(a,b){if(arguments.length==1)if(Ext.isArray(a))Ext.each(a,function(a,b){if(Ext.isObject(a)&&a.setValue)a.setValue(!0),this.resetOriginal===!0&&(a.originalValue=a.getValue());else{var c=this.items.itemAt(b);c&&c.setValue(a)}},this);else if(Ext.isObject(a))for(var c in a){var d=this.getBox(c);d&&d.setValue(a[c])}else this.setValueForItem(a);else{var d=this.getBox(a);d&&d.setValue(b)}},beforeDestroy:function(){Ext.destroy(this.panel),Ext.form.CheckboxGroup.superclass.beforeDestroy.call(this)},setValueForItem:function(a){a=String(a).split(","),this.eachItem(function(b){a.indexOf(b.inputValue)>-1&&b.setValue(!0)})},getBox:function(a){var b=null;return this.eachItem(function(c){if(a==c||c.dataIndex==a||c.id==a||c.getName()==a)return b=c,!1}),b},getValue:function(){var a=[];return this.eachItem(function(b){b.checked&&a.push(b)}),a},eachItem:function(a,b){this.items&&this.items.each&&this.items.each(a,b||this)},getRawValue:Ext.emptyFn,setRawValue:Ext.emptyFn}),Ext.reg("checkboxgroup",Ext.form.CheckboxGroup),Ext.form.CompositeField=Ext.extend(Ext.form.Field,{defaultMargins:"0 5 0 0",skipLastItemMargin:!0,isComposite:!0,combineErrors:!0,initComponent:function(){var a=[],b=this.items,c;for(var d=0,e=b.length;d<e;d++)c=b[d],a.push(c.fieldLabel),Ext.apply(c,this.defaults),(d!=e-1||!this.skipLastItemMargin)&&Ext.applyIf(c,{margins:this.defaultMargins});this.fieldLabel=this.fieldLabel||this.buildLabel(a),this.fieldErrors=new Ext.util.MixedCollection(!0,function(a){return a.field}),this.fieldErrors.on({scope:this,add:this.updateInvalidMark,remove:this.updateInvalidMark,replace:this.updateInvalidMark}),Ext.form.CompositeField.superclass.initComponent.apply(this,arguments)},onRender:function(a,b){if(!this.el){var c=this.innerCt=new Ext.Container({layout:"hbox",renderTo:a,items:this.items,cls:"x-form-composite",defaultMargins:"0 3 0 0"});this.el=c.getEl();var d=c.findBy(function(a){return a.isFormField},this);this.items=new Ext.util.MixedCollection,this.items.addAll(d),this.combineErrors&&this.eachItem(function(a){Ext.apply(a,{markInvalid:this.onFieldMarkInvalid.createDelegate(this,[a],0),clearInvalid:this.onFieldClearInvalid.createDelegate(this,[a],0)})});var e=this.el.parent().parent().child("label",!0);e&&e.setAttribute("for",this.items.items[0].id)}Ext.form.CompositeField.superclass.onRender.apply(this,arguments)},onFieldMarkInvalid:function(a,b){var c=a.getName(),d={field:c,error:b};this.fieldErrors.replace(c,d),a.el.addClass(a.invalidClass)},onFieldClearInvalid:function(a){this.fieldErrors.removeKey(a.getName()),a.el.removeClass(a.invalidClass)},updateInvalidMark:function(){var a=Ext.isIE6&&Ext.isStrict;if(this.fieldErrors.length==0)this.clearInvalid(),a&&this.clearInvalid.defer(50,this);else{var b=this.buildCombinedErrorMessage(this.fieldErrors.items);this.sortErrors(),this.markInvalid(b),a&&this.markInvalid(b)}},validateValue:function(){var a=!0;return this.eachItem(function(b){b.isValid()||(a=!1)}),a},buildCombinedErrorMessage:function(a){var b=[],c;for(var d=0,e=a.length;d<e;d++)c=a[d],b.push(String.format("{0}: {1}",c.field,c.error));return b.join("<br />")},sortErrors:function(){var a=this.items;this.fieldErrors.sort("ASC",function(b,c){var d=function(a){return function(b){return b.getName()==a}},e=a.findIndexBy(d(b.field)),f=a.findIndexBy(d(c.field));return e<f?-1:1})},reset:function(){this.eachItem(function(a){a.reset()}),function(){this.clearInvalid()}.defer(50,this)},clearInvalidChildren:function(){this.eachItem(function(a){a.clearInvalid()})},buildLabel:function(a){return a.join(", ")},isDirty:function(){if(this.disabled||!this.rendered)return!1;var a=!1;return this.eachItem(function(b){if(b.isDirty())return a=!0,!1}),a},eachItem:function(a,b){this.items&&this.items.each&&this.items.each(a,b||this)},onResize:function(a,b,c,d){var e=this.innerCt;this.rendered&&e.rendered&&e.setSize(a,b),Ext.form.CompositeField.superclass.onResize.apply(this,arguments)},doLayout:function(a,b){if(this.rendered){var c=this.innerCt;c.forceLayout=this.ownerCt.forceLayout,c.doLayout(a,b)}},beforeDestroy:function(){Ext.destroy(this.innerCt),Ext.form.CompositeField.superclass.beforeDestroy.call(this)},setReadOnly:function(a){a=a||!0,this.rendered&&this.eachItem(function(b){b.setReadOnly(a)}),this.readOnly=a},onShow:function(){Ext.form.CompositeField.superclass.onShow.call(this),this.doLayout()},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})}}),Ext.reg("compositefield",Ext.form.CompositeField),Ext.form.Radio=Ext.extend(Ext.form.Checkbox,{inputType:"radio",markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,getGroupValue:function(){var a=this.el.up("form")||Ext.getBody(),b=a.child("input[name="+this.el.dom.name+"]:checked",!0);return b?b.value:null},onClick:function(){if(this.el.dom.checked!=this.checked){var a=this.getCheckEl().select("input[name="+this.el.dom.name+"]");a.each(function(a){a.dom.id==this.id?this.setValue(!0):Ext.getCmp(a.dom.id).setValue(!1)},this)}},setValue:function(a){if(typeof a=="boolean")Ext.form.Radio.superclass.setValue.call(this,a);else if(this.rendered){var b=this.getCheckEl().child("input[name="+this.el.dom.name+"][value="+a+"]",!0);b&&Ext.getCmp(b.id).setValue(!0)}return this},getCheckEl:function(){return this.inGroup?this.el.up(".x-form-radio-group"):this.el.up("form")||Ext.getBody()}}),Ext.reg("radio",Ext.form.Radio),Ext.form.RadioGroup=Ext.extend(Ext.form.CheckboxGroup,{allowBlank:!0,blankText:"You must select one item in this group",defaultType:"radio",groupCls:"x-form-radio-group",getValue:function(){var a=null;return this.eachItem(function(b){if(b.checked)return a=b,!1}),a},onSetValue:function(a,b){if(arguments.length>1){var c=this.getBox(a);c&&(c.setValue(b),c.checked&&this.eachItem(function(a){a!==c&&a.setValue(!1)}))}else this.setValueForItem(a)},setValueForItem:function(a){a=String(a).split(",")[0],this.eachItem(function(b){b.setValue(a==b.inputValue)})},fireChecked:function(){this.checkTask||(this.checkTask=new Ext.util.DelayedTask(this.bufferChecked,this)),this.checkTask.delay(10)},bufferChecked:function(){var a=null;this.eachItem(function(b){if(b.checked)return a=b,!1}),this.fireEvent("change",this,a)},onDestroy:function(){this.checkTask&&(this.checkTask.cancel(),this.checkTask=null),Ext.form.RadioGroup.superclass.onDestroy.call(this)}}),Ext.reg("radiogroup",Ext.form.RadioGroup),Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn}),Ext.reg("hidden",Ext.form.Hidden),Ext.form.BasicForm=Ext.extend(Ext.util.Observable,{constructor:function(a,b){Ext.apply(this,b),Ext.isString(this.paramOrder)&&(this.paramOrder=this.paramOrder.split(/[\s,|]/)),this.items=new Ext.util.MixedCollection(!1,function(a){return a.getItemId()}),this.addEvents("beforeaction","actionfailed","actioncomplete"),a&&this.initEl(a),Ext.form.BasicForm.superclass.constructor.call(this)},timeout:30,paramOrder:undefined,paramsAsHash:!1,waitTitle:"Please Wait...",activeAction:null,trackResetOnLoad:!1,initEl:function(a){this.el=Ext.get(a),this.id=this.el.id||Ext.id(),this.standardSubmit||this.el.on("submit",this.onSubmit,this),this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(a){a.stopEvent()},destroy:function(a){a!==!0&&(this.items.each(function(a){Ext.destroy(a)}),Ext.destroy(this.el)),this.items.clear(),this.purgeListeners()},isValid:function(){var a=!0;return this.items.each(function(b){b.validate()||(a=!1)}),a},isDirty:function(){var a=!1;return this.items.each(function(b){if(b.isDirty())return a=!0,!1}),a},doAction:function(a,b){return Ext.isString(a)&&(a=new Ext.form.Action.ACTION_TYPES[a](this,b)),this.fireEvent("beforeaction",this,a)!==!1&&(this.beforeAction(a),a.run.defer(100,a)),this},submit:function(a){a=a||{};if(this.standardSubmit){var b=a.clientValidation===!1||this.isValid();if(b){var c=this.el.dom;this.url&&Ext.isEmpty(c.action)&&(c.action=this.url),c.submit()}return b}var d=String.format("{0}submit",this.api?"direct":"");return this.doAction(d,a),this},load:function(a){var b=String.format("{0}load",this.api?"direct":"");return this.doAction(b,a),this},updateRecord:function(a){a.beginEdit();var b=a.fields;return b.each(function(b){var c=this.findField(b.name);c&&a.set(b.name,c.getValue())},this),a.endEdit(),this},loadRecord:function(a){return this.setValues(a.data),this},beforeAction:function(a){this.items.each(function(a){a.isFormField&&a.syncValue&&a.syncValue()});var b=a.options;b.waitMsg&&(this.waitMsgTarget===!0?this.el.mask(b.waitMsg,"x-mask-loading"):this.waitMsgTarget?(this.waitMsgTarget=Ext.get(this.waitMsgTarget),this.waitMsgTarget.mask(b.waitMsg,"x-mask-loading")):Ext.MessageBox.wait(b.waitMsg,b.waitTitle||this.waitTitle))},afterAction:function(a,b)
{this.activeAction=null;var c=a.options;c.waitMsg&&(this.waitMsgTarget===!0?this.el.unmask():this.waitMsgTarget?this.waitMsgTarget.unmask():(Ext.MessageBox.updateProgress(1),Ext.MessageBox.hide())),b?(c.reset&&this.reset(),Ext.callback(c.success,c.scope,[this,a]),this.fireEvent("actioncomplete",this,a)):(Ext.callback(c.failure,c.scope,[this,a]),this.fireEvent("actionfailed",this,a))},findField:function(a){var b=this.items.get(a);if(!Ext.isObject(b)){var c=function(d){if(d.isFormField){if(d.dataIndex==a||d.id==a||d.getName()==a)return b=d,!1;if(d.isComposite&&d.rendered)return d.items.each(c)}};this.items.each(c)}return b||null},markInvalid:function(a){if(Ext.isArray(a))for(var b=0,c=a.length;b<c;b++){var d=a[b],e=this.findField(d.id);e&&e.markInvalid(d.msg)}else{var f,g;for(g in a)!Ext.isFunction(a[g])&&(f=this.findField(g))&&f.markInvalid(a[g])}return this},setValues:function(a){if(Ext.isArray(a))for(var b=0,c=a.length;b<c;b++){var d=a[b],e=this.findField(d.id);e&&(e.setValue(d.value),this.trackResetOnLoad&&(e.originalValue=e.getValue()))}else{var f,g;for(g in a)!Ext.isFunction(a[g])&&(f=this.findField(g))&&(f.setValue(a[g]),this.trackResetOnLoad&&(f.originalValue=f.getValue()))}return this},getValues:function(a){var b=Ext.lib.Ajax.serializeForm(this.el.dom);return a===!0?b:Ext.urlDecode(b)},getFieldValues:function(a){var b={},c,d,e;return this.items.each(function(f){if(a!==!0||f.isDirty())c=f.getName(),d=b[c],e=f.getValue(),Ext.isDefined(d)?Ext.isArray(d)?b[c].push(e):b[c]=[d,e]:b[c]=e}),b},clearInvalid:function(){return this.items.each(function(a){a.clearInvalid()}),this},reset:function(){return this.items.each(function(a){a.reset()}),this},add:function(){return this.items.addAll(Array.prototype.slice.call(arguments,0)),this},remove:function(a){return this.items.remove(a),this},cleanDestroyed:function(){this.items.filterBy(function(a){return!!a.isDestroyed}).each(this.remove,this)},render:function(){return this.items.each(function(a){a.isFormField&&!a.rendered&&document.getElementById(a.id)&&a.applyToMarkup(a.id)}),this},applyToFields:function(a){return this.items.each(function(b){Ext.apply(b,a)}),this},applyIfToFields:function(a){return this.items.each(function(b){Ext.applyIf(b,a)}),this},callFieldMethod:function(a,b){return b=b||[],this.items.each(function(c){Ext.isFunction(c[a])&&c[a].apply(c,b)}),this}}),Ext.BasicForm=Ext.form.BasicForm,Ext.FormPanel=Ext.extend(Ext.Panel,{minButtonWidth:75,labelAlign:"left",monitorValid:!1,monitorPoll:200,layout:"form",initComponent:function(){this.form=this.createForm(),Ext.FormPanel.superclass.initComponent.call(this),this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()},this.fileUpload&&(this.bodyCfg.enctype="multipart/form-data"),this.initItems(),this.addEvents("clientvalidation"),this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"])},createForm:function(){var a=Ext.applyIf({listeners:{}},this.initialConfig);return new Ext.form.BasicForm(null,a)},initFields:function(){var a=this.form,b=this,c=function(d){b.isField(d)?a.add(d):d.findBy&&d!=b&&(b.applySettings(d),d.items&&d.items.each&&d.items.each(c,this))};this.items.each(c,this)},applySettings:function(a){var b=a.ownerCt;Ext.applyIf(a,{labelAlign:b.labelAlign,labelWidth:b.labelWidth,itemCls:b.itemCls})},getLayoutTarget:function(){return this.form.el},getForm:function(){return this.form},onRender:function(a,b){this.initFields(),Ext.FormPanel.superclass.onRender.call(this,a,b),this.form.initEl(this.body)},beforeDestroy:function(){this.stopMonitoring(),this.form.destroy(!0),Ext.FormPanel.superclass.beforeDestroy.call(this)},isField:function(a){return!!a.setValue&&!!a.getValue&&!!a.markInvalid&&!!a.clearInvalid},initEvents:function(){Ext.FormPanel.superclass.initEvents.call(this),this.on({scope:this,add:this.onAddEvent,remove:this.onRemoveEvent}),this.monitorValid&&this.startMonitoring()},onAdd:function(a){Ext.FormPanel.superclass.onAdd.call(this,a),this.processAdd(a)},onAddEvent:function(a,b){a!==this&&this.processAdd(b)},processAdd:function(a){this.isField(a)?this.form.add(a):a.findBy&&(this.applySettings(a),this.form.add.apply(this.form,a.findBy(this.isField)))},onRemove:function(a){Ext.FormPanel.superclass.onRemove.call(this,a),this.processRemove(a)},onRemoveEvent:function(a,b){a!==this&&this.processRemove(b)},processRemove:function(a){this.destroying||(this.isField(a)?this.form.remove(a):a.findBy&&(Ext.each(a.findBy(this.isField),this.form.remove,this.form),a.isDestroyed&&this.form.cleanDestroyed()))},startMonitoring:function(){this.validTask||(this.validTask=new Ext.util.TaskRunner,this.validTask.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this}))},stopMonitoring:function(){this.validTask&&(this.validTask.stopAll(),this.validTask=null)},load:function(){this.form.load.apply(this.form,arguments)},onDisable:function(){Ext.FormPanel.superclass.onDisable.call(this),this.form&&this.form.items.each(function(){this.disable()})},onEnable:function(){Ext.FormPanel.superclass.onEnable.call(this),this.form&&this.form.items.each(function(){this.enable()})},bindHandler:function(){var a=!0;this.form.items.each(function(b){if(!b.isValid(!0))return a=!1,!1});if(this.fbar){var b=this.fbar.items.items;for(var c=0,d=b.length;c<d;c++){var e=b[c];e.formBind===!0&&e.disabled===a&&e.setDisabled(!a)}}this.fireEvent("clientvalidation",this,a)}}),Ext.reg("form",Ext.FormPanel),Ext.form.FormPanel=Ext.FormPanel,Ext.form.FieldSet=Ext.extend(Ext.Panel,{baseCls:"x-fieldset",layout:"form",animCollapse:!1,onRender:function(a,b){if(!this.el){this.el=document.createElement("fieldset"),this.el.id=this.id;if(this.title||this.header||this.checkboxToggle)this.el.appendChild(document.createElement("legend")).className=this.baseCls+"-header"}Ext.form.FieldSet.superclass.onRender.call(this,a,b);if(this.checkboxToggle){var c=typeof this.checkboxToggle=="object"?this.checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox"};this.checkbox=this.header.insertFirst(c),this.checkbox.dom.checked=!this.collapsed,this.mon(this.checkbox,"click",this.onCheckClick,this)}},onCollapse:function(a,b){this.checkbox&&(this.checkbox.dom.checked=!1),Ext.form.FieldSet.superclass.onCollapse.call(this,a,b)},onExpand:function(a,b){this.checkbox&&(this.checkbox.dom.checked=!0),Ext.form.FieldSet.superclass.onExpand.call(this,a,b)},onCheckClick:function(){this[this.checkbox.dom.checked?"expand":"collapse"]()}}),Ext.reg("fieldset",Ext.form.FieldSet),Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:!0,enableFontSize:!0,enableColors:!0,enableAlignments:!0,enableLists:!0,enableSourceEdit:!0,enableLinks:!0,enableFont:!0,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http://",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",defaultValue:Ext.isOpera||Ext.isIE6?"&#160;":"&#8203;",actionMode:"wrap",validationEvent:!1,deferHeight:!0,initialized:!1,activated:!1,sourceEditMode:!1,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents("initialize","activate","beforesync","beforepush","sync","push","editmodechange")},createFontOptions:function(){var a=[],b=this.fontFamilies,c,d;for(var e=0,f=b.length;e<f;e++)c=b[e],d=c.toLowerCase(),a.push('<option value="',d,'" style="font-family:',c,';"',this.defaultFont==d?' selected="true">':">",c,"</option>");return a.join("")},createToolbar:function(a){function d(b,d,e){return{itemId:b,cls:"x-btn-icon",iconCls:"x-edit-"+b,enableToggle:d!==!1,scope:a,handler:e||a.relayBtnCmd,clickEvent:"mousedown",tooltip:c?a.buttonTips[b]||undefined:undefined,overflowText:a.buttonTips[b].title||undefined,tabIndex:-1}}var b=[],c=Ext.QuickTips&&Ext.QuickTips.isEnabled();if(this.enableFont&&!Ext.isSafari2){var e=new Ext.Toolbar.Item({autoEl:{tag:"select",cls:"x-font-select",html:this.createFontOptions()}});b.push(e,"-")}this.enableFormat&&b.push(d("bold"),d("italic"),d("underline")),this.enableFontSize&&b.push("-",d("increasefontsize",!1,this.adjustFont),d("decreasefontsize",!1,this.adjustFont)),this.enableColors&&b.push("-",{itemId:"forecolor",cls:"x-btn-icon",iconCls:"x-edit-forecolor",clickEvent:"mousedown",tooltip:c?a.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:!0,focus:Ext.emptyFn,value:"000000",plain:!0,listeners:{scope:this,select:function(a,b){this.execCmd("forecolor",Ext.isWebKit||Ext.isIE?"#"+b:b),this.deferFocus()}},clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon",iconCls:"x-edit-backcolor",clickEvent:"mousedown",tooltip:c?a.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:!0,allowReselect:!0,listeners:{scope:this,select:function(a,b){Ext.isGecko?(this.execCmd("useCSS",!1),this.execCmd("hilitecolor",b),this.execCmd("useCSS",!0),this.deferFocus()):(this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isWebKit||Ext.isIE?"#"+b:b),this.deferFocus())}},clickEvent:"mousedown"})}),this.enableAlignments&&b.push("-",d("justifyleft"),d("justifycenter"),d("justifyright")),Ext.isSafari2||(this.enableLinks&&b.push("-",d("createlink",!1,this.createLink)),this.enableLists&&b.push("-",d("insertorderedlist"),d("insertunorderedlist")),this.enableSourceEdit&&b.push("-",d("sourceedit",!0,function(a){this.toggleSourceEdit(!this.sourceEditMode)})));var f=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild,items:b});e&&(this.fontSelect=e.el,this.mon(this.fontSelect,"change",function(){var a=this.fontSelect.dom.value;this.relayCmd("fontname",a),this.deferFocus()},this)),this.mon(f.el,"click",function(a){a.preventDefault()}),this.tb=f,this.tb.doLayout()},onDisable:function(){this.wrap.mask(),Ext.form.HtmlEditor.superclass.onDisable.call(this)},onEnable:function(){this.wrap.unmask(),Ext.form.HtmlEditor.superclass.onEnable.call(this)},setReadOnly:function(a){Ext.form.HtmlEditor.superclass.setReadOnly.call(this,a);if(this.initialized){Ext.isIE?this.getEditorBody().contentEditable=!a:this.setDesignMode(!a);var b=this.getEditorBody();b&&(b.style.cursor=this.readOnly?"default":"text"),this.disableItems(a)}},getDocMarkup:function(){var a=Ext.fly(this.iframe).getHeight()-this.iframePad*2;return String.format('<html><head><style type="text/css">body{border: 0; margin: 0; padding: {0}px; height: {1}px; cursor: text}</style></head><body></body></html>',this.iframePad,a)},getEditorBody:function(){var a=this.getDoc();return a.body||a.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:this.iframe.contentDocument||this.getWin().document},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(a,b){Ext.form.HtmlEditor.superclass.onRender.call(this,a,b),this.el.dom.style.border="0 none",this.el.dom.setAttribute("tabIndex",-1),this.el.addClass("x-hidden"),Ext.isIE&&this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;"),this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}}),this.createToolbar(this),this.disableItems(!0),this.tb.doLayout(),this.createIFrame();if(!this.width){var c=this.el.getSize();this.setSize(c.width,this.height||c.height)}this.resizeEl=this.positionEl=this.wrap},createIFrame:function(){var a=document.createElement("iframe");a.name=Ext.id(),a.frameBorder="0",a.style.overflow="auto",this.wrap.dom.appendChild(a),this.iframe=a,this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})},initFrame:function(){Ext.TaskMgr.stop(this.monitorTask);var a=this.getDoc();this.win=this.getWin(),a.open(),a.write(this.getDocMarkup()),a.close();var b={run:function(){var a=this.getDoc();if(a.body||a.readyState=="complete")Ext.TaskMgr.stop(b),this.setDesignMode(!0),this.initEditor.defer(10,this)},interval:10,duration:1e4,scope:this};Ext.TaskMgr.start(b)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var a=this.getDoc();if(!a)return;(!a.editorInitialized||this.getDesignMode()!="on")&&this.initFrame()}},setDesignMode:function(a){var b;if(b=this.getDoc())this.readOnly&&(a=!1),b.designMode=/on|true/i.test(String(a).toLowerCase())?"on":"off"},getDesignMode:function(){var a=this.getDoc();return a?String(a.designMode).toLowerCase():""},disableItems:function(a){this.fontSelect&&(this.fontSelect.dom.disabled=a),this.tb.items.each(function(b){b.getItemId()!="sourceedit"&&b.setDisabled(a)})},onResize:function(a,b){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(Ext.isNumber(a)){var c=a-this.wrap.getFrameWidth("lr");this.el.setWidth(c),this.tb.setWidth(c),this.iframe.style.width=Math.max(c,0)+"px"}if(Ext.isNumber(b)){var d=b-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(d),this.iframe.style.height=Math.max(d,0)+"px";var e=this.getEditorBody();e&&(e.style.height=Math.max(d-this.iframePad*2,0)+"px")}}},toggleSourceEdit:function(a){var b,c,d;a===undefined&&(a=!this.sourceEditMode),this.sourceEditMode=a===!0;var e=this.tb.getComponent("sourceedit");if(e.pressed!==this.sourceEditMode){e.toggle(this.sourceEditMode);if(!e.xtbHidden)return}this.sourceEditMode?(d=this.getSize(),b=Ext.get(this.iframe).getHeight(),this.disableItems(!0),this.syncValue(),this.iframe.className="x-hidden",this.el.removeClass("x-hidden"),this.el.dom.removeAttribute("tabIndex"),this.el.focus(),this.el.dom.style.height=b+"px"):(c=parseInt(this.el.dom.style.height,10),this.initialized&&this.disableItems(this.readOnly),this.pushValue(),this.iframe.className="",this.el.addClass("x-hidden"),this.el.dom.setAttribute("tabIndex",-1),this.deferFocus(),this.setSize(d),this.iframe.style.height=c+"px"),this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var a=prompt(this.createLinkText,this.defaultLinkValue);a&&a!="http://"&&this.relayCmd("createlink",a)},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(a){return Ext.form.HtmlEditor.superclass.setValue.call(this,a),this.pushValue(),this},cleanHtml:function(a){return a=String(a),Ext.isWebKit&&(a=a.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")),a.charCodeAt(0)==this.defaultValue.replace(/\D/g,"")&&(a=a.substring(1)),a},syncValue:function(){if(this.initialized){var a=this.getEditorBody(),b=a.innerHTML;if(Ext.isWebKit){var c=a.getAttribute("style"),d=c.match(/text-align:(.*?);/i);d&&d[1]&&(b='<div style="'+d[0]+'">'+b+"</div>")}b=this.cleanHtml(b),this.fireEvent("beforesync",this,b)!==!1&&(this.el.dom.value=b,this.fireEvent("sync",this,b))}},getValue:function(){return this[this.sourceEditMode?"pushValue":"syncValue"](),Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var a=this.el.dom.value;!this.activated&&a.length<1&&(a=this.defaultValue),this.fireEvent("beforepush",this,a)!==!1&&(this.getEditorBody().innerHTML=a,Ext.isGecko&&(this.setDesignMode(!1),this.setDesignMode(!0)),this.fireEvent("push",this,a))}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){this.win&&!this.sourceEditMode?this.win.focus():this.el.focus()},initEditor:function(){try{var a=this.getEditorBody(),b=this.el.getStyles("font-size","font-family","background-image","background-repeat","background-color","color"),c,d;b["background-attachment"]="fixed",a.bgProperties="fixed",Ext.DomHelper.applyStyles(a,b),c=this.getDoc();if(c)try{Ext.EventManager.removeAll(c)}catch(e){}d=this.onEditorEvent.createDelegate(this),Ext.EventManager.on(c,{mousedown:d,dblclick:d,click:d,keyup:d,buffer:100}),Ext.isGecko&&Ext.EventManager.on(c,"keypress",this.applyCommand,this),(Ext.isIE||Ext.isWebKit||Ext.isOpera)&&Ext.EventManager.on(c,"keydown",this.fixKeys,this),c.editorInitialized=!0,this.initialized=!0,this.pushValue(),this.setReadOnly(this.readOnly),this.fireEvent("initialize",this)}catch(e){}},onDestroy:function(){this.monitorTask&&Ext.TaskMgr.stop(this.monitorTask);if(this.rendered){Ext.destroy(this.tb);var a=this.getDoc();if(a)try{Ext.EventManager.removeAll(a);for(var b in a)delete a[b]}catch(c){}this.wrap&&(this.wrap.dom.innerHTML="",this.wrap.remove())}this.el&&(this.el.removeAllListeners(),this.el.remove()),this.purgeListeners()},onFirstFocus:function(){this.activated=!0,this.disableItems(this.readOnly);if(Ext.isGecko){this.win.focus();var a=this.win.getSelection();if(!a.focusNode||a.focusNode.nodeType!=3){var b=a.getRangeAt(0);b.selectNodeContents(this.getEditorBody()),b.collapse(!0),this.deferFocus()}try{this.execCmd("useCSS",!0),this.execCmd("styleWithCSS",!1)}catch(c){}}this.fireEvent("activate",this)},adjustFont:function(a){var b=a.getItemId()=="increasefontsize"?1:-1,c=this.getDoc(),d=parseInt(c.queryCommandValue("FontSize")||2,10);Ext.isSafari&&!Ext.isSafari2||Ext.isChrome||Ext.isAir?(d<=10?d=1+b:d<=13?d=2+b:d<=16?d=3+b:d<=18?d=4+b:d<=24?d=5+b:d=6+b,d=d.constrain(1,6)):(Ext.isSafari&&(b*=2),d=Math.max(1,d+b)+(Ext.isSafari?"px":0)),this.execCmd("FontSize",d)},onEditorEvent:function(a){this.updateToolbar()},updateToolbar:function(){if(this.readOnly)return;if(!this.activated){this.onFirstFocus();return}var a=this.tb.items.map,b=this.getDoc();if(this.enableFont&&!Ext.isSafari2){var c=(b.queryCommandValue("FontName")||this.defaultFont).toLowerCase();c!=this.fontSelect.dom.value&&(this.fontSelect.dom.value=c)}this.enableFormat&&(a.bold.toggle(b.queryCommandState("bold")),a.italic.toggle(b.queryCommandState("italic")),a.underline.toggle(b.queryCommandState("underline"))),this.enableAlignments&&(a.justifyleft.toggle(b.queryCommandState("justifyleft")),a.justifycenter.toggle(b.queryCommandState("justifycenter")),a.justifyright.toggle(b.queryCommandState("justifyright"))),!Ext.isSafari2&&this.enableLists&&(a.insertorderedlist.toggle(b.queryCommandState("insertorderedlist")),a.insertunorderedlist.toggle(b.queryCommandState("insertunorderedlist"))),Ext.menu.MenuMgr.hideAll(),this.syncValue()},relayBtnCmd:function(a){this.relayCmd(a.getItemId())},relayCmd:function(a,b){(function(){this.focus(),this.execCmd(a,b),this.updateToolbar()}).defer(10,this)},execCmd:function(a,b){var c=this.getDoc();c.execCommand(a,!1,b===undefined?null:b),this.syncValue()},applyCommand:function(a){if(a.ctrlKey){var b=a.getCharCode(),c;if(b>0){b=String.fromCharCode(b);switch(b){case"b":c="bold";break;case"i":c="italic";break;case"u":c="underline"}c&&(this.win.focus(),this.execCmd(c),this.deferFocus(),a.preventDefault())}}},insertAtCursor:function(a){if(!this.activated)return;if(Ext.isIE){this.win.focus();var b=this.getDoc(),c=b.selection.createRange();c&&(c.pasteHTML(a),this.syncValue(),this.deferFocus())}else this.win.focus(),this.execCmd("InsertHTML",a),this.deferFocus()},fixKeys:function(){if(Ext.isIE)return function(a){var b=a.getKey(),c=this.getDoc(),d;if(b==a.TAB)a.stopEvent(),d=c.selection.createRange(),d&&(d.collapse(!0),d.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;"),this.deferFocus());else if(b==a.ENTER){d=c.selection.createRange();if(d){var e=d.parentElement();if(!e||e.tagName.toLowerCase()!="li")a.stopEvent(),d.pasteHTML("<br />"),d.collapse(!1),d.select()}}};if(Ext.isOpera)return function(a){var b=a.getKey();b==a.TAB&&(a.stopEvent(),this.win.focus(),this.execCmd("InsertHTML","&nbsp;&nbsp;&nbsp;&nbsp;"),this.deferFocus())};if(Ext.isWebKit)return function(a){var b=a.getKey();b==a.TAB?(a.stopEvent(),this.execCmd("InsertText","\t"),this.deferFocus()):b==a.ENTER&&(a.stopEvent(),this.execCmd("InsertHtml","<br /><br />"),this.deferFocus())}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}}),Ext.reg("htmleditor",Ext.form.HtmlEditor),Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:undefined,maxValue:undefined,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,mode:"local",triggerAction:"all",typeAhead:!1,initDate:"1/1/2008",initDateFormat:"j/n/Y",initComponent:function(){Ext.isDefined(this.minValue)&&this.setMinValue(this.minValue,!0),Ext.isDefined(this.maxValue)&&this.setMaxValue(this.maxValue,!0),this.store||this.generateStore(!0),Ext.form.TimeField.superclass.initComponent.call(this)},setMinValue:function(a,b){return this.setLimit(a,!0,b),this},setMaxValue:function(a,b){return this.setLimit(a,!1,b),this},generateStore:function(a){var b=this.minValue||(new Date(this.initDate)).clearTime(),c=this.maxValue||(new Date(this.initDate)).clearTime().add("mi",1439),d=[];while(b<=c)d.push(b.dateFormat(this.format)),b=b.add("mi",this.increment);this.bindStore(d,a)},setLimit:function(a,b,c){var d;Ext.isString(a)?d=this.parseDate(a):Ext.isDate(a)&&(d=a);if(d){var e=(new Date(this.initDate)).clearTime();e.setHours(d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds()),this[b?"minValue":"maxValue"]=e,c||this.generateStore()}},getValue:function(){var a=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(a))||""},setValue:function(a){return Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},validateValue:Ext.form.DateField.prototype.validateValue,formatDate:Ext.form.DateField.prototype.formatDate,parseDate:function(a){if(!a||Ext.isDate(a))return a;var b=this.initDate+" ",c=this.initDateFormat+" ",d=Date.parseDate(b+a,c+this.format),e=this.altFormats;if(!d&&e){this.altFormatsArray||(this.altFormatsArray=e.split("|"));for(var f=0,g=this.altFormatsArray,h=g.length;f<h&&!d;f++)d=Date.parseDate(b+a,c+g[f])}return d}}),Ext.reg("timefield",Ext.form.TimeField),Ext.form.SliderField=Ext.extend(Ext.form.Field,{useTips:!0,tipText:null,actionMode:"wrap",initComponent:function(){var a=Ext.copyTo({id:this.id+"-slider"},this.initialConfig,["vertical","minValue","maxValue","decimalPrecision","keyIncrement","increment","clickToChange","animate"]);if(this.useTips){var b=this.tipText?{getText:this.tipText}:{};a.plugins=[new Ext.slider.Tip(b)]}this.slider=new Ext.Slider(a),Ext.form.SliderField.superclass.initComponent.call(this)},onRender:function(a,b){this.autoCreate={id:this.id,name:this.name,type:"hidden",tag:"input"},Ext.form.SliderField.superclass.onRender.call(this,a,b),this.wrap=this.el.wrap({cls:"x-form-field-wrap"}),this.resizeEl=this.positionEl=this.wrap,this.slider.render(this.wrap)},onResize:function(a,b,c,d){Ext.form.SliderField.superclass.onResize.call(this,a,b,c,d),this.slider.setSize(a,b)},initEvents:function(){Ext.form.SliderField.superclass.initEvents.call(this),this.slider.on("change",this.onChange,this)},onChange:function(a,b){this.setValue(b,undefined,!0)},onEnable:function(){Ext.form.SliderField.superclass.onEnable.call(this),this.slider.enable()},onDisable:function(){Ext.form.SliderField.superclass.onDisable.call(this),this.slider.disable()},beforeDestroy:function(){Ext.destroy(this.slider),Ext.form.SliderField.superclass.beforeDestroy.call(this)},alignErrorIcon:function(){this.errorIcon.alignTo(this.slider.el,"tl-tr",[2,0])},setMinValue:function(a){return this.slider.setMinValue(a),this},setMaxValue:function(a){return this.slider.setMaxValue(a),this},setValue:function(a,b,c){return c||this.slider.setValue(a,b),Ext.form.SliderField.superclass.setValue.call(this,this.slider.getValue())},getValue:function(){return this.slider.getValue()}}),Ext.reg("sliderfield",Ext.form.SliderField),Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(a,b){this.el||(this.el=document.createElement("label"),this.el.id=this.getId(),this.el.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):this.html||"",this.forId&&this.el.setAttribute("for",this.forId)),Ext.form.Label.superclass.onRender.call(this,a,b)},setText:function(a,b){var c=b===!1;return this[c?"html":"text"]=a,delete this[c?"text":"html"],this.rendered&&(this.el.dom.innerHTML=b!==!1?Ext.util.Format.htmlEncode(a):a),this}}),Ext.reg("label",Ext.form.Label),Ext.form.Action=function(a,b){this.form=a,this.options=b||{}},Ext.form.Action.CLIENT_INVALID="client",Ext.form.Action.SERVER_INVALID="server",Ext.form.Action.CONNECT_FAILURE="connect",Ext.form.Action.LOAD_FAILURE="load",Ext.form.Action.prototype={type:"default",run:function(a){},success:function(a){},handleResponse:function(a){},failure:function(a){this.response=a,this.failureType=Ext.form.Action.CONNECT_FAILURE,this.form.afterAction(this,!1)},processResponse:function(a){return this.response=a,!a.responseText&&!a.responseXML?!0:(this.result=this.handleResponse(a),this.result)},getUrl:function(a){var b=this.options.url||this.form.url||this.form.el.dom.action;if(a){var c=this.getParams();c&&(b=Ext.urlAppend(b,c))}return b},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var a=this.form.baseParams,b=this.options.params;return b?typeof b=="object"?b=Ext.urlEncode(Ext.applyIf(b,a)):typeof b=="string"&&a&&(b+="&"+Ext.urlEncode(a)):a&&(b=Ext.urlEncode(a)),b},createCallback:function(a){var a=a||{};return{success:this.success,failure:this.failure,scope:this,timeout:a.timeout*1e3||this.form.timeout*1e3,upload:this.form.fileUpload?this.success:undefined}}},Ext.form.Action.Submit=function(a,b){Ext.form.Action.Submit.superclass.constructor.call(this,a,b)},Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var a=this.options,b=this.getMethod(),c=b=="GET";if(a.clientValidation===!1||this.form.isValid()){if(a.submitEmptyText===!1){var d=this.form.items,e=[];d.each(function(a){a.el.getValue()==a.emptyText&&(e.push(a),a.el.dom.value="")})}Ext.Ajax.request(Ext.apply(this.createCallback(a),{form:this.form.el.dom,url:this.getUrl(c),method:b,headers:a.headers,params:c?null:this.getParams(),isUpload:this.form.fileUpload})),a.submitEmptyText===!1&&Ext.each(e,function(a){a.applyEmptyText&&a.applyEmptyText()})}else a.clientValidation!==!1&&(this.failureType=Ext.form.Action.CLIENT_INVALID,this.form.afterAction(this,!1))},success:function(a){var b=this.processResponse(a);if(b===!0||b.success){this.form.afterAction(this,!0);return}b.errors&&this.form.markInvalid(b.errors),this.failureType=Ext.form.Action.SERVER_INVALID,this.form.afterAction(this,!1)},handleResponse:function(a){if(this.form.errorReader){var b=this.form.errorReader.read(a),c=[];if(b.records)for(var d=0,e=b.records.length;d<e;d++){var f=b.records[d];c[d]=f.data}return c.length<1&&(c=null),{success:b.success,errors:c}}return Ext.decode(a.responseText)}}),Ext.form.Action.Load=function(a,b){Ext.form.Action.Load.superclass.constructor.call(this,a,b),this.reader=this.form.reader},Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(this.options),{method:this.getMethod(),url:this.getUrl(!1),headers:this.options.headers,params:this.getParams()}))},success:function(a){var b=this.processResponse(a);if(b===!0||!b.success||!b.data){this.failureType=Ext.form.Action.LOAD_FAILURE,this.form.afterAction(this,!1);return}this.form.clearInvalid(),this.form.setValues(b.data),this.form.afterAction(this,!0)},handleResponse:function(a){if(this.form.reader){var b=this.form.reader.read(a),c=b.records&&b.records[0]?b.records[0].data:null;return{success:b.success,data:c}}return Ext.decode(a.responseText)}}),Ext.form.Action.DirectLoad=Ext.extend(Ext.form.Action.Load,{constructor:function(a,b){Ext.form.Action.DirectLoad.superclass.constructor.call(this,a,b)},type:"directload",run:function(){var a=this.getParams();a.push(this.success,this),this.form.api.load.apply(window,a)},getParams:function(){var a=[],b={},c=this.form.baseParams,d=this.options.params;Ext.apply(b,d,c);var e=this.form.paramOrder;if(e)for(var f=0,g=e.length;f<g;f++)a.push(b[e[f]]);else this.form.paramsAsHash&&a.push(b);return a},processResponse:function(a){return this.result=a,a},success:function(a,b){b.type==Ext.Direct.exceptions.SERVER&&(a={}),Ext.form.Action.DirectLoad.superclass.success.call(this,a)}}),Ext.form.Action.DirectSubmit=Ext.extend(Ext.form.Action.Submit,{constructor:function(a,b){Ext.form.Action.DirectSubmit.superclass.constructor.call(this,a,b)},type:"directsubmit",run:function(){var a=this.options;a.clientValidation===!1||this.form.isValid()?(this.success.params=this.getParams(),this.form.api.submit(this.form.el.dom,this.success,this)):a.clientValidation!==!1&&(this.failureType=Ext.form.Action.CLIENT_INVALID,this.form.afterAction(this,!1))},getParams:function(){var a={},b=this.form.baseParams,c=this.options.params;return Ext.apply(a,c,b),a},processResponse:function(a){return this.result=a,a},success:function(a,b){b.type==Ext.Direct.exceptions.SERVER&&(a={}),Ext.form.Action.DirectSubmit.superclass.success.call(this,a)}}),Ext.form.Action.ACTION_TYPES={load:Ext.form.Action.Load,submit:Ext.form.Action.Submit,directload:Ext.form.Action.DirectLoad,directsubmit:Ext.form.Action.DirectSubmit},Ext.form.VTypes=function(){var a=/^[a-zA-Z_]+$/,b=/^[a-zA-Z0-9_]+$/,c=/^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,d=/(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{email:function(a){return c.test(a)},emailText:'This field should be an e-mail address in the format "user@example.com"',emailMask:/[a-z0-9_\.\-@\+]/i,url:function(a){return d.test(a)},urlText:'This field should be a URL in the format "http://www.example.com"',alpha:function(b){return a.test(b)},alphaText:"This field should only contain letters and _",alphaMask:/[a-z_]/i,alphanum:function(a){return b.test(a)},alphanumText:"This field should only contain letters, numbers and _",alphanumMask:/[a-z0-9_]/i}}(),jQuery.fn.between=function(a,b){if(this[0].nodeType!==3)b>this.children().size()&&(b=this.children().size()),b<=0?this.prepend(a):this.children().eq(b-1).after(a);else if(b<=0)this.before(a);else if(b>=this[0].length)this.after(a);else{var c=this[0].data;this[0].data=c.substring(0,b),this.after(c.substring(b,c.length)),this.after(a)}},jQuery.fn.removeCss=function(a){return this.each(function(){var b=jQuery(this).attr("style"),c=jQuery.grep(jQuery(this).attr("style").split(";"),function(b){var c=b.split(":");if(c[0]&&c[0].toUpperCase().trim().indexOf(a.toUpperCase())==-1)return b}).join(";").trim();return jQuery(this).removeAttr("style"),c.trim()&&jQuery(this).attr("style",c),jQuery(this)})},jQuery.fn.contentEditable=function(a){var b="contenteditable";jQuery.browser.msie&&parseInt(jQuery.browser.version)==7&&(b="contentEditable");if(a==undefined)return jQuery(this).attr(b);a===""?jQuery(this).removeAttr(b):(a&&a!=="false"?a="true":a="false",jQuery(this).attr(b,a))};if(typeof GENTICS=="undefined"||!GENTICS)var GENTICS={};if(typeof GENTICS.Utils=="undefined"||!GENTICS)GENTICS.Utils={};GENTICS.Utils.applyProperties=function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},GENTICS.Utils.uniqeString4=function(){return((1+Math.random())*65536|0).toString(16).substring(1)},GENTICS.Utils.guid=function(){var a=GENTICS.Utils.uniqeString4;return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()};if(typeof GENTICS=="undefined"||!GENTICS)var GENTICS={};if(typeof GENTICS.Utils=="undefined"||!GENTICS)GENTICS.Utils={};GENTICS.Utils.RangeObject=function(a){this.startContainer,this.startOffset,this.endContainer
,this.endOffset,this.startParents=[],this.endParents=[],this.rangeTree=[],typeof a=="object"?(a.startContainer!==undefined&&(this.startContainer=a.startContainer),a.startOffset!==undefined&&(this.startOffset=a.startOffset),a.endContainer!==undefined&&(this.endContainer=a.endContainer),a.endOffset!==undefined&&(this.endOffset=a.endOffset)):a===!0&&this.initializeFromUserSelection()},GENTICS.Utils.RangeObject.prototype.log=function(a,b){if(GENTICS&&GENTICS.Aloha&&GENTICS.Aloha.Log)return GENTICS.Aloha.Log.debug(this,a),!1;console&&(console.log(a),b&&console.log(b))},GENTICS.Utils.RangeObject.prototype.isCollapsed=function(){return!this.endContainer||this.startContainer===this.endContainer&&this.startOffset===this.endOffset},GENTICS.Utils.RangeObject.prototype.getCommonAncestorContainer=function(){return this.commonAncestorContainer?this.commonAncestorContainer:(this.updateCommonAncestorContainer(),this.commonAncestorContainer)},GENTICS.Utils.RangeObject.prototype.getContainerParents=function(a,b){var c=b?this.endContainer:this.startContainer,d=b?this.endParents:this.startParents;if(!c)return!1;typeof a=="undefined"&&(a=jQuery("body"));if(!d[a.get(0)]){var e;if(c.nodeType==3)e=jQuery(c).parents();else{e=jQuery(c).parents();for(var f=e.length;f>0;--f)e[f]=e[f-1];e[0]=c}var g=e.index(a);g>=0&&(e=e.slice(0,g)),d[a.get(0)]=e}return d[a.get(0)]},GENTICS.Utils.RangeObject.prototype.getStartContainerParents=function(a){return this.getContainerParents(a,!1)},GENTICS.Utils.RangeObject.prototype.getEndContainerParents=function(a){return this.getContainerParents(a,!0)},GENTICS.Utils.RangeObject.prototype.updateCommonAncestorContainer=function(a){var b=this.getStartContainerParents(),c=this.getEndContainerParents();if(!a){if(!(b.length>0&&c.length>0))return GENTICS.Utils.RangeObject.prototype.log("could not find commonAncestorContainer"),!1;for(var d=0;d<b.length;d++)if(c.index(b[d])!=-1){this.commonAncestorContainer=b[d];break}}else this.commonAncestorContainer=a;return GENTICS.Utils.RangeObject.prototype.log(a?"commonAncestorContainer was set successfully":"commonAncestorContainer was calculated successfully"),!0},GENTICS.Utils.RangeObject.prototype.getCollapsedIERange=function(a,b){var c=document.body.createTextRange(),d=this.searchElementToLeft(a,b);if(d.element){var e=document.body.createTextRange();e.moveToElementText(d.element),c.setEndPoint("StartToEnd",e),d.characters!=0?c.moveStart("character",d.characters):(c.moveStart("character",1),c.moveStart("character",-1))}else{var f=this.searchElementToRight(a,b),g=a.nodeType==3?a.parentNode:a,e=document.body.createTextRange();e.moveToElementText(g),c.setEndPoint("StartToStart",e),d.characters!=0&&c.moveStart("character",d.characters)}return c.collapse(),c},GENTICS.Utils.RangeObject.prototype.select=document.createRange===undefined?function(){GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(this,"Set selection to current range (IE version)"),this.startContainer.nodeType==3&&GENTICS.Utils.Dom.isBlockLevelElement(this.startContainer.nextSibling)&&(jQuery(this.startContainer).after("<br/>"),this.endContainer===this.startContainer.parentNode&&GENTICS.Utils.Dom.getIndexInParent(this.startContainer)<this.endOffset&&this.endOffset++);var a=document.body.createTextRange(),b=this.getCollapsedIERange(this.startContainer,this.startOffset);a.setEndPoint("StartToStart",b);if(this.isCollapsed())a.collapse();else{var c=this.getCollapsedIERange(this.endContainer,this.endOffset);a.setEndPoint("EndToStart",c)}a.select()}:function(){GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(this,"Set selection to current range (non IE version)");var a=document.createRange();a.setStart(this.startContainer,this.startOffset),a.setEnd(this.endContainer,this.endOffset),window.getSelection().removeAllRanges(),window.getSelection().addRange(a)},GENTICS.Utils.RangeObject.prototype.searchElementToLeft=function(a,b){var c=undefined,d=0;a.nodeType==3?(d=b,c=a.previousSibling):b>0&&(c=a.childNodes[b-1]);while(c&&c.nodeType==3)d+=c.data.length,c=c.previousSibling;return{element:c,characters:d}},GENTICS.Utils.RangeObject.prototype.searchElementToRight=function(a,b){var c=undefined,d=0;a.nodeType==3?(d=a.data.length-b,c=a.nextSibling):b<a.childNodes.length&&(c=a.childNodes[b]);while(c&&c.nodeType==3)d+=c.data.length,c=c.nextSibling;return{element:c,characters:d}},GENTICS.Utils.RangeObject.prototype.update=function(a){GENTICS.Utils.RangeObject.prototype.log("=========="),GENTICS.Utils.RangeObject.prototype.log("now updating rangeObject"),this.initializeFromUserSelection(a),this.updateCommonAncestorContainer()},GENTICS.Utils.RangeObject.prototype.initializeFromUserSelection=function(a){var b=window.getSelection();if(!b)return!1;var c=b.getRangeAt(0);if(!c)return!1;this.startContainer=c.startContainer,this.endContainer=c.endContainer,this.startOffset=c.startOffset,this.endOffset=c.endOffset,this.correctRange();return},GENTICS.Utils.RangeObject.prototype.correctRange=function(){this.clearCaches();if(this.isCollapsed()){if(this.startContainer.nodeType==1){if(this.startOffset>0&&this.startContainer.childNodes[this.startOffset-1].nodeType==3){this.startContainer=this.startContainer.childNodes[this.startOffset-1],this.startOffset=this.startContainer.data.length,this.endContainer=this.startContainer,this.endOffset=this.startOffset;return}if(this.startOffset>0&&this.startContainer.childNodes[this.startOffset-1].nodeType==1){var a=GENTICS.Utils.Dom.searchAdjacentTextNode(this.startContainer,this.startOffset,!0);if(a){this.startContainer=this.endContainer=a,this.startOffset=this.endOffset=a.data.length;return}a=GENTICS.Utils.Dom.searchAdjacentTextNode(this.startContainer,this.startOffset,!1);if(a){this.startContainer=this.endContainer=a,this.startOffset=this.endOffset=0;return}}if(this.startOffset<this.startContainer.childNodes.length&&this.startContainer.childNodes[this.startOffset].nodeType==3){this.startContainer=this.startContainer.childNodes[this.startOffset],this.startOffset=0,this.endContainer=this.startContainer,this.endOffset=0;return}}if(this.startContainer.nodeType==3&&this.startOffset==0){var a=GENTICS.Utils.Dom.searchAdjacentTextNode(this.startContainer.parentNode,GENTICS.Utils.Dom.getIndexInParent(this.startContainer),!0);a&&(this.startContainer=this.endContainer=a,this.startOffset=this.endOffset=a.data.length)}}else{if(this.startContainer.nodeType==1)if(this.startOffset<this.startContainer.childNodes.length&&this.startContainer.childNodes[this.startOffset].nodeType==3)this.startContainer=this.startContainer.childNodes[this.startOffset],this.startOffset=0;else if(this.startOffset<this.startContainer.childNodes.length&&this.startContainer.childNodes[this.startOffset].nodeType==1){var b=!1,c=this.startContainer.childNodes[this.startOffset];while(b===!1&&c.childNodes&&c.childNodes.length>0)c=c.childNodes[0],c.nodeType==3&&(b=c);b!==!1&&(this.startContainer=b,this.startOffset=0)}if(this.startContainer.nodeType==3&&this.startOffset==this.startContainer.data.length){var a=GENTICS.Utils.Dom.searchAdjacentTextNode(this.startContainer.parentNode,GENTICS.Utils.Dom.getIndexInParent(this.startContainer)+1,!1);a&&(this.startContainer=a,this.startOffset=0)}if(this.endContainer.nodeType==3&&this.endOffset==0)if(this.endContainer.previousSibling&&this.endContainer.previousSibling.nodeType==3)this.endContainer=this.endContainer.previousSibling,this.endOffset=this.endContainer.data.length;else if(this.endContainer.previousSibling&&this.endContainer.previousSibling.nodeType==1&&this.endContainer.parentNode){var d=this.endContainer.parentNode;for(var e=0;e<d.childNodes.length;++e)if(d.childNodes[e]==this.endContainer){this.endOffset=e;break}this.endContainer=d}this.endContainer.nodeType==1&&this.endOffset==0&&this.endContainer.previousSibling&&(this.endContainer.previousSibling.nodeType==3?(this.endContainer=this.endContainer.previousSibling,this.endOffset=this.endContainer.data.length):this.endContainer.previousSibling.nodeType==1&&this.endContainer.previousSibling.childNodes&&this.endContainer.previousSibling.childNodes.length>0&&(this.endContainer=this.endContainer.previousSibling,this.endOffset=this.endContainer.childNodes.length));if(this.endContainer.nodeType==1)if(this.endOffset>0&&this.endContainer.childNodes[this.endOffset-1].nodeType==3)this.endContainer=this.endContainer.childNodes[this.endOffset-1],this.endOffset=this.endContainer.data.length;else if(this.endOffset>0&&this.endContainer.childNodes[this.endOffset-1].nodeType==1){var b=!1,c=this.endContainer.childNodes[this.endOffset-1];while(b===!1&&c.childNodes&&c.childNodes.length>0)c=c.childNodes[c.childNodes.length-1],c.nodeType==3&&(b=c);b!==!1&&(this.endContainer=b,this.endOffset=this.endContainer.data.length)}}},GENTICS.Utils.RangeObject.prototype.clearCaches=function(){this.rangeTree=[],this.startParents=[],this.endParents=[],this.commonAncestorContainer=undefined},GENTICS.Utils.RangeObject.prototype.getRangeTree=function(a){return typeof a=="undefined"&&(a=this.getCommonAncestorContainer()),this.rangeTree[a]?this.rangeTree[a]:(this.inselection=!1,this.rangeTree[a]=this.recursiveGetRangeTree(a),this.rangeTree[a])},GENTICS.Utils.RangeObject.prototype.recursiveGetRangeTree=function(a){var b=jQuery(a),c=0,d=this,e=[];return b.contents().each(function(b){var f="none",g=!1,h=!1,i=!1;d.isCollapsed()&&a===d.startContainer&&d.startOffset==b&&(e[c]=new GENTICS.Utils.RangeTree,e[c].type="collapsed",e[c].domobj=undefined,d.inselection=!1,i=!0,c++);if(!d.inselection&&!i)switch(this.nodeType){case 3:this===d.startContainer&&(d.inselection=!0,f=d.startOffset>0?"partial":"full",g=d.startOffset,h=this.length);break;case 1:this===d.startContainer&&d.startOffset==0&&(d.inselection=!0,f="full"),a===d.startContainer&&d.startOffset==b&&(d.inselection=!0,f="full")}if(d.inselection&&!i){f=="none"&&(f="full");switch(this.nodeType){case 3:this===d.endContainer&&(d.inselection=!1,d.endOffset<this.length&&(f="partial"),g===!1&&(g=0),h=d.endOffset);break;case 1:this===d.endContainer&&d.endOffset==0&&(d.inselection=!1)}a===d.endContainer&&d.endOffset<=b&&(d.inselection=!1,f="none")}e[c]=new GENTICS.Utils.RangeTree,e[c].domobj=this,e[c].type=f,f=="partial"&&(e[c].startOffset=g,e[c].endOffset=h),e[c].children=d.recursiveGetRangeTree(this);if(e[c].children.length>0){var j=!1,k=!1,l=!1;for(var m=0;m<e[c].children.length;++m)switch(e[c].children[m].type){case"none":j=!0;break;case"full":l=!0;break;case"partial":k=!0}k||l&&j?e[c].type="partial":l&&!k&&!j&&(e[c].type="full")}c++}),this.isCollapsed()&&a===this.startContainer&&this.startOffset==a.childNodes.length&&(e[c]=new GENTICS.Utils.RangeTree,e[c].type="collapsed",e[c].domobj=undefined),e},GENTICS.Utils.RangeObject.prototype.findMarkup=function(a,b,c){var d=this.getContainerParents(b,c),e=!1;return jQuery.each(d,function(b,c){if(a.apply(c))return e=c,!1}),e},GENTICS.Utils.RangeTree=function(){this.domobj=new Object,this.type,this.children=[]};if(typeof GENTICS=="undefined"||!GENTICS)var GENTICS={};if(typeof GENTICS.Utils=="undefined"||!GENTICS)GENTICS.Utils={};GENTICS.Utils.Position={},GENTICS.Utils.Position.w=jQuery(window),GENTICS.Utils.Position.Scroll={top:0,left:0,isScrolling:!1},GENTICS.Utils.Position.Mouse={x:0,y:0,oldX:0,oldY:0,isMoving:!1,triggeredMouseStop:!0},GENTICS.Utils.Position.mouseStopCallbacks=[],GENTICS.Utils.Position.mouseMoveCallbacks=[],GENTICS.Utils.Position.update=function(){var a=this.w.scrollTop(),b=this.w.scrollLeft();if(this.Scroll.isScrolling)this.Scroll.top==a&&this.Scroll.left==b&&(this.Scroll.isScrolling=!1);else if(this.Scroll.top!=a||this.Scroll.left!=b)this.Scroll.isScrolling=!0;this.Scroll.top=a,this.Scroll.left=b;if(this.Mouse.x==this.Mouse.oldX&&this.Mouse.y==this.Mouse.oldY){this.Mouse.isMoving=!1;if(!this.Mouse.triggeredMouseStop){this.Mouse.triggeredMouseStop=!0;for(var c=0;c<this.mouseStopCallbacks.length;c++)this.mouseStopCallbacks[c].call()}}else{this.Mouse.isMoving=!0,this.Mouse.triggeredMouseStop=!1;for(var c=0;c<this.mouseMoveCallbacks.length;c++)this.mouseMoveCallbacks[c].call()}this.Mouse.oldX=this.Mouse.x,this.Mouse.oldY=this.Mouse.y},GENTICS.Utils.Position.addMouseStopCallback=function(a){return this.mouseStopCallbacks.push(a),this.mouseStopCallbacks.length-1},GENTICS.Utils.Position.addMouseMoveCallback=function(a){return this.mouseMoveCallbacks.push(a),this.mouseMoveCallbacks.length-1},setInterval("GENTICS.Utils.Position.update()",500),jQuery("html").mousemove(function(a){GENTICS.Utils.Position.Mouse.x=a.pageX,GENTICS.Utils.Position.Mouse.y=a.pageY});if(typeof GENTICS=="undefined"||!GENTICS)var GENTICS={};if(typeof GENTICS.Utils=="undefined"||!GENTICS.Utils)GENTICS.Utils={};if(typeof GENTICS.Utils.Dom=="undefined"||!GENTICS.Utils.Dom)GENTICS.Utils.Dom=function(){};GENTICS.Utils.Dom.prototype.mergeableTags=["a","b","code","del","em","i","ins","strong","sub","sup","#text"],GENTICS.Utils.Dom.prototype.nonWordBoundaryTags=["a","b","code","del","em","i","ins","span","strong","sub","sup","#text"],GENTICS.Utils.Dom.prototype.nonEmptyTags=["br"],GENTICS.Utils.Dom.prototype.tags={flow:["a","abbr","address","area","article","aside","audio","b","bdo","blockquote","br","button","canvas","cite","code","command","datalist","del","details","dfn","div","dl","em","embed","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","menu","meter","nav","noscript","object","ol","output","p","pre","progress","q","ruby","samp","script","section","select","small","span","strong","style","sub","sup","svg","table","textarea","time","ul","var","video","wbr","#text"],phrasing:["a","abbr","area","audio","b","bdo","br","button","canvas","cite","code","command","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","samp","script","select","small","span","strong","sub","sup","svg","textarea","time","var","video","wbr","#text"]},GENTICS.Utils.Dom.prototype.children={a:"phrasing",abbr:"phrasing",address:"flow",area:"empty",article:"flow",aside:"flow",audio:"source",b:"phrasing",base:"empty",bdo:"phrasing",blockquote:"flow",body:"flow",br:"empty",button:"phrasing",canvas:"phrasing",caption:"flow",cite:"phrasing",code:"phrasing",col:"empty",colgroup:"col",command:"empty",datalist:["phrasing","option"],dd:"flow",del:"phrasing",div:"flow",details:["summary","flow"],dfn:"flow",div:"flow",dl:["dt","dd"],dt:"phrasing",em:"phrasing",embed:"empty",fieldset:["legend","flow"],figcaption:"flow",figure:["figcaption","flow"],footer:"flow",form:"flow",h1:"phrasing",h2:"phrasing",h3:"phrasing",h4:"phrasing",h5:"phrasing",h6:"phrasing",header:"flow",hgroup:["h1","h2","h3","h4","h5","h6"],hr:"empty",i:"phrasing",iframe:"#text",img:"empty",input:"empty",ins:"phrasing",kbd:"phrasing",keygen:"empty",label:"phrasing",legend:"phrasing",li:"flow",link:"empty",map:"area",mark:"phrasing",menu:["li","flow"],meta:"empty",meter:"phrasing",nav:"flow",noscript:"phrasing",object:"param",ol:"li",optgroup:"option",option:"#text",output:"phrasing",p:"phrasing",param:"empty",pre:"phrasing",progress:"phrasing",q:"phrasing",rp:"phrasing",rt:"phrasing",ruby:["phrasing","rt","rp"],s:"phrasing",samp:"pharsing",script:"#script",section:"flow",select:["option","optgroup"],small:"phrasing",source:"empty",span:"phrasing",strong:"phrasing",style:"phrasing",sub:"phrasing",summary:"phrasing",sup:"phrasing",table:["caption","colgroup","thead","tbody","tfoot","tr"],tbody:"tr",td:"flow",textarea:"#text",tfoot:"tr",th:"phrasing",thead:"tr",time:"phrasing",title:"#text",tr:["th","td"],track:"empty",ul:"li","var":"phrasing",video:"source",wbr:"empty"},GENTICS.Utils.Dom.prototype.blockLevelElements=["p","h1","h2","h3","h4","h5","h6","blockquote","div","pre"],GENTICS.Utils.Dom.prototype.listElements=["li","ol","ul"],GENTICS.Utils.Dom.prototype.split=function(a,b,c){var d=jQuery(a.startContainer),e=a.startOffset;c&&(d=jQuery(a.endContainer),e=a.endOffset),b.length<1&&(b=jQuery(document.body));var f=!a.isCollapsed()&&!c,g,h=d.parents().get();h.unshift(d.get(0)),jQuery.each(h,function(a,c){var d=b.filter(function(){return this==c}).length;if(d)return a>0&&(g=h.slice(0,a)),!1});if(!g)return!0;g=g.reverse();var i,j;for(var k=0;k<g.length;k++){var l=g[k];if(k===g.length-1){var m;if(l.nodeType===3)m=document.createTextNode(l.data.substring(e,l.data.length)),l.data=l.data.substring(0,e);else{var n=jQuery(l).clone(!1).empty(),o=jQuery(l).contents();m=n.append(o.slice(e,o.length)).get(0)}f&&a.endContainer===l&&(a.endContainer=m,a.endOffset-=e,a.clearCaches()),j?j.prepend(m):jQuery(l).after(m)}else{var n=jQuery(l).clone(!1).empty();i?(j.prepend(n),j=n):(i=n,j=n);var p;while(p=g[k+1].nextSibling)j.append(p);if(f&&a.endContainer===l){a.endContainer=n.get(0);var q=g[k+1],r=0;while(q=q.previousSibling)r++;a.endOffset-=r,a.clearCaches()}}}return jQuery(g[0]).after(i),jQuery([g[0],i?i.get(0):m])},GENTICS.Utils.Dom.prototype.allowsNesting=function(a,b){if(!a||!a.nodeName||!b||!b.nodeName)return!1;var c=a.nodeName.toLowerCase(),d=b.nodeName.toLowerCase();return this.children[c]?this.children[c]==d?!0:jQuery.isArray(this.children[c])&&jQuery.inArray(d,this.children[c])>=0?!0:jQuery.isArray(this.tags[this.children[c]])&&jQuery.inArray(d,this.tags[this.children[c]])>=0?!0:!1:!1},GENTICS.Utils.Dom.prototype.addMarkup=function(a,b,c){a.startContainer.nodeType==3&&a.startOffset>0&&a.startOffset<a.startContainer.data.length&&this.split(a,jQuery(a.startContainer).parent(),!1),a.endContainer.nodeType==3&&a.endOffset>0&&a.endOffset<a.endContainer.data.length&&this.split(a,jQuery(a.endContainer).parent(),!0);var d=a.getRangeTree();this.recursiveAddMarkup(d,b,a,c),this.doCleanup({merge:!0,removeempty:!0},a)},GENTICS.Utils.Dom.prototype.recursiveAddMarkup=function(a,b,c,d){for(var e=0;e<a.length;++e)if(a[e].type=="full"&&this.allowsNesting(b.get(0),a[e].domobj)){if((d||a[e].domobj.nodeName!=b.get(0).nodeName)&&(a[e].domobj.nodeType!=3||jQuery.trim(a[e].domobj.data).length!=0)){jQuery(a[e].domobj).wrap(b);if(!d&&a[e].domobj.nodeType!=3){var f=new GENTICS.Utils.RangeObject;f.startContainer=f.endContainer=a[e].domobj.parentNode,f.startOffset=0,f.endOffset=f.endContainer.childNodes.length,this.removeMarkup(f,b,jQuery(a[e].domobj.parentNode))}}}else(d||a[e].domobj.nodeName!=b.get(0).nodeName)&&a[e].children&&a[e].children.length>0&&this.recursiveAddMarkup(a[e].children,b)},GENTICS.Utils.Dom.prototype.findHighestElement=function(a,b,c){var d=a;b=b.toLowerCase();var e=c?function(){return c.filter(function(){return d==this}).length}:function(){return!1},f=undefined;while(!e()&&d)d.nodeName.toLowerCase()==b&&(f=d),d=d.parentNode;return f},GENTICS.Utils.Dom.prototype.removeMarkup=function(a,b,c){var d=b.get(0).nodeName,e=this.findHighestElement(a.startContainer,d,c),f=this.findHighestElement(a.endContainer,d,c),g=!1;e&&(this.split(a,jQuery(e).parent(),!1),g=!0),f&&(this.split(a,jQuery(f).parent(),!0),g=!0),g&&a.correctRange();var h=this.findHighestElement(a.getCommonAncestorContainer(),d,c),i=h?h.parentNode:undefined,j=a.getRangeTree(i);this.recursiveRemoveMarkup(j,b),this.doCleanup({merge:!0,removeempty:!0},a,i)},GENTICS.Utils.Dom.prototype.recursiveRemoveMarkup=function(a,b){for(var c=0;c<a.length;++c){if(a[c].type=="full"&&a[c].domobj.nodeName==b.get(0).nodeName){var d=jQuery(a[c].domobj).contents();d.length>0?d.first().unwrap():jQuery(a[c].domobj).remove()}a[c].children&&this.recursiveRemoveMarkup(a[c].children,b)}},GENTICS.Utils.Dom.prototype.doCleanup=function(a,b,c){var d=this;typeof a=="undefined"&&(a={merge:!0,removeempty:!0}),typeof c=="undefined"&&b&&(c=b.getCommonAncestorContainer());var e=!1,f=!1,g=jQuery(c);return g.contents().each(function(c){switch(this.nodeType){case 1:if(e&&e.nodeName==this.nodeName)b.startContainer===g&&b.startOffset>c&&(b.startOffset-=1,f=!0),b.endContainer===g&&b.endOffset>c&&(b.endOffset-=1,f=!0),jQuery(e).append(jQuery(this).contents()),f|=d.doCleanup(a,b,e),jQuery(this).remove();else{f|=d.doCleanup(a,b,this);var h=!1;a.removeempty&&(GENTICS.Utils.Dom.isBlockLevelElement(this)&&this.childNodes.length==0&&(jQuery(this).remove(),h=!0),jQuery.inArray(this.nodeName.toLowerCase(),d.mergeableTags)>=0&&jQuery(this).text().length==0&&this.childNodes.length==0&&(jQuery(this).remove(),h=!0)),h||(jQuery.inArray(this.nodeName.toLowerCase(),d.mergeableTags)>=0?e=this:e=!1)}break;case 3:e&&e.nodeType==3&&a.merge?(b.startContainer===this&&(b.startContainer=e,b.startOffset+=e.length,f=!0),b.endContainer===this&&(b.endContainer=e,b.endOffset+=e.length,f=!0),b.startContainer===g&&b.startOffset>c&&(b.startOffset-=1,f=!0),b.endContainer===g&&b.endOffset>c&&(b.endOffset-=1,f=!0),e.data+=this.data,jQuery(this).remove()):e=this}}),a.removeempty&&GENTICS.Utils.Dom.isBlockLevelElement(c)&&(!c.childNodes||c.childNodes.length==0)&&(b.startContainer==c&&(b.startContainer=c.parentNode,b.startOffset=GENTICS.Utils.Dom.getIndexInParent(c)),b.endContainer==c&&(b.endContainer=c.parentNode,b.endOffset=GENTICS.Utils.Dom.getIndexInParent(c)),g.remove(),f=!0),f&&b.clearCaches(),f},GENTICS.Utils.Dom.prototype.getIndexInParent=function(a){if(!a)return!1;var b=0,c=a.previousSibling;while(c)b++,c=c.previousSibling;return b},GENTICS.Utils.Dom.prototype.isBlockLevelElement=function(a){return a?a.nodeType==1&&jQuery.inArray(a.nodeName.toLowerCase(),this.blockLevelElements)>=0?!0:!1:!1},GENTICS.Utils.Dom.prototype.isLineBreakElement=function(a){return a?a.nodeType==1&&a.nodeName.toLowerCase()=="br":!1},GENTICS.Utils.Dom.prototype.isListElement=function(a){return a?a.nodeType==1&&jQuery.inArray(a.nodeName.toLowerCase(),this.listElements)>=0:!1},GENTICS.Utils.Dom.prototype.isSplitObject=function(a){if(a.nodeType===1)switch(a.nodeName.toLowerCase()){case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"li":return!0}return!1},GENTICS.Utils.Dom.prototype.searchAdjacentTextNode=function(a,b,c,d){if(!a||a.nodeType!=1||b<0||b>a.childNodes.length)return!1;typeof d=="undefined"&&(d={blocklevel:!0,list:!0,linebreak:!0}),d.blocklevel=="undefined"&&(stopal.blocklevel=!0),d.list=="undefined"&&(stopal.list=!0),d.linebreak=="undefined"&&(stopal.linebreak=!0),typeof c=="undefined"&&(c=!0);var e=undefined,f=a;c&&b>0&&(e=a.childNodes[b-1]),!c&&b<a.childNodes.length&&(e=a.childNodes[b]);while(typeof f!="undefined")if(!e){if(d.blocklevel&&this.isBlockLevelElement(f))return!1;if(d.list&&this.isListElement(f))return!1;e=c?f.previousSibling:f.nextSibling,f=f.parentNode}else{if(e.nodeType==3&&jQuery.trim(e.data).length>0)return e;if(d.blocklevel&&this.isBlockLevelElement(e))return!1;if(d.linebreak&&this.isLineBreakElement(e))return!1;if(d.list&&this.isListElement(e))return!1;e.nodeType==3?e=c?e.previousSibling:e.nextSibling:(f=e,e=c?e.lastChild:e.firstChild)}},GENTICS.Utils.Dom.prototype.insertIntoDOM=function(a,b,c,d){var e=b.getContainerParents(c,d),f=this,g;c||(c=jQuery(document.body)),e.length==0?g=c.get(0):jQuery.each(e,function(b,c){if(f.allowsNesting(c,a.get(0)))return g=c,!1}),typeof g=="undefined"&&c.length>0&&(g=c.get(0));if(typeof g!="undefined"){var h=this.split(b,jQuery(g),d);if(h===!0){var i=b.startContainer,j=b.startOffset;d&&(i=b.endContainer,j=b.endOffset);if(j==0){var k=jQuery(i).contents();return k.length>0?k.eq(0).before(a):jQuery(i).append(a),!0}return jQuery(i).contents().eq(j-1).after(a),!0}return h?(h.eq(0).after(a),!0):!1}return!1},GENTICS.Utils.Dom.prototype.removeFromDOM=function(a,b,c){if(c){var d=this.getIndexInParent(a),e=jQuery(a).contents().length,f=a.parentNode;b.startContainer==f&&b.startOffset>d?b.startOffset+=e-1:b.startContainer==a&&(b.startContainer=f,b.startOffset=d+b.startOffset),b.endContainer==f&&b.endOffset>d?b.endOffset+=e-1:b.endContainer==a&&(b.endContainer=f,b.endOffset=d+b.endOffset),jQuery(a).contents().unwrap(),this.doCleanup({merge:!0},b,f)}},GENTICS.Utils.Dom.prototype.extendToWord=function(a,b){var c=this.searchWordBoundary(a.startContainer,a.startOffset,!0),d=this.searchWordBoundary(a.endContainer,a.endOffset,!1);if(!b){if(a.startContainer==c.container&&a.startOffset==c.offset)return;if(a.endContainer==d.container&&a.endOffset==d.offset)return}a.startContainer=c.container,a.startOffset=c.offset,a.endContainer=d.container,a.endOffset=d.offset,a.correctRange(),a.clearCaches()},GENTICS.Utils.Dom.prototype.isWordBoundaryElement=function(a){return!a||!a.nodeName?!1:jQuery.inArray(a.nodeName.toLowerCase(),this.nonWordBoundaryTags)==-1},GENTICS.Utils.Dom.prototype.searchWordBoundary=function(a,b,c){typeof c=="undefined"&&(c=!0);var d=!1;while(!d)if(a.nodeType==3)if(!c){var e=a.data.substring(b).search(/\W/);e!=-1?(b=b+e,d=!0):(b=this.getIndexInParent(a)+1,a=a.parentNode)}else{var e=a.data.substring(0,b).search(/\W/),f=e;while(f!=-1)e=f,f=a.data.substring(e+1,b).search(/\W/),f!=-1&&(f=f+e+1);e!=-1?(b=e+1,d=!0):(b=this.getIndexInParent(a),a=a.parentNode)}else a.nodeType==1&&(c?b>0?this.isWordBoundaryElement(a.childNodes[b-1])?d=!0:(a=a.childNodes[b-1],b=a.nodeType==3?a.data.length:a.childNodes.length):this.isWordBoundaryElement(a)?d=!0:(b=this.getIndexInParent(a),a=a.parentNode):b<a.childNodes.length?this.isWordBoundaryElement(a.childNodes[b])?d=!0:(a=a.childNodes[b],b=0):this.isWordBoundaryElement(a)?d=!0:(b=this.getIndexInParent(a)+1,a=a.parentNode));if(a.nodeType!=3){var g=this.searchAdjacentTextNode(a,b,!c);g&&(a=g,b=c?0:a.data.length)}return{container:a,offset:b}},GENTICS.Utils.Dom.prototype.isEmpty=function(a){if(!a)return!0;if(jQuery.inArray(a.nodeName.toLowerCase(),this.nonEmptyTags)!=-1)return!1;if(a.nodeType==3)return a.data.search(/\S/)==-1;for(var b=0;b<a.childNodes.length;++b)if(!this.isEmpty(a.childNodes[b]))return!1;return!0},GENTICS.Utils.Dom.prototype.setCursorAfter=function(a){var b=new GENTICS.Utils.RangeObject;b.startContainer=b.endContainer=a.parentNode,b.startOffset=b.endOffset=this.getIndexInParent(a),b.select()},GENTICS.Utils.Dom.prototype.setCursorInto=function(a){var b=new GENTICS.Utils.RangeObject;b.startContainer=b.endContainer=a,b.startOffset=b.endOffset=0,b.select()},GENTICS.Utils.Dom=new GENTICS.Utils.Dom,Ext.data.AlohaProxy=function(){var a={};a[Ext.data.Api.actions.read]=!0,Ext.data.AlohaProxy.superclass.constructor.call(this,{api:a}),this.params={queryString:null,objectTypeFilter:null,filter:null,inFolderId:null,orderBy:null,maxItems:null,skipCount:null,renditionFilter:null,repositoryId:null}},Ext.extend(Ext.data.AlohaProxy,Ext.data.DataProxy,{doRequest:function(a,b,c,d,e,f,g){var h=this.params;jQuery.extend(h,c);try{GENTICS.Aloha.RepositoryManager.query(h,function(a){var b=d.readRecords(a);e.call(f,b,g,!0)})}catch(i){return this.fireEvent("loadexception",this,null,g,i),this.fireEvent("exception",this,"response",a,g,null,i),!1}},setObjectTypeFilter:function(a){this.params.objectTypeFilter=a},getObjectTypeFilter:function(){return this.params.objectTypeFilter},setParams:function(a){jQuery.extend(this.params,a)}}),Ext.data.AlohaObjectReader=function(a,b){a={},Ext.applyIf(a,{idProperty:"id",root:"items",totalProperty:"results",fields:["id","url","name","type","weight","repositoryId"]}),Ext.data.JsonReader.superclass.constructor.call(this,a,a.fields)},Ext.extend(Ext.data.AlohaObjectReader,Ext.data.JsonReader,{}),Ext.tree.AlohaTreeLoader=function(a){Ext.apply(this,a),Ext.tree.AlohaTreeLoader.superclass.constructor.call(this)},Ext.extend(Ext.tree.AlohaTreeLoader,Ext.tree.TreeLoader,{paramOrder:["node","id"],nodeParameter:"id",directFn:function(a,b,c){var d={inFolderId:a.id,objectTypeFilter:this.objectTypeFilter,repositoryId:a.repositoryId};GENTICS.Aloha.RepositoryManager.getChildren(d,function(b){var d={};d={status:!0,scope:this,argument:{callback:c,node:a}},typeof c=="function"&&c(b,d)})},createNode:function(a){return a.name&&(a.text=a.name),a.hasMoreItems&&(a.leaf=!a.hasMoreItems),a.objectType&&(a.cls=a.objectType),Ext.tree.TreeLoader.prototype.createNode.call(this,a)},objectTypeFilter:null,setObjectTypeFilter:function(a){this.objectTypeFilter=a},getObjectTypeFilter:function(){return this.objectTypeFilter}});if(typeof GENTICS=="undefined"||!GENTICS)var GENTICS={};GENTICS.Aloha=function(){},GENTICS.Aloha.setAutobase=function(){var a=document.getElementsByTagName("script"),b=a[a.length-1].src.split("?")[0];b=b.split("/");var c=1;"core"===b[b.length-2]&&(c=2),GENTICS.Aloha.prototype.autobase=b.slice(0,c*-1).join("/")+"/"},GENTICS.Aloha.setAutobase(),GENTICS.Aloha.prototype.version="0.9.3",GENTICS.Aloha.prototype.editables=[],GENTICS.Aloha.prototype.activeEditable=null,GENTICS.Aloha.prototype.ready=!1,GENTICS.Aloha.prototype.dictionaries={},GENTICS.Aloha.prototype.settings={},GENTICS.Aloha.prototype.OSName="Unknown",GENTICS.Aloha.prototype.readyCallbacks=[],GENTICS.Aloha.prototype.init=function(){if(jQuery.browser.webkit&&parseFloat(jQuery.browser.version)<532.5||jQuery.browser.mozilla&&parseFloat(jQuery.browser.version)<1.9||jQuery.browser.msie&&jQuery.browser.version<7||jQuery.browser.opera){alert("Sorry, your browser is not supported at the moment.");return}var a=this;jQuery("html").mousedown(function(){a.activeEditable&&!a.isMessageVisible()&&(a.activeEditable.blur(),a.FloatingMenu.setScope("GENTICS.Aloha.empty"),a.activeEditable=null)});if(typeof this.settings.base=="undefined"||!this.settings.base)this.settings.base=GENTICS.Aloha.autobase,typeof GENTICS_Aloha_base!="undefined"&&(this.settings.base=GENTICS_Aloha_base);this.Log.init(),this.settings.errorhandling!=!1&&(window.onerror=function(a,b,c){return GENTICS.Aloha.Log.error(GENTICS.Aloha,"Error message: "+a+"\nURL: "+b+"\nLine Number: "+c),!0}),navigator.appVersion.indexOf("Win")!=-1&&(this.OSName="Win"),navigator.appVersion.indexOf("Mac")!=-1&&(this.OSName="Mac"),navigator.appVersion.indexOf("X11")!=-1&&(this.OSName="Unix"),navigator.appVersion.indexOf("Linux")!=-1&&(this.OSName="Linux"),this.initI18n(),this.PluginRegistry.init(),this.RepositoryManager.init(),this.Ribbon.init(),this.FloatingMenu.init(),Ext.MessageBox.buttonText.yes=GENTICS.Aloha.i18n(this,"yes"),Ext.MessageBox.buttonText.no=GENTICS.Aloha.i18n(this,"no"),Ext.MessageBox.buttonText.cancel=GENTICS.Aloha.i18n(this,"cancel"),Ext.ux.AlohaAttributeField.prototype.listEmptyText=GENTICS.Aloha.i18n(GENTICS.Aloha,"repository.no_item_found"),Ext.ux.AlohaAttributeField.prototype.loadingText=GENTICS.Aloha.i18n(GENTICS.Aloha,"repository.loading")+"...",this.ready=!0;for(var b=0;b<this.editables.length;b++)this.editables[b].ready||this.editables[b].init();GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("ready",GENTICS.Aloha,null))},GENTICS.Aloha.prototype.activateEditable=function(a){for(var b=0;b<this.editables.length;b++)if(this.editables[b]!=a&&this.editables[b].isActive){var c=this.editables[b];this.editables[b].blur()}this.activeEditable=a},GENTICS.Aloha.prototype.getActiveEditable=function(){return this.activeEditable},GENTICS.Aloha.prototype.deactivateEditable=function(){if(typeof this.activeEditable=="undefined"||this.activeEditable==null)return;this.activeEditable.blur(),this.FloatingMenu.setScope("GENTICS.Aloha.empty"),this.activeEditable=null},GENTICS.Aloha.prototype.getEditableById=function(a){for(var b=0;b<GENTICS.Aloha.editables.length;b++)if(GENTICS.Aloha.editables[b].getId()==a)return GENTICS.Aloha.editables[b];return null},GENTICS.Aloha.prototype.log=function(a,b,c){GENTICS.Aloha.Log.log(a,b,c)},GENTICS.Aloha.prototype.identStr=function(a){a instanceof jQuery&&(a=a[0]);if(a instanceof HTMLElement){var b=a.tagName.toLowerCase();return a.id?b+"#"+a.id:a.className?b+"."+a.className:b}return GENTICS.Aloha.Log.warn(this,"{"+a.toString()+"} provided is not an HTML element"),a.toString()},GENTICS.Aloha.prototype.trim=function(a){a=a.replace(/^\s+/,"");for(var b=a.length-1;b>=0;b--)if(/\S/.test(a.charAt(b))){a=a.substring(0,b+1);break}return a},GENTICS.Aloha.prototype.initI18n=function(){if(typeof this.settings.i18n=="undefined"||!this.settings.i18n)this.settings.i18n={};if(typeof this.settings.i18n.available=="undefined"||!this.settings.i18n.available||!this.settings.i18n.available instanceof Array)this.settings.i18n.available=["en","de","fr","eo","fi","ru","it","pl"];if((typeof this.settings.i18n.current=="undefined"||!this.settings.i18n.current)&&typeof this.settings.i18n.acceptLanguage=="string"){var a=[],b=this.settings.i18n.acceptLanguage.split(",");for(i=0;i<b.length;i++){var c=b[i].split(";");typeof c[1]=="undefined"||!c[1]?c[1]=1:c[1]=parseFloat(c[1].substring(2,c[1].length)),a.push(c)}a.sort(function(a,b){return b[1]-a[1]});for(i=0;i<a.length;i++)if(jQuery.inArray(a[i][0],this.settings.i18n.available)>=0){this.settings.i18n.current=a[i][0];break}}if(typeof this.settings.i18n.current=="undefined"||!this.settings.i18n.current)this.settings.i18n.current=navigator.language?navigator.language:navigator.userLanguage;var d=this
.getLanguage(this.settings.i18n.current,this.settings.i18n.available);if(!d)GENTICS.Aloha.Log.error(this,"Could not determine actual language.");else{var e=this.settings.base+"i18n/"+d+".dict";this.loadI18nFile(e,this)}},GENTICS.Aloha.prototype.getLanguage=function(a,b){if(!b instanceof Array)return GENTICS.Aloha.Log.error(this,"Available languages must be an Array"),null;if(typeof a=="undefined"||!a)return b[0];for(var c=0;c<b.length;++c)if(a==b[c])return a;return b[0]},GENTICS.Aloha.prototype.loadI18nFile=function(a,b){jQuery.ajax({async:!1,datatype:"text",url:a,error:function(c,d,e){GENTICS.Aloha.Log.error(b,"Error while getting dictionary file "+a+": server returned "+d)},success:function(c,d,e){GENTICS.Aloha.Log.isInfoEnabled()&&GENTICS.Aloha.Log.info(b,"Loaded dictionary file "+a),GENTICS.Aloha.parseI18nFile(c,b)}})},GENTICS.Aloha.prototype.parseI18nFile=function(a,b){a=a.replace(/\r/g,"");var c=a.split("\n"),d=new Object;for(var e=0;e<c.length;++e){var f=c[e],g=f.indexOf("=");if(g>0){var h=GENTICS.Aloha.trim(f.substring(0,g)),i=GENTICS.Aloha.trim(f.substring(g+1,f.length));i=i.replace(/\\n/g,"\n"),i=i.replace(/\\\\/g,"\\"),d[h]?GENTICS.Aloha.Log.warn(b,"Found duplicate key "+h+" in dictionary file, ignoring"):d[h]=i}}this.dictionaries[b.toString()]=d},GENTICS.Aloha.prototype.i18n=function(a,b,c){var d=null;this.dictionaries[a.toString()]&&this.dictionaries[a.toString()][b]&&(d=this.dictionaries[a.toString()][b]),!d&&a!=GENTICS.Aloha&&this.dictionaries[GENTICS.Aloha.toString()]&&this.dictionaries[GENTICS.Aloha.toString()][b]&&(d=this.dictionaries[GENTICS.Aloha.toString()][b]);if(!d)return"??? "+b+" ???";if(typeof c!="undefined"&&c!=null)for(var e=0;e<c.length;++e)if(typeof c[e]!="undefined"&&c[e]!=null){var f=new RegExp("\\{"+e+"\\}","g"),g=c[e].toString().replace(/\{/g,"\\{");g=g.replace(/\}/g,"\\}"),d=d.replace(f,g)}return d=d.replace(/\{\d\}/g,""),d=d.replace(/\\\{/g,"{"),d=d.replace(/\\\}/g,"}"),d},GENTICS.Aloha.prototype.registerEditable=function(a){this.editables.push(a)},GENTICS.Aloha.prototype.unregisterEditable=function(a){var b=this.editables.indexOf(a);b!=-1&&this.editables.splice(b,1)},GENTICS.Aloha.prototype.showMessage=function(a){GENTICS.Aloha.FloatingMenu.obj&&GENTICS.Aloha.FloatingMenu.obj.css("z-index",8900);switch(a.type){case GENTICS.Aloha.Message.Type.ALERT:Ext.MessageBox.alert(a.title,a.text,a.callback);break;case GENTICS.Aloha.Message.Type.CONFIRM:Ext.MessageBox.confirm(a.title,a.text,a.callback);break;case GENTICS.Aloha.Message.Type.WAIT:Ext.MessageBox.wait(a.text,a.title);break;default:this.log("warn",this,"Unknown message type for message {"+a.toString()+"}")}},GENTICS.Aloha.prototype.hideMessage=function(){Ext.MessageBox.hide()},GENTICS.Aloha.prototype.isMessageVisible=function(){return Ext.MessageBox.isVisible()},GENTICS.Aloha.prototype.toString=function(){return"GENTICS.Aloha"},GENTICS.Aloha.prototype.isModified=function(){for(var a in this.editables)if(this.editables[a].isModified&&this.editables[a].isModified())return!0;return!1},GENTICS.Aloha=new GENTICS.Aloha,Array.indexOf||(Array.prototype.indexOf=function(a){for(var b=0;b<this.length;b++)if(this[b]===a)return b;return-1}),jQuery(document).ready(function(){Ext.isReady?GENTICS.Aloha.init():Ext.onReady(function(){GENTICS.Aloha.init()})}),typeof GENTICS.Aloha.ui=="undefined"&&(GENTICS.Aloha.ui=function(){}),GENTICS.Aloha.ui.Button=function(a){this.init(a)},GENTICS.Aloha.ui.Button.prototype.init=function(a){this.label,this.iconClass,this.icon,this.onclick,this.menu,this.toggle,this.pressed=!1,this.visible=!0,this.enabled=!0,this.tooltip,this.extButton,this.listenerQueue=[],GENTICS.Utils.applyProperties(this,a),this.id=this.generateId()},GENTICS.Aloha.ui.Button.idCounter=0,GENTICS.Aloha.ui.Button.prototype.generateId=function(){return GENTICS.Aloha.ui.Button.idCounter=GENTICS.Aloha.ui.Button.idCounter+1,"GENTICS_Aloha_ui_Button_"+GENTICS.Aloha.ui.Button.idCounter},GENTICS.Aloha.ui.Button.prototype.setPressed=function(a){this.toggle&&(this.pressed=a,typeof this.extButton=="object"&&this.extButton.pressed!=a&&this.extButton.toggle(this.pressed))},GENTICS.Aloha.ui.Button.prototype.isPressed=function(){return this.toggle?this.pressed:!1},GENTICS.Aloha.ui.Button.prototype.show=function(){this.visible=!0},GENTICS.Aloha.ui.Button.prototype.hide=function(){this.visible=!1},GENTICS.Aloha.ui.Button.prototype.isVisible=function(){return this.visible},GENTICS.Aloha.ui.Button.prototype.enable=function(){this.enabled=!0,typeof this.extButton=="object"&&this.extButton.enable()},GENTICS.Aloha.ui.Button.prototype.disable=function(){this.enabled=!1,typeof this.extButton=="object"&&this.extButton.disable()},GENTICS.Aloha.ui.Button.prototype.isEnabled=function(){return this.enabled},GENTICS.Aloha.ui.Button.prototype.getExtMenu=function(){if(typeof this.menu=="object"){var a=new Ext.menu.Menu;for(var b=0;b<this.menu.length;++b){var c=this.menu[b];a.addItem(new Ext.menu.Item(c.getExtMenuConfigProperties()))}}return a},GENTICS.Aloha.ui.Button.prototype.getExtMenuConfigProperties=function(){var a=this,b=this.getExtMenu();return{text:this.label,icon:this.icon,iconCls:this.iconClass,handler:function(){typeof a.onclick=="function"&&a.onclick()},menu:b}},GENTICS.Aloha.ui.Button.prototype.getExtConfigProperties=function(){var a=this,b=this.getExtMenu(),c={text:this.label,enableToggle:this.toggle,pressed:this.pressed,icon:this.icon,iconCls:this.iconClass,scale:this.scale||this.size,width:this.width||undefined,rowspan:this.rowspan||(this.size=="large"||this.size=="medium"?2:1),menu:b,handler:function(b,c){typeof a.onclick=="function"&&a.onclick.apply(a,[b,c]),a.pressed=!a.pressed},xtype:b&&typeof this.onclick=="function"?"splitbutton":"button",tooltipType:"qtip",tooltip:this.tooltip,id:this.id,arrowAlign:this.arrowAlign||(this.size=="large"||this.size=="small"?"right":"bottom")};return c},Ext.ux.GENTICSMultiSplitButton=Ext.extend(Ext.Component,{autoEl:{cls:"GENTICS_multisplit-wrapper"},ulObj:null,panelButton:null,wrapper:null,panelOpened:!1,onRender:function(){Ext.ux.GENTICSMultiSplitButton.superclass.onRender.apply(this,arguments),this.wrapper=jQuery(this.el.dom);var a,b='<ul class="GENTICS_multisplit">';for(var c=0;c<this.items.length;c++){a=this.items[c],a.visible==undefined&&(a.visible=!0);if(a.wide)continue;b+='<li><button xmlns:ext="http://www.extjs.com/" class="'+a.iconClass+'" ext:qtip="'+a.tooltip+'" gtxmultisplititem="'+c+'">&#160;</button></li>'}for(var c=0;c<this.items.length;c++){a=this.items[c];if(!a.wide)continue;b+='<li><button xmlns:ext="http://www.extjs.com/" class="GENTICS_multisplit-wide '+a.iconClass+'" ext:qtip="'+a.tooltip+'" gtxmultisplititem="'+c+'">'+a.text+"</button></li>"}b+="</ul>";var d=this;GENTICS.Aloha.FloatingMenu.extTabPanel.on("move",function(){d.closePanel()}),GENTICS.Aloha.FloatingMenu.extTabPanel.on("tabchange",function(){d.closePanel()}),this.ulObj=jQuery(this.el.createChild(b).dom),this.ulObj.click(function(a){d.onClick(a)}),this.panelButton=jQuery(this.el.createChild('<button class="GENTICS_multisplit_toggle GENTICS_multisplit_toggle_open">&#160;</button>').dom),this.panelButton.click(function(){d.togglePanel()})},onClick:function(a){if(!a.target.attributes.gtxmultisplititem)return;var b=jQuery(a.target);this.closePanel(),b.hasClass("GENTICS_multisplit-wide")||this.setActiveDOMElement(b),this.items[a.target.attributes.gtxmultisplititem.value].click()},setActiveItem:function(a){this.closePanel();if(this.activeItem==a)return;for(var b=0;b<this.items.length;b++)if(this.items[b].name==a){var c=jQuery(this.ulObj).find("[gtxmultisplititem="+b+"]");this.setActiveDOMElement(c),this.activeItem=a;return}this.activeItem=null,this.setActiveDOMElement(null)},setActiveDOMElement:function(a){var b=this;while(typeof b!="undefined"){if(b.hidden){this.activeDOMElement=a;return}b=b.ownerCt}jQuery(this.ulObj).find(".GENTICS_multisplit-activeitem").removeClass("GENTICS_multisplit-activeitem"),a&&a.addClass("GENTICS_multisplit-activeitem");if(a==null||a.parent().is(":hidden"))return;if(a&&this.ulObj){this.ulObj.css("margin-top",0);var c=a.position().top;this.ulObj.css("margin-top",-c+6),this.ulObj.css("height",46+c-6)}this.activeDOMElement=undefined},togglePanel:function(){this.panelOpened?this.closePanel():this.openPanel()},openPanel:function(){if(this.panelOpened)return;this.ulObj.appendTo(jQuery(document.body)),this.ulObj.addClass("GENTICS_multisplit-expanded"),this.ulObj.mousedown(function(a){a.stopPropagation()});var a=this.wrapper.offset();this.ulObj.css("top",a.top-1),this.ulObj.css("left",a.left-1),this.ulObj.animate({height:this.ulObj.attr("scrollHeight")}),this.panelButton.removeClass("GENTICS_multisplit_toggle_open"),this.panelButton.addClass("GENTICS_multisplit_toggle_close"),this.panelOpened=!0},closePanel:function(){if(!this.panelOpened)return;this.ulObj.removeClass("GENTICS_multisplit-expanded"),this.ulObj.appendTo(this.wrapper),this.panelButton.addClass("GENTICS_multisplit_toggle_open"),this.panelButton.removeClass("GENTICS_multisplit_toggle_close"),this.panelOpened=!1},hideItem:function(a){for(var b=0;b<this.items.length;b++)if(this.items[b].name==a){this.items[b].visible=!1,jQuery("#"+this.id+" [gtxmultisplititem="+b+"]").parent().hide();return}},showItem:function(a){for(var b=0;b<this.items.length;b++)if(this.items[b].name==a){this.items[b].visible=!0,jQuery("#"+this.id+" [gtxmultisplititem="+b+"]").parent().show();return}}}),Ext.reg("genticsmultisplitbutton",Ext.ux.GENTICSMultiSplitButton),GENTICS.Aloha.ui.MultiSplitButton=function(a){this.items,GENTICS.Utils.applyProperties(this,a),this.id=this.generateId()},GENTICS.Aloha.ui.MultiSplitButton.idCounter=0,GENTICS.Aloha.ui.MultiSplitButton.prototype.generateId=function(){return GENTICS.Aloha.ui.MultiSplitButton.idCounter=GENTICS.Aloha.ui.MultiSplitButton.idCounter+1,"GENTICS_Aloha_ui_MultiSplitButton_"+GENTICS.Aloha.ui.MultiSplitButton.idCounter},GENTICS.Aloha.ui.MultiSplitButton.prototype.getExtConfigProperties=function(){return{xtype:"genticsmultisplitbutton",items:this.items,id:this.id}},GENTICS.Aloha.ui.MultiSplitButton.prototype.setActiveItem=function(a){this.extButton.setActiveItem(a)},GENTICS.Aloha.ui.MultiSplitButton.prototype.isVisible=function(){for(var a=0;a<this.items.length;a++)if(this.items[a].visible)return!0;return!1},GENTICS.Aloha.ui.MultiSplitButton.prototype.showItem=function(a){this.extButton.showItem(a)},GENTICS.Aloha.ui.MultiSplitButton.prototype.hideItem=function(a){this.extButton.hideItem(a)},Ext.ux.AlohaAttributeField=Ext.extend(Ext.form.ComboBox,{typeAhead:!1,mode:"remote",triggerAction:"all",width:300,hideTrigger:!0,minChars:3,valueField:"id",displayField:"url",enableKeyEvents:!0,store:new Ext.data.Store({proxy:new Ext.data.AlohaProxy,reader:new Ext.data.AlohaObjectReader}),tpl:new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">',"<span><b>{name}</b><br />{url}</span>","</div></tpl>"),onSelect:function(a){this.setItem(a.data),typeof this.alohaButton.onSelect=="function"&&this.alohaButton.onSelect.call(this.alohaButton,a.data),this.collapse()},listeners:{beforequery:function(a){if(this.noQuery){a.cancel=!0;return}this.store!=null&&this.store.proxy!=null&&this.store.proxy.setParams({objectTypeFilter:this.getObjectTypeFilter(),queryString:a.query})},afterrender:function(a,b){var c=this;jQuery(this.wrap.dom.children[0]).blur(function(a){c.triggerBlur()})},keydown:function(a,b){if(b.keyCode==13||b.keyCode==27)this.isExpanded()?this.ALOHAwasExpanded=!0:this.ALOHAwasExpanded=!1},keyup:function(a,b){(b.keyCode==13||b.keyCode==27)&&!this.ALOHAwasExpanded&&setTimeout(function(){GENTICS.Aloha.activeEditable.obj[0].focus(),GENTICS.Aloha.Selection.getRangeObject().select()},0);var c=this.wrap.dom.children[0].value;this.setAttribute(this.targetAttribute,c)},focus:function(a,b){var c=jQuery(this.getTargetObject()),d=c.css("background-color");c&&c.context.style&&c.context.style["background-color"]&&c.attr("data-original-background-color",c.context.style["background-color"]),c.css("background-color","Highlight")},blur:function(a,b){var c=jQuery(this.getTargetObject());c&&((color=c.attr("data-original-background-color"))?jQuery(c).css("background-color",color):jQuery(c).removeCss("background-color"),jQuery(c).removeAttr("data-original-background-color"))},expand:function(a){this.noQuery&&this.collapse()}},setItem:function(a,b){this.resourceItem=a;if(a){b=b?b:this.displayField;var c=a[b];this.setValue(c),this.setAttribute(this.targetAttribute,c),GENTICS.Aloha.RepositoryManager.markObject(this.targetObject,a)}},getItem:function(){return this.resourceItem},setAttribute:function(a,b,c,d){if(this.targetObject){var e=!0;if(typeof d!="undefined"){var f=new RegExp(c);d.match(f)||(e=!1)}e?jQuery(this.targetObject).attr(a,b):jQuery(this.targetObject).removeAttr(a)}},setTargetObject:function(a,b){this.targetObject=a,this.targetAttribute=b,this.targetObject&&this.targetAttribute?this.setValue(jQuery(this.targetObject).attr(this.targetAttribute)):this.setValue("")},getTargetObject:function(){return this.targetObject},setObjectTypeFilter:function(a){this.objectTypeFilter=a},getObjectTypeFilter:function(){return this.objectTypeFilter},noQuery:!0}),Ext.reg("alohaattributefield",Ext.ux.AlohaAttributeField),GENTICS.Aloha.ui.AttributeField=function(a){this.onSelect=null,this.listenerQueue=[],this.objectTypeFilter=null,this.tpl=null,this.displayField=null,this.init(a)},GENTICS.Aloha.ui.AttributeField.prototype=new GENTICS.Aloha.ui.Button,GENTICS.Aloha.ui.AttributeField.prototype.getExtConfigProperties=function(){return{alohaButton:this,xtype:"alohaattributefield",rowspan:this.rowspan||undefined,width:this.width||undefined,id:this.id}},GENTICS.Aloha.ui.AttributeField.prototype.setTargetObject=function(a,b){this.extButton&&this.extButton.setTargetObject(a,b)},GENTICS.Aloha.ui.AttributeField.prototype.getTargetObject=function(){return this.extButton?this.extButton.getTargetObject():null},GENTICS.Aloha.ui.AttributeField.prototype.focus=function(){this.extButton&&(this.extButton.focus(),this.extButton.getValue().length>0&&this.extButton.selectText(0,this.extButton.getValue().length))},GENTICS.Aloha.ui.AttributeField.prototype.addListener=function(a,b,c){this.extButton?this.extButton.addListener(a,b,null):(listener={eventName:a,handler:b,scope:c,options:null},this.listenerQueue.push(listener))},GENTICS.Aloha.ui.AttributeField.prototype.setAttribute=function(a,b,c,d){this.extButton&&this.extButton.setAttribute(a,b,c,d)},GENTICS.Aloha.ui.AttributeField.prototype.setObjectTypeFilter=function(a){this.extButton?(this.noQuery=!1,this.extButton.setObjectType(a)):(a||(a="all"),this.objectTypeFilter=a)},GENTICS.Aloha.ui.AttributeField.prototype.setItem=function(a,b){this.extButton&&this.extButton.setItem(a,b)},GENTICS.Aloha.ui.AttributeField.prototype.getItem=function(){return this.extButton?this.extButton.getItem():null},GENTICS.Aloha.ui.AttributeField.prototype.getValue=function(){return this.extButton?this.extButton.getValue():null},GENTICS.Aloha.ui.AttributeField.prototype.setValue=function(a){this.extButton&&this.extButton.setValue(a)},GENTICS.Aloha.ui.AttributeField.prototype.getQueryValue=function(){return this.extButton?this.extButton.wrap.dom.children[0].value:null},GENTICS.Aloha.ui.AttributeField.prototype.setDisplayField=function(a){return this.extButton?this.extButton.displayField=a:this.displayField=a},GENTICS.Aloha.ui.AttributeField.prototype.setTemplate=function(a){return this.extButton?this.extButton.tpl='<tpl for="."><div class="x-combo-list-item">'+a+"</div></tpl>":this.tpl='<tpl for="."><div class="x-combo-list-item">'+a+"</div></tpl>"},GENTICS.Aloha.ui.Browser=function(){this.onSelect=null;var a=this;this.grid=new Ext.grid.GridPanel({region:"center",autoScroll:!0,store:new Ext.data.Store({proxy:new Ext.data.AlohaProxy,reader:new Ext.data.AlohaObjectReader}),columns:[{id:"name",header:"Name",width:100,sortable:!0,dataIndex:"name"},{header:"URL",renderer:function(a){return a},width:300,sortable:!0,dataIndex:"url"}],stripeRows:!0,autoExpandColumn:"name",height:350,width:600,title:"Objectlist",stateful:!0,stateId:"grid",selModel:new Ext.grid.RowSelectionModel({singleSelect:!0}),listeners:{dblclick:function(b){a.onItemSelect()}}}),this.grid.getSelectionModel().on({selectionchange:function(b,c,d){var e=a.grid.getSelectionModel().getSelected();e?this.win.buttons[1].enable():this.win.buttons[1].disable()},scope:this}),this.tree=new Ext.tree.TreePanel({region:"center",useArrows:!0,autoScroll:!0,animate:!0,enableDD:!0,containerScroll:!0,border:!1,loader:new Ext.tree.AlohaTreeLoader,root:{nodeType:"async",text:"Aloha Repositories",draggable:!1,id:"aloha"},rootVisible:!1,listeners:{beforeload:function(a){this.loader.baseParams={node:a.attributes}}}}),this.tree.getSelectionModel().on({selectionchange:function(b,c){if(c){var d=c.attributes;a.grid.store.load({params:{inFolderId:d.id,objectTypeFilter:a.objectTypeFilter,repositoryId:d.repositoryId}})}},scope:this}),this.nav=new Ext.Panel({title:"Navigation",region:"west",width:300,layout:"fit",collapsible:!0,items:[this.tree]}),this.win=new Ext.Window({title:"Resource Selector",layout:"border",width:800,height:300,closeAction:"hide",onEsc:function(){this.hide()},defaultButton:this.nav,plain:!0,initHidden:!0,items:[this.nav,this.grid],buttons:[{text:"Close",handler:function(){a.win.hide()}},{text:"Select",disabled:!0,handler:function(){a.onItemSelect()}}],toFront:function(a){return this.manager=this.manager||Ext.WindowMgr,this.manager.bringToFront(this),this.setZIndex(9999999999),this}}),this.onItemSelect=function(){var a=this.grid.getSelectionModel(),b=a?a.getSelected():null,c=b?b.data:null;this.win.hide(),typeof this.onSelect=="function"&&this.onSelect.call(this,c)}},GENTICS.Aloha.ui.Browser.prototype.setObjectTypeFilter=function(a){this.objectTypeFilter=a},GENTICS.Aloha.ui.Browser.prototype.getObjectTypeFilter=function(){return this.objectTypeFilter},GENTICS.Aloha.ui.Browser.prototype.show=function(){this.win.show(),this.win.toFront(!0),this.win.focus()},function(){function c(a){var b=document.createElement("link");return b.setAttribute("rel","stylesheet"),b.setAttribute("type","text/css"),b.setAttribute("href",a),b.setAttribute("media","all"),b}if(typeof this.GENTICS_Aloha_autoloadcss=="undefined"||this.GENTICS_Aloha_autoloadcss!=!1){var a=GENTICS.Aloha.autobase;typeof GENTICS_Aloha_base!="undefined"&&(a=GENTICS_Aloha_base);var b=document.getElementsByTagName("head")[0];b.appendChild(c(a+"css/aloha.css?v="+GENTICS.Aloha.version)),b.appendChild(c(a+"deps/extjs/resources/css/ext-all.css?v="+GENTICS.Aloha.version)),b.appendChild(c(a+"deps/extjs/resources/css/xtheme-gray.css?v="+GENTICS.Aloha.version)),b.appendChild(c(a+"deps/prettyPhoto/resources/css/prettyPhoto.css?v="+GENTICS.Aloha.version)),b.appendChild(c(a+"plugins/com.gentics.aloha.plugins.Table/resources/table.css?v="+GENTICS.Aloha.version)),b.appendChild(c(a+"plugins/com.gentics.aloha.plugins.Link/css/Link.css?v="+GENTICS.Aloha.version)),b.appendChild(c(a+"plugins/com.gentics.aloha.plugins.HighlightEditables/css/HighlightEditables.css?v="+GENTICS.Aloha.version)),b.appendChild(c(a+"plugins/com.gentics.aloha.plugins.LinkChecker/css/LinkChecker.css?v="+GENTICS.Aloha.version))}}(),GENTICS.Aloha.Editable=function(a){a.attr("id")||a.attr("id",GENTICS.Utils.guid()),this.obj=a,this.ready=!1,GENTICS.Aloha.registerEditable(this),this.init()},GENTICS.Aloha.Editable.prototype.isActive=!1,GENTICS.Aloha.Editable.prototype.originalContent=null,GENTICS.Aloha.Editable.prototype.range=undefined,GENTICS.Aloha.Editable.prototype.check=function(){var a=this.obj,b=a.get(0),c=b.nodeName.toLowerCase(),d=["a","abbr","address","article","aside","b","bdo","blockquote","cite","code","command","del","details","dfn","div","dl","em","footer","h1","h2","h3","h4","h5","h6","header","i","ins","menu","nav","p","pre","q","ruby","section","small","span","strong","sub","sup","var"];for(var e=0;e<d.length;e++){var f=c;if(c==d[e])return!0}switch(c){case"label":case"button":break;case"textarea":var g=jQuery("<div/>").insertAfter(a);g.html(a.val()),a.hide();var h=function(){var b=g.html();a.val(b)};return a.parents("form:first").submit(h),this.obj=g,!0;default:}return!1},GENTICS.Aloha.Editable.prototype.init=function(){var a=this;if(!this.check(this.obj)){this.destroy();return}GENTICS.Aloha.ready&&(this.obj.addClass("GENTICS_editable"),this.obj.attr("contentEditable",!0),this.obj.mousedown(function(b){a.activate(b),b.stopPropagation()}),this.obj.focus(function(b){a.activate(b)}),this.obj.keydown(function(a){return GENTICS.Aloha.Markup.preProcessKeyStrokes(a)}),this.obj.keyup(function(a){if(a.keyCode==27)return GENTICS.Aloha.deactivateEditable(),!1}),this.obj.GENTICS_contentEditableSelectionChange(function(b){return GENTICS.Aloha.Selection.onChange(a.obj,b),a.obj}),GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableCreated",GENTICS.Aloha,[this])),this.setUnmodified(),this.ready=!0)},GENTICS.Aloha.Editable.prototype.destroy=function(){var a=this;this.blur(),this.ready=!1,this.obj.removeClass("GENTICS_editable"),this.obj.removeAttr("contentEditable"),this.obj.unbind("mousedown"),this.obj.unbind("focus"),this.obj.unbind("keydown"),this.obj.unbind("keyup"),GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableDestroyed",GENTICS.Aloha,[this])),GENTICS.Aloha.unregisterEditable(this)},GENTICS.Aloha.Editable.prototype.setUnmodified=function(){this.originalContent=this.getContents()},GENTICS.Aloha.Editable.prototype.isModified=function(){return this.originalContent!=this.getContents()?!0:!1},GENTICS.Aloha.Editable.prototype.toString=function(){return"GENTICS.Aloha.Editable"},GENTICS.Aloha.Editable.prototype.isDisabled=function(){return this.obj.attr("contentEditable")=="false"||!this.obj.attr("contentEditable")?!0:!1},GENTICS.Aloha.Editable.prototype.disable=function(){if(this.isDisabled())return;this.obj.attr("contentEditable","false")},GENTICS.Aloha.Editable.prototype.enable=function(){if(!this.isDisabled())return;this.obj.attr("contentEditable","true")},GENTICS.Aloha.Editable.prototype.activate=function(a){if(this.isActive||this.isDisabled())return;var b=GENTICS.Aloha.getActiveEditable();GENTICS.Aloha.activateEditable(this),document.selection&&document.selection.createRange&&this.obj.mouseup(),this.isActive=!0,GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableActivated",GENTICS.Aloha,{oldActive:b,editable:this})),GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableActivated",this,{oldActive:GENTICS.Aloha.getActiveEditable()}))},GENTICS.Aloha.Editable.prototype.blur=function(){this.obj.blur(),this.isActive=!1,GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableDeactivated",GENTICS.Aloha,{editable:this})),GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableDeactivated",this))},GENTICS.Aloha.Editable.prototype.empty=function(a){return null===a?!0:GENTICS.Aloha.trim(a)==""||a=="<br>"},GENTICS.Aloha.Editable.prototype.getContents=function(){var a=this.obj.clone(!0);return GENTICS.Aloha.PluginRegistry.makeClean(a),a.html()},GENTICS.Aloha.Editable.prototype.getId=function(){return this.obj.attr("id")},GENTICS.Aloha.Ribbon=function(){var a=this;this.visible=!1,this.toolbar=new Ext.Toolbar({height:30,cls:"GENTICS_ribbon ext-root"}),this.toolbar.add(new Ext.Toolbar.Spacer({width:"5"})),this.icon=new Ext.Toolbar.Spacer,this.toolbar.add(this.icon),this.toolbar.add(new Ext.Toolbar.Fill),this.toolbar.add(new Ext.Toolbar.Separator);var b=new Ext.Button({iconCls:"GENTICS_fade_out",handler:function(b){var c=jQuery(a.toolbar.getEl().dom);b.iconCls=="GENTICS_fade_out"?(c.css("marginLeft","34px"),c.animate({left:"-100%"}),jQuery("body").animate({paddingTop:0}),b.setIconClass("GENTICS_fade_in")):(c.css("marginLeft","0px"),c.animate({left:"0%"}),jQuery("body").animate({paddingTop:30}),b.setIconClass("GENTICS_fade_out")),a.toolbar.doLayout()}});this.toolbar.add(b),this.toolbar.add(new Ext.Toolbar.Spacer({width:"5"}))},GENTICS.Aloha.Ribbon.prototype.setIcon=function(a){typeof this.icon.cls!="undefined"&&this.icon.removeClass(this.icon.cls),this.icon.addClass(a)},GENTICS.Aloha.Ribbon.prototype.addButton=function(a){if(typeof a.menu=="object"){var b=new Ext.menu.Menu;jQuery.each(a.menu,function(a,c){b.addItem(new Ext.menu.Item({text:c.label,icon:c.icon,iconCls:c.iconClass,handler:function(){c.onclick.apply(c)}}))})}var c={text:a.label,enableToggle:a.toggle,icon:a.icon,pressed:a.pressed,iconCls:a.iconClass,menu:b,handler:function(){typeof a.onclick=="function"&&a.onclick.apply(a),a.pressed=!a.pressed}},d;b&&typeof a.onclick=="function"?d=new Ext.SplitButton(c):d=new Ext.Button(c),this.toolbar.insert(this.toolbar.items.getCount()-3,d)},GENTICS.Aloha.Ribbon.prototype.addSeparator=function(){this.toolbar.insert(this.toolbar.items.getCount()-3,new Ext.Toolbar.Separator)},GENTICS.Aloha.Ribbon.prototype.init=function(){this.toolbar.render(document.body,0),GENTICS.Aloha.settings.ribbon===!0&&(jQuery("body").css("paddingTop","30px !important"),this.show())},GENTICS.Aloha.Ribbon.prototype.hide=function(){jQuery(".GENTICS_ribbon").fadeOut(),this.visible=!1},GENTICS.Aloha.Ribbon.prototype.show=function(){jQuery(".GENTICS_ribbon").fadeIn(),this.visible=!0},GENTICS.Aloha.Ribbon.prototype.isVisible=function(){return this.visible},GENTICS.Aloha.Ribbon=new GENTICS.Aloha.Ribbon,GENTICS.Aloha.Event=function(a,b,c){this.name=a,b?this.source=b:this.source=GENTICS.Aloha,this.properties=c},GENTICS.Aloha.EventRegistry=function(){},GENTICS.Aloha.EventRegistry.prototype.subscribe=function(a,b,c){jQuery(a).bind(b,c)},GENTICS.Aloha.EventRegistry.prototype.trigger=function(a){jQuery(a.source).trigger(a.name,a.properties)},GENTICS.Aloha.EventRegistry=new GENTICS.Aloha.EventRegistry,GENTICS.Aloha.FloatingMenu={},GENTICS.Aloha.FloatingMenu.scopes={"GENTICS.Aloha.empty":{name:"GENTICS.Aloha.empty",extendedScopes:[],buttons:[]},"GENTICS.Aloha.global":{name:"GENTICS.Aloha.global",extendedScopes:["GENTICS.Aloha.empty"],buttons:[]},"GENTICS.Aloha.continuoustext":{name:"GENTICS.Aloha.continuoustext",extendedScopes:["GENTICS.Aloha.global"],buttons:[]}},GENTICS.Aloha.FloatingMenu.tabs=[],GENTICS.Aloha.FloatingMenu.tabMap={},GENTICS.Aloha.FloatingMenu.initialized=!1,GENTICS.Aloha.FloatingMenu.allButtons=[],GENTICS.Aloha.FloatingMenu.top=100,GENTICS.Aloha.FloatingMenu.left=100,GENTICS.Aloha.FloatingMenu.pinned=!1,GENTICS.Aloha.FloatingMenu.window=jQuery(window),GENTICS.Aloha.FloatingMenu.init=function(){this.currentScope="GENTICS.Aloha.global";var a=this;this.window.unload(function(){a.pinned?(jQuery.cookie("GENTICS.Aloha.FloatingMenu.pinned","true"),jQuery.cookie("GENTICS.Aloha.FloatingMenu.top",a.obj.offset().top),jQuery.cookie("GENTICS.Aloha.FloatingMenu.left",a.obj.offset().left),GENTICS.Aloha.Log.isInfoEnabled()&&GENTICS.Aloha.Log.info(this,"stored FloatingMenu pinned position {"+a.obj.offset().left+", "+a.obj.offset().top+"}")):(jQuery.cookie("GENTICS.Aloha.FloatingMenu.pinned",null),jQuery.cookie("GENTICS.Aloha.FloatingMenu.top",null),jQuery.cookie("GENTICS.Aloha.FloatingMenu.left",null)),a.userActivatedTab&&jQuery.cookie("GENTICS.Aloha.FloatingMenu.activeTab",a.userActivatedTab)}).resize(function(){var b=a.calcFloatTarget(GENTICS.Aloha.Selection.getRangeObject());b&&a.floatTo(b)}),this.generateComponent(),this.initialized=!0},GENTICS.Aloha.FloatingMenu.obj=null,GENTICS.Aloha.FloatingMenu.shadow=null,GENTICS.Aloha.FloatingMenu.panelBody=null,GENTICS.Aloha.FloatingMenu.generateComponent=function(){var a=this;Ext.QuickTips.init(),Ext.apply(Ext.QuickTips.getQuickTip(),{minWidth:10}),!this.extTabPanel,this.extTabPanel=new Ext.TabPanel({activeTab:0,width:400,plain:!1,draggable:{insertProxy:!1,onDrag:function(a){var b=this.proxy.getEl();this.x=b.getLeft(!0),this.y=b.getTop(!0),GENTICS.Aloha.FloatingMenu.shadow.hide()},endDrag:function(b){if(GENTICS.Aloha.FloatingMenu.pinned)var c=this.y-jQuery(document).scrollTop();else var c=this.y;a.left=this.x,a.top=c,this.panel.setPosition(this.x,c),GENTICS.Aloha.FloatingMenu.refreshShadow(),GENTICS.Aloha.FloatingMenu.shadow.show()}},floating:!0,defaults:{autoScroll:!0},layoutOnTabChange:!0,shadow:!1,cls:"GENTICS_floatingmenu ext-root",listeners:{tabchange:{fn:function(b,c){c.title!=a.autoActivatedTab?(GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(a,"User selected tab "+c.title),a.userActivatedTab=c.title):GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(a,"Tab "+c.title+" was activated automatically"),a.autoActivatedTab=undefined,jQuery.each(a.allButtons,function(a,b){typeof b.button!="undefined"&&typeof b.button.extButton!="undefined"&&typeof b.button.extButton.setActiveDOMElement=="function"&&typeof b.button.extButton.activeDOMElement!="undefined"&&b.button.extButton.setActiveDOMElement(b.button.extButton.activeDOMElement)}),GENTICS.Aloha.FloatingMenu.shadow.show(),GENTICS.Aloha.FloatingMenu.refreshShadow()}}},enableTabScroll:!0}),jQuery.each(this.tabs,function(b,c){a.extTabPanel.add(c.getExtComponent())}),jQuery("body").append('<div id="GENTICS_floatingmenu_shadow" class="GENTICS_shadow">&#160;</div>'),this.shadow=jQuery("#GENTICS_floatingmenu_shadow");var b=this.extTabPanel.add({title:"&#160;"});this.extTabPanel.render(document.body),jQuery(b.tabEl).addClass("GENTICS_floatingmenu_pin").html("&#160;").mousedown(function(b){a.togglePin(),b.stopPropagation()}),this.panelBody=jQuery(".GENTICS_floatingmenu .x-tab-panel-bwrap"),this.doLayout(),this.obj=jQuery(this.extTabPanel.getEl().dom),jQuery.cookie("GENTICS.Aloha.FloatingMenu.pinned")=="true"&&(this.togglePin(),this.top=parseInt(jQuery.cookie("GENTICS.Aloha.FloatingMenu.top")),this.left=parseInt(jQuery.cookie("GENTICS.Aloha.FloatingMenu.left")),this.top<30&&(this.top=30),this.left<0&&(this.left=0),GENTICS.Aloha.Log.isInfoEnabled()&&GENTICS.Aloha.Log.info(this,"restored FloatingMenu pinned position {"+this.left+", "+this.top+"}"),this.refreshShadow()),jQuery.cookie("GENTICS.Aloha.FloatingMenu.activeTab")&&(this.userActivatedTab=jQuery.cookie("GENTICS.Aloha.FloatingMenu.activeTab")),this.extTabPanel.setPosition(this.left,this.top),this.obj.mousedown(function(a){a.stopPropagation()}),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(b,c){if(!a.pinned){var d=a.calcFloatTarget(c);d&&a.floatTo(d)}})},GENTICS.Aloha.FloatingMenu.refreshShadow=function(){if(!this.panelBody)return;GENTICS.Aloha.FloatingMenu.shadow.css("top",this.top+24),GENTICS.Aloha.FloatingMenu.shadow.css("left",this.left),GENTICS.Aloha.FloatingMenu.shadow.width(this.panelBody.width()),GENTICS.Aloha.FloatingMenu.shadow.height(this.panelBody.height())},GENTICS.Aloha.FloatingMenu.togglePin=function(){var a=jQuery(".GENTICS_floatingmenu_pin");this.pinned?(a.removeClass("GENTICS_floatingmenu_pinned"),this.top=this.obj.offset().top,this.obj.css("top",this.top),this.obj.css("position","absolute"),this.shadow.css("position","absolute"),this.refreshShadow(),this.pinned=!1):(a.addClass("GENTICS_floatingmenu_pinned"),this.top=this.obj.offset().top-this.window.scrollTop(),this.obj.css("top",this.top),this.obj.css("position","fixed"),this.shadow.css("position","fixed"),this.refreshShadow(),this.pinned=!0)},GENTICS.Aloha.FloatingMenu.createScope=function(a,b){typeof b=="undefined"?b=["GENTICS.Aloha.empty"]:typeof b=="string"&&(b=[b]);var c=this.scopes[a];c||(this.scopes[a]={name:a,extendedScopes:b,buttons:[]})},GENTICS.Aloha.FloatingMenu.addButton=function(a,b,c,d){var e=this.scopes[a];typeof e!="undefined";var f={button:b,scopeVisible:!1};this.allButtons.push(f),e.buttons.push(f);var g=this.tabMap[c];typeof g=="undefined"&&(g=new GENTICS.Aloha.FloatingMenu.Tab(c),this.tabs.push(g),this.tabMap[c]=g);var h=g.getGroup(d);h.addButton(f),this.initialized&&this.generateComponent()},GENTICS.Aloha.FloatingMenu.doLayout=function(){GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(this,"doLayout called for FloatingMenu, scope is "+this.currentScope);var a=this,b=!1,c=this.extTabPanel.getActiveTab(),d=!1,e=!1,f=!1;jQuery.each(this.tabs,function(g,h){h.extPanel==c&&(d=h);var i=h.visible;h.doLayout()?(e=!0,i||(GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(a,"showing tab strip for tab "+h.label),a.extTabPanel.unhideTabStripItem(h.extPanel)),b==!1&&(b=h),a.userActivatedTab==h.extPanel.title&&h.extPanel!=c&&(f=h)):i&&(GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(a,"hiding tab strip for tab "+h.label),a.extTabPanel.hideTabStripItem(h.extPanel))}),f?(GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(this,"Setting active tab to "+f.label),this.extTabPanel.setActiveTab(f.extPanel)):typeof d=="object"&&typeof b=="object"&&(d.visible||(GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(this,"Setting active tab to "+b.label),this.autoActivatedTab=b.extPanel.title,this.extTabPanel.
setActiveTab(b.extPanel)));if(e&&this.extTabPanel.hidden)this.extTabPanel.show(),this.refreshShadow(),this.shadow.show(),this.extTabPanel.setPosition(this.left,this.top);else if(!e&&!this.extTabPanel.hidden){var g=this.extTabPanel.getPosition(!0);this.left=g[0]<0?100:g[0],this.top=g[1]<0?100:g[1],this.extTabPanel.hide(),this.shadow.hide()}this.extTabPanel.doLayout()},GENTICS.Aloha.FloatingMenu.setScope=function(a){var b=this.scopes[a];typeof b!="undefined"&&this.currentScope!=a&&(this.currentScope=a,jQuery.each(this.allButtons,function(a,b){b.scopeVisible=!1}),this.setButtonScopeVisibility(b),this.doLayout())},GENTICS.Aloha.FloatingMenu.setButtonScopeVisibility=function(a){var b=this;jQuery.each(a.buttons,function(a,b){b.scopeVisible=!0}),jQuery.each(a.extendedScopes,function(a,c){var d=b.scopes[c];typeof d=="object"&&b.setButtonScopeVisibility(d)})},GENTICS.Aloha.FloatingMenu.nextFloatTargetObj=function(a,b){if(!a||a==b)return a;switch(a.nodeName.toLowerCase()){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"p":case"div":case"td":case"pre":case"ul":case"ol":return a;default:return this.nextFloatTargetObj(a.parentNode,b)}},GENTICS.Aloha.FloatingMenu.calcFloatTarget=function(a){if(!GENTICS.Aloha.activeEditable)return!1;for(var b=0;b<GENTICS.Aloha.editables.length;b++)if(GENTICS.Aloha.editables[b].obj.get(0)==a.limitObject&&GENTICS.Aloha.editables[b].isDisabled())return!1;var c=jQuery(this.nextFloatTargetObj(a.getCommonAncestorContainer(),a.limitObject)),d=GENTICS.Utils.Position.Scroll.top,e=c.offset().top-this.obj.height()-50,f=0;return GENTICS.Aloha.Ribbon&&GENTICS.Aloha.settings.ribbon===!0&&(f=30),e<d+f&&(e=c.offset().top+c.height()+f),e>this.window.height()+this.window.scrollTop()?!1:{x:GENTICS.Aloha.activeEditable.obj.offset().left,y:e}},GENTICS.Aloha.FloatingMenu.floatTo=function(a){if(this.pinned)return;var b=this;if(!this.floatedTo||this.floatedTo.x!=a.x||this.floatedTo.y!=a.y)this.obj.animate({top:a.y,left:a.x},{queue:!1,step:function(a,c){c.prop=="top"?b.top=c.now:c.prop=="left"&&(b.left=c.now),b.refreshShadow()}}),this.floatedTo=a},GENTICS.Aloha.FloatingMenu.Tab=function(a){this.label=a,this.groups=[],this.groupMap={},this.visible=!0},GENTICS.Aloha.FloatingMenu.Tab.prototype.getGroup=function(a){var b=this.groupMap[a];return typeof b=="undefined"&&(b=new GENTICS.Aloha.FloatingMenu.Group,this.groupMap[a]=b,this.groups.push(b)),b},GENTICS.Aloha.FloatingMenu.Tab.prototype.getExtComponent=function(){var a=this;return typeof this.extPanel=="undefined"&&(this.extPanel=new Ext.Panel({tbar:[],title:this.label,style:"margin-top:0px",bodyStyle:"display:none",autoScroll:!0}),jQuery.each(this.groups,function(b,c){a.extPanel.getTopToolbar().add(c.getExtComponent())})),this.extPanel},GENTICS.Aloha.FloatingMenu.Tab.prototype.doLayout=function(){var a=this;return GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(this,"doLayout called for tab "+this.label),this.visible=!1,jQuery.each(this.groups,function(b,c){a.visible|=c.doLayout()}),GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(this,"tab "+this.label+(this.visible?" is ":" is not ")+"visible now"),this.visible},GENTICS.Aloha.FloatingMenu.Group=function(){this.buttons=[]},GENTICS.Aloha.FloatingMenu.Group.prototype.addButton=function(a){this.buttons.push(a)},GENTICS.Aloha.FloatingMenu.Group.prototype.getExtComponent=function(){var a=this;if(typeof this.extButtonGroup=="undefined"){var b=[],c=0;jQuery.each(this.buttons,function(a,d){b.push(d.button.getExtConfigProperties()),c+=d.button.size=="small"?1:2}),this.extButtonGroup=new Ext.ButtonGroup({columns:Math.ceil(c/2),items:b}),jQuery.each(this.buttons,function(b,c){c.button.extButton=a.extButtonGroup.findById(c.button.id);if(c.button.listenerQueue&&c.button.listenerQueue.length>0)while(l=c.button.listenerQueue.shift())c.button.extButton.addListener(l.eventName,l.handler,l.scope,l.options);c.button.extButton.setObjectTypeFilter&&(c.button.objectTypeFilter&&(c.button.extButton.noQuery=!1),c.button.objectTypeFilter=="all"&&(c.button.objectTypeFilter=null),c.button.extButton.setObjectTypeFilter(c.button.objectTypeFilter),c.button.displayField&&(c.button.extButton.displayField=c.button.displayField),c.button.tpl&&(c.button.extButton.tpl=c.button.tpl))})}return this.extButtonGroup},GENTICS.Aloha.FloatingMenu.Group.prototype.doLayout=function(){var a=!1,b=this;return jQuery.each(this.buttons,function(c,d){var e=b.extButtonGroup.findById(d.button.id),f=d.button.isVisible()&&d.scopeVisible;f&&e.hidden?e.show():!f&&!e.hidden&&e.hide(),a|=f}),a&&this.extButtonGroup.hidden?this.extButtonGroup.show():!a&&!this.extButtonGroup.hidden&&this.extButtonGroup.hide(),a},document.attachEvent&&document.selection&&function(){function c(b){this._document=b,this.startContainer=this.endContainer=b.body,this.endOffset=a.getNodeLength(b.body)}function d(b){this.range=b;if(b.collapsed)return;var c=b.commonAncestorContainer;this._next=b.startContainer==c&&!a.isDataNode(b.startContainer)?b.startContainer.childNodes[b.startOffset]:a.findClosestAncestor(c,b.startContainer),this._end=b.endContainer==c&&!a.isDataNode(b.endContainer)?b.endContainer.childNodes[b.endOffset]:a.findClosestAncestor(c,b.endContainer).nextSibling}function e(a){this._document=a;var b=this;a.attachEvent("onselectionchange",function(){b._selectionChangeHandler()})}var a={findChildPosition:function(a){for(var b=0;a=a.previousSibling;b++)continue;return b},isDataNode:function(a){return a&&a.nodeValue!==null&&a.data!==null},isAncestorOf:function(b,c){return!a.isDataNode(b)&&(b.contains(a.isDataNode(c)?c.parentNode:c)||c.parentNode==b)},isAncestorOrSelf:function(b,c){return a.isAncestorOf(b,c)||b==c},findClosestAncestor:function(b,c){if(a.isAncestorOf(b,c))while(c&&c.parentNode!=b)c=c.parentNode;return c},getNodeLength:function(b){return a.isDataNode(b)?b.length:b.childNodes.length},splitDataNode:function(b,c){if(!a.isDataNode(b))return!1;var d=b.cloneNode(!1);b.deleteData(c,b.length),d.deleteData(0,c),b.parentNode.insertBefore(d,b.nextSibling)}},b={convertToDOMRange:function(a,b){function d(a,c,d){var e=b.createElement("a"),f=c.duplicate();f.collapse(d);var g=f.parentElement();do g.insertBefore(e,e.previousSibling),f.moveToElementText(e);while(f.compareEndPoints(d?"StartToStart":"StartToEnd",c)>0&&e.previousSibling);f.compareEndPoints(d?"StartToStart":"StartToEnd",c)==-1&&e.nextSibling?(f.setEndPoint(d?"EndToStart":"EndToEnd",c),a[d?"setStart":"setEnd"](e.nextSibling,f.text.length)):a[d?"setStartBefore":"setEndBefore"](e),e.parentNode.removeChild(e)}var e=new c(b);return d(e,a,!0),d(e,a,!1),e},convertFromDOMRange:function(b){function c(b,c,d){var e=c[d?"startContainer":"endContainer"],f=c[d?"startOffset":"endOffset"],g=0,h=a.isDataNode(e)?e:e.childNodes[f],i=a.isDataNode(e)?e.parentNode:e;if(e.nodeType==3||e.nodeType==4)g=f;var j=c._document.createElement("a");i.insertBefore(j,h);var k=c._document.body.createTextRange();k.moveToElementText(j),j.parentNode.removeChild(j),b.setEndPoint(d?"StartToStart":"EndToStart",k),b[d?"moveStart":"moveEnd"]("character",g)}var d=b._document.body.createTextRange();return c(d,b,!0),c(d,b,!1),d}};c.START_TO_START=0,c.START_TO_END=1,c.END_TO_END=2,c.END_TO_START=3,c.prototype={startContainer:null,startOffset:0,endContainer:null,endOffset:0,commonAncestorContainer:null,collapsed:!1,_document:null,_refreshProperties:function(){this.collapsed=this.startContainer==this.endContainer&&this.startOffset==this.endOffset;var b=this.startContainer;while(b&&b!=this.endContainer&&!a.isAncestorOf(b,this.endContainer))b=b.parentNode;this.commonAncestorContainer=b},setStart:function(a,b){this.startContainer=a,this.startOffset=b,this._refreshProperties()},setEnd:function(a,b){this.endContainer=a,this.endOffset=b,this._refreshProperties()},setStartBefore:function(b){this.setStart(b.parentNode,a.findChildPosition(b))},setStartAfter:function(b){this.setStart(b.parentNode,a.findChildPosition(b)+1)},setEndBefore:function(b){this.setEnd(b.parentNode,a.findChildPosition(b))},setEndAfter:function(b){this.setEnd(b.parentNode,a.findChildPosition(b)+1)},selectNode:function(a){this.setStartBefore(a),this.setEndAfter(a)},selectNodeContents:function(b){this.setStart(b,0),this.setEnd(b,a.getNodeLength(b))},collapse:function(a){a?this.setEnd(this.startContainer,this.startOffset):this.setStart(this.endContainer,this.endOffset)},cloneContents:function(){return function a(b){for(var c,d=document.createDocumentFragment();c=b.next();)c=c.cloneNode(!b.hasPartialSubtree()),b.hasPartialSubtree()&&c.appendChild(a(b.getSubtreeIterator())),d.appendChild(c);return d}(new d(this))},extractContents:function(){var b=this.cloneRange();return this.startContainer!=this.commonAncestorContainer&&this.setStartAfter(a.findClosestAncestor(this.commonAncestorContainer,this.startContainer)),this.collapse(!0),function c(a){for(var b,d=document.createDocumentFragment();b=a.next();)a.hasPartialSubtree()?b=b.cloneNode(!1):a.remove(),a.hasPartialSubtree()&&b.appendChild(c(a.getSubtreeIterator())),d.appendChild(b);return d}(new d(b))},deleteContents:function(){var b=this.cloneRange();this.startContainer!=this.commonAncestorContainer&&this.setStartAfter(a.findClosestAncestor(this.commonAncestorContainer,this.startContainer)),this.collapse(!0),function c(a){while(a.next())a.hasPartialSubtree()?c(a.getSubtreeIterator()):a.remove()}(new d(b))},insertNode:function(b){a.isDataNode(this.startContainer)?(a.splitDataNode(this.startContainer,this.startOffset),this.startContainer.parentNode.insertBefore(b,this.startContainer.nextSibling)):this.startContainer.insertBefore(b,this.startContainer.childNodes[this.startOffset]),this.setStart(this.startContainer,this.startOffset)},surroundContents:function(a){var b=this.extractContents();this.insertNode(a),a.appendChild(b),this.selectNode(a)},compareBoundaryPoints:function(a,b){var d,e,f,g;switch(a){case c.START_TO_START:case c.START_TO_END:d=this.startContainer,e=this.startOffset;break;case c.END_TO_END:case c.END_TO_START:d=this.endContainer,e=this.endOffset}switch(a){case c.START_TO_START:case c.END_TO_START:f=b.startContainer,g=b.startOffset;break;case c.START_TO_END:case c.END_TO_END:f=b.endContainer,g=b.endOffset}return d.sourceIndex<f.sourceIndex?-1:d.sourceIndex==f.sourceIndex?e<g?-1:e==g?0:1:1},cloneRange:function(){var a=new c(this._document);return a.setStart(this.startContainer,this.startOffset),a.setEnd(this.endContainer,this.endOffset),a},detach:function(){},toString:function(){return b.convertFromDOMRange(this).text},createContextualFragment:function(b){var c=(a.isDataNode(this.startContainer)?this.startContainer.parentNode:this.startContainer).cloneNode(!1);c.innerHTML=b;for(var d=this._document.createDocumentFragment();c.firstChild;)d.appendChild(c.firstChild);return d}},d.prototype={range:null,_current:null,_next:null,_end:null,hasNext:function(){return!!this._next},next:function(){var b=this._current=this._next;return this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null,a.isDataNode(this._current)&&(this.range.endContainer==this._current&&(b=b.cloneNode(!0)).deleteData(this.range.endOffset,b.length-this.range.endOffset),this.range.startContainer==this._current&&(b=b.cloneNode(!0)).deleteData(0,this.range.startOffset)),b},remove:function(){if(!a.isDataNode(this._current)||this.range.startContainer!=this._current&&this.range.endContainer!=this._current)this._current.parentNode.removeChild(this._current);else{var b=this.range.startContainer==this._current?this.range.startOffset:0,c=this.range.endContainer==this._current?this.range.endOffset:this._current.length;this._current.deleteData(b,c-b)}},hasPartialSubtree:function(){return!a.isDataNode(this._current)&&(a.isAncestorOrSelf(this._current,this.range.startContainer)||a.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var b=new c(this.range._document);return b.selectNodeContents(this._current),a.isAncestorOrSelf(this._current,this.range.startContainer)&&b.setStart(this.range.startContainer,this.range.startOffset),a.isAncestorOrSelf(this._current,this.range.endContainer)&&b.setEnd(this.range.endContainer,this.range.endOffset),new d(b)}},e.prototype={rangeCount:0,_document:null,_selectionChangeHandler:function(){this.rangeCount=this._selectionExists(this._document.selection.createRange())?1:0},_selectionExists:function(a){return a.compareEndPoints("StartToEnd",a)!=0||a.parentElement().isContentEditable},addRange:function(a){var c=this._document.selection.createRange(),d=b.convertFromDOMRange(a);this._selectionExists(c)?(d.compareEndPoints("StartToStart",c)==-1&&(d.compareEndPoints("StartToEnd",c)>-1&&d.compareEndPoints("EndToEnd",c)==-1?c.setEndPoint("StartToStart",d):d.compareEndPoints("EndToStart",c)<1&&d.compareEndPoints("EndToEnd",c)>-1&&c.setEndPoint("EndToEnd",d)),c.select()):d.select()},removeAllRanges:function(){this._document.selection.empty()},getRangeAt:function(a){var c=this._document.selection.createRange();return this._selectionExists(c)?b.convertToDOMRange(c,this._document):null},toString:function(){return this._document.selection.createRange().text}},document.createRange=function(){return new c(document)};var f=new e(document);window.getSelection=function(){return f}}(),jQuery.fn.aloha=function(){return this.each(function(){new GENTICS.Aloha.Editable(jQuery(this))})},jQuery.fn.GENTICS_aloha=function(){return this.each(function(){new GENTICS.Aloha.Editable(jQuery(this))})},jQuery.fn.mahalo=function(){return this.each(function(){if(jQuery(this).hasClass("GENTICS_editable"))for(var a=0;a<GENTICS.Aloha.editables.length;a++)GENTICS.Aloha.editables[a].obj.get(0)===this&&GENTICS.Aloha.editables[a].destroy()})},jQuery.fn.GENTICS_mahalo=function(){return this.each(function(){var a=this})},jQuery.fn.GENTICS_contentEditableSelectionChange=function(a){var b=this;return this.keyup(function(b){var c=GENTICS.Aloha.Selection.getRangeObject();a(b)}),this.dblclick(function(b){a(b)}),this.mousedown(function(a){b.selectionStarted=!0}),jQuery(document).mouseup(function(c){GENTICS.Aloha.Selection.eventOriginalTarget=b,b.selectionStarted&&a(c),GENTICS.Aloha.Selection.eventOriginalTarget=!1,b.selectionStarted=!1}),this},jQuery.fn.outerHTML=function(a){return a?this.before(a).remove():jQuery("<p>").append(this.eq(0).clone()).html()},GENTICS.Aloha.Log=function(){},GENTICS.Aloha.Log.prototype.logHistory=null,GENTICS.Aloha.Log.prototype.highWaterMarkReached=!1,GENTICS.Aloha.Log.prototype.init=function(){if(typeof GENTICS.Aloha.settings.logLevels=="undefined"||!GENTICS.Aloha.settings.logLevels)GENTICS.Aloha.settings.logLevels={error:!0,warn:!0};if(typeof GENTICS.Aloha.settings.logHistory=="undefined"||!GENTICS.Aloha.settings.logHistory)GENTICS.Aloha.settings.logHistory={};GENTICS.Aloha.settings.logHistory.maxEntries||(GENTICS.Aloha.settings.logHistory.maxEntries=100),GENTICS.Aloha.settings.logHistory.highWaterMark||(GENTICS.Aloha.settings.logHistory.highWaterMark=90),GENTICS.Aloha.settings.logHistory.levels||(GENTICS.Aloha.settings.logHistory.levels={error:!0,warn:!0}),this.flushLogHistory()},GENTICS.Aloha.Log.prototype.log=function(a,b,c){if(typeof a=="undefined"||!a)a="error";a=a.toLowerCase();if(!GENTICS.Aloha.settings.logLevels[a])return;this.addToLogHistory({level:a,component:b.toString(),message:c,date:new Date});switch(a){case"error":window.console&&console.error&&console.error(b.toString()+": "+c);break;case"warn":window.console&&console.warn&&console.warn(b.toString()+": "+c);break;case"info":window.console&&console.info&&console.info(b.toString()+": "+c);break;case"debug":window.console&&console.log&&console.log(b.toString()+" ["+a+"]: "+c);break;default:window.console&&console.log&&console.log(b.toString()+" ["+a+"]: "+c)}},GENTICS.Aloha.Log.prototype.error=function(a,b){this.log("error",a,b)},GENTICS.Aloha.Log.prototype.warn=function(a,b){this.log("warn",a,b)},GENTICS.Aloha.Log.prototype.info=function(a,b){this.log("info",a,b)},GENTICS.Aloha.Log.prototype.debug=function(a,b){this.log("debug",a,b)},GENTICS.Aloha.Log.prototype.isLogLevelEnabled=function(a){return GENTICS.Aloha.settings&&GENTICS.Aloha.settings.logLevels&&GENTICS.Aloha.settings.logLevels[a]==!0},GENTICS.Aloha.Log.prototype.isErrorEnabled=function(){return this.isLogLevelEnabled("error")},GENTICS.Aloha.Log.prototype.isWarnEnabled=function(){return this.isLogLevelEnabled("warn")},GENTICS.Aloha.Log.prototype.isInfoEnabled=function(){return this.isLogLevelEnabled("info")},GENTICS.Aloha.Log.prototype.isDebugEnabled=function(){return this.isLogLevelEnabled("debug")},GENTICS.Aloha.Log.prototype.addToLogHistory=function(a){if(GENTICS.Aloha.settings.logHistory.maxEntries<=0)return;if(!GENTICS.Aloha.settings.logHistory.levels[a.level])return;this.logHistory.push(a),this.highWaterMarkReached==!1&&this.logHistory.length>=GENTICS.Aloha.settings.logHistory.maxEntries*GENTICS.Aloha.settings.logHistory.highWaterMark/100&&(GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("logFull",GENTICS.Aloha.Log)),this.highWaterMarkReached=!0);while(this.logHistory.length>GENTICS.Aloha.settings.logHistory.maxEntries)this.logHistory.shift()},GENTICS.Aloha.Log.prototype.getLogHistory=function(){return this.logHistory},GENTICS.Aloha.Log.prototype.flushLogHistory=function(){this.logHistory=[],this.highWaterMarkReached=!1},GENTICS.Aloha.Log=new GENTICS.Aloha.Log,GENTICS.Aloha.Markup=function(){},GENTICS.Aloha.Markup.prototype.keyHandlers={},GENTICS.Aloha.Markup.prototype.addKeyHandler=function(a,b){this.keyHandlers[a]||(this.keyHandlers[a]=[]),this.keyHandlers[a].push(b)},GENTICS.Aloha.Markup.prototype.insertBreak=function(){var a=GENTICS.Aloha.Selection.rangeObject;a.isCollapsed()||this.removeSelectedMarkup();var b=jQuery("<br/>");GENTICS.Utils.Dom.insertIntoDOM(b,a,GENTICS.Aloha.activeEditable.obj);var c=GENTICS.Utils.Dom.searchAdjacentTextNode(b.parent().get(0),GENTICS.Utils.Dom.getIndexInParent(b.get(0))+1,!1);if(c){var d=c.data.search(/\S/);d>0&&(c.data=c.data.substring(d))}a.startContainer=a.endContainer=b.get(0).parentNode,a.startOffset=a.endOffset=GENTICS.Utils.Dom.getIndexInParent(b.get(0))+1,a.correctRange(),a.clearCaches(),a.select()},GENTICS.Aloha.Markup.prototype.preProcessKeyStrokes=function(a){if(a.type!="keydown")return!1;var b=GENTICS.Aloha.Selection.rangeObject;if(this.keyHandlers[a.keyCode]){var c=this.keyHandlers[a.keyCode];for(var d=0;d<c.length;++d)if(!c[d](a))return!1}switch(a.keyCode){case 13:return a.shiftKey?(GENTICS.Aloha.Log.debug(this,"... got a smoking Shift+Enter, Cowboy"),b.isCollapsed()||this.removeSelectedMarkup(),GENTICS.Aloha.Selection.updateSelection(!1,!0),this.processShiftEnter(b),!1):(GENTICS.Aloha.Log.debug(this,"... got a lonely Enter, Mum"),b.isCollapsed()||this.removeSelectedMarkup(),GENTICS.Aloha.Selection.updateSelection(!1,!0),this.processEnter(b),!1)}return!0},GENTICS.Aloha.Markup.prototype.processShiftEnter=function(a){this.insertHTMLBreak(a.getSelectionTree(),a)},GENTICS.Aloha.Markup.prototype.processEnter=function(a){a.splitObject?(jQuery.browser.msie&&GENTICS.Utils.Dom.isListElement(a.splitObject)&&jQuery(a.splitObject).append(jQuery(document.createTextNode(""))),this.splitRangeObject(a)):this.insertHTMLBreak(a.getSelectionTree(),a)},GENTICS.Aloha.Markup.prototype.insertHTMLCode=function(a){var b=GENTICS.Aloha.Selection.rangeObject;this.insertHTMLBreak(b.getSelectionTree(),b,jQuery(a))},GENTICS.Aloha.Markup.prototype.insertHTMLBreak=function(a,b,c){c=c?c:jQuery("<br />");for(var d=0;d<a.length;d++){var e=a[d],f=e.domobj?jQuery(e.domobj):undefined;if(e.selection!=="none")if(e.selection=="collapsed"){if(d>0){var g=jQuery(a[d-1].domobj);g.after(c)}else{var h=jQuery(a[1].domobj);h.before(c)}b.startContainer=b.endContainer=c[0].parentNode,b.startOffset=b.endOffset=GENTICS.Utils.Dom.getIndexInParent(c[0])+1,b.correctRange()}else if(e.domobj&&e.domobj.nodeType===3){e.domobj.nextSibling&&e.domobj.nextSibling.nodeType==1&&GENTICS.Aloha.Selection.replacingElements[e.domobj.nextSibling.nodeName.toLowerCase()]&&f.after("<br/>");var i=e.domobj;while(i)if(i.nextSibling)i=!1;else{i=i.parentNode,i===b.limitObject&&(i=!1);if(GENTICS.Utils.Dom.isBlockLevelElement(i))break}i&&jQuery(i).append("<br/>"),f.between(c,e.startOffset);var j=0,k=c[0];while(k)k=k.previousSibling,j++;b.startContainer=c[0].parentNode,b.endContainer=c[0].parentNode,b.startOffset=j,b.endOffset=j,b.correctRange()}else e.domobj&&e.domobj.nodeType===1&&(f.parent().find("br.GENTICS_ephemera").length===0&&(jQuery(b.limitObject).find("br.GENTICS_ephemera").remove(),jQuery(b.commonAncestorContainer).append(this.getFillUpElement(b.splitObject))),f.after(c),b.startContainer=b.commonAncestorContainer,b.endContainer=b.startContainer,b.startOffset=d+2,b.endOffset=d+2,b.update())}b.select()},GENTICS.Aloha.Markup.prototype.getSelectedText=function(){var a=GENTICS.Aloha.Selection.rangeObject;return a.isCollapsed()?!1:this.getFromSelectionTree(a.getSelectionTree(),!0)},GENTICS.Aloha.Markup.prototype.getFromSelectionTree=function(a,b){var c="";for(var d=0;d<a.length;d++){var e=a[d];if(e.selection=="partial"){if(e.domobj.nodeType==3)c+=e.domobj.data.substring(e.startOffset,e.endOffset);else if(e.domobj.nodeType==1&&e.children)if(b)c+=this.getFromSelectionTree(e.children,b);else{var f=jQuery(e.domobj).clone(!1).empty();f.html(this.getFromSelectionTree(e.children,b)),c+=f.outerHTML()}}else e.selection=="full"&&(e.domobj.nodeType==3?c+=jQuery(e.domobj).text():e.domobj.nodeType==1&&e.children&&(c+=b?jQuery(e.domobj).text():jQuery(e.domobj).outerHTML()))}return c},GENTICS.Aloha.Markup.prototype.getSelectedMarkup=function(){var a=GENTICS.Aloha.Selection.rangeObject;return a.isCollapsed()?!1:this.getFromSelectionTree(a.getSelectionTree(),!1)},GENTICS.Aloha.Markup.prototype.removeSelectedMarkup=function(){var a=GENTICS.Aloha.Selection.rangeObject;if(a.isCollapsed())return;var b=new GENTICS.Aloha.Selection.SelectionRange;this.removeFromSelectionTree(a.getSelectionTree(),b),b.update(),GENTICS.Utils.Dom.doCleanup({merge:!0,removeempty:!0},GENTICS.Aloha.Selection.rangeObject),GENTICS.Aloha.Selection.rangeObject=b,b.correctRange(),b.update(),b.select(),GENTICS.Aloha.Selection.updateSelection()},GENTICS.Aloha.Markup.prototype.removeFromSelectionTree=function(a,b){var c=undefined;for(var d=0;d<a.length;d++){var e=a[d];if(e.selection=="partial")if(e.domobj.nodeType==3){var f="";e.startOffset>0&&(f+=e.domobj.data.substring(0,e.startOffset)),e.endOffset<e.domobj.data.length&&(f+=e.domobj.data.substring(e.endOffset,e.domobj.data.length)),e.domobj.data=f,b.startContainer||(b.startContainer=b.endContainer=e.domobj,b.startOffset=b.endOffset=e.startOffset)}else e.domobj.nodeType==1&&e.children&&(this.removeFromSelectionTree(e.children,b),c?c.nodeName==e.domobj.nodeName&&(jQuery(c).append(jQuery(e.domobj).contents()),jQuery(e.domobj).remove()):c=e.domobj);else if(e.selection=="full"){if(!b.startContainer){var g=GENTICS.Utils.Dom.searchAdjacentTextNode(e.domobj.parentNode,GENTICS.Utils.Dom.getIndexInParent(e.domobj)+1,!1,{blocklevel:!1});g?(b.startContainer=b.endContainer=g,b.startOffset=b.endOffset=0):(b.startContainer=b.endContainer=e.domobj.parentNode,b.startOffset=b.endOffset=GENTICS.Utils.Dom.getIndexInParent(e.domobj)+1)}jQuery(e.domobj).remove()}}},GENTICS.Aloha.Markup.prototype.splitRangeObject=function(a,b){var c=jQuery(a.splitObject);a.update(a.splitObject);var d=a.getSelectionTree(),e=this.getSplitFollowUpContainer(a);this.splitRangeObjectHelper(d,a,e),e.hasClass("preparedForRemoval")&&e.removeClass("preparedForRemoval");var f=this.getInsertAfterObject(a,e);jQuery(e).insertAfter(f),a.splitObject.nodeName.toLowerCase()==="li"&&!GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(a.splitObject,e)&&jQuery(a.splitObject).remove(),a.startContainer=e.textNodes(!0,!0).first().get(0),a.startContainer||(a.startContainer=e.textNodes(!1).first().parent().get(0)),a.startContainer?(a.endContainer=a.startContainer,a.startOffset=0,a.endOffset=0):(a.startContainer=a.endContainer=e.parent().get(0),a.startOffset=a.endOffset=GENTICS.Utils.Dom.getIndexInParent(e.get(0))),a.update(),a.select()},GENTICS.Aloha.Markup.prototype.getInsertAfterObject=function(a,b){for(var c=0;c<a.markupEffectiveAtStart.length;c++){el=a.markupEffectiveAtStart[c];if(el===a.splitObject)var d=!0;if(!d)continue;if(GENTICS.Aloha.Selection.canTag1WrapTag2(jQuery(el).parent()[0].nodeName,b[0].nodeName))return el}return!1},GENTICS.Aloha.Markup.prototype.getFillUpElement=function(a){return jQuery.browser.msie?!1:jQuery('<br class="GENTICS_ephemera" />')},GENTICS.Aloha.Markup.prototype.removeElementContentWhitespaceObj=function(a){var b=0,c=[];for(var d=0;d<a.length;d++){var e=a[d];e.isElementContentWhitespace&&(c[c.length]=d)}for(var d=0;d<c.length;d++){var f=c[d];a.splice(f-b,1),b++}},GENTICS.Aloha.Markup.prototype.splitRangeObjectHelper=function(a,b,c,d){c||GENTICS.Aloha.Log.warn(this,"no followUpContainer, no inBetweenMarkup, nothing to do...");var e=this.getFillUpElement(b.splitObject),f=jQuery(b.splitObject),g=!1;if(a.length>0){var h=c.contents();h.length!==a.length&&this.removeElementContentWhitespaceObj(h);for(var i=0;i<a.length;i++){var j=a[i];if(j.selection==="none"&&g===!1||j.domobj&&j.domobj.nodeType===3&&j===a[a.length-1]&&j.startOffset===j.domobj.data.length){c.textNodes().length>1?h.eq(i).remove():GENTICS.Utils.Dom.isSplitObject(c[0])?e?c.html(e):c.empty():(c.empty(),c.addClass("preparedForRemoval"));continue}if(j.selection!=="none"){if(j.domobj&&j.domobj.nodeType===3&&j.startOffset!==undefined){var k=j.domobj.data;if(j.startOffset>0)j.domobj.data=k.substr(0,j.startOffset);else if(a.length>1)jQuery(j.domobj).remove();else{var l=jQuery(j.domobj).parent();GENTICS.Utils.Dom.isSplitObject(l[0])?e?l.html(e):l.empty():l.remove()}k.length-j.startOffset>0?h[i].data=k.substr(j.startOffset,k.length):h.length>1?h.eq(i).remove():GENTICS.Utils.Dom.isBlockLevelElement(c[0])?e?c.html(e):c.empty():(c.empty(),c.addClass("preparedForRemoval"))}g=!0,j.children.length>0&&this.splitRangeObjectHelper(j.children,b,h.eq(i),d)}else j.selection==="none"&&g===!0&&(jqObj=jQuery(j.domobj).remove())}}else GENTICS.Aloha.Log.error(this,"can not split splitObject due to an empty selection tree");f.find("br.GENTICS_ephemera:gt(0)").remove(),c.find("br.GENTICS_ephemera:gt(0)").remove(),f.find(".preparedForRemoval").remove(),c.find(".preparedForRemoval").remove(),f.contents().length===0&&GENTICS.Utils.Dom.isSplitObject(f[0])&&e&&f.html(e),c.contents().length===0&&GENTICS.Utils.Dom.isSplitObject(c[0])&&e&&c.html(e)},GENTICS.Aloha.Markup.prototype.getSplitFollowUpContainer=function(a){var b=a.splitObject.nodeName.toLowerCase();switch(b){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":var c=jQuery(a.splitObject).textNodes().last()[0];if(c&&a.startContainer===c&&a.startOffset===c.length){var d=jQuery("<p></p>"),e=jQuery(a.splitObject).clone().contents();return d.append(e),d}break;case"li":if(a.startContainer.nodeName.toLowerCase()==="br"&&jQuery(a.startContainer).hasClass("GENTICS_ephemera")){var d=jQuery("<p></p>"),e=jQuery(a.splitObject).clone().contents();return d.append(e),d}if(!a.splitObject.nextSibling&&jQuery.trim(jQuery(a.splitObject).text()).length==0){var d=jQuery("<p></p>");return d}}return jQuery(a.splitObject).clone()},GENTICS.Aloha.Markup.prototype.transformDomObject=function(a,b){var c=jQuery(a),d=jQuery("<"+b+"></"+b+">");return c.contents().appendTo(d),c.replaceWith(d),d},GENTICS.Aloha.Markup.prototype.toString=function(){return"GENTICS.Aloha.Markup"},GENTICS.Aloha.Markup=new GENTICS.Aloha.Markup,GENTICS.Aloha.Message=function(a){this.title=a.title,this.text=a.text,this.type=a.type,this.callback=a.callback},GENTICS.Aloha.Message.Type={CONFIRM:"confirm",ALERT:"alert",WAIT:"wait"},GENTICS.Aloha.Message.prototype.toString=function(){return this.type+": "+this.message},GENTICS.Aloha.MessageLine=function(){this.messages=[]},GENTICS.Aloha.MessageLine.prototype.add=function(a){this.messages[this.messages.length]=a;while(this.messages.length>4)this.messages.shift();jQuery("#gtx_aloha_messageline").html("");for(var b=0;b<this.messages.length;b++)jQuery("#gtx_aloha_messageline").append(this.messages[b].toString()+"<br/>")},GENTICS.Aloha.MessageLine=new GENTICS.Aloha.MessageLine,GENTICS.Aloha.PluginRegistry=function(){this.plugins=[]},GENTICS.Aloha.PluginRegistry.prototype.register=function(a){a instanceof GENTICS.Aloha.Plugin&&this.plugins.push(a)},GENTICS.Aloha.PluginRegistry.prototype.init=function(){for(var a=0;a<this.plugins.length;a++){var b=this.plugins[a];GENTICS.Aloha.settings.plugins==undefined&&(GENTICS.Aloha.settings.plugins={}),b.settings=GENTICS.Aloha.settings.plugins[b.prefix],b.settings==undefined&&(b.settings={}),b.settings.enabled==undefined&&(b.settings.enabled=!0);var c=b.languages?GENTICS.Aloha.getLanguage(GENTICS.Aloha.settings.i18n.current,b.languages):null;if(!c)GENTICS.Aloha.Log.warn(this,"Could not determine actual language, no languages available for plugin "+b);else{var d=GENTICS.Aloha.settings.base+"plugins/"+b.basePath+"/i18n/"+c+".dict";GENTICS.Aloha.loadI18nFile(d,b)}b.settings.enabled==!0&&this.plugins[a].init()}},GENTICS.Aloha.PluginRegistry.prototype.makeClean=function(a){for(var b=0;b<this.plugins.length;b++){var c=this.plugins[b];GENTICS.Aloha.Log.isDebugEnabled()&&GENTICS.Aloha.Log.debug(this,"Passing contents of HTML Element with id { "+a.attr("id")+" } for cleaning to plugin { "+c.prefix+" }"),c.makeClean(a)}},GENTICS.Aloha.PluginRegistry=new GENTICS.Aloha.PluginRegistry,GENTICS.Aloha.PluginRegistry.toString=function(){return"com.gentics.aloha.PluginRegistry"},GENTICS.Aloha.Plugin=function(a,b){this.prefix=a,this.basePath=b?b:a,GENTICS.Aloha.PluginRegistry.register(this)},GENTICS.Aloha.Plugin.prototype.settings=null,GENTICS.Aloha.Plugin.prototype.init=function(){},GENTICS.Aloha.Plugin.prototype.getEditableConfig=function(a){var b=[],c=!1;return this.settings.editables&&jQuery.each(this.settings.editables,function(d,e){a.is(d)&&(c=!0,b=jQuery.merge(b,e))}),c||(typeof this.settings.config=="undefined"||!this.settings.config?b=this.config:b=this.settings.config),b},GENTICS.Aloha.Plugin.prototype.makeClean=function(a){},GENTICS.Aloha.Plugin.prototype.getUID=function(a){return this.prefix+"."+a},GENTICS.Aloha.Plugin.prototype.i18n=function(a,b){return GENTICS.Aloha.i18n(this,a,b)},GENTICS.Aloha.Plugin.prototype.toString=function(){return this.prefix},GENTICS.Aloha.Plugin.prototype.log=function(a,b){GENTICS.Aloha.Log.log(a,this,b)},jQuery.fn.zap=function(){return this.each(function(){jQuery(this.childNodes).insertBefore(this)}).remove()},jQuery.fn.textNodes=function(a,b){var c=[];return function(d){if(d.nodeType==3&&jQuery.trim(d.data)!=""&&!b||d.nodeType==3&&b||d.nodeName=="BR"&&!a)c.push(d);else for(var e=0;e<d.childNodes.length;++e)arguments.callee(d.childNodes[e])}(this[0]),jQuery(c)},GENTICS.Aloha.Selection=function(){this.rangeObject=new Object,this.tagHierarchy={textNode:[],abbr:["textNode"],b:["textNode","b","i","em","sup","sub","br","span","img","a","del","ins","u","cite","q","code","abbr","strong"],pre:["textNode","b","i","em","sup","sub","br","span","img","a","del","ins","u","cite","q","code","abbr","code"],blockquote:["textNode","b","i","em","sup","sub","br","span","img","a","del","ins","u","cite","q","code","abbr","p","h1","h2","h3","h4","h5","h6"],ins:["textNode","b","i","em","sup","sub","br","span","img","a","u","p","h1","h2","h3","h4","h5","h6"],ul:["li"],ol:["li"],li:["textNode","b","i","em","sup","sub","br","span","img","ul","ol","h1","h2","h3","h4","h5","h6","del","ins","u"],tr:["td","th"],table:["tr"],div:["textNode","b","i","em","sup","sub","br","span","img","ul","ol","table","h1","h2","h3","h4","h5","h6","del","ins","u","p","div","pre","blockquote"],h1:["textNode","b","i","em","sup","sub","br","span","img","a","del","ins","u"]},this.tagHierarchy={textNode:this.tagHierarchy.textNode,abbr:this.tagHierarchy.abbr,br:this.tagHierarchy.textNode,img:this.tagHierarchy.textNode,b:this.tagHierarchy.b,strong:this.tagHierarchy.b,code:this.tagHierarchy.b,q:this.tagHierarchy.b,blockquote:this.tagHierarchy.blockquote,cite:this.tagHierarchy.b,i:this.tagHierarchy.b,em:this.tagHierarchy.b,sup:this.tagHierarchy.b,sub:this.tagHierarchy.b,span:this.tagHierarchy.b,del:this.tagHierarchy.del,ins:this.tagHierarchy.ins,u:this.tagHierarchy.b,p:this.tagHierarchy.b,pre:this.tagHierarchy.pre,a:this.tagHierarchy.b,ul:this.tagHierarchy.ul,ol:this.tagHierarchy.ol,li:this.tagHierarchy.li,td:this.tagHierarchy.li,div:this.tagHierarchy.div,h1:this.tagHierarchy.h1,h2:this.tagHierarchy.h1,h3:this.tagHierarchy.h1,h4:this.tagHierarchy.h1,h5:this.tagHierarchy.h1,h6:this.tagHierarchy.h1,table:this.tagHierarchy.table},this.replacingElements={h1:["p","h1","h2","h3","h4","h5","h6","pre"],blockquote:["blockquote"]},this.replacingElements={h1:this.replacingElements.h1
,h2:this.replacingElements.h1,h3:this.replacingElements.h1,h4:this.replacingElements.h1,h5:this.replacingElements.h1,h6:this.replacingElements.h1,pre:this.replacingElements.h1,p:this.replacingElements.h1,blockquote:this.replacingElements.blockquote},this.allowedToStealElements={h1:["textNode"]},this.allowedToStealElements={h1:this.allowedToStealElements.h1,h2:this.allowedToStealElements.h1,h3:this.allowedToStealElements.h1,h4:this.allowedToStealElements.h1,h5:this.allowedToStealElements.h1,h6:this.allowedToStealElements.h1,p:this.tagHierarchy.b}},GENTICS.Aloha.Selection.prototype.SelectionTree=function(){this.domobj=new Object,this.selection,this.children=[]},GENTICS.Aloha.Selection.prototype.onChange=function(a,b){this.updateSelectionTimeout&&(window.clearTimeout(this.updateSelectionTimeout),this.updateSelectionTimeout=undefined),this.updateSelectionTimeout=window.setTimeout(function(){GENTICS.Aloha.Selection.updateSelection(b)},5)},GENTICS.Aloha.Selection.prototype.updateSelection=function(a){var b=this.rangeObject=new GENTICS.Aloha.Selection.SelectionRange(!0);return b.update(),GENTICS.Aloha.FloatingMenu.setScope("GENTICS.Aloha.continuoustext"),GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("selectionChanged",GENTICS.Aloha,[b,a])),!0},GENTICS.Aloha.Selection.prototype.getSelectionTree=function(a){return a?a.commonAncestorContainer?(this.inselection=!1,GENTICS.Utils.Dom.doCleanup({mergetext:!0},a)&&(this.rangeObject.update(),this.rangeObject.select()),this.recursiveGetSelectionTree(a,a.commonAncestorContainer)):(GENTICS.Aloha.Log.error(this,"the rangeObject is missing the commonAncestorContainer"),!1):this.rangeObject.getSelectionTree()},GENTICS.Aloha.Selection.prototype.recursiveGetSelectionTree=function(a,b){var c=jQuery(b),d=0,e=this,f=[];return c.contents().each(function(c){var g="none",h=!1,i=!1,j=!1;a.isCollapsed()&&b===a.startContainer&&a.startOffset==c&&(f[d]=new GENTICS.Aloha.Selection.SelectionTree,f[d].selection="collapsed",f[d].domobj=undefined,e.inselection=!1,j=!0,d++);if(!e.inselection&&!j)switch(this.nodeType){case 3:this===a.startContainer&&(e.inselection=!0,g=a.startOffset>0?"partial":"full",h=a.startOffset,i=this.length);break;case 1:this===a.startContainer&&a.startOffset==0&&(e.inselection=!0,g="full"),b===a.startContainer&&a.startOffset==c&&(e.inselection=!0,g="full")}if(e.inselection&&!j){g=="none"&&(g="full");switch(this.nodeType){case 3:this===a.endContainer&&(e.inselection=!1,a.endOffset<this.length&&(g="partial"),h===!1&&(h=0),i=a.endOffset);break;case 1:this===a.endContainer&&a.endOffset==0&&(e.inselection=!1)}b===a.endContainer&&a.endOffset<=c&&(e.inselection=!1,g="none")}f[d]=new GENTICS.Aloha.Selection.SelectionTree,f[d].domobj=this,f[d].selection=g,g=="partial"&&(f[d].startOffset=h,f[d].endOffset=i),f[d].children=e.recursiveGetSelectionTree(a,this);if(f[d].children.length>0){var k=!1,l=!1,m=!1;for(var n=0;n<f[d].children.length;++n)switch(f[d].children[n].selection){case"none":k=!0;break;case"full":m=!0;break;case"partial":l=!0}l||m&&k?f[d].selection="partial":m&&!l&&!k&&(f[d].selection="full")}d++}),a.isCollapsed()&&b===a.startContainer&&a.startOffset==b.childNodes.length&&(f[d]=new GENTICS.Aloha.Selection.SelectionTree,f[d].selection="collapsed",f[d].domobj=undefined),f},GENTICS.Aloha.Selection.prototype.getRangeObject=function(){return this.rangeObject},GENTICS.Aloha.Selection.prototype.isRangeObjectWithinMarkup=function(a,b,c,d,e){domObj=b?a.endContainer:a.startContainer,typeof d!="undefined"&&typeof d!="function"&&GENTICS.Aloha.Log.error(this,"parameter tagComparator is not a function");var f=this;typeof d=="undefined"&&(d=function(a,b){return f.standardTextLevelSemanticsComparator(a,b)});var g=jQuery(domObj).parents(),h=!1,i=-1,f=this;return g.length>0&&g.each(function(){if(this===e)return GENTICS.Aloha.Log.debug(f,"reached limit dom obj"),!1;if(d(this,c))return h===!1&&(h=[]),GENTICS.Aloha.Log.debug(f,"reached object equal to markup"),i++,h[i]=this,!0}),h},GENTICS.Aloha.Selection.prototype.standardSectionsAndGroupingContentComparator=function(a,b){if(a.nodeType===1){if(b[0].tagName&&GENTICS.Aloha.Selection.replacingElements[a.tagName.toLowerCase()]&&GENTICS.Aloha.Selection.replacingElements[a.tagName.toLowerCase()].indexOf(b[0].tagName.toLowerCase())!=-1)return!0}else GENTICS.Aloha.Log.debug(this,"only element nodes (nodeType == 1) can be compared");return!1},GENTICS.Aloha.Selection.prototype.standardTextLevelSemanticsComparator=function(a,b){return a.nodeType===1?a.tagName.toLowerCase()!=b[0].tagName.toLowerCase()?!1:this.standardAttributesComparator(a,b)?!0:!1:(GENTICS.Aloha.Log.debug(this,"only element nodes (nodeType == 1) can be compared"),!1)},GENTICS.Aloha.Selection.prototype.standardAttributesComparator=function(a,b){if(a.attributes&&a.attributes.length&&a.attributes.length>0)for(var c=0;c<a.attributes.length;c++){var d=a.attributes[c];if(d.nodeName.toLowerCase()=="class"&&d.nodeValue.length>0)var e=d.nodeValue,f=e.split(" ")}if(b[0].attributes&&b[0].attributes.length&&b[0].attributes.length>0)for(var c=0;c<b[0].attributes.length;c++){var d=b[0].attributes[c];if(d.nodeName.toLowerCase()=="class"&&d.nodeValue.length>0)var e=d.nodeValue,g=e.split(" ")}if(f&&!g||g&&!f)return GENTICS.Aloha.Log.debug(this,"tag comparison for <"+a.tagName.toLowerCase()+"> failed because one element has classes and the other has not"),!1;if(f&&g&&f.length!=f.length)return GENTICS.Aloha.Log.debug(this,"tag comparison for <"+a.tagName.toLowerCase()+"> failed because of a different amount of classes"),!1;if(f&&g&&f.length==g.length&&f.length!=0)for(var c=0;c<f.length;c++)if(!b.hasClass(f[c]))return GENTICS.Aloha.Log.debug(this,"tag comparison for <"+a.tagName.toLowerCase()+"> failed because of different classes"),!1;return!0},GENTICS.Aloha.Selection.prototype.changeMarkup=function(a,b,c){var d=b[0].tagName.toLowerCase();if(this.replacingElements[d]){var e=a;a=new this.SelectionRange(a);if(GENTICS.Aloha.activeEditable)var f=GENTICS.Aloha.activeEditable.obj.get(0);else var f=document.body;a.update(f),b.isReplacingElement=!0}else if(a.isCollapsed())return GENTICS.Aloha.Log.debug(this,"early returning from applying markup because nothing is currently selected"),!1;if(GENTICS.Aloha.activeEditable)var g=GENTICS.Aloha.activeEditable.obj[0];else var g=document.body;var h=this.isRangeObjectWithinMarkup(a,!1,b,c,g),i=this.isRangeObjectWithinMarkup(a,!0,b,c,g);if(!b.isReplacingElement&&a.startOffset==0){var j;if(j=this.getTextNodeSibling(!1,a.commonAncestorContainer.parentNode,a.startContainer))var k=this.isRangeObjectWithinMarkup({startContainer:j,startOffset:0},!1,b,c,g)}if(!b.isReplacingElement&&a.endOffset==a.endContainer.length){var l;if(l=this.getTextNodeSibling(!0,a.commonAncestorContainer.parentNode,a.endContainer))var m=this.isRangeObjectWithinMarkup({startContainer:l,startOffset:0},!1,b,c,g)}if(!b.isReplacingElement&&h&&!i)GENTICS.Aloha.Log.info(this,"markup 2 non-markup"),this.prepareForRemoval(a.getSelectionTree(),b,c),jQuery(h).addClass("preparedForRemoval"),this.insertCroppedMarkups(h,a,!1,c);else if(!b.isReplacingElement&&h&&i)GENTICS.Aloha.Log.info(this,"markup 2 markup"),this.prepareForRemoval(a.getSelectionTree(),b,c),this.splitRelevantMarkupObject(h,i,a,c);else if(!b.isReplacingElement&&(!h&&i||m||k)){GENTICS.Aloha.Log.info(this,"non-markup 2 markup OR with next2markup");if(k&&m){var n=new GENTICS.Aloha.Selection.SelectionRange(a);n.startContainer=jQuery(k[k.length-1]).textNodes()[0],n.startOffset=0,n.endContainer=jQuery(m[m.length-1]).textNodes().last()[0],n.endOffset=n.endContainer.length,n.update(),this.applyMarkup(n.getSelectionTree(),a,b,c),GENTICS.Aloha.Log.info(this,"double extending previous markup(previous and after selection), actually wrapping it ...")}else if(k&&!m&&!i)this.extendExistingMarkupWithSelection(k,a,!1,c),GENTICS.Aloha.Log.info(this,"extending previous markup");else if(k&&!m&&i){var n=new GENTICS.Aloha.Selection.SelectionRange(a);n.startContainer=jQuery(k[k.length-1]).textNodes()[0],n.startOffset=0,n.endContainer=jQuery(i[i.length-1]).textNodes().last()[0],n.endOffset=n.endContainer.length,n.update(),this.applyMarkup(n.getSelectionTree(),a,b,c),GENTICS.Aloha.Log.info(this,"double extending previous markup(previous and relevant at the end), actually wrapping it ...")}else!k&&m?(this.extendExistingMarkupWithSelection(m,a,!0,c),GENTICS.Aloha.Log.info(this,"extending following markup backwards")):this.extendExistingMarkupWithSelection(i,a,!0,c)}else if(b.isReplacingElement||!h&&!i&&!k&&!m)GENTICS.Aloha.Log.info(this,"non-markup 2 non-markup"),this.applyMarkup(a.getSelectionTree(),a,b,c,{setRangeObject2NewMarkup:!0});jQuery(".preparedForRemoval").zap(),a.update(),b.isReplacingElement?e.select():a.select()},GENTICS.Aloha.Selection.prototype.areMarkupObjectsAsLongAsRangeObject=function(a,b,c){if(c.startOffset!==0)return!1;for(var d=0;d<a.length;d++){var e=a[d];if(jQuery(e).textNodes().first()[0]!==c.startContainer)return!1}for(var d=0;d<b.length;d++){var e=b[d];if(jQuery(e).textNodes().last()[0]!==c.endContainer||jQuery(e).textNodes().last()[0].length!=c.endOffset)return!1}return!0},GENTICS.Aloha.Selection.prototype.splitRelevantMarkupObject=function(a,b,c,d){jQuery(a).addClass("preparedForRemoval"),jQuery(b).addClass("preparedForRemoval");if(this.areMarkupObjectsAsLongAsRangeObject(a,b,c))return!0;var e=this.intersectRelevantMarkupObjects(a,b);return e?(this.insertCroppedMarkups([e],c,!1,d),this.insertCroppedMarkups([e],c,!0,d)):(this.insertCroppedMarkups(a,c,!1,d),this.insertCroppedMarkups(b,c,!0,d)),!0},GENTICS.Aloha.Selection.prototype.intersectRelevantMarkupObjects=function(a,b){var c=!1;if(!a||!b)return c;for(var d=0;d<a.length;d++){var e=a[d];for(var f=0;f<b.length;f++){var g=b[f];e===g&&(c=e)}}return c},GENTICS.Aloha.Selection.prototype.extendExistingMarkupWithSelection=function(a,b,c,d){if(!c)var e=!0;if(c)var f=!0;var g=[];for(var h=0;h<a.length;h++)g[h]=new this.SelectionRange,el=a[h],f&&!e&&(g[h].startContainer=b.startContainer,g[h].startOffset=b.startOffset,textnodes=jQuery(el).textNodes(!0),g[h].endContainer=textnodes[textnodes.length-1],g[h].endOffset=textnodes[textnodes.length-1].length,g[h].update(),this.applyMarkup(g[h].getSelectionTree(),b,this.getClonedMarkup4Wrapping(el),d,{setRangeObject2NewMarkup:!0})),!f&&e&&(textnodes=jQuery(el).textNodes(!0),g[h].startContainer=textnodes[0],g[h].startOffset=0,g[h].endContainer=b.endContainer,g[h].endOffset=b.endOffset,g[h].update(),this.applyMarkup(g[h].getSelectionTree(),b,this.getClonedMarkup4Wrapping(el),d,{setRangeObject2NewMarkup:!0}));return!0},GENTICS.Aloha.Selection.prototype.getClonedMarkup4Wrapping=function(a){var b=jQuery(a).clone().removeClass("preparedForRemoval").empty();return b.attr("class").length==0&&b.removeAttr("class"),b},GENTICS.Aloha.Selection.prototype.insertCroppedMarkups=function(a,b,c,d){if(!c)var e=!0;if(c)var f=!0;var g=[];for(var h=0;h<a.length;h++){g[h]=new this.SelectionRange;var i=a[h];if(e&&!f){var j=jQuery(i).textNodes(!0);g[h].startContainer=j[0],g[h].startOffset=0;if(g[h].startContainer===b.startContainer&&g[h].startOffset===b.startOffset)continue;b.startOffset==0?(g[h].endContainer=this.getTextNodeSibling(!1,i,b.startContainer),g[h].endOffset=g[h].endContainer.length):(g[h].endContainer=b.startContainer,g[h].endOffset=b.startOffset),g[h].update(),this.applyMarkup(g[h].getSelectionTree(),b,this.getClonedMarkup4Wrapping(i),d,{setRangeObject2NextSibling:!0})}!e&&f&&(g[h].startContainer=b.endContainer,g[h].startOffset=b.endOffset,textnodes=jQuery(i).textNodes(!0),g[h].endContainer=textnodes[textnodes.length-1],g[h].endOffset=textnodes[textnodes.length-1].length,g[h].update(),this.applyMarkup(g[h].getSelectionTree(),b,this.getClonedMarkup4Wrapping(i),d,{setRangeObject2PreviousSibling:!0}))}return!0},GENTICS.Aloha.Selection.prototype.changeMarkupOnSelection=function(a){this.changeMarkup(this.getRangeObject(),a,this.getStandardTagComparator(a)),GENTICS.Utils.Dom.doCleanup({mergetext:!0},this.rangeObject),this.rangeObject.update(),this.rangeObject.select()},GENTICS.Aloha.Selection.prototype.applyMarkup=function(a,b,c,d,e){e=e?e:new Object,this.prepareForRemoval(a,c,d);var f=this.optimizeSelectionTree4Markup(a,c,d);breakpoint=!0;for(var g=0;g<f.length;g++){var h=f[g];h.wrappable?this.wrapMarkupAroundSelectionTree(h.elements,b,c,d,e):(GENTICS.Aloha.Log.debug(this,"dive further into non-wrappable object"),this.applyMarkup(h.element.children,b,c,d,e))}},GENTICS.Aloha.Selection.prototype.getMarkupType=function(a){var b=jQuery(a)[0].nodeName.toLowerCase();a.outerHTML&&GENTICS.Aloha.Log.debug(this,"Node name detected: "+b+" for: "+a.outerHTML());if(b=="#text")return"textNode";if(this.replacingElements[b])return"sectionOrGroupingContent";if(this.tagHierarchy[b])return"textLevelSemantics";GENTICS.Aloha.Log.warn(this,"unknown markup passed to this.getMarkupType(...): "+a.outerHTML())},GENTICS.Aloha.Selection.prototype.getStandardTagComparator=function(a){var b=this;switch(this.getMarkupType(a)){case"textNode":return function(a,b){return!1};case"sectionOrGroupingContent":return function(a,c){return b.standardSectionsAndGroupingContentComparator(a,c)};case"textLevelSemantics":default:return function(a,c){return b.standardTextLevelSemanticsComparator(a,c)}}},GENTICS.Aloha.Selection.prototype.prepareForRemoval=function(a,b,c){var d=this;typeof c!="undefined"&&typeof c!="function"&&GENTICS.Aloha.Log.error(this,"parameter tagComparator is not a function"),typeof c=="undefined"&&(c=this.getStandardTagComparator(b));for(var e=0;e<a.length;e++){var f=a[e];f.domobj&&(f.selection=="full"||f.selection=="partial"&&b.isReplacingElement)&&f.domobj.nodeType===1&&c(f.domobj,b)&&(GENTICS.Aloha.Log.debug(this,"Marking for removal: "+f.domobj.nodeName),jQuery(f.domobj).addClass("preparedForRemoval")),f.selection!="none"&&f.children.length>0&&this.prepareForRemoval(f.children,b,c)}},GENTICS.Aloha.Selection.prototype.wrapMarkupAroundSelectionTree=function(a,b,c,d,e){var f=[],g=-1;GENTICS.Aloha.Log.debug(this,"The formatting <"+c[0].tagName+"> will be wrapped around the selection");var h="",i="";for(var j=0;j<a.length;j++){var k=a[j];if(k.domobj&&!this.canTag1WrapTag2(k.domobj.parentNode.tagName.toLowerCase(),c[0].tagName.toLowerCase())){GENTICS.Aloha.Log.info(this,"Skipping the wrapping of <"+c[0].tagName.toLowerCase()+"> because this tag is not allowed inside <"+k.domobj.parentNode.tagName.toLowerCase()+">");continue}if(k.domobj&&k.domobj.nodeType==3&&jQuery.trim(jQuery(k.domobj).outerHTML()).length==0)continue;if(k.domobj&&k.selection=="partial"&&!c.isReplacingElement)if(k.startOffset!==undefined&&k.endOffset===undefined)g++,h+=k.domobj.data.substr(0,k.startOffset),k.domobj.data=k.domobj.data.substr(k.startOffset,k.domobj.data.length-k.startOffset),f[g]=k.domobj;else if(k.endOffset!==undefined&&k.startOffset===undefined)g++,i+=k.domobj.data.substr(k.endOffset,k.domobj.data.length-k.endOffset),k.domobj.data=k.domobj.data.substr(0,k.endOffset),f[g]=k.domobj;else if(k.endOffset!==undefined&&k.startOffset!==undefined){if(k.startOffset==k.endOffset){GENTICS.Aloha.Log.debug(this,"skipping empty selection");continue}g++,h+=k.domobj.data.substr(0,k.startOffset);var l=k.domobj.data.substr(k.startOffset,k.endOffset-k.startOffset);i+=k.domobj.data.substr(k.endOffset,k.domobj.data.length-k.endOffset),k.domobj.data=l,f[g]=k.domobj}else GENTICS.Aloha.Log.debug(this,"diving into object"),this.applyMarkup(k.children,b,c,d,e);k.domobj&&(k.selection=="full"||k.selection=="partial"&&c.isReplacingElement)&&(g++,f[g]=k.domobj)}n=!0;if(f.length>0){f=jQuery(f),jQuery.each(f,function(a,b){jQuery.browser.msie&&b.nodeType==3&&!b.nextSibling&&!b.previousSibling&&b.parentNode&&b.parentNode.nodeName.toLowerCase()=="li"&&(b.data=jQuery.trim(b.data))});var m=f.wrapAll(c).parent();m.before(h).after(i);var n=!0;if(e.setRangeObject2NewMarkup){var o=f.textNodes();o.index(b.startContainer)!=-1&&(b.startOffset=0),o.index(b.endContainer)!=-1&&(b.endOffset=b.endContainer.length);var n=!0}if(e.setRangeObject2NextSibling){var p=!0,q=m.textNodes(!0).last()[0];f.index(b.startContainer)!=-1&&(b.startContainer=this.getTextNodeSibling(p,m.parent(),q),b.startOffset=0),f.index(b.endContainer)!=-1&&(b.endContainer=this.getTextNodeSibling(p,m.parent(),q),b.endOffset=b.endOffset-q.length)}if(e.setRangeObject2PreviousSibling){var p=!1,q=m.textNodes(!0).first()[0];f.index(b.startContainer)!=-1&&(b.startContainer=this.getTextNodeSibling(p,m.parent(),q),b.startOffset=0),f.index(b.endContainer)!=-1&&(b.endContainer=this.getTextNodeSibling(p,m.parent(),q),b.endOffset=b.endContainer.length)}}},GENTICS.Aloha.Selection.prototype.getTextNodeSibling=function(a,b,c){var d=jQuery(b).textNodes(!0);index=d.index(c);if(index==-1)return!1;var e=index+(a?1:-1);return d[e]?d[e]:!1},GENTICS.Aloha.Selection.prototype.optimizeSelectionTree4Markup=function(a,b,c){var d=[],e=0,f=0,g=this;typeof c=="undefined"&&(c=function(a,b){return g.standardTextLevelSemanticsComparator(b)});for(var h=0;h<a.length;h++)if(a[h].domobj&&a[h].selection!="none")if(b.isReplacingElement&&c(b[0],jQuery(a[h].domobj)))d[e]!==undefined&&e++,d[e]=new Object,d[e].wrappable=!0,d[e].elements=[],d[e].elements[f]=a[h],e++;else if(this.canMarkupBeApplied2ElementAsWhole([a[h]],b)){d[e]===undefined&&(d[e]=new Object,d[e].wrappable=!0,d[e].elements=[]);if(b.isReplacingElement){var i=h;for(var j=h-1;j>=0;j--)if(this.canMarkupBeApplied2ElementAsWhole([a[j]],b)&&this.isMarkupAllowedToStealSelectionTreeElement(a[j],b))i=j;else break;var k=h;for(var j=h+1;j<a.length;j++)if(this.canMarkupBeApplied2ElementAsWhole([a[j]],b)&&this.isMarkupAllowedToStealSelectionTreeElement(a[j],b))k=j;else break;f=0;for(var j=i;j<=k;j++)d[e].elements[f]=a[j],d[e].elements[f].selection="full",f++;f=0}else d[e].elements[f]=a[h],f++}else d[e]!==undefined&&e++,d[e]=new Object,d[e].wrappable=!1,d[e].element=a[h],f=0,e++;return d},GENTICS.Aloha.Selection.prototype.isMarkupAllowedToStealSelectionTreeElement=function(a,b){if(!a.domobj)return!1;var c=a.domobj.nodeName.toLowerCase();c=c=="#text"?"textNode":c;var d=b[0].nodeName.toLowerCase();return this.allowedToStealElements[d]?this.allowedToStealElements[d].indexOf(c)==-1?!1:!0:!1},GENTICS.Aloha.Selection.prototype.canMarkupBeApplied2ElementAsWhole=function(a,b){b.jquery&&(htmlTag=b[0].tagName),b.tagName&&(htmlTag=b.tagName),returnVal=!0;for(var c=0;c<a.length;c++){var d=a[c];if(d.domobj&&(d.selection!="none"||b.isReplacingElement)){if(!this.canTag1WrapTag2(htmlTag,d.domobj.nodeName))return!1;if(d.children.length>0&&!this.canMarkupBeApplied2ElementAsWhole(d.children,b))return!1}}return returnVal},GENTICS.Aloha.Selection.prototype.canTag1WrapTag2=function(a,b){a=a=="#text"?"textNode":a.toLowerCase(),b=b=="#text"?"textNode":b.toLowerCase();if(!this.tagHierarchy[a])return!0;if(!this.tagHierarchy[b])return!0;var c=this.tagHierarchy[a],d=c.indexOf(b)!=-1?!0:!1;return d},GENTICS.Aloha.Selection.prototype.mayInsertTag=function(a){if(typeof this.rangeObject.unmodifiableMarkupAtStart=="object"){for(var b=0;b<this.rangeObject.unmodifiableMarkupAtStart.length;++b)if(!this.canTag1WrapTag2(this.rangeObject.unmodifiableMarkupAtStart[b].nodeName,a))return!1;return!0}return GENTICS.Aloha.Log.warn(this,"Unable to determine whether tag "+a+" may be inserted"),!0},GENTICS.Aloha.Selection.prototype.toString=function(){return"GENTICS.Aloha.Selection"},GENTICS.Aloha.Selection.prototype.SelectionRange=function(a){GENTICS.Utils.RangeObject.apply(this,arguments),this.commonAncestorContainer,this.selectionTree,this.markupEffectiveAtStart=[],this.unmodifiableMarkupAtStart=[],this.limitObject,this.splitObject,a&&(a.commonAncestorContainer&&(this.commonAncestorContainer=a.commonAncestorContainer),a.selectionTree&&(this.selectionTree=a.selectionTree),a.limitObject&&(this.limitObject=a.limitObject),a.markupEffectiveAtStart&&(this.markupEffectiveAtStart=a.markupEffectiveAtStart),a.unmodifiableMarkupAtStart&&(this.unmodifiableMarkupAtStart=a.unmodifiableMarkupAtStart),a.splitObject&&(this.splitObject=a.splitObject))},GENTICS.Aloha.Selection.prototype.SelectionRange.prototype=new GENTICS.Utils.RangeObject,GENTICS.Aloha.Selection.prototype.SelectionRange.prototype.select=function(){GENTICS.Utils.RangeObject.prototype.select.apply(this,arguments),GENTICS.Aloha.Selection.updateSelection()},GENTICS.Aloha.Selection.prototype.SelectionRange.prototype.update=function(a){this.updatelimitObject(),this.updateMarkupEffectiveAtStart(),this.updateCommonAncestorContainer(a),this.selectionTree=undefined},GENTICS.Aloha.Selection.prototype.SelectionRange.prototype.getSelectionTree=function(){return this.selectionTree||(this.selectionTree=GENTICS.Aloha.Selection.getSelectionTree(this)),this.selectionTree},GENTICS.Aloha.Selection.prototype.SelectionRange.prototype.getSelectedSiblings=function(a){var b=this.getSelectionTree();return this.recursionGetSelectedSiblings(a,b)},GENTICS.Aloha.Selection.prototype.SelectionRange.prototype.recursionGetSelectedSiblings=function(a,b){var c=!1,d=!1;for(var e=0;e<b.length;++e)if(b[e].domobj===a)d=!0,c=[];else if(!d&&b[e].children){c=this.recursionGetSelectedSiblings(a,b[e].children);if(c!==!1)break}else if(d&&b[e].domobj&&b[e].selection!="collapsed"&&b[e].selection!="none")c.push(b[e].domobj);else if(d&&b[e].selection=="none")break;return c},GENTICS.Aloha.Selection.prototype.SelectionRange.prototype.updateMarkupEffectiveAtStart=function(){this.markupEffectiveAtStart=[],this.unmodifiableMarkupAtStart=[];var a=this.getStartContainerParents(),b=!1;for(var c=0;c<a.length;c++){var d=a[c];if(!b&&d!==this.limitObject){this.markupEffectiveAtStart[c]=d;if(!e&&GENTICS.Utils.Dom.isSplitObject(d)){var e=!0;this.splitObject=d}}else b=!0,this.unmodifiableMarkupAtStart.push(d)}e||(this.splitObject=!1);return},GENTICS.Aloha.Selection.prototype.SelectionRange.prototype.updatelimitObject=function(){if(GENTICS.Aloha.editables&&GENTICS.Aloha.editables.length>0){var a=this.getStartContainerParents(),b=GENTICS.Aloha.editables;for(var c=0;c<a.length;c++){var d=a[c];for(var e=0;e<b.length;e++){var f=b[e].obj[0];if(d===f)return this.limitObject=d,!0}}}return this.limitObject=document.body,!0},GENTICS.Aloha.Selection.prototype.SelectionRange.prototype.toString=function(a){return a?"GENTICS.Aloha.Selection.SelectionRange {start ["+this.startContainer.nodeValue+"] offset "+this.startOffset+", end ["+this.endContainer.nodeValue+"] offset "+this.endOffset+"}":"GENTICS.Aloha.Selection.SelectionRange"},GENTICS.Aloha.Selection=new GENTICS.Aloha.Selection,GENTICS.Aloha.Sidebar=function(){},GENTICS.Aloha.Sidebar.prototype.add=function(a){},GENTICS.Aloha.Sidebar.prototype.render=function(){},GENTICS.Aloha.Sidebar.prototype.openPanel=function(a){},GENTICS.Aloha.Sidebar.prototype.closePanel=function(a){},GENTICS.Aloha.Sidebar.prototype.togglePinPanel=function(a){},GENTICS.Aloha.SidebarRight=new GENTICS.Aloha.Sidebar,GENTICS.Aloha.SidebarLeft=new GENTICS.Aloha.Sidebar,GENTICS.Aloha.Sidebar.Panel=function(){},GENTICS.Aloha.Sidebar.Panel.prototype.render=function(){},GENTICS.Aloha.RepositoryManager=function(){this.repositories=[]},GENTICS.Aloha.RepositoryManager.prototype.openCallbacks=[],GENTICS.Aloha.RepositoryManager.prototype.init=function(){GENTICS.Aloha.settings.repositories==undefined&&(GENTICS.Aloha.settings.repositories={});for(var a=0;a<this.repositories.length;a++){var b=this.repositories[a];b.settings==undefined&&(b.settings={}),GENTICS.Aloha.settings.repositories[b.repositoryId]&&jQuery.extend(b.settings,GENTICS.Aloha.settings.repositories[b.repositoryId]),b.init()}},GENTICS.Aloha.RepositoryManager.prototype.register=function(a){a instanceof GENTICS.Aloha.Repository?this.getRepository(a.repositoryId)?GENTICS.Aloha.Log.warn(this,"A repository with name { "+a.repositoryId+" } already registerd. Ignoring this."):this.repositories.push(a):GENTICS.Aloha.Log.error(this,"Trying to register a repository which is not an instance of GENTICS.Aloha.Repository.")},GENTICS.Aloha.RepositoryManager.prototype.getRepository=function(a){for(var b=0;b<this.repositories.length;b++)if(this.repositories[b].repositoryId==a)return this.repositories[b];return null},GENTICS.Aloha.RepositoryManager.prototype.query=function(a,b){var c=this,d=[],e=[];this.openCallbacks=[];var f=setTimeout(function(){c.openCallbacks=[],c.queryCallback(b,d,f)},5e3);a.repositoryId?e.push(this.getRepository(a.repositoryId)):e=this.repositories;for(var g=0;g<e.length;g++){this.openCallbacks.push(e[g].repositoryId);try{var h=e[g].query(a,function(a){var e=c.openCallbacks.indexOf(this.repositoryId);e!=-1&&c.openCallbacks.splice(e,1);if(!a.length==0&&!a[0].repositoryId)for(var g=0;g<a.length;g++)a[g].repositoryId=this.repositoryId;jQuery.merge(d,a),c.queryCallback(b,d,f)})}catch(i){h=!0}if(h){var j=c.openCallbacks.indexOf(e[g].repositoryId);j!=-1&&(this.openCallbacks.splice(j,1),g==e.length-1&&this.queryCallback(b,d,f))}}},GENTICS.Aloha.RepositoryManager.prototype.queryCallback=function(a,b,c){if(this.openCallbacks.length==0){clearTimeout(c),b.sort(function(a,b){return b.weight-a.weight});var d={results:b.length,items:b};a.call(this,d)}},GENTICS.Aloha.RepositoryManager.prototype.getChildren=function(a,b){var c=this,d=[],e=[];this.openChildrenCallbacks=[];if(a.inFolderId=="aloha"&&this.repositories.length>0){var f=[];for(var g=0;g<this.repositories.length;g++)f.push(new GENTICS.Aloha.Repository.Folder({id:this.repositories[g].repositoryId,name:this.repositories[g].repositoryName,repositoryId:this.repositories[g].repositoryId,type:"repository",hasMoreItems:!0}));c.getChildrenCallback(b,f,null);return}var h=setTimeout(function(){c.openChildrenCallbacks=[],c.getChildrenCallback(b,d,h)},5e3);a.repositoryId?e.push(this.getRepository(a.repositoryId)):e=this.repositories;for(var g=0;g<e.length;g++){this.openChildrenCallbacks.push(e[g].repositoryId);try{var i=e[g].getChildren(a,function(a){var e=c.openChildrenCallbacks.indexOf(this.repositoryId);e!=-1&&c.openChildrenCallbacks.splice(e,1),jQuery.merge(d,a),c.getChildrenCallback(b,d,h)})}catch(j){i=!0}if(i){var k=c.openChildrenCallbacks.indexOf(e[g].repositoryId);k!=-1&&(this.openChildrenCallbacks.splice(k,1),g==e.length-1&&this.getChildrenCallback(b,d,h))}}},GENTICS.Aloha.RepositoryManager.prototype.getChildrenCallback=function(a,b,c){this.openChildrenCallbacks.length==0&&(c&&clearTimeout(c),a.call(this,b))},GENTICS.Aloha.RepositoryManager.prototype.makeClean=function(a){var b=this,c={};a.find("[data-GENTICS-aloha-repository="+this.prefix+"]").each(function(){for(var d=0;d<b.repositories.length;d++)c.makeClean(a);GENTICS.Aloha.Log.debug(b,"Passing contents of HTML Element with id { "+this.attr("id")+" } for cleaning to repository { "+c.repositoryId+" }"),c.makeClean(this)})},GENTICS.Aloha.RepositoryManager.prototype.markObject=function(a,b){var c=this.getRepository(b.repositoryId);c?(jQuery(a).attr("data-GENTICS-aloha-repository",b.repositoryId),jQuery(a).attr("data-GENTICS-aloha-object-id",b.id),c.markObject(a,b)):GENTICS.Aloha.Log.error(this,"Trying to apply a repository { "+b.name+" } to an object, but item has no repositoryId.")},GENTICS.Aloha.RepositoryManager=new GENTICS.Aloha.RepositoryManager,GENTICS.Aloha.RepositoryManager.toString=function(){return"com.gentics.aloha.RepositoryManager"},GENTICS.Aloha.Repository=function(a,b){this.repositoryId=a,this.settings={},this.repositoryName=b?b:a,GENTICS.Aloha.RepositoryManager.register(this)},GENTICS.Aloha.Repository.prototype.init=function(){},GENTICS.Aloha.Repository.prototype.query=function(a,b){return!0},GENTICS.Aloha.Repository.prototype.getChildren=function(a,b){return!0},GENTICS.Aloha.Repository.prototype.makeClean=function(a){},GENTICS.Aloha.Repository.prototype.markObject=function(a,b){},GENTICS.Aloha.Repository.Document=function(a){var b=a;this.type="document";if(!b.id||!b.name||!b.repositoryId)return;GENTICS.Utils.applyProperties(this,a),this.baseType="document"},GENTICS.Aloha.Repository.Folder=function(a){var b=a;this.type="folder";if(!b.id||!b.name||!b.repositoryId)return;GENTICS.Utils.applyProperties(this,a),this.baseType="folder"},jQuery.cookie=function(a,b,c){if(typeof b=="undefined"){var i=null;if(document.cookie&&document.cookie!=""){var j=document.cookie.split(";");for(var k=0;k<j.length;k++){var l=jQuery.trim(j[k]);if(l.substring(0,a.length+1)==a+"="){i=decodeURIComponent(l.substring(a.length+1));break}}}return i}c=c||{},b===null&&(b="",c.expires=-1);var d="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){var e;typeof c.expires=="number"?(e=new Date,e.setTime(e.getTime()+c.expires*24*60*60*1e3)):e=c.expires,d="; expires="+e.toUTCString()}var f=c.path?"; path="+c.path:"",g=c.domain?"; domain="+c.domain:"",h=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),d,f,g,h].join("")},GENTICS.Aloha.Format=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Format"),GENTICS.Aloha.Format.languages=["en","de","fr","eo","fi","ru","it","pl"],GENTICS.Aloha.Format.config=["b","i","del","sub","sup","p","h1","h2","h3","h4","h5","h6","pre","removeFormat"],GENTICS.Aloha.Format.init=function(){this.initButtons();var a=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(b,c){a.applyButtonConfig(c.editable.obj)})},GENTICS.Aloha.Format.applyButtonConfig=function(a){config=this.getEditableConfig(a);for(var b in this.buttons)jQuery.inArray(b,config)!=-1?this.buttons[b].button.show():this.buttons[b].button.hide();for(var c in this.multiSplitItems)jQuery.inArray(this.multiSplitItems[c].name,config)!=-1?this.multiSplitButton.extButton.showItem(this.multiSplitItems[c].name):this.multiSplitButton.extButton.hideItem(this.multiSplitItems[c].name)},GENTICS.Aloha.Format.initButtons=function(){var a="GENTICS.Aloha.continuoustext";this.buttons={};var b=this;this.multiSplitItems=[],this.multiSplitButton,jQuery.each(GENTICS.Aloha.Format.config,function(c,d){switch(d){case"b":case"i":case"cite":case"q":case"code":case"abbr":case"del":case"sub":case"sup":b.buttons[d]={button:new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_"+d,size:"small",onclick:function(){GENTICS.Aloha.activeEditable&&GENTICS.Aloha.activeEditable.obj[0].focus();var a=jQuery("<"+d+"></"+d+">"),b=GENTICS.Aloha.Selection.rangeObject,c=b.findMarkup(function(){return this.nodeName.toLowerCase()==a.get(0).nodeName.toLowerCase()},GENTICS.Aloha.activeEditable.obj);return c?b.isCollapsed()?GENTICS.Utils.Dom.removeFromDOM(c,b,!0):GENTICS.Utils.Dom.removeMarkup(b,a,GENTICS.Aloha.activeEditable.obj):(b.isCollapsed()&&GENTICS.Utils.Dom.extendToWord(b),GENTICS.Utils.Dom.addMarkup(b,a)),b.select(),!1},tooltip:b.i18n("button."+d+".tooltip"),toggle:!0}),markup:jQuery("<"+d+"></"+d+">")},GENTICS.Aloha.FloatingMenu.addButton(a,b.buttons[d].button,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1);break;case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"pre":b.multiSplitItems.push({name:d,tooltip:b.i18n("button."+d+".tooltip"),iconClass:"GENTICS_button "+b.i18n("GENTICS_button_"+d),markup:jQuery("<"+d+"></"+d+">"),click:function(){GENTICS.Aloha.activeEditable&&GENTICS.Aloha.activeEditable.obj[0].focus(),GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+d+"></"+d+">"))}});break;case"removeFormat":b.multiSplitItems.push({name:d,text:b.i18n("button."+d+".text"),tooltip:b.i18n("button."+d+".tooltip"),iconClass:"GENTICS_button GENTICS_button_"+d,wide:!0,click:function(){GENTICS.Aloha.Format.removeFormat()}});break;default:GENTICS.Aloha.log("warn",this,'Button "'+d+'" is not defined')}}),this.multiSplitItems.length>0&&(this.multiSplitButton=new GENTICS.Aloha.ui.MultiSplitButton({items:this.multiSplitItems}),GENTICS.Aloha.FloatingMenu.addButton(a,this.multiSplitButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),3)),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(a,c){jQuery.each(b.buttons,function(a,b){for(var d=0;d<c.markupEffectiveAtStart.length;d++){var e=c.markupEffectiveAtStart[d];if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(e,b.markup)){b.button.setPressed(!0);var f=!0}}f||b.button.setPressed(!1)});if(b.multiSplitItems.length>0){var d=!1;for(var e=0;e<c.markupEffectiveAtStart.length&&!d;e++){var f=c.markupEffectiveAtStart[e];for(var g=0;g<b.multiSplitItems.length&&!d;g++){var h=b.multiSplitItems[g];if(!h.markup)continue;GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(f,h.markup)&&(b.multiSplitButton.setActiveItem(h.name),d=!0)}}d||b.multiSplitButton.setActiveItem(null)}})},GENTICS.Aloha.Format.removeFormat=function(){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<p></p>"));var a=["b","i","cite","q","code","abbr","del","sub","sup"],b=GENTICS.Aloha.Selection.rangeObject,c=jQuery(b.startContainer),d=jQuery(b.limitObject);if(b.isCollapsed()||c===d)return;var e=c.parent();while(
e.get(0)!==d.get(0)){var f=a.indexOf(e.get(0).nodeName.toLowerCase());e=e.parent(),f!=-1&&(GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+a[f]+"></"+a[f]+">")),a.splice(f,1))}for(var g in a)GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+a[g]+"></"+a[g]+">")),GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<"+a[g]+"></"+a[g]+">"))},GENTICS.Aloha.Format.toString=function(){return"com.gentics.aloha.plugins.Format"},GENTICS.Aloha.PastePlugin=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Paste"),GENTICS.Aloha.PastePlugin.pasteHandlers=[],GENTICS.Aloha.PastePlugin.init=function(){var a=this;this.pasteDiv=jQuery('<div style="position:absolute; top:-100000px; left:-100000px"></div>'),this.pasteDiv.attr("contentEditable","true"),jQuery("body").append(this.pasteDiv),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableCreated",function(b,c){jQuery.browser.msie?c.obj.bind("beforepaste",function(b){a.redirectPaste()}):c.obj.bind("paste",function(b){a.redirectPaste(),window.setTimeout(function(){a.getPastedContent()},10)})}),jQuery.browser.msie&&this.pasteDiv.bind("paste",function(b){window.setTimeout(function(){a.getPastedContent()},10)})},GENTICS.Aloha.PastePlugin.redirectPaste=function(){this.currentRange=new GENTICS.Utils.RangeObject(!0),this.currentEditable=GENTICS.Aloha.activeEditable,this.pasteDiv.text(""),this.currentEditable&&this.currentEditable.blur(),GENTICS.Utils.Dom.setCursorInto(this.pasteDiv.get(0)),this.pasteDiv.focus()},GENTICS.Aloha.PastePlugin.getPastedContent=function(){var a=this;for(var b=0;b<this.pasteHandlers.length;++b)this.pasteHandlers[b].handlePaste(this.pasteDiv);if(this.currentRange&&this.currentEditable){var c=this.pasteDiv.contents();for(var b=c.length-1;b>=0;--b)GENTICS.Utils.Dom.insertIntoDOM(jQuery(c.get(b)),a.currentRange,a.currentEditable.obj,!1);this.currentEditable.activate(),this.currentEditable.obj.focus(),c.length>0?GENTICS.Utils.Dom.setCursorAfter(c.get(c.length-1)):this.currentRange.select()}this.currentRange=!1,this.currentEditable=!1,this.pasteDiv.text("")},GENTICS.Aloha.PastePlugin.register=function(a){this.pasteHandlers.push(a)},GENTICS.Aloha.PastePlugin.PasteHandler=function(){GENTICS.Aloha.PastePlugin.register(this)},GENTICS.Aloha.PastePlugin.PasteHandler.prototype.handlePaste=function(a){},GENTICS.Aloha.PastePlugin.WordPasteHandler=new GENTICS.Aloha.PastePlugin.PasteHandler,GENTICS.Aloha.PastePlugin.WordPasteHandler.handlePaste=function(a){this.detectWordContent(a)&&this.transformWordContent(a)},GENTICS.Aloha.PastePlugin.WordPasteHandler.detectWordContent=function(a){var b=!1;return a.find("*").each(function(){var a=jQuery(this).attr("style");if(a&&a.toLowerCase().indexOf("mso")>=0)return b=!0,!1;var c=jQuery(this).attr("class");if(c&&c.toLowerCase().indexOf("mso")>=0)return b=!0,!1}),b},GENTICS.Aloha.PastePlugin.WordPasteHandler.isOrderedList=function(a){return a.css("fontFamily")=="Wingdings"?!1:a.text().match(/^\(?[0-9a-cA-C]/)?!0:!1},GENTICS.Aloha.PastePlugin.WordPasteHandler.transformListsFromWord=function(a){var b=this;a.find("p.MsoListParagraphCxSpFirst,p.MsoListParagraph").each(function(){var a=jQuery(this);a.find("font").each(function(){jQuery(this).contents().unwrap()});var c=0,d=parseFloat(a.css("marginLeft")),e=[],f=a.nextUntil(":not(p.MsoListParagraphCxSpMiddle,p.MsoListParagraphCxSpLast)"),g=jQuery(a.children("span:first")),h=b.isOrderedList(g);g.remove();var i=jQuery(h?"<ol></ol>":"<ul></ul>");e.push(i);var j=jQuery("<li></li>");i.append(j),a.contents().appendTo(j),a.replaceWith(i),f.each(function(){var a=jQuery(this);a.find("font").each(function(){jQuery(this).contents().unwrap()});var f=parseFloat(a.css("marginLeft"));g=jQuery(a.children("span:first")),h=b.isOrderedList(g),g.remove();if(f>d){var k=jQuery(h?"<ol></ol>":"<ul></ul>");i.children(":last").append(k),i=k,e.push(i),c++,d=f}else f<d&&c>0&&(e.pop(),c--,i=e[c],d=f);j=jQuery("<li></li>"),i.append(j),a.contents().appendTo(j),a.remove()})})},GENTICS.Aloha.PastePlugin.WordPasteHandler.transformTitles=function(a){a.find("p.MsoTitle").each(function(){GENTICS.Aloha.Markup.transformDomObject(jQuery(this),"h1")}),a.find("p.MsoSubtitle").each(function(){GENTICS.Aloha.Markup.transformDomObject(jQuery(this),"h2")})},GENTICS.Aloha.PastePlugin.WordPasteHandler.transformTables=function(a){a.find("table").each(function(){jQuery(this).removeAttr("border").removeAttr("cellspacing").removeAttr("cellpadding")}),a.find("td").each(function(){jQuery(this).removeAttr("width").removeAttr("height").removeAttr("valign")})},GENTICS.Aloha.PastePlugin.WordPasteHandler.transformFormattings=function(a){a.find("strong,em,s,u").each(function(){this.nodeName.toLowerCase()=="strong"?GENTICS.Aloha.Markup.transformDomObject(jQuery(this),"b"):this.nodeName.toLowerCase()=="em"?GENTICS.Aloha.Markup.transformDomObject(jQuery(this),"i"):this.nodeName.toLowerCase()=="s"?GENTICS.Aloha.Markup.transformDomObject(jQuery(this),"del"):this.nodeName.toLowerCase()=="u"&&jQuery(this).contents().unwrap()})},GENTICS.Aloha.PastePlugin.WordPasteHandler.removeComments=function(a){a.contents().each(function(){this.nodeType==8&&jQuery(this).remove()})},GENTICS.Aloha.PastePlugin.WordPasteHandler.unwrapTags=function(a){a.find("span,font,div").each(function(){jQuery(this).contents().unwrap()})},GENTICS.Aloha.PastePlugin.WordPasteHandler.removeStyles=function(a){a.find("*").each(function(){jQuery(this).removeAttr("style").removeClass()})},GENTICS.Aloha.PastePlugin.WordPasteHandler.removeNamespacedElements=function(a){a.find("*").each(function(){var a=this.prefix?this.prefix:this.scopeName?this.scopeName:undefined;a&&a!="HTML"&&jQuery(this).remove()})},GENTICS.Aloha.PastePlugin.WordPasteHandler.transformWordContent=function(a){this.transformListsFromWord(a),this.transformTables(a),this.transformTitles(a),this.removeComments(a),this.unwrapTags(a),this.removeStyles(a),this.removeNamespacedElements(a),this.transformFormattings(a)},GENTICS.Aloha.LinkChecker=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.LinkChecker"),GENTICS.Aloha.LinkChecker.languages=["en"],GENTICS.Aloha.LinkChecker.errorCodes=[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,500,501,502,503,504,505,506],GENTICS.Aloha.LinkChecker.warningCodes=[404,411,412,413,500,503,504,505],GENTICS.Aloha.LinkChecker.init=function(){this.proxyUrl=null,GENTICS.Aloha.LinkChecker.settings.proxyUrl!=undefined&&(this.proxyUrl=GENTICS.Aloha.LinkChecker.settings.proxyUrl),this.timer={},this.xhr={};var a=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(b,c){c.editable.obj.find("a").each(function(){a.checkLink(this,jQuery(this).attr("href"),0)})}),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableDeactivated",function(b,c){a.makeClean(c.editable.obj)}),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"hrefChanged",function(b,c){a.checkLink(c.obj,"hrefChanged")})},GENTICS.Aloha.LinkChecker.checkLink=function(a,b,c,d){var e=this,f=jQuery(a).attr("href"),g=f;if(typeof f=="string"&&!/^http/.test(f.toLowerCase())){this.makeCleanLink(a);return}this.proxyUrl&&(f=this.proxyUrl+f),this.xhr[b]&&(this.xhr[b].abort(),this.xhr[b]=undefined),this.timer[b]=this.urlExists(f,function(b){e.makeCleanLink(a)},function(b){if(a){if(jQuery.inArray(b.status,e.errorCodes)>=0)var c=b.status;else var c="0";var d=jQuery(a);d.attr("title")&&!d.attr("data-invalid")&&d.attr("data-title",d.attr("title")),d.attr("data-invalid","true"),d.attr("title",g+". "+e.i18n("error."+c)),jQuery.inArray(b.status,e.warningCodes)>=0?d.addClass("GENTICS_link_warn"):d.addClass("GENTICS_link_error")}},b,d,c)},GENTICS.Aloha.LinkChecker.urlExists=function(a,b,c,d,e,f){var g=this;clearTimeout(this.timer[d]),f=f!=null&&f!=undefined?f:700;var h=setTimeout(function(){g.xhr[d]=jQuery.ajax({url:a,timeout:e?1e4:e,type:"HEAD",complete:function(a){clearTimeout(h);try{a.status<400?b.call(this,a):c.call(this,a)}catch(d){c.call(this,{status:0})}}})},f);return h},GENTICS.Aloha.LinkChecker.makeCleanLink=function(a){if(a){var b=jQuery(a);b.attr("data-title")?b.attr("title",b.attr("data-title")):b.removeAttr("title"),b.removeAttr("data-title"),b.removeAttr("data-invalid"),b.removeClass("GENTICS_link_error"),b.removeClass("GENTICS_link_warn")}},GENTICS.Aloha.LinkChecker.makeClean=function(a){var b=this;a.find("a").each(function(){b.makeCleanLink(this)})},GENTICS.Aloha.LinkChecker.urlencode=function(a){return a=(a+"").toString(),encodeURIComponent(a).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},GENTICS.Aloha.Link=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Link"),GENTICS.Aloha.Link.languages=["en","de","fr","ru","pl"],GENTICS.Aloha.Link.config=["a"],GENTICS.Aloha.Link.targetregex="",GENTICS.Aloha.Link.target="",GENTICS.Aloha.Link.cssclassregex="",GENTICS.Aloha.Link.cssclass="",GENTICS.Aloha.Link.objectTypeFilter=[],GENTICS.Aloha.Link.onHrefChange=null,GENTICS.Aloha.Link.init=function(){GENTICS.Aloha.Link.settings.targetregex!=undefined&&(GENTICS.Aloha.Link.targetregex=GENTICS.Aloha.Link.settings.targetregex),GENTICS.Aloha.Link.settings.target!=undefined&&(GENTICS.Aloha.Link.target=GENTICS.Aloha.Link.settings.target),GENTICS.Aloha.Link.settings.cssclassregex!=undefined&&(GENTICS.Aloha.Link.cssclassregex=GENTICS.Aloha.Link.settings.cssclassregex),GENTICS.Aloha.Link.settings.cssclass!=undefined&&(GENTICS.Aloha.Link.cssclass=GENTICS.Aloha.Link.settings.cssclass),GENTICS.Aloha.Link.settings.objectTypeFilter!=undefined&&(GENTICS.Aloha.Link.objectTypeFilter=GENTICS.Aloha.Link.settings.objectTypeFilter),GENTICS.Aloha.Link.settings.onHrefChange!=undefined&&(GENTICS.Aloha.Link.onHrefChange=GENTICS.Aloha.Link.settings.onHrefChange),this.createButtons(),this.subscribeEvents(),this.bindInteractions()},GENTICS.Aloha.Link.createButtons=function(){var a=this;this.formatLinkButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a",size:"small",onclick:function(){a.formatLink()},tooltip:this.i18n("button.addlink.tooltip"),toggle:!0}),GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.formatLinkButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1),this.insertLinkButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a",size:"small",onclick:function(){a.insertLink(!1)},tooltip:this.i18n("button.addlink.tooltip"),toggle:!1}),GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.insertLinkButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1),GENTICS.Aloha.FloatingMenu.createScope(this.getUID("link"),"GENTICS.Aloha.continuoustext"),this.browser=new GENTICS.Aloha.ui.Browser,this.browser.setObjectTypeFilter(GENTICS.Aloha.Link.objectTypeFilter),this.browser.onSelect=function(b){a.hrefField.setItem(b),a.hrefChange()},this.repositoryButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button_big GENTICS_button_tree",size:"large",onclick:function(){a.browser.show()},tooltip:this.i18n("button.addlink.tooltip"),toggle:!1}),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("link"),this.repositoryButton,this.i18n("floatingmenu.tab.link"),1),this.hrefField=new GENTICS.Aloha.ui.AttributeField({width:320}),this.hrefField.setObjectTypeFilter(GENTICS.Aloha.Link.objectTypeFilter),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("link"),this.hrefField,this.i18n("floatingmenu.tab.link"),1),this.removeLinkButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_a_remove",size:"small",onclick:function(){a.removeLink()},tooltip:this.i18n("button.removelink.tooltip")}),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("link"),this.removeLinkButton,this.i18n("floatingmenu.tab.link"),1)},GENTICS.Aloha.Link.bindInteractions=function(){var a=this;this.hrefField.addListener("keyup",function(b,c){if(c.keyCode==27){var d=a.hrefField.getQueryValue();d[0]!="/"&&!d.match(/^.*\.([a-z]){2,4}$/i)&&d[0]!="#"&&!d.match(/^htt.*/i)}a.hrefChange()}),this.hrefField.addListener("blur",function(b,c){this.getValue()==""&&a.removeLink()});for(var b=0;b<GENTICS.Aloha.editables.length;b++)GENTICS.Aloha.editables[b].obj.keydown(function(b){if(b.metaKey&&b.which==76)return a.findLinkMarkup()?(GENTICS.Aloha.FloatingMenu.userActivatedTab=a.i18n("floatingmenu.tab.link"),GENTICS.Aloha.FloatingMenu.doLayout(),a.hrefField.focus()):a.insertLink(),!1}),GENTICS.Aloha.editables[b].obj.find("a").each(function(b){jQuery(this).mouseenter(function(b){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"mouse over link."),a.mouseOverLink=this,a.updateMousePointer()}),jQuery(this).mouseleave(function(b){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"mouse left link."),a.mouseOverLink=null,a.updateMousePointer()}),jQuery(this).click(function(a){if(a.metaKey)return GENTICS.Aloha.activeEditable.blur(),setTimeout(function(){location.href=a.target},0),a.stopPropagation(),!1})});jQuery(document).keydown(function(b){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"Meta key down."),a.metaKey=b.metaKey,a.updateMousePointer()}),jQuery(document).keyup(function(b){GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"Meta key up."),a.metaKey=b.metaKey,a.updateMousePointer()})},GENTICS.Aloha.Link.updateMousePointer=function(){this.metaKey&&this.mouseOverLink?(GENTICS.Aloha.Log.debug(GENTICS.Aloha.Link,"set pointer"),jQuery(this.mouseOverLink).removeClass("GENTICS_link_text"),jQuery(this.mouseOverLink).addClass("GENTICS_link_pointer")):(jQuery(this.mouseOverLink).removeClass("GENTICS_link_pointer"),jQuery(this.mouseOverLink).addClass("GENTICS_link_text"))},GENTICS.Aloha.Link.subscribeEvents=function(){var a=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(b,c){if(GENTICS.Aloha.activeEditable){var d=a.getEditableConfig(GENTICS.Aloha.activeEditable.obj);if(jQuery.inArray("a",d)!=-1)a.formatLinkButton.show(),a.insertLinkButton.show();else{a.formatLinkButton.hide(),a.insertLinkButton.hide();return}var e=a.findLinkMarkup(c);e?(a.insertLinkButton.hide(),a.formatLinkButton.setPressed(!0),GENTICS.Aloha.FloatingMenu.setScope(a.getUID("link")),a.hrefField.setTargetObject(e,"href")):(a.formatLinkButton.setPressed(!1),a.hrefField.setTargetObject(null)),GENTICS.Aloha.FloatingMenu.doLayout()}})},GENTICS.Aloha.Link.findLinkMarkup=function(a){if(typeof a=="undefined")var a=GENTICS.Aloha.Selection.getRangeObject();return GENTICS.Aloha.activeEditable?a.findMarkup(function(){return this.nodeName.toLowerCase()=="a"},GENTICS.Aloha.activeEditable.obj):null},GENTICS.Aloha.Link.formatLink=function(){var a=GENTICS.Aloha.Selection.getRangeObject();GENTICS.Aloha.activeEditable&&(this.findLinkMarkup(a)?this.removeLink():this.insertLink())},GENTICS.Aloha.Link.insertLink=function(a){if(this.findLinkMarkup(b))return;GENTICS.Aloha.FloatingMenu.userActivatedTab=this.i18n("floatingmenu.tab.link");var b=GENTICS.Aloha.Selection.getRangeObject();b.isCollapsed()&&a!=!1&&GENTICS.Utils.Dom.extendToWord(b);if(b.isCollapsed()){var c=this.i18n("newlink.defaulttext"),d=jQuery('<a href="">'+c+"</a>");GENTICS.Utils.Dom.insertIntoDOM(d,b,jQuery(GENTICS.Aloha.activeEditable.obj)),b.startContainer=b.endContainer=d.contents().get(0),b.startOffset=0,b.endOffset=c.length}else{var d=jQuery('<a href=""></a>');GENTICS.Utils.Dom.addMarkup(b,d,!1)}b.select(),this.hrefField.focus(),this.hrefChange()},GENTICS.Aloha.Link.removeLink=function(){var a=GENTICS.Aloha.Selection.getRangeObject(),b=this.findLinkMarkup();b&&(GENTICS.Utils.Dom.removeFromDOM(b,a,!0),GENTICS.Aloha.activeEditable.obj[0].focus(),a.select())},GENTICS.Aloha.Link.hrefChange=function(){this.hrefField.setAttribute("target",this.target,this.targetregex,this.hrefField.getQueryValue()),this.hrefField.setAttribute("class",this.cssclass,this.cssclassregex,this.hrefField.getQueryValue()),typeof this.onHrefChange=="function"&&this.onHrefChange.call(this,this.hrefField.getTargetObject(),this.hrefField.getQueryValue(),this.hrefField.getItem()),GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("hrefChanged",GENTICS.Aloha,{obj:this.hrefField.getTargetObject(),href:this.hrefField.getQueryValue(),item:this.hrefField.getItem()}))},GENTICS.Aloha.Link.makeClean=function(a){a.find("a").each(function(){jQuery(this).removeClass("GENTICS_link_pointer"),jQuery(this).removeClass("GENTICS_link_text")})},GENTICS.Aloha.Repositories||(GENTICS.Aloha.Repositories={}),GENTICS.Aloha.Repositories.delicious=new GENTICS.Aloha.Repository("com.gentics.aloha.repositories.delicious"),GENTICS.Aloha.Repositories.delicious.settings.username="draftkraft",GENTICS.Aloha.Repositories.delicious.settings.weight=.35,GENTICS.Aloha.Repositories.delicious.init=function(){var a=this;this.settings.weight+.15>1&&(this.settings.weight=.85),this.deliciousURL="http://feeds.delicious.com/v2/json/",this.settings.username?(this.deliciousURL+=this.settings.username+"/",this.repositoryName="deliciuos/"+this.settings.username,this.tags=[],jQuery.ajax({type:"GET",dataType:"jsonp",url:"http://feeds.delicious.com/v2/json/tags/"+a.settings.username,success:function(b){for(var c in b)a.tags.push(c)}})):(this.repositoryName="deliciuos/"+popular,this.deliciousURL+="tag/")},GENTICS.Aloha.Repositories.delicious.query=function(a,b){var c=this;if(a.objectTypeFilter&&jQuery.inArray("website",a.objectTypeFilter)==-1)b.call(this,[]);else{var d=[];if(this.settings.username){var e=a.queryString?a.queryString.split(" "):[];for(var f=0;f<e.length;f++){var g=e[f].trim();if(jQuery.inArray(g,c.tags)==-1){var h=c.tags.filter(function(a,b,c){var d=new RegExp(g,"i");return a.match(d)});h.length>0&&d.push(h[0])}else d.push(g)}}else d=a.queryString.split(" ");var i=a.inFolderId?a.inFolderId.split("+"):[];jQuery.extend(d,i);if(a.queryString&&d.length==0){b.call(c,[]);return}jQuery.ajax({type:"GET",dataType:"jsonp",url:c.deliciousURL+d.join("+"),success:function(a){var d=[];for(var e=0;e<a.length;e++)typeof a[e]!="function"&&d.push(new GENTICS.Aloha.Repository.Document({id:a[e].u,name:a[e].d,repositoryId:c.repositoryId,type:"website",url:a[e].u,weight:c.settings.weight+.14}));b.call(c,d)}})}},GENTICS.Aloha.Repositories.delicious.getChildren=function(a,b){var c=this;if(this.settings.username){var d=[];if(a.inFolderId==this.repositoryId){for(var e=0;e<this.tags.length;e++)typeof this.tags[e]!="function"&&d.push(new GENTICS.Aloha.Repository.Folder({id:this.tags[e],name:this.tags[e],repositoryId:this.repositoryId,type:"tag",url:"http://feeds.delicious.com/v2/rss/tags/"+c.settings.username+"/"+this.tags[e]}));b.call(this,d)}else jQuery.ajax({type:"GET",dataType:"jsonp",url:"http://feeds.delicious.com/v2/json/tags/"+c.settings.username+"/"+a.inFolderId,success:function(d){var e=[];for(var f in d){var g=a.inFolderId?a.inFolderId+"+"+f:f;typeof d[f]!="function"&&e.push(new GENTICS.Aloha.Repository.Folder({id:g,name:f,repositoryId:c.repositoryId,type:"tag",url:"http://feeds.delicious.com/v2/rss/tags/"+c.settings.username+"/"+g,hasMoreItems:!0}))}b.call(c,e)}})}else b.call(this,[])},GENTICS.Aloha.Repositories||(GENTICS.Aloha.Repositories={}),GENTICS.Aloha.Repositories.LinkList=new GENTICS.Aloha.Repository("com.gentics.aloha.repositories.LinkList"),GENTICS.Aloha.Repositories.LinkList.settings.data=[{name:"Aloha Editor - The HTML5 Editor",url:"http://aloha-editor.com",type:"website"},{name:"Aloha Logo",url:"http://www.aloha-editor.com/images/aloha-editor-logo.png",type:"image"}],GENTICS.Aloha.Repositories.LinkList.folder=[],GENTICS.Aloha.Repositories.LinkList.init=function(){for(var a=0;a<this.settings.data.length;a++){var b=this.settings.data[a];b.repositoryId=this.repositoryId,b.id=b.id?b.id:b.url;var c=b.uri=this.parseUri(b.url),d=this.addFolder("",c.host),e=c.path.split("/");for(j=0;j<e.length;j++)e[j]&&e[j].lastIndexOf(".")<0&&(d=this.addFolder(d,e[j]));b.parentId=d,this.settings.data[a]=new GENTICS.Aloha.Repository.Document(b)}this.repositoryName="Linklist"},GENTICS.Aloha.Repositories.LinkList.addFolder=function(a,b){var c=a?"folder":"hostname",d=a?a+"/"+b:b;return b&&!this.folder[d]&&(this.folder[d]=new GENTICS.Aloha.Repository.Folder({id:d,name:b?b:d,parentId:a,type:"host",repositoryId:this.repositoryId})),d},GENTICS.Aloha.Repositories.LinkList.query=function(a,b){var c=this.settings.data.filter(function(b,c,d){var e=new RegExp(a.queryString,"i"),f=!1;return(!a.queryString||b.name.match(e)||b.url.match(e))&&(!a.objectTypeFilter||jQuery.inArray(b.type,a.objectTypeFilter)>-1)&&(!a.inFolderId||a.inFolderId==b.parentId)});b.call(this,c)},GENTICS.Aloha.Repositories.LinkList.getChildren=function(a,b){var c=[];for(e in this.folder){var d=this.folder[e].parentId;typeof this.folder[e]!="function"&&(this.folder[e].parentId==a.inFolderId||!this.folder[e].parentId&&a.inFolderId==this.repositoryId)&&c.push(this.folder[e])}b.call(this,c)},GENTICS.Aloha.Repositories.LinkList.parseUri=function(a){var b={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},c=b.parser[b.strictMode?"strict":"loose"].exec(a),d={},e=14;while(e--)d[b.key[e]]=c[e]||"";return d[b.q.name]={},d[b.key[12]].replace(b.q.parser,function(a,c,e){c&&(d[b.q.name][c]=e)}),d},function(){function c(a){return a[a.length-1]}function d(a){return a[0]}function e(a){return a.slice(1)}function f(a,b){return g(a,function(a){return a===b})}function g(a,b){for(var c=0;c<a.length;c++)if(b(a[c]))return a[c];return null}function h(a,b){var c=[];for(var d=0;d<a.length;d++)c.push(b(a[d]));return c}function i(a,b){h(a,b)}var a=GENTICS.Aloha.TOC||{jQuery:jQuery},b=a.jQuery,j="com.gentics.aloha.plugins.TOC",k=GENTICS.Aloha.TOC=new GENTICS.Aloha.Plugin(j);GENTICS.Aloha.TOC.languages=["en","de"];var l=null,m=[];k.init=function(){var a=k.settings;a.updateInterval=a.updateInterval||5e3,a.minEntries=a.minEntries||0,k.initButtons(),b(document).ready(function(){k.spawn()})},k.initButtons=function(){k.insertTocButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_ul",size:"small",onclick:function(){k.insertAtSelection(l)},tooltip:this.i18n("button.addtoc.tooltip"),toggle:!1}),GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.insertTocButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1)},k.register=function(a){l=a},k.generateId=function(a){var c;typeof a=="object"?c=b(a).text().replace(/[^a-zA-Z-]+/g,"-").replace(/^[^a-zA-Z]+/,""):a&&(c=a);for(var d=0;;d++){var e=c;d&&(e+="-"+d);var f=document.getElementById(e);if(!f||typeof a=="object"&&f===a)return e}},k.outline=function(a){var c=[b()],d=[c];return k.headings(a).each(function(){var a=b(this),c=this.nodeName.toLowerCase(),e=["h6","h5","h4","h3","h2","h1"],h=b.inArray(c,e),i=e.slice(h).join(","),j=a.nextUntil(i).andSelf(),k=[j],l=g(d,function(c){var d=c[0];return!d.length||g(d,function(c){return a.get(0)===c||b.contains(c,a.get(0))})});l.push(k),d.splice(0,f(d,l),k)}),c},k.editableContainers=function(){return b(h(GENTICS.Aloha.editables,function(a){return document.getElementById(a.getId())}))},k.headings=function(a){return a.find(":header").add(a.filter(":header"))},k.anchorFromLinkId=function(a,c){return c?a.find('a[href $= "#'+c+'"]'):b()},k.linkIdFromAnchor=function(a){var b=a.attr("href");return b?b.match(/#(.*?)$/)[1]:null},k.insertAtSelection=function(a){a=a||k.editableContainers();var c=k.generateId("toc"),d=b("<ol class='toc_root'></ol>").attr("id",c).attr("contentEditable","false"),e=GENTICS.Aloha.Selection.getRangeObject(),f=GENTICS.Aloha.activeEditable,g=b(document.getElementById(f.getId()));GENTICS.Utils.Dom.insertIntoDOM(d,e,g),k.create(c).register(a).update().tickTock()},k.spawn=function(a,c){a=a||b("body"),c=c||k.editableContainers(),a.find("ol.toc_root").each(function(){var a=b(this).attr("id");a||(a=k.generateId("toc"),b(this).attr("id",a)),k.create(a).register(c).tickTock()})},k.create=function(a){return m.push(this),{id:a,$containers:b(),root:function(){return b(document.getElementById(this.id))},register:function(a){var c=this;return c.$containers=c.$containers.add(a),c.$containers.filter(function(){return!b(this).data(j+"."+c.id+".listening")}).each(function(){var a=b(this);a.data(j+"."+c.id+".listening",!0),a.bind("blur",function(){c.cleanupIds(a.get(0)),c.update(a)})}),c},tickTock:function(a){var b=this;a=a||k.settings.updateInterval;if(!a)return;return window.setInterval(function(){b.register(k.editableContainers()),b.update()},a),b},cleanupIds:function(a){var c=[];return k.headings(this.$containers).each(function(){var d=b(this).attr("id");(d&&-1!=b.inArray(d,c)||a&&(b.contains(a,this)||a===this))&&b(this).attr("id",k.generateId(this)),c.push(d)}),this},update:function(a){var b=this;a=a||b.$containers;var f=k.outline(b.$containers),g=[b.root()],h=[];c(g).empty(),function l(a){var c=[];i(a,function(a){var f=d(a),h=b.linkSection(f,g,c);g.push(h),l(e(a)),g.pop(),c.push(h)})}(e(f));var j=b.root().attr("data-TOC-minEntries")||k.settings.minEntries;return b.root().find("li").length>=j?b.root().show():b.root().hide(),this},linkSection:function(a,d,e){var f=a.eq(0).attr("id");f||(f=k.generateId(a.get(0)),a.eq(0).attr("id",f));var g=this.root(),h=k.anchorFromLinkId(g,f);h.length||(h=b("<li><a/></li>")),h.find("a").attr("href","#"+f).text(a.eq(0).text());if(c(e))c(e).after(h);else if(c(d).get(0)==g.get(0))g.append(h);else{var i=b("<ol/>").append(h);c(d).append(i)}return h}}}}(),GENTICS.Aloha.HighlightEditables=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.highlighteditables"),GENTICS.Aloha.HighlightEditables.init=function(){var a=this;GENTICS.Utils.Position.addMouseMoveCallback(function(){for(var a=0;a<GENTICS.Aloha.editables.length;a++){var b=GENTICS.Aloha.editables[a];!GENTICS.Aloha.activeEditable&&!b.isDisabled()&&b.obj.addClass("GENTICS_editable_highlight")}}),GENTICS.Utils.Position.addMouseStopCallback(function(){a.fade()}),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(b,c){c.editable.obj.addClass("GENTICS_editable_active"),a.fade()}),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableDeactivated",function(a,b){b.editable.obj.removeClass("GENTICS_editable_active")})},GENTICS.Aloha.HighlightEditables.fade=function(){for(var a=0;a<GENTICS.Aloha.editables.length;a++){var b=GENTICS.Aloha.editables[a].obj;b.hasClass("GENTICS_editable_highlight")&&b.removeClass("GENTICS_editable_highlight").css("outline","5px solid #FFE767").animate({outlineWidth:"0px"},300,"swing",function(){jQuery(this).css("outline","")})}},GENTICS.Aloha.TablePlugin=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Table"),GENTICS.Aloha.TablePlugin.createLayer=undefined,GENTICS.Aloha.TablePlugin.languages=["en","de","fr","eo","fi","ru","it","pl"],GENTICS.Aloha.TablePlugin.config=["table"],GENTICS.Aloha.TablePlugin.TableRegistry=[],GENTICS.Aloha.TablePlugin.activeTable=undefined,GENTICS.Aloha.TablePlugin.parameters={className:"GENTICS_Aloha_Table",classSelectionRow:"GENTICS_Aloha_Table_selectColumn",classSelectionColumn:"GENTICS_Aloha_Table_selectRow",classLeftUpperCorner:"GENTICS_Aloha_Table_leftUpperCorner",classTableWrapper:"GENTICS_Aloha_Table_wrapper",classCellSelected:"GENTICS_Aloha_Cell_selected",waiRed:"GENTICS_WAI_RED",waiGreen:"GENTICS_WAI_GREEN",selectionArea:10},GENTICS.Aloha.TablePlugin.init=function(){this.createLayer=new GENTICS.Aloha.Table.CreateLayer;var a=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableCreated",function(b,c){c.obj.bind("mousedown",function(a){GENTICS.Aloha.TablePlugin.setFocusedTable(undefined)}),c.obj.find("table").each(function(){if(a.isEditableTable(this)){var b=new GENTICS.Aloha.Table(this);b.parentEditable=c,GENTICS.Aloha.TablePlugin.TableRegistry.push(b)}})}),this.initTableButtons(),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(b,c){if(GENTICS.Aloha.activeEditable){var d=a.getEditableConfig(GENTICS.Aloha.activeEditable.obj);jQuery.inArray("table",d)!=-1&&GENTICS.Aloha.Selection.mayInsertTag("table")?a.createTableButton.show():a.createTableButton.hide(),GENTICS.Aloha.TableHelper.unselectCells();var e=c.findMarkup(function(){return this.nodeName.toLowerCase()=="table"},GENTICS.Aloha.activeEditable.obj);e?GENTICS.Aloha.FloatingMenu.setScope(a.getUID(GENTICS.Aloha.TableHelper.selectionType)):a.activeTable&&a.activeTable.focusOut(),GENTICS.Aloha.FloatingMenu.doLayout()}}),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableActivated",function(b,c){c.editable.obj.find("table").each(function(){var b=GENTICS.Aloha.TablePlugin.TableRegistry;for(var d=0;d<b.length;d++)if(b[d].obj.attr("id")==jQuery(this).attr("id"))return b[d].activate(),!0;if(a.isEditableTable(this)){var e=new GENTICS.Aloha.Table(this);e.parentEditable=c.editable,e.activate(),GENTICS.Aloha.TablePlugin.TableRegistry.push(e)}})}),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableDeactivated",function(a,b){GENTICS.Aloha.TablePlugin.setFocusedTable(undefined),GENTICS.Aloha.TableHelper.unselectCells();var c=GENTICS.Aloha.TablePlugin.TableRegistry;for(var d=0;d<c.length;d++)c[d].deactivate()})},GENTICS.Aloha.TablePlugin.isEditableTable=function(a){var b=jQuery(a.parentNode);return b.contentEditable()=="true"?!0:!1},GENTICS.Aloha.TablePlugin.initTableButtons=function(){var a=this;GENTICS.Aloha.FloatingMenu.createScope(this.getUID("row"),"GENTICS.Aloha.global"),GENTICS.Aloha.FloatingMenu.createScope(this.getUID("column"),"GENTICS.Aloha.global"),GENTICS.Aloha.FloatingMenu.createScope(this.getUID("cell"),"GENTICS.Aloha.continuoustext"),this.createTableButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_table",size:"small",tooltip:this.i18n("button.createtable.tooltip"),onclick:function(a,b){GENTICS.Aloha.TablePlugin.createDialog(a.btnEl.dom)}}),GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.createTableButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("column"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addColumnLeft",size:"small",tooltip:this.i18n("button.addcolleft.tooltip"),onclick:function(){a.activeTable&&a.activeTable.addColumnsLeft()}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("column"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addColumnRight",size:"small",tooltip:this.i18n("button.addcolright.tooltip"),onclick:function(){a.activeTable&&a.activeTable.addColumnsRight()}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("column"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_deleteColumns",size:"small",tooltip:this.i18n("button.delcols.tooltip"),onclick:function(){if(a.activeTable){var b=a.activeTable;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(a,"Table"),text:GENTICS.Aloha.i18n(a,"deletecolumns.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(a){a=="yes"&&b.deleteColumns()}}))}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("row"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addRowBefore",size:"small",tooltip:this.i18n("button.addrowbefore.tooltip"),onclick:function(){a.activeTable&&a.activeTable.addRowsBefore(!0)}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("row"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_addRowAfter",size:"small",tooltip:this.i18n("button.addrowafter.tooltip"),onclick:function(){a.activeTable&&a.activeTable.addRowsAfter(!0)}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("row"),new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_deleteRows",size:"small",tooltip:this.i18n("button.delrows.tooltip"),onclick:function(){if(a.activeTable){var b=a.activeTable;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(a,"Table"),text:GENTICS.Aloha.i18n(a,"deleterows.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(a){a=="yes"&&b.deleteRows()}}))}}}),GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1),this.captionButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_table_caption",size:"small",tooltip:this.i18n("button.caption.tooltip"
),toggle:!0,onclick:function(){if(a.activeTable)if(a.activeTable.obj.children("caption").is("caption"))a.activeTable.obj.children("caption").remove();else{var b=a.i18n("empty.caption"),c=jQuery("<caption></caption>");a.activeTable.obj.append(c),a.makeCaptionEditable(c,b);var d=c.find("div").eq(0),e=d.contents().eq(0);if(e.length>0){var f=new GENTICS.Utils.RangeObject;f.startContainer=f.endContainer=e.get(0),f.startOffset=0,f.endOffset=e.text().length,a.activeTable.obj.find("div.GENTICS_Table_Cell_editable").blur(),d.focus(),f.select(),GENTICS.Aloha.Selection.updateSelection()}}}}),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("cell"),this.captionButton,GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1),this.summary=new GENTICS.Aloha.ui.AttributeField({width:350}),this.summary.addListener("keyup",function(b,c){a.activeTable.checkWai()}),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("cell"),this.summary,GENTICS.Aloha.i18n(this,"floatingmenu.tab.table"),1)},GENTICS.Aloha.TablePlugin.makeCaptionEditable=function(a,b){var c=this,d=a.children("div").eq(0);d.length==0&&(d=jQuery("<div></div>"),a.contents().length>0?a.contents().wrap(d):(b&&d.text(b),a.append(d))),d.contentEditable(!0),d.unbind("mousedown"),d.bind("mousedown",function(a){return d.focus(),a.preventDefault(),a.stopPropagation(),!1})},GENTICS.Aloha.TablePlugin.createDialog=function(a){this.createLayer.set("target",a),this.createLayer.show()},GENTICS.Aloha.TablePlugin.createTable=function(a,b){if(GENTICS.Aloha.activeEditable!=null&&typeof GENTICS.Aloha.activeEditable.obj!="undefined"){var c=document.createElement("table"),d=c.id=GENTICS.Aloha.TableHelper.getNewTableID(),e=document.createElement("tbody");for(var f=0;f<b;f++){var g=document.createElement("tr");for(var h=0;h<a;h++){var i=document.createTextNode(" "),j=document.createElement("td");j.appendChild(i),g.appendChild(j)}e.appendChild(g)}c.appendChild(e),GENTICS.Utils.Dom.insertIntoDOM(jQuery(c),GENTICS.Aloha.Selection.getRangeObject(),jQuery(GENTICS.Aloha.activeEditable.obj));var k=document.getElementById(d),l=new GENTICS.Aloha.Table(k);l.parentEditable=GENTICS.Aloha.activeEditable,l.activate(),jQuery.browser.msie?window.setTimeout(function(){l.cells[0].wrapper.get(0).focus()},20):l.cells[0].wrapper.get(0).focus(),GENTICS.Aloha.TablePlugin.TableRegistry.push(l)}else this.error("There is no active Editable where the table can be inserted!")},GENTICS.Aloha.TablePlugin.setFocusedTable=function(a){var b=this;for(var c=0;c<GENTICS.Aloha.TablePlugin.TableRegistry.length;c++)GENTICS.Aloha.TablePlugin.TableRegistry[c].hasFocus=!1;if(typeof a!="undefined"){this.summary.setTargetObject(a.obj,"summary");if(a.obj.children("caption").is("caption")){b.captionButton.setPressed(!0);var d=a.obj.children("caption");b.makeCaptionEditable(d)}a.hasFocus=!0}GENTICS.Aloha.TablePlugin.activeTable=a},GENTICS.Aloha.TablePlugin.error=function(a){GENTICS.Aloha.Log.error(this,a)},GENTICS.Aloha.TablePlugin.debug=function(a){GENTICS.Aloha.Log.debug(this,a)},GENTICS.Aloha.TablePlugin.info=function(a){GENTICS.Aloha.Log.info(this,a)},GENTICS.Aloha.TablePlugin.log=function(a){GENTICS.Aloha.log("log",this,a)},GENTICS.Aloha.TablePlugin.get=function(a){return this.config[a]?this.config[a]:this.parameters[a]?this.parameters[a]:undefined},GENTICS.Aloha.TablePlugin.set=function(a,b){this.config[a]?this.config[a]=b:this.parameters[a]=b},GENTICS.Aloha.TablePlugin.makeClean=function(a){a.find("table").each(function(){var a=new GENTICS.Aloha.Table(this);a.deactivate()})},GENTICS.Aloha.TablePlugin.toString=function(){return this.prefix},GENTICS.Aloha.Table=function(a){this.obj=jQuery(a),this.obj.attr("id")||this.obj.attr("id",GENTICS.Utils.guid());var b=this.obj.find("tr"),c=jQuery(b.get(0));this.numCols=c.children("td, th").length,this.numRows=b.length,this.cells=[];var b=this.obj.find("tr");for(var d=0;d<b.length;d++){var e=jQuery(b[d]),f=e.children();for(var g=0;g<f.length;g++){var h=f[g],i=new GENTICS.Aloha.Table.Cell(h,this);this.cells.push(i)}}},GENTICS.Aloha.Table.prototype.obj=undefined,GENTICS.Aloha.Table.prototype.tableWrapper=undefined,GENTICS.Aloha.Table.prototype.cells=undefined,GENTICS.Aloha.Table.prototype.numRows=undefined,GENTICS.Aloha.Table.prototype.numCols=undefined,GENTICS.Aloha.Table.prototype.isActive=!1,GENTICS.Aloha.Table.prototype.hasFocus=!1,GENTICS.Aloha.Table.prototype.parentEditable=undefined,GENTICS.Aloha.Table.prototype.mousedown=!1,GENTICS.Aloha.Table.prototype.clickedColumnId=-1,GENTICS.Aloha.Table.prototype.clickedRowId=-1,GENTICS.Aloha.Table.prototype.columnsToSelect=[],GENTICS.Aloha.Table.prototype.rowsToSelect=[],GENTICS.Aloha.Table.prototype.fmPluginId=undefined,GENTICS.Aloha.Table.prototype.get=function(a){return GENTICS.Aloha.TablePlugin.get(a)},GENTICS.Aloha.Table.prototype.set=function(a,b){GENTICS.Aloha.TablePlugin.set(a,b)},GENTICS.Aloha.Table.prototype.activate=function(){if(this.isActive)return;var a=this;this.obj.addClass(this.get("className")),this.obj.contentEditable(!1),this.obj.attr("id")==""&&this.obj.attr("id",GENTICS.Aloha.TableHelper.getNewTableID()),GENTICS.Aloha.TableHelper.selectionType=undefined,this.obj.bind("keydown",function(a){!a.ctrlKey&&!a.shiftKey&&GENTICS.Aloha.TableHelper.selectedCells.length>0&&GENTICS.Aloha.TableHelper.selectedCells[0].length>0&&GENTICS.Aloha.TableHelper.selectedCells[0][0].firstChild.focus()}),this.obj.bind("mousedown",function(b){return a.hasFocus||a.focus(),b.stopPropagation(),b.preventDefault(),!1});var b=jQuery('<div class="'+this.get("classTableWrapper")+'"></div>');b.contentEditable(!1),this.obj.wrap(b);var c=this.obj.parents("."+this.get("classTableWrapper"));c.get(0).onresizestart=function(a){return!1},c.get(0).oncontrolselect=function(a){return!1},this.tableWrapper=this.obj.parents("."+this.get("classTableWrapper")).get(0),jQuery(this.cells).each(function(){this.activate()}),this.attachSelectionColumn(),this.attachSelectionRow(),this.attachLastCellEvents(),this.makeCaptionEditable(),this.checkWai(),this.isActive=!0,GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("tableActivated",GENTICS.Aloha,[this]))},GENTICS.Aloha.Table.prototype.makeCaptionEditable=function(){var a=this.obj.find("caption").eq(0);a&&GENTICS.Aloha.TablePlugin.makeCaptionEditable(a)},GENTICS.Aloha.Table.prototype.checkWai=function(){var a=this.wai;a.removeClass(this.get("waiGreen")),a.removeClass(this.get("waiRed")),this.obj[0].summary.length>5?a.addClass(this.get("waiGreen")):a.addClass(this.get("waiRed"))},GENTICS.Aloha.Table.prototype.attachSelectionColumn=function(){var a=jQuery("<td>");a.html(" ");var b=this,c=this.obj.context.rows;for(var d=0;d<c.length;d++){var e=jQuery(c[d]),f=a.clone();f.addClass(this.get("classSelectionColumn")),f.css("width",this.get("selectionArea")+"px"),e.find("td:first").before(f);var g=d+1;this.attachRowSelectionEventsToCell(f)}},GENTICS.Aloha.Table.prototype.attachRowSelectionEventsToCell=function(a){var b=this;a.unbind("mousedown"),a.unbind("mouseover"),a.get(0).onselectstart=function(){return!1},a.bind("mousedown",function(a){return b.mousedown=!0,b.rowSelectionMouseDown(a)}),a.bind("mouseover",function(a){if(b.mousedown)return b.rowSelectionMouseOver(a)})},GENTICS.Aloha.Table.prototype.rowSelectionMouseDown=function(a){this.focus(),GENTICS.Aloha.TableHelper.selectedCells.length==0&&(this.rowsToSelect=[]),this.clickedRowId=a.currentTarget.parentNode.rowIndex;if(a.metaKey){var b=jQuery.inArray(this.clickedRowId,this.rowsToSelect);b>=0?this.rowsToSelect.splice(b,1):this.rowsToSelect.push(this.clickedRowId)}else if(a.shiftKey){this.rowsToSelect.sort(function(a,b){return a-b});var c=this.rowsToSelect[0],d=this.clickedRowId;c>d&&(c=d,d=this.rowsToSelect[0]),this.rowsToSelect=[];for(var e=c;e<=d;e++)this.rowsToSelect.push(e)}else this.rowsToSelect=[this.clickedRowId];return this.selectRows(),a.preventDefault(),a.stopPropagation(),!1},GENTICS.Aloha.Table.prototype.rowSelectionMouseOver=function(a){var b=a.currentTarget.parentNode.rowIndex;if(this.mousedown&&this.clickedRowId>=0){var c=jQuery.inArray(b,this.rowsToSelect),d=b<this.clickedRowId?b:this.clickedRowId,e=b<this.clickedRowId?this.clickedRowId:b;this.rowsToSelect=[];for(var f=d;f<=e;f++)this.rowsToSelect.push(f);return this.selectRows(),a.preventDefault(),a.stopPropagation(),!1}},GENTICS.Aloha.Table.prototype.attachSelectionRow=function(){var a=this,b=jQuery("<td>");b.html(" ");var c=this.obj.context.rows[0].cells.length,d=jQuery("<tr>");d.addClass(this.get("classSelectionRow")),d.css("height",this.get("selectionArea")+"px");for(var e=0;e<c;e++){var f=b.clone();if(e>0)this.attachColumnSelectEventsToCell(f);else{var f=jQuery("<td>").clone();f.addClass(this.get("classLeftUpperCorner")),this.wai=jQuery("<div/>"),this.wai.width(25),this.wai.height(12),this.wai.click(function(b){return a.focus(),GENTICS.Aloha.FloatingMenu.userActivatedTab=GENTICS.Aloha.TablePlugin.i18n("floatingmenu.tab.table"),GENTICS.Aloha.FloatingMenu.doLayout(),GENTICS.Aloha.TablePlugin.summary.focus(),b.stopPropagation(),b.preventDefault(),!1}),f.append(this.wai)}d.append(f)}jQuery(document).bind("mouseup",function(b){a.mousedown=!1,a.clickedColumnId=-1,a.clickedRowId=-1}),this.obj.find("tr:first").before(d)},GENTICS.Aloha.Table.prototype.attachColumnSelectEventsToCell=function(a){var b=this;a.unbind("mousedown"),a.unbind("mouseover"),a.get(0).onselectstart=function(){return!1},a.bind("mousedown",function(a){b.mousedown=!0,b.columnSelectionMouseDown(a)}),a.bind("mouseover",function(a){b.mousedown&&b.columnSelectionMouseOver(a)})},GENTICS.Aloha.Table.prototype.columnSelectionMouseDown=function(a){this.focus(),GENTICS.Aloha.TableHelper.selectedCells.length==0&&(this.columnsToSelect=[]),this.clickedColumnId=a.currentTarget.cellIndex;if(a.metaKey){var b=jQuery.inArray(this.clickedColumnId,this.columnsToSelect);b>=0?this.columnsToSelect.splice(b,1):this.columnsToSelect.push(this.clickedColumnId)}else if(a.shiftKey){this.columnsToSelect.sort(function(a,b){return a-b});var c=this.columnsToSelect[0],d=this.clickedColumnId;c>d&&(c=d,d=this.columnsToSelect[0]),this.columnsToSelect=[];for(var e=c;e<=d;e++)this.columnsToSelect.push(e)}else this.columnsToSelect=[this.clickedColumnId];return this.selectColumns(),a.preventDefault(),a.stopPropagation(),!1},GENTICS.Aloha.Table.prototype.columnSelectionMouseOver=function(a){var b=a.currentTarget.cellIndex;if(this.mousedown&&this.clickedColumnId>0){var c=jQuery.inArray(b,this.columnsToSelect),d=b<this.clickedColumnId?b:this.clickedColumnId,e=b<this.clickedColumnId?this.clickedColumnId:b;this.columnsToSelect=[];for(var f=d;f<=e;f++)this.columnsToSelect.push(f);this.selectColumns()}},GENTICS.Aloha.Table.prototype.releaseLastCellEvents=function(){this.obj.find("tr:last td:last").unbind()},GENTICS.Aloha.Table.prototype.attachLastCellEvents=function(){var a=this;this.obj.find("tr:last td:last").bind("keydown",function(b){a.lastCellKeyDown(b)})},GENTICS.Aloha.Table.prototype.lastCellKeyDown=function(a){var b=9;if(b==a.keyCode&&!a.altKey&&!a.shiftKey&&!a.ctrlKey){this.addRowsAfter(!1),a.stopPropagation();if(jQuery.browser.msie)return this.obj.find("tr:last td:nth-child(1) div.GENTICS_Table_Cell_editable").get(0).focus(),!1}},GENTICS.Aloha.Table.prototype.deleteRows=function(){var a=[],b=!1;if(GENTICS.Aloha.TableHelper.selectedCells.length>0)for(var c=0;c<GENTICS.Aloha.TableHelper.selectedCells.length;c++)a.push(GENTICS.Aloha.TableHelper.selectedCells[c][0].parentNode.rowIndex);else typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"&&a.push(GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.parentNode.rowIndex);a.length==this.numRows&&(b=!0);if(b){var d=this;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"Table"),text:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"deletetable.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(a){a=="yes"&&d.deleteTable()}}))}else{a.sort(function(a,b){return a-b});var e=a[0];e>this.numRows-a.length&&e--,this.releaseLastCellEvents();var f=this.obj.find("tr"),g=[];for(var c=0;c<a.length;c++)g.push(jQuery(f[a[c]]));for(var c=0;c<g.length;c++){var h=g[c].children("td").toArray();for(var i=0;i<h.length;i++)for(var j=0;j<this.cells.length;j++)h[i]==this.cells[j].obj.get(0)&&(this.cells.splice(j,1),j=this.cells.length)}for(var c=0;c<g.length;c++)g[c].remove();this.numRows-=g.length,jQuery.browser.msie?setTimeout(this.obj.find("tr:nth-child("+(e+1)+") td:nth-child(2) div.GENTICS_Table_Cell_editable").get(0).focus,5):this.obj.find("tr:nth-child("+(e+1)+") td:nth-child(2) div.GENTICS_Table_Cell_editable").get(0).focus(),this.attachLastCellEvents(),GENTICS.Aloha.TableHelper.unselectCells()}},GENTICS.Aloha.Table.prototype.deleteColumns=function(){var a=[],b=!1;if(GENTICS.Aloha.TableHelper.selectedCells.length>0)for(var c=0;c<GENTICS.Aloha.TableHelper.selectedCells[0].length;c++)a.push(GENTICS.Aloha.TableHelper.selectedCells[0][c].cellIndex);else typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"&&a.push(GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.cellIndex);a.length==this.numCols&&(b=!0);if(b){var d=this;GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"Table"),text:GENTICS.Aloha.i18n(GENTICS.Aloha.TablePlugin,"deletetable.confirm"),type:GENTICS.Aloha.Message.Type.CONFIRM,callback:function(a){a=="yes"&&d.deleteTable()}}))}else{a.sort(function(a,b){return a-b});var e=a[0];e>this.numCols-a.length&&e--,this.releaseLastCellEvents();var f=this.obj.find("tr"),g=[];for(var c=0;c<f.length;c++){var h=jQuery(f[c]).children("td").toArray();for(var i=0;i<a.length;i++)g.push(h[a[i]])}for(var c=0;c<g.length;c++)for(var i=0;i<this.cells.length;i++)g[c]==this.cells[i].obj.get(0)&&(this.cells.splice(i,1),i=this.cells.length);for(var c=0;c<g.length;c++)jQuery(g[c]).remove();this.numCols-=a.length,jQuery.browser.msie?setTimeout(this.obj.find("tr:nth-child(2) td:nth-child("+(e+1)+") div.GENTICS_Table_Cell_editable").get(0).focus,5):this.obj.find("tr:nth-child(2) td:nth-child("+(e+1)+") div.GENTICS_Table_Cell_editable").get(0).focus(),this.attachLastCellEvents(),GENTICS.Aloha.TableHelper.unselectCells()}},GENTICS.Aloha.Table.prototype.deleteTable=function(){var a=-1;for(var b=0;b<GENTICS.Aloha.TablePlugin.TableRegistry.length;b++)if(GENTICS.Aloha.TablePlugin.TableRegistry[b].obj.attr("id")==this.obj.attr("id")){a=b;break}if(a>=0){this.deactivate(),GENTICS.Aloha.TableHelper.selectionType=undefined,GENTICS.Aloha.TablePlugin.TableRegistry.splice(b,1);var c=GENTICS.Aloha.Selection.rangeObject;c.startContainer=c.endContainer=this.obj.get(0).parentNode,c.startOffset=c.endOffset=GENTICS.Utils.Dom.getIndexInParent(this.obj.get(0).parentNode),c.clearCaches(),this.obj.remove(),this.parentEditable.obj.focus(),c.correctRange(),c.select()}},GENTICS.Aloha.Table.prototype.addRowsBefore=function(a){this.addRows("before",a)},GENTICS.Aloha.Table.prototype.addRowsAfter=function(a){this.addRows("after",a)},GENTICS.Aloha.Table.prototype.addRows=function(a,b){if(typeof GENTICS.Aloha.TablePlugin.activeTable!="undefined"){this.releaseLastCellEvents();var c=this,d=this.numCols,e=1,f=1;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){e=GENTICS.Aloha.TableHelper.selectedCells.length;switch(a){case"before":GENTICS.Aloha.TableHelper.selectedCells[0].length&&(f=GENTICS.Aloha.TableHelper.selectedCells[0][0].parentNode.rowIndex);break;case"after":var g=GENTICS.Aloha.TableHelper.selectedCells.length-1;GENTICS.Aloha.TableHelper.selectedCells[g].length&&(f=GENTICS.Aloha.TableHelper.selectedCells[g][0].parentNode.rowIndex)}}else typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"&&(f=GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.parentNode.rowIndex);var h=f;a=="after"&&(h+=1);var j=[];for(var k=0;k<e;k++){j.push(h);var l=jQuery("<tr>"),m=jQuery("<td>");m.addClass(this.get("classSelectionColumn")),this.attachRowSelectionEventsToCell(m),l.append(m);for(i=0;i<d;i++){var n=jQuery("<td>");n.html(" ");var o=new GENTICS.Aloha.Table.Cell(n.get(0),GENTICS.Aloha.TablePlugin.activeTable);o.activate(),this.cells.push(o),l.append(o.obj)}var p=jQuery(GENTICS.Aloha.TablePlugin.activeTable.obj.find("tr").get(f));switch(a){case"before":p.before(l);break;case"after":p.after(l);break;default:this.warn(this,"Wrong call of GENTICS.Aloha.Table.prototype.addRow!")}h++,this.numRows++}GENTICS.Aloha.TableHelper.unselectCells(),this.rowsToSelect=j,b&&this.selectRows(),this.attachLastCellEvents()}},GENTICS.Aloha.Table.prototype.addColumnsRight=function(){this.addColumns("right")},GENTICS.Aloha.Table.prototype.addColumnsLeft=function(){this.addColumns("left")},GENTICS.Aloha.Table.prototype.addColumns=function(a){if(typeof GENTICS.Aloha.TablePlugin.activeTable!="undefined"){this.releaseLastCellEvents();var b=this,c=1,d=1;if(GENTICS.Aloha.TableHelper.selectedCells.length>0){c=GENTICS.Aloha.TableHelper.selectedCells[0].length;switch(a){case"left":GENTICS.Aloha.TableHelper.selectedCells[0].length&&(d=GENTICS.Aloha.TableHelper.selectedCells[0][0].cellIndex);break;case"right":var e=GENTICS.Aloha.TableHelper.selectedCells[0].length-1;GENTICS.Aloha.TableHelper.selectedCells[0].length&&(d=GENTICS.Aloha.TableHelper.selectedCells[0][e].cellIndex)}}else typeof GENTICS.Aloha.Table.Cell.lastActiveCell!="undefined"&&(d=GENTICS.Aloha.Table.Cell.lastActiveCell.obj.context.cellIndex);var f=d,g=jQuery("<td>"),h=this.obj.find("tr"),i=[];for(var j=0;j<h.length;j++){var k=f,l=h[j];for(var m=0;m<c;m++){var n=g.clone();n.html(" "),j==0?this.attachColumnSelectEventsToCell(n):(cellObj=new GENTICS.Aloha.Table.Cell(n.get(0),GENTICS.Aloha.TablePlugin.activeTable),this.cells.push(cellObj),cellObj.activate(),n=cellObj.obj);var o=jQuery(jQuery(l).find("td").get(f));switch(a){case"left":jQuery.inArray(k,i)<0&&i.push(k),o.before(n);break;case"right":jQuery.inArray(k+1,i)<0&&i.push(k+1),o.after(n)}k++}}this.numCols+=c,GENTICS.Aloha.TableHelper.unselectCells(),this.columnsToSelect=i,this.selectColumns(),this.attachLastCellEvents()}},GENTICS.Aloha.Table.prototype.focus=function(){this.hasFocus||(this.parentEditable.isActive||this.parentEditable.obj.focus(),GENTICS.Aloha.TablePlugin.setFocusedTable(this))},GENTICS.Aloha.Table.prototype.focusOut=function(){this.hasFocus&&(GENTICS.Aloha.TablePlugin.setFocusedTable(undefined),GENTICS.Aloha.TableHelper.selectionType=undefined)},GENTICS.Aloha.Table.prototype.selectColumns=function(){var a=this.get("classCellSelected");GENTICS.Aloha.TableHelper.unselectCells(),GENTICS.Aloha.TableHelper.selectionType="column",GENTICS.Aloha.FloatingMenu.setScope(GENTICS.Aloha.TablePlugin.getUID("column")),this.columnsToSelect.sort(function(a,b){return a-b});var b=this.obj.find("tr").toArray();b.shift();var c=[];for(var d=0;d<b.length;d++){var e=b[d].cells,f=[];for(var g=0;g<this.columnsToSelect.length;g++){var h=this.columnsToSelect[g],i=e[h];c.push(i),f.push(i)}GENTICS.Aloha.TableHelper.selectedCells.push(f)}this.obj.find("div.GENTICS_Table_Cell_editable").blur(),jQuery(c).addClass(a)},GENTICS.Aloha.Table.prototype.selectRows=function(){var a=this.get("classCellSelected");GENTICS.Aloha.TableHelper.unselectCells(),this.rowsToSelect.sort(function(a,b){return a-b});for(var b=0;b<this.rowsToSelect.length;b++){var c=this.rowsToSelect[b],d=jQuery(this.obj.find("tr").get(c).cells).toArray();d.shift(),GENTICS.Aloha.TableHelper.selectedCells.push(d),jQuery(d).addClass(this.get("classCellSelected"))}GENTICS.Aloha.TableHelper.selectionType="row",GENTICS.Aloha.FloatingMenu.setScope(GENTICS.Aloha.TablePlugin.getUID("row")),this.obj.find("div.GENTICS_Table_Cell_editable").blur()},GENTICS.Aloha.Table.prototype.deactivate=function(){this.obj.removeClass(this.get("className")),GENTICS.Aloha.trim(this.obj.attr("class"))==""&&this.obj.removeAttr("class"),this.obj.parents("."+this.get("classTableWrapper")).length&&this.obj.unwrap(),this.obj.find("tr."+this.get("classSelectionRow")+":first").remove();var a=this;jQuery.each(this.obj.context.rows,function(){jQuery(this).children("td."+a.get("classSelectionColumn")).remove()}),this.obj.find("td, th").removeClass(this.get("classCellSelected")),this.obj.unbind();for(var b=0;b<this.cells.length;b++){var c=this.cells[b];c.deactivate()}this.obj.find("caption div").each(function(){jQuery(this).contents().unwrap()}),this.isActive=!1},GENTICS.Aloha.Table.prototype.toString=function(){return"GENTICS.Aloha.Table"},GENTICS.Aloha.Table.Cell=function(a,b){this.obj=jQuery(a),this.tableObj=b},GENTICS.Aloha.Table.Cell.prototype.tableObj=undefined,GENTICS.Aloha.Table.Cell.prototype.obj=undefined,GENTICS.Aloha.Table.Cell.prototype.wrapper=undefined,GENTICS.Aloha.Table.Cell.prototype.hasFocus=!1,GENTICS.Aloha.Table.Cell.activeCell=undefined,GENTICS.Aloha.Table.Cell.lastActiveCell=undefined,GENTICS.Aloha.Table.Cell.prototype.editableFocus=function(a){this.hasFocus||(this.tableObj.focus(),GENTICS.Aloha.Table.Cell.activeCell=this,GENTICS.Aloha.Table.Cell.lastActiveCell=this,this.obj.addClass("GENTICS_Table_Cell_active"),this.hasFocus=!0,this.selectAll(this.wrapper.get(0)),GENTICS.Aloha.TableHelper.selectionType="cell")},GENTICS.Aloha.Table.Cell.prototype.editableBlur=function(a){GENTICS.Aloha.Table.Cell.activeCell=undefined,this.hasFocus=!1,this.obj.removeClass("GENTICS_Table_Cell_active")},GENTICS.Aloha.Table.Cell.prototype.activate=function(){this.obj.wrapInner("<div/>");var a=this.obj.children("div").eq(0);a.contentEditable(!0),a.addClass("GENTICS_Table_Cell_editable");var b=this;return a.bind("focus",function(a){a.currentTarget&&(a.currentTarget.indexOf=function(){return-1}),b.editableFocus(a)}),a.bind("mousedown",function(a){a.currentTarget&&(a.currentTarget.indexOf=function(){return-1}),b.editableMouseDown(a)}),a.bind("blur",function(a){b.editableBlur(a)}),a.bind("keyup",function(a){b.editableKeyUp(a)}),a.bind("keydown",function(a){b.editableKeyDown(a)}),a.GENTICS_contentEditableSelectionChange(function(b){return GENTICS.Aloha.Selection.onChange(a,b),a}),this.obj.bind("mousedown",function(a){setTimeout(function(){b.wrapper.trigger("focus")},1),GENTICS.Aloha.TableHelper.unselectCells(),a.stopPropagation()}),this.obj.get(0).onselectstart=function(a){return!1},this.wrapper=this.obj.children(),this.wrapper.get(0).onselectstart=function(){window.event.cancelBubble=!0},this},GENTICS.Aloha.Table.Cell.prototype.deactivate=function(){var a=this.obj.children(".GENTICS_Table_Cell_editable");if(a.length){var b=a.html();a.unbind(),a.remove(),this.obj.unbind("click"),GENTICS.Aloha.trim(this.obj.attr("class"))==""&&this.obj.removeAttr("class"),this.obj.html(b)}},GENTICS.Aloha.Table.Cell.prototype.toString=function(){return"GENTICS.Aloha.Table.Cell"},GENTICS.Aloha.Table.Cell.prototype.selectAll=function(a){var b=a.jquery?a.get(0):a;if(!jQuery.browser.msie){var c=window.getSelection();if(c.setBaseAndExtent)c.setBaseAndExtent(b,0,b,b.innerText.length-1);else{window.opera&&b.innerHTML.substring(b.innerHTML.length-4)=="<BR>"&&(b.innerHTML=b.innerHTML+"&#160;");var d=document.createRange();d.selectNodeContents(b),c.removeAllRanges(),c.addRange(d)}}else if(document.getSelection){var c=document.getSelection(),d=document.createRange();d.selectNodeContents(b),c.removeAllRanges(),c.addRange(d)}else if(document.selection){var d=document.body.createTextRange();d.moveToElementText(b),d.select()}GENTICS.Aloha.Selection.updateSelection(a)},GENTICS.Aloha.Table.Cell.prototype.editableMouseDown=function(a){GENTICS.Aloha.TableHelper.unselectCells(),this.tableObj.hasFocus&&a.stopPropagation()},GENTICS.Aloha.Table.Cell.prototype.editableKeyUp=function(a){this.checkForEmptyEvent(a)},GENTICS.Aloha.Table.Cell.prototype.editableKeyDown=function(a){this.checkForEmptyEvent(a);if(!a.ctrlKey&&!a.shiftKey)GENTICS.Aloha.TableHelper.selectedCells.length>0&&GENTICS.Aloha.TableHelper.selectedCells[0].length>0&&(GENTICS.Aloha.TableHelper.selectedCells[0][0].firstChild.focus(),GENTICS.Aloha.TableHelper.unselectCells(),a.stopPropagation());else if(a.shiftKey&&GENTICS.Aloha.TableHelper.selectedCells.length>0){var b=37,c=38,d=39,e=40;switch(GENTICS.Aloha.TableHelper.selectionType){case"row":switch(a.keyCode){case c:var f=GENTICS.Aloha.TableHelper.selectedCells[0][0].parentNode.rowIndex;f>1&&this.tableObj.rowsToSelect.push(f-1);break;case e:var g=GENTICS.Aloha.TableHelper.selectedCells.length-1,h=GENTICS.Aloha.TableHelper.selectedCells[g][0].parentNode.rowIndex;h<this.tableObj.numRows&&this.tableObj.rowsToSelect.push(h+1)}this.tableObj.selectRows();break;case"column":switch(a.keyCode){case b:var i=GENTICS.Aloha.TableHelper.selectedCells[0][0].cellIndex;i>1&&this.tableObj.columnsToSelect.push(i-1);break;case d:var j=GENTICS.Aloha.TableHelper.selectedCells[0].length-1,k=GENTICS.Aloha.TableHelper.selectedCells[0][j].cellIndex;k<this.tableObj.numCols&&this.tableObj.columnsToSelect.push(k+1)}this.tableObj.selectColumns()}return a.stopPropagation(),a.preventDefault(),!1}},GENTICS.Aloha.Table.Cell.prototype.checkForEmptyEvent=function(a){if(jQuery(this.wrapper).children().length>0)return;var b=this.wrapper.text();b==""&&(this.wrapper.text(" "),this.wrapper.get(0).blur(),this.wrapper.get(0).focus())},GENTICS.Aloha.Table.CreateLayer=function(){},GENTICS.Aloha.Table.CreateLayer.prototype.parameters={elemId:"GENTICS_Aloha_Table_createLayer",className:"GENTICS_Table_Createdialog",numX:10,numY:10,layer:undefined,target:undefined},GENTICS.Aloha.Table.CreateLayer.prototype.config=new Object,GENTICS.Aloha.Table.CreateLayer.prototype.visible=!1,GENTICS.Aloha.Table.CreateLayer.prototype.show=function(){var a=this.get("layer");a==null?this.create():(this.setPosition(a),a.find("td").removeClass("hover"),a.show()),this.visible=!0},GENTICS.Aloha.Table.CreateLayer.prototype.create=function(){var a=this,b=jQuery("<div></div>");b.id=this.get("elemId"),b.addClass(this.get("className"));var c=jQuery("<table></table>");c.css("width",(this.get("numX")+6)*15);var d,e;for(var f=0;f<this.get("numY");f++){d=jQuery("<tr></tr>");for(var g=0;g<this.get("numX");g++)e=jQuery("<td> </td>"),f==0&&g==0&&e.addClass("hover"),e.bind("mouseover",{rowId:f,colId:g},function(b){a.handleMouseOver(b,c)}),e.bind("click",{rowId:f,colId:g},function(b){var c=b.data.rowId+1,d=b.data.colId+1;GENTICS.Aloha.TablePlugin.createTable(d,c),a.hide()}),d.append(e);c.append(d)}b.append(c),this.set("layer",b),this.setPosition(),b.bind("click",function(a){a.stopPropagation()}).mousedown(function(a){a.stopPropagation()}),jQuery("body").append(b).bind("click",function(b){b.target!=a.get("target")&&a.visible&&a.hide()})},GENTICS.Aloha.Table.CreateLayer.prototype.handleMouseOver=function(a,b){var c=a.data.rowId,d=a.data.colId,e=b.find("tr");for(var f=0;f<=e.length;f++){var g=jQuery(e[f]).find("td");for(var h=0;h<=g.length;h++)f<=c&&h<=d?jQuery(g[h]).addClass("hover"):jQuery(g[h]).removeClass("hover")}},GENTICS.Aloha.Table.CreateLayer.prototype.setPosition=function(){var a=jQuery(this.get("target")),b=a.offset();this.get("layer").css("left",b.left+"px"),this.get("layer").css("top",b.top+a.height()+"px")},GENTICS.Aloha.Table.CreateLayer.prototype.hide=function(){this.get("layer").hide(),this.visible=!1},GENTICS.Aloha.Table.CreateLayer.prototype.get=function(a){return this.config[a]?this.config[a]:this.parameters[a]?this.parameters[a]:undefined},GENTICS.Aloha.Table.CreateLayer.prototype.set=function(a,b){this.config[a]?this.config[a]=b:this.parameters[a]=b},GENTICS.Aloha.TableHelper=function(){},GENTICS.Aloha.TableHelper.prototype.selectionType=undefined,GENTICS.Aloha.TableHelper.prototype.selectedCells=[],GENTICS.Aloha.TableHelper.prototype.unselectCells=function(){if(this.selectedCells.length>0){for(var a=0;a<this.selectedCells.length;a++)jQuery(this.selectedCells[a]).removeClass(GENTICS.Aloha.TablePlugin.get("classCellSelected"));this.selectedCells=[],this.selectionType=undefined}},GENTICS.Aloha.TableHelper.prototype.getNewTableID=function(){var a="GENTICS_Table_",b=1e6;for(this.tableCounter;!0;this.tableCounter++){var c=a+Math.ceil(Math.random()*b);for(var d=c.length;d<a.length+b.toString().length;d++)c+="0";if(!jQuery("#"+c).length)return c}},GENTICS.Aloha.TableHelper=new GENTICS.Aloha.TableHelper,GENTICS.Aloha.Abbr=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.Abbr"),GENTICS.Aloha.Abbr.languages=["en","de"],GENTICS.Aloha.Abbr.config=["abbr"],GENTICS.Aloha.Abbr.init=function(){this.createButtons(),this.subscribeEvents(),this.bindInteractions()},GENTICS.Aloha.Abbr.createButtons=function(){var a=this;this.formatAbbrButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_abbr",size:"small",onclick:function(){a.formatAbbr()},tooltip:this.i18n("button.abbr.tooltip"),toggle:!0}),GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.formatAbbrButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1),this.insertAbbrButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_abbr",size:"small",onclick:function(){a.insertAbbr(!1)},tooltip:this.i18n("button.addabbr.tooltip"),toggle:!1}),GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.insertAbbrButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.insert"),1),GENTICS.Aloha.FloatingMenu.createScope(this.getUID("abbr"),"GENTICS.Aloha.continuoustext"),this.abbrField=new GENTICS.Aloha.ui.AttributeField({width:320}),GENTICS.Aloha.FloatingMenu.addButton(this.getUID("abbr"),this.abbrField,this.i18n("floatingmenu.tab.abbr"),1)},GENTICS.Aloha.Abbr.bindInteractions=function(){var a=this;this.abbrField.addListener("blur",function(b,c){this.getValue()==""&&a.removeAbbr()});for(var b=0;b<GENTICS.Aloha.editables.length;b++)GENTICS.Aloha.editables[b].obj.keydown(function(b){if(b.metaKey&&b.which==71)return a.findAbbrMarkup()?(GENTICS.Aloha.FloatingMenu.userActivatedTab=a.i18n("floatingmenu.tab.abbr"),GENTICS.Aloha.FloatingMenu.doLayout(),a.abbrField.focus()):a.insertAbbr(),!1})},GENTICS.Aloha.Abbr.subscribeEvents=function(){var a=this;GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(b,c){if(GENTICS.Aloha.activeEditable){var d=a.getEditableConfig(GENTICS.Aloha.activeEditable.obj);if(jQuery.inArray("abbr",d)!=-1)a.formatAbbrButton.show(),a.insertAbbrButton.show();else{a.formatAbbrButton.hide(),a.insertAbbrButton.hide();return}var e=a.findAbbrMarkup(c);e?(a.insertAbbrButton.hide(),a.formatAbbrButton.setPressed(!0),GENTICS.Aloha.FloatingMenu.setScope(a.getUID("abbr")),a.abbrField.setTargetObject(e,"title")):(a.formatAbbrButton.setPressed(!1),a.abbrField.setTargetObject(null)),GENTICS.Aloha.FloatingMenu.doLayout()}})},GENTICS.Aloha.Abbr.findAbbrMarkup=function(a){if(typeof a=="undefined")var a=GENTICS.Aloha.Selection.getRangeObject();return GENTICS.Aloha.activeEditable?a.findMarkup(function(){return this.nodeName.toLowerCase()=="abbr"},GENTICS.Aloha.activeEditable.obj):null},GENTICS.Aloha.Abbr.formatAbbr=function(){var a=GENTICS.Aloha.Selection.getRangeObject();GENTICS.Aloha.activeEditable&&(this.findAbbrMarkup(a)?this.removeAbbr():this.insertAbbr())},GENTICS.Aloha.Abbr.insertAbbr=function(a){if(this.findAbbrMarkup(b))return;GENTICS.Aloha.FloatingMenu.userActivatedTab=this.i18n("floatingmenu.tab.abbr");var b=GENTICS.Aloha.Selection.getRangeObject();b.isCollapsed()&&a!=!1&&GENTICS.Utils.Dom.extendToWord(b);if(b.isCollapsed()){var c=this.i18n("newabbr.defaulttext"),d=jQuery('<abbr title="">'+c+"</abbr>");GENTICS.Utils.Dom.insertIntoDOM(d,b,jQuery(GENTICS.Aloha.activeEditable.obj)),b.startContainer=b.endContainer=d.contents().get(0),b.startOffset=0,b.endOffset=c.length}else{var d=jQuery('<abbr title=""></abbr>');GENTICS.Utils.Dom.addMarkup(b,d,!1)}b.select(),this.abbrField.focus()},GENTICS.Aloha.Abbr.removeAbbr=function(){var a=GENTICS.Aloha.Selection.getRangeObject(),b=this.findAbbrMarkup();b&&(GENTICS.Utils.Dom.removeFromDOM(b,a,!0),GENTICS.Aloha.activeEditable.obj[0].focus(),a.select())},GENTICS.Aloha.Abbr.makeClean=function(a){},GENTICS.Aloha.ListPlugin=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.List"),GENTICS.Aloha.ListPlugin.languages=["en","de","fr","eo","fi","ru","it"],GENTICS.Aloha.ListPlugin.config=["ul","ol"],GENTICS.Aloha.ListPlugin.transformableElements={p:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,ul:!0,ol:!0},GENTICS.Aloha.ListPlugin.init=function(){var a=this;this.createUnorderedListButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_ul",size:"small",tooltip:this.i18n("button.createulist.tooltip"),toggle:!0,onclick:function(b,c){a.transformList(!1)}}),GENTICS.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.createUnorderedListButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1),this.createOrderedListButton=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button GENTICS_button_ol",size:"small",tooltip:this.i18n("button.createolist.tooltip"),toggle:!0,onclick:function(b,c){a.transformList(!0)}}),GENTICS
.Aloha.FloatingMenu.addButton("GENTICS.Aloha.continuoustext",this.createOrderedListButton,GENTICS.Aloha.i18n(GENTICS.Aloha,"floatingmenu.tab.format"),1),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(b,c){a.createUnorderedListButton.setPressed(!1),a.createOrderedListButton.setPressed(!1);for(var d=0;d<c.markupEffectiveAtStart.length;d++){var e=c.markupEffectiveAtStart[d];if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(e,jQuery("<ul></ul>"))){a.createUnorderedListButton.setPressed(!0);break}if(GENTICS.Aloha.Selection.standardTextLevelSemanticsComparator(e,jQuery("<ol></ol>"))){a.createOrderedListButton.setPressed(!0);break}}GENTICS.Aloha.activeEditable&&a.applyButtonConfig(GENTICS.Aloha.activeEditable.obj),GENTICS.Aloha.FloatingMenu.doLayout()}),GENTICS.Aloha.Markup.addKeyHandler(9,function(b){return a.processTab(b)})},GENTICS.Aloha.ListPlugin.applyButtonConfig=function(a){var b=this.getEditableConfig(a);GENTICS.Aloha.Selection.rangeObject.unmodifiableMarkupAtStart[0]&&(jQuery.inArray("ul",b)!=-1&&GENTICS.Aloha.Selection.canTag1WrapTag2(GENTICS.Aloha.Selection.rangeObject.unmodifiableMarkupAtStart[0].nodeName,"ul")!=-1?this.createUnorderedListButton.show():this.createUnorderedListButton.hide(),jQuery.inArray("ol",b)!=-1&&GENTICS.Aloha.Selection.canTag1WrapTag2(GENTICS.Aloha.Selection.rangeObject.unmodifiableMarkupAtStart[0].nodeName,"ol")!=-1?this.createOrderedListButton.show():this.createOrderedListButton.hide())},GENTICS.Aloha.ListPlugin.processTab=function(a){switch(a.keyCode){case 9:return a.shiftKey?this.outdentList():this.indentList()}return!0},GENTICS.Aloha.ListPlugin.getStartingDomObjectToTransform=function(){var a=GENTICS.Aloha.Selection.rangeObject;for(var b=0;b<a.markupEffectiveAtStart.length;b++){var c=a.markupEffectiveAtStart[b];if(this.transformableElements[c.nodeName.toLowerCase()])return c}return!1},GENTICS.Aloha.ListPlugin.getNearestSelectedListItem=function(){var a=GENTICS.Aloha.Selection.rangeObject;for(var b=0;b<a.markupEffectiveAtStart.length;b++){var c=a.markupEffectiveAtStart[b];if(GENTICS.Utils.Dom.isListElement(c))return c}return!1},GENTICS.Aloha.ListPlugin.transformList=function(a){var b=this.getStartingDomObjectToTransform();if(!b){GENTICS.Aloha.Selection.changeMarkupOnSelection(jQuery("<p></p>")),b=this.getStartingDomObjectToTransform();if(!b){GENTICS.Aloha.Log.error(this,"Could not transform selection into a list");return}}var c=b.nodeName.toLowerCase();if(c=="ul"&&!a){var d=jQuery(b),e=d.parent();if(e.length>0&&GENTICS.Utils.Dom.isListElement(e.get(0)))d.children().unwrap();else{var f=jQuery(b);jQuery.each(f.children("li"),function(a,b){var c=GENTICS.Aloha.Markup.transformDomObject(b,"p");c.after(c.children("ol,ul"))}),f.children().unwrap()}}else if(c=="ul"&&a)GENTICS.Aloha.Markup.transformDomObject(b,"ol"),this.mergeAdjacentLists(jQuery(b));else if(c=="ol"&&!a)GENTICS.Aloha.Markup.transformDomObject(b,"ul"),this.mergeAdjacentLists(jQuery(b));else if(c=="ol"&&a){var d=jQuery(b),e=d.parent();if(e.length>0&&GENTICS.Utils.Dom.isListElement(e.get(0)))d.children().unwrap();else{var f=jQuery(b);jQuery.each(f.children("li"),function(a,b){var c=GENTICS.Aloha.Markup.transformDomObject(b,"p");c.after(c.children("ol,ul"))}),f.children().unwrap()}}else{var g=GENTICS.Aloha.Selection.rangeObject.getSelectedSiblings(b),d=a?jQuery("<ol></ol>"):jQuery("<ul></ul>"),h=jQuery("<li></li>");d.append(h),jQuery(b).contents().appendTo(h),jQuery(b).replaceWith(d);if(g){var i=!1;for(var j=0;j<g.length;++j)if(GENTICS.Utils.Dom.isBlockLevelElement(g[j]))i&&(i=!1),h=GENTICS.Aloha.Markup.transformDomObject(g[j],"li"),d.append(h);else{if(g[j].nodeType==3&&jQuery.trim(g[j].data).length==0)continue;i||(i=jQuery("<li></li>"),d.append(i)),i.append(g[j])}}this.mergeAdjacentLists(d)}this.refreshSelection()},GENTICS.Aloha.ListPlugin.indentList=function(){var a=this.getNearestSelectedListItem();if(a){var b=jQuery(a).prev("li");if(b.length==0)return!1;var c=jQuery(a).parent(),d=GENTICS.Aloha.Selection.rangeObject.getSelectedSiblings(a),e=jQuery(a).parent().clone(!1).empty();e.append(a),b.append(e);if(d)for(var f=0;f<d.length;++f)e.append(jQuery(d[f]));return this.mergeAdjacentLists(e),this.refreshSelection(),!1}return!0},GENTICS.Aloha.ListPlugin.outdentList=function(){var a=this.getNearestSelectedListItem();if(a){var b=jQuery(a),c=b.parent(),d=c.parents("ul,ol"),e=c.parent("li");if(d.length>0&&GENTICS.Utils.Dom.isListElement(d.get(0))){var f=GENTICS.Aloha.Selection.rangeObject.getSelectedSiblings(a);if(f&&f.length>0)var g=jQuery(f[f.length-1]);else var g=b;if(g.nextAll("li").length>0){var h=c.clone(!1).empty();h.append(g.nextAll())}e.length>0?(typeof h!="undefined"&&b.append(h),e.after(b)):c.before(b);if(f&&f.length>0)for(var i=f.length-1;i>=0;--i)b.after(jQuery(f[i]));c.contents("li").length==0&&c.remove(),e.length>0&&e.contents().length==0&&e.remove(),this.refreshSelection()}return!1}return!0},GENTICS.Aloha.ListPlugin.refreshSelection=function(){GENTICS.Aloha.activeEditable&&GENTICS.Aloha.activeEditable.obj[0].focus(),GENTICS.Aloha.Selection.rangeObject.update(),GENTICS.Aloha.Selection.rangeObject.select(),GENTICS.Aloha.Selection.updateSelection()},GENTICS.Aloha.ListPlugin.mergeAdjacentLists=function(a){var b=a.get(0);while(b.previousSibling&&b.previousSibling.nodeType==1&&b.previousSibling.nodeName==b.nodeName)b=b.previousSibling;a=jQuery(b);while(b.nextSibling&&(b.nextSibling.nodeType==1&&b.nextSibling.nodeName==b.nodeName||b.nextSibling.nodeType==3&&jQuery.trim(b.nextSibling.data).length==0)){var c=jQuery(b.nextSibling);b.nextSibling.nodeType==1&&c.contents().appendTo(a),c.remove()}},GENTICS.Aloha.Image=new GENTICS.Aloha.Plugin("at.tapo.aloha.plugins.Image"),GENTICS.Aloha.Image.languages=["en","de"],GENTICS.Aloha.Image.getImage=function(){var a=GENTICS.Aloha.Selection.getRangeObject(),b=a.getRangeTree();for(var c=0;c<b.length;c++)if(b[c].type=="full"&&b[c].domobj.nodeName.toLowerCase()=="img")return b[c].domobj;return undefined};var TAPO=function(){var a=GENTICS.Aloha.Image.getImage;GENTICS.Aloha.Image.init=function(){var b=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button TAPO_image_align_left",size:"small",onclick:function(){var b=a();jQuery(b).css("float","left")},tooltip:GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"align.left")}),c=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button TAPO_image_align_none",size:"small",onclick:function(){var b=a();jQuery(b).css("float","")},tooltip:GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"align.none")}),d=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button TAPO_image_align_right",size:"small",onclick:function(){var b=a();jQuery(b).css("float","right")},tooltip:GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"align.right")}),e=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button TAPO_image_border",size:"small",onclick:function(){var b=a();jQuery(b).css("border")?jQuery(b).css("border",""):jQuery(b).css("border","2px solid red")},toggle:!0,tooltip:GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"border")}),f=new GENTICS.Aloha.ui.Button({iconClass:"GENTICS_button TAPO_image_title",size:"small",onclick:function(){var b=a(),c=jQuery(b).attr("title");c=prompt(GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"image.title.prompt"),c),jQuery(b).attr("title",c),f.setPressed(c)},tooltip:GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"title"),toggle:!0});GENTICS.Aloha.FloatingMenu.createScope("image"),GENTICS.Aloha.FloatingMenu.addButton("image",b,GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"floatingmenu.tab.image"),1),GENTICS.Aloha.FloatingMenu.addButton("image",d,GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"floatingmenu.tab.image"),1),GENTICS.Aloha.FloatingMenu.addButton("image",c,GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"floatingmenu.tab.image"),1),GENTICS.Aloha.FloatingMenu.addButton("image",e,GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"floatingmenu.tab.image"),2),GENTICS.Aloha.FloatingMenu.addButton("image",f,GENTICS.Aloha.i18n(GENTICS.Aloha.Image,"floatingmenu.tab.image"),3),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"selectionChanged",function(b,c){var d=a();d?(GENTICS.Aloha.FloatingMenu.setScope("image"),e.setPressed(jQuery(d).css("border"))):e.setPressed(!1),GENTICS.Aloha.FloatingMenu.doLayout()}),GENTICS.Aloha.EventRegistry.subscribe(GENTICS.Aloha,"editableCreated",function(a,b){jQuery(b.obj).bind("drop",function(a){var b=a.originalEvent,c=b.dataTransfer.files,d=c.length;if(d<1)return!0;for(var e=0;e<c.length;e++){var f=new FileReader;f.onloadend=function(a){var b=jQuery('<img src="" alt="xyz" />');b.attr("src",a.target.result),GENTICS.Utils.Dom.insertIntoDOM(b,GENTICS.Aloha.Selection.getRangeObject(),jQuery(GENTICS.Aloha.activeEditable.obj))},f.readAsDataURL(c[e])}return!1})})}}();(function(){$(function(){return $("[contenteditable]").aloha()})}).call(this),function(){GENTICS.Aloha.settings={ribbon:!1,errorhandling:!0,i18n:{current:"en"},plugins:{"com.gentics.aloha.plugins.Format":{config:["b","i","u","del","sub","sup","p","title","h2","h3","removeFormat"]}}},$(document).bind("sailenjoy:load",function(){return $(".admin textarea").aloha()})}.call(this),function(){}.call(this),function(){var a;$(document).ready(function(){return $(document).bind("sailenjoy:load",function(){return $(".contact.new #small").googlemap()})}),a="ABQIAAAAXPKFWeAwmFOKIz_vr04lbhSQShRg9Igo0lggPPGYLwef47M4VRTiP4Fn2RINMtMxx-cedlj1ZQzgdA",$.widget("ui.googlemap",{_init:function(){var b,c,d;return d=this,this.element.size()===0?null:!window.google||!google.maps?(b=arguments,c="callback_"+Math.random().toString().replace(".",""),window[c]=function(){d.addMap(),window[c]=null;try{return delete window[c]}catch(a){return null}},$.getScript("http://www.google.com/jsapi?key="+a+"&callback="+c)):d.addMap()},addMap:function(){var a,b;return a=$(document).data("maps"),a?this.element.html(a):(b=this,this.element.html('<div id="map_container"><div id="map" /><div class="map_overlay top" /><div class="map_overlay left" /><div class="map_overlay right" /><div class="map_overlay bottom" /></div>'),$(".map_overlay").each(function(){var a,b,c;return b=$(this),c=b.css("background-image").match(/url\(([^)]+)\)/)[1],a=$('<img src="'+c+'" />').attr("class",b.attr("class")),b.replaceWith(a)}),google.load("maps","2",{callback:function(){var a;return a=new google.maps.Map2($("#map")[0]),a.setCenter(new google.maps.LatLng(52.21539038101605,4.546623229980469),13),a.addOverlay(new GMarker(new GLatLng(52.215535,4.553339))),a.setMapType(G_HYBRID_MAP),$("#map_container").hover(b.grow,b.shrink),b.element.delay(1e3).addClass("nobg"),$(document).data("map",$("#map"))}}))},grow:function(){return $("#map_container, #map").addClass("grown",{easing:"InOutCubic",duration:2e3})},shrink:function(){return $("#map_container, #map").removeClass("grown",{easing:"InOutCubic",duration:2e3})}})}.call(this),function(){$(document).bind("sailenjoy:load",function(){return $.sailenjoy.handleFlash()}),$.sailenjoy||($.sailenjoy={}),$.sailenjoy.handleFlash=function(){return $("#flash").delay(4e3).fadeOut(2e3,function(){return $(this).remove()})}}.call(this),function(){$(document).ready(function(){return $.ga.load("UA-7865273-1")})}.call(this),function(){$(document).bind("sailenjoy:load",function(){return $("form.menu .items .inputs ol").prepend('<li class="handle">'),$("form.menu .menu-item_delta").hide(),$("form.menu .items").sortable({items:".inputs",containment:"parent",axis:"y",handle:".handle",update:function(){return $(".inputs",this).each(function(a,b){return $(".menu-item_delta input",b).val(a+1)})}})})}.call(this),function(){$.sailenjoy||($.sailenjoy={}),$.sailenjoy.nextAction=function(a,b){var c,d;return c=$("#flash",a),d=$("#action_wrapper",a),$.sailenjoy.replace(d,b,c)},$.sailenjoy.finish=function(a){return $(".navigate").removeClass("navigate"),$("a.current").removeClass("current"),$('a[href="'+a+'"]').addClass("current")},$.sailenjoy.replace=function(a,b,c){var d;c==null&&(c=null),d=$("html").queue("sailenjoy:replace").length===0,$.queue($("html")[0],"sailenjoy:replace",function(){var d;d=$(".action_wrapper"),a.hide().appendTo(d.parent()).fadeIn(1e3,"easeInCubic"),d.fadeOut(1e3,"easeInCubic",function(){return d.remove(),$(document).trigger("sailenjoy:load"),$.sailenjoy.finish(b),$.dequeue($("html")[0],"sailenjoy:replace")});if(c)return c.prependTo("#site_wrapper"),$.sailenjoy.handleFlash()});if(d)return $("html").dequeue("sailenjoy:replace")},$.sailenjoy.goto=function(a){return $.bbq.pushState({url:a})},$(document).ready(function(){return $(document).trigger("sailenjoy:load"),$("#site_wrapper form").live("ajax:beforeSend",function(a,b,c){var d;return d=$(this).find('input[name="commit"]'),d.data("origText",d.val()),d.val("Submitting...")}).live("ajax:success",function(a,b,c,d){return $(":input",this).val("")}).live("ajax:complete",function(a,b,c){var d;return d=$(this).find('input[name="commit"]'),d.val($(d).data("origText"))}).live("ajax:error",function(a,b,c,d){return $(this).parents("#action_wrapper:first").html(b.responseText)}),$("#site_wrapper a").live("click",function(){var a;a=$(this).attr("href");if(!a.match(/^http/))return $.sailenjoy.goto(a),!1}),$(window).bind("hashchange",function(a){var b,c;c=$.bbq.getState("url");if(c){try{$.ga.trackPageView(c)}catch(d){}return b=$('a[href="'+c+'"]').add("html"),b.addClass("navigate"),$.ajax({url:c,cache:!0,async:!1,success:function(a){return $.sailenjoy.nextAction(a,c)},error:function(){return b.removeClass("navigate"),window.location=c}})}}),$.bbq.getState("url")&&$(window).trigger("hashchange"),!0})}.call(this),function(){}.call(this),function(){}.call(this),function(){$(document).bind("sailenjoy:load",function(){var a;return $(".admin  .photo_album.show #large .content").hide(),a=$("form.photo_album .photos"),a.append('<input type="button" class="add-another" value="Nog één" />'),$(".add-another",a).click(function(){var a,b,c;return b=$("form.photo_album .photos fieldset:last"),c=function(a){return parseInt(a)+1},a=$("<div>").append(b.clone()).html(),b.after(a.replace(/\d+(?=\_)|\d+(?=\])/g,c))})})}.call(this),function(){$(document).bind("sailenjoy:load",function(){return $(".photos.slideshow").cycle({easing:"easeInQuad",fx:"fade",speed:2e3,timeout:5e3})})}.call(this),function(){$(document).ready(function(){return $("#quotes-footer ul").cycle({easing:"easeInOutExpo",fx:"scrollLeft",speed:1e3,timeout:5e3})})}.call(this),function(){}.call(this)
