/*
 Rangy, a cross-browser JavaScript range and selection library
 http://code.google.com/p/rangy/

 Copyright 2011, Tim Down
 Licensed under the MIT license.
 Version: 1.2.1
 Build date: 8 October 2011
 MIT License {@link http://creativecommons.org/licenses/MIT/}
 @return {String} outerHtml
 jquery.layout 1.3.0 - Release Candidate 29.14
 $Date: 2011-02-13 08:00:00 (Sun, 13 Feb 2011) $
 $Rev: 302914 $

 Copyright (c) 2010 
   Fabrizio Balliano (http://www.fabrizioballiano.net)
   Kevin Dalman (http://allpro.net)

 Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
 and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.

 Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc29.13

 Docs: http://layout.jquery-dev.net/documentation.html
 Tips: http://layout.jquery-dev.net/tips.html
 Help: http://groups.google.com/group/jquery-ui-layout
 RequireJS i18n 2.0.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details
*/
(function(){function Ga(m,e){var a;a=m||{};this.jQuery=e||{};this.config={};this.config.elements=a.elements?a.elements:[];this.config.attributes=a.attributes?a.attributes:{};this.config.attributes[Ga.ALL]=this.config.attributes[Ga.ALL]?this.config.attributes[Ga.ALL]:[];this.config.allow_comments=a.allow_comments?a.allow_comments:!1;this.allowed_elements={};this.config.protocols=a.protocols?a.protocols:{};this.config.add_attributes=a.add_attributes?a.add_attributes:{};this.dom=a.dom?a.dom:document;
for(var j=0,d=this.config.elements.length;j<d;j++)this.allowed_elements[this.config.elements[j]]=!0;this.config.remove_element_contents={};this.config.remove_all_contents=!1;if(a.remove_contents)if(a.remove_contents instanceof Array)for(var b=this.config.remove_element_contents,j=0,d=a.remove_contents.length;j<d;j++)b[a.remove_contents[j]]=!0;else this.config.remove_all_contents=!0;this.transformers=a.transformers?a.transformers:[];this.filters=a.filters?a.filters:[]}var ha;ha||(ha={});(function(){function m(a){return 10>
a?"0"+a:a}function e(a){d.lastIndex=0;return d.test(a)?'"'+a.replace(d,function(a){var b=l[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function a(d,c){var l,j,o,p,r=b,t,m=c[d];m&&("object"===typeof m&&"function"===typeof m.toJSON)&&(m=m.toJSON(d));"function"===typeof g&&(m=g.call(c,d,m));switch(typeof m){case "string":return e(m);case "number":return isFinite(m)?""+m:"null";case "boolean":case "null":return""+m;case "object":if(!m)return"null";
b+=f;t=[];if("[object Array]"===Object.prototype.toString.apply(m)){p=m.length;for(l=0;l<p;l+=1)t[l]=a(l,m)||"null";o=0===t.length?"[]":b?"[\n"+b+t.join(",\n"+b)+"\n"+r+"]":"["+t.join(",")+"]";b=r;return o}if(g&&"object"===typeof g){p=g.length;for(l=0;l<p;l+=1)"string"===typeof g[l]&&(j=g[l],(o=a(j,m))&&t.push(e(j)+(b?": ":":")+o))}else for(j in m)Object.prototype.hasOwnProperty.call(m,j)&&(o=a(j,m))&&t.push(e(j)+(b?": ":":")+o);o=0===t.length?"{}":b?"{\n"+b+t.join(",\n"+b)+"\n"+r+"}":"{"+t.join(",")+
"}";b=r;return o}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+m(this.getUTCMonth()+1)+"-"+m(this.getUTCDate())+"T"+m(this.getUTCHours())+":"+m(this.getUTCMinutes())+":"+m(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var j=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,b,f,l={"":"\\b","\t":"\\t","\n":"\\n","":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},g;"function"!==typeof ha.stringify&&(ha.stringify=function(d,c,l){var e;f=b="";if(typeof l==="number")for(e=0;e<l;e=e+1)f=f+" ";else typeof l==="string"&&(f=l);if((g=c)&&typeof c!=="function"&&(typeof c!=="object"||typeof c.length!=="number"))throw Error("JSON.stringify");return a("",{"":d})});
"function"!==typeof ha.parse&&(ha.parse=function(a,c){function b(a,d){var g,f,k=a[d];if(k&&typeof k==="object")for(g in k)if(Object.prototype.hasOwnProperty.call(k,g)){f=b(k,g);f!==void 0?k[g]=f:delete k[g]}return c.call(a,d,k)}var d,a=""+a;j.lastIndex=0;j.test(a)&&(a=a.replace(j,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){d=eval("("+a+")");return typeof c==="function"?b({"":d},""):d}throw new SyntaxError("JSON.parse");})})();define("util/json2",[],function(){return ha});(function(){var m=function(){function e(a,b){var d=typeof a[b];return d==c||!!(d==k&&a[b])||"unknown"==d}function a(a,c){return!!(typeof a[c]==k&&a[c])}function j(a,c){return typeof a[c]!=q}function d(a){return function(c,b){for(var d=b.length;d--;)if(!a(c,b[d]))return!1;return!0}}function b(a){return a&&t(a,
r)&&v(a,p)}function f(a){window.alert("Rangy not supported in your browser. Reason: "+a);u.initialized=!0;u.supported=!1}function l(){if(!u.initialized){var c,d=!1,g=!1;e(document,"createRange")&&(c=document.createRange(),t(c,o)&&v(c,n)&&(d=!0),c.detach());if((c=document.createElement("body"))&&e(c,"createTextRange"))c=c.createTextRange(),b(c)&&(g=!0);!d&&!g&&f("Neither Range nor TextRange are implemented");u.initialized=!0;u.features={implementsDomRange:d,implementsTextRange:g};d=C.concat(z);g=0;
for(c=d.length;g<c;++g)try{d[g](u)}catch(k){a(window,"console")&&e(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",k)}}}function g(a){this.name=a;this.supported=this.initialized=!1}var k="object",c="function",q="undefined",n="startContainer startOffset endContainer endOffset collapsed commonAncestorContainer START_TO_START START_TO_END END_TO_START END_TO_END".split(" "),o="setStart setStartBefore setStartAfter setEnd setEndBefore setEndAfter collapse selectNode selectNodeContents compareBoundaryPoints deleteContents extractContents cloneContents insertNode surroundContents cloneRange toString detach".split(" "),
p="boundingHeight boundingLeft boundingTop boundingWidth htmlText text".split(" "),r="collapse compareEndPoints duplicate getBookmark moveToBookmark moveToElementText parentElement pasteHTML select setEndPoint getBoundingClientRect".split(" "),t=d(e),m=d(a),v=d(j),u={version:"1.2.1",initialized:!1,supported:!0,util:{isHostMethod:e,isHostObject:a,isHostProperty:j,areHostMethods:t,areHostObjects:m,areHostProperties:v,isTextRange:b},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};
u.fail=f;u.warn=function(a){a="Rangy warning: "+a;u.config.alertOnWarn?window.alert(a):typeof window.console!=q&&typeof window.console.log!=q&&window.console.log(a)};({}).hasOwnProperty?u.util.extend=function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])}:f("hasOwnProperty not supported");var z=[],C=[];u.init=l;u.addInitListener=function(a){u.initialized?a(u):z.push(a)};var F=[];u.addCreateMissingNativeApiListener=function(a){F.push(a)};u.createMissingNativeApi=function(a){a=a||window;l();
for(var c=0,b=F.length;c<b;++c)F[c](a)};g.prototype.fail=function(a){this.initialized=!0;this.supported=!1;throw Error("Module '"+this.name+"' failed to load: "+a);};g.prototype.warn=function(a){u.warn("Module "+this.name+": "+a)};g.prototype.createError=function(a){return Error("Error in Rangy "+this.name+" module: "+a)};u.createModule=function(a,c){var b=new g(a);u.modules[a]=b;C.push(function(a){c(a,b);b.initialized=!0;b.supported=!0})};u.requireModules=function(a){for(var c=0,b=a.length,d,f;c<
b;++c){f=a[c];d=u.modules[f];if(!d||!(d instanceof g))throw Error("Module '"+f+"' not found");if(!d.supported)throw Error("Module '"+f+"' not supported");}};var A=!1,m=function(){A||(A=!0,u.initialized||l())};if(typeof window==q)f("No window found");else if(typeof document==q)f("No document found");else return e(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",m,!1),e(window,"addEventListener")?window.addEventListener("load",m,!1):e(window,"attachEvent")?window.attachEvent("onload",
m):f("Window does not have required addEventListener or attachEvent method"),u}();m.createModule("DomUtil",function(e,a){function j(a){for(var c=0;a=a.previousSibling;)c++;return c}function d(a,c){var b=[],d;for(d=a;d;d=d.parentNode)b.push(d);for(d=c;d;d=d.parentNode)if(m(b,d))return d;return null}function b(a,c,b){for(b=b?a:a.parentNode;b;){a=b.parentNode;if(a===c)return b;b=a}return null}function f(a){a=a.nodeType;return 3==a||4==a||8==a}function l(a,c){var b=c.nextSibling,d=c.parentNode;b?d.insertBefore(a,
b):d.appendChild(a);return a}function g(a){if(9==a.nodeType)return a;if(typeof a.ownerDocument!=p)return a.ownerDocument;if(typeof a.document!=p)return a.document;if(a.parentNode)return g(a.parentNode);throw Error("getDocument: no document found for node");}function k(a){if(a)return a.previousSibling?a.previousSibling.nextSibling:a.nextSibling?a.nextSibling.previousSibling:a.parentNode?a.parentNode.firstChild:a}function c(a){return!a?"[No node]":f(a)?'"'+a.data+'"':1==a.nodeType?"<"+a.nodeName+(a.id?
' id="'+a.id+'"':"")+">["+a.childNodes.length+"]":a.nodeName}function q(a){this._next=this.root=a}function n(a,c){this.node=a;this.offset=c}function o(a){this.code=this[a];this.codeName=a;this.message="DOMException: "+this.codeName}var p="undefined",r=e.util;r.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||a.fail("document missing a Node creation method");r.isHostMethod(document,"getElementsByTagName")||a.fail("document missing getElementsByTagName method");
var t=document.createElement("div");r.areHostMethods(t,["insertBefore","appendChild","cloneNode"])||a.fail("Incomplete Element implementation");r.isHostProperty(t,"innerHTML")||a.fail("Element is missing innerHTML property");t=document.createTextNode("test");r.areHostMethods(t,["splitText","deleteData","insertData","appendData","cloneNode"])||a.fail("Incomplete Text Node implementation");var m=function(a,c){for(var b=a.length;b--;)if(a[b]===c)return!0;return!1};q.prototype={_current:null,hasNext:function(){return!!this._next},
next:function(){var a=this._current=this._next,c;if(this._current){c=a.firstChild;if(!c)for(c=null;a!==this.root&&!(c=a.nextSibling);)a=a.parentNode;this._next=c}return this._current},detach:function(){this._current=this._next=this.root=null}};n.prototype={equals:function(a){return this.node===a.node&this.offset==a.offset},inspect:function(){return"[DomPosition("+c(this.node)+":"+this.offset+")]"}};o.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,
NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11};o.prototype.toString=function(){return this.message};e.dom={arrayContains:m,isHtmlNamespace:function(a){var c;return typeof a.namespaceURI==p||null===(c=a.namespaceURI)||"http://www.w3.org/1999/xhtml"==c},parentElement:function(a){a=a.parentNode;return 1==a.nodeType?a:null},getNodeIndex:j,getNodeLength:function(a){var c;return f(a)?a.length:(c=a.childNodes)?c.length:0},getCommonAncestor:d,isAncestorOf:function(a,c,b){for(c=b?c:c.parentNode;c;){if(c===
a)return!0;c=c.parentNode}return!1},getClosestAncestorIn:b,isCharacterDataNode:f,insertAfter:l,splitDataNode:function(a,c){var b=a.cloneNode(!1);b.deleteData(0,c);a.deleteData(c,a.length-c);l(b,a);return b},getDocument:g,getWindow:function(a){a=g(a);if(typeof a.defaultView!=p)return a.defaultView;if(typeof a.parentWindow!=p)return a.parentWindow;throw Error("Cannot get a window object for node");},getIframeWindow:function(a){if(typeof a.contentWindow!=p)return a.contentWindow;if(typeof a.contentDocument!=
p)return a.contentDocument.defaultView;throw Error("getIframeWindow: No Window object found for iframe element");},getIframeDocument:function(a){if(typeof a.contentDocument!=p)return a.contentDocument;if(typeof a.contentWindow!=p)return a.contentWindow.document;throw Error("getIframeWindow: No Document object found for iframe element");},getBody:function(a){return r.isHostObject(a,"body")?a.body:a.getElementsByTagName("body")[0]},getRootContainer:function(a){for(var c;c=a.parentNode;)a=c;return a},
comparePoints:function(a,c,g,f){var a=k(a),g=k(g),l;if(a==g)return c===f?0:c<f?-1:1;if(l=b(g,a,!0))return c<=j(l)?-1:1;if(l=b(a,g,!0))return j(l)<f?-1:1;c=d(a,g);a=a===c?c:b(a,c,!0);g=g===c?c:b(g,c,!0);if(a===g)throw Error("comparePoints got to case 4 and childA and childB are the same!");for(c=c.firstChild;c;){if(c===a)return-1;if(c===g)return 1;c=c.nextSibling}throw Error("Should not be here!");},inspectNode:c,fragmentFromNodeChildren:function(a){for(var c=g(a).createDocumentFragment(),b;b=a.firstChild;)c.appendChild(b);
return c},createIterator:function(a){return new q(a)},DomPosition:n};e.DOMException=o});m.createModule("DomRange",function(e){function a(a,c){return 3!=a.nodeType&&(H.isAncestorOf(a,c.startContainer,!0)||H.isAncestorOf(a,c.endContainer,!0))}function j(a){return H.getDocument(a.startContainer)}function d(a,c,b){if(c=a._listeners[c])for(var d=0,g=c.length;d<g;++d)c[d].call(a,{target:a,args:b})}function b(a){return new R(a.parentNode,H.getNodeIndex(a))}function f(a){return new R(a.parentNode,H.getNodeIndex(a)+
1)}function l(a,c,b){var d=11==a.nodeType?a.firstChild:a;H.isCharacterDataNode(c)?b==c.length?H.insertAfter(a,c):c.parentNode.insertBefore(a,0==b?c:H.splitDataNode(c,b)):b>=c.childNodes.length?c.appendChild(a):c.insertBefore(a,c.childNodes[b]);return d}function g(a){for(var c,b,d=j(a.range).createDocumentFragment();b=a.next();){c=a.isPartiallySelectedSubtree();b=b.cloneNode(!c);c&&(c=a.getSubtreeIterator(),b.appendChild(g(c)),c.detach(!0));if(10==b.nodeType)throw new L("HIERARCHY_REQUEST_ERR");d.appendChild(b)}return d}
function k(a,c,b){for(var d,g,b=b||{stop:!1};d=a.next();)if(a.isPartiallySelectedSubtree())if(!1===c(d)){b.stop=!0;break}else{if(d=a.getSubtreeIterator(),k(d,c,b),d.detach(!0),b.stop)break}else for(d=H.createIterator(d);g=d.next();)if(!1===c(g)){b.stop=!0;return}}function c(a){for(var b;a.next();)a.isPartiallySelectedSubtree()?(b=a.getSubtreeIterator(),c(b),b.detach(!0)):a.remove()}function q(a){for(var c,b=j(a.range).createDocumentFragment(),d;c=a.next();){a.isPartiallySelectedSubtree()?(c=c.cloneNode(!1),
d=a.getSubtreeIterator(),c.appendChild(q(d)),d.detach(!0)):a.remove();if(10==c.nodeType)throw new L("HIERARCHY_REQUEST_ERR");b.appendChild(c)}return b}function n(a,c,b){var d=!(!c||!c.length),g,f=!!b;d&&(g=RegExp("^("+c.join("|")+")$"));var l=[];k(new p(a,!1),function(a){(!d||g.test(a.nodeType))&&(!f||b(a))&&l.push(a)});return l}function o(a){return"["+("undefined"==typeof a.getName?"Range":a.getName())+"("+H.inspectNode(a.startContainer)+":"+a.startOffset+", "+H.inspectNode(a.endContainer)+":"+a.endOffset+
")]"}function p(a,c){this.range=a;this.clonePartiallySelectedTextNodes=c;if(!a.collapsed){this.sc=a.startContainer;this.so=a.startOffset;this.ec=a.endContainer;this.eo=a.endOffset;var b=a.commonAncestorContainer;this.sc===this.ec&&H.isCharacterDataNode(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===b&&!H.isCharacterDataNode(this.sc)?this.sc.childNodes[this.so]:H.getClosestAncestorIn(this.sc,b,!0),this._last=this.ec===b&&!H.isCharacterDataNode(this.ec)?
this.ec.childNodes[this.eo-1]:H.getClosestAncestorIn(this.ec,b,!0))}}function r(a){this.code=this[a];this.codeName=a;this.message="RangeException: "+this.codeName}function t(a,c,b){this.nodes=n(a,c,b);this._next=this.nodes[0];this._position=0}function m(a){return function(c,b){for(var d,g=b?c:c.parentNode;g;){d=g.nodeType;if(H.arrayContains(a,d))return g;g=g.parentNode}return null}}function v(a,c){if(V(a,c))throw new r("INVALID_NODE_TYPE_ERR");}function u(a){if(!a.startContainer)throw new L("INVALID_STATE_ERR");
}function z(a,c){if(!H.arrayContains(c,a.nodeType))throw new r("INVALID_NODE_TYPE_ERR");}function C(a,c){if(0>c||c>(H.isCharacterDataNode(a)?a.length:a.childNodes.length))throw new L("INDEX_SIZE_ERR");}function F(a,c){if(X(a,!0)!==X(c,!0))throw new L("WRONG_DOCUMENT_ERR");}function A(a){if(U(a,!0))throw new L("NO_MODIFICATION_ALLOWED_ERR");}function E(a,c){if(!a)throw new L(c);}function J(a){u(a);if(!H.arrayContains(P,a.startContainer.nodeType)&&!X(a.startContainer,!0)||!H.arrayContains(P,a.endContainer.nodeType)&&
!X(a.endContainer,!0)||!(a.startOffset<=(H.isCharacterDataNode(a.startContainer)?a.startContainer.length:a.startContainer.childNodes.length))||!(a.endOffset<=(H.isCharacterDataNode(a.endContainer)?a.endContainer.length:a.endContainer.childNodes.length)))throw Error("Range error: Range is no longer valid after DOM mutation ("+a.inspect()+")");}function K(){}function O(a){a.START_TO_START=Ka;a.START_TO_END=Da;a.END_TO_END=da;a.END_TO_START=va;a.NODE_BEFORE=pa;a.NODE_AFTER=qa;a.NODE_BEFORE_AND_AFTER=
mb;a.NODE_INSIDE=ja}function y(a){O(a);O(a.prototype)}function Y(a,c){return function(){J(this);var b=this.startContainer,d=this.startOffset,g=this.commonAncestorContainer,l=new p(this,!0);b!==g&&(b=H.getClosestAncestorIn(b,g,!0),d=f(b),b=d.node,d=d.offset);k(l,A);l.reset();g=a(l);l.detach();c(this,b,d,b,d);return g}}function D(d,g,k){function l(a,c){return function(d){u(this);z(d,S);z(ka(d),P);d=(a?b:f)(d);(c?j:o)(this,d.node,d.offset)}}function j(a,c,b){var d=a.endContainer,f=a.endOffset;if(c!==
a.startContainer||b!==this.startOffset){if(ka(c)!=ka(d)||1==H.comparePoints(c,b,d,f))d=c,f=b;g(a,c,b,d,f)}}function o(a,c,b){var d=a.startContainer,f=a.startOffset;if(c!==a.endContainer||b!==this.endOffset){if(ka(c)!=ka(d)||-1==H.comparePoints(c,b,d,f))d=c,f=b;g(a,d,f,c,b)}}function r(a,c,b){(c!==a.startContainer||b!==this.startOffset||c!==a.endContainer||b!==this.endOffset)&&g(a,c,b,c,b)}d.prototype=new K;e.util.extend(d.prototype,{setStart:function(a,c){u(this);v(a,!0);C(a,c);j(this,a,c)},setEnd:function(a,
c){u(this);v(a,!0);C(a,c);o(this,a,c)},setStartBefore:l(!0,!0),setStartAfter:l(!1,!0),setEndBefore:l(!0,!1),setEndAfter:l(!1,!1),collapse:function(a){J(this);a?g(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):g(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(a){u(this);v(a,!0);g(this,a,0,a,H.getNodeLength(a))},selectNode:function(a){u(this);v(a,!1);z(a,S);var c=b(a),a=f(a);g(this,c.node,c.offset,a.node,a.offset)},
extractContents:Y(q,g),deleteContents:Y(c,g),canSurroundContents:function(){J(this);A(this.startContainer);A(this.endContainer);var c=new p(this,!0),b=c._first&&a(c._first,this)||c._last&&a(c._last,this);c.detach();return!b},detach:function(){k(this)},splitBoundaries:function(){J(this);var a=this.startContainer,c=this.startOffset,b=this.endContainer,d=this.endOffset,f=a===b;H.isCharacterDataNode(b)&&(0<d&&d<b.length)&&H.splitDataNode(b,d);H.isCharacterDataNode(a)&&(0<c&&c<a.length)&&(a=H.splitDataNode(a,
c),f?(d-=c,b=a):b==a.parentNode&&d>=H.getNodeIndex(a)&&d++,c=0);g(this,a,c,b,d)},normalizeBoundaries:function(){J(this);var a=this.startContainer,c=this.startOffset,b=this.endContainer,d=this.endOffset,f=function(a){var c=a.nextSibling;c&&c.nodeType==a.nodeType&&(b=a,d=a.length,a.appendData(c.data),c.parentNode.removeChild(c))},k=function(g){var f=g.previousSibling;if(f&&f.nodeType==g.nodeType){a=g;var k=g.length;c=f.length;g.insertData(0,f.data);f.parentNode.removeChild(f);a==b?(d+=c,b=a):b==g.parentNode&&
(f=H.getNodeIndex(g),d==f?(b=g,d=k):d>f&&d--)}},l=!0;H.isCharacterDataNode(b)?b.length==d&&f(b):(0<d&&(l=b.childNodes[d-1])&&H.isCharacterDataNode(l)&&f(l),l=!this.collapsed);l?H.isCharacterDataNode(a)?0==c&&k(a):c<a.childNodes.length&&(f=a.childNodes[c])&&H.isCharacterDataNode(f)&&k(f):(a=b,c=d);g(this,a,c,b,d)},collapseToPoint:function(a,c){u(this);v(a,!0);C(a,c);r(this,a,c)}});y(d)}function G(a){a.collapsed=a.startContainer===a.endContainer&&a.startOffset===a.endOffset;a.commonAncestorContainer=
a.collapsed?a.startContainer:H.getCommonAncestor(a.startContainer,a.endContainer)}function N(a,c,b,g,f){var k=a.startContainer!==c||a.startOffset!==b,l=a.endContainer!==g||a.endOffset!==f;a.startContainer=c;a.startOffset=b;a.endContainer=g;a.endOffset=f;G(a);d(a,"boundarychange",{startMoved:k,endMoved:l})}function B(a){this.startContainer=a;this.startOffset=0;this.endContainer=a;this.endOffset=0;this._listeners={boundarychange:[],detach:[]};G(this)}e.requireModules(["DomUtil"]);var H=e.dom,R=H.DomPosition,
L=e.DOMException;p.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null;this._next=this._first},hasNext:function(){return!!this._next},next:function(){var a=this._current=this._next;a&&(this._next=a!==this._last?a.nextSibling:null,H.isCharacterDataNode(a)&&this.clonePartiallySelectedTextNodes&&(a===this.ec&&(a=a.cloneNode(!0)).deleteData(this.eo,a.length-this.eo),this._current===this.sc&&(a=a.cloneNode(!0)).deleteData(0,this.so)));
return a},remove:function(){var a=this._current,c,b;H.isCharacterDataNode(a)&&(a===this.sc||a===this.ec)?(c=a===this.sc?this.so:0,b=a===this.ec?this.eo:a.length,c!=b&&a.deleteData(c,b-c)):a.parentNode&&a.parentNode.removeChild(a)},isPartiallySelectedSubtree:function(){return a(this._current,this.range)},getSubtreeIterator:function(){var a;if(this.isSingleCharacterDataNode)a=this.range.cloneRange(),a.collapse();else{a=new B(j(this.range));var c=this._current,b=c,d=0,g=c,f=H.getNodeLength(c);H.isAncestorOf(c,
this.sc,!0)&&(b=this.sc,d=this.so);H.isAncestorOf(c,this.ec,!0)&&(g=this.ec,f=this.eo);N(a,b,d,g,f)}return new p(a,this.clonePartiallySelectedTextNodes)},detach:function(a){a&&this.range.detach();this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};r.prototype={BAD_BOUNDARYPOINTS_ERR:1,INVALID_NODE_TYPE_ERR:2};r.prototype.toString=function(){return this.message};t.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){this._current=
this._next;this._next=this.nodes[++this._position];return this._current},detach:function(){this._current=this._next=this.nodes=null}};var S=[1,3,4,5,7,8,10],P=[2,9,11],W=[1,3,4,5,7,8,10,11],la=[1,3,4,5,7,8],ka=H.getRootContainer,X=m([9,11]),U=m([5,6,10,12]),V=m([6,10,12]),ga=document.createElement("style"),Z=!1;try{ga.innerHTML="<b>x</b>",Z=3==ga.firstChild.nodeType}catch(ea){}e.features.htmlParsingConforms=Z;var I="startContainer startOffset endContainer endOffset collapsed commonAncestorContainer".split(" "),
Ka=0,Da=1,da=2,va=3,pa=0,qa=1,mb=2,ja=3;K.prototype={attachListener:function(a,c){this._listeners[a].push(c)},compareBoundaryPoints:function(a,c){J(this);F(this.startContainer,c.startContainer);var b=a==va||a==Ka?"start":"end",d=a==Da||a==Ka?"start":"end";return H.comparePoints(this[b+"Container"],this[b+"Offset"],c[d+"Container"],c[d+"Offset"])},insertNode:function(a){J(this);z(a,W);A(this.startContainer);if(H.isAncestorOf(a,this.startContainer,!0))throw new L("HIERARCHY_REQUEST_ERR");this.setStartBefore(l(a,
this.startContainer,this.startOffset))},cloneContents:function(){J(this);var a,c;if(this.collapsed)return j(this).createDocumentFragment();if(this.startContainer===this.endContainer&&H.isCharacterDataNode(this.startContainer))return a=this.startContainer.cloneNode(!0),a.data=a.data.slice(this.startOffset,this.endOffset),c=j(this).createDocumentFragment(),c.appendChild(a),c;c=new p(this,!0);a=g(c);c.detach();return a},canSurroundContents:function(){J(this);A(this.startContainer);A(this.endContainer);
var c=new p(this,!0),b=c._first&&a(c._first,this)||c._last&&a(c._last,this);c.detach();return!b},surroundContents:function(a){z(a,la);if(!this.canSurroundContents())throw new r("BAD_BOUNDARYPOINTS_ERR");var c=this.extractContents();if(a.hasChildNodes())for(;a.lastChild;)a.removeChild(a.lastChild);l(a,this.startContainer,this.startOffset);a.appendChild(c);this.selectNode(a)},cloneRange:function(){J(this);for(var a=new B(j(this)),c=I.length,b;c--;)b=I[c],a[b]=this[b];return a},toString:function(){J(this);
var a=this.startContainer;if(a===this.endContainer&&H.isCharacterDataNode(a))return 3==a.nodeType||4==a.nodeType?a.data.slice(this.startOffset,this.endOffset):"";var c=[],a=new p(this,!0);k(a,function(a){(3==a.nodeType||4==a.nodeType)&&c.push(a.data)});a.detach();return c.join("")},compareNode:function(a){J(this);var c=a.parentNode,b=H.getNodeIndex(a);if(!c)throw new L("NOT_FOUND_ERR");a=this.comparePoint(c,b);c=this.comparePoint(c,b+1);return 0>a?0<c?mb:pa:0<c?qa:ja},comparePoint:function(a,c){J(this);
E(a,"HIERARCHY_REQUEST_ERR");F(a,this.startContainer);return 0>H.comparePoints(a,c,this.startContainer,this.startOffset)?-1:0<H.comparePoints(a,c,this.endContainer,this.endOffset)?1:0},createContextualFragment:Z?function(a){var c=this.startContainer,b=H.getDocument(c);if(!c)throw new L("INVALID_STATE_ERR");var d=null;1==c.nodeType?d=c:H.isCharacterDataNode(c)&&(d=H.parentElement(c));d=null===d||"HTML"==d.nodeName&&H.isHtmlNamespace(H.getDocument(d).documentElement)&&H.isHtmlNamespace(d)?b.createElement("body"):
d.cloneNode(!1);d.innerHTML=a;return H.fragmentFromNodeChildren(d)}:function(a){u(this);var c=j(this).createElement("body");c.innerHTML=a;return H.fragmentFromNodeChildren(c)},toHtml:function(){J(this);var a=j(this).createElement("div");a.appendChild(this.cloneContents());return a.innerHTML},intersectsNode:function(a,c){J(this);E(a,"NOT_FOUND_ERR");if(H.getDocument(a)!==j(this))return!1;var b=a.parentNode,d=H.getNodeIndex(a);E(b,"NOT_FOUND_ERR");var g=H.comparePoints(b,d,this.endContainer,this.endOffset),
b=H.comparePoints(b,d+1,this.startContainer,this.startOffset);return c?0>=g&&0<=b:0>g&&0<b},isPointInRange:function(a,c){J(this);E(a,"HIERARCHY_REQUEST_ERR");F(a,this.startContainer);return 0<=H.comparePoints(a,c,this.startContainer,this.startOffset)&&0>=H.comparePoints(a,c,this.endContainer,this.endOffset)},intersectsRange:function(a,c){J(this);if(j(a)!=j(this))throw new L("WRONG_DOCUMENT_ERR");var b=H.comparePoints(this.startContainer,this.startOffset,a.endContainer,a.endOffset),d=H.comparePoints(this.endContainer,
this.endOffset,a.startContainer,a.startOffset);return c?0>=b&&0<=d:0>b&&0<d},intersection:function(a){if(this.intersectsRange(a)){var c=H.comparePoints(this.startContainer,this.startOffset,a.startContainer,a.startOffset),b=H.comparePoints(this.endContainer,this.endOffset,a.endContainer,a.endOffset),d=this.cloneRange();-1==c&&d.setStart(a.startContainer,a.startOffset);1==b&&d.setEnd(a.endContainer,a.endOffset);return d}return null},union:function(a){if(this.intersectsRange(a,!0)){var c=this.cloneRange();
-1==H.comparePoints(a.startContainer,a.startOffset,this.startContainer,this.startOffset)&&c.setStart(a.startContainer,a.startOffset);1==H.comparePoints(a.endContainer,a.endOffset,this.endContainer,this.endOffset)&&c.setEnd(a.endContainer,a.endOffset);return c}throw new r("Ranges do not intersect");},containsNode:function(a,c){return c?this.intersectsNode(a,!1):this.compareNode(a)==ja},containsNodeContents:function(a){return 0<=this.comparePoint(a,0)&&0>=this.comparePoint(a,H.getNodeLength(a))},containsRange:function(a){return this.intersection(a).equals(a)},
containsNodeText:function(a){var c=this.cloneRange();c.selectNode(a);var b=c.getNodes([3]);return 0<b.length?(c.setStart(b[0],0),a=b.pop(),c.setEnd(a,a.length),a=this.containsRange(c),c.detach(),a):this.containsNodeContents(a)},createNodeIterator:function(a,c){J(this);return new t(this,a,c)},getNodes:function(a,c){J(this);return n(this,a,c)},getDocument:function(){return j(this)},collapseBefore:function(a){u(this);this.setEndBefore(a);this.collapse(!1)},collapseAfter:function(a){u(this);this.setStartAfter(a);
this.collapse(!0)},getName:function(){return"DomRange"},equals:function(a){return B.rangesEqual(this,a)},inspect:function(){return o(this)}};D(B,N,function(a){u(a);a.startContainer=a.startOffset=a.endContainer=a.endOffset=null;a.collapsed=a.commonAncestorContainer=null;d(a,"detach",null);a._listeners=null});e.rangePrototype=K.prototype;B.rangeProperties=I;B.RangeIterator=p;B.copyComparisonConstants=y;B.createPrototypeRange=D;B.inspect=o;B.getRangeDocument=j;B.rangesEqual=function(a,c){return a.startContainer===
c.startContainer&&a.startOffset===c.startOffset&&a.endContainer===c.endContainer&&a.endOffset===c.endOffset};e.DomRange=B;e.RangeException=r});m.createModule("WrappedRange",function(e){function a(a,c,d,g){var l=a.duplicate();l.collapse(d);var e=l.parentElement();b.isAncestorOf(c,e,!0)||(e=c);if(!e.canHaveHTML)return new f(e.parentNode,b.getNodeIndex(e));c=b.getDocument(e).createElement("span");c.parentNode&&c.parentNode.removeChild(c);var j,t=d?"StartToStart":"StartToEnd";do e.insertBefore(c,c.previousSibling),
l.moveToElementText(c);while(0<(j=l.compareEndPoints(t,a))&&c.previousSibling);t=c.nextSibling;if(-1==j&&t&&b.isCharacterDataNode(t)){l.setEndPoint(d?"EndToStart":"EndToEnd",a);if(/[\r\n]/.test(t.data)){l=l.duplicate();e=l.text.replace(/\r\n/g,"\r").length;for(e=l.moveStart("character",e);-1==l.compareEndPoints("StartToEnd",l);)e++,l.moveStart("character",1)}else if(e=l.text.replace(/\u00a0/g," "),d=t.data.replace(/\u00a0/g," "),0!==d.indexOf(e)){for(;0<e.length&&0!==d.indexOf(e);)e=e.substr(1);e=
e.length}else e=l.text.length;t=new f(t,e)}else t=(g||!d)&&c.previousSibling,t=(l=(g||d)&&c.nextSibling)&&b.isCharacterDataNode(l)?new f(l,0):t&&b.isCharacterDataNode(t)?new f(t,t.length):new f(e,b.getNodeIndex(c));c.parentNode.removeChild(c);return t}function j(a,c){var d,g,f=a.offset,l=b.getDocument(a.node),e=l.body.createTextRange(),j=b.isCharacterDataNode(a.node);j?(d=a.node,g=d.parentNode):(d=a.node.childNodes,d=f<d.length?d[f]:null,g=a.node);l=l.createElement("span");l.innerHTML="&#feff;";d?
g.insertBefore(l,d):g.appendChild(l);try{e.moveToElementText(l),e.collapse(!c)}catch(m){}g.removeChild(l);if(j)e[c?"moveStart":"moveEnd"]("character",f);return e}e.requireModules(["DomUtil","DomRange"]);var d,b=e.dom,f=b.DomPosition,l=e.DomRange;if(e.features.implementsDomRange&&(!e.features.implementsTextRange||!e.config.preferTextRange))(function(){function a(c){for(var b=g.length,d;b--;)d=g[b],c[d]=c.nativeRange[d]}var c,g=l.rangeProperties,f;d=function(c){if(!c)throw Error("Range must be specified");
this.nativeRange=c;a(this)};l.createPrototypeRange(d,function(a,c,b,d,g){var f=a.endContainer!==d||a.endOffset!=g;if(a.startContainer!==c||a.startOffset!=b||f)a.setEnd(d,g),a.setStart(c,b)},function(a){a.nativeRange.detach();a.detached=!0;for(var c=g.length,b;c--;)b=g[c],a[b]=null});c=d.prototype;c.selectNode=function(c){this.nativeRange.selectNode(c);a(this)};c.deleteContents=function(){this.nativeRange.deleteContents();a(this)};c.extractContents=function(){var c=this.nativeRange.extractContents();
a(this);return c};c.cloneContents=function(){return this.nativeRange.cloneContents()};c.surroundContents=function(c){this.nativeRange.surroundContents(c);a(this)};c.collapse=function(c){this.nativeRange.collapse(c);a(this)};c.cloneRange=function(){return new d(this.nativeRange.cloneRange())};c.refresh=function(){a(this)};c.toString=function(){return this.nativeRange.toString()};var j=document.createTextNode("test");b.getBody(document).appendChild(j);var p=document.createRange();p.setStart(j,0);p.setEnd(j,
0);try{p.setStart(j,1),c.setStart=function(c,b){this.nativeRange.setStart(c,b);a(this)},c.setEnd=function(c,b){this.nativeRange.setEnd(c,b);a(this)},f=function(c){return function(b){this.nativeRange[c](b);a(this)}}}catch(r){c.setStart=function(c,b){try{this.nativeRange.setStart(c,b)}catch(d){this.nativeRange.setEnd(c,b),this.nativeRange.setStart(c,b)}a(this)},c.setEnd=function(c,b){try{this.nativeRange.setEnd(c,b)}catch(d){this.nativeRange.setStart(c,b),this.nativeRange.setEnd(c,b)}a(this)},f=function(c,
b){return function(d){try{this.nativeRange[c](d)}catch(g){this.nativeRange[b](d),this.nativeRange[c](d)}a(this)}}}c.setStartBefore=f("setStartBefore","setEndBefore");c.setStartAfter=f("setStartAfter","setEndAfter");c.setEndBefore=f("setEndBefore","setStartBefore");c.setEndAfter=f("setEndAfter","setStartAfter");p.selectNodeContents(j);c.selectNodeContents=p.startContainer==j&&p.endContainer==j&&0==p.startOffset&&p.endOffset==j.length?function(c){this.nativeRange.selectNodeContents(c);a(this)}:function(a){this.setStart(a,
0);this.setEnd(a,l.getEndOffset(a))};p.selectNodeContents(j);p.setEnd(j,3);f=document.createRange();f.selectNodeContents(j);f.setEnd(j,4);f.setStart(j,2);c.compareBoundaryPoints=-1==p.compareBoundaryPoints(p.START_TO_END,f)&1==p.compareBoundaryPoints(p.END_TO_START,f)?function(a,c){c=c.nativeRange||c;a==c.START_TO_END?a=c.END_TO_START:a==c.END_TO_START&&(a=c.START_TO_END);return this.nativeRange.compareBoundaryPoints(a,c)}:function(a,c){return this.nativeRange.compareBoundaryPoints(a,c.nativeRange||
c)};e.util.isHostMethod(p,"createContextualFragment")&&(c.createContextualFragment=function(a){return this.nativeRange.createContextualFragment(a)});b.getBody(document).removeChild(j);p.detach();f.detach()})(),e.createNativeRange=function(a){a=a||document;return a.createRange()};else if(e.features.implementsTextRange){d=function(a){this.textRange=a;this.refresh()};d.prototype=new l(document);d.prototype.refresh=function(){var d,c,g=this.textRange;d=g.parentElement();var f=g.duplicate();f.collapse(!0);
c=f.parentElement();f=g.duplicate();f.collapse(!1);g=f.parentElement();c=c==g?c:b.getCommonAncestor(c,g);c=c==d?c:b.getCommonAncestor(d,c);0==this.textRange.compareEndPoints("StartToEnd",this.textRange)?c=d=a(this.textRange,c,!0,!0):(d=a(this.textRange,c,!0,!1),c=a(this.textRange,c,!1,!1));this.setStart(d.node,d.offset);this.setEnd(c.node,c.offset)};l.copyComparisonConstants(d);var g=function(){return this}();"undefined"==typeof g.Range&&(g.Range=d);e.createNativeRange=function(a){a=a||document;return a.body.createTextRange()}}e.features.implementsTextRange&&
(d.rangeToTextRange=function(a){if(a.collapsed)return j(new f(a.startContainer,a.startOffset),!0);var c=j(new f(a.startContainer,a.startOffset),!0),d=j(new f(a.endContainer,a.endOffset),!1),a=b.getDocument(a.startContainer).body.createTextRange();a.setEndPoint("StartToStart",c);a.setEndPoint("EndToEnd",d);return a});d.prototype.getName=function(){return"WrappedRange"};e.WrappedRange=d;e.createRange=function(a){a=a||document;return new d(e.createNativeRange(a))};e.createRangyRange=function(a){a=a||
document;return new l(a)};e.createIframeRange=function(a){return e.createRange(b.getIframeDocument(a))};e.createIframeRangyRange=function(a){return e.createRangyRange(b.getIframeDocument(a))};e.addCreateMissingNativeApiListener(function(a){a=a.document;if(typeof a.createRange=="undefined")a.createRange=function(){return e.createRange(this)};a=a=null})});m.createModule("WrappedSelection",function(e,a){function j(a){return(a||window).getSelection()}function d(a){return(a||window).document.selection}
function b(a,c,b){var d=b?"end":"start",b=b?"start":"end";a.anchorNode=c[d+"Container"];a.anchorOffset=c[d+"Offset"];a.focusNode=c[b+"Container"];a.focusOffset=c[b+"Offset"]}function f(a){a.anchorNode=a.focusNode=null;a.anchorOffset=a.focusOffset=0;a.rangeCount=0;a.isCollapsed=!0;a._ranges.length=0}function l(a){var c;a instanceof v?(c=a._selectionNativeRange,c||(c=e.createNativeRange(t.getDocument(a.startContainer)),c.setEnd(a.endContainer,a.endOffset),c.setStart(a.startContainer,a.startOffset),
a._selectionNativeRange=c,a.attachListener("detach",function(){this._selectionNativeRange=null}))):a instanceof u?c=a.nativeRange:e.features.implementsDomRange&&a instanceof t.getWindow(a.startContainer).Range&&(c=a);return c}function g(a){var c=a.getNodes(),b;a:if(!c.length||1!=c[0].nodeType)b=!1;else{b=1;for(var d=c.length;b<d;++b)if(!t.isAncestorOf(c[0],c[b])){b=!1;break a}b=!0}if(!b)throw Error("getSingleElementFromRange: range "+a.inspect()+" did not consist of a single element");return c[0]}
function k(a,c){var d=new u(c);a._ranges=[d];b(a,d,!1);a.rangeCount=1;a.isCollapsed=d.collapsed}function c(a){a._ranges.length=0;if("None"==a.docSelection.type)f(a);else{var c=a.docSelection.createRange();if(c&&"undefined"!=typeof c.text)k(a,c);else{a.rangeCount=c.length;for(var d,g=t.getDocument(c.item(0)),l=0;l<a.rangeCount;++l)d=e.createRange(g),d.selectNode(c.item(l)),a._ranges.push(d);a.isCollapsed=1==a.rangeCount&&a._ranges[0].collapsed;b(a,a._ranges[a.rangeCount-1],!1)}}}function q(a,b){for(var d=
a.docSelection.createRange(),f=g(b),k=t.getDocument(d.item(0)),k=t.getBody(k).createControlRange(),l=0,e=d.length;l<e;++l)k.add(d.item(l));try{k.add(f)}catch(j){throw Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)");}k.select();c(a)}function n(a,c,b){this.nativeSelection=a;this.docSelection=c;this._ranges=[];this.win=b;this.refresh()}function o(a,b){for(var d=t.getDocument(b[0].startContainer),d=t.getBody(d).createControlRange(),
f=0,k;f<rangeCount;++f){k=g(b[f]);try{d.add(k)}catch(l){throw Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)");}}d.select();c(a)}function p(a,c){if(a.anchorNode&&t.getDocument(a.anchorNode)!==t.getDocument(c))throw new z("WRONG_DOCUMENT_ERR");}function r(a){var c=[],b=new C(a.anchorNode,a.anchorOffset),d=new C(a.focusNode,a.focusOffset),g="function"==typeof a.getName?a.getName():"Selection";if("undefined"!=typeof a.rangeCount)for(var f=
0,k=a.rangeCount;f<k;++f)c[f]=v.inspect(a.getRangeAt(f));return"["+g+"(Ranges: "+c.join(", ")+")(anchor: "+b.inspect()+", focus: "+d.inspect()+"]"}e.requireModules(["DomUtil","DomRange","WrappedRange"]);e.config.checkSelectionRanges=!0;var t=e.dom,m=e.util,v=e.DomRange,u=e.WrappedRange,z=e.DOMException,C=t.DomPosition,F,A,E=e.util.isHostMethod(window,"getSelection"),J=e.util.isHostObject(document,"selection"),K=J&&(!E||e.config.preferTextRange);K?(F=d,e.isSelectionValid=function(a){var a=(a||window).document,
c=a.selection;return"None"!=c.type||t.getDocument(c.createRange().parentElement())==a}):E?(F=j,e.isSelectionValid=function(){return!0}):a.fail("Neither document.selection or window.getSelection() detected.");e.getNativeSelection=F;var E=F(),O=e.createNativeRange(document),y=t.getBody(document),Y=m.areHostObjects(E,m.areHostProperties(E,["anchorOffset","focusOffset"]));e.features.selectionHasAnchorAndFocus=Y;var D=m.isHostMethod(E,"extend");e.features.selectionHasExtend=D;var G="number"==typeof E.rangeCount;
e.features.selectionHasRangeCount=G;var N=!1,B=!0;m.areHostMethods(E,["addRange","getRangeAt","removeAllRanges"])&&("number"==typeof E.rangeCount&&e.features.implementsDomRange)&&function(){var a=document.createElement("iframe");y.appendChild(a);var c=t.getIframeDocument(a);c.open();c.write("<html><head></head><body>12</body></html>");c.close();var b=t.getIframeWindow(a).getSelection(),d=c.documentElement.lastChild.firstChild,c=c.createRange();c.setStart(d,1);c.collapse(true);b.addRange(c);B=b.rangeCount==
1;b.removeAllRanges();var g=c.cloneRange();c.setStart(d,0);g.setEnd(d,2);b.addRange(c);b.addRange(g);N=b.rangeCount==2;c.detach();g.detach();y.removeChild(a)}();e.features.selectionSupportsMultipleRanges=N;e.features.collapsedNonEditableSelectionsSupported=B;var H=!1,R;y&&m.isHostMethod(y,"createControlRange")&&(R=y.createControlRange(),m.areHostProperties(R,["item","add"])&&(H=!0));e.features.implementsControlRange=H;A=Y?function(a){return a.anchorNode===a.focusNode&&a.anchorOffset===a.focusOffset}:
function(a){return a.rangeCount?a.getRangeAt(a.rangeCount-1).collapsed:false};var L;m.isHostMethod(E,"getRangeAt")?L=function(a,c){try{return a.getRangeAt(c)}catch(b){return null}}:Y&&(L=function(a){var c=t.getDocument(a.anchorNode),c=e.createRange(c);c.setStart(a.anchorNode,a.anchorOffset);c.setEnd(a.focusNode,a.focusOffset);if(c.collapsed!==this.isCollapsed){c.setStart(a.focusNode,a.focusOffset);c.setEnd(a.anchorNode,a.anchorOffset)}return c});e.getSelection=function(a){var a=a||window,c=a._rangySelection,
b=F(a),g=J?d(a):null;if(c){c.nativeSelection=b;c.docSelection=g;c.refresh(a)}else{c=new n(b,g,a);a._rangySelection=c}return c};e.getIframeSelection=function(a){return e.getSelection(t.getIframeWindow(a))};R=n.prototype;if(!K&&Y&&m.areHostMethods(E,["removeAllRanges","addRange"])){R.removeAllRanges=function(){this.nativeSelection.removeAllRanges();f(this)};var S=function(a,c){var b=v.getRangeDocument(c),b=e.createRange(b);b.collapseToPoint(c.endContainer,c.endOffset);a.nativeSelection.addRange(l(b));
a.nativeSelection.extend(c.startContainer,c.startOffset);a.refresh()};R.addRange=G?function(a,c){if(H&&J&&this.docSelection.type=="Control")q(this,a);else if(c&&D)S(this,a);else{var d;if(N)d=this.rangeCount;else{this.removeAllRanges();d=0}this.nativeSelection.addRange(l(a));this.rangeCount=this.nativeSelection.rangeCount;if(this.rangeCount==d+1){if(e.config.checkSelectionRanges)(d=L(this.nativeSelection,this.rangeCount-1))&&!v.rangesEqual(d,a)&&(a=new u(d));this._ranges[this.rangeCount-1]=a;b(this,
a,la(this.nativeSelection));this.isCollapsed=A(this)}else this.refresh()}}:function(a,c){if(c&&D)S(this,a);else{this.nativeSelection.addRange(l(a));this.refresh()}};R.setRanges=function(a){if(H&&a.length>1)o(this,a);else{this.removeAllRanges();for(var c=0,b=a.length;c<b;++c)this.addRange(a[c])}}}else if(m.isHostMethod(E,"empty")&&m.isHostMethod(O,"select")&&H&&K)R.removeAllRanges=function(){try{var a=Aloha.browser.msie&&Aloha.browser.version<8&&typeof document.documentMode==="undefined";a||this.docSelection.empty();
this.docSelection.type!="None"&&a&&this.docSelection.empty()}catch(c){}f(this)},R.addRange=function(a){if(this.docSelection.type=="Control")q(this,a);else try{u.rangeToTextRange(a).select();this._ranges[0]=a;this.rangeCount=1;this.isCollapsed=this._ranges[0].collapsed;b(this,a,false)}catch(c){}},R.setRanges=function(a){this.removeAllRanges();var c=a.length;c>1?o(this,a):c&&this.addRange(a[0])};else return a.fail("No means of selecting a Range or TextRange was found"),!1;R.getRangeAt=function(a){if(a<
0||a>=this.rangeCount)throw new z("INDEX_SIZE_ERR");return this._ranges[a]};var P;if(K)P=function(a){var b;if(e.isSelectionValid(a.win))b=a.docSelection.createRange();else{b=t.getBody(a.win.document).createTextRange();b.collapse(true)}a.docSelection.type=="Control"?c(a):b&&typeof b.text!="undefined"?k(a,b):f(a)};else if(m.isHostMethod(E,"getRangeAt")&&"number"==typeof E.rangeCount)P=function(a){if(H&&J&&a.docSelection.type=="Control")c(a);else{a._ranges.length=a.rangeCount=a.nativeSelection.rangeCount;
if(a.rangeCount){for(var d=0,g=a.rangeCount;d<g;++d)a._ranges[d]=new e.WrappedRange(a.nativeSelection.getRangeAt(d));b(a,a._ranges[a.rangeCount-1],la(a.nativeSelection));a.isCollapsed=A(a)}else f(a)}};else if(Y&&"boolean"==typeof E.isCollapsed&&"boolean"==typeof O.collapsed&&e.features.implementsDomRange)P=function(a){var c;c=a.nativeSelection;if(c.anchorNode){c=L(c,0);a._ranges=[c];a.rangeCount=1;c=a.nativeSelection;a.anchorNode=c.anchorNode;a.anchorOffset=c.anchorOffset;a.focusNode=c.focusNode;
a.focusOffset=c.focusOffset;a.isCollapsed=A(a)}else f(a)};else return a.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;R.refresh=function(a){var c=a?this._ranges.slice(0):null;P(this);if(a){a=c.length;if(a!=this._ranges.length)return false;for(;a--;)if(!v.rangesEqual(c[a],this._ranges[a]))return false;return true}};var W=function(a,c){var b=a.getAllRanges(),d=false;a.removeAllRanges();for(var g=0,k=b.length;g<k;++g)d||c!==b[g]?a.addRange(b[g]):d=true;a.rangeCount||
f(a)};R.removeRange=H?function(a){if(this.docSelection.type=="Control"){for(var b=this.docSelection.createRange(),a=g(a),d=t.getDocument(b.item(0)),d=t.getBody(d).createControlRange(),f,k=false,l=0,e=b.length;l<e;++l){f=b.item(l);f!==a||k?d.add(b.item(l)):k=true}d.select();c(this)}else W(this,a)}:function(a){W(this,a)};var la;!K&&Y&&e.features.implementsDomRange?(la=function(a){var c=false;a.anchorNode&&(c=t.comparePoints(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset)==1);return c},R.isBackwards=
function(){return la(this)}):la=R.isBackwards=function(){return false};R.toString=function(){for(var a=[],c=0,b=this.rangeCount;c<b;++c)a[c]=""+this._ranges[c];return a.join("")};R.collapse=function(a,c){p(this,a);var b=e.createRange(t.getDocument(a));b.collapseToPoint(a,c);this.removeAllRanges();this.addRange(b);this.isCollapsed=true};R.collapseToStart=function(){if(this.rangeCount){var a=this._ranges[0];this.collapse(a.startContainer,a.startOffset)}else throw new z("INVALID_STATE_ERR");};R.collapseToEnd=
function(){if(this.rangeCount){var a=this._ranges[this.rangeCount-1];this.collapse(a.endContainer,a.endOffset)}else throw new z("INVALID_STATE_ERR");};R.selectAllChildren=function(a){p(this,a);var c=e.createRange(t.getDocument(a));c.selectNodeContents(a);this.removeAllRanges();this.addRange(c)};R.deleteFromDocument=function(){if(H&&J&&this.docSelection.type=="Control"){for(var a=this.docSelection.createRange(),c;a.length;){c=a.item(0);a.remove(c);c.parentNode.removeChild(c)}this.refresh()}else if(this.rangeCount){a=
this.getAllRanges();this.removeAllRanges();c=0;for(var b=a.length;c<b;++c)a[c].deleteContents();this.addRange(a[b-1])}};R.getAllRanges=function(){return this._ranges.slice(0)};R.setSingleRange=function(a){this.setRanges([a])};R.containsNode=function(a,c){for(var b=0,d=this._ranges.length;b<d;++b)if(this._ranges[b].containsNode(a,c))return true;return false};R.toHtml=function(){var a="";if(this.rangeCount){for(var a=v.getRangeDocument(this._ranges[0]).createElement("div"),c=0,b=this._ranges.length;c<
b;++c)a.appendChild(this._ranges[c].cloneContents());a=a.innerHTML}return a};R.getName=function(){return"WrappedSelection"};R.inspect=function(){return r(this)};R.detach=function(){this.win=this.anchorNode=this.focusNode=this.win._rangySelection=null};n.inspect=r;e.Selection=n;e.selectionPrototype=R;e.addCreateMissingNativeApiListener(function(a){if(typeof a.getSelection=="undefined")a.getSelection=function(){return e.getSelection(this)};a=null})});window.rangy=m})();define("vendor/rangy-core",function(){});
define("aloha/rangy-core",["jquery","vendor/rangy-core"],function(){return window.rangy});define("util/class",[],function(){var m=!1,e=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(){function a(){!m&&this._constructor&&this._constructor.apply(this,arguments)}var j=this.prototype;m=!0;var d=new this;m=!1;for(var b=0;b<arguments.length;b++){var f=arguments[b],l;for(l in f)d[l]="function"==typeof f[l]&&"function"==typeof j[l]&&e.test(f[l])?function(a,b){return function(){var c=
this._super;this._super=j[a];var d=b.apply(this,arguments);this._super=c;return d}}(l,f[l]):f[l]}a.prototype=d;a.constructor=a;a.extend=arguments.callee;return a};return this.Class});window.GENTICS=window.GENTICS||{};window.GENTICS.Utils=window.GENTICS.Utils||{};define("util/lang",[],function(){});(function(m){var e=m.GENTICS;e.Utils.applyProperties=function(a,e){for(var d in e)e.hasOwnProperty(d)&&(a[d]=e[d])};e.Utils.uniqeString4=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};
e.Utils.guid=function(){var a=e.Utils.uniqeString4;return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}})(window);define("aloha/ecma5shims",[],function(){function m(a){var b=null;if(a){do b=a;while(null!=(a=a.parentNode))}return b}function e(a,b){return(a.contains(b)&&16)+(b.contains(a)&&8)+(0<=a.sourceIndex&&0<=b.sourceIndex?(a.sourceIndex<b.sourceIndex&&4)+(a.sourceIndex>b.sourceIndex&&2):1)}function a(a){return null!=a.sourceIndex?a:a.parentNode.insertBefore(document.createComment(""),a)}var j,
d={bind:function(a){var b=this.obj||this,d=Function.prototype.bind,k=Array.prototype.slice.call(arguments,1);return d?d.apply(b,arguments):function(){return b.apply(a,0===arguments.length?k:k.concat(Array.prototype.slice.call(arguments)))}},trim:function(){var a=this.obj||this,b=String.prototype.trim;return b?b.call(a):a.replace(/^\s+/,"").replace(/\s+$/,"")},indexOf:function(a,b){var d=this.obj||this,k=Array.prototype.indexOf;if(k)return k.call(d,a,b);void 0===b&&(b=0);0>b&&(b+=d.length);0>b&&(b=
0);for(k=d.length;b<k;b++)if(void 0!==d[b]&&d[b]===a)return b;return-1},forEach:function(a,b){var d=this.obj||this,k=Array.prototype.forEach;if(k)return k.call(d,a,b);var c,k=0;for(c=d.length;k<c;k++)void 0!==d[k]&&a.call(b,d[k],k,d)},map:function(a,b,d){var k=this.obj||this,c=Array.prototype.map,e="boolean"==typeof arguments[arguments.length-1]?Array.prototype.pop.call(arguments):!1,n=[];if(c)n=c.call(k,a,b);else{var c=[],o,n=0;for(o=k.length;n<o;n++)void 0!==k[n]&&(c[n]=a.call(b,k[n],n,k));n=c}return e?
j(n):n},filter:function(a,b,d){var k=this.obj||this,c=Array.prototype.filter,e="boolean"==typeof arguments[arguments.length-1]?Array.prototype.pop.call(arguments):!1,n=[];if(c)n=c.call(k,a,b);else{var c=[],o,p,n=0;for(p=k.length;n<p;n++)void 0!==k[n]&&a.call(b,o=k[n],n,k)&&c.push(o);n=c}return e?j(n):n},every:function(a,b){var d=this.obj||this,k=Array.prototype.every;if(k)return k.call(d,a,b);var c,k=0;for(c=d.length;k<c;k++)if(void 0!==d[k]&&!a.call(b,d[k],k,d))return!1;return!0},some:function(a,
b){var d=this.obj||this,k=Array.prototype.some;if(k)return k.call(d,a,b);var c,k=0;for(c=d.length;k<c;k++)if(void 0!==d[k]&&a.call(b,d[k],k,d))return!0;return!1},hasAttribute:function(a){var b=this.obj||this;return b.hasAttribute?b.hasAttribute(a):!!b.getAttribute(a)}};j=function(a){var b=function(){};b.prototype=d;b=new b;b.obj=a;return b};for(var b in d)d.hasOwnProperty(b)&&(j[b]=d[b]);j.Node="undefined"!=typeof window.Node?window.Node:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,
ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12,DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32};j.compareDocumentPosition=function(b,d){if(document.documentElement.compareDocumentPosition)return b.compareDocumentPosition(d);if(!document.documentElement.contains)throw"neither compareDocumentPosition nor contains is supported by this browser.";
if(b==d)return 0;if(m(b)!=m(d))return 1;if(null!=b.sourceIndex&&null!=d.sourceIndex)return e(b,d);if(b==document)return 20;if(d==document)return 10;var g=a(b),k=a(d),c=e(g,k);b!=g&&g.parentNode.removeChild(g);d!=k&&k.parentNode.removeChild(k);return c};j.getComputedStyle=function(a,b){return window.getComputedStyle?window.getComputedStyle(a,b):a.currentStyle?a.currentStyle:null};return j});window.GENTICS=window.GENTICS||{};window.GENTICS.Utils=window.GENTICS.Utils||{};define("util/dom",["jquery",
"util/class","aloha/ecma5shims"],function(m,e,a){var j;function d(a){if(!a)return-1;var c,b=a.parentNode.childNodes,d=b.length;for(c=0;c<d;c++)if(b[c]===a)return c;return-1}function b(a){if(1===a.nodeType){for(var c=0,a=a.firstChild;a;)c+=1,a=a.nextSibling;return c}return 3===a.nodeType?a.length:0}function f(a){return"aloha-editing-p"===a.className&&1===b(a)&&"BR"===a.children[0].nodeName&&"aloha-end-br"===a.children[0].className}function l(a,c){if(!a)return null;if(c(a))return a;var b=a.firstChild||
a.nextSibling||a.parentNode&&!q.Utils.Dom.isEditingHost(a.parentNode)&&a.parentNode.nextSibling;return b?l(b,c):null}function g(a){if(!a)return!0;if("BR"===a.nodeName)return!1;if(a.nodeType===j)return-1===a.data.search(/\S/)||1===a.data.length&&8192<=a.data.charCodeAt(0)?!0:!1;var c=b(a);if(0===c)return!0;var a=a.childNodes,d;for(d=0;d<c;d++)if(!g(a[d]))return!1;return!0}function k(a){return!g(a)}function c(a,c){a.nodeType!==j&&(g(a)||f(a))?m(a).replaceWith(c):m(a).after(c)}var q=window.GENTICS;j=
3;var n={P:!0,H1:!0,H2:!0,H3:!0,H4:!0,H5:!0,H6:!0,LI:!0},e=e.extend({getIndexInParent:d,wordRegex:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0525\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0621-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971\u0972\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3D\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC\u0EDD\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8B\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10D0-\u10FA\u10FC\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u2094\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31B7\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCB\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA65F\uA662-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B\uA78C\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA2D\uFA30-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
nonWordRegex:/[^\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0525\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0621-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971\u0972\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3D\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC\u0EDD\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8B\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10D0-\u10FA\u10FC\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u2094\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31B7\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCB\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA65F\uA662-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B\uA78C\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA2D\uFA30-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
mergeableTags:"b code del em i ins strong sub sup #text".split(" "),nonWordBoundaryTags:"a b code del em i ins span strong sub sup #text".split(" "),nonEmptyTags:["br"],tags:{flow:"a abbr acronym address area article aside audio b bdi 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 s samp script section select small span strong style sub sup svg table textarea time u ul var video wbr #text".split(" "),
phrasing:"a abbr acronym area audio b bdi 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 u var video wbr #text".split(" ")},children:{a:"phrasing",abbr:"phrasing",acronym:"phrasing",address:"flow",area:"empty",article:"flow",aside:"flow",audio:"source",b:"phrasing",base:"empty",bdo:"phrasing",blockquote:"phrasing",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",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".split(" "),
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".split(" "),tbody:"tr",td:"flow",textarea:"#text",tfoot:"tr",th:"phrasing",thead:"tr",time:"phrasing",title:"#text",tr:["th","td"],track:"empty",u:"phrasing",ul:"li","var":"phrasing",video:"source",wbr:"empty"},blockLevelElements:"p h1 h2 h3 h4 h5 h6 blockquote div pre".split(" "),
listElements:["li","ol","ul"],tableElements:"caption colgroup table thead tbody tfoot tr td".split(" "),split:function(a,c,b){var d=m(a.startContainer),g=a.startOffset,f,k,l,e,j,q,n,J,K;b&&(d=m(a.endContainer),g=a.endOffset);1>c.length&&(c=m(document.body));b=!a.isCollapsed()&&!b;k=d.parents().get();k.unshift(d.get(0));m.each(k,function(a,b){if(c.filter(function(){return this==b}).length){a>0&&(f=k.slice(0,a));return false}});if(!f)return!0;f=f.reverse();d=0;for(q=f.length;d<q;++d)if(n=f[d],d===q-
1)3===n.nodeType?(j=document.createTextNode(n.data.substring(g,n.data.length)),n.data=n.data.substring(0,g),this.isBlockLevelElement(n.parentElement)&&(this.isEmpty(j)&&0===m("br",l).length)&&(j=m("<br/>").addClass("aloha-end-br"))):(J=m(n),j=J.contents(),J=J.clone(!1).empty(),j=J.append(j.slice(g,j.length)).get(0),m(j).addClass("aloha-editing-p"),1===j.childNodes.length&&"br"===j.childNodes.item(0).nodeName.toLowerCase()&&m(j.childNodes.item(0)).addClass("aloha-end-br")),b&&a.endContainer===n&&(a.endContainer=
j,a.endOffset-=g,a.clearCaches()),e?e.prepend(j):m(n).after(j);else{J=m(n).clone(!1).empty();l?e.prepend(J):l=J;for(e=J;;){K=f[d+1].nextSibling;if(!K)break;e.append(K)}if(b&&a.endContainer===n){a.endContainer=J.get(0);n=f[d+1];for(J=0;;){n=n.previousSibling;if(!n)break;J++}a.endOffset-=J;a.clearCaches()}}m(f[0]).after(l);return m([f[0],l?l.get(0):j])},allowsNesting:function(a,c){if(!a||!a.nodeName||!c||!c.nodeName)return!1;var b=a.nodeName.toLowerCase(),d=c.nodeName.toLowerCase();return!this.children[b]?
!1:this.children[b]==d||m.isArray(this.children[b])&&0<=m.inArray(d,this.children[b])||m.isArray(this.tags[this.children[b]])&&0<=m.inArray(d,this.tags[this.children[b]])?!0:!1},addMarkup:function(a,c,b){3===a.startContainer.nodeType&&(0<a.startOffset&&a.startOffset<a.startContainer.data.length)&&this.split(a,m(a.startContainer).parent(),!1);3===a.endContainer.nodeType&&(0<a.endOffset&&a.endOffset<a.endContainer.data.length)&&this.split(a,m(a.endContainer).parent(),!0);this.recursiveAddMarkup(a.getRangeTree(),
c,a,b);this.doCleanup({merge:!0,removeempty:!0},a)},recursiveAddMarkup:function(a,c,b,d){var g,f,b=0;for(f=a.length;b<f;++b)if("full"==a[b].type&&this.allowsNesting(c.get(0),a[b].domobj)){if((d||a[b].domobj.nodeName!=c.get(0).nodeName)&&(3!==a[b].domobj.nodeType||0!==m.trim(a[b].domobj.data).length))m(a[b].domobj).wrap(c),!d&&3!==a[b].domobj.nodeType&&(g=new q.Utils.RangeObject,g.startContainer=g.endContainer=a[b].domobj.parentNode,g.startOffset=0,g.endOffset=g.endContainer.childNodes.length,this.removeMarkup(g,
c,m(a[b].domobj.parentNode)))}else(d||a[b].domobj&&a[b].domobj.nodeName!==c.get(0).nodeName)&&(a[b].children&&0<a[b].children.length)&&this.recursiveAddMarkup(a[b].children,c)},findHighestElement:function(a,c,b){for(var c=c.toLowerCase(),d,g=a,a=b?function(){return b.filter(function(){return g==this}).length}:function(){return!1};!a()&&g;)g.nodeName.toLowerCase()===c&&(d=g),g=g.parentNode;return d},removeMarkup:function(a,c,b,d){"undefined"==typeof d&&(d=!0);var g=c.get(0).nodeName,f=this.findHighestElement(a.startContainer,
g,b),k=this.findHighestElement(a.endContainer,g,b),l=!1;f&&0<a.startOffset&&(this.split(a,m(f).parent(),!1),l=!0);if(k&&(3===a.endContainer.nodeType&&a.endOffset<a.endContainer.data.length&&(this.split(a,m(k).parent(),!0),l=!0),1===a.endContainer.nodeType&&a.endOffset<a.endContainer.childNodes.length))this.split(a,m(k).parent(),!0),l=!0;l&&a.correctRange();if(b=(b=this.findHighestElement(a.getCommonAncestorContainer(),g,b))?b.parentNode:a.getCommonAncestorContainer())g=a.getRangeTree(b),this.recursiveRemoveMarkup(g,
c,d),this.doCleanup({merge:!0,removeempty:!0},a,b)},recursiveRemoveMarkup:function(a,c,b){var d,g,f,k=c[0].nodeName;d=0;for(g=a.length;d<g;++d){var l=a[d];f=l.domobj;if("full"==l.type&&f.nodeName==k&&(b||this.isEditable(f))){var e=m(f);f=e.contents();0<f.length?f.first().unwrap():e.remove()}l.children&&this.recursiveRemoveMarkup(l.children,c,b)}},doCleanup:function(a,c,b){var g=this,f,k,l,e,j;"undefined"===typeof a&&(a={});"undefined"===typeof a.merge&&(a.merge=!1);"undefined"===typeof a.removeempty&&
(a.removeempty=!1);"undefined"===typeof b&&c&&(b=c.getCommonAncestorContainer());k=f=!1;l=m(b);e=c.startOffset;j=c.endOffset;l.contents().each(function(){var b;try{b=this.nodeType}catch(n){return}switch(b){case 1:b=this.nodeName;if(f&&f.nodeName===b){if(c.startContainer===l&&e>d(this)){c.startOffset=c.startOffset-1;k=true}if(c.endContainer===l&&j>d(this)){c.endOffset=c.endOffset-1;k=true}m(f).append(m(this).contents());k=k|g.doCleanup(a,c,f);m(this).remove()}else{k=k|g.doCleanup(a,c,this);var r=false;
if(a.removeempty){q.Utils.Dom.isBlockLevelElement(this)&&this.childNodes.length===0&&(r=true);m.inArray(b.toLowerCase(),g.mergeableTags)>=0&&(m(this).text().length===0&&this.childNodes.length===0)&&(r=true)}if(r){if(c.startContainer===this.parentNode&&e>d(this)){c.startOffset=c.startOffset-1;k=true}if(c.endContainer===this.parentNode&&j>d(this)){c.endOffset=c.endOffset-1;k=true}m(this).remove()}else f=(a.mergeable?a.mergeable(this):m.inArray(b.toLowerCase(),g.mergeableTags)>=0)?this:false}break;case 3:if(f&&
f.nodeType===3&&a.merge){b=f.nodeValue.length;if(c.startContainer===this){c.startContainer=f;c.startOffset=c.startOffset+b;k=true}else if(c.startContainer===f.parentNode&&c.startOffset===d(f)+1){c.startContainer=f;c.startOffset=b;k=true}if(c.endContainer===this){c.endContainer=f;c.endOffset=c.endOffset+b;k=true}else if(c.endContainer===f.parentNode&&c.endOffset===d(f)+1){c.endContainer=f;c.endOffset=b;k=true}f.data=f.data+this.data}else if(!(this.nodeValue===""&&a.removeempty)){f=this;break}if(c.startContainer===
this.parentNode&&c.startOffset>d(this)){c.startOffset=c.startOffset-1;k=true}if(c.endContainer===this.parentNode&&c.endOffset>d(this)){c.endOffset=c.endOffset-1;k=true}m(this).remove();b=f.nextSibling;if(f&&(!b||b.nodeType!==3)){var r=f.data,J=r.length;for(b=J-1;b>=0&&J>1;b--)if(r.charAt(b)==="​"){f.deleteData(b,1);if(c.startContainer===f&&c.startOffset>b){c.startOffset--;k=true}if(c.endContainer===f&&c.endOffset>b){c.endOffset--;k=true}}}}});k&&c.clearCaches();return k},isBlockLevelElement:function(a){return!a?
!1:1===a.nodeType&&0<=m.inArray(a.nodeName.toLowerCase(),this.blockLevelElements)?!0:!1},isTableElement:function(a){return!a?!1:1===a.nodeType&&0<=m.inArray(a.nodeName.toLowerCase(),this.tableElements)?!0:!1},isLineBreakElement:function(a){return!a?!1:1===a.nodeType&&"br"==a.nodeName.toLowerCase()},isHorizontalRulerElement:function(a){return!a?!1:1===a.nodeType&&"hr"==a.nodeName.toLowerCase()},isListElement:function(a){return!a?!1:1===a.nodeType&&0<=m.inArray(a.nodeName.toLowerCase(),this.listElements)},
isSplitObject:function(a){return 1===a.nodeType&&n.hasOwnProperty(a.nodeName)},searchAdjacentTextNode:function(a,c,b,d,g){if(!a||1!==a.nodeType||0>c||c>a.childNodes.length)return!1;"undefined"===typeof d&&(d={blocklevel:!0,list:!0,linebreak:!0,table:!0});"undefined"===typeof d.blocklevel&&(d.blocklevel=!0);"undefined"===typeof d.list&&(d.list=!0);"undefined"===typeof d.linebreak&&(d.linebreak=!0);"undefined"===typeof d.table&&(d.table=!0);"undefined"===typeof b&&(b=!0);var g=m.extend({acceptUntrimmed:!1},
g),f,k=a;b&&0<c&&(f=a.childNodes[c-1]);for(!b&&c<a.childNodes.length&&(f=a.childNodes[c]);k;)if(f){if(3===f.nodeType&&0<(g.acceptUntrimmed?f.data:m.trim(f.data)).length)return f;if(d.blocklevel&&this.isBlockLevelElement(f)||d.table&&this.isTableElement(f)||d.linebreak&&(this.isLineBreakElement(f)||this.isHorizontalRulerElement(f))||d.list&&this.isListElement(f))return!1;3===f.nodeType?f=b?f.previousSibling:f.nextSibling:(k=f,f=b?f.lastChild:f.firstChild)}else{if(d.blocklevel&&this.isBlockLevelElement(k)||
d.table&&this.isTableElement(k)||d.list&&this.isListElement(k))return!1;f=b?k.previousSibling:k.nextSibling;k=k.parentNode}},insertIntoDOM:function(a,b,d,e,j){var q=b.getContainerParents(d,e),n=this,z;d||(d=m(document.body));0===q.length?z=d.get(0):m.each(q,function(c,b){if(n.allowsNesting(b,a.get(0)))return z=b,!1});"undefined"===typeof z&&0<d.length&&(z=d.get(0));if(!this.allowsNesting(z,a.get(0))&&!j)return!1;if("undefined"!==typeof z){d=this.split(b,m(z),e);if(!0===d){d=b.startContainer;j=b.startOffset;
e&&(d=b.endContainer,j=b.endOffset);j>m(d).contents().length&&(j=m(d).contents().length);if(0===j)return b=m(d).contents(),0<b.length?b.eq(0).before(a):m(d).append(a),!0;m(d).contents().eq(j-1).after(a);return!0}if(d){b=d[1];c(d[0],a);if(g(b)||f(b))l(b.nextSibling||b.parentNode&&b.parentNode.nextSibling,k)&&m(b).remove();return!0}}return!1},removeFromDOM:function(a,c,b){if(b){var b=d(a),g=m(a).contents().length,f=a.parentNode;c.startContainer==f&&c.startOffset>b?c.startOffset+=g-1:c.startContainer==
a&&(c.startContainer=f,c.startOffset=b+c.startOffset);c.endContainer==f&&c.endOffset>b?c.endOffset+=g-1:c.endContainer==a&&(c.endContainer=f,c.endOffset=b+c.endOffset);m(a).contents().unwrap();this.doCleanup({merge:!0},c,f)}},removeRange:function(a){if(!a||a.isCollapsed())return!1;3==a.startContainer.nodeType&&(0<a.startOffset&&a.startOffset<a.startContainer.data.length)&&this.split(a,m(a.startContainer).parent(),!1);3==a.endContainer.nodeType&&(0<a.endOffset&&a.endOffset<a.endContainer.data.length)&&
this.split(a,m(a.endContainer).parent(),!0);var c=a.getRangeTree();a.endContainer=a.startContainer;a.endOffset=a.startOffset;this.recursiveRemoveRange(c,a);this.doCleanup({merge:!0},a);a.clearCaches()},recursiveRemoveRange:function(a,c){var b;for(b=0;b<a.length;++b)"full"==a[b].type?(0<m(c.startContainer).parents().andSelf().filter(a[b].domobj).length&&(c.startContainer=c.endContainer=a[b].domobj.parentNode,c.startOffset=c.endOffset=d(a[b].domobj)),m(a[b].domobj).remove()):"partial"==a[b].type&&a[b].children&&
this.recursiveRemoveRange(a[b].children,c)},extendToWord:function(a,c){var b=this.searchWordBoundary(a.startContainer,a.startOffset,!0),d=this.searchWordBoundary(a.endContainer,a.endOffset,!1);if(c||!(a.startContainer==b.container&&a.startOffset==b.offset||a.endContainer==d.container&&a.endOffset==d.offset))a.startContainer=b.container,a.startOffset=b.offset,a.endContainer=d.container,a.endOffset=d.offset,a.correctRange(),a.clearCaches()},isWordBoundaryElement:function(a){return!a||!a.nodeName?!1:
-1==m.inArray(a.nodeName.toLowerCase(),this.nonWordBoundaryTags)},searchWordBoundary:function(a,c,b){"undefined"===typeof b&&(b=!0);for(var g=!1,f,k;!g;){var l=d(a);if(3===a.nodeType)if(b){for(k=f=a.data.substring(0,c).search(this.nonWordRegex);-1!=k;)f=k,k=a.data.substring(f+1,c).search(this.nonWordRegex),-1!=k&&(k=k+f+1);-1!=f?(c=f+1,g=!0):(c=l,a=a.parentNode)}else f=a.data.substring(c).search(this.nonWordRegex),-1!=f?(c+=f,g=!0):(c=l+1,a=a.parentNode);else 1===a.nodeType&&(b?0<c?this.isWordBoundaryElement(a.childNodes[c-
1])?g=!0:(a=a.childNodes[c-1],c=3===a.nodeType?a.data.length:a.childNodes.length):this.isWordBoundaryElement(a)?g=!0:(c=l,a=a.parentNode):c<a.childNodes.length?this.isWordBoundaryElement(a.childNodes[c])?g=!0:(a=a.childNodes[c],c=0):this.isWordBoundaryElement(a)?g=!0:(c=l+1,a=a.parentNode))}if(3!==a.nodeType&&(g=this.searchAdjacentTextNode(a,c,!b)))a=g,c=b?0:a.data.length;return{container:a,offset:c}},isEmpty:function(a){if(!a)return!0;if(-1!=m.inArray(a.nodeName.toLowerCase(),this.nonEmptyTags))return!1;
if(3===a.nodeType)return-1==a.data.search(/\S/)||1===a.data.length&&8192<=a.data.charCodeAt(0)?!0:!1;var c,b;c=0;for(b=a.childNodes.length;c<b;++c)if(!this.isEmpty(a.childNodes[c]))return!1;return!0},setCursorAfter:function(a){var c=new q.Utils.RangeObject;d(a);var b;3==a.nodeType?(b=a,a=b.nodeValue.length):a.nextSibling&&3==a.nextSibling.nodeType?(b=a.nextSibling,a=0):(b=a.parentNode,a=d(a)+1);c.startContainer=c.endContainer=b;c.startOffset=c.endOffset=a;c.select();return c},selectDomNode:function(a){var c=
new q.Utils.RangeObject;c.startContainer=c.endContainer=a.parentNode;c.startOffset=d(a);c.endOffset=c.startOffset+1;c.select()},setCursorInto:function(a){var c=new q.Utils.RangeObject;c.startContainer=c.endContainer=a;c.startOffset=c.endOffset=0;c.select()},isEditingHost:function(a){return a&&1==a.nodeType&&("true"==a.contentEditable||a.parentNode&&9==a.parentNode.nodeType&&"on"==a.parentNode.designMode)},isEditable:function(a){return a&&!this.isEditingHost(a)&&(1!=a.nodeType||"false"!=a.contentEditable)&&
(this.isEditingHost(a.parentNode)||this.isEditable(a.parentNode))},getEditingHostOf:function(a){if(this.isEditingHost(a))return a;if(this.isEditable(a)){for(a=a.parentNode;!this.isEditingHost(a);)a=a.parentNode;return a}return null},inSameEditingHost:function(a,c){return this.getEditingHostOf(a)&&this.getEditingHostOf(a)==this.getEditingHostOf(c)},isBlockNode:function(c){return c&&(c.nodeType==a.Node.ELEMENT_NODE&&-1==a(["inline","inline-block","inline-table","none"]).indexOf(a.getComputedStyle(c).display)||
c.nodeType==a.Node.DOCUMENT_NODE||c.nodeType==a.Node.DOCUMENT_FRAGMENT_NODE)},getFirstVisibleChild:function(c,b,d){if(!c||c.nodeType==a.Node.TEXT_NODE&&this.isEmpty(c)||c.nodeType==a.Node.ELEMENT_NODE&&0===this.getOffsetHeight(c)&&-1===m.inArray(c.nodeName.toLowerCase(),this.nonEmptyTags))return null;if(c.nodeType==a.Node.TEXT_NODE||(c.nodeType==a.Node.ELEMENT_NODE&&0==c.childNodes.length||!m(c).contentEditable())||m.isArray(d)&&0<=m.inArray(c.nodeName,d))return b?c:null;for(b=0;b<c.childNodes.length;++b){var g=
this.getFirstVisibleChild(c.childNodes[b],!0,d);if(null!=g)return g}return null},getLastVisibleChild:function(c,b,d){if(!c||c.nodeType==a.Node.TEXT_NODE&&this.isEmpty(c)||c.nodeType==a.Node.ELEMENT_NODE&&0===this.getOffsetHeight(c)&&-1===m.inArray(c.nodeName.toLowerCase(),this.nonEmptyTags))return null;if(c.nodeType==a.Node.TEXT_NODE||(c.nodeType==a.Node.ELEMENT_NODE&&0==c.childNodes.length||!m(c).contentEditable())||m.isArray(d)&&0<=m.inArray(c.nodeName,d))return b?c:null;for(b=c.childNodes.length-
1;0<=b;--b){var g=this.getLastVisibleChild(c.childNodes[b],!0,d);if(null!=g)return g}return null},getOffsetHeight:function(a){if(!a)return 0;var c=a.offsetHeight;0===c&&(c=a.offsetHeight);return c},isEmptyBlockLevelElement:function(a){if(!this.isBlockLevelElement(a))return!1;if(!a.childNodes)return!0;var c=a.childNodes.length,b=!1,d,g;for(d=0;d<c;d++)if(g=a.childNodes[d],"BR"===g.nodeName){if(b)return!1;b=!0}else if(!this.isEmpty(g))return!1;return!0}});q.Utils.Dom=new e;return q.Utils.Dom});define("aloha/pluginmanager",
["jquery","util/class"],function(m,e){function a(a,b){if(0===a.length)b&&b();else{var f=a.length,l=function(){0===--f&&b&&b()},g,k;for(g=0;g<a.length;g++)(k=a[g],k.settings=k.settings||{},"undefined"===typeof k.settings.enabled&&(k.settings.enabled=!0),k.settings.enabled&&k.checkDependencies())?(k=k.init())&&"function"===typeof k.done?k.done(l):l():l()}}var j=window.Aloha;return new (e.extend({plugins:{},init:function(d,b){var f=this.plugins,l=j&&j.settings&&j.settings.plugins,g;for(g in l)l.hasOwnProperty(g)&&
f[g]&&(f[g].settings=l[g]||{});var k;if(f&&0===b.length)for(k in b=[],f)f.hasOwnProperty(k)&&b.push(k);l=b;g=[];var c;for(c=0;c<l.length;c++)(k=f[l[c]])&&g.push(k);a(g,d)},register:function(a){if(!a.name)throw Error("Plugin does not have an name.");if(this.plugins[a.name])throw Error('Already registered the plugin "'+a.name+'"!');this.plugins[a.name]=a},makeClean:function(a){for(var b in this.plugins)this.plugins.hasOwnProperty(b)&&(j.Log.isDebugEnabled()&&j.Log.debug(this,"Passing contents of HTML Element with id { "+
a.attr("id")+" } for cleaning to plugin { "+b+" }"),this.plugins[b].makeClean(a))},toString:function(){return"pluginmanager"}}))});define("aloha/core",["jquery","aloha/pluginmanager"],function(m,e){function a(){var a=d.browser,b=a.version;return!(a.chrome&&21>parseFloat(b)||a.webkit&&!a.chrome&&532.5>parseFloat(b)||a.mozilla&&1.9>parseFloat(b)||a.msie&&7>b||a.opera&&11>b)}function j(){m("html").mousedown(function(a){d.activeEditable&&(!d.eventHandled&&!(0<m(a.target).closest(".aloha-dialog").length))&&
d.deactivateEditable()}).mouseup(function(){d.eventHandled=!1})}var d=window.Aloha,b=[{fn:null,event:null,deferred:null},{fn:function(b,l){if(a())d.browser.webkit?m("html").addClass("aloha-webkit"):d.browser.opera?m("html").addClass("aloha-opera"):d.browser.msie?m("html").addClass("aloha-ie"+parseInt(d.browser.version,10)):d.browser.mozilla&&m("html").addClass("aloha-mozilla"),-1!==navigator.appVersion.indexOf("Win")?d.OSName="Win":-1!==navigator.appVersion.indexOf("Mac")?d.OSName="Mac":-1!==navigator.appVersion.indexOf("X11")?
d.OSName="Unix":-1!==navigator.appVersion.indexOf("Linux")&&(d.OSName="Linux"),d.browser.msie&&(9<=parseFloat(d.browser.version)&&"function"===typeof document.execCommand)&&document.execCommand("AutoUrlDetect",!1,!1),j(),d.settings.base=d.getAlohaUrl(),d.Log.init(),d.settings.errorhandling&&(window.onerror=function(a,b,g){d.Log.error(d,"Error message: "+a+"\nURL: "+b+"\nLine Number: "+g);return true}),b(),l();else{var g=window.console;if(g){var k=g.error?"error":g.log?"log":null;if(k)g[k]("This browser is not supported")}}},
event:null,deferred:null},{fn:function(a,b){d.RepositoryManager.init();a();b()},event:null,deferred:null},{fn:function(a,b){if(0===d.loadedPlugins.length){var g=e.plugins,k;for(k in g)g.hasOwnProperty(k)&&d.loadedPlugins.push(k)}var c=!1;e.init(function(){c||(a(),c=!0);b()},d.loadedPlugins);c||(a(),c=!0)},event:"aloha-plugins-loaded",deferred:null},{fn:function(a,b){var g;for(g=0;g<d.editables.length;g++)d.editables[g].ready||d.editables[g].init();a();b()},event:null,deferred:null},{fn:null,event:"aloha-ready",
deferred:null}];m.extend(!0,d,{version:"1.4.9",editables:[],activeEditable:null,settings:{},defaults:{},ui:{},OSName:"Unknown",loadedPlugins:[],_pluginBaseUrlByName:{},init:function(){d.initialize(b)},getLoadedPlugins:function(){return this.loadedPlugins},isPluginLoaded:function(a){var b=false;m.each(this.loadedPlugins,function(d,k){if(a===k.toString()){b=true;return false}});return b},activateEditable:function(a){var b=d.editables,g;for(g=0;g<b.length;g++)b[g]!==a&&b[g].isActive&&b[g].blur();
d.activeEditable=a},getActiveEditable:function(){return d.activeEditable},deactivateEditable:function(){if(d.activeEditable){d.activeEditable.blur();d.activeEditable=null}},getEditableById:function(a){var b=m("#"+a);b.length&&"textarea"===b[0].nodeName.toLowerCase()&&(a=a+"-aloha");for(b=0;b<d.editables.length;b++)if(d.editables[b].getId()===a)return d.editables[b];return null},isEditable:function(a){var b,g;b=0;for(g=d.editables.length;b<g;b++)if(d.editables[b].originalObj.get(0)===a)return true;
return false},getEditableHost:function(){var a=function(a){var b;for(b=0;b<d.editables.length;b++)if(d.editables[b].originalObj[0]===a)return d.editables[b];return null};return function(b){if(!b||0===b.length)return null;var d=a(b[0]);d||b.parents().each(function(b,c){if(d=a(c))return false});return d}}(),log:function(a,b,g){typeof d.Log!=="undefined"&&d.Log.log(a,b,g)},registerEditable:function(a){d.editables.push(a)},unregisterEditable:function(a){a=m.inArray(a,d.editables);a!==-1&&d.editables.splice(a,
1)},isModified:function(){var a;for(a=0;a<d.editables.length;a++)if(d.editables[a].isModified&&d.editables[a].isModified())return true;return false},getAlohaUrl:function(){return d.settings.baseUrl||""},getPluginUrl:function(a){if(!a)return null;(a=d.settings._pluginBaseUrlByName[a])&&(a.match("^(/|http[s]?:).*")||(a=d.getAlohaUrl()+"/"+a));return a},disableObjectResizing:function(){try{var a;try{a=document.queryCommandSupported("enableObjectResizing")}catch(b){a=false;d.Log.log("enableObjectResizing is not supported.")}if(a){document.execCommand("enableObjectResizing",
false,false);d.Log.log("enableObjectResizing disabled.")}}catch(g){d.Log.error(g,"Could not disable enableObjectResizing")}},disableInlineTableEditing:function(){try{var a;try{a=document.queryCommandSupported("enableInlineTableEditing")}catch(b){a=false;d.Log.log("enableInlineTableEditing is not supported.")}if(a){document.execCommand("enableInlineTableEditing",false,false);d.Log.log("enableInlineTableEditing disabled.")}}catch(g){d.Log.error(g,"Could not disable enableInlineTableEditing")}},toString:function(){return"Aloha"},
browser:function(){var a,b;a=navigator.userAgent;a=a.toLowerCase();b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||/(trident)(?:.*? rv:([\w.]+))/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];a=b[1]||"";b=b[2]||"0";var d={};if(a){d[a]=true;d.version=b}if(d.chrome)d.webkit=true;else if(d.webkit)d.safari=true;if(d.trident)d.msie=true;return d}()});return d});define("aloha/console",
["aloha/core","util/class","jquery"],function(m,e){var a=e.extend({init:function(){if("undefined"===typeof m.settings.logLevels||!m.settings.logLevels)m.settings.logLevels={error:!0,warn:!0};if("undefined"===typeof m.settings.logHistory||!m.settings.logHistory)m.settings.logHistory={};m.settings.logHistory.maxEntries||(m.settings.logHistory.maxEntries=100);m.settings.logHistory.highWaterMark||(m.settings.logHistory.highWaterMark=90);m.settings.logHistory.levels||(m.settings.logHistory.levels={error:!0,
warn:!0});this.flushLogHistory();m.trigger("aloha-logger-ready")},logHistory:[],highWaterMarkReached:!1,log:function(a,d,b){"undefined"===typeof d&&(b=a);"string"!==typeof d&&(d&&d.toString)&&(d=d.toString());"undefined"===typeof b&&(b=d,d=void 0);if("undefined"===typeof a||!a)a="log";a=a.toLowerCase();if("undefined"!==typeof m.settings.logLevels&&m.settings.logLevels[a]){d=d||"Unkown Aloha Component";this.addToLogHistory({level:a,component:d,message:b,date:new Date});var f=window.console;switch(a){case "error":window.console&&
f.error&&(!d&&!b?f.error("Error occured without message and component"):f.error(d+": "+b));break;case "warn":window.console&&f.warn&&f.warn(d+": "+b);break;case "info":window.console&&f.info&&f.info(d+": "+b);break;case "debug":window.console&&f.log&&f.log(d+" ["+a+"]: "+b);break;default:window.console&&f.log&&f.log(d+" ["+a+"]: "+b)}}},error:function(a,d){this.log("error",a,d)},warn:function(a,d){this.log("warn",a,d)},info:function(a,d){this.log("info",a,d)},debug:function(a,d){this.log("debug",
a,d)},deprecated:function(a,d){this.log("warn",a,d);if(m.settings.logLevels.deprecated)throw Error(d);},isLogLevelEnabled:function(a){return m.settings&&m.settings.logLevels&&m.settings.logLevels[a]},isErrorEnabled:function(){return this.isLogLevelEnabled("error")},isWarnEnabled:function(){return this.isLogLevelEnabled("warn")},isInfoEnabled:function(){return this.isLogLevelEnabled("info")},isDebugEnabled:function(){return this.isLogLevelEnabled("debug")},addToLogHistory:function(a){m.settings.logHistory||
this.init();if(!(0>=m.settings.logHistory.maxEntries)&&m.settings.logHistory.levels[a.level]){this.logHistory.push(a);!this.highWaterMarkReached&&this.logHistory.length>=m.settings.logHistory.maxEntries*m.settings.logHistory.highWaterMark/100&&(m.trigger("aloha-log-full"),this.highWaterMarkReached=!0);for(;this.logHistory.length>m.settings.logHistory.maxEntries;)this.logHistory.shift()}},getLogHistory:function(){return this.logHistory},flushLogHistory:function(){this.logHistory=[];this.highWaterMarkReached=
!1}}),a=new a;return m.Log=m.Console=a});window.GENTICS=window.GENTICS||{};window.GENTICS.Utils=window.GENTICS.Utils||{};define("util/range",["jquery","util/dom","util/class","aloha/console","aloha/rangy-core"],function(m,e,a,j,d){function b(a,c){var b=[],d;for(d=1===a.nodeType?a:a.parentNode;d&&!(d===c||9===d.nodeType);)1===d.nodeType&&b.push(d),d=d.parentNode;return b}function f(a,c,b){var d,g,l=a.length;for(g=0;g<l;g++)d=a[g],"none"!==d.type&&"collapsed"!==d.type&&(d.domobj.nodeName===c&&b.push(d.domobj),
0<d.children.length&&f(d.children,c,b))}var l=window.GENTICS,g=window.Aloha;l.Utils.RangeObject=a.extend({_constructor:function(a){if("object"===typeof a){if("undefined"!==typeof a.startContainer&&(this.startContainer=a.startContainer),"undefined"!==typeof a.startOffset&&(this.startOffset=a.startOffset),"undefined"!==typeof a.endContainer&&(this.endContainer=a.endContainer),"undefined"!==typeof a.endOffset)this.endOffset=a.endOffset}else!0===a&&this.initializeFromUserSelection()},startContainer:void 0,
startOffset:void 0,endContainer:void 0,endOffset:void 0,deleteContents:function(){e.removeRange(this)},log:function(a){j.deprecated("Utils.RangeObject",'log() is deprecated. use console.log() from module "aloha/console" instead: '+a)},isCollapsed:function(){return!this.endContainer||this.startContainer===this.endContainer&&this.startOffset===this.endOffset},getCommonAncestorContainer:function(){if(this.commonAncestorContainer)return this.commonAncestorContainer;this.updateCommonAncestorContainer();
return this.commonAncestorContainer},getContainerParents:function(a,c){var d=c?this.endContainer:this.startContainer;return!d?!1:m(b(d,a?a[0]:null))},getStartContainerParents:function(a){return this.getContainerParents(a,!1)},getEndContainerParents:function(a){return this.getContainerParents(a,!0)},updateCommonAncestorContainer:function(a){if(a)this.commonAncestorContainer=a;else{var c=this.getStartContainerParents(),b=this.getEndContainerParents(),d;if(!(0<c.length&&0<b.length))return j.warn("aloha/range",
"could not find commonAncestorContainer"),!1;for(d=0;d<c.length;d++)if(-1!=b.index(c[d])){this.commonAncestorContainer=c[d];break}}j.debug(a?"commonAncestorContainer was set successfully":"commonAncestorContainer was calculated successfully");return!0},getCollapsedIERange:function(a,c){var b=document.body.createTextRange(),d,g,f;f=this.searchElementToLeft(a,c);f.element?(d=document.body.createTextRange(),d.moveToElementText(f.element),b.setEndPoint("StartToEnd",d),0!==f.characters?b.moveStart("character",
f.characters):(b.moveStart("character",1),b.moveStart("character",-1))):(this.searchElementToRight(a,c),g=3==a.nodeType?a.parentNode:a,d=document.body.createTextRange(),d.moveToElementText(g),b.setEndPoint("StartToStart",d),0!==f.characters&&b.moveStart("character",f.characters));b.collapse();return b},select:function(){var a,c;if("undefined"===typeof this.startContainer||"undefined"===typeof this.endContainer)return j.warn("can not select an empty range"),!1;a=d.createRange();a.setStart(this.startContainer,
this.startOffset);a.setEnd(this.endContainer,this.endOffset);c=d.getSelection();try{c.setSingleRange(a)}catch(b){j.warn(b)}},searchElementToLeft:function(a,c){var b,d=0;3===a.nodeType?(d=c,b=a.previousSibling):0<c&&(b=a.childNodes[c-1]);for(;b&&3===b.nodeType;)d+=b.data.length,b=b.previousSibling;return{element:b,characters:d}},searchElementToRight:function(a,c){var b,d=0;3===a.nodeType?(d=a.data.length-c,b=a.nextSibling):c<a.childNodes.length&&(b=a.childNodes[c]);for(;b&&3===b.nodeType;)d+=b.data.length,
b=b.nextSibling;return{element:b,characters:d}},update:function(a){j.debug("now updating rangeObject");this.initializeFromUserSelection(a);this.updateCommonAncestorContainer()},initializeFromUserSelection:function(){var a=d.getSelection();if(!a||!a.rangeCount)return!1;a=a.getRangeAt(0);if(!a)return!1;this.startContainer=a.startContainer;this.endContainer=a.endContainer;this.startOffset=a.startOffset;this.endOffset=a.endOffset;this.correctRange()},correctRange:function(){var a,c;this.clearCaches();
if(this.isCollapsed()){if(1===this.startContainer.nodeType){if(0<this.startOffset&&3===this.startContainer.childNodes[this.startOffset-1].nodeType){this.startContainer=this.startContainer.childNodes[this.startOffset-1];this.startOffset=this.startContainer.data.length;this.endContainer=this.startContainer;this.endOffset=this.startOffset;return}if(0<this.startOffset&&1===this.startContainer.childNodes[this.startOffset-1].nodeType){if((a=l.Utils.Dom.searchAdjacentTextNode(this.startContainer,this.startOffset,
!0))&&m(a.parentNode).contentEditable()){this.startContainer=this.endContainer=a;this.startOffset=this.endOffset=a.data.length;return}if((a=l.Utils.Dom.searchAdjacentTextNode(this.startContainer,this.startOffset,!1))&&m(a.parentNode).contentEditable()){this.startContainer=this.endContainer=a;this.startOffset=this.endOffset=0;return}}if(this.startOffset<this.startContainer.childNodes.length&&3===this.startContainer.childNodes[this.startOffset].nodeType){this.startContainer=this.startContainer.childNodes[this.startOffset];
this.startOffset=0;this.endContainer=this.startContainer;this.endOffset=0;return}}if(3===this.startContainer.nodeType&&0===this.startOffset){if((a=l.Utils.Dom.searchAdjacentTextNode(this.startContainer.parentNode,l.Utils.Dom.getIndexInParent(this.startContainer),!0))&&g.activeEditable&&m(a.parentNode).contentEditable()&&0<m(a).closest(g.activeEditable.obj).length)this.startContainer=this.endContainer=a,this.startOffset=this.endOffset=a.data.length}else if(3===this.startContainer.nodeType&&!m(this.startContainer.parentNode).contentEditable()&&
(a=l.Utils.Dom.searchAdjacentTextNode(this.startContainer.parentNode,l.Utils.Dom.getIndexInParent(this.startContainer)+1,!1,{},{acceptUntrimmed:!0}))&&g.activeEditable&&m(a.parentNode).contentEditable()&&0<m(a).closest(g.activeEditable.obj).length)this.startContainer=this.endContainer=a,this.startOffset=this.endOffset=0}else{if(1===this.startContainer.nodeType)if(this.startOffset<this.startContainer.childNodes.length&&3===this.startContainer.childNodes[this.startOffset].nodeType)this.startContainer=
this.startContainer.childNodes[this.startOffset],this.startOffset=0;else if(this.startOffset<this.startContainer.childNodes.length&&1===this.startContainer.childNodes[this.startOffset].nodeType){a=!1;for(c=this.startContainer.childNodes[this.startOffset];!1===a&&c.childNodes&&0<c.childNodes.length;)c=c.childNodes[0],3===c.nodeType&&(a=c);!1!==a&&(this.startContainer=a,this.startOffset=0)}if(3===this.startContainer.nodeType&&this.startOffset===this.startContainer.data.length&&(a=l.Utils.Dom.searchAdjacentTextNode(this.startContainer.parentNode,
l.Utils.Dom.getIndexInParent(this.startContainer)+1,!1)))this.startContainer=a,this.startOffset=0;if(3===this.endContainer.nodeType&&0===this.endOffset)if(this.endContainer.previousSibling&&3===this.endContainer.previousSibling.nodeType)this.endContainer=this.endContainer.previousSibling,this.endOffset=this.endContainer.data.length;else if(this.endContainer.previousSibling&&1===this.endContainer.previousSibling.nodeType&&this.endContainer.parentNode){a=this.endContainer.parentNode;for(c=0;c<a.childNodes.length;++c)if(a.childNodes[c]==
this.endContainer){this.endOffset=c;break}this.endContainer=a}1==this.endContainer.nodeType&&0===this.endOffset&&this.endContainer.previousSibling&&(3===this.endContainer.previousSibling.nodeType?(this.endContainer=this.endContainer.previousSibling,this.endOffset=this.endContainer.data.length):1===this.endContainer.previousSibling.nodeType&&(this.endContainer.previousSibling.childNodes&&0<this.endContainer.previousSibling.childNodes.length)&&(this.endContainer=this.endContainer.previousSibling,this.endOffset=
this.endContainer.childNodes.length));if(1==this.endContainer.nodeType)if(0<this.endOffset&&3===this.endContainer.childNodes[this.endOffset-1].nodeType)this.endContainer=this.endContainer.childNodes[this.endOffset-1],this.endOffset=this.endContainer.data.length;else if(0<this.endOffset&&1===this.endContainer.childNodes[this.endOffset-1].nodeType){a=!1;for(c=this.endContainer.childNodes[this.endOffset-1];!1===a&&c.childNodes&&0<c.childNodes.length;)c=c.childNodes[c.childNodes.length-1],3===c.nodeType&&
(a=c);!1!==a&&(this.endContainer=a,this.endOffset=this.endContainer.data.length)}}},clearCaches:function(){this.commonAncestorContainer=void 0},getRangeTree:function(a){"undefined"===typeof a&&(a=this.getCommonAncestorContainer());this.inselection=!1;return this.recursiveGetRangeTree(a)},recursiveGetRangeTree:function(a){var c=0,b=this,d=[];m(a).contents().each(function(g){var f="none",e=!1,j=!1,m=!1,v=!1,u=!1,z=!1;b.isCollapsed()&&(a===b.startContainer&&b.startOffset===g)&&(d[c]=new l.Utils.RangeTree,
d[c].type="collapsed",d[c].domobj=void 0,b.inselection=!1,m=!0,c++);if(!b.inselection&&!m)switch(this.nodeType){case 3:this===b.startContainer&&(b.inselection=!0,f=0<b.startOffset?"partial":"full",e=b.startOffset,j=this.length);break;case 1:if(this===b.startContainer&&0===b.startOffset&&(b.inselection=!0,f="full"),a===b.startContainer&&b.startOffset===g)b.inselection=!0,f="full"}if(b.inselection&&!m){"none"==f&&(f="full");switch(this.nodeType){case 3:this===b.endContainer&&(b.inselection=!1,b.endOffset<
this.length&&(f="partial"),!1===e&&(e=0),j=b.endOffset);break;case 1:this===b.endContainer&&0===b.endOffset&&(b.inselection=!1)}a===b.endContainer&&b.endOffset<=g&&(b.inselection=!1,f="none")}d[c]=new l.Utils.RangeTree;d[c].domobj=this;d[c].type=f;"partial"==f&&(d[c].startOffset=e,d[c].endOffset=j);d[c].children=b.recursiveGetRangeTree(this);if(0<d[c].children.length){for(g=0;g<d[c].children.length;++g)switch(d[c].children[g].type){case "none":v=!0;break;case "full":z=!0;break;case "partial":u=!0}u||
z&&v?d[c].type="partial":z&&(!u&&!v)&&(d[c].type="full")}c++});this.isCollapsed()&&(a===this.startContainer&&this.startOffset==a.childNodes.length)&&(d[c]=new l.Utils.RangeTree,d[c].type="collapsed",d[c].domobj=void 0);return d},findMarkup:function(a,c,d){var d=d?this.endContainer:this.startContainer,g,c=c?c[0]:null;if(d){c=b(d,c);d=0;for(g=c.length;d<g;d++)if(a.apply(c[d]))return c[d];return!1}},findAllMarkupByTagName:function(a,c){var b=c.getRangeTree(),d=[],a=a.toUpperCase();f(b,a,d);return d},
getText:function(){return this.isCollapsed()?"":this.recursiveGetText(this.getRangeTree())},recursiveGetText:function(a){if(!a)return"";var c=this,b="";m.each(a,function(){"full"==this.type?b+=m(this.domobj).text():"partial"==this.type&&3===this.domobj.nodeType?b+=m(this.domobj).text().substring(this.startOffset,this.endOffset):"partial"==this.type&&(1===this.domobj.nodeType&&this.children)&&(b+=c.recursiveGetText(this.children))});return b}});l.Utils.RangeTree=a.extend({domobj:{},type:null,children:[]});
return l.Utils.RangeObject});define("PubSub",[],function(){var m={},e={},a=0;return{sub:function(j,d){if("function"!==typeof d)return-1;var b=m[j];b||(b=m[j]=[]);b.push(++a);e[a]={channel:j,callback:d};return a},unsub:function(a){if(-1===a||!e[a])return!1;var d=e[a]&&m[e[a].channel];delete e[a];for(var b=d.length;b;)if(d[--b]===a)return d.splice(b,1),!0;return!1},pub:function(a,d){var b=a.split("."),f,l=b.length,g="",k=0;for(f=0;f<l;++f){var g=g+((0===f?"":".")+b[f]),c;var q=g;c=d;if(m[q]){c?"object"!==
typeof c&&(c={data:c}):c={};c.channel=q;for(var q=m[q].slice(),n=void 0,n=0;n<q.length;++n)e[q[n]].callback(c);c=n}else c=0;k+=c}return k}}});define("util/functions",[],function(){return{identity:function(m){return m},noop:function(){},returnTrue:function(){return!0},returnFalse:function(){return!1},complement:function(m){return function(){return!m.apply(this,arguments)}}}});define("util/maps",[],function(){return{isEmpty:function(m){for(var e in m)if(m.hasOwnProperty(e))return!1;return!0},fillTuples:function(m,
e){for(var a=e.length,j;a--;)j=e[a],m[j[0]]=j[1];return m},fillKeys:function(m,e,a){for(var j=e.length;j--;)m[e[j]]=a;return m},keys:function(m){var e=[],a;for(a in m)m.hasOwnProperty(a)&&e.push(a);return e},forEach:function(m,e){for(var a in m)m.hasOwnProperty(a)&&e(m[a],a,m)}}});define("util/arrays",["util/functions"],function(m){function e(a,b){var d,c,f=[];d=0;for(c=a.length;d<c;d++)f.push(b(a[d]));return f}function a(a,b){return a.map(b)}function j(a,b){var d,c,f,e=[];d=0;for(c=a.length;d<c;d++)f=
a[d],b(f)&&e.push(f);return e}function d(a,b){var d,c;d=0;for(c=a.length;d<c;d++)if(b===a[d])return d;return-1}function b(a,b){return-1!==d(a,b)}function f(a,b){var d,c;d=0;for(c=a.length;d<c;d++)if(b(a[d]))return!0;return!1}return{filter:j,indexOf:d,reduce:function(a,b,d){var c,f;c=0;for(f=a.length;c<f;c++)b=d(b,a[c]);return b},forEach:function(a,b){var d,c;d=0;for(c=a.length;d<c;d++)b(a[d],d,a)},some:f,every:function(a,b){return!f(a,m.complement(b))},map:Array.prototype.map?a:e,contains:b,equal:function(a,
b,d){var c,f=a.length;if(f!==b.length)return!1;if(d)for(c=0;c<f;c++){if(!d(a[c],b[c]))return!1}else for(c=0;c<f;c++)if(a[c]!==b[c])return!1;return!0},applyNotNull:function(a,b){return null==a?null:b(a)},sortUnique:function(a,b){var d;if(b){a.sort(b);for(d=1;d<a.length;d++)0===b(a[d],a[d-1])&&a.splice(d--,1)}else{a.sort();for(d=1;d<a.length;d++)a[d]==a[d-1]&&a.splice(d--,1)}return a},intersect:function(a,d){return j(a,function(a){return b(d,a)})},subtract:function(a,d){return j(a,function(a){return!b(d,
a)})},second:function(a){return a[1]},last:function(a){return a.length?a[a.length-1]:null},coerce:function(a){var b,d,c=[];b=0;for(d=a.length;b<d;b++)c.push(a[b]);return c},isEmpty:function(a){return 0===a.length},concat:function(a,b){return a.concat(b)}}});define("util/strings",["jquery"],function(){var m=/\s+/;return{words:function(e){e=e.split(m);e.length&&""===e[0]&&e.shift();e.length&&""===e[e.length-1]&&e.pop();return e},dashesToCamelCase:function(e){return e.replace(/[\-]([a-z])/gi,function(a,
e){return e.toUpperCase()})},camelCaseToDashes:function(e){return e.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})},splitIncl:function(e,a){for(var j=[],d=0,b;null!=(b=a.exec(e));)d<b.index&&(j.push(e.substring(d,b.index)),d=b.index),d+=b[0].length,j.push(b[0]);d<e.length&&j.push(e.substring(d,e.length));return j},empty:function(e){return""===e||null==e},parseBoolean:function(e){return!0===e||1===e?!0:"string"===typeof e||e instanceof String?(e=e.toLowerCase(),"true"===e||"1"===e):!1}}});
define("util/browser",["aloha/core"],function(m){return{mozilla:m.browser.mozilla,ie8:m.browser.msie&&9>parseInt(m.browser.version,10),ie7:m.browser.msie&&8>parseInt(m.browser.version,10),ie:m.browser.msie}});define("util/dom2","aloha/core jquery util/functions util/maps util/arrays util/strings util/browser util/dom util/range".split(" "),function(m,e,a,j,d,b,f,l,g){function k(a,c,b){for(;c;){var d=c.nextSibling;a.insertBefore(c,b);c=d}}function c(a){var c=a.outerHTML;if(typeof c!=="undefined")return c;
try{return W?W.serializeToString(a):a.xml}catch(b){return a.xml}}function q(a){for(var b=[],a=c(a.cloneNode(false)),d;null!=(d=P.exec(a));)b.push(d[1]);return b}function n(a,c){var d={},g,f,k,l,e,j,q;j=0;for(e=a.length;j<e;j++){k=a[j];if(k.className){f=b.words(k.className);for(q=0;q<f.length;q++){l=f[q];if(c[l])(g=d[l])?g.push(k):d[l]=[k]}}}return d}function o(a){for(var c=0;a.previousSibling;){c++;a=a.previousSibling}return c}function p(a){for(var c=0,a=a.firstChild;a;){c=c+1;a=a.nextSibling}return c}
function r(a,c){return 1===a.nodeType&&c>=p(a)||3===a.nodeType&&c===a.length&&!a.nextSibling}function t(a,c){1===a.nodeType&&c<p(a)?a=a.childNodes[c]:3===a.nodeType&&c===a.length&&(a=a.nextSibling||a.parentNode);return a}function x(a,c,b){b?c.appendChild(a):c.parentNode.insertBefore(a,c)}function v(a,c){this.node=a;this.atEnd=c}function u(a,c){return new v(a,c)}function z(a,c){return u(t(a,c),r(a,c))}function C(a,c){for(var b=[],d=a.parentNode;d&&!c(d);){b.push(d);d=d.parentNode}return b}function F(a,
c){var b=C(a,c),d=b.length?b[b.length-1]:a;d.parentNode&&b.push(d.parentNode);return b}function A(a,c){if(c(a))return[];var b=C(a,c);b.unshift(a);return b}function E(a,c){if(c(a))return[a];var b=F(a,c);b.unshift(a);return b}function J(a,c){var b=a.parentNode,d=a.nodeValue;if(0===c||c>=d.length)return a;var g=document.createTextNode(d.substring(0,c)),d=document.createTextNode(d.substring(c,d.length));b.insertBefore(g,a);b.insertBefore(d,a);b.removeChild(a);return g}function K(a,c,b,d,g,f){if(c===g){g=
f.length;if(b===0){c=f.parentNode;b=o(f)}else if(b<g)c=f;else if(b===g){c=f.parentNode;b=o(f)+1}else{c=f.nextSibling;b=b-g}a[d].call(a,c,b)}}function O(a,c,b){if(3===a.nodeType){var d=b.startContainer,g=b.startOffset,f=b.endContainer,k=b.endOffset,c=J(a,c);K(b,d,g,"setStart",a,c);K(b,f,k,"setEnd",a,c)}}function y(a,c,b,d){for(;a&&!b(a,d);){var g=a.nextSibling;c(a,d);a=g}}function Y(c,b,d){y(c,b,a.returnFalse,d)}function D(a,c,b){1===a.nodeType&&Y(a.firstChild,function(a){D(a,c,b)});c(a,b)}function G(a){if(a){this.startContainer=
a.startContainer;this.startOffset=a.startOffset;this.endContainer=a.endContainer;this.endOffset=a.endOffset;this.commonAncestorContainer=a.commonAncestorContainer;this.collapsed=a.collapsed}}function N(a,c){c.atEnd?a.setStart(c.node,p(c.node)):a.setStart(c.node.parentNode,o(c.node))}function B(a,c){c.atEnd?a.setEnd(c.node,p(c.node)):a.setEnd(c.node.parentNode,o(c.node))}function H(a,c){a.setStart(c.startContainer,c.startOffset);a.setEnd(c.endContainer,c.endOffset)}function R(a,c,b){if(!a.collapsed){for(var d=
z(a.startContainer,a.startOffset),g=z(a.endContainer,a.endOffset),f=false;!d.equals(g)&&c(d)&&d.next();)f=true;b=b||c;c=false;for(3===a.endContainer.nodeType&&a.endOffset>0&&a.endOffset<a.endContainer.length&&g.next()&&b(g)&&g.prev();!g.equals(d)&&b(g)&&g.prev();)c=true;f&&N(a,d);c&&B(a,g)}}function L(a){if(a.firstChild)return a.firstChild;for(;a&&!a.nextSibling;)a=a.parentNode;return a&&a.nextSibling}function S(a){for(var c=a.previousSibling;c&&c.lastChild;)c=c.lastChild;return c||a.parentNode}var P=
/\s([^\/<>\s=]+)(?:=(?:"[^"]*"|'[^']*'|[^>\/\s]+))?/g,W=window.XMLSerializer&&new window.XMLSerializer;v.prototype.next=function(){var a=this.node,c;if(this.atEnd||1!==a.nodeType){if(c=a.nextSibling)this.atEnd=false;else{c=a.parentNode;if(!c)return false;this.atEnd=true}this.node=c}else(c=a.firstChild)?this.node=c:this.atEnd=true;return true};v.prototype.prev=function(){var a=this.node,c;if(this.atEnd)(c=a.lastChild)?this.node=c:this.atEnd=false;else{if(c=a.previousSibling){if(1===a.nodeType)this.atEnd=
true}else{c=a.parentNode;if(!c)return false}this.node=c}return true};v.prototype.equals=function(a){return a.node===this.node&&a.atEnd===this.atEnd};v.prototype.clone=function(a){return a(a.node,a.atEnd)};v.prototype.insert=function(a){return x(a,this.node,this.atEnd)};G.prototype.update=function(){if(this.startContainer&&this.endContainer){this.collapsed=this.startContainer===this.endContainer&&this.startOffset===this.endOffset;var c=A(this.startContainer,a.returnFalse),b=A(this.endContainer,a.returnFalse);
this.commonAncestorContainer=d.intersect(c,b)[0]}};G.prototype.setStart=function(a,c){this.startContainer=a;this.startOffset=c;this.update()};G.prototype.setEnd=function(a,c){this.endContainer=a;this.endOffset=c;this.update()};return{backward:S,forward:L,findForward:function(a,c,b){for(;a&&!b(a);){if(c(a))return a;a=L(a)}return null},findBackward:function(a,c,b){for(;a&&!b(a);){if(c(a))return a;a=S(a)}return null},moveNextAll:k,attrNames:q,attrs:function(a){var c=[],b={},d=q(a),g,f;g=0;for(f=d.length;g<
f;g++){var k=d[g],l=e.attr(a,k);if(k==="lang"&&a.lang)l=a.lang;l=null==l?"":l.toString();if(!b.hasOwnProperty(k)){c.push([k,l]);b[k]=true}}return c},indexByClass:function(a,c){var b;b=f.ie7?a.getElementsByTagName("*"):e(a).find("."+j.keys(c).join(",."));return n(b,c)},indexByName:function(a,c){var b,d={},g;b=0;for(g=c.length;b<g;b++){var f=c[b];d[f]=e.makeArray(a.getElementsByTagName(f))}return d},indexByClassHaveList:n,outerHtml:c,removeShallow:function(a){var c=a.parentNode;k(c,a.firstChild,a);
c.removeChild(a)},remove:function(a){var c=a.parentNode;c&&c.removeChild(a)},wrap:function(a,c){a.parentNode.replaceChild(c,a);c.appendChild(a)},insert:x,cursor:u,cursorFromBoundaryPoint:z,nodeAtOffset:t,isAtEnd:r,parentsUntil:C,parentsUntilIncl:F,childAndParentsUntil:A,childAndParentsUntilIncl:E,childAndParentsUntilNode:function(a,c){return A(a,function(a){return a===c})},childAndParentsUntilInclNode:function(a,c){return E(a,function(a){return a===c})},next:function(a,c,b){for(;a&&!c(a,b);)a=a.nextSibling;
return a},parent:function(a,c,b){for(;a&&!c(a,b);)a=a.parentNode;return a},isTextNode:function(a){return 3===a.nodeType},nodeIndex:o,splitTextNode:J,splitTextContainers:function(a){O(a.startContainer,a.startOffset,a);O(a.endContainer,a.endOffset,a)},walk:Y,walkRec:D,walkUntil:y,walkUntilNode:function(a,c,b,d){y(a,c,function(a){return a===b},d)},stableRange:function(a){return new G(a)},trimRange:R,trimRangeClosingOpening:function(a,c,b){b=b||c;R(a,function(a){return a.atEnd||c(a.node)},function(a){a=
a.atEnd?a.node.lastChild:a.node.previousSibling;return!a||b(a)})},setRangeFromRef:H,setRangeStartFromCursor:N,setRangeEndFromCursor:B,splitTextNodeAdjustRange:O,insertSelectText:function(a,c){if(a.length){O(c.startContainer,c.startOffset,c);var b=t(c.startContainer,c.startOffset),d=r(c.startContainer,c.startOffset);if(!d&&3===b.nodeType){b.insertData(0,a);c.setStart(b,0);c.setEnd(b,a.length)}else{var g;if((g=d?b.lastChild:b.previousSibling)&&3===g.nodeType){g.insertData(g.length,a);c.setStart(g,g.length-
a.length)}else{g=document.createTextNode(a);x(g,b,d);c.setStart(g,0)}c.setEnd(g,g.length)}}},areRangesEq:function(a,c){return a.startContainer===c.startContainer&&a.startOffset===c.startOffset&&a.endContainer===c.endContainer&&a.endOffset===c.endOffset},collapseToEnd:function(a){a.setStart(a.endContainer,a.endOffset)},extendToWord:function(a){var c=new g(a);l.extendToWord(c);H(a,c)},rangeFromRangeObject:function(a){var c=m.createRange();c.setStart(a.startContainer,a.startOffset);c.setEnd(a.endContainer,
a.endOffset);return c},cloneShallow:function(a){return a.cloneNode(false)},setStyle:function(a,c,b){e(a).css(c,null==b?"":b)},getStyle:function(a,c){c=b.dashesToCamelCase(c);return a.nodeType===1?a.style[c]:null},getComputedStyle:function(a,c){if(a.currentStyle)return a.currentStyle[c];var b=a.ownerDocument;if(b.defaultView&&b.defaultView.getComputedStyle)if(b=b.defaultView.getComputedStyle(a,null))return b[c]||b.getPropertyValue(c);return null},nodeLength:function(a){return 1===a.nodeType?p(a):3===
a.nodeType?a.length:0}}});define("aloha/content-rules",["PubSub","aloha/core","util/dom2","util/arrays","aloha/jquery"],function(m,e,a,j,d){function b(a,c){var b=d(a),g=[],f;for(f in c)c.hasOwnProperty(f)&&b.is(f)&&g.push(c[f]);return g}function f(a){var c=[];d.each(a,function(a,b){c=c.concat(b)});d.unique(c);return c}function l(a,c){var d=b(a,q);if(0<d.length&&!j.contains(f(["#text"].concat(d)),c.toLowerCase()))return!1;d=b(a,n);return 0<d.length?!j.contains(f(d),c.toLowerCase()):!0}function g(a,
c){return d.extend.apply({},b(a,o))[c.toLowerCase()]||c}var k=["li"],c="caption colgroup col thead tbody tfoot td th".split(" "),q=function(a){for(var b in a)if(a.hasOwnProperty(b)){if(j.contains(a[b],"ol")||j.contains(a[b],"ul"))a[b]=j.concat(a[b],k);j.contains(a[b],"table")&&(a[b]=j.concat(a[b],c))}return a}(e.settings&&e.settings.contentRules&&e.settings.contentRules.whitelist||{}),n=e.settings&&e.settings.contentRules&&e.settings.contentRules.blacklist||{},o=e.settings&&e.settings.contentRules&&
e.settings.contentRules.translate||{},p={FIELDSET:!0,OBJECT:!0,FIGURE:!0,AUDIO:!0,SELECT:!0,COLGROUP:!0,HGROUP:!0,TABLE:!0,TBODY:!0,TR:!0,OL:!0,UL:!0,DL:!0,MENU:!0},r={LI:["OL","UL","DL"],DT:["DL"],DD:["DL"],TBODY:["TABLE"],TR:["TABLE","TBODY"],TH:["TABLE","TBODY"],TD:["TR","TH"]};return{isAllowed:l,translate:g,applyRules:function(c,b){var f=b.ownerDocument,k=f.createElement("div");k.innerHTML=c;for(var e=a.forward(k);e;)if(d(e).hasClass("aloha-block"))e=e.nextSibling||a.forward(e.lastChild||e);else{var j=
g(b,e.nodeName);j!==e.nodeName&&(j=f.createElement(j),j.innerHTML=e.innerHTML,e.parentNode.replaceChild(j,e),e=j);l(b,e.nodeName)?e=a.forward(e):p[e.nodeName]||r[e.nodeName]?(j=a.backward(e),e.parentNode.removeChild(e),e=a.forward(j)):(j=a.forward(e),a.removeShallow(e),e=j)}return k.innerHTML}}});define("util/html",["jquery","util/dom","util/maps","util/arrays"],function(m,e,a,j){function d(a){return n.test(a)||r.test(a)}function b(a){return 3===a.nodeType&&d(a.data)}function f(a){return v[a.nodeName]}
function l(a){return 3===a.nodeType&&!a.length}function g(a){return 3===a.nodeType&&0===a.data.length||a===a.parentNode.lastChild&&f(a.parentNode)&&"BR"===a.nodeName?!0:b(a)}var k={A:!0,B:!0,EM:!0,FONT:!0,I:!0,S:!0,SPAN:!0,STRIKE:!0,STRONG:!0,SUB:!0,SUP:!0,U:!0},c="address article aside audio blockquote canvas dd div dl fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hgroup hr noscript ol output p pre section table tfoot ul video".split(" "),q=["\\u200B","\\u200C","\\u200D","\\uFEFF"],
n=RegExp("^[\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u0085\\u00A0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]+$"),o=RegExp("^[\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u0085\\u00A0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]+"),p=RegExp("[\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u0085\\u00A0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]+$"),
r=RegExp("["+q.join("")+"]+"),t=RegExp("^["+q.join("")+"]+"),x=RegExp("["+q.join("")+"]+$"),v={};a.fillKeys(v,c,!0);a.fillKeys(v,j.map(c,function(a){return a.toUpperCase()}),!0);return{BLOCKLEVEL_ELEMENTS:c,VOID_ELEMENTS:"area base br col command embed hr img input keygen link meta param source track wbr".split(" "),TEXT_LEVEL_SEMANTIC_ELEMENTS:"a abbr b bdi bdo cite code del dfn em i ins kbd mark q rp rt ruby s samp small strong sub sup time u var".split(" "),isBlock:f,isIgnorableWhitespace:l,isInlineFormattable:function(a){return k[a.nodeName]},
isProppedBlock:function(a){if(!v[a.nodeName])return!1;var c=!1,a=a.children,b=a.length,d;for(d=0;d<b;d++)if(!c&&"br"===a[d].nodeName.toLowerCase())c=!0;else if(!l(a[d]))return!1;return c},isEditingHost:function(a){return 1===a.nodeType&&"true"===a.contentEditable},findNodeLeft:function(a,c){for(;a&&!c(a);)a=a.nextSibling;return a},findNodeRight:function(a,c){for(;a&&!c(a);)a=a.previousSibling;return a},allowNestedParagraph:function(a){return a.obj[0]&&e.allowsNesting(a.obj[0],m("<p>")[0])?!0:!1},
trimWhitespaceCharacters:function(a){return a.replace(o,"").replace(p,"").replace(t,"").replace(x,"")},isWSPorZWSPNode:b,isWSPorZWSPText:d,isUnrenderedNode:g,isRenderedNode:function(a){return!g(a)},hasOnlyWhiteSpaceChildren:function(a){var a=a.childNodes,c,d;c=0;for(d=a.length;c<d;c++)if(!b(a[c]))return!1;return!0}}});define("aloha/engine","aloha/core aloha/ecma5shims util/maps util/html util/dom util/dom2 jquery aloha/content-rules PubSub".split(" "),function(m,e,a,j,d,b,f,l,g){function k(a,c){return a.hasAttribute?
a.hasAttribute(c):typeof a.attributes[c]!=="undefined"}function c(a,c){var b=a.cloneNode(false);b.deleteData(0,c);a.deleteData(c,a.length-c);var d=a.nextSibling,g=a.parentNode;d?g.insertBefore(b,d):g.appendChild(b);return b}function q(a){return a===null||!a||a===Ga}function n(a,c){typeof c=="string"&&(c=[c]);typeof c=="object"&&(c=e(c).map(function(a){return a.toUpperCase()}));return a&&a.nodeType==1&&q(a.namespaceURI)&&(typeof c=="undefined"||e(c).indexOf(a.tagName)!=-1)}function o(a){return a&&
a.nodeType==1&&q(a.namespaceURI)}function p(a,c){return a&&a.nodeType==1&&q(a.namespaceURI)&&c.toUpperCase()===a.nodeName}function r(a,c){var b;if(b=a)if(b=a.nodeType==1)if(b=q(a.namespaceURI))a:{b=a.nodeName;var d,g;b=b.toUpperCase();d=0;for(g=c.length;d<g;d++)if(c[d].toUpperCase()===b){b=true;break a}b=false}return b}function t(a){var c,b=0;if(!a||!a.style)return 0;if(typeof a.style.length!=="undefined")return a.style.length;for(c in a.style)a.style[c]&&(a.style[c]!==0&&a.style[c]!=="false")&&b++;
return b}function x(a){if(!a)return null;var c=[],b;for(b=a.length>>>0;b--;)c[b]=a[b];return c}function v(a){for(;a&&!a.nextSibling;)a=a.parentNode;return!a?null:a.nextSibling}function u(a){return a.hasChildNodes()?a.firstChild:v(a)}function z(a){if(a.previousSibling){for(a=a.previousSibling;a.hasChildNodes();)a=a.lastChild;return a}return a.parentNode&&a.parentNode.nodeType==e.Node.ELEMENT_NODE?a.parentNode:null}function C(a,c){return a&&c&&Boolean(e.compareDocumentPosition(a,c)&e.Node.DOCUMENT_POSITION_CONTAINED_BY)}
function F(a,c){return c&&a&&Boolean(e.compareDocumentPosition(c,a)&e.Node.DOCUMENT_POSITION_CONTAINED_BY)}function A(a,c){return Boolean(e.compareDocumentPosition(a,c)&e.Node.DOCUMENT_POSITION_FOLLOWING)}function E(a){for(var c=[];a.parentNode;){c.unshift(a.parentNode);a=a.parentNode}return c}function J(a){for(var c=[],b=v(a);null!=(a=u(a))&&a!=b;)c.push(a);return c}function K(a){return{"xx-small":1,small:2,medium:3,large:4,"x-large":5,"xx-large":6,"xxx-large":7}[a]}function O(a){return a.dir=="ltr"?
"ltr":a.dir=="rtl"?"rtl":!o(a.parentNode)?"ltr":O(a.parentNode)}function y(a){switch(a.nodeType){case e.Node.PROCESSING_INSTRUCTION_NODE:case e.Node.DOCUMENT_TYPE_NODE:return 0;case e.Node.TEXT_NODE:case e.Node.COMMENT_NODE:return a.length;default:return a.childNodes.length}}function Y(a,c,b,g){if(a==b){if(c==g)return"equal";if(c<g)return"before";if(c>g)return"after"}var f=e.compareDocumentPosition(b,a);if(f&e.Node.DOCUMENT_POSITION_FOLLOWING){g=Y(b,g,a,c);if(g=="before")return"after";if(g=="after")return"before"}if(f&
e.Node.DOCUMENT_POSITION_CONTAINS){for(;b.parentNode!=a;)b=b.parentNode;if(d.getIndexInParent(b)<c)return"after"}return"before"}function D(a){for(;a.parentNode!=null;)a=a.parentNode;return a}function G(a,c){return Y(a,0,c.startContainer,c.startOffset)!=="after"||Y(a,y(a),c.endContainer,c.endOffset)!=="before"?false:D(a)==D(c.startContainer)}function N(a,c){typeof c=="undefined"&&(c=function(){return true});for(var b=a.startContainer,b=b.hasChildNodes()&&a.startOffset<b.childNodes.length?b.childNodes[a.startOffset]:
a.startOffset==y(b)?v(b):u(b),d=a.endContainer,d=d.hasChildNodes()&&a.endOffset<d.childNodes.length?d.childNodes[a.endOffset]:v(d),g=[];A(b,d);)if(G(b,a)&&c(b)){g.push(b);b=v(b)}else b=u(b);return g}function B(a,c){typeof c=="undefined"&&(c=function(){return true});for(var b=a.startContainer,b=b.hasChildNodes()&&a.startOffset<b.childNodes.length?b.childNodes[a.startOffset]:a.startOffset==y(b)?v(b):u(b),d=a.endContainer,d=d.hasChildNodes()&&a.endOffset<d.childNodes.length?d.childNodes[a.endOffset]:
v(d),g=[];A(b,d);){G(b,a)&&c(b)&&g.push(b);b=u(b)}return g}function H(a){if(a.toLowerCase()=="currentcolor")return null;var c=document.createElement("span");document.body.appendChild(c);c.style.color="black";var b=document.createElement("span");c.appendChild(b);b.style.color=a;a=e.getComputedStyle(b).color;if(a=="rgb(0, 0, 0)"){c.color="white";a=e.getComputedStyle(b).color;if(a!="rgb(0, 0, 0)")return null}document.body.removeChild(c);return/^rgba\([0-9]+, [0-9]+, [0-9]+, 1\)$/.test(a)?a.replace("rgba",
"rgb").replace(", 1)",")"):a=="transparent"?"rgba(0, 0, 0, 0)":a}function R(a){a=a.toLowerCase();if(e(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen",
"darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen",
"lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru",
"pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]).indexOf(a)!=-1)return a;var a=H(a),c=/^rgb\(([0-9]+), ([0-9]+), ([0-9]+)\)$/.exec(a);return c?"#"+parseInt(c[1],10).toString(16).replace(/^.$/,"0$&")+parseInt(c[2],10).toString(16).replace(/^.$/,
"0$&")+parseInt(c[3],10).toString(16).replace(/^.$/,"0$&"):/^#[abcdef0123456789]+$/i.exec(a)?a:null}function L(a){a=e(a).trim();if(/^[\-+]?[0-9]+(\.[0-9]+)?([eE][\-+]?[0-9]+)?$/.test(a)){var c;if(a[0]=="+"){a=a.slice(1);c="relative-plus"}else if(a[0]=="-"){a=a.slice(1);c="relative-minus"}else c="absolute";a=parseInt(a,10);c=="relative-plus"&&(a=a+3);c=="relative-minus"&&(a=3-a);a<1&&(a=1);a>7&&(a=7);a={1:"xx-small",2:"small",3:"medium",4:"large",5:"x-large",6:"xx-large",7:"xxx-large"}[a]}return a}
function S(a){a=L(a);if(f.inArray(a,["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large"])==-1&&!/^[0-9]+(\.[0-9]+)?(cm|mm|in|pt|pc|px)$/.test(a))return null;var c=document.createElement("font");document.body.appendChild(c);a=="xxx-large"?c.size=7:c.style.fontSize=a;a=parseInt(e.getComputedStyle(c).fontSize,10);document.body.removeChild(c);for(var b=1;b<7;){c=document.createElement("font");c.size=b;document.body.appendChild(c);var d=parseInt(e.getComputedStyle(c).fontSize,
10);c.size=1+b;var g=parseInt(e.getComputedStyle(c).fontSize,10);document.body.removeChild(c);if(a<(g+d)/2)return""+b;b++}return"7"}function P(a,c,b,d){var g;nb===0&&(Ma=b);nb++;try{g=d()}catch(f){nb--;throw f;}nb--;return g}function W(a,c){a=a.toLowerCase();return P(a,"action",c,function(a){return function(){return f.inArray(a,["copy","cut","paste","selectall","stylewithcss","usecss"])!=-1||c!==null}}(a))}function la(a){var c=new window.GENTICS.Utils.RangeObject;c.startContainer=a.startContainer;
c.startOffset=a.startOffset;c.endContainer=a.endContainer;c.endOffset=a.endOffset;c.correctRange();c.select()}function ka(a,c,b,d){var g=a.toLowerCase(),f=c,k=b;if(arguments.length==1||arguments.length>=4&&typeof f=="undefined")f=false;if(arguments.length<=2||arguments.length>=4&&typeof k=="undefined")k="";return P(g,"action",d,function(a,c,b){return function(){if(!W(a))return false;Q[a].action(b,d);la(d);return true}}(g,f,k))}function X(a,c){a=a.toLowerCase();return P(a,"state",c,function(a){return function(){return!W(a,
c)?false:typeof bb(a,c)!="undefined"?bb(a,c):Q[a].state(c)}}(a))}function U(a,c){a=a.toLowerCase();return P(a,"value",c,function(){return!Q.hasOwnProperty(a)||!Q[a].hasOwnProperty("value")?"":a=="fontsize"&&Na("fontsize",c)!==void 0?S(Na("fontsize",c)):typeof Na(a,c)!="undefined"?Na(a,c):Q[a].value(c)})}function V(a){return a&&a.nodeType==1&&q(a.namespaceURI)&&ca[a.nodeName]}function ga(a){return a&&(a.nodeType==e.Node.ELEMENT_NODE&&!Eb[e.getComputedStyle(a).display]||a.nodeType==e.Node.DOCUMENT_NODE||
a.nodeType==e.Node.DOCUMENT_FRAGMENT_NODE)}function Z(a){return a&&!ga(a)}function ea(a){return a&&a.nodeType==e.Node.ELEMENT_NODE&&(a.contentEditable=="true"||a.parentNode&&a.parentNode.nodeType==e.Node.DOCUMENT_NODE&&a.parentNode.designMode=="on")}function I(a){return a&&!ea(a)&&(a.nodeType!=e.Node.ELEMENT_NODE||a.contentEditable!="false"||f(a).hasClass("aloha-table-wrapper"))&&(ea(a.parentNode)||I(a.parentNode))}function Ka(a){var c;for(c=0;c<a.childNodes.length;c++)if(I(a.childNodes[c])||Ka(a.childNodes[c]))return true;
return false}function Da(a){if(ea(a))return a;if(I(a)){for(a=a.parentNode;!ea(a);)a=a.parentNode;return a}return null}function da(a,c){return Da(a)&&Da(a)==Da(c)}function va(a){if(!p(a,"br"))return false;for(var c=a.parentNode;e.getComputedStyle(c).display=="inline";)c=c.parentNode;var b=c.style.height,d=c.style.maxHeight,g=c.style.minHeight;c.style.height="auto";c.style.maxHeight="none";if(!(m.browser.msie&&m.browser.version<8))c.style.minHeight="0";var f=document.createTextNode("​"),k=c.offsetHeight;
if(k==0)throw"isCollapsedLineBreak: original height is zero, bug?";a.parentNode.insertBefore(f,a.nextSibling);a=c.offsetHeight;f.parentNode.removeChild(f);c.style.height=b;c.style.maxHeight=d;if(!(m.browser.msie&&m.browser.version<8))c.style.minHeight=g;return k<a-5}function pa(a){if(!p(a,"br")||p(a.parentNode,"li")&&a.parentNode.childNodes.length==1)return false;for(var c=a.parentNode;e.getComputedStyle(c).display=="inline";)c=c.parentNode;var b=c.style.height,g=c.style.maxHeight,f=c.style.minHeight,
k=c.contentEditable;c.style.height="auto";c.style.maxHeight="none";c.style.minHeight="0";if(m.browser.msie&&m.browser.version<=7)c.contentEditable="false";var l=d.getOffsetHeight(c);if(l==0)throw"isExtraneousLineBreak: original height is zero, bug?";var j=a.style.display;a.style.display="none";var q=c.offsetHeight;c.style.height=b;c.style.maxHeight=g;c.style.minHeight=f;if(m.browser.msie&&m.browser.version<=7)c.contentEditable=k;a.style.display=j;return l==q}function qa(a){var c=e.Node;if(a&&a.nodeType===
c.TEXT_NODE){var b=a.parentNode,a=a.data;if(f.trim(a).length===0)return true;if(b&&/^[\t\n\r ]+$/.test(a))if(b.nodeType===c.ELEMENT_NODE){if(f.inArray(e.getComputedStyle(b).whiteSpace,["normal","nowrap"])!==-1||e.getComputedStyle(b).whiteSpace==="pre-line")return true}else if(b.nodeType===c.DOCUMENT_FRAGMENT_NODE)return true}return false}function mb(a){if(!qa(a))return false;if(a.data=="")return true;var c=a.parentNode;if(!c||e(E(a)).some(function(a){return a.nodeType==e.Node.ELEMENT_NODE&&e.getComputedStyle(a).display==
"none"}))return true;for(;!ga(c)&&c.parentNode;)c=c.parentNode;for(var b=a;b!=c;){b=z(b);if(ga(b)||p(b,"br"))return true;if(b.nodeType==e.Node.TEXT_NODE&&!qa(b)||p(b,"img"))break}b=a;for(a=v(c);b!=a;){b=u(b);if(ga(b)||p(b,"br"))return true;if(b&&b.nodeType==e.Node.TEXT_NODE&&!qa(b)||p(b,"img"))break}return false}function ja(a){var c;if(!a||e(E(a).concat(a)).filter(function(a){return a.nodeType==e.Node.ELEMENT_NODE},true).some(function(a){return e.getComputedStyle(a).display=="none"}))return false;
if(ga(a)||a.nodeType==e.Node.TEXT_NODE&&!mb(a)||p(a,"img")||p(a,"br")&&!pa(a))return true;for(c=0;c<a.childNodes.length;c++)if(ja(a.childNodes[c]))return true;return false}function Ea(a){return a&&!ja(a)}function Va(a){var c;if(va(a)&&!pa(a))return true;if(!Z(a)||a.nodeType!=e.Node.ELEMENT_NODE)return false;var b=false;for(c=0;c<a.childNodes.length;c++){if(!Ea(a.childNodes[c])&&!Va(a.childNodes[c]))return false;Va(a.childNodes[c])&&(b=true)}return b}function kb(a){var c;if(a&&a.nodeType!==e.Node.TEXT_NODE)c=
false;else{c=0;for(var a=a.data,b=a.length;c<b&&a.charAt(c)==="​";)c++;c=c===b}return!c}function gb(a){var c;if(c=a){if(!(c=!a.hasChildNodes())){if(j.isBlock(a))c=(c=j.findNodeRight(a.lastChild,ja))&&"br"===c.nodeName.toLowerCase()&&!j.findNodeRight(c.previousSibling,ja);else c=false;c=c||!j.findNodeRight(a.lastChild,kb)}c=c&&ea(a.parentNode)&&!a.previousSibling&&!a.nextSibling}return c}function lb(a){var c=a.parentNode,b=d.getIndexInParent(a);c.removeChild(a);return{node:c,offset:b}}function M(){var a;
if(Ma)a=Ma;else if(m.getSelection().rangeCount)a=m.getSelection().getRangeAt(0);else return null;if(f.inArray(a.startContainer.nodeType,[e.Node.TEXT_NODE,e.Node.ELEMENT_NODE])==-1||f.inArray(a.endContainer.nodeType,[e.Node.TEXT_NODE,e.Node.ELEMENT_NODE])==-1||!a.startContainer.ownerDocument||!a.endContainer.ownerDocument||!F(a.startContainer,a.startContainer.ownerDocument)||!F(a.endContainer,a.endContainer.ownerDocument))throw"Invalid active range; test bug?";return a}function ta(a,c,b,g){if(b==-1)b=
c.childNodes.length;var f=a.parentNode,k=d.getIndexInParent(a),l,j=[g];for(l=0;l<m.getSelection().rangeCount;l++)j.push(m.getSelection().getRangeAt(l));var q=[];e(j).forEach(function(a){q.push([a.startContainer,a.startOffset]);q.push([a.endContainer,a.endOffset])});e(q).forEach(function(a){a[0]==c&&a[1]>b&&a[1]++;if(a[0]==f&&(a[1]==k||a[1]==k+1)){a[0]=c;a[1]=a[1]+(b-k)}a[0]==f&&a[1]>k+1&&a[1]--});c.childNodes.length==b?c.appendChild(a):c.insertBefore(a,c.childNodes[b]);var p=null;if(q[0][1]>q[0][0].childNodes.length&&
q[1][1]>q[1][0].childNodes.length){g.setStart(a,0);g.setEnd(a,0)}else{g.setStart(q[0][0],q[0][1]);g.setEnd(q[1][0],q[1][1]);m.getSelection().removeAllRanges();for(l=1;l<j.length;l++){p=m.createRange();p.setStart(q[2*l][0],q[2*l][1]);p.setEnd(q[2*l+1][0],q[2*l+1][1]);m.getSelection().addRange(p)}p&&(g=p)}}function $a(a,c){m.browser.msie&&(m.browser.version>=7&&typeof a.attributes[f.expando]!=="undefined")&&f(a).removeAttr(f.expando);var b=a.attributes,d;for(d=0;d<b.length;d++){var g=b[d];if(typeof g.specified===
"undefined"||g.specified)typeof c.setAttributeNS==="function"?c.setAttributeNS(g.namespaceURI,g.name,g.value):c.setAttribute(g.name,g.value)}}function La(a,c,b){if(p(a,c)||!a.parentNode)return a;c=a.ownerDocument.createElement(c);a.parentNode.insertBefore(c,a);for($a(a,c);a.childNodes.length;)ta(a.firstChild,c,c.childNodes.length,b);a.parentNode.removeChild(a);if(b.startContainer===a)b.startContainer=c;if(b.endContainer===a)b.endContainer=c;return c}function ab(a){var c=a.previousSibling;if(c){for(;c.hasChildNodes();)c=
c.lastChild;for(;Ea(c)&&!pa(c)&&c!=a.parentNode;)c=z(c);I(c)&&pa(c)&&c.parentNode.removeChild(c)}}function hb(a){for(var c=a;c.hasChildNodes();)c=c.lastChild;for(;Ea(c)&&!pa(c)&&c!=a;)c=z(c);I(c)&&pa(c)&&c.parentNode.removeChild(c)}function sb(a){ab(a);hb(a)}function Fa(a,c,b,g){var f;typeof c=="undefined"&&(c=function(){return false});typeof b=="undefined"&&(b=function(){return null});if(!a.length||!I(a[0]))return null;Z(a[a.length-1])&&(!p(a[a.length-1],"br")&&p(a[a.length-1].nextSibling,"br"))&&
a.push(a[a.length-1].nextSibling);b=I(a[0].previousSibling)&&c(a[0].previousSibling)?a[0].previousSibling:I(a[a.length-1].nextSibling)&&c(a[a.length-1].nextSibling)?a[a.length-1].nextSibling:b();if(!b)return null;if(!b.parentNode){a[0].parentNode.insertBefore(b,a[0]);f=g.startContainer;var k=g.startOffset,l=g.endContainer,e=g.endOffset,j=d.getIndexInParent(b);k>=j&&f==b.parentNode&&g.setStart(f,k+1);e>=j&&l==b.parentNode&&g.setEnd(l,e+1);if(Ma&&Ma!==g){f=Ma.startContainer;k=Ma.startOffset;l=Ma.endContainer;
e=Ma.endOffset;f==b.parentNode&&k>=j&&Ma.setStart(f,k+1);l==b.parentNode&&e>=j&&Ma.setEnd(l,e+1)}}k=a[0].parentNode;if(A(b,a[0])){!Z(b)&&(Z(b.lastChild)&&Z(a[0])&&!p(b.lastChild,"BR"))&&b.appendChild(b.ownerDocument.createElement("br"));for(f=0;f<a.length;f++)ta(a[f],b,-1,g)}else{!Z(b)&&(Z(b.firstChild)&&Z(a[a.length-1])&&!p(a[a.length-1],"BR"))&&b.insertBefore(b.ownerDocument.createElement("br"),b.firstChild);for(f=a.length-1;f>=0;f--)ta(a[f],b,0,g)}I(k)&&!k.hasChildNodes()&&k.parentNode.removeChild(k);
if(I(b.nextSibling)&&c(b.nextSibling)){for(!Z(b)&&(Z(b.lastChild)&&Z(b.nextSibling.firstChild)&&!p(b.lastChild,"BR"))&&b.appendChild(b.ownerDocument.createElement("br"));b.nextSibling.hasChildNodes();)ta(b.nextSibling.firstChild,b,-1,g);b.parentNode.removeChild(b.nextSibling)}sb(b);return b}function oa(a,c){if((Fb[c]||r(c,["colgroup","table","tbody","tfoot","thead","tr"]))&&typeof a=="object"&&a.nodeType==e.Node.TEXT_NODE&&!/^[ \t\n\f\r]*$/.test(a.data)||(Gb[c]||r(c,["script","style","plaintext",
"xmp"]))&&(typeof a!="object"||a.nodeType!=e.Node.TEXT_NODE)||typeof a=="object"&&(a.nodeType==e.Node.DOCUMENT_NODE||a.nodeType==e.Node.DOCUMENT_FRAGMENT_NODE||a.nodeType==e.Node.DOCUMENT_TYPE_NODE))return false;o(a)&&(a=a.tagName.toLowerCase());if(typeof a!="string")return true;if(o(c)){for(var b=c;b;){if(a=="a"&&p(b,"a")||ca[a.toUpperCase()]&&b&&b.nodeType==1&&q(b.namespaceURI)&&Hb[b.nodeName]||/^h[1-6]$/.test(a)&&o(b)&&/^H[1-6]$/.test(b.tagName))return false;b=b.parentNode}c=c.tagName.toLowerCase()}if(typeof c==
"object"&&(c.nodeType==e.Node.ELEMENT_NODE||c.nodeType==e.Node.DOCUMENT_FRAGMENT_NODE))return true;if(typeof c!="string")return false;switch(c){case "colgroup":return a=="col";case "table":return f.inArray(a,["caption","col","colgroup","tbody","td","tfoot","th","thead","tr"])!=-1;case "tbody":case "thead":case "tfoot":return f.inArray(a,["td","th","tr"])!=-1;case "tr":return f.inArray(a,["td","th"])!=-1;case "dl":return f.inArray(a,["dt","dd"])!=-1;case "dir":case "ol":case "ul":return f.inArray(a,
["dir","li","ol","ul"])!=-1;case "hgroup":return/^h[1-6]$/.test(a)}if(f.inArray(a,["body","caption","col","colgroup","frame","frameset","head","html","tbody","td","tfoot","th","thead","tr"])!=-1||f.inArray(a,["dd","dt"])!=-1&&c!="dl"||a=="li"&&c!="ol"&&c!="ul")return false;return(b=Ib[c.toUpperCase()])&&b[a.toUpperCase()]?false:true}function Wa(a,c){return c.collapsed?false:G(a,c)||a==c.startContainer&&a.nodeType==e.Node.TEXT_NODE&&y(a)!=c.startOffset||a==c.endContainer&&a.nodeType==e.Node.TEXT_NODE&&
c.endOffset!=0||a.hasChildNodes()&&e(a.childNodes).every(function(a){return Wa(a,c)})&&(!F(c.startContainer,a)||c.startContainer.nodeType!=e.Node.TEXT_NODE||c.startOffset==0)&&(!F(c.endContainer,a)||c.endContainer.nodeType!=e.Node.TEXT_NODE||c.endOffset==y(c.endContainer))?true:false}function na(a,c){typeof c=="undefined"&&(c=function(){return true});for(var b=a.startContainer;Wa(b.parentNode,a);)b=b.parentNode;for(var d=v(a.endContainer),g=[];A(b,d);){Wa(b,a)&&c(b)&&g.push(b);b=u(b)}return g}function ha(a){if(!o(a))return false;
if(f.inArray(a.tagName,["B","EM","I","S","SPAN","STRIKE","STRONG","SUB","SUP","U"])!=-1&&(a.attributes.length==0||a.attributes.length==1&&k(a,"style")))return true;if(a.tagName=="FONT"||a.tagName=="A"){var c=a.attributes.length;k(a,"style")&&c--;if(a.tagName=="FONT"){k(a,"color")&&c--;k(a,"face")&&c--;k(a,"size")&&c--}a.tagName=="A"&&k(a,"href")&&c--;if(c==0)return true}return false}function za(a){return!o(a)||f.inArray(a.tagName,["A","B","EM","FONT","I","S","SPAN","STRIKE","STRONG","SUB","SUP","U"])==
-1?false:a.attributes.length==0?true:a.attributes.length>1?false:k(a,"style")&&t(a)==0||a.tagName=="A"&&k(a,"href")||a.tagName=="FONT"&&(k(a,"color")||k(a,"face")||k(a,"size"))||(a.tagName=="B"||a.tagName=="STRONG")&&k(a,"style")&&t(a)==1&&a.style.fontWeight!=""||(a.tagName=="I"||a.tagName=="EM")&&k(a,"style")&&t(a)==1&&a.style.fontStyle!=""||(a.tagName=="A"||a.tagName=="FONT"||a.tagName=="SPAN")&&k(a,"style")&&t(a)==1&&a.style.textDecoration==""||f.inArray(a.tagName,["A","FONT","S","SPAN","STRIKE",
"U"])!=-1&&k(a,"style")&&t(a)==1&&(a.style.textDecoration=="line-through"||a.style.textDecoration=="underline"||a.style.textDecoration=="overline"||a.style.textDecoration=="none")?true:false}function Ha(a,c,b){return c===null&&b===null||typeof c=="string"&&typeof b=="string"&&c==b&&!Q[a].hasOwnProperty("equivalentValues")||typeof c=="string"&&typeof b=="string"&&Q[a].hasOwnProperty("equivalentValues")&&Q[a].equivalentValues(c,b)?true:false}function sa(a,c,b){if(Ha(a,c,b))return true;if(a!="fontsize"||
typeof c!="string"||typeof b!="string")return false;var d=sa;if(d.sizeMap===void 0){d.sizeMap={};var g=document.createElement("font");document.body.appendChild(g);e(["xx-small","small","medium","large","x-large","xx-large","xxx-large"]).forEach(function(a){g.size=K(a);d.sizeMap[a]=e.getComputedStyle(g).fontSize});document.body.removeChild(g)}return c===d.sizeMap[b]||b===d.sizeMap[c]}function ia(a,c){if(a.nodeType!=e.Node.ELEMENT_NODE&&(!a.parentNode||a.parentNode.nodeType!=e.Node.ELEMENT_NODE))return null;
if(a.nodeType!=e.Node.ELEMENT_NODE)return ia(a.parentNode,c);if(c=="createlink"||c=="unlink"){for(;a&&(!o(a)||a.tagName!="A"||!k(a,"href"));)a=a.parentNode;return!a?null:a.getAttribute("href")}if(c=="backcolor"||c=="hilitecolor"){for(;(e.getComputedStyle(a).backgroundColor=="rgba(0, 0, 0, 0)"||e.getComputedStyle(a).backgroundColor===""||e.getComputedStyle(a).backgroundColor=="transparent")&&a.parentNode&&a.parentNode.nodeType==e.Node.ELEMENT_NODE;)a=a.parentNode;return e.getComputedStyle(a).backgroundColor==
"rgba(0, 0, 0, 0)"||e.getComputedStyle(a).backgroundColor===""||e.getComputedStyle(a).backgroundColor=="transparent"?"rgb(255, 255, 255)":e.getComputedStyle(a).backgroundColor}if(c=="subscript"||c=="superscript"){for(var b=false,d=false;Z(a);){e.getComputedStyle(a);p(a,"sub")?b=true:p(a,"sup")&&(d=true);a=a.parentNode}return b&&d?"mixed":b?"subscript":d?"superscript":null}if(c=="strikethrough"){do{if(e.getComputedStyle(a).textDecoration.indexOf("line-through")!=-1)return"line-through";a=a.parentNode}while(a&&
a.nodeType==e.Node.ELEMENT_NODE);return null}if(c=="underline"){do{if(e.getComputedStyle(a).textDecoration.indexOf("underline")!=-1)return"underline";a=a.parentNode}while(a&&a.nodeType==e.Node.ELEMENT_NODE);return null}if(!Q[c].hasOwnProperty("relevantCssProperty"))throw"Bug: no relevantCssProperty for "+c+" in getEffectiveCommandValue";return e.getComputedStyle(a)[Q[c].relevantCssProperty].toString()}function wa(a,c){if((c=="backcolor"||c=="hilitecolor")&&e.getComputedStyle(a).display!="inline")return null;
if(c=="createlink"||c=="unlink")return o(a)&&a.tagName=="A"&&k(a,"href")?a.getAttribute("href"):null;if(c=="subscript"||c=="superscript")return p(a,"sup")?"superscript":p(a,"sub")?"subscript":null;if(c=="strikethrough"&&a.style.textDecoration!="")return a.style.textDecoration.indexOf("line-through")!=-1?"line-through":null;if(c=="strikethrough"&&r(a,["S","STRIKE"]))return"line-through";if(c=="underline"&&a.style.textDecoration!="")return a.style.textDecoration.indexOf("underline")!=-1?"underline":
null;if(c=="underline"&&p(a,"U"))return"underline";var b=Q[c].relevantCssProperty;if(b===null)return null;if(a.style[b]!="")return a.style[b];if(q(a.namespaceURI)&&a.tagName=="FONT"){if(b=="color"&&k(a,"color"))return a.color;if(b=="fontFamily"&&k(a,"face"))return a.face;if(b=="fontSize"&&k(a,"size")){b=parseInt(a.size,10);b<1&&(b=1);b>7&&(b=7);return{1:"xx-small",2:"small",3:"medium",4:"large",5:"x-large",6:"xx-large",7:"xxx-large"}[b]}}return b=="fontWeight"&&(a.tagName=="B"||a.tagName=="STRONG")?
"bold":b=="fontStyle"&&(a.tagName=="I"||a.tagName=="EM")?"italic":null}function cb(a,c,b,g){for(var f=a;ha(f)&&f.childNodes.length==1&&ha(f.firstChild)&&(!za(f)||!Ha(c,wa(f,c),b));)f=f.firstChild;if(!(f==a||!za(f)||!Ha(c,wa(f,c),b)||!sa(c,ia(f,c),b))){for(;f.hasChildNodes();)ta(f.firstChild,f.parentNode,d.getIndexInParent(f),g);a.parentNode.insertBefore(f,a.nextSibling);ta(a,f,-1,g)}}function Aa(a){var c=[],a=f.makeArray(a),b,d,g,k,l,e;for(b=0;b<a.length;b++){g=a[b];for(d=0;d<vb.length;d++){k=vb[d];
l=g;if(l.nodeType!=1)l=l.parentNode;for(e=null;l&&l.nodeType==1&&(e=wa(l,k))===null;)l=l.parentNode;c.push([g,k,e])}}return c}function Sa(a,c,b){if(!I(a)||wa(a,c)===null)return[];if(za(a)){var c=Array.prototype.slice.call(x(a.childNodes)),g;for(g=0;g<c.length;g++)ta(c[g],a.parentNode,d.getIndexInParent(a),b);a.parentNode.removeChild(a);return c}if(c=="strikethrough"&&a.style.textDecoration.indexOf("line-through")!=-1){a.style.textDecoration=a.style.textDecoration=="line-through"?"":a.style.textDecoration.replace("line-through",
"");a.getAttribute("style")==""&&a.removeAttribute("style")}if(c=="underline"&&a.style.textDecoration.indexOf("underline")!=-1){a.style.textDecoration=a.style.textDecoration=="underline"?"":a.style.textDecoration.replace("underline","");a.getAttribute("style")==""&&a.removeAttribute("style")}if(Q[c].relevantCssProperty!==null){a.style[Q[c].relevantCssProperty]="";a.getAttribute("style")==""&&a.removeAttribute("style")}if(q(a.namespaceURI)&&a.tagName=="FONT"){c=="forecolor"&&a.removeAttribute("color");
c=="fontname"&&a.removeAttribute("face");c=="fontsize"&&a.removeAttribute("size")}p(a,"A")&&(c=="createlink"||c=="unlink")&&a.removeAttribute("href");return wa(a,c)===null?[]:[La(a,"span",b)]}function Ta(a,c,b,g){var k=[],l,j;if(a.parentNode&&b!==null){if(oa(a,"span")){cb(a.previousSibling,c,b,g);cb(a.nextSibling,c,b,g);Fa([a],function(a){return za(a)&&Ha(c,wa(a,c),b)&&sa(c,ia(a,c),b)},function(){return null},g)}if(!sa(c,ia(a,c),b))if(oa(a,"span")){if(!sa(c,ia(a,c),b)){k=null;if(!ib){if(c=="bold"&&
(b=="bold"||b=="700"))k=a.ownerDocument.createElement("b");c=="italic"&&b=="italic"&&(k=a.ownerDocument.createElement("i"));c=="strikethrough"&&b=="line-through"&&(k=a.ownerDocument.createElement("s"));c=="underline"&&b=="underline"&&(k=a.ownerDocument.createElement("u"));if(c=="forecolor"&&R(b)){k=a.ownerDocument.createElement("span");f(k).css("color",R(b))}if(c=="fontname"){k=a.ownerDocument.createElement("font");k.face=b}}if(c=="createlink"||c=="unlink"){k=a.ownerDocument.createElement("a");k.setAttribute("href",
b);for(l=a.parentNode;l;){p(l,"A")&&(l=La(l,"span",g));l=l.parentNode}}if(c=="fontsize"&&f.inArray(b,["xx-small","small","medium","large","x-large","xx-large","xxx-large"])!=-1&&(!ib||b=="xxx-large")){k=a.ownerDocument.createElement("font");k.size=K(b)}if((c=="subscript"||c=="superscript")&&b=="subscript")k=a.ownerDocument.createElement("sub");if((c=="subscript"||c=="superscript")&&b=="superscript")k=a.ownerDocument.createElement("sup");k||(k=a.ownerDocument.createElement("span"));a.parentNode.insertBefore(k,
a);l=Q[c].relevantCssProperty;l!==null&&!sa(c,ia(k,c),b)&&(k.style[l]=b);if(c=="strikethrough"&&b=="line-through"&&ia(k,"strikethrough")!="line-through")k.style.textDecoration="line-through";if(c=="underline"&&b=="underline"&&ia(k,"underline")!="underline")k.style.textDecoration="underline";ta(a,k,k.childNodes.length,g);if(a.nodeType==e.Node.ELEMENT_NODE&&!Ha(c,ia(a,c),b)){ta(a,k.parentNode,d.getIndexInParent(k),g);k.parentNode.removeChild(k);k=[];for(l=0;l<a.childNodes.length;l++){if(a.childNodes[l].nodeType==
e.Node.ELEMENT_NODE){j=wa(a.childNodes[l],c);if(j!==null&&!Ha(c,b,j))continue}k.push(a.childNodes[l])}for(l=0;l<k.length;l++)Ta(k[l],c,b,g)}}}else{for(l=0;l<a.childNodes.length;l++){if(a.childNodes[l].nodeType==e.Node.ELEMENT_NODE){j=wa(a.childNodes[l],c);if(j!==null&&!Ha(c,b,j))continue}k.push(a.childNodes[l])}for(l=0;l<k.length;l++)Ta(k[l],c,b,g)}}}function Ua(a,c,b,d){if(a.parentNode&&a.parentNode.nodeType==e.Node.ELEMENT_NODE&&!sa(c,ia(a,c),b)){for(var g=a.parentNode,f=[];I(g)&&g.nodeType==e.Node.ELEMENT_NODE&&
!sa(c,ia(g,c),b);){f.push(g);g=g.parentNode}if(f.length){var k=wa(f[f.length-1],c);if(!(k===null&&k!=b)&&(b===null||sa(c,ia(f[f.length-1].parentNode,c),b)))for(;f.length;){g=f.pop();wa(g,c)!==null&&(k=wa(g,c));b=Array.prototype.slice.call(x(g.childNodes));wa(g,c)!==null&&Sa(g,c,d);for(g=0;g<b.length;g++){var l=b[g];l!=a&&!(l.nodeType==e.Node.ELEMENT_NODE&&wa(l,c)!==null&&!Ha(c,k,wa(l,c)))&&l!=f[f.length-1]&&Ta(l,c,k,d)}}}}}function Ia(a,c){e(a).forEach(function(a){var b=a[0],d=a[1],a=a[2],g=b;if(!g||
g.nodeType!=e.Node.ELEMENT_NODE)g=g.parentNode;for(;g&&g.nodeType==e.Node.ELEMENT_NODE&&wa(g,d)===null;)g=g.parentNode;a===null&&g&&g.nodeType==e.Node.ELEMENT_NODE?Ua(b,d,null,c):(g&&g.nodeType==e.Node.ELEMENT_NODE&&!Ha(d,wa(g,d),a)||(!g||g.nodeType!=e.Node.ELEMENT_NODE)&&a!==null)&&Ta(b,d,a,c)})}function ma(a,b,d){d=d||M();if(e(na(d)).filter(function(a){return a.nodeType==e.Node.TEXT_NODE},true).some(I)){if(I(d.startContainer)&&d.startContainer.nodeType==e.Node.TEXT_NODE&&d.startOffset!=0&&d.startOffset!=
y(d.startContainer)){var g=c(d.startContainer,d.startOffset),f=m.createRange();if(d.startContainer==d.endContainer){var k=d.endOffset-d.startOffset;f.setEnd(g,k);d.setEnd(g,k)}f.setStart(g,0);m.getSelection().removeAllRanges();m.getSelection().addRange(f);d.setStart(g,0)}if(I(d.endContainer)&&d.endContainer.nodeType==e.Node.TEXT_NODE&&d.endOffset!=0&&d.endOffset!=y(d.endContainer)){g=d;f=[g.startContainer,g.startOffset];k=[g.endContainer,g.endOffset];c(g.endContainer,g.endOffset);g.setStart(f[0],
f[1]);g.setEnd(k[0],k[1]);m.getSelection().removeAllRanges();m.getSelection().addRange(g)}e(na(M(),function(a){return I(a)&&a.nodeType==e.Node.ELEMENT_NODE})).forEach(function(c){Sa(c,a,d)});e(na(d,I)).forEach(function(c){Ua(c,a,b,d);Ta(c,a,b,d)})}else{Q[a].hasOwnProperty("inlineCommandActivatedValues")&&ob(a,e(Q[a].inlineCommandActivatedValues).indexOf(b)!=-1,d);a=="subscript"&&pb("superscript",d);a=="superscript"&&pb("subscript",d);b===null?wb(a,d):Q[a].hasOwnProperty("value")&&tb(a,b,d)}}function Ja(a,
c){return!a.parentNode&&c==0||0<=c-1&&c-1<a.childNodes.length&&ja(a.childNodes[c-1])&&(ga(a.childNodes[c-1])||p(a.childNodes[c-1],"br"))}function Oa(a,c){return!a.parentNode&&c==y(a)||c<a.childNodes.length&&ja(a.childNodes[c])&&ga(a.childNodes[c])}function Pa(a){for(var c=0;!Ja(a,c)&&!Oa(a,c);){if(0<=c-1&&c-1<a.childNodes.length&&ja(a.childNodes[c-1]))return false;if(c==0||!a.hasChildNodes()){c=d.getIndexInParent(a);a=a.parentNode}else{a=a.childNodes[c-1];c=y(a)}}return true}function Qa(a){for(var c=
y(a);!Ja(a,c)&&!Oa(a,c);){if(c<a.childNodes.length&&ja(a.childNodes[c]))return false;if(c==y(a)||!a.hasChildNodes()){c=1+d.getIndexInParent(a);a=a.parentNode}else{a=a.childNodes[c];c=0}}return true}function Ba(a,c){var b,g=a[0].parentNode;if(I(g)&&g.parentNode){f.inArray(g.firstChild,a)!=-1&&ab(g);b=f.inArray(g.firstChild,a)!=-1;var k=f.inArray(g.lastChild,a)!=-1,l=b&&Pa(g),e=k&&Qa(g);if(!b&&k){for(b=a.length-1;b>=0;b--)ta(a[b],g.parentNode,1+d.getIndexInParent(g),c);e&&!Qa(a[a.length-1])&&a[a.length-
1].parentNode.insertBefore(document.createElement("br"),a[a.length-1].nextSibling);hb(g)}else{if(!b){b=g.cloneNode(false);g.removeAttribute("id");for(g.parentNode.insertBefore(b,g);a[0].previousSibling;)ta(g.firstChild,b,b.childNodes.length,c)}for(b=0;b<a.length;b++)ta(a[b],g.parentNode,d.getIndexInParent(g),c);l&&!Pa(a[0])&&a[0].parentNode.insertBefore(document.createElement("br"),a[0]);Z(a[a.length-1])&&(!p(a[a.length-1],"br")&&p(g.firstChild,"br")&&!Z(g))&&g.removeChild(g.firstChild);if(g.hasChildNodes())ab(g);
else{if(g.parentNode===c.startContainer&&g.parentNode===c.endContainer&&c.startContainer===c.endContainer&&c.startOffset===c.endOffset&&g.parentNode.childNodes.length===c.startOffset){c.startOffset=g.parentNode.childNodes.length-1;c.endOffset=c.startOffset}g.parentNode.removeChild(g);e&&!Qa(a[a.length-1])&&a[a.length-1].parentNode.insertBefore(document.createElement("br"),a[a.length-1].nextSibling)}!a[a.length-1].nextSibling&&a[a.length-1].parentNode&&hb(a[a.length-1].parentNode)}}}function jb(a){return r(a,
["address","div","h1","h2","h3","h4","h5","h6","listing","p","pre","xmp"])}function ua(a){return jb(a)||r(a,["li","dt","dd"])}function T(){return document.createElement("br")}function xa(a){a&&(ea(a)||p(a.lastChild,"br")||e(a.childNodes).some(ja)||(!m.browser.msie||parseInt(m.browser.version,10)>=11?a.appendChild(T()):m.browser.msie&&(m.browser.version<=7&&r(a,["p","h1","h2","h3","h4","h5","h6","pre","blockquote"]))&&(a.firstChild||a.appendChild(document.createTextNode("​")))))}function fa(a,c){var b;
if(I(a))if(e(E(a)).every(function(c){return!da(a,c)||!oa(a,c)})&&!n(a,Za))if(r(a,["dd","dt"]))Fa([a],function(a){return p(a,"dl")&&!a.attributes.length},function(){return document.createElement("dl")},c);else{if(V(a)){a=La(a,Za,c);xa(a);fa(a,c);var g=J(a);for(b=0;b<g.length;b++)fa(g[b],c)}}else{for(var g=Aa([a]),k;!oa(a,a.parentNode);){for(b=a.parentNode.childNodes.length-1;b>=0;--b)if(a.parentNode.childNodes[b].nodeType==3&&a.parentNode.childNodes[b].data.length==0){a.parentNode.removeChild(a.parentNode.childNodes[b]);
c.startContainer==a.parentNode&&c.startOffset>b&&c.startOffset--;c.endContainer==a.parentNode&&c.endOffset>b&&c.endOffset--}if(a.parentNode.childNodes.length==1&&f.inArray(a.nodeName,Jb)===-1){b=c.startOffset;k=c.endOffset;c.startContainer===a.parentNode&&c.startOffset>d.getIndexInParent(a)&&(b=c.startOffset+(f(a).contents().length-1));c.endContainer===a.parentNode&&c.endOffset>d.getIndexInParent(a)&&(k=c.endOffset+(f(a).contents().length-1));f(a).contents().unwrap();c.startOffset=b;c.endOffset=k;
break}else{b=a.parentNode;Ba([a],c);if(b===a.parentNode){b=c.startOffset;k=c.endOffset;c.startContainer===a.parentNode&&c.startOffset>d.getIndexInParent(a)&&(b=c.startOffset+(f(a).contents().length-1));c.endContainer===a.parentNode&&c.endOffset>d.getIndexInParent(a)&&(k=c.endOffset+(f(a).contents().length-1));f(a).contents().unwrap();c.startOffset=b;c.endOffset=k;break}}}Ia(g,c)}}function ra(a,c){function b(a){return r(a,["OL","UL"])}if(p(a,"LI")&&I(a)&&I(a.parentNode))for(var g=null;e(a.childNodes).some(b);){var f=
a.lastChild;if(r(f,["OL","UL"])||!g&&f.nodeType==e.Node.TEXT_NODE&&/^[ \t\n\f\r]*$/.test(f.data)){g=null;ta(f,a.parentNode,1+d.getIndexInParent(a),c)}else{if(!g){g=a.ownerDocument.createElement("li");a.parentNode.insertBefore(g,a.nextSibling)}ta(f,g,0,c)}}}function aa(a,c){r(a,["OL","UL"])&&I(a)&&f(a).children("ol,ul").each(function(a,b){p(b.previousSibling,"LI")&&ta(b,b.previousSibling,b.previousSibling.childNodes.length,c)})}function ba(a){var c=a.startContainer,b=a.startOffset,g=a.endContainer,
a=a.endOffset,f=e(E(c).concat(c)).filter(function(a){return p(a,"li")}).slice(-1);if(f.length){b=d.getIndexInParent(f[0]);c=f[0].parentNode}if(!Ja(c,b)){do if(b==0){b=d.getIndexInParent(c);c=c.parentNode}else b--;while(!Ja(c,b)&&!Oa(c,b))}for(;b==0&&c.parentNode;){b=d.getIndexInParent(c);c=c.parentNode}f=e(E(g).concat(g)).filter(function(a){return p(a,"li")}).slice(-1);if(f.length){a=1+d.getIndexInParent(f[0]);g=f[0].parentNode}if(!Oa(g,a)){do if(a==y(g)){a=1+d.getIndexInParent(g);g=g.parentNode}else a++;
while(!Ja(g,a)&&!Oa(g,a))}for(;a==y(g)&&g.parentNode;){a=1+d.getIndexInParent(g);g=g.parentNode}f=m.createRange();f.setStart(c,b);f.setEnd(g,a);return f}function Ra(){var a=ba(M()),c=N(a,function(a){return I(a)&&(r(a,["ol","ul"])||r(a.parentNode,["ol","ul"])||oa(a,"li"))});if(!c.length)return"none";if(e(c).every(function(a){return p(a,"ol")||p(a.parentNode,"ol")||p(a.parentNode,"li")&&p(a.parentNode.parentNode,"ol")})&&!e(c).some(function(a){return p(a,"ul")||a.querySelector&&a.querySelector("ul")}))return"ol";
if(e(c).every(function(a){return p(a,"ul")||p(a.parentNode,"ul")||p(a.parentNode,"li")&&p(a.parentNode.parentNode,"ul")})&&!e(c).some(function(a){return p(a,"ol")||a.querySelector&&a.querySelector("ol")}))return"ul";a=e(c).some(function(a){return p(a,"ol")||p(a.parentNode,"ol")||a.querySelector&&a.querySelector("ol")||p(a.parentNode,"li")&&p(a.parentNode.parentNode,"ol")});c=e(c).some(function(a){return p(a,"ul")||p(a.parentNode,"ul")||a.querySelector&&a.querySelector("ul")||p(a.parentNode,"li")&&
p(a.parentNode.parentNode,"ul")});return a&&c?"mixed":a?"mixed ol":c?"mixed ul":"none"}function Ca(a){for(;a&&a.nodeType!=e.Node.ELEMENT_NODE||a.nodeType==e.Node.ELEMENT_NODE&&f.inArray(e.getComputedStyle(a).display,["inline","none"])!=-1;)a=a.parentNode;if(!a||a.nodeType!=e.Node.ELEMENT_NODE)return"left";var c=e.getComputedStyle(a).textAlign.replace(/^-(moz|webkit)-/,"").replace(/^auto$/,"start");return c=="start"?O(a)=="ltr"?"left":"right":c=="end"?O(a)=="ltr"?"right":"left":f.inArray(c,["center",
"justify","left","right"])!=-1?c:"left"}function Kb(a){var c=[];Na("createlink",a)!==void 0&&c.push(["createlink",Na("createlink",a)]);e(["bold","italic","strikethrough","subscript","superscript","underline"]).forEach(function(b){bb(b,a)!==void 0&&c.push([b,bb(b,a)])});e(["fontname","fontsize","forecolor","hilitecolor"]).forEach(function(b){Na(b,a)!==void 0&&c.push([b,Na(b,a)])});return c}function Lb(a){var c=[],b=e(na(a)).filter(function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE})[0];if(!b)return c;
c.push(["createlink",Q.createlink.value(a)]);e(["bold","italic","strikethrough","subscript","superscript","underline"]).forEach(function(a){e(Q[a].inlineCommandActivatedValues).indexOf(ia(b,a))!=-1?c.push([a,true]):c.push([a,false])});e(["fontname","fontsize","forecolor","hilitecolor"]).forEach(function(b){c.push([b,Q[b].value(a)])});c.push(["fontsize",ia(b,"fontsize")]);return c}function db(a,c){function b(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE}var d,g,f,k=e(na(c)).filter(function(a){return I(a)&&
a.nodeType==e.Node.TEXT_NODE})[0];if(k)for(d=0;d<a.length;d++){g=a[d][0];f=a[d][1];if(typeof f=="boolean"&&X(g,c)!=f)ka(g,false,f,c);else if(typeof f=="string"&&g!="fontsize"&&!Ha(g,U(g,c),f))ka(g,false,f,c);else if(typeof f=="string"&&g=="fontsize"&&(Na("fontsize",c)!==void 0&&Na("fontsize",c)!==f||Na("fontsize",c)===void 0&&!sa(g,ia(k,"fontsize"),f)))ka("fontsize",false,f,c);else continue;k=e(na(c)).filter(b)[0]||k}else for(d=0;d<a.length;d++){g=a[d][0];f=a[d][1];typeof f=="boolean"&&ob(g,f,c);
typeof f=="string"&&tb(g,f,c)}}function Mb(a,c,b){if(a==0)return"";if(a==1&&!c&&!b)return" ";if(a==1)return" ";var d="",g;for(g=c?"  ":"  ";a>3;){d=d+g;a=a-2}return a==3?d+(!c&&!b?"   ":c&&!b?"   ":!c&&b?"   ":c&&b?"   ":"impossible"):d+(!c&&!b?"  ":c&&!b?"  ":!c&&b?"  ":c&&b?"  ":"impossible")}function Xa(a,c){if(I(a)||ea(a)){for(var b=a,g=c;;)if(0<=g-1&&da(b,b.childNodes[g-1])){b=b.childNodes[g-1];g=y(b)}else if(g==0&&!Pa(b)&&da(b,b.parentNode)){g=d.getIndexInParent(b);b=b.parentNode}else if(b.nodeType==
e.Node.TEXT_NODE&&f.inArray(e.getComputedStyle(b.parentNode).whiteSpace,["pre","pre-wrap"])==-1&&g!=0&&/[ \xa0]/.test(b.data[g-1]))g--;else break;for(var k=b,l=g,j=0,q=false;;)if(l<k.childNodes.length&&da(k,k.childNodes[l])){k=k.childNodes[l];l=0}else if(l==y(k)&&!Qa(k)&&da(k,k.parentNode)){l=1+d.getIndexInParent(k);k=k.parentNode}else if(k.nodeType==e.Node.TEXT_NODE&&f.inArray(e.getComputedStyle(k.parentNode).whiteSpace,["pre","pre-wrap"])==-1&&l!=y(k)&&/[ \xa0]/.test(k.data[l]))if(q&&" "==k.data[l])k.deleteData(l,
1);else{q=" "==k.data[l];l++;j++}else break;for(var q=g==0&&(Pa(b)||ea(b)),p=l==y(k)&&(Qa(k)||ea(k)),j=Mb(j,q,p);Y(b,g,k,l)=="before";)if(g<b.childNodes.length){b=b.childNodes[g];g=0}else if(b.nodeType!=e.Node.TEXT_NODE||g==y(b)){g=1+d.getIndexInParent(b);b=b.parentNode}else{q=j[0];j=j.slice(1);if(q!=b.data[g]){b.insertData(g,q);b.deleteData(g+1,1)}g++}}}function xb(a,c){var b=false,g,f;if(!a||!c||ea(a))return false;g=a.parentNode;if(!g)return false;f=a.childNodes.length;f===0&&(b=true);if(f===1){f=
a.childNodes[0];f.nodeType===e.Node.TEXT_NODE&&f.nodeValue.length===0&&(b=true)}if(!b)return false;b=d.getIndexInParent(a);g.removeChild(a);c.setStart(g,b);c.setEnd(g,b);return true}function ya(a,c,b,g,f){var k,l={},j;if(arguments.length<3)k=a;else{k=m.createRange();k.setStart(a,c);k.setEnd(b,g)}arguments.length==2&&(l=c);arguments.length==5&&(l=f);var q=null!=l.blockMerging?!!l.blockMerging:true,o=null!=l.stripWrappers?!!l.stripWrappers:true;if(k){var n=k.startContainer;j=k.startOffset;for(var t=
k.endContainer,A=k.endOffset,v;n.hasChildNodes();)if(j==y(n)&&da(n,n.parentNode)&&Z(n)){j=1+d.getIndexInParent(n);n=n.parentNode}else{if(j==y(n))break;v=n.childNodes[j];if(ga(v)||v.nodeType==e.Node.ELEMENT_NODE&&!v.hasChildNodes()||v.nodeType!=e.Node.ELEMENT_NODE&&v.nodeType!=e.Node.TEXT_NODE)break;n=v;j=0}for(;t.hasChildNodes();)if(A==0&&da(t,t.parentNode)&&Z(t)){A=d.getIndexInParent(t);t=t.parentNode}else{if(A==0)break;v=t.childNodes[A-1];if(ga(v)||v.nodeType==e.Node.ELEMENT_NODE&&!v.hasChildNodes()||
v.nodeType!=e.Node.ELEMENT_NODE&&v.nodeType!=e.Node.TEXT_NODE)break;t=v;A=y(v)}if(Y(t,A,n,j)!=="after"){k.setEnd(k.startContainer,k.startOffset);return k}if(t.nodeType==e.Node.TEXT_NODE&&A==y(t)&&n!=t){A=1+d.getIndexInParent(t);t=t.parentNode}k.setStart(n,j);k.setEnd(t,A);for(var u=k.startContainer;da(u,u.parentNode)&&Z(u);)u=u.parentNode;if(!ga(u)&&!ea(u)||!oa("span",u)||r(u,["td","th"]))u=null;for(var E=k.endContainer;da(E,E.parentNode)&&Z(E);)E=E.parentNode;if(!ga(E)&&!ea(E)||!oa("span",E)||r(E,
["td","th"]))E=null;l=Lb(k);if(n==t&&I(n)&&n.nodeType==e.Node.TEXT_NODE){v=n.parentNode;n.deleteData(j,A-j);j>0&&(n.data.substr(j-1,1)===" "&&j<n.data.length&&n.data.substr(j,1)===" ")&&n.replaceData(j-1,1," ");Xa(n,j);if(!Z(v)||!xb(v,k)){k.setStart(k.startContainer,k.startOffset);k.setEnd(k.startContainer,k.startOffset)}db(l,k);(I(v)||ea(v))&&!Z(v)&&xa(v);return k}I(n)&&n.nodeType==e.Node.TEXT_NODE&&n.deleteData(j,y(n)-j);var z=N(k,function(a){return I(a)&&!r(a,["thead","tbody","tfoot","tr","th",
"td"])});for(j=0;j<z.length;j++){var J=z[j];v=J.parentNode;v.removeChild(J);if(o||!C(v,n)&&v!=n)for(;I(v)&&Z(v)&&y(v)==0;){J=v.parentNode;J.removeChild(v);v=J}(I(v)||ea(v))&&!Z(v)&&xa(v)}I(t)&&t.nodeType==e.Node.TEXT_NODE&&t.deleteData(0,A);Z(n.parentNode)&&xb(n.parentNode,k);Xa(k.startContainer,k.startOffset);Xa(k.endContainer,k.endOffset);if(!q||!u||!E||!da(u,E)||u==E){k.setEnd(k.startContainer,k.startOffset);E=u||E;if(gb(E)){E=lb(E);k.setStart(E.node,E.offset);k.setEnd(E.node,E.offset)}db(l,k);
return k}u.children.length==1&&Va(u.firstChild)&&u.removeChild(u.firstChild);E.children.length==1&&Va(E.firstChild)&&E.removeChild(E.firstChild);if(C(u,E)){for(v=E;v.parentNode!=u;)v=v.parentNode;k.setStart(u,d.getIndexInParent(v));k.setEnd(u,d.getIndexInParent(v));if(!E.hasChildNodes()){for(;I(E)&&E.parentNode.childNodes.length==1&&E.parentNode!=u;){v=E;v.removeChild(E);E=v}I(E)&&(!Z(E)&&Z(E.previousSibling)&&Z(E.nextSibling))&&E.parentNode.insertBefore(document.createElement("br"),E.nextSibling);
I(E)&&E.parentNode.removeChild(E);db(l,k);return k}if(!Z(E.firstChild)){db(l,k);return k}o=[];for(o.push(E.firstChild);!p(o[o.length-1],"br")&&Z(o[o.length-1].nextSibling);)o.push(o[o.length-1].nextSibling);for(q=Aa(o);o[0].parentNode!=u;)Ba(o,k);I(o[0].previousSibling)&&p(o[0].previousSibling,"br")&&o[0].parentNode.removeChild(o[0].previousSibling)}else if(F(u,E)){k.setStart(u,y(u));k.setEnd(u,y(u));for(v=u;v.parentNode!=E;)v=v.parentNode;Z(v.nextSibling)&&p(u.lastChild,"br")&&u.removeChild(u.lastChild);
E=[];v.nextSibling&&(!p(v.nextSibling,"br")&&!ga(v.nextSibling))&&E.push(v.nextSibling);E.length&&(E[E.length-1].nextSibling&&!p(E[E.length-1].nextSibling,"br")&&!ga(E[E.length-1].nextSibling))&&E.push(E[E.length-1].nextSibling);q=Aa(E);e(E).forEach(function(a){ta(a,u,-1,k)});p(v.nextSibling,"br")&&v.parentNode.removeChild(v.nextSibling)}else{k.setStart(u,y(u));k.setEnd(u,y(u));Z(E.firstChild)&&p(u.lastChild,"br")&&u.removeChild(u.lastChild);for(q=Aa([].slice.call(x(E.childNodes)));E.hasChildNodes();)ta(E.firstChild,
u,-1,k);for(;!E.hasChildNodes();){v=E.parentNode;v.removeChild(E);E=v}}Ia(q,k);if(gb(u)){E=lb(u);k.setStart(E.node,E.offset);k.setEnd(E.node,E.offset);u=E.node}xa(u);db(l,k);return k}}function qb(a,c){a.hasChildNodes()?Ba([].slice.call(x(a.childNodes)),c):a.parentNode.removeChild(a)}function Nb(a){if(!qa(a))return false;if(a.parentNode.nodeName==="UL"||a.parentNode.nodeName==="OL")return true;if(a.parentNode.nodeName!=="LI")return false;var c=d.getIndexInParent(a),b=a.parentNode.childNodes.length-
1,g=d.blockLevelElements.concat(d.listElements);return(c===0||g.indexOf(a.previousSibling.nodeName.toLowerCase())>-1)&&(c===b||g.indexOf(a.nextSibling.nodeName.toLowerCase())>-1)}function Ob(a,c){a&&f(a).find("ul,ol,li").each(function(){f(this).contents().each(function(){if(Nb(this)){var a=d.getIndexInParent(this);if(c.startContainer===this.parentNode&&c.startOffset>a)c.startOffset--;else if(c.startContainer===this){c.startContainer=this.parentNode;c.startOffset=a}if(c.endContainer===this.parentNode&&
c.endOffset>a)c.endOffset--;else if(c.endContainer===this){c.endContainer=this.parentNode;c.endOffset=a}f(this).remove()}})})}function Pb(a,c){if(a.length){var b=a[0];if(r(b.parentNode,["OL","UL"])){var d=b.parentNode.tagName;Fa(a,function(a){return n(a,d)},function(){return b.ownerDocument.createElement(d)},c)}else{var g=Fa(a,function(){return false},function(){return b.ownerDocument.createElement("blockquote")},c);fa(g,c)}}}function ub(a,c){if(I(a)){for(var b=a.parentNode,d=[];I(b)&&b.nodeType==
e.Node.ELEMENT_NODE&&!r(b,["ol","ul"]);){d.push(b);b=b.parentNode}I(b);b=a.parentNode;for(d=[];I(b)&&b.nodeType==e.Node.ELEMENT_NODE&&!r(b,["ol","ul"]);){d.push(b);b=b.parentNode}if(r(a,["OL","UL"])&&(!I(b)||1)){a.removeAttribute("reversed");a.removeAttribute("start");a.removeAttribute("type");b=[].slice.call(x(a.childNodes));if(a.attributes.length&&!r(a.parentNode,["OL","UL"]))La(a,"div",c);else{d=Aa([].slice.call(x(a.childNodes)));qb(a,c);Ia(d,c)}for(d=0;d<b.length;d++)fa(b[d],c)}else I(b)}}function yb(a,
c){function b(){return document.createElement("li")}function d(a){return r(a,["ol","ul"])}function g(a){return function(c){return n(c,a)}}function f(a){return function(){return document.createElement(a)}}function k(a,c){return function(){I(c[0].parentNode);return document.createElement(a)}}var l=Ra()==a?"disable":"enable",a=a.toUpperCase(),j=a=="OL"?"UL":"OL",q=[];(function(){var a;for(a=c.endContainer;a!=c.commonAncestorContainer;a=a.parentNode)p(a,"li")&&q.unshift(a);for(a=c.startContainer;a;a=
a.parentNode)p(a,"li")&&q.unshift(a)})();e(q).forEach(function(a){ra(a,c)});var o=ba(c);l=="enable"&&e(B(o,function(a){return I(a)&&n(a,j)})).forEach(function(b){if(I(b.previousSibling)&&n(b.previousSibling,a)||I(b.nextSibling)&&n(b.nextSibling,a)){var b=[].slice.call(x(b.childNodes)),d=Aa(b);Ba(b,c);Fa(b,function(c){return n(c,a)},function(){return null},c);Ia(d,c)}else La(b,a,c)});o=N(o,function(a){return I(a)&&(r(a,["OL","UL"])||r(a.parentNode,["OL","UL"])||oa(a,"li"))});l=="enable"&&(o=e(o).filter(function(a){return!r(a,
["ol","ul"])||r(a.parentNode,["ol","ul"])}));var m;if(l=="disable")for(;o.length;){l=[];l.push(o.shift());if(n(l[0],a))ub(l[0],c);else{for(;o.length&&o[0]==l[l.length-1].nextSibling&&!n(o[0],a);)l.push(o.shift());m=Aa(l);Ba(l,c);var C;for(C=0;C<l.length;C++)fa(l[C],c);Ia(m,c)}}else for(;o.length;){for(l=[];!l.length||o.length&&o[0]==l[l.length-1].nextSibling;)if(r(o[0],["p","div"])){l.push(La(o[0],"li",c));o.shift()}else if(r(o[0],["li","ol","ul"]))l.push(o.shift());else{for(m=[];!m.length||o.length&&
o[0]==m[m.length-1].nextSibling&&Z(o[0])&&Z(m[m.length-1])&&!p(m[m.length-1],"br");)m.push(o.shift());l.push(Fa(m,void 0,b,c))}if(!n(l[0].parentNode,a)&&!e(l).every(d))if(n(l[0].parentNode,j)){m=Aa(l);Ba(l,c);Fa(l,g(a),f(a),c);Ia(m,c)}else fa(Fa(l,g(a),k(a,l,c),c),c)}}function rb(a,c){function b(a){return function(c){return p(c,"div")&&e(c.attributes).every(function(b){return b.name=="align"&&b.value.toLowerCase()==a||b.name=="style"&&t(c)==1&&c.style.textAlign==a})}}function d(a){return function(){var c=
document.createElement("div");c.setAttribute("style","text-align: "+a);return c}}for(var g=ba(c),f=B(g,function(a){return a.nodeType==e.Node.ELEMENT_NODE&&I(a)&&(k(a,"align")||a.style.textAlign!=""||p(a,"center"))}),g=0;g<f.length;g++){var l=f[g];l.removeAttribute("align");l.style.textAlign="";l.getAttribute("style")==""&&l.removeAttribute("style");r(l,["div","span","center"])&&!l.attributes.length&&qb(l,c);p(l,"center")&&l.attributes.length&&La(l,"div",c)}g=ba(Ma);f=[];for(f=N(g,function(c){return I(c)&&
oa(c,"div")&&Ca(c)!=a});f.length;){g=[];for(g.push(f.shift());f.length&&f[0]==g[g.length-1].nextSibling;)g.push(f.shift());Fa(g,b(a),d(a),c)}}function zb(a,c){var b;if(a.collapsed){b=a.startOffset;if(c){if(a.startContainer&&a.startContainer.nodeType===e.Node.TEXT_NODE)for(;b<a.startContainer.data.length&&a.startContainer.data.charAt(b)==="​";)b++}else if(a.startContainer&&a.startContainer.nodeType===e.Node.TEXT_NODE)for(;b>0&&a.startContainer.data.charAt(b-1)==="​";)b--;if(b!==a.startOffset){a.setStart(a.startContainer,
b);a.setEnd(a.startContainer,b)}}}function Qb(a){var a=a.childNodes,c,b,d,k;for(b=0;b<a.length;b++){c=f(a[b]).find("a");d=0;for(k=c.length;d<k;d++)g.pub("aloha.link.pasted",{href:c[d].getAttribute("href"),element:c[d]})}}var Ga="http://www.w3.org/1999/xhtml",ib=false,Ma=null,Q={},bb,ob,Ya,pb,Na,tb,wb,nb=0,ca={ADDRESS:true,ARTICLE:true,ASIDE:true,BLOCKQUOTE:true,CAPTION:true,CENTER:true,COL:true,COLGROUP:true,DD:true,DETAILS:true,DIR:true,DIV:true,DL:true,DT:true,FIELDSET:true,FIGCAPTION:true,FIGURE:true,
FOOTER:true,FORM:true,H1:true,H2:true,H3:true,H4:true,H5:true,H6:true,HEADER:true,HGROUP:true,HR:true,LI:true,LISTING:true,MENU:true,NAV:true,OL:true,P:true,PLAINTEXT:true,PRE:true,SECTION:true,SUMMARY:true,TABLE:true,TBODY:true,TD:true,TFOOT:true,TH:true,THEAD:true,TR:true,UL:true,XMP:true},Eb={inline:true,"inline-block":true,"inline-table":true,none:true};(function(){var c={},b={},d=null;Ya=function(g){if(!d||d.startContainer!=g.startContainer||d.endContainer!=g.endContainer||d.startOffset!=g.startOffset||
d.endOffset!=g.endOffset){d={startContainer:g.startContainer,endContainer:g.endContainer,startOffset:g.startOffset,endOffset:g.endOffset};if(!a.isEmpty(c)||!a.isEmpty(b)){c={};b={};return true}}return false};bb=function(a,b){Ya(b);return c[a]};ob=function(a,b,d){Ya(d);c[a]=b};pb=function(a,b){Ya(b);delete c[a]};Na=function(a,c){Ya(c);return b[a]};tb=function(a,c,d){Ya(d);b[a]=c;if(a=="backcolor")b.hilitecolor=c;else if(a=="hilitecolor")b.backcolor=c};wb=function(a,c){Ya(c);delete b[a];a=="backcolor"?
delete b.hilitecolor:a=="hilitecolor"&&delete b.backcolor}})();var Hb={A:true,ABBR:true,B:true,BDI:true,BDO:true,CITE:true,CODE:true,DFN:true,EM:true,H1:true,H2:true,H3:true,H4:true,H5:true,H6:true,I:true,KBD:true,MARK:true,P:true,PRE:true,Q:true,RP:true,RT:true,RUBY:true,S:true,SAMP:true,SMALL:true,SPAN:true,STRONG:true,SUB:true,SUP:true,U:true,VAR:true,ACRONYM:true,LISTING:true,STRIKE:true,XMP:true,BIG:true,BLINK:true,FONT:true,MARQUEE:true,NOBR:true,TT:true},Fb={colgroup:true,table:true,tbody:true,
tfoot:true,thead:true,tr:true},Gb={script:true,style:true,plaintext:true,xmp:true},eb=f.extend({H1:true,H2:true,H3:true,H4:true,H5:true,H6:true},ca),Ab={CAPTION:true,COL:true,COLGROUP:true,TBODY:true,TD:true,TFOOT:true,TH:true,THEAD:true,TR:true},Bb={DD:true,DT:true},Ib={A:f.extend({A:true},ca),DD:Bb,DT:Bb,LI:{LI:true},NOBR:f.extend({NOBR:true},ca),H1:eb,H2:eb,H3:eb,H4:eb,H5:eb,H6:eb,TD:Ab,TH:Ab,ABBR:ca,B:ca,BDI:ca,BDO:ca,CITE:ca,CODE:ca,DFN:ca,EM:ca,I:ca,KBD:ca,MARK:ca,P:ca,PRE:ca,Q:ca,RP:ca,RT:ca,
RUBY:ca,S:ca,SAMP:ca,SMALL:ca,SPAN:ca,STRONG:ca,SUB:ca,SUP:ca,U:ca,VAR:ca,ACRONYM:ca,LISTING:ca,STRIKE:ca,XMP:ca,BIG:ca,BLINK:ca,FONT:ca,MARQUEE:ca,TT:ca},vb=["subscript","bold","fontname","fontsize","forecolor","hilitecolor","italic","strikethrough","underline"];Q.backcolor={action:function(a,c){/^([0-9a-fA-F]{3}){1,2}$/.test(a)&&(a="#"+a);(/^(rgba?|hsla?)\(.*\)$/.test(a)||R(a)||a.toLowerCase()=="transparent")&&ma("backcolor",a,c)},standardInlineValueCommand:true,relevantCssProperty:"backgroundColor",
equivalentValues:function(a,c){return H(a)===H(c)}};Q.bold={action:function(a,c){X("bold",c)?ma("bold","normal",c):ma("bold","bold",c)},inlineCommandActivatedValues:["bold","600","700","800","900"],relevantCssProperty:"fontWeight",equivalentValues:function(a,c){return a==c||a=="bold"&&c=="700"||a=="700"&&c=="bold"||a=="normal"&&c=="400"||a=="400"&&c=="normal"}};Q.createlink={action:function(a,c){if(a!==""){e(na(M())).forEach(function(c){e(E(c)).forEach(function(c){I(c)&&(p(c,"a")&&k(c,"href"))&&c.setAttribute("href",
a)})});ma("createlink",a,c)}},standardInlineValueCommand:true};Q.fontname={action:function(a,c){ma("fontname",a,c)},standardInlineValueCommand:true,relevantCssProperty:"fontFamily"};Q.fontsize={action:function(a,c){if(a!==""){a=L(a);(f.inArray(a,["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large"])!=-1||/^[0-9]+(\.[0-9]+)?(cm|mm|in|pt|pc)$/.test(a))&&ma("fontsize",a,c)}},indeterm:function(){return e(na(M(),function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE})).map(function(a){return ia(a,
"fontsize")},true).filter(function(a,c,b){return e(b.slice(0,c)).indexOf(a)==-1}).length>=2},value:function(a){var c=na(a,function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE})[0];if(c===void 0)c=a.startContainer;a=ia(c,"fontsize");return S(a)},relevantCssProperty:"fontSize"};Q.forecolor={action:function(a,c){/^([0-9a-fA-F]{3}){1,2}$/.test(a)&&(a="#"+a);(/^(rgba?|hsla?)\(.*\)$/.test(a)||R(a)||a.toLowerCase()=="transparent")&&ma("forecolor",a,c)},standardInlineValueCommand:true,relevantCssProperty:"color",
equivalentValues:function(a,c){return H(a)===H(c)}};Q.hilitecolor={action:function(a,c){/^([0-9a-fA-F]{3}){1,2}$/.test(a)&&(a="#"+a);(/^(rgba?|hsla?)\(.*\)$/.test(a)||R(a)||a.toLowerCase()=="transparent")&&ma("hilitecolor",a,c)},indeterm:function(){return e(na(M(),function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE})).map(function(a){return ia(a,"hilitecolor")},true).filter(function(a,c,b){return e(b.slice(0,c)).indexOf(a)==-1}).length>=2},standardInlineValueCommand:true,relevantCssProperty:"backgroundColor",
equivalentValues:function(a,c){return H(a)===H(c)}};Q.italic={action:function(a,c){X("italic",c)?ma("italic","normal",c):ma("italic","italic",c)},inlineCommandActivatedValues:["italic","oblique"],relevantCssProperty:"fontStyle"};Q.removeformat={action:function(a,b){function g(a){return I(a)&&r(a,["abbr","acronym","b","bdi","bdo","big","blink","cite","code","dfn","em","font","i","ins","kbd","mark","nobr","q","s","samp","small","span","strike","strong","sub","sup","tt","u","var"])}var f,k;f=na(M(),
g);e(f).forEach(function(a){for(;a.hasChildNodes();)ta(a.firstChild,a.parentNode,d.getIndexInParent(a),M());a.parentNode.removeChild(a)});if(I(M().startContainer)&&M().startContainer.nodeType==e.Node.TEXT_NODE&&M().startOffset!=0&&M().startOffset!=y(M().startContainer))if(M().startContainer==M().endContainer){f=M().endOffset-M().startOffset;k=c(M().startContainer,M().startOffset);M().setStart(k,0);M().setEnd(k,f)}else M().setStart(c(M().startContainer,M().startOffset),0);if(I(M().endContainer)&&M().endContainer.nodeType==
e.Node.TEXT_NODE&&M().endOffset!=0&&M().endOffset!=y(M().endContainer)){k=[M().startContainer,M().startOffset];f=[M().endContainer,M().endOffset];M().setEnd(document.documentElement,0);c(f[0],f[1]);M().setStart(k[0],k[1]);M().setEnd(f[0],f[1])}e(na(M(),I)).forEach(function(a){for(;g(a.parentNode)&&da(a.parentNode,a);)Ba([a],M())});e(["subscript","bold","fontname","fontsize","forecolor","hilitecolor","italic","strikethrough","underline"]).forEach(function(a){ma(a,null,b)})}};Q.strikethrough={action:function(a,
c){X("strikethrough",c)?ma("strikethrough",null,c):ma("strikethrough","line-through",c)},inlineCommandActivatedValues:["line-through"]};Q.subscript={action:function(a,c){var b=X("subscript",c);ma("subscript",null,c);b||ma("subscript","subscript",c)},indeterm:function(){var a=na(M(),function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE});return e(a).some(function(a){return ia(a,"subscript")=="subscript"})&&e(a).some(function(a){return ia(a,"subscript")!="subscript"})||e(a).some(function(a){return ia(a,
"subscript")=="mixed"})},inlineCommandActivatedValues:["subscript"]};Q.superscript={action:function(a,c){var b=X("superscript",c);ma("superscript",null,c);b||ma("superscript","superscript",c)},indeterm:function(){var a=na(M(),function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE});return e(a).some(function(a){return ia(a,"superscript")=="superscript"})&&e(a).some(function(a){return ia(a,"superscript")!="superscript"})||e(a).some(function(a){return ia(a,"superscript")=="mixed"})},inlineCommandActivatedValues:["superscript"]};
Q.underline={action:function(a,c){X("underline",c)?ma("underline",null,c):ma("underline","underline",c)},inlineCommandActivatedValues:["underline"]};Q.unlink={action:function(){var a=M(),c=[],b;for(b=a.startContainer;b;b=b.parentNode)p(b,"A")&&k(b,"href")&&c.unshift(b);for(b=a.startContainer;b!=v(a.endContainer);b=u(b))p(b,"A")&&(k(b,"href")&&(G(b,a)||C(b,a.endContainer)||b==a.endContainer))&&c.push(b);for(b=0;b<c.length;b++)Sa(c[b],"unlink",a)},standardInlineValueCommand:true};var Za="p",Jb=["TABLE",
"OL","UL","DL"];Q["delete"]={action:function(a,c){var b,g;zb(c,false);if(c.collapsed){Xa(c.startContainer,c.startOffset);var f=c.startContainer;g=c.startOffset;for(var k=b=false;;){if(g>0){b=p(f.childNodes[g-1],"br")||false;k=p(f.childNodes[g-1],"hr")||false}if(g==0&&I(f.previousSibling)&&Ea(f.previousSibling))f.parentNode.removeChild(f.previousSibling);else if(0<=g-1&&g-1<f.childNodes.length&&I(f.childNodes[g-1])&&(Ea(f.childNodes[g-1])||b||k)){f.removeChild(f.childNodes[g-1]);g--;if(b||k){c.setStart(f,
g);c.setEnd(f,g);return}}else if(g==0&&Z(f)||Ea(f)){g=d.getIndexInParent(f);f=f.parentNode}else{if(0<=g-1&&g-1<f.childNodes.length&&I(f.childNodes[g-1])&&p(f.childNodes[g-1],"a")){qb(f.childNodes[g-1],c);return}if(0<=g-1&&g-1<f.childNodes.length&&!ga(f.childNodes[g-1])&&!r(f.childNodes[g-1],["br","img"])){f=f.childNodes[g-1];g=y(f)}else break}}if(f.nodeType==e.Node.TEXT_NODE&&g!=0){if(I(f)){c.setStart(f,g-1);c.setEnd(f,g-1);if(g=ya(f,g-1,f,g)){c.setStart(g.startContainer,g.startOffset);c.setEnd(g.endContainer,
g.endOffset)}}}else if(f.nodeType==e.Node.TEXT_NODE&&g==0&&m.browser.msie){g=1;c.setStart(f,g);c.setEnd(f,g);c.startOffset=0;ya(c)}else if(!Z(f))if(0<=g-1&&g-1<f.childNodes.length&&r(f.childNodes[g-1],["br","hr","img"])){c.setStart(f,g);c.setEnd(f,g);ya(c)}else if(r(f,["li","dt","dd"])&&f==f.parentNode.firstChild&&g==0){g=[];for(b=f.parentNode;b;b=b.parentNode)p(b,"li")&&g.unshift(b);for(b=0;b<g.length;b++)ra(g[b],c);b=Aa([f]);Ba([f],c);Ia(b,c);r(f,["dd","dt"])&&e(E(f)).every(function(a){return!da(f,
a)||!oa(f,a)})&&(f=La(f,Za,c));fa(f,c);for(b=0;b<g.length;b++)aa(g[b].parentNode,c)}else{b=f;for(k=g;;)if(k==0){k=d.getIndexInParent(b);b=b.parentNode}else if(0<=k-1&&k-1<b.childNodes.length&&I(b.childNodes[k-1])&&Ea(b.childNodes[k-1])){b.removeChild(b.childNodes[k-1]);k--}else break;if(g==0&&e(E(f).concat(f)).filter(function(a){return I(a)&&da(a,f)&&false}).length){g=m.createRange();g.setStart(f,0);g.setEnd(f,0);g=ba(g);g=N(g,function(a){return I(a)&&!Ka(a)});for(b=0;b<g.length;b++)ub(g[b],c)}else if(!p(b.childNodes[k],
"table"))if(0<=k-1&&k-1<b.childNodes.length&&p(b.childNodes[k-1],"table")){c.setStart(b,k-1);c.setEnd(b,k)}else if(g==0&&(p(b.childNodes[k-1],"hr")||p(b.childNodes[k-1],"br")&&(p(b.childNodes[k-1].previousSibling,"br")||!Z(b.childNodes[k-1].previousSibling)))){c.setStart(f,g);c.setEnd(f,g);ya(b,k-1,b,k)}else{if(r(b.childNodes[k],["li","dt","dd"])&&Z(b.childNodes[k].firstChild)&&k!=0){var l=b.childNodes[k-1];Z(l.lastChild)&&!p(l.lastChild,"br")&&l.appendChild(document.createElement("br"));Z(l.lastChild)&&
l.appendChild(document.createElement("br"))}if(r(b.childNodes[k],["li","dt","dd"])&&r(b.childNodes[k-1],["li","dt","dd"])){b=b.childNodes[k-1];k=y(b);f=b.nextSibling;g=0}else for(;0<=k-1&&k-1<b.childNodes.length;)if(I(b.childNodes[k-1])&&Ea(b.childNodes[k-1])){b.removeChild(b.childNodes[k-1]);k--}else{b=b.childNodes[k-1];k=y(b)}l=m.createRange();l.setStart(b,k);l.setEnd(f,g);ya(l);if(!document.body&&!c.startContainer||!(document.body==c.startContainer||C(document.body,c.startContainer)))if(l.startContainer.hasChildNodes()||
l.startContainer.nodeType==e.Node.TEXT_NODE||ea(l.startContainer)){c.setStart(l.startContainer,l.startOffset);c.setEnd(l.startContainer,l.startOffset)}else{c.setStart(l.startContainer.parentNode,d.getIndexInParent(l.startContainer));c.setEnd(l.startContainer.parentNode,d.getIndexInParent(l.startContainer))}}}}else ya(c)}};var fb=["address","dd","div","dt","h1","h2","h3","h4","h5","h6","p","pre"];Q.formatblock={action:function(a){function c(a){return function(c){return I(c)&&da(c,a)&&n(c,fb)&&!e(J(c)).some(V)}}
function b(a){return function(c){return n(c,a)&&!c.attributes.length}}function d(){return false}function g(a){return function(){return document.createElement(a)}}var k;/^<.*>$/.test(a)&&(a=a.slice(1,-1));a=a.toLowerCase();if(e(fb).indexOf(a)!=-1){var l=ba(M()),j=N(l,function(a){return I(a)&&(jb(a)||oa(a,"p")||r(a,["dd","dt"]))&&!e(J(a)).some(V)}),q=Aa(j);for(k=0;k<j.length;k++)for(var o=j[k];e(E(o)).some(c(o));)Ba([o],l);for(Ia(q,l);j.length;){if(ua(j[0])){k=[].slice.call(x(j[0].childNodes));q=Aa(k);
qb(j[0],l);Ia(q,l);j.shift()}else{k=[];for(k.push(j.shift());j.length&&j[0]==k[k.length-1].nextSibling&&!ua(j[0])&&!p(k[k.length-1],"BR");)k.push(j.shift())}fa(Fa(k,f.inArray(a,["div","p"])==-1?b(a):d,g(a),l),l)}}},indeterm:function(){var a=ba(M()),a=B(a,function(a){return ja(a)&&I(a)&&!a.hasChildNodes()});if(!a.length)return false;var c=null,b;for(b=0;b<a.length;b++){for(var d=a[b];I(d.parentNode)&&da(d,d.parentNode)&&!n(d,fb);)d=d.parentNode;var g="";if(I(d)&&n(d,fb)&&!e(J(d)).some(V))g=d.tagName;
if(c===null)c=g;else if(c!=g)return true}return false},value:function(){var a=ba(M()),a=B(a,function(a){return ja(a)&&I(a)&&!a.hasChildNodes()});if(!a.length)return"";for(a=a[0];I(a.parentNode)&&da(a,a.parentNode)&&!n(a,fb);)a=a.parentNode;return I(a)&&n(a,fb)&&!e(J(a)).some(V)?a.tagName.toLowerCase():""}};Q.forwarddelete={action:function(a,c){var b;zb(c,true);if(c.collapsed){Xa(c.startContainer,c.startOffset);if(c.startContainer.nodeType===3&&c.startContainer.data.length===0){c.startOffset=c.endOffset=
d.getIndexInParent(c.startContainer)+1;c.startContainer=c.endContainer=c.startContainer.parentNode}b=c.startContainer;var g=c.startOffset;if(d.isEmptyBlockLevelElement(b)&&!ea(b)){c.startContainer=b.parentElement;c.startOffset=d.getIndexInParent(b);c.endContainer=b.parentElement;c.endOffset=c.startOffset+1;ya(c);if(b=d.searchAdjacentTextNode(c.startContainer,c.startOffset,false,{blocklevel:false,list:false})){c.startContainer=c.endContainer=b;c.startOffset=c.endOffset=0}else{b=c.startContainer.childNodes.length>
c.startOffset?c.startContainer.childNodes[c.startOffset]:null;if(d.isBlockLevelElement(b)&&d.isEditable(b)){c.startContainer=c.endContainer=b;c.startOffset=c.endOffset=0}else if(b=d.searchAdjacentTextNode(c.startContainer,c.startOffset,true,{blocklevel:false,list:false})){c.startContainer=c.endContainer=b;c.startOffset=c.endOffset=b.data.length}}}else{for(;;)if(g==y(b)&&I(b.nextSibling)&&Ea(b.nextSibling))b.parentNode.removeChild(b.nextSibling);else if(g<b.childNodes.length&&I(b.childNodes[g])&&Ea(b.childNodes[g]))b.removeChild(b.childNodes[g]);
else if(g<b.childNodes.length&&Va(b.childNodes[g]))g++;else if(g==y(b)&&Z(b)||Ea(b)){g=1+d.getIndexInParent(b);b=b.parentNode}else if(g<b.childNodes.length&&!ga(b.childNodes[g])&&!r(b.childNodes[g],["br","img"])){b=b.childNodes[g];g=0}else break;Xa(c.startContainer,c.startOffset);var k;if(b.nodeType==e.Node.TEXT_NODE&&g!=y(b)){if(I(b)){c.setStart(b,g);c.setEnd(b,g);for(k=g+1;k!=b.length&&/^[\u0300-\u036f\u0591-\u05bd\u05c1\u05c2]$/.test(b.data[k]);)k++;if(b=ya(b,g,b,k)){c.setStart(b.startContainer,
b.startOffset);c.setEnd(b.endContainer,b.endOffset)}}}else if(g<b.childNodes.length&&r(b.childNodes[g],["br","hr","img"])){c.setStart(b,g);c.setEnd(b,g);ya(b,g,b,g+1)}else if(!Z(b)){var l=b;for(k=g;;)if(k==y(l)){k=1+d.getIndexInParent(l);l=l.parentNode}else if(k<l.childNodes.length&&I(l.childNodes[k])&&Ea(l.childNodes[k]))l.removeChild(l.childNodes[k]);else break;if(!p(l.childNodes[k-1],"table"))if(p(l.childNodes[k],"table")){c.setStart(l,k);c.setEnd(l,k+1)}else if(g==y(b)&&r(l.childNodes[k],["br",
"hr"])){c.setStart(b,g);c.setEnd(b,g);ya(l,k,l,k+1)}else{for(;k<l.childNodes.length;)if(I(l.childNodes[k])&&Ea(l.childNodes[k]))l.removeChild(l.childNodes[k]);else{if(!I(l.childNodes[k])||f(l.childNodes[k]).hasClass("aloha-table-wrapper"))return;l=l.childNodes[k];k=0}b=ya(b,g,l,k);c.setStart(b.startContainer,b.startOffset);c.setEnd(b.endContainer,b.endOffset)}}}}else ya(c)}};Q.indent={action:function(){var a=[],c;for(c=M().endContainer;c!=M().commonAncestorContainer;c=c.parentNode)p(c,"LI")&&a.unshift(c);
for(c=M().startContainer;c!=M().commonAncestorContainer;c=c.parentNode)p(c,"LI")&&a.unshift(c);for(c=M().commonAncestorContainer;c;c=c.parentNode)p(c,"LI")&&a.unshift(c);for(c=0;c<a.length;c++)ra(a[c],M());a=ba(M());c=[];c=N(a,function(a){return I(a)&&(oa(a,"div")||oa(a,"ol"))});for(c.length&&(p(c[0],"LI")&&r(c[0].parentNode,["OL","UL"])&&p(c[0].previousSibling,"LI"))&&ra(c[0].previousSibling,a);c.length;){var b=[];for(b.push(c.shift());c.length&&c[0]==b[b.length-1].nextSibling;)b.push(c.shift());
Pb(b,a)}}};Q.inserthorizontalrule={action:function(a,c){for(;c.startOffset==0&&c.startContainer.parentNode;)c.setStart(c.startContainer.parentNode,d.getIndexInParent(c.startContainer));for(;c.endOffset==y(c.endContainer)&&c.endContainer.parentNode;)c.setEnd(c.endContainer.parentNode,1+d.getIndexInParent(c.endContainer));ya(c,{blockMerging:false});if(I(M().startContainer)||ea(M().startContainer)){if(M().startContainer.nodeType==e.Node.TEXT_NODE&&M().startOffset==0){M().setStart(M().startContainer.parentNode,
d.getIndexInParent(M().startContainer));M().collapse(true)}if(M().startContainer.nodeType==e.Node.TEXT_NODE&&M().startOffset==y(M().startContainer)){M().setStart(M().startContainer.parentNode,1+d.getIndexInParent(M().startContainer));M().collapse(true)}var b=document.createElement("hr");c.insertNode(b);fa(b,c);c.setStart(b.parentNode,1+d.getIndexInParent(b));c.setEnd(b.parentNode,1+d.getIndexInParent(b));m.getSelection().removeAllRanges();m.getSelection().addRange(c)}}};Q.inserthtml={action:function(a,
c){var b=d.getEditingHostOf(c.commonAncestorContainer),b=b?l.applyRules(a,b):a;ya(c);if(I(c.startContainer)||ea(c.startContainer)){var g=c.createContextualFragment(b);Qb(g);var f=g.lastChild;if(f){b=J(g);ga(c.startContainer)&&e(c.startContainer.childNodes).filter(function(a,c){return I(a)&&Va(a)&&d.getIndexInParent(a)>=c.startOffset},true).forEach(function(a){a.parentNode.removeChild(a)});c.insertNode(g);ga(c.startContainer)&&xa(c.startContainer);c.setStart(f.parentNode,1+d.getIndexInParent(f));c.setEnd(f.parentNode,
1+d.getIndexInParent(f));for(g=0;g<b.length;g++)fa(b[g],c);la(c)}}}};Q.insertimage={action:function(a){if(a!==""){var c=M();ya(c,{stripWrappers:false});if(I(M().startContainer)||ea(M().startContainer)){ga(c.startContainer)&&(c.startContainer.childNodes.length==1&&p(c.startContainer.firstChild,"br")&&c.startOffset==0)&&c.startContainer.removeChild(c.startContainer.firstChild);var b=document.createElement("img");b.setAttribute("src",a);c.insertNode(b);c.setStart(b.parentNode,1+d.getIndexInParent(b));
c.setEnd(b.parentNode,1+d.getIndexInParent(b));m.getSelection().removeAllRanges();m.getSelection().addRange(c);b.removeAttribute("width");b.removeAttribute("height")}}}};Q.insertlinebreak={action:function(a,c){ya(c,{stripWrappers:false});if(I(c.startContainer)||ea(c.startContainer))if(c.startContainer.nodeType!=e.Node.ELEMENT_NODE||oa("br",c.startContainer))if(c.startContainer.nodeType==e.Node.ELEMENT_NODE||oa("br",c.startContainer.parentNode)){var b,g;if(c.startContainer.nodeType==e.Node.TEXT_NODE&&
c.startOffset==0){b=c.startContainer.parentNode;g=d.getIndexInParent(c.startContainer);m.getSelection().collapse(b,g);c.setStart(b,g);c.setEnd(b,g)}if(c.startContainer.nodeType==e.Node.TEXT_NODE&&c.startOffset==y(c.startContainer)){b=c.startContainer.parentNode;g=1+d.getIndexInParent(c.startContainer);m.getSelection().collapse(b,g);c.setStart(b,g);c.setEnd(b,g)}b=document.createElement("br");c.insertNode(b);m.getSelection().collapse(b.parentNode,1+d.getIndexInParent(b));c.setStart(b.parentNode,1+
d.getIndexInParent(b));c.setEnd(b.parentNode,1+d.getIndexInParent(b));if(va(b)){c.insertNode(T());m.getSelection().collapse(b.parentNode,1+d.getIndexInParent(b));c.setStart(b.parentNode,1+d.getIndexInParent(b));c.setEnd(b.parentNode,1+d.getIndexInParent(b))}m.browser.msie&&m.browser.version<8&&b.parentNode.removeAttribute("style")}}};Q.insertorderedlist={action:function(a,c){yb("ol",c)},indeterm:function(){return/^mixed( ol)?$/.test(Ra())},state:function(){return Ra()=="ol"}};var Cb={LI:true,DT:true,
DD:true};Q.insertparagraph={action:function(a,b){var g;ya(b);Ob(Da(b.startContainer),b);if(I(b.startContainer)||ea(b.startContainer)){var k=d.getEditingHostOf(b.commonAncestorContainer);if(k){var j=b.startContainer;g=b.startOffset;j.nodeType==e.Node.TEXT_NODE&&(g!=0&&g!=y(j))&&c(j,g);if(j.nodeType==e.Node.TEXT_NODE&&g==y(j)){g=1+d.getIndexInParent(j);j=j.parentNode}if(j.nodeType==e.Node.TEXT_NODE||j.nodeType==e.Node.COMMENT_NODE){g=d.getIndexInParent(j);j=j.parentNode}m.getSelection().collapse(j,
g);b.setStart(j,g);b.setEnd(j,g);for(var q=j;!ua(q)&&I(q.parentNode)&&da(j,q.parentNode);)q=q.parentNode;if(!I(q)||!da(q,j)||!ua(q)){k=d.getEditingHostOf(q);if(!k||!l.isAllowed(k,Za))return;var o=Za,n=ba(b),n=N(n,function(a){return oa(a,"p")}).slice(0,1);if(!n.length){if(!oa(o,b.startContainer))return;q=document.createElement(o);b.insertNode(q);q.appendChild(T());m.getSelection().collapse(q,0);b.setStart(q,0);b.setEnd(q,0);return}for(;n[n.length-1].nextSibling&&oa(n[n.length-1].nextSibling,"p");)n.push(n[n.length-
1].nextSibling);q=Fa(n,function(){return false},function(){return document.createElement(o)},b)}if(q){var C;if(q.tagName=="ADDRESS"||q.tagName=="LISTING"||q.tagName=="PRE"){if(l.isAllowed(k,"br")){k=document.createElement("br");n=q.offsetHeight;b.insertNode(k);C=q.offsetHeight;m.getSelection().collapse(j,g+1);b.setStart(j,g+1);b.setEnd(j,g+1);if(n==C&&!F(u(k),q)){b.insertNode(T());m.getSelection().collapse(j,g+1);b.setEnd(j,g+1)}}}else if(Cb[q.tagName]&&(!q.hasChildNodes()||q.childNodes.length==1&&
p(q.firstChild,"br"))){Ba([q],b);r(q,["dd","dt"])&&e(E(q)).every(function(a){return!da(q,a)||!oa(q,a)})&&(q=La(q,Za,b));fa(q,b);if(p(q,"li")&&p(q.nextSibling,"li")&&r(q.nextSibling.firstChild,["ol","ul"])){k=q.nextSibling;j=q.nextSibling.childNodes.length;for(g=0;g<j;g++)q.appendChild(k.childNodes[0]);k.parentNode.removeChild(k)}}else if(p(q,"p")&&p(q.parentNode,"blockquote")&&!q.nextSibling&&(!q.hasChildNodes()||q.childNodes.length===1&&p(q.firstChild,"br")))f(q.parentNode).after(q);else{j=m.createRange();
j.setStart(b.startContainer,b.startOffset);for(j.setEnd(q,y(q));j.startOffset==0&&j.startContainer!=q;)j.setStart(j.startContainer.parentNode,d.getIndexInParent(j.startContainer));for(;j.startOffset==y(j.startContainer)&&j.startContainer!=q;)j.setStart(j.startContainer.parentNode,1+d.getIndexInParent(j.startContainer));g=N(j);g=!g.length||g.length==1&&p(g[0],"br");g=/^H[1-6]$/.test(q.tagName)&&g?Za:q.tagName=="DT"&&g?"dd":q.tagName=="DD"&&g?"dt":q.tagName.toLowerCase();if(Cb[g.toUpperCase()]||l.isAllowed(k,
g)){k=document.createElement(g);$a(q,k);k.removeAttribute("id");q.parentNode.insertBefore(k,q.nextSibling);n=B(j);j=j.extractContents();C=J(j);for(g=0;g<C.length;g++)C[g].nodeType==e.Node.ELEMENT_NODE&&e(n).indexOf(C[g])==-1&&C[g].removeAttribute("id");g=[];if(n=j.firstChild){do qa(n)||g.push(n);while(null!=(n=n.nextSibling))}if(p(k,"li")&&g.length&&r(g[0],["ul","ol"])){n=k.offsetHeight;g=T();k.appendChild(g);C=k.offsetHeight;n!==C&&k.removeChild(g)}k.appendChild(j);xa(q);xa(k);m.getSelection().collapse(k,
0);b.setStart(k,0);b.setEnd(k,0)}}}}}}};Q.inserttext={action:function(a,c){var b;ya(c,{stripWrappers:false});if(I(c.startContainer)||ea(c.startContainer))if(a.length>1)for(b=0;b<a.length;b++)Q.inserttext.action(a[b],c);else if(a!="")if(a=="\n")Q.insertparagraph.action("",c);else{b=c.startContainer;var d=c.startOffset;if(0<=d-1&&d-1<b.childNodes.length&&b.childNodes[d-1].nodeType==e.Node.TEXT_NODE){b=b.childNodes[d-1];d=y(b)}if(0<=d&&d<b.childNodes.length&&b.childNodes[d].nodeType==e.Node.TEXT_NODE){b=
b.childNodes[d];d=0}var g=b.nodeType==e.Node.ELEMENT_NODE?b:b.parentNode;a==" "&&(g.nodeType==e.Node.ELEMENT_NODE&&f.inArray(e.getComputedStyle(g).whiteSpace,["pre","pre-wrap"])==-1)&&(a=" ");g=Kb(c);if(b.nodeType==e.Node.TEXT_NODE){b.insertData(d,a);m.getSelection().collapse(b,d);c.setStart(b,d);m.getSelection().extend(b,d+1);c.setEnd(b,d+1)}else{b.childNodes.length==1&&va(b.firstChild)&&b.removeChild(b.firstChild);b=document.createTextNode(a);c.insertNode(b);m.getSelection().collapse(b,0);c.setStart(b,
0);m.getSelection().extend(b,1);c.setEnd(b,1)}db(g,c);Xa(c.startContainer,c.startOffset);Xa(c.endContainer,c.endOffset);m.getSelection().collapseToEnd();c.collapse(false)}}};Q.insertunorderedlist={action:function(a,c){yb("ul",c)},indeterm:function(){return/^mixed( ul)?$/.test(Ra())},state:function(){return Ra()=="ul"}};Q.justifycenter={action:function(a,c){rb("center",c)},indeterm:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return e(a).some(function(a){return Ca(a)==
"center"})&&e(a).some(function(a){return Ca(a)!="center"})},state:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return a.length&&e(a).every(function(a){return Ca(a)=="center"})},value:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return a.length?Ca(a[0]):"left"}};Q.justifyfull={action:function(a,c){rb("justify",c)},indeterm:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return e(a).some(function(a){return Ca(a)==
"justify"})&&e(a).some(function(a){return Ca(a)!="justify"})},state:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return a.length&&e(a).every(function(a){return Ca(a)=="justify"})},value:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return a.length?Ca(a[0]):"left"}};Q.justifyleft={action:function(a,c){rb("left",c)},indeterm:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return e(a).some(function(a){return Ca(a)==
"left"})&&e(a).some(function(a){return Ca(a)!="left"})},state:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return a.length&&e(a).every(function(a){return Ca(a)=="left"})},value:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return a.length?Ca(a[0]):"left"}};Q.justifyright={action:function(a,c){rb("right",c)},indeterm:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return e(a).some(function(a){return Ca(a)==
"right"})&&e(a).some(function(a){return Ca(a)!="right"})},state:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return a.length&&e(a).every(function(a){return Ca(a)=="right"})},value:function(){var a=B(ba(M()),function(a){return I(a)&&ja(a)&&!a.hasChildNodes()});return a.length?Ca(a[0]):"left"}};Q.outdent={action:function(){var a=[];(function(){var c;for(c=M().endContainer;c!=M().commonAncestorContainer;c=c.parentNode)p(c,"li")&&a.unshift(c);for(c=M().startContainer;c;c=
c.parentNode)p(c,"li")&&a.unshift(c)})();e(a).forEach(function(a){ra(a,M())});for(var c=ba(M()),b=N(c,function(a){return I(a)&&(!e(J(a)).some(I)||r(a,["ol","ul"])||p(a,"li")&&r(a.parentNode,["ol","ul"]))});b.length;){for(;b.length&&(r(b[0],["OL","UL"])||!r(b[0].parentNode,["OL","UL"]));)ub(b.shift(),c);if(!b.length)break;var d=[];for(d.push(b.shift());b.length&&b[0]==d[d.length-1].nextSibling&&!r(b[0],["OL","UL"]);)d.push(b.shift());var g=Aa(d);Ba(d,c);e(d).forEach(fa);Ia(g,c)}}};Q.selectall={action:function(){var a=
document.body;if(!a)a=document.documentElement;a?m.getSelection().selectAllChildren(a):m.getSelection().removeAllRanges()}};Q.stylewithcss={action:function(a){ib=(""+a).toLowerCase()!="false"},state:function(){return ib}};Q.usecss={action:function(a){ib=(""+a).toLowerCase()=="false"}};(function(){var a=[],c;for(c in Q)Q.hasOwnProperty(c)&&a.push(c);e(a).forEach(function(a){if(null==Q[a].relevantCssProperty)Q[a].relevantCssProperty=null;if(null!=Q[a].inlineCommandActivatedValues&&null==Q[a].indeterm)Q[a].indeterm=
function(c){var c=e(na(c,function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE})).map(function(c){return ia(c,a)}),b=e(c).filter(function(c){return e(Q[a].inlineCommandActivatedValues).indexOf(c)!=-1});return b.length>=1&&c.length-b.length>=1};if(null!=Q[a].inlineCommandActivatedValues)Q[a].state=function(c){var b=na(c,function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE});return b.length==0?e(Q[a].inlineCommandActivatedValues).indexOf(ia(c.startContainer,a))!=-1:e(b).every(function(c){return e(Q[a].inlineCommandActivatedValues).indexOf(ia(c,
a))!=-1})};if(null!=Q[a].standardInlineValueCommand){Q[a].indeterm=function(){var c=e(na(M())).filter(function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE},true).map(function(c){return ia(c,a)}),b;for(b=1;b<c.length;b++)if(c[b]!=c[b-1])return true;return false};Q[a].value=function(c){var b=na(c,function(a){return I(a)&&a.nodeType==e.Node.TEXT_NODE})[0];if(typeof b=="undefined")b=c.startContainer;return ia(b,a)}}})})();return{commands:Q,execCommand:ka,queryCommandIndeterm:function(a,c){a=a.toLowerCase();
return P(a,"indeterm",c,function(a){return function(){return!W(a,c)?false:Q[a].indeterm(c)}}(a))},queryCommandState:X,queryCommandValue:U,queryCommandEnabled:W,queryCommandSupported:function(a){a=a.toLowerCase();return Q.hasOwnProperty(a)},copyAttributes:$a,createEndBreak:T,isEndBreak:function(a){return p(a,"br")&&a.parentNode.lastChild===a},ensureContainerEditable:xa,isEditingHost:ea,isEditable:I,getStateOverride:bb,setStateOverride:ob,resetOverrides:Ya,unsetStateOverride:pb}});define("aloha/selection",
"aloha/core jquery util/class util/range util/arrays util/strings util/dom util/dom2 util/browser util/html aloha/console PubSub aloha/engine aloha/ecma5shims aloha/rangy-core".split(" "),function(m,e,a,j,d,b,f,l,g,k,c,q,n,o){function p(a,c){var b=m.activeEditable?m.activeEditable.obj.parent()[0]:null,b=e(a).parentsUntil(b).get(),g;g=[];var f,k,l;1===a.nodeType&&a.nodeName!=="BODY"&&a.nodeName!=="HTML"?g.push(a.cloneNode(false).outerHTML):g.push("#"+a.nodeType);l=0;for(k=b.length;l<k;l++){f=b[l];
if(f.nodeName==="BODY"||f.nodeName==="HTML")break;g.push(f.cloneNode(false).outerHTML)}g=g.join("");return c&&a===c.node&&d.equal(c.parents,b)&&g===c.html?null:{node:a,parents:b,html:g}}function r(a){for(;a&&!k.isBlock(a);)a=a.parentNode;return a}function t(a){var c;if(m.browser.msie&&a.startContainer===a.endContainer&&a.startOffset===a.endOffset&&a.startContainer.nodeType==3&&a.startOffset==a.startContainer.data.length&&a.startContainer.nextSibling){c=a.startContainer.nextSibling;if("OL"===c.nodeName||
"UL"===c.nodeName)a.startContainer.data[a.startContainer.data.length-1]==" "?a.startOffset=a.endOffset=a.startOffset-1:a.startContainer.data=a.startContainer.data+" "}}var x=window.GENTICS,v=null,u=null,j=a.extend({_constructor:function(){this.rangeObject={};this.correctSelectionFlag=this.preventSelectionChangedFlag=false;this.tagHierarchy={textNode:{},abbr:{textNode:true},b:{textNode:true,b:true,i:true,em:true,sup:true,sub:true,br:true,span:true,img:true,a:true,del:true,ins:true,u:true,cite:true,
q:true,code:true,abbr:true,strong:true},pre:{textNode:true,b:true,i:true,em:true,sup:true,sub:true,br:true,span:true,img:true,a:true,del:true,ins:true,u:true,cite:true,q:true,code:true,abbr:true},blockquote:{textNode:true,b:true,i:true,em:true,sup:true,sub:true,br:true,span:true,img:true,a:true,del:true,ins:true,u:true,cite:true,q:true,code:true,abbr:true,p:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true},ins:{textNode:true,b:true,i:true,em:true,sup:true,sub:true,br:true,span:true,img:true,a:true,
u:true,p:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true},ul:{li:true},ol:{li:true},dl:{dt:true,dd:true},dt:{textNode:true},dd:{textNode:true,b:true,i:true,em:true,sup:true,sub:true,br:true,span:true,img:true,ul:true,ol:true,dt:true,table:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,del:true,ins:true,u:true,p:true,div:true,pre:true,blockquote:true,a:true},li:{textNode:true,b:true,i:true,em:true,sup:true,sub:true,br:true,span:true,img:true,ul:true,ol:true,h1:true,h2:true,h3:true,h4:true,
h5:true,h6:true,p:true,del:true,ins:true,u:true,a:true},tr:{td:true,th:true},table:{tr:true},div:{textNode:true,b:true,i:true,em:true,sup:true,sub:true,br:true,span:true,img:true,ul:true,ol:true,dt:true,table:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,del:true,ins:true,u:true,p:true,div:true,pre:true,blockquote:true,a:true},h1:{textNode:true,b:true,i:true,em:true,sup:true,sub:true,br:true,span:true,img:true,a:true,del:true,ins:true,u:true}};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,dl:this.tagHierarchy.dl,li: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.div,tr:this.tagHierarchy.div,th:this.tagHierarchy.div,td:this.tagHierarchy.div};this.replacingElements={h1:{p:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,pre:true,blockquote:true}};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.h1};this.allowedToStealElements={h1:{textNode:true}};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}},SelectionTree:function(){this.domobj={};this.selection=void 0;this.children=[]},onChange:function(a,c,b,d){this.updateSelectionTimeout&&window.clearTimeout(this.updateSelectionTimeout);if(c&&(c.target.nodeName==="INPUT"||c.target.nodeName==="TEXTAREA")){var g=m.getEditableHost(a);g&&m.activeEditable!==g&&g.activate()}else{var f=this;this.updateSelectionTimeout=window.setTimeout(function(){var g=new m.Selection.SelectionRange(true);if(!g.startContainer||
"HTML"===g.startContainer.nodeName||"BODY"===g.startContainer.nodeName){if(!this.updateSelectionTimeout)f.onChange(a,c,10+(b||5)*2)}else{var k=m.getEditableHost(e(g.startContainer));k&&k.activate();m.browser.msie&&d&&g.select();m.Selection._updateSelection(c,g)}},b||5)}},preventSelectionChanged:function(){this.preventSelectionChangedFlag=true},isSelectionChangedPrevented:function(){var a=this.preventSelectionChangedFlag;this.preventSelectionChangedFlag=false;return a},isSelectionEditable:function(){return this.rangeObject.commonAncestorContainer&&
e(this.rangeObject.commonAncestorContainer).contentEditable()},isFloatingMenuVisible:function(){var a=e(m.Selection.rangeObject.commonAncestorContainer).attr("data-aloha-floatingmenu-visible");return a!=="undefined"&&a==="true"?true:false},updateSelection:function(a){return this._updateSelection(a,null)},_updateSelection:function(a,b){if(a&&(a.target.nodeName==="INPUT"||a.target.nodeName==="TEXTAREA"||a.originalEvent&&true===a.originalEvent.stopSelectionUpdate)||typeof b==="undefined")return false;
if((this.rangeObject=b=b||new m.Selection.SelectionRange(true))&&b.startContainer&&"HR"===b.startContainer.nodeName&&b.endContainer&&"HR"===b.endContainer.nodeName){m.getSelection().removeAllRanges();return true}b.update();if(b&&b.startContainer&&b.endContainer&&!this.correctSelectionFlag&&e(b.commonAncestorContainer).closest(".aloha-editable").length>0&&b.isCollapsed()){var d=this._validEditablePosition(b.startContainer),g=this._validEditablePosition(b.endContainer),f,k=a&&(a.keyCode===40||a.keyCode===
39);if(!d)if(f=this._getNearestEditablePosition(b.startContainer,k)){b.startContainer=f.container;b.startOffset=f.offset}if(!g)if(f=this._getNearestEditablePosition(b.endContainer,k)){b.endContainer=f.container;b.endOffset=f.offset}if(!d||!g){this.correctSelectionFlag=true;b.correctRange();b.select()}}this.correctSelectionFlag=false;if(this.isSelectionChangedPrevented())return true;m.trigger("aloha-selection-changed-before",[this.rangeObject,a]);m.trigger("aloha-selection-changed",[this.rangeObject,
a]);d=this.rangeObject;f=d.startContainer;g=d.endContainer;if(!f||!g)c.warn("aloha/selection","encountered range object without start or end container");else{f=p(f,v);g=p(g,u);if(f||g){v=f;u=g;q.pub("aloha.selection.context-change",{range:d,event:a})}}m.trigger("aloha-selection-changed-after",[this.rangeObject,a]);return true},_validEditablePosition:function(a){if(!a)return false;switch(a.nodeType){case 1:return e(a).contentEditable();case 3:return e(a.parentNode).contentEditable();default:return false}},
_getNearestEditablePosition:function(a,c){for(var b=a,d=b.parentNode;d!==null&&!e(d).contentEditable();){b=d;d=d.parentNode}return b===null?false:c?f.isBlockLevelElement(b.nextSibling)&&e(b.nextSibling).contentEditable()?{container:b.nextSibling,offset:0}:{container:d,offset:f.getIndexInParent(b)+1}:f.isBlockLevelElement(b.previousSibling)&&e(b.previousSibling).contentEditable()?{container:b.previousSibling,offset:b.previousSibling.childNodes.length}:{container:d,offset:f.getIndexInParent(b)}},getSelectionTree:function(a){if(!a)return this.rangeObject.getSelectionTree();
if(!a.commonAncestorContainer){m.Log.error(this,"the rangeObject is missing the commonAncestorContainer");return false}this.inselection=false;if(x.Utils.Dom.doCleanup({merge:true},a)){a.update();a.select()}return this.recursiveGetSelectionTree(a,a.commonAncestorContainer)},recursiveGetSelectionTree:function(a,c){var b=0,d=this,g=[];e(c).contents().each(function(f){var k="none",l=false,e=false,j=false,q=false,o=false,p=false;if(a.isCollapsed()&&c===a.startContainer&&a.startOffset==f){g[b]=new m.Selection.SelectionTree;
g[b].selection="collapsed";g[b].domobj=void 0;d.inselection=false;j=true;b++}if(!d.inselection&&!j){var n;try{n=this.nodeType}catch(r){return}switch(n){case 3:if(this===a.startContainer){d.inselection=true;k=a.startOffset>0?"partial":"full";l=a.startOffset;e=this.length}break;case 1:if(this===a.startContainer&&a.startOffset===0){d.inselection=true;k="full"}if(c===a.startContainer&&a.startOffset===f){d.inselection=true;k="full"}}}if(d.inselection&&!j){k=="none"&&(k="full");switch(this.nodeType){case 3:if(this===
a.endContainer){d.inselection=false;a.endOffset<this.length&&(k="partial");l===false&&(l=0);e=a.endOffset}break;case 1:if(this===a.endContainer&&a.endOffset===0)d.inselection=false}if(c===a.endContainer&&a.endOffset<=f){d.inselection=false;k="none"}}g[b]=new m.Selection.SelectionTree;g[b].domobj=this;g[b].selection=k;if(k=="partial"){g[b].startOffset=l;g[b].endOffset=e}g[b].children=d.recursiveGetSelectionTree(a,this);k=g[b].children.length;if(k>0){for(f=0;f<k;++f)switch(g[b].children[f].selection){case "none":q=
true;break;case "full":p=true;break;case "partial":o=true}if(o||p&&q)g[b].selection="partial";else if(p&&!o&&!q)g[b].selection="full"}b++});if(a.isCollapsed()&&c===a.startContainer&&a.startOffset==c.childNodes.length){g[b]=new m.Selection.SelectionTree;g[b].selection="collapsed";g[b].domobj=void 0}return g},getRangeObject:function(){return this.rangeObject},isRangeObjectWithinMarkup:function(a,c,b,d,g){var f=this,a=e(!c?a.startContainer:a.endContainer).parents(),k=false,l=-1;typeof d!=="undefined"&&
typeof d!=="function"&&m.Log.error(this,"parameter tagComparator is not a function");typeof d==="undefined"&&(d=function(a,c){return f.standardTextLevelSemanticsComparator(a,c)});a.length>0&&a.each(function(){if(this===g){m.Log.debug(f,"reached limit dom obj");return false}if(d(this,b)){k===false&&(k=[]);m.Log.debug(f,"reached object equal to markup");l++;k[l]=this;return true}});return k},standardSectionsAndGroupingContentComparator:function(a,c){if(a.nodeType!==1){m.Log.debug(this,"only element nodes (nodeType == 1) can be compared");
return false}if(!c[0].nodeName)return false;var b=m.Selection.replacingElements[a.nodeName.toLowerCase()];return b&&b[c[0].nodeName.toLowerCase()]},standardTagNameComparator:function(a,c){if(a.nodeType===1)return a.nodeName!=c[0].nodeName?false:true;m.Log.debug(this,"only element nodes (nodeType == 1) can be compared");return false},standardTextLevelSemanticsComparator:function(a,c){if(a.nodeType===1)return a.nodeName!=c[0].nodeName||!this.standardAttributesComparator(a,c)?false:true;m.Log.debug(this,
"only element nodes (nodeType == 1) can be compared");return false},standardAttributesComparator:function(a,c){var g=b.words(a&&a.className||""),f=b.words(c.length&&c[0].className||"");d.sortUnique(g);d.sortUnique(f);return d.equal(g,f)},changeMarkup:function(a,c,b){var d=c[0].tagName.toLowerCase(),g,f,k=this.isRangeObjectWithinMarkup(a,false,c,b,g),l=this.isRangeObjectWithinMarkup(a,true,c,b,g),j,q,p,r;if(this.replacingElements[d]){f=a;a=new this.SelectionRange(a);d=m.activeEditable?m.activeEditable.obj.get(0):
e("body");a.update(d);c.isReplacingElement=true}else if(a.isCollapsed()){m.Log.debug(this,"early returning from applying markup because nothing is currently selected");return false}g=m.activeEditable?m.activeEditable.obj[0]:e("body");if(!c.isReplacingElement&&a.startOffset===0&&null!=(p=this.getTextNodeSibling(false,a.commonAncestorContainer.parentNode,a.startContainer)))r=this.isRangeObjectWithinMarkup({startContainer:p,startOffset:0},false,c,b,g);if(!c.isReplacingElement&&a.endOffset===a.endContainer.length&&
null!=(j=this.getTextNodeSibling(true,a.commonAncestorContainer.parentNode,a.endContainer)))q=this.isRangeObjectWithinMarkup({startContainer:j,startOffset:0},false,c,b,g);if(!c.isReplacingElement&&k&&!l){m.Log.info(this,"markup 2 non-markup");this.prepareForRemoval(a.getSelectionTree(),c,b);e(k).addClass("preparedForRemoval");this.insertCroppedMarkups(k,a,false,b)}else if(!c.isReplacingElement&&k&&l){m.Log.info(this,"markup 2 markup");this.prepareForRemoval(a.getSelectionTree(),c,b);this.splitRelevantMarkupObject(k,
l,a,b)}else if(!c.isReplacingElement&&(!k&&l||q||r)){m.Log.info(this,"non-markup 2 markup OR with next2markup");if(r&&q){k=new m.Selection.SelectionRange(a);k.startContainer=e(r[r.length-1]).textNodes()[0];k.startOffset=0;k.endContainer=e(q[q.length-1]).textNodes().last()[0];k.endOffset=k.endContainer.length;k.update();this.applyMarkup(k.getSelectionTree(),a,c,b);m.Log.info(this,"double extending previous markup(previous and after selection), actually wrapping it ...")}else if(r&&!q&&!l){this.extendExistingMarkupWithSelection(r,
a,false,b);m.Log.info(this,"extending previous markup")}else if(r&&!q&&l){k=new m.Selection.SelectionRange(a);k.startContainer=e(r[r.length-1]).textNodes()[0];k.startOffset=0;k.endContainer=e(l[l.length-1]).textNodes().last()[0];k.endOffset=k.endContainer.length;k.update();this.applyMarkup(k.getSelectionTree(),a,c,b);m.Log.info(this,"double extending previous markup(previous and relevant at the end), actually wrapping it ...")}else if(!r&&q){this.extendExistingMarkupWithSelection(q,a,true,b);m.Log.info(this,
"extending following markup backwards")}else this.extendExistingMarkupWithSelection(l,a,true,b)}else if(c.isReplacingElement||!k&&!l&&!r&&!q){m.Log.info(this,"non-markup 2 non-markup");if(a.startContainer!==a.endContainer)l=false;else if(a.startContainer.nodeType!=1)l=false;else{l=a.startContainer.firstChild;l=!l||!l.nextSibling&&l.nodeName=="BR"}if(l){c=c.clone();b=a.startContainer!==a.endContainer?false:a.startContainer.nodeType!=1?false:n.isEndBreak(a.startContainer);b&&c[0].appendChild(n.createEndBreak());
m.activeEditable&&(m.browser.mozilla&&document.activeElement!==m.activeEditable.obj[0])&&m.activeEditable.obj.focus();if(n.isEditable(a.startContainer)){n.copyAttributes(a.startContainer,c[0]);e(a.startContainer).after(c[0]).remove();n.ensureContainerEditable(c[0])}else if(n.isEditingHost(a.startContainer)){e(a.startContainer).append(c[0]);n.ensureContainerEditable(c[0])}f.startContainer=c[0];f.endContainer=c[0];f.startOffset=0;f.endOffset=0;return}this.applyMarkup(a.getSelectionTree(),a,c,b,{setRangeObject2NewMarkup:true});
f.startContainer=a.startContainer;f.endContainer=a.endContainer;f.startOffset=a.startOffset;f.endOffset=a.endOffset}if(c.isReplacingElement){if(f&&f.startContainer.className&&f.startContainer.className.indexOf("preparedForRemoval")>-1){b=e(f.startContainer).parents(c[0].tagName).get(0);f.startContainer=b;a.startContainer=b}if(f&&f.endContainer.className&&f.endContainer.className.indexOf("preparedForRemoval")>-1){b=e(f.endContainer).parents(c[0].tagName).get(0);f.endContainer=b;a.endContainer=b}}e(".preparedForRemoval").zap();
if(c.isReplacingElement){if(o.Node.ELEMENT_NODE===f.startContainer.nodeType&&f.startContainer.childNodes&&f.startContainer.childNodes.length<f.startOffset){f.startOffset=f.startContainer.childNodes.length;a.startOffset=f.startContainer.childNodes.length}if(o.Node.ELEMENT_NODE===f.endContainer.nodeType&&f.endContainer.childNodes&&f.endContainer.childNodes.length<f.endOffset){f.endOffset=f.endContainer.childNodes.length;a.endOffset=f.endContainer.childNodes.length}a.endContainer=f.endContainer;a.endOffset=
f.endOffset;a.startContainer=f.startContainer;a.startOffset=f.startOffset;f.update();f.select()}else{a.update();a.select()}},areMarkupObjectsAsLongAsRangeObject:function(a,c,b){var d,g,f;if(b.startOffset!==0)return false;d=0;for(f=a.length;d<f;d++){g=e(a[d]);if(g.textNodes().first()[0]!==b.startContainer)return false}d=0;for(a=c.length;d<a;d++){g=e(c[d]);g=g.textNodes().last()[0];if(g!==b.endContainer||g.length!=b.endOffset)return false}return true},splitRelevantMarkupObject:function(a,c,b,d){e(a).addClass("preparedForRemoval");
e(c).addClass("preparedForRemoval");if(this.areMarkupObjectsAsLongAsRangeObject(a,c,b))return true;var g=this.intersectRelevantMarkupObjects(a,c);if(g){this.insertCroppedMarkups([g],b,false,d);this.insertCroppedMarkups([g],b,true,d)}else{this.insertCroppedMarkups(a,b,false,d);this.insertCroppedMarkups(c,b,true,d)}return true},intersectRelevantMarkupObjects:function(a,c){var b=false,d,g,f,k,l,e;if(!a||!c)return b;l=a.length;e=c.length;for(d=0;d<l;d++){g=a[d];for(f=0;f<e;f++){k=c[f];g===k&&(b=g)}}return b},
extendExistingMarkupWithSelection:function(a,c,b,d){var g,f,k,l,j,q,o;b||(g=true);b&&(f=true);b=[];k=0;for(l=a.length;k<l;k++){b[k]=new this.SelectionRange;j=a[k];if(f&&!g){b[k].startContainer=c.startContainer;b[k].startOffset=c.startOffset;q=e(j).textNodes(true);o=q.length-1;b[k].endContainer=q[o];b[k].endOffset=q[o].length;b[k].update();this.applyMarkup(b[k].getSelectionTree(),c,this.getClonedMarkup4Wrapping(j),d,{setRangeObject2NewMarkup:true})}if(!f&&g){q=e(j).textNodes(true);b[k].startContainer=
q[0];b[k].startOffset=0;b[k].endContainer=c.endContainer;b[k].endOffset=c.endOffset;b[k].update();this.applyMarkup(b[k].getSelectionTree(),c,this.getClonedMarkup4Wrapping(j),d,{setRangeObject2NewMarkup:true})}}return true},getClonedMarkup4Wrapping:function(a){a=e(a.outerHTML).removeClass("preparedForRemoval").empty();a.attr("class").length===0&&a.removeAttr("class");return a},insertCroppedMarkups:function(a,c,b,d){var g,f,k,l,j;b?f=true:g=true;b=[];for(l=0;l<a.length;l++){b[l]=new this.SelectionRange;
j=a[l];if(g&&!f){k=e(j).textNodes(true);b[l].startContainer=k[0];b[l].startOffset=0;if(b[l].startContainer===c.startContainer&&b[l].startOffset===c.startOffset)continue;if(c.startOffset===0){b[l].endContainer=this.getTextNodeSibling(false,j,c.startContainer);b[l].endOffset=b[l].endContainer.length}else{b[l].endContainer=c.startContainer;b[l].endOffset=c.startOffset}b[l].update();this.applyMarkup(b[l].getSelectionTree(),c,this.getClonedMarkup4Wrapping(j),d,{setRangeObject2NextSibling:true})}if(!g&&
f){b[l].startContainer=c.endContainer;b[l].startOffset=c.endOffset;k=e(j).textNodes(true);b[l].endContainer=k[k.length-1];b[l].endOffset=k[k.length-1].length;b[l].update();this.applyMarkup(b[l].getSelectionTree(),c,this.getClonedMarkup4Wrapping(j),d,{setRangeObject2PreviousSibling:true})}}return true},checkForFirefoxIncorrectRange:function(){if(g.mozilla&&m.getSelection().getRangeCount()!==0){var a=this.getRangeObject(),c;if(c=!a.isCollapsed())a:{c=a.endContainer;var b=r(a.endContainer),d;b:{d=a.endContainer;
var f=a.endOffset;if(l.isTextNode(d)){for(f=f-1;f>=0;f--)if(e.trim(d.textContent[f]).length!==0){d=false;break b}d=true}else d=false}if(d){for(c=c.previousSibling||c.parentNode;c!==b;)if(c.previousSibling){c=c.previousSibling;if(k.isRenderedNode(c)){c=false;break a}}else c=c.parentNode;c=c===b}else c=false}if(c){a=r(a.endContainer);c=m.getSelection().getRangeAt(0);c.setEndBefore(a);m.getSelection().removeAllRanges();m.getSelection().addRange(c)}}},changeMarkupOnSelection:function(a){this.checkForFirefoxIncorrectRange();
var c=this.getRangeObject();this.changeMarkup(c,a,this.getStandardTagComparator(a));x.Utils.Dom.doCleanup({merge:true},c);c.update();c.select();this.rangeObject=c},applyMarkup:function(a,c,b,d,g){var f,k,g=g||{};this.prepareForRemoval(a,b,d);a=this.optimizeSelectionTree4Markup(a,b,d);for(f=0;f<a.length;f++){k=a[f];if(k.wrappable)this.wrapMarkupAroundSelectionTree(k.elements,c,b,d,g);else{m.Log.debug(this,"dive further into non-wrappable object");this.applyMarkup(k.element.children,c,b,d,g)}}},getMarkupType:function(a){var c=
e(a)[0].nodeName.toLowerCase();a.outerHtml&&m.Log.debug(this,"Node name detected: "+c+" for: "+a.outerHtml());if(c=="#text")return"textNode";if(this.replacingElements[c])return"sectionOrGroupingContent";if(this.tagHierarchy[c])return"textLevelSemantics";m.Log.warn(this,"unknown markup passed to this.getMarkupType(...): "+a.outerHtml())},getStandardTagComparator:function(a){var c=this;switch(this.getMarkupType(a)){case "textNode":a=function(){return false};break;case "sectionOrGroupingContent":a=function(a,
b){return c.standardSectionsAndGroupingContentComparator(a,b)};break;default:a=function(a,b){return c.standardTextLevelSemanticsComparator(a,b)}}return a},prepareForRemoval:function(a,c,b){var d,g;typeof b!=="undefined"&&typeof b!=="function"&&m.Log.error(this,"parameter tagComparator is not a function");typeof b==="undefined"&&(b=this.getStandardTagComparator(c));for(d=0;d<a.length;d++){g=a[d];if(g.domobj&&(g.selection=="full"||g.selection=="partial"&&c.isReplacingElement)&&g.domobj.nodeType===1&&
b(g.domobj,c)){m.Log.debug(this,"Marking for removal: "+g.domobj.nodeName);e(g.domobj).addClass("preparedForRemoval")}g.selection!="none"&&g.children.length>0&&this.prepareForRemoval(g.children,c,b)}},wrapMarkupAroundSelectionTree:function(a,c,b,d,g){var f=[],k=-1,l="",j="",q,o,p;m.Log.debug(this,"The formatting <"+b[0].tagName+"> will be wrapped around the selection");for(q=0;q<a.length;q++){o=a[q];if(o.domobj&&!this.canTag1WrapTag2(o.domobj.parentNode.tagName.toLowerCase(),b[0].tagName.toLowerCase()))m.Log.info(this,
"Skipping the wrapping of <"+b[0].tagName.toLowerCase()+"> because this tag is not allowed inside <"+o.domobj.parentNode.tagName.toLowerCase()+">");else if(!o.domobj||!(o.domobj.nodeType===3&&e.trim(o.domobj.nodeValue).length===0)){if(o.domobj&&o.selection=="partial"&&!b.isReplacingElement)if(o.startOffset!==void 0&&o.endOffset===void 0){k++;l=l+o.domobj.data.substr(0,o.startOffset);o.domobj.data=o.domobj.data.substr(o.startOffset,o.domobj.data.length-o.startOffset);f[k]=o.domobj}else if(o.endOffset!==
void 0&&o.startOffset===void 0){k++;j=j+o.domobj.data.substr(o.endOffset,o.domobj.data.length-o.endOffset);o.domobj.data=o.domobj.data.substr(0,o.endOffset);f[k]=o.domobj}else if(o.endOffset!==void 0&&o.startOffset!==void 0){if(o.startOffset==o.endOffset){m.Log.debug(this,"skipping empty selection");continue}k++;l=l+o.domobj.data.substr(0,o.startOffset);p=o.domobj.data.substr(o.startOffset,o.endOffset-o.startOffset);j=j+o.domobj.data.substr(o.endOffset,o.domobj.data.length-o.endOffset);o.domobj.data=
p;f[k]=o.domobj}else{m.Log.debug(this,"diving into object");this.applyMarkup(o.children,c,b,d,g)}if(o.domobj&&(o.selection=="full"||o.selection=="partial"&&b.isReplacingElement)){k++;f[k]=o.domobj}}}if(f.length>0){f=e(f);e.each(f,function(a,c){if(m.browser.msie&&c.nodeType==3&&!c.nextSibling&&!c.previousSibling&&c.parentNode&&c.parentNode.nodeName.toLowerCase()=="li")c.data=e.trim(c.data)});a=f.wrapAll(b).parent();a.before(l).after(j);if(g.setRangeObject2NewMarkup){l=f.textNodes();if(l.index(c.startContainer)!=
-1)c.startOffset=0;if(l.index(c.endContainer)!=-1)c.endOffset=c.endContainer.length}if(g.setRangeObject2NextSibling){l=true;j=a.textNodes(true).last()[0];if(f.index(c.startContainer)!=-1){c.startContainer=this.getTextNodeSibling(l,a.parent(),j);c.startOffset=0}if(f.index(c.endContainer)!=-1){c.endContainer=this.getTextNodeSibling(l,a.parent(),j);c.endOffset=c.endOffset-j.length}}if(g.setRangeObject2PreviousSibling){l=false;j=a.textNodes(true).first()[0];if(f.index(c.startContainer)!=-1){c.startContainer=
this.getTextNodeSibling(l,a.parent(),j);c.startOffset=0}if(f.index(c.endContainer)!=-1){c.endContainer=this.getTextNodeSibling(l,a.parent(),j);c.endOffset=c.endContainer.length}}}},getTextNodeSibling:function(a,c,b){c=e(c).textNodes(true);b=c.index(b);return b==-1?false:c[b+(!a?-1:1)]||false},optimizeSelectionTree4Markup:function(a,c,b){var d=[],g=0,f=0,k=this,l,j,q,o;typeof b==="undefined"&&(b=function(a,c){return k.standardTextLevelSemanticsComparator(c)});for(l=0;l<a.length;l++)if(a[l].domobj&&
a[l].selection!="none")if(c.isReplacingElement&&b(c[0],e(a[l].domobj))){d[g]!==void 0&&g++;d[g]={};d[g].wrappable=true;d[g].elements=[];d[g].elements[f]=a[l];g++}else if(this.canMarkupBeApplied2ElementAsWhole([a[l]],c)){if(d[g]===void 0){d[g]={};d[g].wrappable=true;d[g].elements=[]}if(c.isReplacingElement){o=l;for(j=l-1;j>=0;j--)if(this.canMarkupBeApplied2ElementAsWhole([a[j]],c)&&this.isMarkupAllowedToStealSelectionTreeElement(a[j],c))o=j;else break;q=l;for(j=l+1;j<a.length;j++)if(this.canMarkupBeApplied2ElementAsWhole([a[j]],
c)&&this.isMarkupAllowedToStealSelectionTreeElement(a[j],c))q=j;else break;f=0;for(j=o;j<=q;j++){d[g].elements[f]=a[j];d[g].elements[f].selection="full";f++}f=0}else{d[g].elements[f]=a[l];f++}}else{d[g]!==void 0&&g++;d[g]={};d[g].wrappable=false;d[g].element=a[l];f=0;g++}return d},isMarkupAllowedToStealSelectionTreeElement:function(a,c){if(!a.domobj)return false;var b=a.domobj.nodeName.toLowerCase(),b=b=="#text"?"textNode":b,d=this.allowedToStealElements[c[0].nodeName.toLowerCase()];return d&&d[b]},
canMarkupBeApplied2ElementAsWhole:function(a,c){var b,d,g;if(c.jquery)b=c[0].tagName;if(c.tagName)b=c.tagName;for(d=0;d<a.length;d++){g=a[d];if(g.domobj&&(g.selection!="none"||c.isReplacingElement))if(!this.canTag1WrapTag2(b,g.domobj.nodeName)||g.children.length>0&&!this.canMarkupBeApplied2ElementAsWhole(g.children,c))return false}return true},canTag1WrapTag2:function(a,c){var a=a=="#text"?"textNode":a.toLowerCase(),c=c=="#text"?"textNode":c.toLowerCase(),b=this.tagHierarchy[a];return!b||!this.tagHierarchy[c]?
true:b[c]},mayInsertTag:function(a){var c;if(typeof this.rangeObject.unmodifiableMarkupAtStart=="object"){for(c=0;c<this.rangeObject.unmodifiableMarkupAtStart.length;++c)if(!this.canTag1WrapTag2(this.rangeObject.unmodifiableMarkupAtStart[c].nodeName,a))return false;return true}m.Log.warn(this,"Unable to determine whether tag "+a+" may be inserted");return true},resetPrevSelectionContexts:function(){u=v=null},toString:function(){return"Aloha.Selection"},SelectionRange:x.Utils.RangeObject.extend({_constructor:function(a){this._super(a);
if(a){if(a.commonAncestorContainer)this.commonAncestorContainer=a.commonAncestorContainer;if(a.selectionTree)this.selectionTree=a.selectionTree;if(a.limitObject)this.limitObject=a.limitObject;if(a.markupEffectiveAtStart)this.markupEffectiveAtStart=a.markupEffectiveAtStart;if(a.unmodifiableMarkupAtStart)this.unmodifiableMarkupAtStart=a.unmodifiableMarkupAtStart;if(a.splitObject)this.splitObject=a.splitObject}},commonAncestorContainer:void 0,selectionTree:void 0,markupEffectiveAtStart:[],unmodifiableMarkupAtStart:[],
limitObject:void 0,splitObject:void 0,select:function(){this._super();m.Selection.updateSelection()},update:function(a){this.updatelimitObject();this.updateMarkupEffectiveAtStart();this.updateCommonAncestorContainer(a);this.selectionTree=void 0},getSelectionTree:function(){if(!this.selectionTree)this.selectionTree=m.Selection.getSelectionTree(this);return this.selectionTree},getSelectedSiblings:function(a){var c=this.getSelectionTree();return this.recursionGetSelectedSiblings(a,c)},recursionGetSelectedSiblings:function(a,
c){var b=false,d=false,g;for(g=0;g<c.length;++g)if(c[g].domobj===a){d=true;b=[]}else if(!d&&c[g].children){b=this.recursionGetSelectedSiblings(a,c[g].children);if(b!==false)break}else if(d&&c[g].domobj&&c[g].selection!="collapsed"&&c[g].selection!="none")b.push(c[g].domobj);else if(d&&c[g].selection=="none")break;return b},updateMarkupEffectiveAtStart:function(){this.markupEffectiveAtStart=[];this.unmodifiableMarkupAtStart=[];var a=this.getStartContainerParents(),c=false,b,d,g;for(d=0;d<a.length;d++){g=
a[d];if(!c&&g!==this.limitObject){this.markupEffectiveAtStart[d]=g;if(!b&&x.Utils.Dom.isSplitObject(g)){b=true;this.splitObject=g}}else{c=true;this.unmodifiableMarkupAtStart.push(g)}}if(!b)this.splitObject=false},updatelimitObject:function(){if(m.editables&&m.editables.length>0){var a=this.getStartContainerParents(),c=m.editables,b,d,g,f;for(b=0;b<a.length;b++){d=a[b];for(g=0;g<c.length;g++){f=c[g].obj[0];if(d===f){this.limitObject=d;return true}}}}this.limitObject=e("body");return true},toString:function(a){return!a?
"Aloha.Selection.SelectionRange":"Aloha.Selection.SelectionRange {start ["+this.startContainer.nodeValue+"] offset "+this.startOffset+", end ["+this.endContainer.nodeValue+"] offset "+this.endOffset+"}"}})}),z=a.extend({_constructor:function(a){this._nativeSelection=a;this.ranges=[];this.preventChange=false},anchorNode:null,anchorOffset:0,focusNode:null,focusOffset:0,isCollapsed:false,rangeCount:0,collapse:function(a,c){this._nativeSelection.collapse(a,c)},collapseToStart:function(){throw"NOT_IMPLEMENTED";
},extend:function(){},modify:function(){},collapseToEnd:function(){this._nativeSelection.collapseToEnd()},selectAllChildren:function(){throw"NOT_IMPLEMENTED";},deleteFromDocument:function(){throw"NOT_IMPLEMENTED";},getRangeAt:function(a){a=this._nativeSelection.getRangeAt(a);t(a);return a},addRange:function(a){this._nativeSelection.addRange(a);var c=this._nativeSelection._ranges;t(a);c[0]=a;m.Selection.updateSelection()},removeRange:function(){this._nativeSelection.removeRange()},removeAllRanges:function(){this._nativeSelection.removeAllRanges()},
refresh:function(){},toString:function(){return"Aloha.Selection"},getRangeCount:function(){return this._nativeSelection.rangeCount}});m.getSelection=function(a){a=a!==document||a!==window?window:a;return new z(window.rangy.getSelection(a))};m.createRange=function(a){return window.rangy.createRange(a)};m.scrollToSelection=function(){var a=m.getSelection();if(a.getRangeCount()!==0){var c=a.getRangeAt(0);if(c.collapsed&&c.nativeRange&&c.nativeRange.getClientRects){var b,d,g;if(c.nativeRange.getClientRects().length===
0)if(c.startContainer.nodeType===3){b=c.startContainer.parentNode.getBoundingClientRect();a=b.top;b=b.bottom}else{b=c.startContainer.getBoundingClientRect();a=b.top;b=b.bottom;if(c.startOffset>0){d=c.startContainer.childNodes[c.startOffset-1];g=d.nextSibling}else g=c.startContainer.firstChild;if(d&&d.nodeType===1)a=d.getBoundingClientRect().bottom;if(g&&g.nodeType===1)b=g.getBoundingClientRect().top}else{b=c.nativeRange.getClientRects()[0];a=b.top;b=b.bottom}d=e(window);a<0?d.scrollTop(d.scrollTop()+
a):b>d.height()&&d.scrollTop(d.scrollTop()+(b-d.height()));c=e(c.startContainer).closest(":hasScroll(y)");if(c.length>0&&!c.is(d)&&!c.is(e("html"))){d=c[0].getBoundingClientRect();a<d.top?c.scrollTop(c.scrollTop()-(d.top-a)):b>d.bottom&&c.scrollTop(c.scrollTop()+(b-d.bottom))}}}};a=new j;return m.Selection=a});define("aloha/block-jump",["aloha/core","jquery","aloha/console"],function(m,e,a){function j(a,b){a.deleteData(0,a.length);""!==b&&(a.nextSibling&&3===a.nextSibling.nodeType?a.nextSibling.insertData(0,
b):a.previousSibling&&3===a.previousSibling.nodeType?a.previousSibling.insertData(a.previousSibling.length,b):a.insertData(0,b));setTimeout(function(){0===a.length&&e(a).remove()},0)}function d(){if(b){var d=b.nodeValue.replace(/\u200b/,"");d===b.nodeValue&&a.warn("Expected to remove the zero width text node fix, but couldn't find it");j(b,d);b=null}}var b=null;return{removeZeroWidthTextNodeFix:d,insertZeroWidthTextNodeFix:function(a,l){d();b=document.createTextNode("​");l?e(a).after(b):e(a).before(b);
m.bind("aloha-selection-changed",function(a){d();m.unbind(a)});return b}}});define("aloha/markup","aloha/core util/class util/html jquery aloha/ecma5shims aloha/console aloha/block-jump aloha/content-rules".split(" "),function(m,e,a,j,d,b,f,l){function g(a){return"false"===j(a).attr("contenteditable")}function k(a){return a&&3===a.nodeType}function c(a){return!a?0:k(a)?a.length:a.childNodes.length}function q(a){return!a?null:a.nextSibling?k(a.nextSibling)&&!(0<a.nextSibling.data.replace(/\s+/g,"").length)||
"BR"===a.nextSibling.nodeName&&a.nextSibling===a.parentNode.lastChild||""===a.nextSibling.innerHTML&&!g(a.nextSibling)?q(a.nextSibling):a.nextSibling:a.parentNode?q(a.parentNode):null}function n(a){return!a?null:a.previousSibling?k(a.previousSibling)&&!(0<a.previousSibling.data.replace(/\s+/g,"").length)?n(a.previousSibling):""===a.previousSibling.innerHTML&&!g(a.previousSibling)?n(a.previouSibling):a.previousSibling:a.parentNode?n(a.parentNode):null}function o(a,c){return k(a)&&c<=a.data.length-
a.data.replace(/^\s+/,"").length?true:c===0}function p(a,b){var d=c(a);if(d===b)return true;var g=k(a);return g&&a.data.replace(/\s+$/,"").length===b?true:1===d&&!g?"BR"===a.childNodes[0].nodeName:false}function r(a){var c;if(c=window.$_alohaPlaceholder){c=a.startContainer;var a=a.endContainer,b=window.$_alohaPlaceholder;c=!(b.is(c)||b.is(a)||(u?d.compareDocumentPosition(b[0],c)&16:0<j(b[0]).find(c).length)||(u?d.compareDocumentPosition(b[0],a)&16:0<j(b[0]).find(a).length))}if(c){0===window.$_alohaPlaceholder.html().replace(/^(&nbsp;)*$/,
"").length&&window.$_alohaPlaceholder.remove();window.$_alohaPlaceholder=null}}function t(a,c){var b;if(a.parentNode){for(b=0;b<c.length;b++)if(c[b]===a.parentNode.nodeName)return true;return t(a.parentNode,c)}return false}function x(a,c){if(!a.parentNode)return true;var b=a.nodeType===3&&a.parentNode.firstChild===a||a.parentNode.children[0]===a,d=a.nodeName==="TR"&&a.parentNode.children[0].className.indexOf("aloha-table-selectcolumn")!==-1,d=(a.nodeName==="TD"&&a.parentNode.children[0].className.indexOf("aloha-table-selectrow")!==
-1||d)&&a.parentNode.children[1]===a;return b||d?a.parentNode.nodeName===c?true:x(a.parentNode,c):false}var v=window.GENTICS,u=!!(m.browser.msie&&9>parseInt(m.browser.version,10)),z=function(){return function(a,c){if(!a.parentNode)return true;var b;a:{b=a.parentNode;var d,g;for(g=b.childNodes.length-1;g>-1;g--){d=b.childNodes[g];if(d.nodeName!=="CAPTION"&&!(d.nodeType===3&&/^[\t\n\r ]+$/.test(d.data))){b=d;break a}}b=b.lastChild}return b===a?a.parentNode.nodeName===c?true:z(a.parentNode,c):false}}();
m.Markup=e.extend({keyHandlers:{},addKeyHandler:function(a,c){this.keyHandlers[a]||(this.keyHandlers[a]=[]);this.keyHandlers[a].push(c)},removeKeyHandler:function(a){this.keyHandlers[a]&&(this.keyHandlers[a]=null)},insertBreak:function(){var a=m.Selection.rangeObject,c,b,d;a.isCollapsed()||this.removeSelectedMarkup();d=j("<br/>");v.Utils.Dom.insertIntoDOM(d,a,m.activeEditable.obj);if(b=v.Utils.Dom.searchAdjacentTextNode(d.parent().get(0),v.Utils.Dom.getIndexInParent(d.get(0))+1,false)){c=b.data.search(/\S/);
if(c>0)b.data=b.data.substring(c)}a.startContainer=a.endContainer=d.get(0).parentNode;a.startOffset=a.endOffset=v.Utils.Dom.getIndexInParent(d.get(0))+1;a.correctRange();a.clearCaches();a.select()},preProcessKeyStrokes:function(c){if(c.target.nodeName==="INPUT"||c.target.nodeName==="TEXTAREA"){c.stopImmediatePropagation();return true}if(c.type!=="keydown")return false;var b,d;if(this.keyHandlers[c.keyCode]){b=this.keyHandlers[c.keyCode];for(d=0;d<b.length;++d)if(!b[d](c))return false}if(c.keyCode===
37||c.keyCode===39){if(m.getSelection().getRangeCount()){b=m.getSelection().getRangeAt(0);if(this.processCursor(b,c.keyCode)){r(m.Selection.rangeObject);return true}}return false}if(c.keyCode===38||c.keyCode===40){if(m.getSelection().getRangeCount()){b=m.getSelection().getRangeAt(0);if(this.processCursorUpDown(b,c.keyCode))return false}return true}if(m.browser.msie&&!m.Selection.isSelectionEditable()&&!c.ctrlKey)return false;if(c.keyCode===8){c.preventDefault();m.execCommand("delete",false);return false}if(c.keyCode===
46){m.execCommand("forwarddelete",false);return false}if(c.keyCode===13){!c.shiftKey&&a.allowNestedParagraph(m.activeEditable)&&l.isAllowed(m.activeEditable.obj,"p")?m.execCommand("insertparagraph",false):l.isAllowed(m.activeEditable.obj,"br")?m.execCommand("insertlinebreak",false):a.allowNestedParagraph(m.activeEditable)&&l.isAllowed(m.activeEditable.obj,"p")&&m.execCommand("insertparagraph",false);return false}return true},processCursorUpDown:function(a,c){if(!a.collapsed)return false;var b=a.startContainer;
if(c===38&&o(b,a.startOffset)&&t(b,["TD","TH"])&&x(b,"TABLE")){b=j(b).parents("div.aloha-table-wrapper").get(0);if(!b)return false;for(b=b.previousElementSibling?b.previousElementSibling:b.previousSibling;b.nodeType!==3;){b=b.lastChild;if(b===null)return false}m.Selection.rangeObject.startContainer=b;m.Selection.rangeObject.endContainer=b;m.Selection.rangeObject.startOffset=b.length;m.Selection.rangeObject.endOffset=b.length;m.Selection.rangeObject.select();m.activeEditable&&(j.browser.mozilla&&document.activeElement!==
m.activeEditable.obj[0])&&m.activeEditable.obj.focus();return true}if(c===40&&p(b,a.startOffset)&&t(b,["TD","TH"])&&z(b,"TABLE")){b=j(b).parents("div.aloha-table-wrapper").get(0);if(!b)return false;for(b=b.nextElementSibling?b.nextElementSibling:b.nextSibling;b.nodeType!==3;){b=b.firstChild;if(b===null)return false}m.Selection.rangeObject.startContainer=b;m.Selection.rangeObject.endContainer=b;m.Selection.rangeObject.startOffset=0;m.Selection.rangeObject.endOffset=0;m.Selection.rangeObject.select();
m.activeEditable&&(j.browser.mozilla&&document.activeElement!==m.activeEditable.obj[0])&&m.activeEditable.obj.focus();return true}return false},processCursor:function(a,b){if(!a.collapsed)return true;f.removeZeroWidthTextNodeFix();var d=a.startContainer,l=m.getSelection();if(!d)return true;var e,t;if(m.browser.msie&&parseInt(m.browser.version,10)<=7&&k(d))if(b==37){for(t=a.startOffset;t>0&&d.data.charAt(t-1)==="​";)t--;if(t!=a.startOffset){a.setStart(a.startContainer,t);a.setEnd(a.startContainer,
t);l=m.getSelection();l.removeAllRanges();l.addRange(a)}}else if(b==39){for(t=a.startOffset;t<d.data.length&&d.data.charAt(t)==="​";)t++;if(t!=a.startOffset){a.setStart(a.startContainer,t);a.setEnd(a.startContainer,t);l.removeAllRanges();l.addRange(a)}}if(u&&!j(d).contentEditable()){l=j(d).parents("[contenteditable=false]");if(l.length>0)if(l.parent().hasClass("aloha-editable"))e=l[0];else return true}var x;if(!e){x=37===b||38===b;t=a.startOffset;if(k(d))if(x){if(1!==t&&!o(d,t))return true}else{if(!p(d,
t))return true}else d.childNodes.length>0&&(d=d.childNodes[t===c(d)?t-1:t]);e=x?n(d):q(d)}if(g(e)){d=e;e=new v.Utils.RangeObject;l=x?n(d):q(d);if(!l||g(l)){l=j('<div class="aloha-placeholder aloha-editing-div">&nbsp;</div>');x?j(d).before(l):j(d).after(l);e.startContainer=e.endContainer=l[0];e.startOffset=e.endOffset=0;r(e);window.$_alohaPlaceholder=l}else{if(a.startContainer.nodeType===3&&a.startContainer===a.endContainer&&a.startContainer.nodeValue!==""&&(x?a.startOffset===1:a.endOffset+1===a.endContainer.length)||
a.startContainer.nodeType===1&&(!a.startOffset||a.startContainer.childNodes[a.startOffset]&&a.startContainer.childNodes[a.startOffset].nodeType===1)){l=f.insertZeroWidthTextNodeFix(d,x);e.startContainer=e.endContainer=l;e.startOffset=e.endOffset=x?1:0}else{e.startContainer=e.endContainer=l;e.startOffset=e.endOffset=x?c(l):0;x||f.insertZeroWidthTextNodeFix(d,true)}r(e)}e.select();m.trigger("aloha-block-selected",d);m.Selection.preventSelectionChanged();return false}return true},processShiftEnter:function(a){this.insertHTMLBreak(a.getSelectionTree(),
a)},processEnter:function(a){a.splitObject?this.splitRangeObject(a):this.insertHTMLBreak(a.getSelectionTree(),a)},insertHTMLCode:function(a){var c=m.Selection.rangeObject;this.insertHTMLBreak(c.getSelectionTree(),c,j(a))},insertHTMLBreak:function(a,c,b){var d,g,f,k,l,b=b||j("<br/>");d=0;for(g=a.length;d<g;++d){f=a[d];k=f.domobj?j(f.domobj):void 0;if(f.selection!=="none")if(f.selection=="collapsed"){if(d>0){f=j(a[d-1].domobj);f.after(b)}else{f=j(a[1].domobj);f.before(b)}c.startContainer=c.endContainer=
b[0].parentNode;c.startOffset=c.endOffset=v.Utils.Dom.getIndexInParent(b[0])+1;c.correctRange()}else if(f.domobj&&f.domobj.nodeType===3){f.domobj.nextSibling&&(f.domobj.nextSibling.nodeType==1&&m.Selection.replacingElements[f.domobj.nextSibling.nodeName.toLowerCase()])&&k.after("<br/>");if(this.needEndingBreak()){for(l=f.domobj;l;)if(l.nextSibling)l=false;else{l=l.parentNode;if(v.Utils.Dom.isBlockLevelElement(l)||v.Utils.Dom.isListElement(l))break;l===c.limitObject&&(l=false)}l&&j(l).append('<br class="aloha-cleanme" />')}k.between(b,
f.startOffset);k=0;for(f=b[0];f;){f=f.previousSibling;++k}c.startContainer=b[0].parentNode;c.endContainer=b[0].parentNode;c.startOffset=k;c.endOffset=k;c.correctRange()}else if(f.domobj&&f.domobj.nodeType===1){if(k.parent().find("br.aloha-ephemera").length===0){j(c.limitObject).find("br.aloha-ephemera").remove();j(c.commonAncestorContainer).append(this.getFillUpElement(c.splitObject))}k.after(b);c.startContainer=c.commonAncestorContainer;c.endContainer=c.startContainer;c.startOffset=d+2;c.endOffset=
d+2;c.update()}}c.select()},needEndingBreak:function(){return!m.browser.msie},getSelectedText:function(){var a=m.Selection.rangeObject;return a.isCollapsed()?false:this.getFromSelectionTree(a.getSelectionTree(),true)},getFromSelectionTree:function(a,c){var b="",d,g,f,k;d=0;for(g=a.length;d<g;d++){f=a[d];if(f.selection=="partial")if(f.domobj.nodeType===3)b=b+f.domobj.data.substring(f.startOffset,f.endOffset);else{if(f.domobj.nodeType===1&&f.children)if(c)b=b+this.getFromSelectionTree(f.children,c);
else{k=j(f.domobj.outerHTML).empty();k.html(this.getFromSelectionTree(f.children,c));b=b+k.outerHTML()}}else f.selection=="full"&&(f.domobj.nodeType===3?b=b+j(f.domobj).text():f.domobj.nodeType===1&&f.children&&(b=b+(c?j(f.domobj).text():j(f.domobj).outerHTML())))}return b},getSelectedMarkup:function(){var a=m.Selection.rangeObject;return a.isCollapsed()?null:this.getFromSelectionTree(a.getSelectionTree(),false)},removeSelectedMarkup:function(){var a=m.Selection.rangeObject,c;if(!a.isCollapsed()){c=
new m.Selection.SelectionRange;this.removeFromSelectionTree(a.getSelectionTree(),c);c.update();v.Utils.Dom.doCleanup({merge:true,removeempty:true},m.Selection.rangeObject);m.Selection.rangeObject=c;c.correctRange();c.update();c.select();m.Selection.updateSelection()}},removeFromSelectionTree:function(a,c){var b,d,g,f,k;g=0;for(k=a.length;g<k;g++){f=a[g];if(f.selection=="partial")if(f.domobj.nodeType===3){d="";f.startOffset>0&&(d=d+f.domobj.data.substring(0,f.startOffset));f.endOffset<f.domobj.data.length&&
(d=d+f.domobj.data.substring(f.endOffset,f.domobj.data.length));f.domobj.data=d;if(!c.startContainer){c.startContainer=c.endContainer=f.domobj;c.startOffset=c.endOffset=f.startOffset}}else{if(f.domobj.nodeType===1&&f.children){this.removeFromSelectionTree(f.children,c);if(b){if(b.nodeName==f.domobj.nodeName){j(b).append(j(f.domobj).contents());j(f.domobj).remove()}}else b=f.domobj}}else if(f.selection=="full"){if(!c.startContainer)if(d=v.Utils.Dom.searchAdjacentTextNode(f.domobj.parentNode,v.Utils.Dom.getIndexInParent(f.domobj)+
1,false,{blocklevel:false})){c.startContainer=c.endContainer=d;c.startOffset=c.endOffset=0}else{c.startContainer=c.endContainer=f.domobj.parentNode;c.startOffset=c.endOffset=v.Utils.Dom.getIndexInParent(f.domobj)+1}j(f.domobj).remove()}}},splitRangeObject:function(a){j(a.splitObject);var c,b;a.update(a.splitObject);c=a.getSelectionTree();b=this.getSplitFollowUpContainer(a);this.splitRangeObjectHelper(c,a,b);b.hasClass("preparedForRemoval")&&b.removeClass("preparedForRemoval");c=this.getInsertAfterObject(a,
b);j(b).insertAfter(c);a.splitObject.nodeName.toLowerCase()==="li"&&!m.Selection.standardTextLevelSemanticsComparator(a.splitObject,b)&&j(a.splitObject).remove();a.startContainer=null;c=b.contents();if(c.length>0&&c.get(0).nodeType==1&&c.get(0).nodeName.toLowerCase()==="br")a.startContainer=b.get(0);if(!a.startContainer)a.startContainer=b.textNodes(true,true).first().get(0);if(!a.startContainer)a.startContainer=b.textNodes(false).first().parent().get(0);if(a.startContainer){a.endContainer=a.startContainer;
a.startOffset=0;a.endOffset=0}else{a.startContainer=a.endContainer=b.parent().get(0);a.startOffset=a.endOffset=v.Utils.Dom.getIndexInParent(b.get(0))}a.update();a.select()},getInsertAfterObject:function(a,c){var b,d,g;for(d=0;d<a.markupEffectiveAtStart.length;d++){g=a.markupEffectiveAtStart[d];g===a.splitObject&&(b=true);if(b&&m.Selection.canTag1WrapTag2(j(g).parent()[0].nodeName,c[0].nodeName))return g}return false},getFillUpElement:function(){return m.browser.msie?false:j('<br class="aloha-cleanme"/>')},
removeElementContentWhitespaceObj:function(a){var c=0,b=[],d,g;for(d=0;d<a.length;++d){g=a[d];g.isElementContentWhitespace&&(b[b.length]=d)}for(d=0;d<b.length;++d){g=b[d];a.splice(g-c,1);++c}},splitRangeObjectHelper:function(a,c,b,d){b||m.Log.warn(this,"no followUpContainer, no inBetweenMarkup, nothing to do...");var g=this.getFillUpElement(c.splitObject),f=j(c.splitObject),k=false,l,e,q,o,p;if(a.length>0){q=b.contents();q.length!==a.length&&this.removeElementContentWhitespaceObj(q);e=0;for(p=a.length;e<
p;++e){l=a[e];if(l.selection==="none"&&k===false||l.domobj&&l.domobj.nodeType===3&&l===a[a.length-1]&&l.startOffset===l.domobj.data.length)if(b.textNodes().length>1||l.domobj.nodeType===1&&l.children.length===0)q.eq(e).remove();else if(v.Utils.Dom.isSplitObject(b[0]))g?b.html(g):b.empty();else{b.empty();b.addClass("preparedForRemoval")}else if(l.selection!=="none"){if(l.domobj&&l.domobj.nodeType===3&&l.startOffset!==void 0){k=l.domobj.data;if(l.startOffset>0)l.domobj.data=k.substr(0,l.startOffset);
else if(a.length>1)j(l.domobj).remove();else{o=j(l.domobj).parent();v.Utils.Dom.isSplitObject(o[0])?g?o.html(g):o.empty():o.remove()}if(k.length-l.startOffset>0)q[e].data=k.substr(l.startOffset,k.length);else if(q.length>1)q.eq(e).remove();else if(v.Utils.Dom.isBlockLevelElement(b[0]))g?b.html(g):b.empty();else{b.empty();b.addClass("preparedForRemoval")}}k=true;l.children.length>0&&this.splitRangeObjectHelper(l.children,c,q.eq(e),d)}else l.selection==="none"&&k===true&&j(l.domobj).remove()}}else m.Log.error(this,
"can not split splitObject due to an empty selection tree");f.find("br.aloha-ephemera:gt(0)").remove();b.find("br.aloha-ephemera:gt(0)").remove();f.find(".preparedForRemoval").remove();b.find(".preparedForRemoval").remove();f.contents().length===0&&(v.Utils.Dom.isSplitObject(f[0])&&g)&&f.html(g);b.contents().length===0&&(v.Utils.Dom.isSplitObject(b[0])&&g)&&b.html(g)},getSplitFollowUpContainer:function(a){var c;switch(a.splitObject.nodeName.toLowerCase()){case "h1":case "h2":case "h3":case "h4":case "h5":case "h6":if((c=
j(a.splitObject).textNodes(":not(.aloha-cleanme)").last()[0])&&a.startContainer===c&&a.startOffset===c.length){c=j("<p></p>");a=j(a.splitObject.outerHTML).contents();c.append(a);return c}break;case "li":if(a.startContainer.nodeName.toLowerCase()==="br"&&j(a.startContainer).hasClass("aloha-ephemera")){c=j("<p></p>");a=j(a.splitObject.outerHTML).contents();c.append(a);return c}if(!a.splitObject.nextSibling&&j.trim(j(a.splitObject).text()).length===0)return c=j("<p></p>")}return j(a.splitObject.outerHTML)},
transformDomObject:function(a,c,b){var d=j(a),c=j("<"+c+">"),g,f=d[0].cloneNode(false).attributes;if(f)for(g=0;g<f.length;++g)(typeof f[g].specified==="undefined"||f[g].specified)&&c.attr(f[g].nodeName,f[g].nodeValue);if(d[0].style&&d[0].style.cssText)c[0].style.cssText=d[0].style.cssText;d.contents().appendTo(c);d.replaceWith(c);if(b){if(b.startContainer==a)b.startContainer=c.get(0);if(b.endContainer==a)b.endContainer=c.get(0)}return c},toString:function(){return"Aloha.Markup"}});m.Markup=new m.Markup;
return m.Markup});define("aloha/observable",["jquery"],function(m){return{_eventHandlers:null,bind:function(e,a,j){this._eventHandlers=this._eventHandlers||{};this._eventHandlers[e]||(this._eventHandlers[e]=[]);this._eventHandlers[e].push({handler:a,scope:j||window})},unbind:function(e,a){this._eventHandlers=this._eventHandlers||{};this._eventHandlers[e]&&(this._eventHandlers[e]=a?m.grep(this._eventHandlers[e],function(e){return e.handler===a?!1:!0}):[])},trigger:function(e){this._eventHandlers=this._eventHandlers||
{};if(this._eventHandlers[e]){var a=[];m.each(arguments,function(e,d){0<e&&a.push(d)});m.each(this._eventHandlers[e],function(e,d){d.handler.apply(d.scope,a)})}},unbindAll:function(){this._eventHandlers=null}}});define("aloha/registry",["jquery","aloha/observable","util/class"],function(m,e,a){return a.extend(e,{_entries:null,_ids:null,_constructor:function(){this._entries={};this._ids=[]},register:function(a,d){this._entries[a]=d;this._ids.push(a);this.trigger("register",d,a)},unregister:function(a){var d,
b=this._entries[a];delete this._entries[a];for(d in this._ids)if(this._ids.hasOwnProperty(d)&&this._ids[d]===a){this._ids.splice(d,1);break}this.trigger("unregister",b,a)},get:function(a){return this._entries[a]},has:function(a){return this._entries[a]?!0:!1},getEntries:function(){return m.extend({},this._entries)},getIds:function(){return m.extend([],this._ids)}})});define("aloha/contenthandlermanager",["aloha/core","aloha/registry","util/class"],function(m,e,a){return new (e.extend({createHandler:function(e){if("function"!==
typeof e.handleContent)throw"ContentHandler has no function handleContent().";return new (a.extend({handleContent:function(){}},e))},handleContent:function(a,d,b){var f=d?d.contenthandler:this.getIds();if(!f)return a;var l,g;for(l=0;l<f.length&&!((g=this.get(f[l]))&&(a=g.handleContent(a,d,b||m.activeEditable)),null===a);l++);return a}}))});define("util/trees",["jquery"],function(m){function e(a,c,b){var d=m.type(a),g,f,k;if("array"===d){d=b?a:[];k=g=0;for(f=a.length;k<f;k++)b=c(a[k]),b.length&&(d[g++]=
b[0]);g!==d.length&&(d=d.slice(0,g))}else if("object"===d)for(g in d=b?a:{},a)a.hasOwnProperty(g)&&(b=c(a[g]),b.length?d[g]=b[0]:delete d[g]);else d=a;return d}function a(a,c){return e(a,c,!0)}function j(a,c){var b,d,g;if(1===a.nodeType)for(d=a.firstChild;d;)b=c(d),g=d.nextSibling,b.length?b[0]!==d&&a.replaceChild(b[0],d):a.removeChild(d),d=g;return a}function d(a,c,b,d){return[b(c(d),a)]}function b(a,c,b,d){return[c(b(d,a))]}function f(a,c,b,d){return c(d)?[]:[b(d,a)]}function l(a,c,b,d){a=b(d,a);
return c(a)?[]:[a]}function g(a,c,b,d){function g(d){return a(g,c,b,d)}return g(d)[0]}function k(a){a=m.type(a);return"object"!==a&&"array"!==a}function c(c,b,d){function g(a){return k(a)?[b(a)]:[f(a,g)]}var f=d?a:e;return g(c)[0]}return{prewalk:function(c,b,f){return g(d,b,f?a:e,c)},postwalk:function(c,d,f){return g(b,d,f?a:e,c)},preprune:function(c,b,d){return g(f,b,d?a:e,c)},postprune:function(c,b,d){return g(l,b,d?a:e,c)},prewalkDom:function(a,c,b){return g(d,c,j,b?a:a.cloneNode(!0))},postwalkDom:function(a,
c,d){return g(b,c,j,d?a:a.cloneNode(!0))},prepruneDom:function(a,c,b){return g(f,c,j,b?a:a.cloneNode(!0))},postpruneDom:function(a,c,b){return g(l,c,j,b?a:a.cloneNode(!0))},isLeaf:k,leaves:c,clone:function(a){function c(a){return[e(a,c)]}return c(a)[0]},flatten:function(a){var b=[];c(a,function(a){b.push(a);return a},!0);return b},walk:e,walkInplace:a,walkDomInplace:j}});define("util/misc",["jquery","aloha/engine","util/dom"],function(m,e,a){return{anyRx:function(a,d){var b,f;b=0;for(f=a.length;b<
f;b++)if(a[b].test(d))return!0;return!1},addEditingHelpers:function(e){var d=a.getFirstVisibleChild(e[0],!1,["TABLE"]),b=m(d);if(a.isBlockNode(d)&&(!b.contentEditable()||"TABLE"===d.nodeName))d=m('<p class="aloha-editing-p"></p>'),e.prepend(d),0===a.getOffsetHeight(d[0])&&d.append(m('<br class="aloha-end-br"/>'));d=a.getLastVisibleChild(e[0],!1,["TABLE"]);m(d);if(a.isBlockNode(d)&&(!m(d).contentEditable()||"TABLE"===d.nodeName))d=m('<p class="aloha-editing-p"></p>'),e.append(d),0===a.getOffsetHeight(d[0])&&
d.append(m('<br class="aloha-end-br"/>'))},removeEditingHelpers:function(j){j.find("p.aloha-editing-p > br.aloha-end-br").remove();j.find("p.aloha-editing-p").each(function(d,b){a.isEmpty(b)&&!m(b).find(".aloha-block").length?m(b).remove():(m(b).removeClass("aloha-editing-p"),e.ensureContainerEditable(b))})}}});define("aloha/ephemera","jquery aloha/core aloha/console util/strings util/trees util/arrays util/maps util/dom2 util/functions util/html util/misc util/browser PubSub".split(" "),function(m,
e,a,j,d,b,f,l,g,k,c,q,n){function o(a){var a=m(a),c=a.attr("data-aloha-ephemera-attr"),b;q.ie7||a.removeAttr("data-aloha-ephemera-attr");if(typeof c==="string"){b=j.words(c);for(c=0;c<b.length;c++)a.removeAttr(b[c])}}function p(a,d,g,f){return(g=g[d])&&(true===g||-1!==b.indexOf(g,a.nodeName))?true:c.anyRx(f,d)}function r(a,c){var b=null,d=l.attrNames(a),g,f,k;f=0;for(k=d.length;f<k;f++){g=d[f];if(p(a,g,c.attrMap,c.attrRxs)){b=b||m(a);b.removeAttr(g)}}}function t(a,c){var d=a.className;if("string"===
typeof d&&-1!==d.indexOf(v)){d=j.words(d);if(-1!==b.indexOf(d,"aloha-cleanme")||-1!==b.indexOf(d,"aloha-ephemera")){m.removeData(a);return false}if(-1!==b.indexOf(d,"aloha-ephemera-wrapper")||-1!==b.indexOf(d,"aloha-ephemera-filler")){l.moveNextAll(a.parentNode,a.firstChild,a.nextSibling);m.removeData(a);return false}if(-1!==b.indexOf(d,"aloha-ephemera-empty-wrapper")){k.hasOnlyWhiteSpaceChildren(a)||l.moveNextAll(a.parentNode,a.firstChild,a.nextSibling);m.removeData(a);return false}-1!==b.indexOf(d,
"aloha-ephemera-attr")&&o(a);var g=b.filter(d,function(a){return!c.classMap[a]});if(g.length!==d.length)0===g.length?m(a).removeAttr("class"):a.className=g.join(" ")}r(a,c);return true}var x={classMap:{"aloha-ephemera-wrapper":true,"aloha-ephemera-filler":true,"aloha-ephemera-attr":true,"aloha-ephemera":true,"aloha-cleanme":true},attrMap:{hidefocus:true,hideFocus:true,tabindex:true,tabIndex:true,contenteditable:["TABLE"],contentEditable:["TABLE"]},attrRxs:[/^(?:nodeIndex|sizcache|sizset|jquery)[\w\d]*$/i],
pruneFns:[]},v="aloha-";return{ephemera:function(a){a&&(x=a);n.pub("aloha.ephemera",{ephemera:x});return x},classes:function(){var c=Array.prototype.slice.call(arguments);f.fillKeys(x.classMap,c,true);var b=c,d,g;d=0;for(g=b.length;d<g;d++)if(-1===b[d].indexOf(v)){a.warn('Class "'+b[d]+'" was set to be ephemeral,which hurts peformance. Add the common substring "'+v+'" to the class to fix this problem.');v=""}n.pub("aloha.ephemera.classes",{ephemera:x,newClasses:c})},attributes:function(){var a=Array.prototype.slice.call(arguments);
f.fillKeys(x.attrMap,a,true);n.pub("aloha.ephemera.attributes",{ephemera:x,newAttributes:a})},markElement:function(a){m(a).addClass("aloha-ephemera")},markAttr:function(a,c){var a=m(a),d=a.attr("data-aloha-ephemera-attr");null==d||""===d?d=c:-1===b.indexOf(j.words(d),c)&&(d=d+(" "+c));a.attr("data-aloha-ephemera-attr",d);a.addClass("aloha-ephemera-attr")},markWrapper:function(a){m(a).addClass("aloha-ephemera-wrapper")},markWhiteSpaceWrapper:function(a){m(a).addClass("aloha-ephemera-empty-wrapper")},
markFiller:function(a){m(a).addClass("aloha-ephemera-filler")},prune:function(a,c){function g(a){var f;a:{f=c;var k=g;if(1===a.nodeType){if(!t(a,f)){f=[];break a}a=d.walkDomInplace(a,k)}f=(a=b.reduce(f.pruneFns,a,b.applyNotNull))?[a]:[]}return f}c=c||x;return g(a)[0]},isAttrEphemeral:p}});define("aloha/copypaste",["jquery","aloha/core"],function(m,e){function a(a){var d=e.createRange(),b=e.getSelection();d.setStart(a.startContainer,a.startOffset);d.setEnd(a.endContainer,a.endOffset);b.removeAllRanges();
b.addRange(d)}return{getEditableAt:function(a){if(!a||!a.commonAncestorContainer)return null;a=m(a.commonAncestorContainer);return a.length?e.getEditableHost(a):null},getRange:function(){var a=e.getSelection();return a.getRangeCount()?a.getRangeAt(0):null},selectAllOf:function(e){a({startContainer:e,endContainer:e,startOffset:0,endOffset:e.childNodes?e.childNodes.length:e.length});m(e).focus()},setSelectionAt:a}});define("aloha/command",["aloha/core","aloha/registry","aloha/engine","util/dom","aloha/contenthandlermanager"],
function(m,e,a,j,d){var b={execCommand:function(b,l,g,k){var c={commandId:b,preventDefault:!1};m.trigger("aloha-command-will-execute",c);if(!0!==c.preventDefault){c=m.getSelection();if(!k){if(!c.getRangeCount())return;k=c.getRangeAt(0)}"inserthtml"===b.toLowerCase()&&(g=d.handleContent(g,{contenthandler:m.settings.contentHandler.insertHtml,command:"insertHtml"}));a.execCommand(b,l,g,k);"insertparagraph"!==b.toLowerCase()&&c.getRangeCount()&&(k=c.getRangeAt(0),l=k.commonAncestorContainer,l.parentNode&&
(l=l.parentNode),g=new window.GENTICS.Utils.RangeObject,g.startContainer=k.startContainer,g.startOffset=k.startOffset,g.endContainer=k.endContainer,g.endOffset=k.endOffset,j.doCleanup({merge:!0,removeempty:!1},g,l),g.select());m.scrollToSelection();m.trigger("aloha-command-executed",b)}},queryCommandEnabled:function(b,d){if(!d){if(!m.getSelection().getRangeCount())return;d=m.getSelection().getRangeAt(0)}return a.queryCommandEnabled(b,d)},queryCommandIndeterm:function(b,d){if(!d){if(!m.getSelection().getRangeCount())return;
d=m.getSelection().getRangeAt(0)}return a.queryCommandIndeterm(b,d)},queryCommandState:function(b,d){if(!d){if(!m.getSelection().getRangeCount())return;d=m.getSelection().getRangeAt(0)}return a.queryCommandState(b,d)},queryCommandSupported:function(b){return a.queryCommandSupported(b)},queryCommandValue:function(b,d){if(!d){if(!m.getSelection().getRangeCount())return;d=m.getSelection().getRangeAt(0)}return a.queryCommandValue(b,d)},querySupportedCommands:function(){var b=[],d;for(d in a.commands)a.commands.hasOwnProperty(d)&&
b.push(d);return b},getStateOverride:a.getStateOverride,setStateOverride:a.setStateOverride,resetOverrides:a.resetOverrides,unsetStateOverride:a.unsetStateOverride},b=new (e.extend(b));m.execCommand=b.execCommand;m.queryCommandEnabled=b.queryCommandEnabled;m.queryCommandIndeterm=b.queryCommandIndeterm;m.queryCommandState=b.queryCommandState;m.queryCommandSupported=b.queryCommandSupported;m.queryCommandValue=b.queryCommandValue;m.querySupportedCommands=b.querySupportedCommands;return b});define("aloha/state-override",
"aloha/core jquery aloha/command util/dom2 util/maps util/range PubSub".split(" "),function(m,e,a,j,d,b,f){function l(){c=q=null}function g(a,b,d){if(k){q=b;c=c||{};c[a]=d}}var k=m.settings.stateOverride!==false,c=null,q=null;m.bind("aloha-selection-changed",function(a,c){if(q&&!j.areRangesEq(q,c)){l();f.pub("aloha.selection.context-change",{range:c,event:a})}});return{enabled:function(a){null!=a&&(k=a);return k},keyPressHandler:function(a){if(c&&!a.altKey&&!a.ctrlKey&&a.which){var b=m.getSelection();
if(b.getRangeCount()){var g=String.fromCharCode(a.which),f=b.getRangeAt(0);j.insertSelectText(g,f);d.forEach(c,function(a,c){a(c,f)});j.collapseToEnd(f);b.removeAllRanges();b.addRange(f);a.preventDefault()}}},setWithRangeObject:function(a,c,d){if(k){g(a,j.rangeFromRangeObject(c),function(a,c){var g=new b(c);d(a,g);j.setRangeFromRef(c,g)});c.select()}},set:g,clear:l}});define("aloha/editable","aloha/core util/class jquery aloha/content-rules aloha/pluginmanager aloha/selection aloha/markup aloha/contenthandlermanager aloha/console aloha/block-jump aloha/ephemera util/dom2 util/browser PubSub aloha/copypaste aloha/command aloha/state-override".split(" "),
function(m,e,a,j,d,b,f,l,g,k,c,q,n,o,p,r,t){function x(a){return l.handleContent(a.getContents(),{contenthandler:m.settings.contentHandler.smartContentChange},a)}function v(a){var c=a.obj;c.mousedown(function(){m.eventHandled=true}).mouseup(function(){m.eventHandled=false});c.keydown(function(c){var b=f.preProcessKeyStrokes(c);a.keyCode=c.which;b||a.smartContentChange(c);return b});c.keypress(t.keyPressHandler);c.keypress(function(a){m.activeEditable.smartContentChange(a)});c.on("dragstart",function(){return false});
c.keyup(function(a){if(a.keyCode===27){m.deactivateEditable();return false}});c.contentEditableSelectionChange(function(a){b.onChange(c,a,0,m.mouseEventChangedEditable);if(m.mouseEventChangedEditable)m.mouseEventChangedEditable=false;return c})}function u(c,b){var d=a(b);if(d.hasClass("aloha-editing-div")){var d=a(b),g=b.firstChild;if(g){if(!q.isTextNode(g)||g.data.indexOf(" ")===-1)g=b.lastChild;if(q.isTextNode(g))g.data=g.data.replace(/(^(\u00A0)+)|((\u00A0)+$)/g,"");d.is(":empty")?d.remove():q.removeShallow(b)}else d.remove()}else if(d.hasClass("aloha-editing-p")){d=
a(b);if(n.ie?b.className==="aloha-editing-p aloha-placeholder"&&b.children.length===0&&(!b.firstChild||b.firstChild.data==="⁠"):b.className==="aloha-editing-p aloha-placeholder"&&b.children.length>=1&&b.children[0].nodeName==="BR"&&b.children[0].className==="aloha-end-br")d.remove();else{d.removeClass("aloha-editing-p");d.removeClass("aloha-placeholder");if(n.ie)if((d=d[0].firstChild)&&q.isTextNode(d)&&d.data.indexOf("⁠")>=-1)d.data=d.data.replace(/(^(\u2060)+)|((\u2060)+$)/g,"")}}else d.remove()}
var z=a,C=window.unescape,F=window.GENTICS,A=false,E={};m.defaults.contentHandler={};m.defaults.contentHandler.initEditable=["blockelement","sanitize"];m.defaults.contentHandler.getContents=["blockelement","sanitize","basic"];if(typeof m.settings.contentHandler==="undefined")m.settings.contentHandler={};var J=function(a){return z(a).html()},K={65:"a"},O={"ctrl+a":function(){var a=p.getEditableAt(p.getRange());if(a){p.selectAllOf(a.obj[0]);return false}}};a(document).keydown(function(a){if(m.activeEditable){var c=
K[a.which];if(c){var b=a.altKey?"alt":a.ctrlKey?"ctrl":a.shiftKey?"shift":null,c=(b?b+"+":"")+c;if(O[c])return O[c](a)}}});m.Editable=e.extend({_constructor:function(a){a.attr("id")||a.attr("id",F.Utils.guid());this.originalObj=this.obj=a;this.ready=false;this.sccDelimiters=[":",";",".","!","?",",",C("%u0009"),C("%u0020"),C("%u0008"),C("%u007F"),"Enter"];this.sccIdle=5E3;this.sccDelay=500;this.sccTimerDelay=this.sccTimerIdle=false;this.keyCodeMap={93:"Apps",18:"Alt",20:"CapsLock",17:"Control",40:"Down",
35:"End",13:"Enter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",36:"Home",45:"Insert",37:"Left",224:"Meta",34:"PageDown",33:"PageUp",19:"Pause",44:"PrintScreen",39:"Right",145:"Scroll",16:"Shift",38:"Up",91:"Win",92:"Win"};this.placeholderClass="aloha-placeholder";m.registerEditable(this)},init:function(){var a=this;if((this.settings=m.settings)&&m.settings.smartContentChange){if(m.settings.smartContentChange.delimiters)this.sccDelimiters=
m.settings.smartContentChange.delimiters;if(m.settings.smartContentChange.idle)this.sccIdle=m.settings.smartContentChange.idle;if(m.settings.smartContentChange.delay)this.sccDelay=m.settings.smartContentChange.delay}if(this.check(this.obj)){if(typeof m.settings.contentHandler.getContents==="undefined")m.settings.contentHandler.getContents=m.defaults.contentHandler.getContents;if(typeof m.settings.contentHandler.initEditable==="undefined")m.settings.contentHandler.initEditable=m.defaults.contentHandler.initEditable;
var c=a.obj.html(),c=l.handleContent(c,{contenthandler:m.settings.contentHandler.initEditable,command:"initEditable"},a);a.obj.html(j.applyRules(c,a.obj[0]));m.bind("aloha-plugins-loaded",function(){a.obj.addClass("aloha-editable").contentEditable(true);v(a);a.setUnmodified();a.snapshotContent=a.getContents();a.initPlaceholder();a.ready=true;window.setTimeout(function(){m.disableObjectResizing();m.disableInlineTableEditing()},20);m.trigger("aloha-editable-created",[a]);o.pub("aloha.editable.created",
{editable:a,data:a})})}else this.destroy()},isActive:false,originalContent:null,range:void 0,check:function(){var a=this,c=this.obj,b=c.get(0).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"],g;for(g=0;g<d.length;++g)if(b===d[g])return true;switch(b){case "textarea":case "input":b=
z('<div id="'+this.getId()+'-aloha" class="aloha-'+b+'" />').insertAfter(c);b.height(c.height()).width(c.width()).html(c.val());c.hide();c.parents("form:first").submit(function(){c.val(a.getContents())});this.obj=b;return true}return false},initPlaceholder:function(){m.settings.placeholder&&this.isEmpty()&&this.addPlaceholder()},isEmpty:function(){var a=z.trim(this.getContents());return a.length===0||(a==="<br>"?true:false)},addPlaceholder:function(){var a=z("<div>"),c=z("<span>"),b,d=this.obj;b=
F.Utils.Dom.allowsNesting(d[0],a[0])?a:c;if(z("."+this.placeholderClass,d).length===0){z.each(m.settings.placeholder,function(a,c){d.is(a)&&b.html(c)});if(!b.is(":empty")){b.addClass(this.placeholderClass).addClass("aloha-ephemera");z(d).append(b)}z("br",d).remove()}},removePlaceholder:function(a,c){var d=this.placeholderClass,g;z("."+this.placeholderClass,a).length!==0&&(c===true?window.setTimeout(function(){g=new b.SelectionRange;g.startContainer=g.endContainer=a.get(0);g.startOffset=g.endOffset=
0;a.find("."+d).each(u);g.select()},100):a.find("."+d).each(u))},destroy:function(){this===m.getActiveEditable()&&this.blur();switch(this.originalObj.get(0).nodeName.toLowerCase()){case "textarea":case "input":this.originalObj.val(this.getContents());this.obj.remove();this.originalObj.show()}this.ready=false;this.removePlaceholder(this.obj);this.obj.removeClass("aloha-editable").contentEditable(false).unbind("mousedown click dblclick focus keydown keypress keyup");m.trigger("aloha-editable-destroyed",
[this]);o.pub("aloha.editable.destroyed",{editable:this,data:this});m.unregisterEditable(this)},setUnmodified:function(){this.originalContent=this.getContents()},isModified:function(){return this.originalContent!==this.getContents()},toString:function(){return"Aloha.Editable"},isDisabled:function(){return!this.obj.contentEditable()||this.obj.contentEditable()==="false"},disable:function(){return this.isDisabled()||this.obj.contentEditable(false)},enable:function(){return this.isDisabled()&&this.obj.contentEditable(true)},
activate:function(a){var c=m.getActiveEditable();if(A)A=false;else if((!a||!(a.type==="focus"&&c!==null&&c.obj.parent().get(0)===a.currentTarget))&&!this.isActive&&!this.isDisabled()){this.obj.addClass("aloha-editable-active");m.activateEditable(this);A=true;this.removePlaceholder(this.obj,true);A=false;this.isActive=true;m.trigger("aloha-editable-activated",{oldActive:c,editable:this});o.pub("aloha.editable.activated",{old:c,editable:this,data:{old:c,editable:this}})}},blur:function(){this.obj.blur();
this.isActive=false;this.initPlaceholder();this.obj.removeClass("aloha-editable-active");m.trigger("aloha-editable-deactivated",{editable:this});o.pub("aloha.editable.deactivated",{editable:this,data:{editable:this}});m.activeEditable.smartContentChange({type:"blur"},null);b.resetPrevSelectionContexts()},empty:function(a){return null===a||z.trim(a)===""||a==="<br/>"},getContents:function(a){var b=this.obj.html(),g=E[this.getId()];if(!g||b!==g.raw){k.removeZeroWidthTextNodeFix();var f=this.obj.clone(false);
this.removePlaceholder(f);f=z(c.prune(f[0]));d.makeClean(f);f=z("<div>"+l.handleContent(f.html(),{contenthandler:m.settings.contentHandler.getContents,command:"getContents"},this)+"</div>");g=E[this.getId()]={};g.raw=b;g.element=f}if(a)return g.element.clone().contents();if(null==g.serialized)g.serialized=J(g.element[0]);return g.serialized},setContents:function(a,c){var b=null;if(m.getActiveEditable()===this){m.deactivateEditable();b=this}this.obj.html(a);null!==b&&b.activate();this.smartContentChange({type:"set-contents"});
return c?this.obj.contents():J(this.obj[0])},getId:function(){return this.obj.attr("id")},smartContentChange:function(c){function b(){null==k&&(k=d.getSnapshotContent());return k}var d=this,f=null;if(c&&(c.metaKey||c.crtlKey||c.altKey))return false;c&&(f=this.keyCodeMap[this.keyCode]||String.fromCharCode(c.which)||"unknown");var k=null;if(z.inArray(f,this.sccDelimiters)>=0){clearTimeout(this.sccTimerIdle);clearTimeout(this.sccTimerDelay);this.sccTimerDelay=window.setTimeout(function(){m.trigger("aloha-smart-content-changed",
{editable:d,keyIdentifier:c.originalEvent.keyIdentifier,keyCode:c.keyCode,"char":f,triggerType:"keypress",getSnapshotContent:b});x(d);g.debug("Aloha.Editable","smartContentChanged: event type keypress triggered")},this.sccDelay)}else if(c&&c.type==="paste"){m.trigger("aloha-smart-content-changed",{editable:d,keyIdentifier:null,keyCode:null,"char":null,triggerType:"paste",getSnapshotContent:b});x(d)}else if(c&&c.type==="blur"){m.trigger("aloha-smart-content-changed",{editable:d,keyIdentifier:null,
keyCode:null,"char":null,triggerType:"blur",getSnapshotContent:b});x(d)}else if(c&&c.type==="block-change"){clearTimeout(this.sccTimerIdle);clearTimeout(this.sccTimerDelay);this.sccTimerDelay=window.setTimeout(function(){m.trigger("aloha-smart-content-changed",{editable:d,keyIdentifier:null,keyCode:null,"char":null,triggerType:"block-change",getSnapshotContent:b});x(d)},this.sccDelay)}else if(f!==null){var l=m.Selection.getRangeObject();if(l.startContainer==l.endContainer){l=a(l.startContainer).children();
l.length==1&&l.is("br")&&l.remove()}clearTimeout(this.sccTimerDelay);clearTimeout(this.sccTimerIdle);this.sccTimerIdle=window.setTimeout(function(){m.trigger("aloha-smart-content-changed",{editable:d,keyIdentifier:null,keyCode:null,"char":null,triggerType:"idle",getSnapshotContent:b});x(d)},this.sccIdle)}},getSnapshotContent:function(){var a=this.snapshotContent;this.snapshotContent=this.getContents();return a}});m.Editable.setContentSerializer=function(a){J=a};m.Editable.getContentSerializer=function(){return J};
m.Editable.registerEvents=v});define("aloha/plugin",["aloha/core","jquery","util/class","aloha/pluginmanager","aloha/console"],function(m,e,a,j,d){function b(a){var b=m.getEditableById(a.attr("id"));return b?b.originalObj:a}var f=a.extend({name:null,defaults:{},settings:{},dependencies:[],_constructor:function(a){"string"!==typeof a?d.error("Cannot initialise unnamed plugin, skipping"):this.name=a},checkDependencies:function(){var a=this,b=!0;e.each(a.dependencies,function(f,c){if(!m.isPluginLoaded(c.toString()))return b=
!1,d.error("plugin."+a.name,'Required plugin "'+c+'" not found.'),!1});return b},init:function(){},getEditableConfig:function(a){var d=null,f=!1,c=this;this.settings.editables&&(a=b(a),e.each(this.settings.editables,function(b,j){var o;if(a.is(b))if(f=!0,j instanceof Array)d=[],d=e.merge(d,j);else if("object"===typeof j)for(o in d={},d["aloha-editable-selector"]=b,j)j.hasOwnProperty(o)&&(j[o]instanceof Array?d[o]=j[o]:"object"===typeof j[o]?(d[o]={},d[o]=e.extend(!0,d[o],c.config[o],j[o])):d[o]=j[o]);
else d=j}));f||(d="undefined"===typeof this.settings.config||!this.settings.config?this.config:this.settings.config);return d},makeClean:function(){},getUID:function(){d.deprecated("plugin","getUID() is deprecated. Use plugin.name instead.");return this.name},toString:function(){return this.name},log:function(a,b){d.deprecated("plugin","log() is deprecated. Use Aloha.console instead.");d.log(a,this,b)}});f.create=function(a,b){var d=new (f.extend(b))(a);d.settings=e.extendObjects(!0,d.defaults,m.settings[a]);
j.register(d);return d};return f});define("aloha/jquery.aloha",["aloha/core","aloha/selection","jquery","aloha/console"],function(m,e,a,j){function d(a,b,d,c){if(!(b!==c.target&&(/textarea|input|select/i.test(c.target.nodeName)||"text"===c.target.type)))return a.apply(b,d)}function b(b){var g,f,c,e;if("string"===typeof b.data){g=b.handler;f=b.data.toLowerCase().split(" ");c={};for(e=0;e<f.length;e++)c[f[e]]=!0;b.handler=function(b){if(this===b.target){var f="keypress"!==b.type&&a.hotkeys.specialKeys[b.which],
k="";b.altKey&&"alt"!==f&&(k+="alt+");b.ctrlKey&&"ctrl"!==f&&(k+="ctrl+");b.metaKey&&(!b.ctrlKey&&"meta"!==f)&&(k+="meta+");b.shiftKey&&"shift"!==f&&(k+="shift+");if(f){if(c[k+f])return d(g,this,arguments,b)}else if(f=String.fromCharCode(b.which).toLowerCase(),c[k+f]||c[k+a.hotkeys.shiftNums[f]]||"shift+"===k&&c[a.hotkeys.shiftNums[f]])return d(g,this,arguments,b)}}}}var f=window.XMLSerializer;a.fn.between=function(a,b){var d;3!==this[0].nodeType?(d=this.children().size(),b>d&&(b=d),0>=b?this.prepend(a):
this.children().eq(b-1).after(a)):0>=b?this.before(a):(b>=this[0].length||(d=this[0].data,this[0].data=d.substring(0,b),this.after(d.substring(b,d.length))),this.after(a))};a.fn.contentEditable=function(b){var d=a(this),f="contenteditable";m.browser.msie&&7==parseInt(m.browser.version,10)&&(f="contentEditable");if("undefined"===typeof b){if("undefined"===typeof d[0]){j.warn("The jquery object did not contain any valid elements.");return}return"undefined"===typeof d[0].isContentEditable?(j.warn("Could not determine whether the is editable or not. I assume it is."),
!0):d[0].isContentEditable}""===b?d.removeAttr(f):d.attr(f,b&&"false"!==b?"true":"false");return d};a.fn.aloha=function(){var b=this;m.bind("aloha-plugins-loaded",function(){b.each(function(b,d){m.isEditable(d)||(new m.Editable(a(d))).init()})});return b};a.fn.mahalo=function(){return this.each(function(){m.isEditable(this)&&m.getEditableById(a(this).attr("id")).destroy()})};a.fn.alohaText=function(){return this.each(function(){m.isEditable(this)&&m.getEditableById(a(this).attr("id")).getContents()})};
a.fn.contentEditableSelectionChange=function(b){var d=this;this.keyup(function(a){e.getRangeObject();b(a)});this.dblclick(function(a){b(a)});this.mousedown(function(){d.selectionStarted=!0});a(document).mouseup(function(a){e.eventOriginalTarget=d;d.selectionStarted&&b(a);e.eventOriginalTarget=!1;d.selectionStarted=!1});return this};a.fn.outerHtml=a.fn.outerHtml||function(){var b=a(this).get(0);if("undefined"!=typeof b.outerHTML)return b.outerHTML;try{return(new f).serializeToString(b)}catch(d){try{return b.xml}catch(k){}}};
a.fn.zap=function(){return this.each(function(){a(this.childNodes).insertBefore(this)}).remove()};a.fn.textNodes=function(b,d){var f=[],c=function(e){var j,o;if(3===e.nodeType&&a.trim(e.data)&&!d||3===e.nodeType&&d||"BR"==e.nodeName&&!b)f.push(e);else{j=0;for(o=e.childNodes.length;j<o;++j)c(e.childNodes[j])}};c(this[0]);return a(f)};a.extendObjects=a.fn.extendObjects=function(b,d){var f,c,e,j,o;f=1;var p=b||{},r=arguments.length,m=!1,x;"boolean"===typeof p&&(m=p,p=d||{},f=2);"object"!==typeof p&&
!a.isFunction(p)&&(p={});r===f&&(p=this,--f);for(x=f;x<r;x++)if(null!=(f=arguments[x]))for(c in f)f.hasOwnProperty(c)&&(e=p[c],j=f[c],p!==j&&(m&&j&&(a.isPlainObject(j)||!0===(o=a.isArray(j)))?(o?(o=!1,e=e&&a.isArray(e)?e:[]):e=e&&a.isPlainObject(e)?e:{},p[c]=a.isArray(j)?j:a.extendObjects(m,e,j)):void 0!==j&&(p[c]=j)));return p};a.expr[":"].hasScroll=function(b,d,f){if(!b.style)return!1;var d=a(b),c=d.css("overflow-x"),e=d.css("overflow-y");if(f=f[3])if("x"===f){if("hidden"===c||"visible"===c)return!1;
if("scroll"===c)return!0}else{if("y"===f){if("hidden"===e||"visible"===e)return!1;if("scroll"===e)return!0}}else{if(c===e&&("hidden"===e||"visible"===e))return!1;if("scroll"===c||"scroll"===e)return!0}return d.innerHeight()<b.scrollHeight||d.innerWidth()<b.scrollWidth};a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",
45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",188:",",190:".",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]=
{add:b}})});define("aloha/sidebar",["aloha/core","jquery","aloha/selection","PubSub"],function(m,e,a,j){var d=+new Date;e.easing.easeOutExpo||e.extend(e.easing,{easeOutExpo:function(a,b,d,g,f){return b==f?d+g:g*(-Math.pow(2,-10*b/f)+1)+d},easeOutElastic:function(a,b,d,g,f){var a=Math,k=1.70158,l=0,e=g;if(!b)return d;if(1==(b/=f))return d+g;l||(l=0.3*f);e<a.abs(g)?(e=g,k=l/4):k=l/(2*a.PI)*a.asin(g/e);return e*a.pow(2,-10*b)*a.sin((b*f-k)*2*a.PI/l)+g+d}});var b=function(a){this.id=null;this.folds={};
this.button=null;this.title=e('<div class="aloha-sidebar-panel-title"><span class="aloha-sidebar-panel-title-arrow"></span><span class="aloha-sidebar-panel-title-text">Untitled</span></div>');this.content=e('<div class="aloha-sidebar-panel-content"><div class="aloha-sidebar-panel-content-inner"><div class="aloha-sidebar-panel-content-inner-text"></div></div></div>');this.effectiveElement=this.element=null;this.expanded=!1;this.isActive=!0;this.init(a)},f=function(a){var b=this;this.id="aloha-sidebar-"+
++d;this.panels={};this.container=e('<div class="aloha-ui aloha-sidebar-bar"><div class="aloha-sidebar-handle"><span class="aloha-sidebar-handle-icon"></span></div><div class="aloha-sidebar-inner"><ul class="aloha-sidebar-panels"></ul></div></div>');this.width=300;this.isCompletelyOpen=this.isOpen=this.opened=!1;this.settings={rotateIcons:!m.browser.msie,overlayPage:!0};e(function(){"undefined"!==typeof m.settings.sidebar&&m.settings.sidebar.disabled||b.init(a)})},l=null,g=null;e.extend(f.prototype,
{init:function(a){var b=this,d;"object"===typeof a&&(d=a.panels,delete a.panels);e.extend(this,a);"object"===typeof d&&e.each(d,function(){b.addPanel(this,true)});a=this.container;"right"===this.position&&a.addClass("aloha-sidebar-right");a.hide().appendTo(e("body")).click(function(){b.barClicked.apply(b,arguments)}).find(".aloha-sidebar-panels").width(this.width);a.width(this.width);this.width=a.width();this.updateHeight();this.initToggler();this.container.css("right"===this.position?"marginRight":
"marginLeft",-this.width);this.opened&&this.open(0);this.toggleHandleIcon(this.isOpen);this.subscribeToEvents();e(window).resize(function(){b.updateHeight();b.correctHeight()});this.correctHeight()},show:function(){this.container.css("display","block");return this},hide:function(){this.container.css("display","none");return this},checkActivePanels:function(a){var b=[];if("undefined"!==typeof a&&"undefined"!==typeof a.markupEffectiveAtStart){var d=a.markupEffectiveAtStart.length,g;for(g=0;g<d;++g)b.push(e(a.markupEffectiveAtStart[g]))}var f=
this;e.each(this.panels,function(){f.showActivePanel(this,b)});this.correctHeight()},subscribeToEvents:function(){var a=this;j.sub("aloha.selection.context-change",function(b){a.isOpen&&a.checkActivePanels(b.range);a.lastRange=b.range});m.bind("aloha-editable-deactivated",function(){a.isOpen&&a.checkActivePanels();a.lastRange=null});this.container.mousedown(function(a){a.originalEvent.stopSelectionUpdate=!0;m.eventHandled=!0});this.container.mouseup(function(a){a.originalEvent.stopSelectionUpdate=
!0;m.eventHandled=!1})},correctHeight:function(){if(this.isOpen)if(this.isCompletelyOpen){var a=e(window).height(),b=[],d=[],f;for(f in this.panels)this.panels.hasOwnProperty(f)&&this.panels[f].isActive&&(d.push(this.panels[f]),b.push(f));if(0!==d.length&&(b=b.sort().join(","),!(g===b&&l===a))){l=a;g=b;for(var a=this.container.find(".aloha-sidebar-inner").height()-(d[0].title.outerHeight()+10)*d.length,k,j,m,x=0,v=Math,u;0<d.length&&0<a;){a+=x;x=0;m=[];for(u=d.length-1;0<=u;--u)b=d[u],k=b.content.find(".aloha-sidebar-panel-content-inner"),
f=v.min(k.height("auto").height(),v.floor(a/(u+1))),k.height(f),a-=f,j=k.find(".aloha-sidebar-panel-content-inner-text"),j.height()>f?(m.push(b),x+=f,k.css({"overflow-x":"hidden","overflow-y":"scroll"})):k.css("overflow-y","hidden"),b.expanded&&b.expand();d=m}}}else this.correctHeightWhenCompletelyOpen=!0},showActivePanel:function(a,b){b.push(null);a.content.parent("li");var d=a.activeOn,g=e(),f=0,k=b.length,l;for(l=0;l<k;++l)d(b[l])&&(++f,b[l]&&e.merge(g,b[l]));f?a.activate(g):a.deactivate()},initToggler:function(){var a=
this,b=this.container,d=b.find(".aloha-sidebar-handle-icon"),g,f="right"===this.position;this.opened&&this.rotateHandleArrow(f?0:180,0);e(function(){"undefined"!==typeof m.settings.sidebar&&(m.settings.sidebar.handle&&m.settings.sidebar.handle.top)&&(e(b.find(".aloha-sidebar-handle"))[0].style.top=m.settings.sidebar.handle.top)});b.find(".aloha-sidebar-handle").click(function(){g&&clearInterval(g);d.stop().css("marginLeft",4);a.isOpen?(e(this).removeClass("aloha-sidebar-toggled"),a.close(),a.isOpen=
!1):(e(this).addClass("aloha-sidebar-toggled"),a.open(),a.isOpen=!0)}).hover(function(){var b=a.isOpen?-1:1;g&&clearInterval(g);d.stop();e(this).stop().animate(f?{marginLeft:"-="+5*b}:{marginRight:"-="+5*b},200);g=setInterval(function(){b*=-1;d.animate(f?{left:"-="+4*b}:{right:"-="+4*b},300)},300)},function(){g&&clearInterval(g);d.stop().css(f?"left":"right",5);e(this).stop().animate(f?{marginLeft:0}:{marginRight:0},600,"easeOutElastic")})},roundCorners:function(){var a=this.container,b=a.find(".aloha-sidebar-panels>li:not(.aloha-sidebar-deactivated)");
a.find(".aloha-sidebar-panel-top, .aloha-sidebar-panel-bottom").removeClass("aloha-sidebar-panel-top").removeClass("aloha-sidebar-panel-bottom");b.first().find(".aloha-sidebar-panel-title").addClass("aloha-sidebar-panel-top");b.last().find(".aloha-sidebar-panel-content").addClass("aloha-sidebar-panel-bottom")},updateHeight:function(){var a=e(window).height();this.container.height(a).find(".aloha-sidebar-inner").height(a)},barClicked:function(a){this.handleBarclick(e(a.target))},handleBarclick:function(a){a.hasClass("aloha-sidebar-panel-title")?
this.togglePanel(a):!a.hasClass("aloha-sidebar-panel-content")&&(!a.hasClass("aloha-sidebar-handle")&&!a.hasClass("aloha-sidebar-bar"))&&this.handleBarclick(a.parent())},getPanelById:function(a){return this.panels[a]},getPanelByElement:function(a){return this.getPanelById(("LI"===a[0].tagName?a:a.parent("li"))[0].id)},togglePanel:function(a){this.getPanelByElement(a).toggle()},rotateHandleIcon:function(a,b){var d=this.container.find(".aloha-sidebar-handle-icon");d.animate({angle:a},{duration:"number"===
typeof b||"string"===typeof b?b:500,easing:"easeOutExpo",step:function(a){d.css({"-o-transform":"rotate("+a+"deg)","-webkit-transform":"rotate("+a+"deg)","-moz-transform":"rotate("+a+"deg)","-ms-transform":"rotate("+a+"deg)"})}})},toggleHandleIcon:function(a){a^="right"===this.position;if(this.settings.rotateIcons)this.rotateHandleIcon(a?180:0,0);else{var b=this.container.find(".aloha-sidebar-handle-icon");a?b.addClass("aloha-sidebar-handle-icon-left"):b.removeClass("aloha-sidebar-handle-icon-left")}},
open:function(a){if(this.isOpen)return this;var b="right"===this.position,d=b?{marginRight:0}:{marginLeft:0},g=this;this.toggleHandleIcon(!0);this.container.animate(d,"number"===typeof a||"string"===typeof a?a:500,"easeOutExpo");this.settings.overlayPage||e("body").animate(b?{marginRight:"+="+this.width}:{marginLeft:"+="+this.width},500,"easeOutExpo",function(){g.isCompletelyOpen=!0;g.correctHeightWhenCompletelyOpen&&g.correctHeight()});this.isOpen=!0;this.correctHeight();this.lastRange&&this.checkActivePanels(this.lastRange);
e("body").trigger("aloha-sidebar-opened",this);return this},close:function(a){if(!this.isOpen)return this;var b="right"===this.position,d=b?{marginRight:-this.width}:{marginLeft:-this.width};this.toggleHandleIcon(!1);this.container.animate(d,"number"===typeof a||"string"===typeof a?a:500,"easeOutExpo");this.settings.overlayPage||e("body").animate(b?{marginRight:"-="+this.width}:{marginLeft:"-="+this.width},500,"easeOutExpo");this.isCompletelyOpen=this.isOpen=!1;return this},activatePanel:function(a,
b){"string"===typeof a&&(a=this.getPanelById(a));a&&a.activate(b);this.roundCorners();return this},expandPanel:function(a,b){"string"===typeof a&&(a=this.getPanelById(a));a&&a.expand(b);return this},collapsePanel:function(a,b){"string"===typeof a&&(a=this.getPanelById(a));a&&a.collapse(b);return this},addPanel:function(c){c instanceof b||(c.width||(c.width=this.width),c.sidebar=this,c=new b(c));this.panels[c.id]=c;this.container.find(".aloha-sidebar-panels").append(c.element);this.checkActivePanels(a.getRangeObject());
return c}});e.extend(b.prototype,{init:function(a){this.setTitle(a.title).setContent(a.content);delete a.title;delete a.content;e.extend(this,a);this.id||(this.id="aloha-sidebar-"+ ++d);this.element=e('<li id="'+this.id+'">').append(this.title,this.content);this.expanded&&this.content.height("auto");this.toggleTitleIcon(this.expanded);this.coerceActiveOn();this.title.attr("unselectable","on").css("-moz-user-select","none").each(function(){this.onselectstart=function(){return false}});"function"===
typeof this.onInit&&this.onInit.apply(this)},toggleTitleIcon:function(a){if(this.sidebar.settings.rotateIcons)this.rotateTitleIcon(a?90:0);else{var b=this.title.find(".aloha-sidebar-panel-title-arrow");a?b.addClass("aloha-sidebar-panel-title-arrow-down"):b.removeClass("aloha-sidebar-panel-title-arrow-down")}},coerceActiveOn:function(){if("function"!==typeof this.activeOn){var a=this.activeOn;this.activeOn=function(){var b=typeof a;return"boolean"===b?function(){return a}:"undefined"===b?function(){return!0}:
"string"===b?function(b){return b?b.is(a):!1}:function(){return!1}}()}},activate:function(a){this.isActive=!0;this.content.parent("li").show().removeClass("aloha-sidebar-deactivated");this.effectiveElement=a;"function"===typeof this.onActivate&&this.onActivate.call(this,a)},deactivate:function(){this.isActive&&(this.isActive=!1,this.content.parent("li").hide().addClass("aloha-sidebar-deactivated"),this.effectiveElement=null)},toggle:function(){this.expanded?this.collapse():this.expand()},expand:function(a){var b=
this,d=this.content,g=d.height(),f=d.height("auto").height();d.height(g).stop().animate({height:f},500,"easeOutExpo",function(){"function"===typeof a&&a.call(b)});this.element.removeClass("collapsed");this.toggleTitleIcon(!0);this.expanded=!0;return this},collapse:function(a,b){var d=this;this.element.addClass("collapsed");this.content.stop().animate({height:3},250,"easeOutExpo",function(){"function"===typeof b&&b.call(d)});this.toggleTitleIcon(!1);this.expanded=!1;return this},setTitle:function(a){this.title.find(".aloha-sidebar-panel-title-text").html(a);
return this},setContent:function(a){if(!a||""===a)a="&nbsp;";this.content.find(".aloha-sidebar-panel-content-inner-text").html(a);return this},rotateTitleIcon:function(a,b){var d=this.title.find(".aloha-sidebar-panel-title-arrow");d.animate({angle:a},{duration:"number"===typeof b?b:500,easing:"easeOutExpo",step:function(a){d.css({"-o-transform":"rotate("+a+"deg)","-webkit-transform":"rotate("+a+"deg)","-moz-transform":"rotate("+a+"deg)","-ms-transform":"rotate("+a+"deg)"})}})},renderEffectiveParents:function(a,
b){for(var d=a.first(),g=[],f=[],k=this.activeOn,l,j;0<d.length&&!d.is(".aloha-editable");){if(k(d)){f.push("<span>"+d[0].tagName.toLowerCase()+"</span>");l=f.length;for(j=[];l--;)j.push(f[l]);g.push('<div class="aloha-sidebar-panel-parent"><div class="aloha-sidebar-panel-parent-path">'+j.join("")+'</div><div class="aloha-sidebar-panel-parent-contentaloha-sidebar-opened">'+("function"===typeof b?b(d):"----")+"</div></div>")}d=d.parent()}this.setContent(g.join(""));e(".aloha-sidebar-panel-parent-path").click(function(){var a=
e(this).parent().find(".aloha-sidebar-panel-parent-content");a.hasClass("aloha-sidebar-opened")?a.hide().removeClass("aloha-sidebar-opened"):a.show().addClass("aloha-sidebar-opened")});this.content.height("auto").find(".aloha-sidebar-panel-content-inner").height("auto")}});var k=new f({position:"left",width:250}),f=new f({position:"right",width:250});m.Sidebar={left:k,right:f};return m.Sidebar});window.GENTICS=window.GENTICS||{};window.GENTICS.Utils=window.GENTICS.Utils||{};define("util/position",
["jquery"],function(m){var e=window.GENTICS;e.Utils.Position={};e.Utils.Position.w=m(window);e.Utils.Position.Scroll={top:0,left:0,isScrolling:!1};e.Utils.Position.ScrollCorrection={top:100,left:50};e.Utils.Position.Mouse={x:0,y:0,oldX:0,oldY:0,isMoving:!1,triggeredMouseStop:!0};e.Utils.Position.mouseStopCallbacks=[];e.Utils.Position.mouseMoveCallbacks=[];e.Utils.Position.update=function(){var a=this.w.scrollTop(),e=this.w.scrollLeft();if(this.Scroll.isScrolling)this.Scroll.top==a&&this.Scroll.left==
e&&(this.Scroll.isScrolling=!1);else if(this.Scroll.top!=a||this.Scroll.left!=e)this.Scroll.isScrolling=!0;this.Scroll.top=a;this.Scroll.left=e;if(this.Mouse.x==this.Mouse.oldX&&this.Mouse.y==this.Mouse.oldY){if(this.Mouse.isMoving=!1,!this.Mouse.triggeredMouseStop){this.Mouse.triggeredMouseStop=!0;for(a=0;a<this.mouseStopCallbacks.length;a++)this.mouseStopCallbacks[a].call()}}else{this.Mouse.isMoving=!0;this.Mouse.triggeredMouseStop=!1;for(a=0;a<this.mouseMoveCallbacks.length;a++)this.mouseMoveCallbacks[a].call()}this.Mouse.oldX=
this.Mouse.x;this.Mouse.oldY=this.Mouse.y};e.Utils.Position.addMouseStopCallback=function(a){this.mouseStopCallbacks.push(a);return this.mouseStopCallbacks.length-1};e.Utils.Position.addMouseMoveCallback=function(a){this.mouseMoveCallbacks.push(a);return this.mouseMoveCallbacks.length-1};m(function(){window.setInterval(function(){e.Utils.Position.update()},500)});m("html").mousemove(function(a){e.Utils.Position.Mouse.x=a.pageX;e.Utils.Position.Mouse.y=a.pageY})});define("aloha/repositoryobjects",
["aloha/core","util/class"],function(m,e){var a=window.GENTICS;m.RepositoryObject=function(){};m.RepositoryDocument=e.extend({_constructor:function(e){this.type="document";e.id&&(e.name&&e.repositoryId)&&(a.Utils.applyProperties(this,e),this.baseType="document")}});m.RepositoryFolder=e.extend({_constructor:function(e){this.type="folder";e.id&&(e.name&&e.repositoryId)&&(a.Utils.applyProperties(this,e),this.baseType="folder")}})});define("aloha/repositorymanager",["jquery","util/class","aloha/core",
"aloha/console","aloha/repositoryobjects"],function(m,e,a,j){function d(a,b){var d={items:a,results:a.length};b&&(d.numItems=b.numItems,d.hasMoreItems=b.hasMoreItems,d.timeout=b.timeout);return d}function b(a,b){a(b)}var f=function(a){return a?function(a,c){return a.filter(c)}:function(a,c){var b=[],d,g=a.length;for(d=0;d<g;d++)c(a[d])&&b.push(a[d]);return b}}(Array.prototype.hasOwnProperty("filter")),l=function(a){return"function"===typeof a.query},g=function(a){return"function"===typeof a.getChildren},
k=function(a){return"function"===typeof a.getSelectedFolder},e=e.extend({repositories:[],settings:a.settings&&a.settings.repositories||{},initialized:!1,init:function(){"undefined"===typeof this.settings.timeout&&(this.settings.timeout=5E3);var a;for(a=0;a<this.repositories.length;a++)this.initRepository(this.repositories[a]);this.initialized=!0},register:function(a){this.getRepository(a.repositoryId)?j.warn(this,'A repository with name "'+a.repositoryId+'" already registerd. Ignoring this.'):(this.repositories.push(a),
this.initialized&&this.initRepository(a))},initRepository:function(a){a.settings||(a.settings={});this.settings[a.repositoryId]&&m.extend(a.settings,this.settings[a.repositoryId]);a.init()},getRepository:function(a){var b;for(b=0;b<this.repositories.length;b++)if(this.repositories[b].repositoryId===a)return this.repositories[b];return null},query:function(a,g){var k=this,e,p=[],r={numItems:0,hasMoreItems:!1},t,x=a.timeout&&parseInt(a.timeout,10)||k.settings.timeout,v=window.setTimeout(function(){r=
r||{};r.timeout=!0;0<t&&(j.warn(k,t+" repositories did not return before the configured timeout of "+x+"ms."),t=0);clearTimeout(v);var a=d(p,r);g(a)},x),u=function(a,c){if(0!==t){if(a&&a.length){if(!a[0].repositoryId){var b=this.repositoryId,f;for(f=0;f<a.length;f++)a[f].repositoryId=b}m.merge(p,a)}c&&r?(r.numItems=m.isNumeric(c.numItems)&&m.isNumeric(r.numItems)?r.numItems+c.numItems:void 0,r.hasMoreItems="boolean"===typeof c.hasMoreItems&&"boolean"===typeof r.hasMoreItems?r.hasMoreItems||c.hasMoreItems:
void 0,c.timeout&&(r.timeout=!0)):r=void 0;j.debug(k,"The repository "+this.repositoryId+"returned with "+a.length+" results.");0===--t&&(clearTimeout(v),b=d(p,r),g(b))}};e=a.repositoryId?[k.getRepository(a.repositoryId)]:k.repositories;var z=f(e,l);if(0===z.length)clearTimeout(v),b(g,d(p,r));else{var C=function(a){return function(){u.apply(a,arguments)}};t=z.length;for(e=0;e<z.length;e++)z[e].query(a,C(z[e]))}},getChildren:function(c,b){var d=this,k,l=[],e=0,t=c.timeout&&parseInt(c.timeout,10)||
d.settings.timeout,x=window.setTimeout(function(){0<e&&(j.warn(d,e+" repositories did not respond before the configured timeout of "+t+"ms."),e=0);clearTimeout(x);b(l)},t),v=function(a){0!==e&&(a&&m.merge(l,a),0===--e&&(clearTimeout(x),b(l)))},u=c.repositoryId?[d.getRepository(c.repositoryId)]:d.repositories;c.repositoryFilter&&c.repositoryFilter.length&&(u=f(u,function(a){return-1<m.inArray(a.repositoryId,c.repositoryFilter)}));if("aloha"===c.inFolderId){for(k=0;k<u.length;k++)l.push(new a.RepositoryFolder({id:u[k].repositoryId,
name:u[k].repositoryName,repositoryId:u[k].repositoryId,type:"repository",hasMoreItems:!0}));clearTimeout(x);b(l)}else if(u=f(u,g),0===u.length)clearTimeout(x),b(l);else{e=u.length;for(k=0;k<u.length;k++)u[k].getChildren(c,v)}},makeClean:function(a){var b=this,d={},g=0,f=b.repositories.length;a.find("[data-gentics-aloha-repository="+this.prefix+"]").each(function(){for(;g<f;)d.makeClean(a),g+=1;j.debug(b,"Passing contents of HTML Element with id { "+this.attr("id")+" } for cleaning to repository { "+
d.repositoryId+" }");d.makeClean(this)})},markObject:function(a,b){if(a){var d=m(a);if(b){var g=this.getRepository(b.repositoryId);if(g){if(d.attr("data-gentics-aloha-repository")!==b.repositoryId||d.attr("data-gentics-aloha-object-id")!==b.id)d.attr({"data-gentics-aloha-repository":b.repositoryId,"data-gentics-aloha-object-id":b.id}),g.markObject(a,b)}else j.error(this,'Trying to apply a repository "'+b.name+'" to an object, but item has no repositoryId.')}else d.removeAttr("data-gentics-aloha-repository").removeAttr("data-gentics-aloha-object-id")}},
getObject:function(a,b){var d=m(a),g=d.attr("data-gentics-aloha-object-id"),d=d.attr("data-gentics-aloha-repository"),f=this.getRepository(d);if(f&&g){this.itemCache||(this.itemCache=[]);var k=this.itemCache[d];k||(k=this.itemCache[d]=[]);k[g]?b([k[g]]):f.getObjectById(g,function(a){k[g]=a[0];b(a)})}},folderOpened:function(a){var b=this.getRepository(a.repositoryId);"function"===typeof b.folderOpened&&b.folderOpened(a)},folderClosed:function(a){var b=this.getRepository(a.repositoryId);"function"===
typeof b.folderClosed&&b.folderClosed(a)},folderSelected:function(a){var b=this.getRepository(a.repositoryId);"function"===typeof b.folderSelected&&b.folderSelected(a)},getSelectedFolder:function(){var a=f(this.repositories,k),b,d;for(b=0;b<a.length;b++)if(d=a[b].getSelectedFolder())return d;return null},toString:function(){return"repositorymanager"}});a.RepositoryManager=new e;return a.RepositoryManager});define("aloha/repository",["aloha/core","util/class","aloha/repositorymanager"],function(m,
e,a){e=e.extend({_constructor:function(e,d){this.repositoryId=e;this.settings={};this.repositoryName=d||e;a.register(this)},init:function(){},query:null,getChildren:null,makeClean:function(){},markObject:function(){},setTemplate:function(a){this.template=a?a:null},hasTemplate:function(){return this.template?!0:!1},getTemplate:function(){return this.template},getObjectById:function(){return!0}});return m.AbstractRepository=e});(function(m){function e(){var a,b,c=Aloha.settings.plugins&&Aloha.settings.plugins.load,
d=Aloha.settings.baseUrl,f,l=/\/aloha.js(\?\S*)?$/,e=/\/[^\/]*\.js$/,j;if(!c||!d){a=document.getElementsByTagName("script");for(j=0;j<a.length;j++){b=a[j];f=b.getAttribute("data-aloha-plugins");if(null!=f){c||(c=f);d||(d=b.src.replace(e,""));break}!d&&l.test(b.src)&&(d=b.src.replace(l,""))}}"string"===typeof c&&""!==c&&(c=c.replace(/\s+/g,"").split(","));return{baseUrl:d,plugins:c||[]}}function a(){for(var a=document.getElementsByTagName("script"),b=0;b<a.length;b++)if("true"===a[b].getAttribute("data-aloha-defer-init"))return!0;
return!1}function j(a){var b={},c=[],d={},f={},l,e,j=Aloha.settings.basePath||"",m=Aloha.settings.bundles||{},x;for(x=0;x<a.length;x++){l=a[x].split("/");e=l[0];l=l[1];e=m[e]?j+m[e]:j+"../plugins/"+e;var v=b,u=e,z=l,C=["nls","css","vendor","res"],F=void 0,A=void 0;v[z]=u+"/"+z+"/lib";for(A=0;A<C.length;A++)F=C[A],v[z+"/"+F]=u+"/"+z+"/"+F;d[l]=e+"/"+l;c.push(l+"/"+l+"-plugin");f[l]={jquery:"aloha/jquery"}}return{paths:b,entryPoints:c,baseUrlByName:d,names:[],map:f}}function d(){var a={},b=Array.prototype.slice.call(arguments),
c,d,f;for(d=0;d<b.length;d++)for(c in f=b[d],f)f.hasOwnProperty(c)&&(a[c]=b[d][c]);return a}function b(a,b){define(a,function(){return b})}function f(){Aloha.features={};Aloha.defaults={};Aloha.settings=Aloha.settings||{};Aloha.initialize=l.start;var a=e(),f=j(a.plugins);Aloha.settings.baseUrl=a.baseUrl;Aloha.settings.loadedPlugins=f.names;Aloha.settings._pluginBaseUrlByName=f.baseUrlByName;var a=d({aloha:{jquery:"aloha/jquery"},"aloha/jquery":{jquery:"jquery"},jqueryui:{jquery:"aloha/jquery"},vendor:{jquery:"aloha/jquery"},
util:{jquery:"aloha/jquery"},RepositoryBrowser:{jquery:"aloha/jquery"},jstree:{jquery:"aloha/jquery"},jqgrid:{jquery:"aloha/jquery"},"jqgrid-locale-en":{jquery:"aloha/jquery"},"jqgrid-locale-de":{jquery:"aloha/jquery"},"jquery-layout":{jquery:"aloha/jquery"}},f.map),c=d({context:"aloha",config:{i18n:{locale:Aloha.settings.locale||"en"}},baseUrl:Aloha.settings.baseUrl,map:a},Aloha.settings.requireConfig);c.paths=d({jquery:"vendor/jquery-1.7.2",jqueryui:"vendor/jquery-ui-1.9.0.custom-aloha"},{PubSub:"vendor/pubsub/js/pubsub-unminified",
Class:"vendor/class",RepositoryBrowser:"vendor/repository-browser/js/repository-browser-unminified",jstree:"vendor/jquery.jstree",jqgrid:"vendor/jquery.jqgrid","jquery-layout":"vendor/jquery.layout-1.3.0-rc29.14","jqgrid-locale-en":"vendor/grid.locale.en","jqgrid-locale-de":"vendor/grid.locale.de","repository-browser-i18n-de":"vendor/repository-browser/js/repository-browser-unminified","repository-browser-i18n-en":"vendor/repository-browser/js/repository-browser-unminified"},f.paths,c.paths);a=Aloha.settings.predefinedModules||
{};Aloha.settings.jQuery&&(a.jquery=Aloha.settings.jQuery);for(var q in a)a.hasOwnProperty(q)&&(b(q,a[q]),delete c.paths[q]);var n=require.config(c);Aloha.require=function(a){return 1===arguments.length&&typeof a==="function"?n(["aloha"],a):n.apply(this,arguments)};Aloha.bind=function(a,c){Aloha.require(["aloha/jquery"],function(b){Aloha.bind=function(a,c){switch(l.getReadiness(a)){case "deferred":var d=l.getPhaseByEvent(a);if(!d.deferred)d.deferred=b.Deferred();d.deferred.done(c);break;case "immediate":c();
break;case "normal":b(Aloha,"body").bind(a,c);break;default:throw"Unknown readiness";}return this};Aloha.bind(a,c)});return this};Aloha.trigger=function(a,c){Aloha.require(["aloha/jquery"],function(b){Aloha.trigger=function(a,c){var d=l.getPhaseByEvent(a);if(d&&d.deferred){b(d.deferred.resolve);d.deferred=null}b(Aloha,"body").trigger(a,c);return this};Aloha.trigger(a,c)});return this};Aloha.unbind=function(a){Aloha.require(["aloha/jquery"],function(c){Aloha.unbind=function(a){c(Aloha,"body").unbind(a)};
Aloha.unbind(a)})};Aloha.ready=function(a){this.bind("aloha-ready",a);return this};var o=Aloha.settings.jQuery;define("aloha/jquery",["jquery"],function(a){return o||a});Aloha.jQuery=o;define("aloha","aloha/jquery util/json2 aloha/rangy-core util/class util/lang util/range util/dom aloha/core aloha/editable aloha/console aloha/markup aloha/plugin aloha/selection aloha/command aloha/jquery.aloha aloha/sidebar util/position aloha/repositorymanager aloha/repository aloha/repositoryobjects aloha/contenthandlermanager".split(" "),
function(a){Aloha.features.jquery=true;Aloha.jQuery=a;Aloha.settings=a.extendObjects(true,{},Aloha.defaults,Aloha.settings);return Aloha});require(c,["aloha","aloha/jquery"],function(a,b){require(c,f.entryPoints,function(){b(function(){window.rangy.init();a.init()})})})}var l={phases:[],completed:[],start:function(a,b){l.phases=l.phases.concat(a);l.proceed(0,a,b)},proceed:function(a,b,c){if(a<b.length){var d=b[a],f=function(){l.proceed(++a,b,c)},e=function(){l.completed.push(d);d.event&&Aloha.trigger(d.event)};
d.fn?d.fn(e,f):(e(),f())}else c&&c()},getPhaseByEvent:function(a){var b;for(b=0;b<l.phases.length;b++)if(a===l.phases[b].event)return l.phases[b];return null},getReadiness:function(a){var b;for(b=0;b<l.completed.length;b++)if(a===l.completed[b].event)return"immediate";return l.getPhaseByEvent(a)?"deferred":"normal"}};m.Aloha=m.Aloha||{};m.Aloha.settings=m.Aloha.settings||{};m.__DEPS__=m.__DEPS__||{};m.__DEPS__.lang=m.Aloha.settings.locale||"en";m.Aloha.deferInit||a()?m.Aloha.deferInit=f:Aloha._load=
f})(window);define("ui/context",["aloha","jquery","util/class"],function(m,e,a){var j;j=e("#aloha-ui-context");j.length||(j=e("<div>",{"class":"aloha",id:"aloha-ui-context"}),e(function(){j.appendTo("body")}));m=a.extend({surfaces:[],containers:[]});e.extend(m,{selector:"#aloha-ui-context",element:j});return m});define("ui/scopes",["jquery","PubSub","util/maps"],function(m,e,a){function j(a,c){if(d.hasOwnProperty(c))for(var b=d[c],g=0;g<b.length;g++){var f=b[g];a.push(f);j(a,f)}}var d={"Aloha.empty":[],
"Aloha.global":["Aloha.empty"],"Aloha.continuoustext":["Aloha.global"]},b=[],f={},l=!1;Aloha.bind("aloha-selection-changed-before",function(){l=!1});Aloha.bind("aloha-selection-changed-after",function(a,c,b){"undefined"!==typeof b&&!l&&g.setScope("Aloha.continuoustext")});var g={enterScope:function(a,c){var c=c||"_globalCounter",b=f[a];b||(b=f[a]={});var d=b[c]||0;b[c]=d+1;d||e.pub("aloha.ui.scope.change")},leaveScope:function(b,c,d){var c=c||"_globalCounter",g=f[b];if(g){var l=g[c];l&&((l-=1)&&!d?
g[c]=l:(delete g[c],a.isEmpty(g)&&delete f[b],e.pub("aloha.ui.scope.change")))}},isActiveScope:function(a){return f[a]||-1!==m.inArray(a,b)?!0:!1},getPrimaryScope:function(){return b[0]},setScope:function(a){l=!0;b[0]!=a&&(b=[a],j(b,a),e.pub("aloha.ui.scope.change"))},createScope:function(a,c){c?"string"===typeof c&&(c=[c]):c=["Aloha.empty"];d[a]=c}};return g});define("ui/container",["jquery","util/class","ui/scopes"],function(m,e,a){function j(d,g){switch(m.type(g)){case "function":return g;case "object":if(g.scope)return b[g.scope]?
b[g.scope]:b[g.scope]=function(){return a.isActiveScope(g.scope)};throw"Invalid showOn configuration";default:return f}}var d=0,b={},f=function(){return!0},e=e.extend({element:null,_constructor:function(a,b){var f=j(this,b.showOn),c;f.showOnId||(f.showOnId=++d);c=f.showOnId;var e=a.containers[c];this.context=a;e||(e=a.containers[c]={shouldShow:f,containers:[]});e.containers.push(this)},show:function(){},hide:function(){},focus:function(){},foreground:function(){},childVisible:function(){},childFocus:function(){},
childForeground:function(){}});m.extend(e,{showContainersForContext:function(a,b){var d,c,f;if(a.containers)for(c in f=a.containers,f)if(f.hasOwnProperty(c)){d=f[c];var e=d.containers;d=d.shouldShow(b)?"show":"hide";for(var j=void 0,j=0;j<e.length;j++)e[j][d]()}}});return e});define("ui/surface",["aloha/core","jquery","util/class","ui/container"],function(m,e,a){var j=a.extend({_constructor:function(a){a.surfaces.push(this)},isActive:function(){return!0}});e.extend(j,{range:null,show:function(a){e.each(a.surfaces,
function(a,d){d.show()})},hide:function(a){e.each(a.surfaces,function(a,d){d.hide()})},trackRange:function(a){a.bind("mousedown",function(a){a.originalEvent.stopSelectionUpdate=!0;m.eventHandled=!0;j.suppressHide=!0;m.activeEditable&&(a=m.getSelection(),j.range=0<a.getRangeCount()?a.getRangeAt(0):null)});a.bind("mouseup",function(a){a.originalEvent.stopSelectionUpdate=!0;m.eventHandled=!1;j.suppressHide=!1})}});return j});define("ui/component",["aloha/core","jquery","util/class"],function(m,e,a){var j=
0;return a.extend({id:0,isInstance:!0,container:null,type:null,visible:!0,_constructor:function(){this.id=j++;this.init()},adoptParent:function(a){this.container=a},init:function(){},isVisible:function(){return this.visible},show:function(a){!1===a?this.hide():this.visible||(this.visible=!0,this.element.show(),this.container&&this.container.childVisible(this,!0))},hide:function(){this.visible&&(this.visible=!1,this.element.hide(),this.container&&this.container.childVisible(this,!1))},focus:function(){this.element.focus();
this.container&&this.container.childFocus(this)},foreground:function(){this.container&&this.container.childForeground(this)},enable:function(){},disable:function(){}})});define("jqueryui",["jquery"],function(m){(function(e,a){function j(a,b){var f,c;f=a.nodeName.toLowerCase();if("area"===f){f=a.parentNode;c=f.name;if(!a.href||!c||"map"!==f.nodeName.toLowerCase())return!1;f=e("img[usemap=#"+c+"]")[0];return!!f&&d(f)}return(/input|select|textarea|button|object/.test(f)?!a.disabled:"a"===f?a.href||b:
b)&&d(a)}function d(a){return!e(a).parents().andSelf().filter(function(){return"hidden"===e.css(this,"visibility")||e.expr.filters.hidden(this)}).length}var b=0,f=/^ui-id-\d+$/;e.ui=e.ui||{};e.ui.version||(e.extend(e.ui,{version:"1.9.0",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),
e.fn.extend({_focus:e.fn.focus,focus:function(a,b){return"number"===typeof a?this.each(function(){var d=this;setTimeout(function(){e(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=Aloha.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+
e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?e(document):a},zIndex:function(b){if(b!==a)return this.css("zIndex",b);if(this.length)for(var b=e(this[0]),d;b.length&&b[0]!==document;){d=b.css("position");if("absolute"===d||"relative"===d||"fixed"===d)if(d=parseInt(b.css("zIndex"),10),!isNaN(d)&&0!==d)return d;b=b.parent()}return 0},
uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++b)})},removeUniqueId:function(){return this.each(function(){f.test(this.id)&&e(this).removeAttr("id")})}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(b,d){function f(a,b,d,g){e.each(c,function(){b-=parseFloat(e.css(a,"padding"+this))||0;d&&(b-=parseFloat(e.css(a,"border"+this+"Width"))||0);g&&(b-=parseFloat(e.css(a,"margin"+this))||0)});return b}var c="Width"===d?["Left","Right"]:["Top","Bottom"],
j=d.toLowerCase(),n={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+d]=function(c){return c===a?n["inner"+d].call(this):this.each(function(){e(this).css(j,f(this,c)+"px")})};e.fn["outer"+d]=function(a,c){return"number"!==typeof a?n["outer"+d].call(this,a):this.each(function(){e(this).css(j,f(this,a,!0,c)+"px")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(a){return function(b){return!!e.data(b,
a)}}):function(a,b,d){return!!e.data(a,d[3])},focusable:function(a){return j(a,!isNaN(e.attr(a,"tabindex")))},tabbable:function(a){var b=e.attr(a,"tabindex"),d=isNaN(b);return(d||0<=b)&&j(a,!d)}}),e(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));b.offsetHeight;e.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});e.support.minHeight=100===b.offsetHeight;e.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"}),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?
"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(a,b,d){var c,a=e.ui[a].prototype;for(c in d)a.plugins[c]=a.plugins[c]||[],a.plugins[c].push([b,d[c]])},call:function(a,b,d){var c=a.plugins[b];if(c&&a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType)for(b=0;b<c.length;b++)a.options[c[b][0]]&&c[b][1].apply(a.element,d)}},contains:e.contains,hasScroll:function(a,
b){if("hidden"===e(a).css("overflow"))return!1;var d=b&&"left"===b?"scrollLeft":"scrollTop",c=!1;if(0<a[d])return!0;a[d]=1;c=0<a[d];a[d]=0;return c},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,c,f,j){return e.ui.isOverAxis(a,d,f)&&e.ui.isOverAxis(b,c,j)}}))})(m);(function(e,a){var j=0,d=Array.prototype.slice,b=e.cleanData;e.cleanData=function(a){for(var d=0,g;null!=(g=a[d]);d++)try{e(g).triggerHandler("remove")}catch(k){}b(a)};e.widget=function(a,b,d){var k,c,j,n,o=a.split(".")[0],
a=a.split(".")[1];k=o+"-"+a;d||(d=b,b=e.Widget);e.expr[":"][k.toLowerCase()]=function(a){return!!e.data(a,k)};e[o]=e[o]||{};c=e[o][a];j=e[o][a]=function(a,b){if(!this._createWidget)return new j(a,b);arguments.length&&this._createWidget(a,b)};e.extend(j,c,{version:d.version,_proto:e.extend({},d),_childConstructors:[]});n=new b;n.options=e.widget.extend({},n.options);e.each(d,function(a,c){e.isFunction(c)&&(d[a]=function(){var d=function(){return b.prototype[a].apply(this,arguments)},g=function(c){return b.prototype[a].apply(this,
c)};return function(){var a=this._super,b=this._superApply,f;this._super=d;this._superApply=g;f=c.apply(this,arguments);this._super=a;this._superApply=b;return f}}())});j.prototype=e.widget.extend(n,{widgetEventPrefix:a},d,{constructor:j,namespace:o,widgetName:a,widgetBaseClass:k,widgetFullName:k});c?(e.each(c._childConstructors,function(a,b){var c=b.prototype;e.widget(c.namespace+"."+c.widgetName,j,b._proto)}),delete c._childConstructors):b._childConstructors.push(j);e.widget.bridge(a,j)};e.widget.extend=
function(b){for(var l=d.call(arguments,1),g=0,k=l.length,c,j;g<k;g++)for(c in l[g])j=l[g][c],l[g].hasOwnProperty(c)&&j!==a&&(b[c]=e.isPlainObject(j)?e.widget.extend({},b[c],j):j);return b};e.widget.bridge=function(b,l){var g=l.prototype.widgetFullName;e.fn[b]=function(k){var c="string"===typeof k,j=d.call(arguments,1),n=this,k=!c&&j.length?e.widget.extend.apply(null,[k].concat(j)):k;c?this.each(function(){var c,d=e.data(this,g);if(!d)return e.error("cannot call methods on "+b+" prior to initialization; attempted to call method '"+
k+"'");if(!e.isFunction(d[k])||"_"===k.charAt(0))return e.error("no such method '"+k+"' for "+b+" widget instance");c=d[k].apply(d,j);if(c!==d&&c!==a)return n=c&&c.jquery?n.pushStack(c.get()):c,!1}):this.each(function(){var a=e.data(this,g);a?a.option(k||{})._init():new l(k,this)});return n}};e.Widget=function(){};e.Widget._childConstructors=[];e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(a,b){b=e(b||this.defaultElement||
this)[0];this.element=e(b);this.uuid=j++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=e.widget.extend({},this.options,this._getCreateOptions(),a);this.bindings=e();this.hoverable=e();this.focusable=e();b!==this&&(e.data(b,this.widgetName,this),e.data(b,this.widgetFullName,this),this._on({remove:"destroy"}),this.document=e(b.style?b.ownerDocument:b.document||b),this.window=e(this.document[0].defaultView||this.document[0].parentWindow));this._create();this._trigger("create",null,this._getCreateEventData());
this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},
_destroy:e.noop,widget:function(){return this.element},option:function(b,d){var g=b,k,c,j;if(0===arguments.length)return e.widget.extend({},this.options);if("string"===typeof b)if(g={},k=b.split("."),b=k.shift(),k.length){c=g[b]=e.widget.extend({},this.options[b]);for(j=0;j<k.length-1;j++)c[k[j]]=c[k[j]]||{},c=c[k[j]];b=k.pop();if(d===a)return c[b]===a?null:c[b];c[b]=d}else{if(d===a)return this.options[b]===a?null:this.options[b];g[b]=d}this._setOptions(g);return this},_setOptions:function(a){for(var b in a)this._setOption(b,
a[b]);return this},_setOption:function(a,b){this.options[a]=b;"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!b).attr("aria-disabled",b),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"));return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(a,b){b?(a=e(a),this.bindings=this.bindings.add(a)):(b=a,a=this.element);var d=this;e.each(b,
function(b,c){function l(){if(!(d.options.disabled===true||e(this).hasClass("ui-state-disabled")))return(typeof c==="string"?d[c]:c).apply(d,arguments)}if(typeof c!=="string")l.guid=c.guid=c.guid||l.guid||e.guid++;var j=b.match(/^(\w+)\s*(.*)$/),o=j[1]+d.eventNamespace;(j=j[2])?d.widget().delegate(j,o,l):a.bind(o,l)})},_off:function(a,b){b=(b||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;a.unbind(b).undelegate(b)},_delay:function(a,b){var d=this;return setTimeout(function(){return("string"===
typeof a?d[a]:a).apply(d,arguments)},b||0)},_hoverable:function(a){this.hoverable=this.hoverable.add(a);this._on(a,{mouseenter:function(a){e(a.currentTarget).addClass("ui-state-hover")},mouseleave:function(a){e(a.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(a){this.focusable=this.focusable.add(a);this._on(a,{focusin:function(a){e(a.currentTarget).addClass("ui-state-focus")},focusout:function(a){e(a.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(a,b,d){var k,
c=this.options[a],d=d||{},b=e.Event(b);b.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();b.target=this.element[0];if(a=b.originalEvent)for(k in a)k in b||(b[k]=a[k]);this.element.trigger(b,d);return!(e.isFunction(c)&&!1===c.apply(this.element[0],[b].concat(d))||b.isDefaultPrevented())}};e.each({show:"fadeIn",hide:"fadeOut"},function(a,b){e.Widget.prototype["_"+a]=function(d,k,c){"string"===typeof k&&(k={effect:k});var j,n=!k?a:!0===k||"number"===typeof k?b:k.effect||b,k=
k||{};"number"===typeof k&&(k={duration:k});j=!e.isEmptyObject(k);k.complete=c;k.delay&&d.delay(k.delay);if(j&&e.effects&&(e.effects.effect[n]||!1!==e.uiBackCompat&&e.effects[n]))d[a](k);else if(n!==a&&d[n])d[n](k.duration,k.easing,c);else d.queue(function(b){e(this)[a]();c&&c.call(d[0]);b()})}});!1!==e.uiBackCompat&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})})(m);(function(e){var a=!1;e(document).mouseup(function(){a=!1});
e.widget("ui.mouse",{version:"1.9.0",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(d){return a._mouseDown(d)}).bind("click."+this.widgetName,function(d){if(!0===e.data(d.target,a.widgetName+".preventClickEvent"))return e.removeData(d.target,a.widgetName+".preventClickEvent"),d.stopImmediatePropagation(),!1});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);
this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(j){if(!a){this._mouseStarted&&this._mouseUp(j);this._mouseDownEvent=j;var d=this,b=1===j.which,f="string"===typeof this.options.cancel&&j.target.nodeName?e(j.target).closest(this.options.cancel).length:!1;if(!b||f||!this._mouseCapture(j))return!0;this.mouseDelayMet=!this.options.delay;this.mouseDelayMet||(this._mouseDelayTimer=
setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)&&(this._mouseStarted=!1!==this._mouseStart(j),!this._mouseStarted))return j.preventDefault(),!0;!0===e.data(j.target,this.widgetName+".preventClickEvent")&&e.removeData(j.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(a){return d._mouseMove(a)};this._mouseUpDelegate=function(a){return d._mouseUp(a)};e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+
this.widgetName,this._mouseUpDelegate);j.preventDefault();return a=!0}},_mouseMove:function(a){if(Aloha.browser.msie&&!(9<=document.documentMode)&&!a.button)return this._mouseUp(a);if(this._mouseStarted)return this._mouseDrag(a),a.preventDefault();this._mouseDistanceMet(a)&&this._mouseDelayMet(a)&&((this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,a))?this._mouseDrag(a):this._mouseUp(a));return!this._mouseStarted},_mouseUp:function(a){e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+
this.widgetName,this._mouseUpDelegate);this._mouseStarted&&(this._mouseStarted=!1,a.target===this._mouseDownEvent.target&&e.data(a.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(a));return!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(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(m);
(function(e,a){function j(a,b,c){return[parseInt(a[0],10)*(o.test(a[0])?b/100:1),parseInt(a[1],10)*(o.test(a[1])?c/100:1)]}function d(a,b){return parseInt(e.css(a,b),10)||0}e.ui=e.ui||{};var b,f=Math.max,l=Math.abs,g=Math.round,k=/left|center|right/,c=/top|center|bottom/,q=/[\+\-]\d+%?/,n=/^\w+/,o=/%$/,p=e.fn.position;e.position={scrollbarWidth:function(){if(b!==a)return b;var c,d,g=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>");
d=g.children()[0];e("body").append(g);c=d.offsetWidth;g.css("overflow","scroll");d=d.offsetWidth;c===d&&(d=g[0].clientWidth);g.remove();return b=c-d},getScrollInfo:function(a){var b=a.isWindow?"":a.element.css("overflow-x"),c=a.isWindow?"":a.element.css("overflow-y"),c="scroll"===c||"auto"===c&&a.height<a.element[0].scrollHeight;return{width:"scroll"===b||"auto"===b&&a.width<a.element[0].scrollWidth?e.position.scrollbarWidth():0,height:c?e.position.scrollbarWidth():0}},getWithinInfo:function(a){var a=
e(a||window),b=e.isWindow(a[0]);return{element:a,isWindow:b,offset:a.offset()||{left:0,top:0},scrollLeft:a.scrollLeft(),scrollTop:a.scrollTop(),width:b?a.width():a.outerWidth(),height:b?a.height():a.outerHeight()}}};e.fn.position=function(a){if(!a||!a.of)return p.apply(this,arguments);var a=e.extend({},a),b,o,m,u,z,C=e(a.of),F=e.position.getWithinInfo(a.within),A=e.position.getScrollInfo(F),E=C[0],J=(a.collision||"flip").split(" "),K={};9===E.nodeType?(o=C.width(),m=C.height(),u={top:0,left:0}):e.isWindow(E)?
(o=C.width(),m=C.height(),u={top:C.scrollTop(),left:C.scrollLeft()}):E.preventDefault?(a.at="left top",o=m=0,u={top:E.pageY,left:E.pageX}):(o=C.outerWidth(),m=C.outerHeight(),u=C.offset());z=e.extend({},u);e.each(["my","at"],function(){var b=(a[this]||"").split(" "),d,g;b.length===1&&(b=k.test(b[0])?b.concat(["center"]):c.test(b[0])?["center"].concat(b):["center","center"]);b[0]=k.test(b[0])?b[0]:"center";b[1]=c.test(b[1])?b[1]:"center";d=q.exec(b[0]);g=q.exec(b[1]);K[this]=[d?d[0]:0,g?g[0]:0];a[this]=
[n.exec(b[0])[0],n.exec(b[1])[0]]});1===J.length&&(J[1]=J[0]);"right"===a.at[0]?z.left+=o:"center"===a.at[0]&&(z.left+=o/2);"bottom"===a.at[1]?z.top+=m:"center"===a.at[1]&&(z.top+=m/2);b=j(K.at,o,m);z.left+=b[0];z.top+=b[1];return this.each(function(){var c,k,q=e(this),p=q.outerWidth(),n=q.outerHeight(),E=d(this,"marginLeft"),B=d(this,"marginTop"),H=p+E+d(this,"marginRight")+A.width,R=n+B+d(this,"marginBottom")+A.height,L=e.extend({},z),S=j(K.my,q.outerWidth(),q.outerHeight());if(a.my[0]==="right")L.left=
L.left-p;else if(a.my[0]==="center")L.left=L.left-p/2;if(a.my[1]==="bottom")L.top=L.top-n;else if(a.my[1]==="center")L.top=L.top-n/2;L.left=L.left+S[0];L.top=L.top+S[1];if(!e.support.offsetFractions){L.left=g(L.left);L.top=g(L.top)}c={marginLeft:E,marginTop:B};e.each(["left","top"],function(d,g){if(e.ui.position[J[d]])e.ui.position[J[d]][g](L,{targetWidth:o,targetHeight:m,elemWidth:p,elemHeight:n,collisionPosition:c,collisionWidth:H,collisionHeight:R,offset:[b[0]+S[0],b[1]+S[1]],my:a.my,at:a.at,within:F,
elem:q})});e.fn.bgiframe&&q.bgiframe();a.using&&(k=function(b){var c=u.left-L.left,d=c+o-p,g=u.top-L.top,k=g+m-n,e={target:{element:C,left:u.left,top:u.top,width:o,height:m},element:{element:q,left:L.left,top:L.top,width:p,height:n},horizontal:d<0?"left":c>0?"right":"center",vertical:k<0?"top":g>0?"bottom":"middle"};if(o<p&&l(c+d)<o)e.horizontal="center";if(m<n&&l(g+k)<m)e.vertical="middle";e.important=f(l(c),l(d))>f(l(g),l(k))?"horizontal":"vertical";a.using.call(this,b,e)});q.offset(e.extend(L,
{using:k}))})};e.ui.position={fit:{left:function(a,b){var c=b.within,d=c.isWindow?c.scrollLeft:c.offset.left,g=c.width,k=a.left-b.collisionPosition.marginLeft,c=d-k,l=k+b.collisionWidth-g-d;b.collisionWidth>g?0<c&&0>=l?(d=a.left+c+b.collisionWidth-g-d,a.left+=c-d):a.left=0<l&&0>=c?d:c>l?d+g-b.collisionWidth:d:a.left=0<c?a.left+c:0<l?a.left-l:f(a.left-k,a.left)},top:function(a,b){var c=b.within,d=c.isWindow?c.scrollTop:c.offset.top,g=b.within.height,k=a.top-b.collisionPosition.marginTop,c=d-k,l=k+
b.collisionHeight-g-d;b.collisionHeight>g?0<c&&0>=l?(d=a.top+c+b.collisionHeight-g-d,a.top+=c-d):a.top=0<l&&0>=c?d:c>l?d+g-b.collisionHeight:d:a.top=0<c?a.top+c:0<l?a.top-l:f(a.top-k,a.top)}},flip:{left:function(a,b){var c=b.within,d=c.offset.left+c.scrollLeft,g=c.width,f=c.isWindow?c.scrollLeft:c.offset.left,k=a.left-b.collisionPosition.marginLeft,c=k-f,e=k+b.collisionWidth-g-f,k="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0,j="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:
0,q=-2*b.offset[0];if(0>c){if(d=a.left+k+j+q+b.collisionWidth-g-d,0>d||d<l(c))a.left+=k+j+q}else if(0<e&&(d=a.left-b.collisionPosition.marginLeft+k+j+q-f,0<d||l(d)<e))a.left+=k+j+q},top:function(a,b){var c=b.within,d=c.offset.top+c.scrollTop,g=c.height,f=c.isWindow?c.scrollTop:c.offset.top,k=a.top-b.collisionPosition.marginTop,c=k-f,e=k+b.collisionHeight-g-f,k="top"===b.my[1]?-b.elemHeight:"bottom"===b.my[1]?b.elemHeight:0,j="top"===b.at[1]?b.targetHeight:"bottom"===b.at[1]?-b.targetHeight:0,q=-2*
b.offset[1];if(0>c){if(d=a.top+k+j+q+b.collisionHeight-g-d,a.top+k+j+q>c&&(0>d||d<l(c)))a.top+=k+j+q}else if(0<e&&(d=a.top-b.collisionPosition.marginTop+k+j+q-f,a.top+k+j+q>e&&(0<d||l(d)<e)))a.top+=k+j+q}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments);e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments);e.ui.position.fit.top.apply(this,arguments)}}};(function(){var a,b,c,d,g=document.getElementsByTagName("body")[0];c=document.createElement("div");
a=document.createElement(g?"div":"body");b={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};g&&e.extend(b,{position:"absolute",left:"-1000px",top:"-1000px"});for(d in b)a.style[d]=b[d];a.appendChild(c);b=g||document.documentElement;b.insertBefore(a,b.firstChild);c.style.cssText="position: absolute; left: 10.7432222px;";c=e(c).offset().left;e.support.offsetFractions=10<c&&11>c;a.innerHTML="";b.removeChild(a)})();!1!==e.uiBackCompat&&function(b){var c=b.fn.position;b.fn.position=
function(d){if(!d||!d.offset)return c.call(this,d);var g=d.offset.split(" "),f=d.at.split(" ");1===g.length&&(g[1]=g[0]);/^\d/.test(g[0])&&(g[0]="+"+g[0]);/^\d/.test(g[1])&&(g[1]="+"+g[1]);1===f.length&&(/left|center|right/.test(f[0])?f[1]="center":(f[1]=f[0],f[0]="center"));return c.call(this,b.extend(d,{at:f[0]+g[0]+" "+f[1]+g[1],offset:a}))}}(m)})(m);(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.0",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,
containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){"original"==this.options.helper&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative");this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&
this.element.addClass("ui-draggable-disabled");this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(a){var j=this.options;if(this.helper||j.disabled||e(a.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(a);if(!this.handle)return!1;e(!0===j.iframeFix?"iframe":j.iframeFix).each(function(){e('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+
"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(e(this).offset()).appendTo("body")});return!0},_mouseStart:function(a){var j=this.options;this.helper=this._createHelper(a);this.helper.addClass("ui-draggable-dragging");this._cacheHelperProportions();e.ui.ddmanager&&(e.ui.ddmanager.current=this);this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset=
{top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};e.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;j.cursorAt&&this._adjustOffsetFromHelper(j.cursorAt);j.containment&&this._setContainment();if(!1===this._trigger("start",a))return this._clear(),!1;this._cacheHelperProportions();
e.ui.ddmanager&&!j.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,a);this._mouseDrag(a,!0);e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,a);return!0},_mouseDrag:function(a,j){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!j){var d=this._uiHash();if(!1===this._trigger("drag",a,d))return this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||"y"!=this.options.axis)this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
"x"!=this.options.axis)this.helper[0].style.top=this.position.top+"px";e.ui.ddmanager&&e.ui.ddmanager.drag(this,a);return!1},_mouseStop:function(a){var j=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(j=e.ui.ddmanager.drop(this,a));this.dropped&&(j=this.dropped,this.dropped=!1);for(var d=this.element[0],b=!1;d&&(d=d.parentNode);)d==document&&(b=!0);if(!b&&"original"===this.options.helper)return!1;if("invalid"==this.options.revert&&!j||"valid"==this.options.revert&&j||!0===this.options.revert||e.isFunction(this.options.revert)&&
this.options.revert.call(this.element,j)){var f=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",a)!==false&&f._clear()})}else!1!==this._trigger("stop",a)&&this._clear();return!1},_mouseUp:function(a){e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,a);return e.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?
this._mouseUp({}):this._clear();return this},_getHandle:function(a){var j=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;e(this.options.handle,this.element).find("*").andSelf().each(function(){this==a.target&&(j=!0)});return j},_createHelper:function(a){var j=this.options,a=e.isFunction(j.helper)?e(j.helper.apply(this.element[0],[a])):"clone"==j.helper?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo("parent"==j.appendTo?this.element[0].parentNode:
j.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){"string"==typeof a&&(a=a.split(" "));e.isArray(a)&&(a={left:+a[0],top:+a[1]||0});"left"in a&&(this.offset.click.left=a.left+this.margins.left);"right"in a&&(this.offset.click.left=this.helperProportions.width-a.right+this.margins.left);"top"in a&&(this.offset.click.top=a.top+this.margins.top);"bottom"in a&&(this.offset.click.top=this.helperProportions.height-
a.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();"absolute"==this.cssPosition&&(this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0]))&&(a.left+=this.scrollParent.scrollLeft(),a.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&Aloha.browser.msie)a={top:0,left:0};return{top:a.top+
(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){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 a=this.options;"parent"==a.containment&&(a.containment=this.helper[0].parentNode);if("document"==a.containment||"window"==a.containment)this.containment=["document"==a.containment?
0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"==a.containment?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"==a.containment?0:e(window).scrollLeft())+e("document"==a.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==a.containment?0:e(window).scrollTop())+(e("document"==a.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-
this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var a=e(a.containment),j=a[0];if(j){a.offset();var d="hidden"!=e(j).css("overflow");this.containment=[(parseInt(e(j).css("borderLeftWidth"),10)||0)+(parseInt(e(j).css("paddingLeft"),10)||0),(parseInt(e(j).css("borderTopWidth"),10)||0)+(parseInt(e(j).css("paddingTop"),10)||0),(d?Math.max(j.scrollWidth,j.offsetWidth):j.offsetWidth)-(parseInt(e(j).css("borderLeftWidth"),10)||0)-(parseInt(e(j).css("paddingRight"),
10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(d?Math.max(j.scrollHeight,j.offsetHeight):j.offsetHeight)-(parseInt(e(j).css("borderTopWidth"),10)||0)-(parseInt(e(j).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else a.containment.constructor==Array&&(this.containment=a.containment)},_convertPositionTo:function(a,j){j||(j=this.position);var d="absolute"==a?1:-1,b="absolute"==this.cssPosition&&
!(this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(b[0].tagName);return{top:j.top+this.offset.relative.top*d+this.offset.parent.top*d-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():f?0:b.scrollTop())*d,left:j.left+this.offset.relative.left*d+this.offset.parent.left*d-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():f?0:b.scrollLeft())*d}},_generatePosition:function(a){var j=this.options,
d="absolute"==this.cssPosition&&!(this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,b=/(html|body)/i.test(d[0].tagName),f=a.pageX,l=a.pageY;if(this.originalPosition){var g;this.containment&&(this.relative_container?(g=this.relative_container.offset(),g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]):g=this.containment,a.pageX-this.offset.click.left<g[0]&&(f=g[0]+this.offset.click.left),
a.pageY-this.offset.click.top<g[1]&&(l=g[1]+this.offset.click.top),a.pageX-this.offset.click.left>g[2]&&(f=g[2]+this.offset.click.left),a.pageY-this.offset.click.top>g[3]&&(l=g[3]+this.offset.click.top));j.grid&&(l=j.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/j.grid[1])*j.grid[1]:this.originalPageY,l=g?!(l-this.offset.click.top<g[1]||l-this.offset.click.top>g[3])?l:!(l-this.offset.click.top<g[1])?l-j.grid[1]:l+j.grid[1]:l,f=j.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/
j.grid[0])*j.grid[0]:this.originalPageX,f=g?!(f-this.offset.click.left<g[0]||f-this.offset.click.left>g[2])?f:!(f-this.offset.click.left<g[0])?f-j.grid[0]:f+j.grid[0]:f)}return{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"==this.cssPosition?-this.scrollParent.scrollTop():b?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():b?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(a,j,d){d=d||this._uiHash();e.ui.plugin.call(this,a,[j,d]);"drag"==a&&(this.positionAbs=this._convertPositionTo("absolute"));return e.Widget.prototype._trigger.call(this,a,j,d)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});e.ui.plugin.add("draggable","connectToSortable",
{start:function(a,j){var d=e(this).data("draggable"),b=d.options,f=e.extend({},j,{item:d.element});d.sortables=[];e(b.connectToSortable).each(function(){var b=e.data(this,"sortable");b&&!b.options.disabled&&(d.sortables.push({instance:b,shouldRevert:b.options.revert}),b.refreshPositions(),b._trigger("activate",a,f))})},stop:function(a,j){var d=e(this).data("draggable"),b=e.extend({},j,{item:d.element});e.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(a),this.instance.options.helper=this.instance.options._helper,"original"==d.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",a,b))})},drag:function(a,j){var d=e(this).data("draggable"),b=this;e.each(d.sortables,function(){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=e(b).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 j.helper[0]},a.target=this.instance.currentItem[0],this.instance._mouseCapture(a,!0),this.instance._mouseStart(a,
!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",a),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(a)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=
!0,this.instance.options.revert=!1,this.instance._trigger("out",a,this.instance._uiHash(this.instance)),this.instance._mouseStop(a,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",a),d.dropped=!1)})}});e.ui.plugin.add("draggable","cursor",{start:function(){var a=e("body"),j=e(this).data("draggable").options;a.css("cursor")&&(j._cursor=a.css("cursor"));a.css("cursor",
j.cursor)},stop:function(){var a=e(this).data("draggable").options;a._cursor&&e("body").css("cursor",a._cursor)}});e.ui.plugin.add("draggable","opacity",{start:function(a,j){var d=e(j.helper),b=e(this).data("draggable").options;d.css("opacity")&&(b._opacity=d.css("opacity"));d.css("opacity",b.opacity)},stop:function(a,j){var d=e(this).data("draggable").options;d._opacity&&e(j.helper).css("opacity",d._opacity)}});e.ui.plugin.add("draggable","scroll",{start:function(){var a=e(this).data("draggable");
a.scrollParent[0]!=document&&"HTML"!=a.scrollParent[0].tagName&&(a.overflowOffset=a.scrollParent.offset())},drag:function(a){var j=e(this).data("draggable"),d=j.options,b=!1;if(j.scrollParent[0]!=document&&"HTML"!=j.scrollParent[0].tagName){if(!d.axis||"x"!=d.axis)j.overflowOffset.top+j.scrollParent[0].offsetHeight-a.pageY<d.scrollSensitivity?j.scrollParent[0].scrollTop=b=j.scrollParent[0].scrollTop+d.scrollSpeed:a.pageY-j.overflowOffset.top<d.scrollSensitivity&&(j.scrollParent[0].scrollTop=b=j.scrollParent[0].scrollTop-
d.scrollSpeed);if(!d.axis||"y"!=d.axis)j.overflowOffset.left+j.scrollParent[0].offsetWidth-a.pageX<d.scrollSensitivity?j.scrollParent[0].scrollLeft=b=j.scrollParent[0].scrollLeft+d.scrollSpeed:a.pageX-j.overflowOffset.left<d.scrollSensitivity&&(j.scrollParent[0].scrollLeft=b=j.scrollParent[0].scrollLeft-d.scrollSpeed)}else{if(!d.axis||"x"!=d.axis)a.pageY-e(document).scrollTop()<d.scrollSensitivity?b=e(document).scrollTop(e(document).scrollTop()-d.scrollSpeed):e(window).height()-(a.pageY-e(document).scrollTop())<
d.scrollSensitivity&&(b=e(document).scrollTop(e(document).scrollTop()+d.scrollSpeed));if(!d.axis||"y"!=d.axis)a.pageX-e(document).scrollLeft()<d.scrollSensitivity?b=e(document).scrollLeft(e(document).scrollLeft()-d.scrollSpeed):e(window).width()-(a.pageX-e(document).scrollLeft())<d.scrollSensitivity&&(b=e(document).scrollLeft(e(document).scrollLeft()+d.scrollSpeed))}!1!==b&&(e.ui.ddmanager&&!d.dropBehaviour)&&e.ui.ddmanager.prepareOffsets(j,a)}});e.ui.plugin.add("draggable","snap",{start:function(){var a=
e(this).data("draggable"),j=a.options;a.snapElements=[];e(j.snap.constructor!=String?j.snap.items||":data(draggable)":j.snap).each(function(){var d=e(this),b=d.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:d.outerWidth(),height:d.outerHeight(),top:b.top,left:b.left})})},drag:function(a,j){for(var d=e(this).data("draggable"),b=d.options,f=b.snapTolerance,l=j.offset.left,g=l+d.helperProportions.width,k=j.offset.top,c=k+d.helperProportions.height,q=d.snapElements.length-1;0<=q;q--){var n=
d.snapElements[q].left,o=n+d.snapElements[q].width,p=d.snapElements[q].top,r=p+d.snapElements[q].height;if(n-f<l&&l<o+f&&p-f<k&&k<r+f||n-f<l&&l<o+f&&p-f<c&&c<r+f||n-f<g&&g<o+f&&p-f<k&&k<r+f||n-f<g&&g<o+f&&p-f<c&&c<r+f){if("inner"!=b.snapMode){var m=Math.abs(p-c)<=f,x=Math.abs(r-k)<=f,v=Math.abs(n-g)<=f,u=Math.abs(o-l)<=f;m&&(j.position.top=d._convertPositionTo("relative",{top:p-d.helperProportions.height,left:0}).top-d.margins.top);x&&(j.position.top=d._convertPositionTo("relative",{top:r,left:0}).top-
d.margins.top);v&&(j.position.left=d._convertPositionTo("relative",{top:0,left:n-d.helperProportions.width}).left-d.margins.left);u&&(j.position.left=d._convertPositionTo("relative",{top:0,left:o}).left-d.margins.left)}var z=m||x||v||u;if("outer"!=b.snapMode&&(m=Math.abs(p-k)<=f,x=Math.abs(r-c)<=f,v=Math.abs(n-l)<=f,u=Math.abs(o-g)<=f,m&&(j.position.top=d._convertPositionTo("relative",{top:p,left:0}).top-d.margins.top),x&&(j.position.top=d._convertPositionTo("relative",{top:r-d.helperProportions.height,
left:0}).top-d.margins.top),v&&(j.position.left=d._convertPositionTo("relative",{top:0,left:n}).left-d.margins.left),u))j.position.left=d._convertPositionTo("relative",{top:0,left:o-d.helperProportions.width}).left-d.margins.left;!d.snapElements[q].snapping&&(m||x||v||u||z)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,a,e.extend(d._uiHash(),{snapItem:d.snapElements[q].item}));d.snapElements[q].snapping=m||x||v||u||z}else d.snapElements[q].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,
a,e.extend(d._uiHash(),{snapItem:d.snapElements[q].item})),d.snapElements[q].snapping=!1}}});e.ui.plugin.add("draggable","stack",{start:function(){var a=e(this).data("draggable").options,a=e.makeArray(e(a.stack)).sort(function(a,b){return(parseInt(e(a).css("zIndex"),10)||0)-(parseInt(e(b).css("zIndex"),10)||0)});if(a.length){var j=parseInt(a[0].style.zIndex)||0;e(a).each(function(a){this.style.zIndex=j+a});this[0].style.zIndex=j+a.length}}});e.ui.plugin.add("draggable","zIndex",{start:function(a,
j){var d=e(j.helper),b=e(this).data("draggable").options;d.css("zIndex")&&(b._zIndex=d.css("zIndex"));d.css("zIndex",b.zIndex)},stop:function(a,j){var d=e(this).data("draggable").options;d._zIndex&&e(j.helper).css("zIndex",d._zIndex)}})})(m);(function(e){e.widget("ui.droppable",{version:"1.9.0",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,j=a.accept;this.isover=0;this.isout=
1;this.accept=e.isFunction(j)?j:function(a){return a.is(j)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};e.ui.ddmanager.droppables[a.scope]=e.ui.ddmanager.droppables[a.scope]||[];e.ui.ddmanager.droppables[a.scope].push(this);a.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var a=e.ui.ddmanager.droppables[this.options.scope],j=0;j<a.length;j++)a[j]==this&&a.splice(j,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},
_setOption:function(a,j){"accept"==a&&(this.accept=e.isFunction(j)?j:function(a){return a.is(j)});e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var j=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass);j&&this._trigger("activate",a,this.ui(j))},_deactivate:function(a){var j=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);j&&this._trigger("deactivate",a,this.ui(j))},_over:function(a){var j=
e.ui.ddmanager.current;if(j&&(j.currentItem||j.element)[0]!=this.element[0])if(this.accept.call(this.element[0],j.currentItem||j.element))this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",a,this.ui(j))},_out:function(a){var j=e.ui.ddmanager.current;if(j&&(j.currentItem||j.element)[0]!=this.element[0])if(this.accept.call(this.element[0],j.currentItem||j.element))this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",
a,this.ui(j))},_drop:function(a,j){var d=j||e.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var b=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var a=e.data(this,"droppable");if(a.options.greedy&&!a.options.disabled&&a.options.scope==d.options.scope&&a.accept.call(a.element[0],d.currentItem||d.element)&&e.ui.intersect(d,e.extend(a,{offset:a.element.offset()}),a.options.tolerance))return b=!0,!1});return b?!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",a,this.ui(d)),this.element):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});e.ui.intersect=function(a,j,d){if(!j.offset)return!1;var b=(a.positionAbs||a.position.absolute).left,f=b+a.helperProportions.width,l=(a.positionAbs||a.position.absolute).top,
g=l+a.helperProportions.height,k=j.offset.left,c=k+j.proportions.width,q=j.offset.top,n=q+j.proportions.height;switch(d){case "fit":return k<=b&&f<=c&&q<=l&&g<=n;case "intersect":return k<b+a.helperProportions.width/2&&f-a.helperProportions.width/2<c&&q<l+a.helperProportions.height/2&&g-a.helperProportions.height/2<n;case "pointer":return e.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,
q,k,j.proportions.height,j.proportions.width);case "touch":return(l>=q&&l<=n||g>=q&&g<=n||l<q&&g>n)&&(b>=k&&b<=c||f>=k&&f<=c||b<k&&f>c);default:return!1}};e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,j){var d=e.ui.ddmanager.droppables[a.options.scope]||[],b=j?j.type:null,f=(a.currentItem||a.element).find(":data(droppable)").andSelf(),l=0;a:for(;l<d.length;l++)if(!(d[l].options.disabled||a&&!d[l].accept.call(d[l].element[0],a.currentItem||a.element))){for(var g=
0;g<f.length;g++)if(f[g]==d[l].element[0]){d[l].proportions.height=0;continue a}d[l].visible="none"!=d[l].element.css("display");d[l].visible&&("mousedown"==b&&d[l]._activate.call(d[l],j),d[l].offset=d[l].element.offset(),d[l].proportions={width:d[l].element[0].offsetWidth,height:d[l].element[0].offsetHeight})}},drop:function(a,j){var d=!1;e.each(e.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options&&(!this.options.disabled&&(this.visible&&e.ui.intersect(a,this,this.options.tolerance))&&
(d=this._drop.call(this,j)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||a.element)))this.isout=1,this.isover=0,this._deactivate.call(this,j)});return d},dragStart:function(a,j){a.element.parentsUntil("body").bind("scroll.droppable",function(){a.options.refreshPositions||e.ui.ddmanager.prepareOffsets(a,j)})},drag:function(a,j){a.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(a,j);e.each(e.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!this.options.disabled&&
!this.greedyChild&&this.visible){var d=e.ui.intersect(a,this,this.options.tolerance);if(d=!d&&1==this.isover?"isout":d&&0==this.isover?"isover":null){var b;if(this.options.greedy){var f=this.options.scope,l=this.element.parents(":data(droppable)").filter(function(){return e.data(this,"droppable").options.scope===f});l.length&&(b=e.data(l[0],"droppable"),b.greedyChild="isover"==d?1:0)}b&&"isover"==d&&(b.isover=0,b.isout=1,b._out.call(b,j));this[d]=1;this["isout"==d?"isover":"isout"]=0;this["isover"==
d?"_over":"_out"].call(this,j);b&&"isout"==d&&(b.isout=0,b.isover=1,b._over.call(b,j))}}})},dragStop:function(a,j){a.element.parentsUntil("body").unbind("scroll.droppable");a.options.refreshPositions||e.ui.ddmanager.prepareOffsets(a,j)}}})(m);(function(e){e.widget("ui.resizable",e.ui.mouse,{version:"1.9.0",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,
maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var a=this,b=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!b.aspectRatio,aspectRatio:b.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:b.helper||b.ghost||b.animate?b.helper||"ui-resizable-helper":null});this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),
width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("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=b.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{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"});if(this.handles.constructor==String){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var f=this.handles.split(",");this.handles={};for(var l=0;l<f.length;l++){var g=e.trim(f[l]),k=e('<div class="ui-resizable-handle ui-resizable-'+g+'"></div>');k.css({zIndex:b.zIndex});"se"==g&&k.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[g]=".ui-resizable-"+g;this.element.append(k)}}this._renderAxis=
function(a){var a=a||this.element,b;for(b in this.handles){this.handles[b].constructor==String&&(this.handles[b]=e(this.handles[b],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=e(this.handles[b],this.element),g=0,g=/sw|ne|nw|se|n|s/.test(b)?d.outerHeight():d.outerWidth(),d=["padding",/ne|nw|n/.test(b)?"Top":/se|sw|s/.test(b)?"Bottom":/^e$/.test(b)?"Right":"Left"].join("");a.css(d,g);this._proportionallyResize()}e(this.handles[b])}};
this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!a.resizing){if(this.className)var b=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);a.axis=b&&b[1]?b[1]:"se"}});b.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(!b.disabled){e(this).removeClass("ui-resizable-autohide");a._handles.show()}}).mouseleave(function(){if(!b.disabled&&!a.resizing){e(this).addClass("ui-resizable-autohide");
a._handles.hide()}}));this._mouseInit()},_destroy:function(){this._mouseDestroy();var a=function(a){e(a).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){a(this.element);var b=this.element;b.after(this.originalElement.css({position:b.css("position"),width:b.outerWidth(),height:b.outerHeight(),top:b.css("top"),left:b.css("left")})).remove()}this.originalElement.css("resize",
this.originalResizeStyle);a(this.originalElement);return this},_mouseCapture:function(a){var b=!1,f;for(f in this.handles)e(this.handles[f])[0]==a.target&&(b=!0);return!this.options.disabled&&b},_mouseStart:function(d){var b=this.options,f=this.element.position(),l=this.element;this.resizing=!0;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};(l.is(".ui-draggable")||/absolute/.test(l.css("position")))&&l.css({position:"absolute",top:f.top,left:f.left});this._renderProxy();
var f=a(this.helper.css("left")),g=a(this.helper.css("top"));b.containment&&(f+=e(b.containment).scrollLeft()||0,g+=e(b.containment).scrollTop()||0);this.offset=this.helper.offset();this.position={left:f,top:g};this.size=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()};this.originalSize=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()};this.originalPosition={left:f,top:g};this.sizeDiff={width:l.outerWidth()-
l.width(),height:l.outerHeight()-l.height()};this.originalMousePosition={left:d.pageX,top:d.pageY};this.aspectRatio="number"==typeof b.aspectRatio?b.aspectRatio:this.originalSize.width/this.originalSize.height||1;b=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor","auto"==b?this.axis+"-resize":b);l.addClass("ui-resizable-resizing");this._propagate("start",d);return!0},_mouseDrag:function(a){var b=this.helper,f=this.originalMousePosition,l=this._change[this.axis];if(!l)return!1;f=
l.apply(this,[a,a.pageX-f.left||0,a.pageY-f.top||0]);this._updateVirtualBoundaries(a.shiftKey);if(this._aspectRatio||a.shiftKey)f=this._updateRatio(f,a);f=this._respectSize(f,a);this._propagate("resize",a);b.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(f);this._trigger("resize",a,this.ui());return!1},_mouseStop:function(a){this.resizing=
!1;var b=this.options;if(this._helper){var f=this._proportionallyResizeElements,l=f.length&&/textarea/i.test(f[0].nodeName),f=l&&e.ui.hasScroll(f[0],"left")?0:this.sizeDiff.height,l=l?0:this.sizeDiff.width,l={width:this.helper.width()-l,height:this.helper.height()-f},f=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null,g=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;b.animate||this.element.css(e.extend(l,{top:g,left:f}));
this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!b.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",a);this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,f,l,g,b={minWidth:j(b.minWidth)?b.minWidth:0,maxWidth:j(b.maxWidth)?b.maxWidth:Infinity,minHeight:j(b.minHeight)?b.minHeight:0,maxHeight:j(b.maxHeight)?b.maxHeight:Infinity};
if(this._aspectRatio||a)if(a=b.minHeight*this.aspectRatio,l=b.minWidth/this.aspectRatio,f=b.maxHeight*this.aspectRatio,g=b.maxWidth/this.aspectRatio,a>b.minWidth&&(b.minWidth=a),l>b.minHeight&&(b.minHeight=l),f<b.maxWidth&&(b.maxWidth=f),g<b.maxHeight)b.maxHeight=g;this._vBoundaries=b},_updateCache:function(a){this.offset=this.helper.offset();j(a.left)&&(this.position.left=a.left);j(a.top)&&(this.position.top=a.top);j(a.height)&&(this.size.height=a.height);j(a.width)&&(this.size.width=a.width)},_updateRatio:function(a){var b=
this.position,f=this.size,l=this.axis;j(a.height)?a.width=a.height*this.aspectRatio:j(a.width)&&(a.height=a.width/this.aspectRatio);"sw"==l&&(a.left=b.left+(f.width-a.width),a.top=null);"nw"==l&&(a.top=b.top+(f.height-a.height),a.left=b.left+(f.width-a.width));return a},_respectSize:function(a){var b=this._vBoundaries,f=this.axis,l=j(a.width)&&b.maxWidth&&b.maxWidth<a.width,g=j(a.height)&&b.maxHeight&&b.maxHeight<a.height,k=j(a.width)&&b.minWidth&&b.minWidth>a.width,c=j(a.height)&&b.minHeight&&b.minHeight>
a.height;k&&(a.width=b.minWidth);c&&(a.height=b.minHeight);l&&(a.width=b.maxWidth);g&&(a.height=b.maxHeight);var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height,o=/sw|nw|w/.test(f),f=/nw|ne|n/.test(f);k&&o&&(a.left=e-b.minWidth);l&&o&&(a.left=e-b.maxWidth);c&&f&&(a.top=n-b.minHeight);g&&f&&(a.top=n-b.maxHeight);(b=!a.width&&!a.height)&&!a.left&&a.top?a.top=null:b&&(!a.top&&a.left)&&(a.left=null);return a},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var a=
this.helper||this.element,b=0;b<this._proportionallyResizeElements.length;b++){var f=this._proportionallyResizeElements[b];if(!this.borderDif){var l=[f.css("borderTopWidth"),f.css("borderRightWidth"),f.css("borderBottomWidth"),f.css("borderLeftWidth")],g=[f.css("paddingTop"),f.css("paddingRight"),f.css("paddingBottom"),f.css("paddingLeft")];this.borderDif=e.map(l,function(a,b){var d=parseInt(a,10)||0,f=parseInt(g[b],10)||0;return d+f})}f.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||
0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var a=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var b=Aloha.browser.msie&&7>Aloha.browser.version,f=b?1:0,b=b?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+b,height:this.element.outerHeight()+b,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++a.zIndex});
this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b){return{width:this.originalSize.width+b}},w:function(a,b){return{left:this.originalPosition.left+b,width:this.originalSize.width-b}},n:function(a,b,f){return{top:this.originalPosition.top+f,height:this.originalSize.height-f}},s:function(a,b,f){return{height:this.originalSize.height+f}},se:function(a,b,f){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[a,b,f]))},sw:function(a,
b,f){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[a,b,f]))},ne:function(a,b,f){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[a,b,f]))},nw:function(a,b,f){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[a,b,f]))}},_propagate:function(a,b){e.ui.plugin.call(this,a,[b,this.ui()]);"resize"!=a&&this._trigger(a,b,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,
helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.ui.plugin.add("resizable","alsoResize",{start:function(){var a=e(this).data("resizable").options,b=function(a){e(a).each(function(){var a=e(this);a.data("resizable-alsoresize",{width:parseInt(a.width(),10),height:parseInt(a.height(),10),left:parseInt(a.css("left"),10),top:parseInt(a.css("top"),10)})})};"object"==typeof a.alsoResize&&!a.alsoResize.parentNode?a.alsoResize.length?
(a.alsoResize=a.alsoResize[0],b(a.alsoResize)):e.each(a.alsoResize,function(a){b(a)}):b(a.alsoResize)},resize:function(a,b){var f=e(this).data("resizable"),l=f.options,g=f.originalSize,k=f.originalPosition,c={height:f.size.height-g.height||0,width:f.size.width-g.width||0,top:f.position.top-k.top||0,left:f.position.left-k.left||0},j=function(a,d){e(a).each(function(){var a=e(this),g=e(this).data("resizable-alsoresize"),f={},k=d&&d.length?d:a.parents(b.originalElement[0]).length?["width","height"]:
["width","height","top","left"];e.each(k,function(a,b){var d=(g[b]||0)+(c[b]||0);d&&0<=d&&(f[b]=d||null)});a.css(f)})};"object"==typeof l.alsoResize&&!l.alsoResize.nodeType?e.each(l.alsoResize,function(a,b){j(a,b)}):j(l.alsoResize)},stop:function(){e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(a){var b=e(this).data("resizable"),f=b.options,l=b._proportionallyResizeElements,g=l.length&&/textarea/i.test(l[0].nodeName),k=g&&e.ui.hasScroll(l[0],"left")?
0:b.sizeDiff.height,g={width:b.size.width-(g?0:b.sizeDiff.width),height:b.size.height-k},k=parseInt(b.element.css("left"),10)+(b.position.left-b.originalPosition.left)||null,c=parseInt(b.element.css("top"),10)+(b.position.top-b.originalPosition.top)||null;b.element.animate(e.extend(g,c&&k?{top:c,left:k}:{}),{duration:f.animateDuration,easing:f.animateEasing,step:function(){var c={width:parseInt(b.element.css("width"),10),height:parseInt(b.element.css("height"),10),top:parseInt(b.element.css("top"),
10),left:parseInt(b.element.css("left"),10)};l&&l.length&&e(l[0]).css({width:c.width,height:c.height});b._updateCache(c);b._propagate("resize",a)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var d=e(this).data("resizable"),b=d.element,f=d.options.containment;if(b=f instanceof e?f.get(0):/parent/.test(f)?b.parent().get(0):f)if(d.containerElement=e(b),/document/.test(f)||f==document)d.containerOffset={left:0,top:0},d.containerPosition={left:0,top:0},d.parentData={element:e(document),
left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var l=e(b),g=[];e(["Top","Right","Left","Bottom"]).each(function(b,c){g[b]=a(l.css("padding"+c))});d.containerOffset=l.offset();d.containerPosition=l.position();d.containerSize={height:l.innerHeight()-g[3],width:l.innerWidth()-g[1]};var f=d.containerOffset,k=d.containerSize.height,c=d.containerSize.width,c=e.ui.hasScroll(b,"left")?b.scrollWidth:c,k=e.ui.hasScroll(b)?b.scrollHeight:k;d.parentData=
{element:b,left:f.left,top:f.top,width:c,height:k}}},resize:function(a){var b=e(this).data("resizable"),f=b.options,l=b.containerOffset,g=b.position,a=b._aspectRatio||a.shiftKey,k={top:0,left:0},c=b.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(k=l);if(g.left<(b._helper?l.left:0))b.size.width+=b._helper?b.position.left-l.left:b.position.left-k.left,a&&(b.size.height=b.size.width/b.aspectRatio),b.position.left=f.helper?l.left:0;if(g.top<(b._helper?l.top:0))b.size.height+=b._helper?
b.position.top-l.top:b.position.top,a&&(b.size.width=b.size.height*b.aspectRatio),b.position.top=b._helper?l.top:0;b.offset.left=b.parentData.left+b.position.left;b.offset.top=b.parentData.top+b.position.top;f=Math.abs(b.offset.left-k.left+b.sizeDiff.width);l=Math.abs((b._helper?b.offset.top-k.top:b.offset.top-l.top)+b.sizeDiff.height);g=b.containerElement.get(0)==b.element.parent().get(0);k=/relative|absolute/.test(b.containerElement.css("position"));g&&k&&(f-=b.parentData.left);f+b.size.width>=
b.parentData.width&&(b.size.width=b.parentData.width-f,a&&(b.size.height=b.size.width/b.aspectRatio));l+b.size.height>=b.parentData.height&&(b.size.height=b.parentData.height-l,a&&(b.size.width=b.size.height*b.aspectRatio))},stop:function(){var a=e(this).data("resizable"),b=a.options,f=a.containerOffset,l=a.containerPosition,g=a.containerElement,k=e(a.helper),c=k.offset(),j=k.outerWidth()-a.sizeDiff.width,k=k.outerHeight()-a.sizeDiff.height;a._helper&&(!b.animate&&/relative/.test(g.css("position")))&&
e(this).css({left:c.left-l.left-f.left,width:j,height:k});a._helper&&(!b.animate&&/static/.test(g.css("position")))&&e(this).css({left:c.left-l.left-f.left,width:j,height:k})}});e.ui.plugin.add("resizable","ghost",{start:function(){var a=e(this).data("resizable"),b=a.options,f=a.size;a.ghost=a.originalElement.clone();a.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof b.ghost?b.ghost:
"");a.ghost.appendTo(a.helper)},resize:function(){var a=e(this).data("resizable");a.ghost&&a.ghost.css({position:"relative",height:a.size.height,width:a.size.width})},stop:function(){var a=e(this).data("resizable");a.ghost&&a.helper&&a.helper.get(0).removeChild(a.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var a=e(this).data("resizable"),b=a.options,f=a.size,l=a.originalSize,g=a.originalPosition,k=a.axis;b.grid="number"==typeof b.grid?[b.grid,b.grid]:b.grid;var c=Math.round((f.width-
l.width)/(b.grid[0]||1))*(b.grid[0]||1),b=Math.round((f.height-l.height)/(b.grid[1]||1))*(b.grid[1]||1);/^(se|s|e)$/.test(k)?(a.size.width=l.width+c,a.size.height=l.height+b):/^(ne)$/.test(k)?(a.size.width=l.width+c,a.size.height=l.height+b,a.position.top=g.top-b):(/^(sw)$/.test(k)?(a.size.width=l.width+c,a.size.height=l.height+b):(a.size.width=l.width+c,a.size.height=l.height+b,a.position.top=g.top-b),a.position.left=g.left-c)}});var a=function(a){return parseInt(a,10)||0},j=function(a){return!isNaN(parseInt(a,
10))}})(m);(function(e){e.widget("ui.selectable",e.ui.mouse,{version:"1.9.0",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var a=this;this.element.addClass("ui-selectable");this.dragged=!1;var j;this.refresh=function(){j=e(a.options.filter,a.element[0]);j.addClass("ui-selectee");j.each(function(){var a=e(this),b=a.offset();e.data(this,"selectable-item",{element:this,$element:a,left:b.left,top:b.top,right:b.left+a.outerWidth(),bottom:b.top+a.outerHeight(),
startselected:!1,selected:a.hasClass("ui-selected"),selecting:a.hasClass("ui-selecting"),unselecting:a.hasClass("ui-unselecting")})})};this.refresh();this.selectees=j.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled");this._mouseDestroy()},_mouseStart:function(a){var j=this;this.opos=[a.pageX,
a.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",a);e(d.appendTo).append(this.helper);this.helper.css({left:a.clientX,top:a.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=!0;!a.metaKey&&!a.ctrlKey&&(b.$element.removeClass("ui-selected"),b.selected=!1,b.$element.addClass("ui-unselecting"),b.unselecting=!0,j._trigger("unselecting",
a,{unselecting:b.element}))});e(a.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var d=!a.metaKey&&!a.ctrlKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(d?"ui-unselecting":"ui-selected").addClass(d?"ui-selecting":"ui-unselecting");b.unselecting=!d;b.selecting=d;(b.selected=d)?j._trigger("selecting",a,{selecting:b.element}):j._trigger("unselecting",a,{unselecting:b.element});return!1}})}},_mouseDrag:function(a){var j=this;this.dragged=!0;if(!this.options.disabled){var d=
this.options,b=this.opos[0],f=this.opos[1],l=a.pageX,g=a.pageY;if(b>l)var k=l,l=b,b=k;f>g&&(k=g,g=f,f=k);this.helper.css({left:b,top:f,width:l-b,height:g-f});this.selectees.each(function(){var c=e.data(this,"selectable-item");if(c&&c.element!=j.element[0]){var k=false;d.tolerance=="touch"?k=!(c.left>l||c.right<b||c.top>g||c.bottom<f):d.tolerance=="fit"&&(k=c.left>b&&c.right<l&&c.top>f&&c.bottom<g);if(k){if(c.selected){c.$element.removeClass("ui-selected");c.selected=false}if(c.unselecting){c.$element.removeClass("ui-unselecting");
c.unselecting=false}if(!c.selecting){c.$element.addClass("ui-selecting");c.selecting=true;j._trigger("selecting",a,{selecting:c.element})}}else{if(c.selecting)if((a.metaKey||a.ctrlKey)&&c.startselected){c.$element.removeClass("ui-selecting");c.selecting=false;c.$element.addClass("ui-selected");c.selected=true}else{c.$element.removeClass("ui-selecting");c.selecting=false;if(c.startselected){c.$element.addClass("ui-unselecting");c.unselecting=true}j._trigger("unselecting",a,{unselecting:c.element})}if(c.selected&&
!a.metaKey&&!a.ctrlKey&&!c.startselected){c.$element.removeClass("ui-selected");c.selected=false;c.$element.addClass("ui-unselecting");c.unselecting=true;j._trigger("unselecting",a,{unselecting:c.element})}}}});return!1}},_mouseStop:function(a){var j=this;this.dragged=!1;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=!1;d.startselected=!1;j._trigger("unselected",a,{unselected:d.element})});e(".ui-selecting",
this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=!1;d.selected=!0;d.startselected=!0;j._trigger("selected",a,{selected:d.element})});this._trigger("stop",a);this.helper.remove();return!1}})})(m);(function(e){e.widget("ui.sortable",e.ui.mouse,{version:"1.9.0",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,
forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?"x"===a.axis||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1;this.offset=this.element.offset();
this._mouseInit();this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();for(var a=this.items.length-1;0<=a;a--)this.items[a].item.removeData(this.widgetName+"-item");return this},_setOption:function(a,j){"disabled"===a?(this.options[a]=j,this.widget().toggleClass("ui-sortable-disabled",!!j)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,j){var d=this;if(this.reverting||this.options.disabled||"static"==this.options.type)return!1;
this._refreshItems(a);var b=null;e(a.target).parents().each(function(){if(e.data(this,d.widgetName+"-item")==d)return b=e(this),!1});e.data(a.target,d.widgetName+"-item")==d&&(b=e(a.target));if(!b)return!1;if(this.options.handle&&!j){var f=!1;e(this.options.handle,b).find("*").andSelf().each(function(){this==a.target&&(f=!0)});if(!f)return!1}this.currentItem=b;this._removeCurrentsFromItems();return!0},_mouseStart:function(a,j,d){j=this.options;this.currentContainer=this;this.refreshPositions();this.helper=
this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};e.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=
this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;j.cursorAt&&this._adjustOffsetFromHelper(j.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();j.containment&&this._setContainment();j.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",j.cursor));j.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=
this.helper.css("opacity")),this.helper.css("opacity",j.opacity));j.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",j.zIndex));this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset());this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(d=this.containers.length-1;0<=d;d--)this.containers[d]._trigger("activate",a,this._uiHash(this));
e.ui.ddmanager&&(e.ui.ddmanager.current=this);e.ui.ddmanager&&!j.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,a);this.dragging=!0;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return!0},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var j=this.options,d=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?
(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<j.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+j.scrollSpeed:a.pageY-this.overflowOffset.top<j.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-j.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<j.scrollSensitivity)?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+j.scrollSpeed:a.pageX-this.overflowOffset.left<j.scrollSensitivity&&
(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-j.scrollSpeed):(a.pageY-e(document).scrollTop()<j.scrollSensitivity?d=e(document).scrollTop(e(document).scrollTop()-j.scrollSpeed):e(window).height()-(a.pageY-e(document).scrollTop())<j.scrollSensitivity&&(d=e(document).scrollTop(e(document).scrollTop()+j.scrollSpeed)),a.pageX-e(document).scrollLeft()<j.scrollSensitivity?d=e(document).scrollLeft(e(document).scrollLeft()-j.scrollSpeed):e(window).width()-(a.pageX-e(document).scrollLeft())<
j.scrollSensitivity&&(d=e(document).scrollLeft(e(document).scrollLeft()+j.scrollSpeed)));!1!==d&&(e.ui.ddmanager&&!j.dropBehaviour)&&e.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||"y"!=this.options.axis)this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||"x"!=this.options.axis)this.helper[0].style.top=this.position.top+"px";for(j=this.items.length-1;0<=j;j--){var d=this.items[j],b=d.item[0],f=this._intersectsWithPointer(d);
if(f&&d.instance===this.currentContainer&&b!=this.currentItem[0]&&this.placeholder[1==f?"next":"prev"]()[0]!=b&&!e.contains(this.placeholder[0],b)&&("semi-dynamic"==this.options.type?!e.contains(this.element[0],b):1)){this.direction=1==f?"down":"up";if("pointer"==this.options.tolerance||this._intersectsWithSides(d))this._rearrange(a,d);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);e.ui.ddmanager&&e.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());
this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(a,j){if(a){e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,a);if(this.options.revert){var d=this,b=this.placeholder.offset();this.reverting=!0;e(this.helper).animate({left:b.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},
parseInt(this.options.revert,10)||500,function(){d._clear(a)})}else this._clear(a,j);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var a=this.containers.length-1;0<=a;a--)this.containers[a]._trigger("deactivate",null,this._uiHash(this)),this.containers[a].containerCache.over&&(this.containers[a]._trigger("out",null,this._uiHash(this)),this.containers[a].containerCache.over=
0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&(this.helper&&this.helper[0].parentNode)&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(a){var j=this._getItemsAsjQuery(a&&a.connected),d=[],a=a||
{};e(j).each(function(){var b=(e(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);b&&d.push((a.key||b[1]+"[]")+"="+(a.key&&a.expression?b[1]:b[2]))});!d.length&&a.key&&d.push(a.key+"=");return d.join("&")},toArray:function(a){var j=this._getItemsAsjQuery(a&&a.connected),d=[],a=a||{};j.each(function(){d.push(e(a.item||this).attr(a.attribute||"id")||"")});return d},_intersectsWith:function(a){var e=this.positionAbs.left,d=e+this.helperProportions.width,b=this.positionAbs.top,
f=b+this.helperProportions.height,l=a.left,g=l+a.width,k=a.top,c=k+a.height,q=this.offset.click.top,n=this.offset.click.left;return"pointer"==this.options.tolerance||this.options.forcePointerForContainers||"pointer"!=this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?b+q>k&&b+q<c&&e+n>l&&e+n<g:l<e+this.helperProportions.width/2&&d-this.helperProportions.width/2<g&&k<b+this.helperProportions.height/2&&f-this.helperProportions.height/2<c},
_intersectsWithPointer:function(a){var j="x"===this.options.axis||e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height),a="y"===this.options.axis||e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width),j=j&&a,a=this._getDragVerticalDirection(),d=this._getDragHorizontalDirection();return!j?!1:this.floating?d&&"right"==d||"down"==a?2:1:a&&("down"==a?2:1)},_intersectsWithSides:function(a){var j=e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+
a.height/2,a.height),a=e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width),d=this._getDragVerticalDirection(),b=this._getDragHorizontalDirection();return this.floating&&b?"right"==b&&a||"left"==b&&!a:d&&("down"==d&&j||"up"==d&&!j)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return 0!=a&&(0<a?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return 0!=a&&(0<a?"right":
"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var j=[],d=[],b=this._connectWith();if(b&&a)for(a=b.length-1;0<=a;a--)for(var f=e(b[a]),l=f.length-1;0<=l;l--){var g=e.data(f[l],this.widgetName);g&&(g!=this&&!g.options.disabled)&&d.push([e.isFunction(g.options.items)?g.options.items.call(g.element):e(g.options.items,
g.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),g])}d.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=d.length-1;0<=a;a--)d[a][0].each(function(){j.push(this)});return e(j)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data("+this.widgetName+"-item)"),e=0;e<this.items.length;e++)for(var d=
0;d<a.length;d++)a[d]==this.items[e].item[0]&&this.items.splice(e,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var j=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):e(this.options.items,this.element),this]],b=this._connectWith();if(b&&this.ready)for(var f=b.length-1;0<=f;f--)for(var l=e(b[f]),g=l.length-1;0<=g;g--){var k=e.data(l[g],this.widgetName);k&&(k!=this&&!k.options.disabled)&&(d.push([e.isFunction(k.options.items)?
k.options.items.call(k.element[0],a,{item:this.currentItem}):e(k.options.items,k.element),k]),this.containers.push(k))}for(f=d.length-1;0<=f;f--){a=d[f][1];b=d[f][0];g=0;for(l=b.length;g<l;g++)k=e(b[g]),k.data(this.widgetName+"-item",a),j.push({item:k,instance:a,width:0,height:0,left:0,top:0})}},refreshPositions:function(a){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var j=this.items.length-1;0<=j;j--){var d=this.items[j];if(!(d.instance!=this.currentContainer&&
this.currentContainer&&d.item[0]!=this.currentItem[0])){var b=this.options.toleranceElement?e(this.options.toleranceElement,d.item):d.item;a||(d.width=b.outerWidth(),d.height=b.outerHeight());b=b.offset();d.left=b.left;d.top=b.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(j=this.containers.length-1;0<=j;j--)b=this.containers[j].element.offset(),this.containers[j].containerCache.left=b.left,this.containers[j].containerCache.top=
b.top,this.containers[j].containerCache.width=this.containers[j].element.outerWidth(),this.containers[j].containerCache.height=this.containers[j].element.outerHeight();return this},_createPlaceholder:function(a){var a=a||this,j=a.options;if(!j.placeholder||j.placeholder.constructor==String){var d=j.placeholder;j.placeholder={element:function(){var b=e(document.createElement(a.currentItem[0].nodeName)).addClass(d||a.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];
d||(b.style.visibility="hidden");return b},update:function(b,f){if(!d||j.forcePlaceholderSize)f.height()||f.height(a.currentItem.innerHeight()-parseInt(a.currentItem.css("paddingTop")||0,10)-parseInt(a.currentItem.css("paddingBottom")||0,10)),f.width()||f.width(a.currentItem.innerWidth()-parseInt(a.currentItem.css("paddingLeft")||0,10)-parseInt(a.currentItem.css("paddingRight")||0,10))}}}a.placeholder=e(j.placeholder.element.call(a.element,a.currentItem));a.currentItem.after(a.placeholder);j.placeholder.update(a,
a.placeholder)},_contactContainers:function(a){for(var j=null,d=null,b=this.containers.length-1;0<=b;b--)if(!e.contains(this.currentItem[0],this.containers[b].element[0]))if(this._intersectsWith(this.containers[b].containerCache)){if(!j||!e.contains(this.containers[b].element[0],j.element[0]))j=this.containers[b],d=b}else this.containers[b].containerCache.over&&(this.containers[b]._trigger("out",a,this._uiHash(this)),this.containers[b].containerCache.over=0);if(j)if(1===this.containers.length)this.containers[d]._trigger("over",
a,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){for(var j=1E4,b=null,f=this.positionAbs[this.containers[d].floating?"left":"top"],l=this.items.length-1;0<=l;l--)if(e.contains(this.containers[d].element[0],this.items[l].item[0])){var g=this.containers[d].floating?this.items[l].item.offset().left:this.items[l].item.offset().top;Math.abs(g-f)<j&&(j=Math.abs(g-f),b=this.items[l],this.direction=0<g-f?"down":"up")}if(b||this.options.dropOnEmpty)this.currentContainer=
this.containers[d],b?this._rearrange(a,b,null,!0):this._rearrange(a,null,this.containers[d].element,!0),this._trigger("change",a,this._uiHash()),this.containers[d]._trigger("change",a,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",a,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(a){var j=this.options,a=e.isFunction(j.helper)?e(j.helper.apply(this.element[0],[a,this.currentItem])):
"clone"==j.helper?this.currentItem.clone():this.currentItem;a.parents("body").length||e("parent"!=j.appendTo?j.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);a[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")});(""==a[0].style.width||j.forceHelperSize)&&a.width(this.currentItem.width());(""==a[0].style.height||
j.forceHelperSize)&&a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){"string"==typeof a&&(a=a.split(" "));e.isArray(a)&&(a={left:+a[0],top:+a[1]||0});"left"in a&&(this.offset.click.left=a.left+this.margins.left);"right"in a&&(this.offset.click.left=this.helperProportions.width-a.right+this.margins.left);"top"in a&&(this.offset.click.top=a.top+this.margins.top);"bottom"in a&&(this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=
this.helper.offsetParent();var a=this.offsetParent.offset();"absolute"==this.cssPosition&&(this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0]))&&(a.left+=this.scrollParent.scrollLeft(),a.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&Aloha.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+
(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){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 a=this.options;"parent"==a.containment&&(a.containment=this.helper[0].parentNode);if("document"==a.containment||"window"==a.containment)this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"==a.containment?document:window).width()-this.helperProportions.width-this.margins.left,
(e("document"==a.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var j=e(a.containment)[0],a=e(a.containment).offset(),d="hidden"!=e(j).css("overflow");this.containment=[a.left+(parseInt(e(j).css("borderLeftWidth"),10)||0)+(parseInt(e(j).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(e(j).css("borderTopWidth"),10)||0)+(parseInt(e(j).css("paddingTop"),10)||
0)-this.margins.top,a.left+(d?Math.max(j.scrollWidth,j.offsetWidth):j.offsetWidth)-(parseInt(e(j).css("borderLeftWidth"),10)||0)-(parseInt(e(j).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(d?Math.max(j.scrollHeight,j.offsetHeight):j.offsetHeight)-(parseInt(e(j).css("borderTopWidth"),10)||0)-(parseInt(e(j).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,j){j||(j=this.position);var d="absolute"==a?1:-1,
b="absolute"==this.cssPosition&&!(this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(b[0].tagName);return{top:j.top+this.offset.relative.top*d+this.offset.parent.top*d-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():f?0:b.scrollTop())*d,left:j.left+this.offset.relative.left*d+this.offset.parent.left*d-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():f?0:b.scrollLeft())*d}},_generatePosition:function(a){var j=
this.options,d="absolute"==this.cssPosition&&!(this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,b=/(html|body)/i.test(d[0].tagName);"relative"==this.cssPosition&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=a.pageX,l=a.pageY;if(this.originalPosition&&(this.containment&&(a.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+
this.offset.click.left),a.pageY-this.offset.click.top<this.containment[1]&&(l=this.containment[1]+this.offset.click.top),a.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),a.pageY-this.offset.click.top>this.containment[3]&&(l=this.containment[3]+this.offset.click.top)),j.grid))l=this.originalPageY+Math.round((l-this.originalPageY)/j.grid[1])*j.grid[1],l=this.containment?!(l-this.offset.click.top<this.containment[1]||l-this.offset.click.top>this.containment[3])?
l:!(l-this.offset.click.top<this.containment[1])?l-j.grid[1]:l+j.grid[1]:l,f=this.originalPageX+Math.round((f-this.originalPageX)/j.grid[0])*j.grid[0],f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-j.grid[0]:f+j.grid[0]:f;return{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"==this.cssPosition?-this.scrollParent.scrollTop():b?0:d.scrollTop()),left:f-
this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():b?0:d.scrollLeft())}},_rearrange:function(a,e,d,b){d?d[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"==this.direction?e.item[0]:e.item[0].nextSibling);var f=this.counter=this.counter?++this.counter:1;this._delay(function(){f==this.counter&&this.refreshPositions(!b)})},_clear:function(a,j){this.reverting=!1;var d=[];!this._noFinalSort&&
this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var b in this._storedCSS)if("auto"==this._storedCSS[b]||"static"==this._storedCSS[b])this._storedCSS[b]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!j&&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])&&!j&&d.push(function(a){this._trigger("update",a,this._uiHash())});this!==this.currentContainer&&!j&&(d.push(function(a){this._trigger("remove",a,this._uiHash())}),d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.currentContainer)),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.currentContainer)));for(b=this.containers.length-1;0<=b;b--)j||d.push(function(a){return function(b){a._trigger("deactivate",
b,this._uiHash(this))}}.call(this,this.containers[b])),this.containers[b].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[b])),this.containers[b].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex);this.dragging=!1;if(this.cancelHelperRemoval){if(!j){this._trigger("beforeStop",
a,this._uiHash());for(b=0;b<d.length;b++)d[b].call(this,a);this._trigger("stop",a,this._uiHash())}return this.fromOutside=!1}j||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!j){for(b=0;b<d.length;b++)d[b].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){!1===e.Widget.prototype._trigger.apply(this,arguments)&&
this.cancel()},_uiHash:function(a){var j=a||this;return{helper:j.helper,placeholder:j.placeholder||e([]),position:j.position,originalPosition:j.originalPosition,offset:j.positionAbs,item:j.currentItem,sender:a?a.element:null}}})})(m);(function(e){var a=0,j={},d={};j.height=j.paddingTop=j.paddingBottom=j.borderTopWidth=j.borderBottomWidth="hide";d.height=d.paddingTop=d.paddingBottom=d.borderTopWidth=d.borderBottomWidth="show";e.widget("ui.accordion",{version:"1.9.0",options:{active:0,animate:{},collapsible:!1,
event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var b=this.accordionId="ui-accordion-"+(this.element.attr("id")||++a),d=this.options;this.prevShow=this.prevHide=e();this.element.addClass("ui-accordion ui-widget ui-helper-reset");this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all");
this._hoverable(this.headers);this._focusable(this.headers);this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide();!d.collapsible&&!1===d.active&&(d.active=0);0>d.active&&(d.active+=this.headers.length);this.active=this._findActive(d.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top");this.active.next().addClass("ui-accordion-content-active").show();this._createIcons();this.originalHeight=
this.element[0].style.height;this.refresh();this.element.attr("role","tablist");this.headers.attr("role","tab").each(function(a){var d=e(this),f=d.attr("id"),c=d.next(),j=c.attr("id");if(!f){f=b+"-header-"+a;d.attr("id",f)}if(!j){j=b+"-panel-"+a;c.attr("id",j)}d.attr("aria-controls",j);c.attr("aria-labelledby",f)}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide();this.active.length?
this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0);this._on(this.headers,{keydown:"_keydown"});this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._setupEvents(d.event)},_getCreateEventData:function(){return{header:this.active,content:!this.active.length?e():this.active.next()}},_createIcons:function(){var a=this.options.icons;a&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+a.header).prependTo(this.headers),
this.active.children(".ui-accordion-header-icon").removeClass(a.header).addClass(a.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var a;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&
this.removeAttribute("id")});this._destroyIcons();a=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")});"content"!==this.options.heightStyle&&(this.element.css("height",this.originalHeight),a.css("height",
""))},_setOption:function(a,d){"active"===a?this._activate(d):("event"===a&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(d)),this._super(a,d),"collapsible"===a&&(!d&&!1===this.options.active)&&this._activate(0),"icons"===a&&(this._destroyIcons(),d&&this._createIcons()),"disabled"===a&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!d))},_keydown:function(a){if(!a.altKey&&!a.ctrlKey){var d=e.ui.keyCode,l=this.headers.length,g=this.headers.index(a.target),
k=!1;switch(a.keyCode){case d.RIGHT:case d.DOWN:k=this.headers[(g+1)%l];break;case d.LEFT:case d.UP:k=this.headers[(g-1+l)%l];break;case d.SPACE:case d.ENTER:this._eventHandler(a);break;case d.HOME:k=this.headers[0];break;case d.END:k=this.headers[l-1]}k&&(e(a.target).attr("tabIndex",-1),e(k).attr("tabIndex",0),k.focus(),a.preventDefault())}},_panelKeyDown:function(a){a.keyCode===e.ui.keyCode.UP&&a.ctrlKey&&e(a.currentTarget).prev().focus()},refresh:function(){var a,d,l=this.options.heightStyle,g=
this.element.parent();this.element.css("height",this.originalHeight);"fill"===l?(e.support.minHeight||(d=g.css("overflow"),g.css("overflow","hidden")),a=g.height(),this.element.siblings(":visible").each(function(){var d=e(this),c=d.css("position");c==="absolute"||c==="fixed"||(a=a-d.outerHeight(true))}),d&&g.css("overflow",d),this.headers.each(function(){a=a-e(this).outerHeight(true)}),this.headers.next().each(function(){e(this).height(Math.max(0,a-e(this).innerHeight()+e(this).height()))}).css("overflow",
"auto")):"auto"===l&&(a=0,this.headers.next().each(function(){a=Math.max(a,e(this).height("").height())}).height(a));"content"!==l&&this.element.height(this.element.height())},_activate:function(a){a=this._findActive(a)[0];a!==this.active[0]&&(a=a||this.active[0],this._eventHandler({target:a,currentTarget:a,preventDefault:e.noop}))},_findActive:function(a){return"number"===typeof a?this.headers.eq(a):e()},_setupEvents:function(a){var d={};a&&(e.each(a.split(" "),function(a,b){d[b]="_eventHandler"}),
this._on(this.headers,d))},_eventHandler:function(a){var d=this.options,l=this.active,g=e(a.currentTarget),k=g[0]===l[0],c=k&&d.collapsible,j=c?e():g.next(),n=l.next(),j={oldHeader:l,oldPanel:n,newHeader:c?e():g,newPanel:j};a.preventDefault();k&&!d.collapsible||!1===this._trigger("beforeActivate",a,j)||(d.active=c?!1:this.headers.index(g),this.active=k?e():g,this._toggle(j),l.removeClass("ui-accordion-header-active ui-state-active"),d.icons&&l.children(".ui-accordion-header-icon").removeClass(d.icons.activeHeader).addClass(d.icons.header),
k||(g.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),d.icons&&g.children(".ui-accordion-header-icon").removeClass(d.icons.header).addClass(d.icons.activeHeader),g.next().addClass("ui-accordion-content-active")))},_toggle:function(a){var d=a.newPanel,l=this.prevShow.length?this.prevShow:a.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0);this.prevShow=d;this.prevHide=l;this.options.animate?this._animate(d,l,a):(l.hide(),d.show(),this._toggleComplete(a));
l.attr({"aria-expanded":"false","aria-hidden":"true"});l.prev().attr("aria-selected","false");d.length&&l.length?l.prev().attr("tabIndex",-1):d.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1);d.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(a,f,e){var g,k,c,q=this,n=0,o=this.options.animate||{},p=a.length&&(!f.length||a.index()<f.index())&&o.down||o,r=function(){q._toggleComplete(e)};
"number"===typeof p&&(c=p);"string"===typeof p&&(k=p);k=k||p.easing||o.easing;c=c||p.duration||o.duration;if(!f.length)return a.animate(d,c,k,r);if(!a.length)return f.animate(j,c,k,r);g=a.show().outerHeight();f.animate(j,{duration:c,easing:k,step:function(a,b){b.now=Math.round(a)}});a.hide().animate(d,{duration:c,easing:k,complete:r,step:function(a,b){b.now=Math.round(a);"height"!==b.prop?n+=b.now:"content"!==q.options.heightStyle&&(b.now=Math.round(g-f.outerHeight()-n),n=0)}})},_toggleComplete:function(a){var d=
a.oldPanel;d.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all");d.length&&(d.parent()[0].className=d.parent()[0].className);this._trigger("activate",null,a)}});!1!==e.uiBackCompat&&(function(a,d){a.extend(d.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var e=d._create;d._create=function(){if(this.options.navigation){var d=this,f=this.element.find(this.options.header),c=f.next(),
j=f.add(c).find("a").filter(this.options.navigationFilter)[0];j&&f.add(c).each(function(c){if(a.contains(this,j))return d.options.active=Math.floor(c/2),!1})}e.call(this)}}(m,m.ui.accordion.prototype),function(a,d){a.extend(d.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var e=d._create,g=d._setOption;a.extend(d,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle();e.call(this)},_setOption:function(a,b){if("autoHeight"===a||"clearStyle"===
a||"fillSpace"===a)this.options.heightStyle=this._mergeHeightStyle();g.apply(this,arguments)},_mergeHeightStyle:function(){var a=this.options;if(a.fillSpace)return"fill";if(a.clearStyle)return"content";if(a.autoHeight)return"auto"}})}(m,m.ui.accordion.prototype),function(a,d){a.extend(d.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var e=d._createIcons;d._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected);
e.call(this)}}(m,m.ui.accordion.prototype),function(a,d){d.activate=d._activate;var e=d._findActive;d._findActive=function(a){-1===a&&(a=!1);a&&"number"!==typeof a&&(a=this.headers.index(this.headers.filter(a)),-1===a&&(a=!1));return e.call(this,a)}}(m,m.ui.accordion.prototype),m.ui.accordion.prototype.resize=m.ui.accordion.prototype.refresh,function(a,d){a.extend(d.options,{change:null,changestart:null});var e=d._trigger;d._trigger=function(a,b,c){var d=e.apply(this,arguments);if(!d)return!1;"beforeActivate"===
a?d=e.call(this,"changestart",b,{oldHeader:c.oldHeader,oldContent:c.oldPanel,newHeader:c.newHeader,newContent:c.newPanel}):"activate"===a&&(d=e.call(this,"change",b,{oldHeader:c.oldHeader,oldContent:c.oldPanel,newHeader:c.newHeader,newContent:c.newPanel}));return d}}(m,m.ui.accordion.prototype),function(a,d){a.extend(d.options,{animate:null,animated:"slide"});var e=d._create;d._create=function(){var a=this.options;null===a.animate&&(a.animate=a.animated?"slide"===a.animated?300:"bounceslide"===a.animated?
{duration:200,down:{easing:"easeOutBounce",duration:1E3}}:a.animated:!1);e.call(this)}}(m,m.ui.accordion.prototype))})(m);(function(e){var a=0;e.widget("ui.autocomplete",{version:"1.9.0",defaultElement:"<input>",options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var a,d,b;this.isMultiLine=this._isMultiLine();
this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"];this.isNewMenu=!0;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off");this._on({keydown:function(f){if(this.element.prop("readOnly"))d=b=a=!0;else{d=b=a=!1;var l=e.ui.keyCode;switch(f.keyCode){case l.PAGE_UP:a=!0;this._move("previousPage",f);break;case l.PAGE_DOWN:a=!0;this._move("nextPage",f);break;case l.UP:a=!0;this._keyEvent("previous",f);break;case l.DOWN:a=!0;this._keyEvent("next",f);break;case l.ENTER:case l.NUMPAD_ENTER:this.menu.active&&
(a=!0,f.preventDefault(),this.menu.select(f));break;case l.TAB:this.menu.active&&this.menu.select(f);break;case l.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(f),f.preventDefault());break;default:d=!0,this._searchTimeout(f)}}},keypress:function(b){if(a)a=!1,b.preventDefault();else if(!d){var l=e.ui.keyCode;switch(b.keyCode){case l.PAGE_UP:this._move("previousPage",b);break;case l.PAGE_DOWN:this._move("nextPage",b);break;case l.UP:this._keyEvent("previous",b);break;case l.DOWN:this._keyEvent("next",
b)}}},input:function(a){b?(b=!1,a.preventDefault()):this._searchTimeout(a)},focus:function(){this.selectedItem=null;this.previous=this._value()},blur:function(a){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(a),this._change(a))}});this._initSource();this.menu=e("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:e(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu");this._on(this.menu.element,
{mousedown:function(a){a.preventDefault();this.cancelBlur=!0;this._delay(function(){delete this.cancelBlur});var b=this.menu.element[0];e(a.target).closest(".ui-menu-item").length||this._delay(function(){var a=this;this.document.one("mousedown",function(d){d.target!==a.element[0]&&(d.target!==b&&!e.contains(b,d.target))&&a.close()})})},menufocus:function(a,b){if(this.isNewMenu&&(this.isNewMenu=!1,a.originalEvent&&/^mouse/.test(a.originalEvent.type))){this.menu.blur();this.document.one("mousemove",
function(){e(a.target).trigger(a.originalEvent)});return}var d=b.item.data("ui-autocomplete-item")||b.item.data("item.autocomplete");!1!==this._trigger("focus",a,{item:d})?a.originalEvent&&/^key/.test(a.originalEvent.type)&&this._value(d.value):this.liveRegion.text(d.value)},menuselect:function(a,b){var d=b.item.data("ui-autocomplete-item")||b.item.data("item.autocomplete"),k=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=k,this._delay(function(){this.previous=
k;this.selectedItem=d}));!1!==this._trigger("select",a,{item:d})&&this._value(d.value);this.term=this._value();this.close(a);this.selectedItem=d}});this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element);e.fn.bgiframe&&this.menu.element.bgiframe();this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching);this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete");
this.menu.element.remove();this.liveRegion.remove()},_setOption:function(a,d){this._super(a,d);"source"===a&&this._initSource();"appendTo"===a&&this.menu.element.appendTo(this.document.find(d||"body")[0]);"disabled"===a&&(d&&this.xhr)&&this.xhr.abort()},_isMultiLine:function(){return this.element.is("textarea")?!0:this.element.is("input")?!1:this.element.prop("isContentEditable")},_initSource:function(){var a,d,b=this;e.isArray(this.options.source)?(a=this.options.source,this.source=function(b,d){d(e.ui.autocomplete.filter(a,
b.term))}):"string"===typeof this.options.source?(d=this.options.source,this.source=function(a,l){b.xhr&&b.xhr.abort();b.xhr=e.ajax({url:d,data:a,dataType:"json",success:function(a){l(a)},error:function(){l([])}})}):this.source=this.options.source},_searchTimeout:function(a){clearTimeout(this.searching);this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,a))},this.options.delay)},search:function(a,d){a=null!=a?a:this._value();this.term=this._value();
if(a.length<this.options.minLength)return this.close(d);if(!1!==this._trigger("search",d))return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.cancelSearch=!1;this.source({term:a},this._response())},_response:function(){var e=this,d=++a;return function(b){d===a&&e.__response(b);e.pending--;e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(a){a&&(a=this._normalize(a));this._trigger("response",null,{content:a});
!this.options.disabled&&a&&a.length&&!this.cancelSearch?(this._suggest(a),this._trigger("open")):this._close()},close:function(a){this.cancelSearch=!0;this._close(a)},_close:function(a){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",a))},_change:function(a){this.previous!==this._value()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){return a.length&&a[0].label&&a[0].value?a:e.map(a,function(a){return"string"===
typeof a?{label:a,value:a}:e.extend({label:a.label||a.value,value:a.value||a.label},a)})},_suggest:function(a){var d=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(d,a);this.menu.refresh();d.show();this._resizeMenu();d.position(e.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(a,d){var b=
this;e.each(d,function(d,e){b._renderItemData(a,e)})},_renderItemData:function(a,d){return this._renderItem(a,d).data("ui-autocomplete-item",d)},_renderItem:function(a,d){return e("<li>").append(e("<a>").text(d.label)).appendTo(a)},_move:function(a,d){if(this.menu.element.is(":visible"))if(this.menu.isFirstItem()&&/^previous/.test(a)||this.menu.isLastItem()&&/^next/.test(a))this._value(this.term),this.menu.blur();else this.menu[a](d);else this.search(null,d)},widget:function(){return this.menu.element},
_value:function(a){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(a,d){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,d),d.preventDefault()}});e.extend(e.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(a,d){var b=RegExp(e.ui.autocomplete.escapeRegex(d),"i");return e.grep(a,function(a){return b.test(a.label||a.value||a)})}});e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",
results:function(a){return a+(1<a?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(a){var d;this._superApply(arguments);!this.options.disabled&&!this.cancelSearch&&(d=a&&a.length?this.options.messages.results(a.length):this.options.messages.noResults,this.liveRegion.text(d))}})})(m);(function(e){var a,j,d,b,f=function(){var a=e(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},l=function(a){var b=a.name,c=a.form,d=e([]);
b&&(d=c?e(c).find("[name='"+b+"']"):e("[name='"+b+"']",a.ownerDocument).filter(function(){return!this.form}));return d};e.widget("ui.button",{version:"1.9.0",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f);"boolean"!==typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",
this.options.disabled);this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var g=this,k=this.options,c="checkbox"===this.type||"radio"===this.type,q="ui-state-hover"+(!c?" ui-state-active":"");null===k.label&&(k.label="input"===this.type?this.buttonElement.val():this.buttonElement.html());this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(!k.disabled){e(this).addClass("ui-state-hover");
this===a&&e(this).addClass("ui-state-active")}}).bind("mouseleave"+this.eventNamespace,function(){k.disabled||e(this).removeClass(q)}).bind("click"+this.eventNamespace,function(a){if(k.disabled){a.preventDefault();a.stopImmediatePropagation()}});this.element.bind("focus"+this.eventNamespace,function(){g.buttonElement.addClass("ui-state-focus")}).bind("blur"+this.eventNamespace,function(){g.buttonElement.removeClass("ui-state-focus")});c&&(this.element.bind("change"+this.eventNamespace,function(){b||
g.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(a){if(!k.disabled){b=false;j=a.pageX;d=a.pageY}}).bind("mouseup"+this.eventNamespace,function(a){if(!k.disabled&&(j!==a.pageX||d!==a.pageY))b=true}));"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(k.disabled||b)return false;e(this).toggleClass("ui-state-active");g.buttonElement.attr("aria-pressed",g.element[0].checked)}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,
function(){if(k.disabled||b)return false;e(this).addClass("ui-state-active");g.buttonElement.attr("aria-pressed","true");var a=g.element[0];l(a).not(a).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(k.disabled)return false;e(this).addClass("ui-state-active");a=this;g.document.one("mouseup",function(){a=null})}).bind("mouseup"+this.eventNamespace,function(){if(k.disabled)return false;
e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(a){if(k.disabled)return false;(a.keyCode===e.ui.keyCode.SPACE||a.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(a){a.keyCode===e.ui.keyCode.SPACE&&e(this).click()}));this._setOption("disabled",k.disabled);this._resetButton()},_determineButtonType:function(){var a,
b;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button";"checkbox"===this.type||"radio"===this.type?(a=this.element.parents().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"),
(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",a)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active  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").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());
this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(a,b){this._super(a,b);"disabled"===a?b?this.element.prop("disabled",!0):this.element.prop("disabled",!1):this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);"radio"===this.type?l(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",
"false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("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"),
b=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),c=this.options.icons,d=c.primary&&c.secondary,f=[];c.primary||c.secondary?(this.options.text&&f.push("ui-button-text-icon"+(d?"s":c.primary?"-primary":"-secondary")),c.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+c.primary+"'></span>"),c.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+c.secondary+"'></span>"),this.options.text||(f.push(d?"ui-button-icons-only":
"ui-button-icon-only"),this.hasTitle||a.attr("title",e.trim(b)))):f.push("ui-button-text-only");a.addClass(f.join(" "))}}});e.widget("ui.buttonset",{version:"1.9.0",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,b){"disabled"===a&&this.buttons.button("option",a,b);this._super(a,b)},refresh:function(){var a=
"rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(a?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(m);
(function(e,a){function j(){this.debug=!1;this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._inDialog=this._datepickerShowing=!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".split(" "),monthNamesShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dayNames:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),dayNamesShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),dayNamesMin:"Su Mo Tu We Th Fr Sa".split(" "),
weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,
beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1};e.extend(this._defaults,this.regional[""]);this.dpDiv=d(e('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function d(a){return a.delegate("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a",
"mouseout",function(){e(this).removeClass("ui-state-hover");-1!=this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover");-1!=this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a","mouseover",function(){if(!e.datepicker._isDisabledDatepicker(l.inline?a.parent()[0]:l.input[0]))e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),
e(this).addClass("ui-state-hover"),-1!=this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!=this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover")})}function b(b,d){e.extend(b,d);for(var c in d)if(null==d[c]||d[c]==a)b[c]=d[c];return b}e.extend(e.ui,{datepicker:{version:"1.9.0"}});var f=(new Date).getTime(),l;e.extend(j.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",
arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){b(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null,d;for(d in this._defaults){var f=a.getAttribute("date:"+d);if(f){c=c||{};try{c[d]=eval(f)}catch(l){c[d]=f}}}d=a.nodeName.toLowerCase();f="div"==d||"span"==d;a.id||(this.uuid+=1,a.id="dp"+this.uuid);var j=this._newInst(e(a),f);j.settings=e.extend({},b||{},c||{});"input"==d?this._connectDatepicker(a,j):f&&this._inlineDatepicker(a,j)},_newInst:function(a,
b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d(e('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=e(a);b.append=e([]);b.trigger=e([]);c.hasClass(this.markerClassName)||(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),e.data(a,"datepicker",b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove();c&&(b.append=e('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append));a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");("focus"==
c||"both"==c)&&a.focus(this._showDatepicker);if("button"==c||"both"==c){var c=this._get(b,"buttonText"),f=this._get(b,"buttonImage");b.trigger=e(this._get(b,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):e('<button type="button"></button>').addClass(this._triggerClass).html(""==f?c:e("<img/>").attr({src:f,alt:c,title:c})));a[d?"before":"after"](b.trigger);b.trigger.click(function(){if(e.datepicker._datepickerShowing&&e.datepicker._lastInput==a[0])e.datepicker._hideDatepicker();
else{e.datepicker._datepickerShowing&&e.datepicker._lastInput!=a[0]&&e.datepicker._hideDatepicker();e.datepicker._showDatepicker(a[0])}return false})}},_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){for(var b=0,c=0,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=e(a);c.hasClass(this.markerClassName)||(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)}),e.data(a,"datepicker",b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),
b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,d,c,f,l){a=this._dialogInst;a||(this.uuid+=1,this._dialogInput=e('<input type="text" id="dp'+this.uuid+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),a=this._dialogInst=this._newInst(this._dialogInput,!1),a.settings={},e.data(this._dialogInput[0],"datepicker",a));b(a.settings,f||{});d=d&&d.constructor==Date?this._formatDate(a,d):d;this._dialogInput.val(d);
this._pos=l?l.length?l:[l.pageX,l.pageY]:null;this._pos||(this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)]);this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=!0;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);e.blockUI&&e.blockUI(this.dpDiv);
e.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=e(a),c=e.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();e.removeData(a,"datepicker");"input"==d?(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)):("div"==d||"span"==d)&&b.removeClass(this.markerClassName).empty()}},
_enableDatepicker:function(a){var b=e(a),c=e.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if("input"==d)a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if("div"==d||"span"==d)b=b.children("."+this._inlineClass),b.children().removeClass("ui-state-disabled"),b.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1);this._disabledInputs=e.map(this._disabledInputs,
function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=e(a),c=e.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if("input"==d)a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if("div"==d||"span"==d)b=b.children("."+this._inlineClass),b.children().addClass("ui-state-disabled"),b.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",
!0);this._disabledInputs=e.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 e.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(d,f,c){var l=this._getInst(d);if(2==arguments.length&&"string"==typeof f)return"defaults"==
f?e.extend({},e.datepicker._defaults):l?"all"==f?e.extend({},l.settings):this._get(l,f):null;var j=f||{};"string"==typeof f&&(j={},j[f]=c);if(l){this._curInst==l&&this._hideDatepicker();var o=this._getDateDatepicker(d,!0),p=this._getMinMaxDate(l,"min"),r=this._getMinMaxDate(l,"max");b(l.settings,j);null!==p&&(j.dateFormat!==a&&j.minDate===a)&&(l.settings.minDate=this._formatDate(l,p));null!==r&&(j.dateFormat!==a&&j.maxDate===a)&&(l.settings.maxDate=this._formatDate(l,r));this._attachments(e(d),l);
this._autoSize(l);this._setDate(l,o);this._updateAlternate(l);this._updateDatepicker(l)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_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);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=
e.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if(e.datepicker._datepickerShowing)switch(a.keyCode){case 9:e.datepicker._hideDatepicker();c=!1;break;case 13:return c=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",b.dpDiv),c[0]&&e.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]),(a=e.datepicker._get(b,"onSelect"))?(c=e.datepicker._formatDate(b),a.apply(b.input?b.input[0]:null,[c,b])):e.datepicker._hideDatepicker(),
!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(a.target,a.ctrlKey?-e.datepicker._get(b,"stepBigMonths"):-e.datepicker._get(b,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(a.target,a.ctrlKey?+e.datepicker._get(b,"stepBigMonths"):+e.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&e.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&e.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;
break;case 37:if(a.ctrlKey||a.metaKey)e.datepicker._adjustDate(a.target,d?1:-1,"D");c=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&e.datepicker._adjustDate(a.target,a.ctrlKey?-e.datepicker._get(b,"stepBigMonths"):-e.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&e.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)e.datepicker._adjustDate(a.target,d?-1:1,"D");c=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&e.datepicker._adjustDate(a.target,
a.ctrlKey?+e.datepicker._get(b,"stepBigMonths"):+e.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&e.datepicker._adjustDate(a.target,7,"D");c=a.ctrlKey||a.metaKey;break;default:c=!1}else 36==a.keyCode&&a.ctrlKey?e.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(b){var d=e.datepicker._getInst(b.target);if(e.datepicker._get(d,"constrainInput")){var d=e.datepicker._possibleChars(e.datepicker._get(d,"dateFormat")),c=String.fromCharCode(b.charCode==
a?b.keyCode:b.charCode);return b.ctrlKey||b.metaKey||" ">c||!d||-1<d.indexOf(c)}},_doKeyUp:function(a){a=e.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(e.datepicker.parseDate(e.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,e.datepicker._getFormatConfig(a)))e.datepicker._setDateFromField(a),e.datepicker._updateAlternate(a),e.datepicker._updateDatepicker(a)}catch(b){e.datepicker.log(b)}return!0},_showDatepicker:function(a){a=a.target||a;"input"!=a.nodeName.toLowerCase()&&
(a=e("input",a.parentNode)[0]);if(!(e.datepicker._isDisabledDatepicker(a)||e.datepicker._lastInput==a)){var d=e.datepicker._getInst(a);e.datepicker._curInst&&e.datepicker._curInst!=d&&(e.datepicker._curInst.dpDiv.stop(!0,!0),d&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0]));var c=e.datepicker._get(d,"beforeShow"),c=c?c.apply(a,[a,d]):{};if(!1!==c){b(d.settings,c);d.lastVal=null;e.datepicker._lastInput=a;e.datepicker._setDateFromField(d);e.datepicker._inDialog&&
(a.value="");e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(a),e.datepicker._pos[1]+=a.offsetHeight);var f=!1;e(a).parents().each(function(){f=f|e(this).css("position")=="fixed";return!f});c={left:e.datepicker._pos[0],top:e.datepicker._pos[1]};e.datepicker._pos=null;d.dpDiv.empty();d.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});e.datepicker._updateDatepicker(d);c=e.datepicker._checkOffset(d,c,f);d.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":f?"fixed":
"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!d.inline){var c=e.datepicker._get(d,"showAnim"),l=e.datepicker._get(d,"duration"),j=function(){var a=d.dpDiv.find("iframe.ui-datepicker-cover");if(a.length){var b=e.datepicker._getBorders(d.dpDiv);a.css({left:-b[0],top:-b[1],width:d.dpDiv.outerWidth(),height:d.dpDiv.outerHeight()})}};d.dpDiv.zIndex(e(a).zIndex()+1);e.datepicker._datepickerShowing=!0;if(e.effects&&(e.effects.effect[c]||e.effects[c]))d.dpDiv.show(c,e.datepicker._get(d,
"showOptions"),l,j);else d.dpDiv[c||"show"](c?l:null,j);(!c||!l)&&j();d.input.is(":visible")&&!d.input.is(":disabled")&&d.input.focus();e.datepicker._curInst=d}}}},_updateDatepicker:function(a){this.maxRows=4;var b=e.datepicker._getBorders(a.dpDiv);l=a;a.dpDiv.empty().append(this._generateHTML(a));this._attachHandlers(a);var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+
" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");1<c&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(1!=b[0]||1!=b[1]?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==e.datepicker._curInst&&(e.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=
document.activeElement)&&a.input.focus();if(a.yearshtml){var d=a.yearshtml;setTimeout(function(){d===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);d=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(),f=a.dpDiv.outerHeight(),l=a.input?a.input.outerWidth():
0,j=a.input?a.input.outerHeight():0,r=document.documentElement.clientWidth+(c?0:e(document).scrollLeft()),m=document.documentElement.clientHeight+(c?0:e(document).scrollTop());b.left-=this._get(a,"isRTL")?d-l:0;b.left-=c&&b.left==a.input.offset().left?e(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+j?e(document).scrollTop():0;b.left-=Math.min(b.left,b.left+d>r&&r>d?Math.abs(b.left+d-r):0);b.top-=Math.min(b.top,b.top+f>m&&m>f?Math.abs(f+j):0);return b},_findPos:function(a){for(var b=
this._get(this._getInst(a),"isRTL");a&&("hidden"==a.type||1!=a.nodeType||e.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=e(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(b&&!(a&&b!=e.data(a,"datepicker"))&&this._datepickerShowing){var a=this._get(b,"showAnim"),c=this._get(b,"duration"),d=function(){e.datepicker._tidyDialog(b)};if(e.effects&&(e.effects.effect[a]||e.effects[a]))b.dpDiv.hide(a,e.datepicker._get(b,"showOptions"),c,d);else b.dpDiv["slideDown"==
a?"slideUp":"fadeIn"==a?"fadeOut":"hide"](a?c:null,d);a||d();this._datepickerShowing=!1;(a=this._get(b,"onClose"))&&a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._lastInput=null;this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv)));this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(e.datepicker._curInst){var a=
e(a.target),b=e.datepicker._getInst(a[0]);(a[0].id!=e.datepicker._mainDivId&&0==a.parents("#"+e.datepicker._mainDivId).length&&!a.hasClass(e.datepicker.markerClassName)&&!a.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||a.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!=b)&&e.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var a=e(a),d=this._getInst(a[0]);this._isDisabledDatepicker(a[0])||(this._adjustInstDate(d,
b+("M"==c?this._get(d,"showCurrentAtPos"):0),c),this._updateDatepicker(d))},_gotoToday:function(a){var a=e(a),b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay)b.selectedDay=b.currentDay,b.drawMonth=b.selectedMonth=b.currentMonth,b.drawYear=b.selectedYear=b.currentYear;else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){var a=e(a),
d=this._getInst(a[0]);d["selected"+("M"==c?"Month":"Year")]=d["draw"+("M"==c?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(d);this._adjustDate(a)},_selectDay:function(a,b,c,d){var f=e(a);!e(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(f[0])&&(f=this._getInst(f[0]),f.selectedDay=f.currentDay=e("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){a=e(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){var c=this._getInst(e(a)[0]),b=null!=b?b:this._formatDate(c);c.input&&c.input.val(b);this._updateAlternate(c);var d=this._get(c,"onSelect");d?d.apply(c.input?c.input[0]:null,[b,c]):c.input&&c.input.trigger("change");c.inline?this._updateDatepicker(c):(this._hideDatepicker(),this._lastInput=c.input[0],"object"!=typeof c.input[0]&&c.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),f=this.formatDate(c,d,this._getFormatConfig(a));e(b).each(function(){e(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[0<a&&6>a,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(null==a||null==b)throw"Invalid arguments";
b="object"==typeof b?b.toString():b+"";if(""==b)return null;for(var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,d="string"!=typeof d?d:(new Date).getFullYear()%100+parseInt(d,10),f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,l=(c?c.dayNames:null)||this._defaults.dayNames,j=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,r=(c?c.monthNames:null)||this._defaults.monthNames,m=c=-1,x=-1,v=-1,u=!1,z=function(b){(b=J+1<a.length&&a.charAt(J+1)==b)&&J++;return b},C=function(a){var c=
z(a),a=RegExp("^\\d{1,"+("@"==a?14:"!"==a?20:"y"==a&&c?4:"o"==a?3:2)+"}"),a=b.substring(E).match(a);if(!a)throw"Missing number at position "+E;E+=a[0].length;return parseInt(a[0],10)},F=function(a,c,d){var a=e.map(z(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),g=-1;e.each(a,function(a,c){var d=c[1];if(b.substr(E,d.length).toLowerCase()==d.toLowerCase())return g=c[0],E+=d.length,!1});if(-1!=g)return g+1;throw"Unknown name at position "+E;},A=function(){if(b.charAt(E)!=
a.charAt(J))throw"Unexpected literal at position "+E;E++},E=0,J=0;J<a.length;J++)if(u)"'"==a.charAt(J)&&!z("'")?u=!1:A();else switch(a.charAt(J)){case "d":x=C("d");break;case "D":F("D",f,l);break;case "o":v=C("o");break;case "m":m=C("m");break;case "M":m=F("M",j,r);break;case "y":c=C("y");break;case "@":var K=new Date(C("@")),c=K.getFullYear(),m=K.getMonth()+1,x=K.getDate();break;case "!":K=new Date((C("!")-this._ticksTo1970)/1E4);c=K.getFullYear();m=K.getMonth()+1;x=K.getDate();break;case "'":z("'")?
A():u=!0;break;default:A()}if(E<b.length&&(f=b.substr(E),!/^\s+/.test(f)))throw"Extra/unparsed characters found in date: "+f;-1==c?c=(new Date).getFullYear():100>c&&(c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=d?0:-100));if(-1<v){m=1;x=v;do{d=this._getDaysInMonth(c,m-1);if(x<=d)break;m++;x-=d}while(1)}K=this._daylightSavingAdjust(new Date(c,m-1,x));if(K.getFullYear()!=c||K.getMonth()+1!=m||K.getDate()!=x)throw"Invalid date";return K},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:864E9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,e=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,c=(c?c.monthNames:null)||this._defaults.monthNames,l=
function(b){(b=u+1<a.length&&a.charAt(u+1)==b)&&u++;return b},j=function(a,b,c){b=""+b;if(l(a))for(;b.length<c;)b="0"+b;return b},m=function(a,b,c,d){return l(a)?d[b]:c[b]},x="",v=!1;if(b)for(var u=0;u<a.length;u++)if(v)"'"==a.charAt(u)&&!l("'")?v=!1:x+=a.charAt(u);else switch(a.charAt(u)){case "d":x+=j("d",b.getDate(),2);break;case "D":x+=m("D",b.getDay(),d,f);break;case "o":x+=j("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/
864E5),3);break;case "m":x+=j("m",b.getMonth()+1,2);break;case "M":x+=m("M",b.getMonth(),e,c);break;case "y":x+=l("y")?b.getFullYear():(10>b.getYear()%100?"0":"")+b.getYear()%100;break;case "@":x+=b.getTime();break;case "!":x+=1E4*b.getTime()+this._ticksTo1970;break;case "'":l("'")?x+="'":v=!0;break;default:x+=a.charAt(u)}return x},_possibleChars:function(a){for(var b="",c=!1,d=function(b){(b=f+1<a.length&&a.charAt(f+1)==b)&&f++;return b},f=0;f<a.length;f++)if(c)"'"==a.charAt(f)&&!d("'")?c=!1:b+=
a.charAt(f);else switch(a.charAt(f)){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(f)}return b},_get:function(b,d){return b.settings[d]!==a?b.settings[d]:this._defaults[d]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,f,e;f=e=this._getDefaultDate(a);var l=this._getFormatConfig(a);try{f=this.parseDate(c,d,l)||e}catch(j){this.log(j),
d=b?"":d}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=d?f.getDate():0;a.currentMonth=d?f.getMonth():0;a.currentYear=d?f.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;b.setDate(b.getDate()+a);return b},f=function(b){try{return e.datepicker.parseDate(e.datepicker._get(a,
"dateFormat"),b,e.datepicker._getFormatConfig(a))}catch(c){}for(var d=(b.toLowerCase().match(/^c/)?e.datepicker._getDate(a):null)||new Date,f=d.getFullYear(),k=d.getMonth(),d=d.getDate(),l=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,j=l.exec(b);j;){switch(j[2]||"d"){case "d":case "D":d+=parseInt(j[1],10);break;case "w":case "W":d+=7*parseInt(j[1],10);break;case "m":case "M":k+=parseInt(j[1],10);d=Math.min(d,e.datepicker._getDaysInMonth(f,k));break;case "y":case "Y":f+=parseInt(j[1],10),d=Math.min(d,e.datepicker._getDaysInMonth(f,
k))}j=l.exec(b)}return new Date(f,k,d)};if(b=(b=null==b||""===b?c:"string"==typeof b?f(b):"number"==typeof b?isNaN(b)?c:d(b):new Date(b.getTime()))&&"Invalid Date"==b.toString()?c:b)b.setHours(0),b.setMinutes(0),b.setSeconds(0),b.setMilliseconds(0);return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(12<a.getHours()?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,f=a.selectedMonth,e=a.selectedYear,b=this._restrictMinMax(a,this._determineDate(a,
b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();(f!=a.selectedMonth||e!=a.selectedYear)&&!c&&this._notifyChange(a);this._adjustInstDate(a);a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&""==a.input.val()?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_attachHandlers:function(a){var b=this._get(a,
"stepMonths"),c="#"+a.id.replace(/\\\\/g,"\\");a.dpDiv.find("[data-handler]").map(function(){e(this).bind(this.getAttribute("data-event"),{prev:function(){window["DP_jQuery_"+f].datepicker._adjustDate(c,-b,"M")},next:function(){window["DP_jQuery_"+f].datepicker._adjustDate(c,+b,"M")},hide:function(){window["DP_jQuery_"+f].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+f].datepicker._gotoToday(c)},selectDay:function(){window["DP_jQuery_"+f].datepicker._selectDay(c,+this.getAttribute("data-month"),
+this.getAttribute("data-year"),this);return!1},selectMonth:function(){window["DP_jQuery_"+f].datepicker._selectMonthYear(c,this,"M");return!1},selectYear:function(){window["DP_jQuery_"+f].datepicker._selectMonthYear(c,this,"Y");return!1}}[this.getAttribute("data-handler")])})},_generateHTML:function(a){var b=new Date,b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate())),c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),e=this._get(a,
"navigationAsDateFormat"),l=this._getNumberOfMonths(a),j=this._get(a,"showCurrentAtPos"),m=this._get(a,"stepMonths"),x=1!=l[0]||1!=l[1],v=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),u=this._getMinMaxDate(a,"min"),z=this._getMinMaxDate(a,"max"),j=a.drawMonth-j,C=a.drawYear;0>j&&(j+=12,C--);if(z)for(var F=this._daylightSavingAdjust(new Date(z.getFullYear(),z.getMonth()-l[0]*l[1]+1,z.getDate())),F=u&&F<u?u:F;this._daylightSavingAdjust(new Date(C,
j,1))>F;)j--,0>j&&(j=11,C--);a.drawMonth=j;a.drawYear=C;var F=this._get(a,"prevText"),F=!e?F:this.formatDate(F,this._daylightSavingAdjust(new Date(C,j-m,1)),this._getFormatConfig(a)),F=this._canAdjustMonth(a,-1,C,j)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+F+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+F+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+F+'"><span class="ui-icon ui-icon-circle-triangle-'+
(c?"e":"w")+'">'+F+"</span></a>",A=this._get(a,"nextText"),A=!e?A:this.formatDate(A,this._daylightSavingAdjust(new Date(C,j+m,1)),this._getFormatConfig(a)),f=this._canAdjustMonth(a,1,C,j)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+A+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+A+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+A+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":
"e")+'">'+A+"</span></a>",m=this._get(a,"currentText"),A=this._get(a,"gotoCurrent")&&a.currentDay?v:b,m=!e?m:this.formatDate(m,A,this._getFormatConfig(a)),e=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(a,"closeText")+"</button>":"",d=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?e:"")+(this._isInRange(a,A)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+
m+"</button>":"")+(c?"":e)+"</div>":"",e=parseInt(this._get(a,"firstDay"),10),e=isNaN(e)?0:e,m=this._get(a,"showWeek"),A=this._get(a,"dayNames");this._get(a,"dayNamesShort");var E=this._get(a,"dayNamesMin"),J=this._get(a,"monthNames"),K=this._get(a,"monthNamesShort"),O=this._get(a,"beforeShowDay"),y=this._get(a,"showOtherMonths"),Y=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var D=this._getDefaultDate(a),G="",N=0;N<l[0];N++){var B="";this.maxRows=4;for(var H=0;H<l[1];H++){var R=
this._daylightSavingAdjust(new Date(C,j,a.selectedDay)),L=" ui-corner-all",S="";if(x){S+='<div class="ui-datepicker-group';if(1<l[1])switch(H){case 0:S+=" ui-datepicker-group-first";L=" ui-corner-"+(c?"right":"left");break;case l[1]-1:S+=" ui-datepicker-group-last";L=" ui-corner-"+(c?"left":"right");break;default:S+=" ui-datepicker-group-middle",L=""}S+='">'}for(var S=S+('<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+L+'">'+(/all|left/.test(L)&&0==N?c?f:F:"")+(/all|right/.test(L)&&
0==N?c?F:f:"")+this._generateMonthYearHeader(a,j,C,u,z,0<N||0<H,J,K)+'</div><table class="ui-datepicker-calendar"><thead><tr>'),P=m?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"",L=0;7>L;L++)var W=(L+e)%7,P=P+("<th"+(5<=(L+e+6)%7?' class="ui-datepicker-week-end"':"")+'><span title="'+A[W]+'">'+E[W]+"</span></th>");S+=P+"</tr></thead><tbody>";P=this._getDaysInMonth(C,j);C==a.selectedYear&&j==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,P));L=(this._getFirstDayOfMonth(C,
j)-e+7)%7;P=Math.ceil((L+P)/7);this.maxRows=P=x?this.maxRows>P?this.maxRows:P:P;for(var W=this._daylightSavingAdjust(new Date(C,j,1-L)),la=0;la<P;la++){for(var S=S+"<tr>",ka=!m?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(W)+"</td>",L=0;7>L;L++){var X=O?O.apply(a.input?a.input[0]:null,[W]):[!0,""],U=W.getMonth()!=j,V=U&&!Y||!X[0]||u&&W<u||z&&W>z,ka=ka+('<td class="'+(5<=(L+e+6)%7?" ui-datepicker-week-end":"")+(U?" ui-datepicker-other-month":"")+(W.getTime()==R.getTime()&&
j==a.selectedMonth&&a._keyEvent||D.getTime()==W.getTime()&&D.getTime()==R.getTime()?" "+this._dayOverClass:"")+(V?" "+this._unselectableClass+" ui-state-disabled":"")+(U&&!y?"":" "+X[1]+(W.getTime()==v.getTime()?" "+this._currentClass:"")+(W.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!U||y)&&X[2]?' title="'+X[2]+'"':"")+(V?"":' data-handler="selectDay" data-event="click" data-month="'+W.getMonth()+'" data-year="'+W.getFullYear()+'"')+">"+(U&&!y?"&#xa0;":V?'<span class="ui-state-default">'+
W.getDate()+"</span>":'<a class="ui-state-default'+(W.getTime()==b.getTime()?" ui-state-highlight":"")+(W.getTime()==v.getTime()?" ui-state-active":"")+(U?" ui-priority-secondary":"")+'" href="#">'+W.getDate()+"</a>")+"</td>");W.setDate(W.getDate()+1);W=this._daylightSavingAdjust(W)}S+=ka+"</tr>"}j++;11<j&&(j=0,C++);S+="</tbody></table>"+(x?"</div>"+(0<l[0]&&H==l[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");B+=S}G+=B}G+=d+(Aloha.browser.msie&&7>parseInt(Aloha.browser.version,10)&&!a.inline?
'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=!1;return G},_generateMonthYearHeader:function(a,b,c,d,f,e,l,j){var m=this._get(a,"changeMonth"),x=this._get(a,"changeYear"),v=this._get(a,"showMonthAfterYear"),u='<div class="ui-datepicker-title">',z="";if(e||!m)z+='<span class="ui-datepicker-month">'+l[b]+"</span>";else{for(var l=d&&d.getFullYear()==c,C=f&&f.getFullYear()==c,z=z+'<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">',
F=0;12>F;F++)if((!l||F>=d.getMonth())&&(!C||F<=f.getMonth()))z+='<option value="'+F+'"'+(F==b?' selected="selected"':"")+">"+j[F]+"</option>";z+="</select>"}v||(u+=z+(e||!m||!x?"&#xa0;":""));if(!a.yearshtml)if(a.yearshtml="",e||!x)u+='<span class="ui-datepicker-year">'+c+"</span>";else{var j=this._get(a,"yearRange").split(":"),A=(new Date).getFullYear(),l=function(a){a=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?A+parseInt(a,10):parseInt(a,10);return isNaN(a)?A:a},b=l(j[0]),
j=Math.max(b,l(j[1]||"")),b=d?Math.max(b,d.getFullYear()):b,j=f?Math.min(j,f.getFullYear()):j;for(a.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';b<=j;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";u+=a.yearshtml;a.yearshtml=null}u+=this._get(a,"yearSuffix");v&&(u+=(e||!m||!x?"&#xa0;":"")+z);return u+"</div>"},_adjustInstDate:function(a,b,c){var d=a.drawYear+("Y"==c?b:0),f=a.drawMonth+
("M"==c?b:0),b=Math.min(a.selectedDay,this._getDaysInMonth(d,f))+("D"==c?b:0),d=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,f,b)));a.selectedDay=d.getDate();a.drawMonth=a.selectedMonth=d.getMonth();a.drawYear=a.selectedYear=d.getFullYear();("M"==c||"Y"==c)&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),c=c&&b<c?c:b;return d&&c>d?d:c},_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){a=this._get(a,"numberOfMonths");return null==a?[1,1]:"number"==typeof a?[1,a]:a},_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 f=this._getNumberOfMonths(a),c=this._daylightSavingAdjust(new Date(c,
d+(0>b?b:f[0]*f[1]),1));0>b&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_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"),b="string"!=typeof b?b:(new Date).getFullYear()%100+parseInt(b,10);return{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);b=b?"object"==typeof b?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"),b,this._getFormatConfig(a))}});e.fn.datepicker=function(a){if(!this.length)return this;
e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick).find(document.body).append(e.datepicker.dpDiv),e.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return"string"==typeof a&&("isDisabled"==a||"getDate"==a||"widget"==a)||"option"==a&&2==arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+a+"Datepicker"].apply(e.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?e.datepicker["_"+a+"Datepicker"].apply(e.datepicker,
[this].concat(b)):e.datepicker._attachDatepicker(this,a)})};e.datepicker=new j;e.datepicker.initialized=!1;e.datepicker.uuid=(new Date).getTime();e.datepicker.version="1.9.0";window["DP_jQuery_"+f]=e})(m);(function(e,a){var j={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},d={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.0",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,
height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(a){var d=e(this).css(a).offset().top;0>d&&e(this).css("top",a.top-d)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");"string"!==typeof this.originalTitle&&(this.originalTitle="");this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)};
this.options.title=this.options.title||this.originalTitle;var a=this,d=this.options,l=d.title||"&#160;",g=(this.uiDialog=e("<div>")).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+d.dialogClass).css({display:"none",outline:0,zIndex:d.zIndex}).attr("tabIndex",-1).keydown(function(c){if(d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===e.ui.keyCode.ESCAPE){a.close(c);c.preventDefault()}}).mousedown(function(c){a.moveToTop(false,c)}).appendTo("body");this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);
var k=(this.uiDialogTitlebar=e("<div>")).addClass("ui-dialog-titlebar  ui-widget-header  ui-corner-all  ui-helper-clearfix").prependTo(g),c=e("<a href='#'></a>").addClass("ui-dialog-titlebar-close  ui-corner-all").attr("role","button").click(function(c){c.preventDefault();a.close(c)}).appendTo(k);(this.uiDialogTitlebarCloseText=e("<span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(c);var l=e("<span>").uniqueId().addClass("ui-dialog-title").html(l).prependTo(k),j=(this.uiDialogButtonPane=
e("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");(this.uiButtonSet=e("<div>")).addClass("ui-dialog-buttonset").appendTo(j);g.attr({role:"dialog","aria-labelledby":l.attr("id")});k.find("*").add(k).disableSelection();this._hoverable(c);this._focusable(c);d.draggable&&e.fn.draggable&&this._makeDraggable();d.resizable&&e.fn.resizable&&this._makeResizable();this._createButtons(d.buttons);this._isOpen=!1;e.fn.bgiframe&&g.bgiframe();this._on(g,{keydown:function(a){if(d.modal&&
a.keyCode===e.ui.keyCode.TAB){var b=e(":tabbable",g),c=b.filter(":first"),b=b.filter(":last");if(a.target===b[0]&&!a.shiftKey){c.focus(1);return false}if(a.target===c[0]&&a.shiftKey){b.focus(1);return false}}}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var a,d=this.oldPosition;this.overlay&&this.overlay.destroy();this.uiDialog.hide();this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();this.originalTitle&&this.element.attr("title",
this.originalTitle);a=d.parent.children().eq(d.index);a.length&&a[0]!==this.element[0]?a.before(this.element):d.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(a){var d=this,l,g;if(this._isOpen&&!1!==this._trigger("beforeClose",a))return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this.uiDialog.hide(this.options.hide,function(){d._trigger("close",a)}):(this.uiDialog.hide(),this._trigger("close",a)),e.ui.dialog.overlay.resize(),this.options.modal&&
(l=0,e(".ui-dialog").each(function(){if(this!==d.uiDialog[0]){g=e(this).css("z-index");isNaN(g)||(l=Math.max(l,g))}}),e.ui.dialog.maxZ=l),this},isOpen:function(){return this._isOpen},moveToTop:function(a,d){var l=this.options;if(l.modal&&!a||!l.stack&&!l.modal)return this._trigger("focus",d);l.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=l.zIndex);this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ));l={scrollTop:this.element.scrollTop(),
scrollLeft:this.element.scrollLeft()};e.ui.dialog.maxZ+=1;this.uiDialog.css("z-index",e.ui.dialog.maxZ);this.element.attr(l);this._trigger("focus",d);return this},open:function(){if(!this._isOpen){var a;a=this.options;var d=this.uiDialog;this._size();this._position(a.position);d.show(a.show);this.overlay=a.modal?new e.ui.dialog.overlay(this):null;this.moveToTop(!0);a=this.element.find(":tabbable");a.length||(a=this.uiDialogButtonPane.find(":tabbable"),a.length||(a=d));a.eq(0).focus();this._isOpen=
!0;this._trigger("open");return this}},_createButtons:function(a){var d=this,l=!1;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();"object"===typeof a&&null!==a&&e.each(a,function(){return!(l=!0)});l?(e.each(a,function(a,b){var b=e.isFunction(b)?{click:b,text:a}:b,c=e("<button type='button'>").attr(b,!0).unbind("click").click(function(){b.click.apply(d.element[0],arguments)}).appendTo(d.uiButtonSet);e.fn.button&&c.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):
this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function a(b){return{position:b.position,offset:b.offset}}var d=this,l=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(g,l){e(this).addClass("ui-dialog-dragging");d._trigger("dragStart",g,a(l))},drag:function(g,e){d._trigger("drag",g,a(e))},stop:function(g,k){l.position=[k.position.left-d.document.scrollLeft(),k.position.top-
d.document.scrollTop()];e(this).removeClass("ui-dialog-dragging");d._trigger("dragStop",g,a(k));e.ui.dialog.overlay.resize()}})},_makeResizable:function(b){function d(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}var b=b===a?this.options.resizable:b,l=this,g=this.options,k=this.uiDialog.css("position"),b="string"===typeof b?b:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,
maxWidth:g.maxWidth,maxHeight:g.maxHeight,minWidth:g.minWidth,minHeight:this._minHeight(),handles:b,start:function(a,b){e(this).addClass("ui-dialog-resizing");l._trigger("resizeStart",a,d(b))},resize:function(a,b){l._trigger("resize",a,d(b))},stop:function(a,b){e(this).removeClass("ui-dialog-resizing");g.height=e(this).height();g.width=e(this).width();l._trigger("resizeStop",a,d(b));e.ui.dialog.overlay.resize()}}).css("position",k).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},
_minHeight:function(){var a=this.options;return"auto"===a.height?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var d=[],l=[0,0],g;if(a){if("string"===typeof a||"object"===typeof a&&"0"in a)d=a.split?a.split(" "):[a[0],a[1]],1===d.length&&(d[1]=d[0]),e.each(["left","top"],function(a,b){+d[a]===d[a]&&(l[a]=d[a],d[a]=b)}),a={my:d.join(" "),at:d.join(" "),offset:l.join(" ")};a=e.extend({},e.ui.dialog.prototype.options.position,a)}else a=e.ui.dialog.prototype.options.position;(g=this.uiDialog.is(":visible"))||
this.uiDialog.show();this.uiDialog.position(a);g||this.uiDialog.hide()},_setOptions:function(a){var f=this,l={},g=!1;e.each(a,function(a,b){f._setOption(a,b);a in j&&(g=!0);a in d&&(l[a]=b)});g&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",l)},_setOption:function(a,d){var l,g=this.uiDialog;switch(a){case "buttons":this._createButtons(d);break;case "closeText":this.uiDialogTitlebarCloseText.text(""+d);break;case "dialogClass":g.removeClass(this.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
d);break;case "disabled":d?g.addClass("ui-dialog-disabled"):g.removeClass("ui-dialog-disabled");break;case "draggable":(l=g.is(":data(draggable)"))&&!d&&g.draggable("destroy");!l&&d&&this._makeDraggable();break;case "position":this._position(d);break;case "resizable":(l=g.is(":data(resizable)"))&&!d&&g.resizable("destroy");l&&"string"===typeof d&&g.resizable("option","handles",d);!l&&!1!==d&&this._makeResizable(d);break;case "title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(d||"&#160;"))}this._super(a,
d)},_size:function(){var a,d,l=this.options,g=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});l.minWidth>l.width&&(l.width=l.minWidth);a=this.uiDialog.css({height:"auto",width:l.width}).outerHeight();d=Math.max(0,l.minHeight-a);"auto"===l.height?e.support.minHeight?this.element.css({minHeight:d,height:"auto"}):(this.uiDialog.show(),a=this.element.css("height","auto").height(),g||this.uiDialog.hide(),this.element.height(Math.max(a,d))):this.element.height(Math.max(l.height-
a,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");a||(a=this.uuid+=1);return"ui-dialog-title-"+a},overlay:function(a){this.$el=e.ui.dialog.overlay.create(a)}});e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus mousedown mouseup keydown keypress click".split(" "),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){0===
this.instances.length&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(a){if(e(a.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var d=this.oldInstances.pop()||e("<div>").addClass("ui-widget-overlay");e(document).bind("keydown.dialog-overlay",function(l){var g=e.ui.dialog.overlay.instances;if(g.length!==0&&g[g.length-1]===d&&a.options.closeOnEscape&&!l.isDefaultPrevented()&&
l.keyCode&&l.keyCode===e.ui.keyCode.ESCAPE){a.close(l);l.preventDefault()}});d.appendTo(document.body).css({width:this.width(),height:this.height()});e.fn.bgiframe&&d.bgiframe();this.instances.push(d);return d},destroy:function(a){var d=e.inArray(a,this.instances),l=0;-1!==d&&this.oldInstances.push(this.instances.splice(d,1)[0]);0===this.instances.length&&e([document,window]).unbind(".dialog-overlay");a.height(0).width(0).remove();e.each(this.instances,function(){l=Math.max(l,this.css("z-index"))});
this.maxZ=l},height:function(){var a,d;return Aloha.browser.msie?(a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),a<d?e(window).height()+"px":a+"px"):e(document).height()+"px"},width:function(){var a,d;return Aloha.browser.msie?(a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),d=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),a<d?e(window).width()+
"px":a+"px"):e(document).width()+"px"},resize:function(){var a=e([]);e.each(e.ui.dialog.overlay.instances,function(){a=a.add(this)});a.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}});e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})})(m);(function(e){var a=!1;e.widget("ui.menu",{version:"1.9.0",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",
at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(a){this.options.disabled&&a.preventDefault()},this));this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true");
this._on({"mousedown .ui-menu-item > a":function(a){a.preventDefault()},"click .ui-state-disabled > a":function(a){a.preventDefault()},"click .ui-menu-item:has(a)":function(j){var d=e(j.target).closest(".ui-menu-item");!a&&d.not(".ui-state-disabled").length&&(a=!0,this.select(j),d.has(".ui-menu").length?this.expand(j):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(a){var d=
e(a.currentTarget);d.siblings().children(".ui-state-active").removeClass("ui-state-active");this.focus(a,d)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(a,d){var b=this.active||this.element.children(".ui-menu-item").eq(0);d||this.focus(a,b)},blur:function(a){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(a)})},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(j){e(j.target).closest(".ui-menu").length||
this.collapseAll(j);a=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show();this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var a=
e(this);a.data("ui-menu-submenu-carat")&&a.remove()});this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(a){function d(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var b,f,l,g,k=!0;switch(a.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(a);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(a);break;case e.ui.keyCode.HOME:this._move("first","first",a);break;case e.ui.keyCode.END:this._move("last","last",a);break;case e.ui.keyCode.UP:this.previous(a);
break;case e.ui.keyCode.DOWN:this.next(a);break;case e.ui.keyCode.LEFT:this.collapse(a);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(a);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(a);break;case e.ui.keyCode.ESCAPE:this.collapse(a);break;default:(k=!1,b=this.previousFilter||"",f=String.fromCharCode(a.keyCode),l=!1,clearTimeout(this.filterTimer),f===b?l=!0:f=b+f,g=RegExp("^"+d(f),"i"),b=this.activeMenu.children(".ui-menu-item").filter(function(){return g.test(e(this).children("a").text())}),
b=l&&-1!==b.index(this.active.next())?this.active.nextAll(".ui-menu-item"):b,b.length||(f=String.fromCharCode(a.keyCode),g=RegExp("^"+d(f),"i"),b=this.activeMenu.children(".ui-menu-item").filter(function(){return g.test(e(this).children("a").text())})),b.length)?(this.focus(a,b),1<b.length?(this.previousFilter=f,this.filterTimer=this._delay(function(){delete this.previousFilter},1E3)):delete this.previousFilter):delete this.previousFilter}k&&a.preventDefault()},_activate:function(a){this.active.is(".ui-state-disabled")||
(this.active.children("a[aria-haspopup='true']").length?this.expand(a):this.select(a))},refresh:function(){var a,d=this.options.icons.submenu,b=this.element.find(this.options.menus+":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"});a=b.add(this.element);a.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,
role:this._itemRole()});a.children(":not(.ui-menu-item)").each(function(){var a=e(this);/[^\-—–\s]/.test(a.text())||a.addClass("ui-widget-content ui-menu-divider")});a.children(".ui-state-disabled").attr("aria-disabled","true");b.each(function(){var a=e(this),b=a.prev("a"),g=e("<span>").addClass("ui-menu-icon ui-icon "+d).data("ui-menu-submenu-carat",!0);b.attr("aria-haspopup","true").prepend(g);a.attr("aria-labelledby",b.attr("id"))});this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},
_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(a,d){var b;this.blur(a,a&&"focus"===a.type);this._scrollIntoView(d);this.active=d.first();b=this.active.children("a").addClass("ui-state-focus");this.options.role&&this.element.attr("aria-activedescendant",b.attr("id"));this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active");a&&"keydown"===a.type?this._close():this.timer=this._delay(function(){this._close()},this.delay);
b=d.children(".ui-menu");b.length&&/^mouse/.test(a.type)&&this._startOpening(b);this.activeMenu=d.parent();this._trigger("focus",a,{item:d})},_scrollIntoView:function(a){var d,b,f;this._hasScroll()&&(d=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,b=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,d=a.offset().top-this.activeMenu.offset().top-d-b,b=this.activeMenu.scrollTop(),f=this.activeMenu.height(),a=a.height(),0>d?this.activeMenu.scrollTop(b+d):d+a>f&&this.activeMenu.scrollTop(b+
d-f+a))},blur:function(a,d){d||clearTimeout(this.timer);this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",a,{item:this.active}))},_startOpening:function(a){clearTimeout(this.timer);"true"===a.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close();this._open(a)},this.delay))},_open:function(a){var d=e.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(a.parents(".ui-menu")).hide().attr("aria-hidden",
"true");a.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(d)},collapseAll:function(a,d){clearTimeout(this.timer);this.timer=this._delay(function(){var b=d?this.element:e(a&&a.target).closest(this.element.find(".ui-menu"));b.length||(b=this.element);this._close(b);this.blur(a);this.activeMenu=b},this.delay)},_close:function(a){a||(a=this.active?this.active.parent():this.element);a.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},
collapse:function(a){var d=this.active&&this.active.parent().closest(".ui-menu-item",this.element);d&&d.length&&(this._close(),this.focus(a,d))},expand:function(a){var d=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();d&&d.length&&(this._open(d.parent()),this._delay(function(){this.focus(a,d)}))},next:function(a){this._move("next","first",a)},previous:function(a){this._move("prev","last",a)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},
isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(a,d,b){var f;this.active&&(f="first"===a||"last"===a?this.active["first"===a?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[a+"All"](".ui-menu-item").eq(0));if(!f||!f.length||!this.active)f=this.activeMenu.children(".ui-menu-item")[d]();this.focus(b,f)},nextPage:function(a){var d,b,f;this.active?this.isLastItem()||(this._hasScroll()?(b=this.active.offset().top,f=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){d=
e(this);return 0>d.offset().top-b-f}),this.focus(a,d)):this.focus(a,this.activeMenu.children(".ui-menu-item")[!this.active?"first":"last"]())):this.next(a)},previousPage:function(a){var d,b,f;this.active?this.isFirstItem()||(this._hasScroll()?(b=this.active.offset().top,f=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){d=e(this);return 0<d.offset().top-b+f}),this.focus(a,d)):this.focus(a,this.activeMenu.children(".ui-menu-item").first())):this.next(a)},_hasScroll:function(){return this.element.outerHeight()<
this.element.prop("scrollHeight")},select:function(a){this.active=this.active||e(a.target).closest(".ui-menu-item");var d={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(a,!0);this._trigger("select",a,d)}})})(m);(function(e,a){e.widget("ui.progressbar",{version:"1.9.0",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=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.valueDiv.remove()},value:function(e){if(e===a)return this._value();this._setOption("value",
e);return this},_setOption:function(a,d){"value"===a&&(this.options.value=d,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete"));this._super(a,d)},_value:function(){var a=this.options.value;"number"!==typeof a&&(a=0);return 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(),d=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(d.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}})})(m);(function(e){e.widget("ui.slider",e.ui.mouse,{version:"1.9.0",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var a,j=this.options,d=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),b=j.values&&j.values.length||1,f=[];this._mouseSliding=
this._keySliding=!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"+(j.disabled?" ui-slider-disabled ui-disabled":""));this.range=e([]);if(j.range){if(!0===j.range&&(j.values||(j.values=[this._valueMin(),this._valueMin()]),j.values.length&&2!==j.values.length))j.values=[j.values[0],j.values[0]];this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+
("min"===j.range||"max"===j.range?" ui-slider-range-"+j.range:""))}for(a=d.length;a<b;a++)f.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");this.handles=d.add(e(f.join("")).appendTo(this.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).mouseenter(function(){j.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){j.disabled?
e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")});this.handles.each(function(a){e(this).data("ui-slider-handle-index",a)});this._on(this.handles,{keydown:function(a){var b,d,c,f=e(a.target).data("ui-slider-handle-index");switch(a.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(a.preventDefault(),
!this._keySliding&&(this._keySliding=!0,e(a.target).addClass("ui-state-active"),b=this._start(a,f),!1===b))return}c=this.options.step;b=this.options.values&&this.options.values.length?d=this.values(f):d=this.value();switch(a.keyCode){case e.ui.keyCode.HOME:d=this._valueMin();break;case e.ui.keyCode.END:d=this._valueMax();break;case e.ui.keyCode.PAGE_UP:d=this._trimAlignValue(b+(this._valueMax()-this._valueMin())/5);break;case e.ui.keyCode.PAGE_DOWN:d=this._trimAlignValue(b-(this._valueMax()-this._valueMin())/
5);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(b===this._valueMax())return;d=this._trimAlignValue(b+c);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(b===this._valueMin())return;d=this._trimAlignValue(b-c)}this._slide(a,f,d)},keyup:function(a){var b=e(a.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(a,b),this._change(a,b),e(a.target).removeClass("ui-state-active"))}});this._refreshValue();this._animateOff=!1},_destroy:function(){this.handles.remove();
this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all");this._mouseDestroy()},_mouseCapture:function(a){var j,d,b,f,l,g=this;l=this.options;if(l.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();j=this._normValueFromMouse({x:a.pageX,y:a.pageY});d=this._valueMax()-this._valueMin()+1;this.handles.each(function(a){var c=
Math.abs(j-g.values(a));d>c&&(d=c,b=e(this),f=a)});!0===l.range&&this.values(1)===l.min&&(f+=1,b=e(this.handles[f]));if(!1===this._start(a,f))return!1;this._mouseSliding=!0;this._handleIndex=f;b.addClass("ui-state-active").focus();l=b.offset();this._clickOffset=!e(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-l.left-b.width()/2,top:a.pageY-l.top-b.height()/2-(parseInt(b.css("borderTopWidth"),10)||0)-(parseInt(b.css("borderBottomWidth"),10)||0)+(parseInt(b.css("marginTop"),
10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,f,j);return this._animateOff=!0},_mouseStart:function(){return!0},_mouseDrag:function(a){var e=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,e);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=!1;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=!1},_detectOrientation:function(){this.orientation=
"vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(a){var e;"horizontal"===this.orientation?(e=this.elementSize.width,a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0));e=a/e;1<e&&(e=1);0>e&&(e=0);"vertical"===this.orientation&&(e=1-e);a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+e*a)},_start:function(a,
e){var d={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(d.value=this.values(e),d.values=this.values());return this._trigger("start",a,d)},_slide:function(a,e,d){var b;if(this.options.values&&this.options.values.length){b=this.values(e?0:1);if(2===this.options.values.length&&!0===this.options.range&&(0===e&&d>b||1===e&&d<b))d=b;d!==this.values(e)&&(b=this.values(),b[e]=d,a=this._trigger("slide",a,{handle:this.handles[e],value:d,values:b}),this.values(e?
0:1),!1!==a&&this.values(e,d,!0))}else d!==this.value()&&(a=this._trigger("slide",a,{handle:this.handles[e],value:d}),!1!==a&&this.value(d))},_stop:function(a,e){var d={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(d.value=this.values(e),d.values=this.values());this._trigger("stop",a,d)},_change:function(a,e){if(!this._keySliding&&!this._mouseSliding){var d={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(d.value=
this.values(e),d.values=this.values());this._trigger("change",a,d)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(a,j){var d,b,f;if(1<arguments.length)this.options.values[a]=this._trimAlignValue(j),this._refreshValue(),this._change(null,a);else if(arguments.length)if(e.isArray(arguments[0])){d=this.options.values;b=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(b[f]),
this._change(null,f);this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):this.value();else return this._values()},_setOption:function(a,j){var d,b=0;e.isArray(this.options.values)&&(b=this.options.values.length);e.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":j?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",
!1),this.element.removeClass("ui-disabled"));break;case "orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=!0;this._refreshValue();this._change(null,0);this._animateOff=!1;break;case "values":this._animateOff=!0;this._refreshValue();for(d=0;d<b;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},
_values:function(a){var e,d;if(arguments.length)return e=this.options.values[a],e=this._trimAlignValue(e);e=this.options.values.slice();for(d=0;d<e.length;d+=1)e[d]=this._trimAlignValue(e[d]);return e},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var e=0<this.options.step?this.options.step:1,d=(a-this._valueMin())%e,a=a-d;2*Math.abs(d)>=e&&(a+=0<d?e:-e);return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},
_valueMax:function(){return this.options.max},_refreshValue:function(){var a,j,d,b,f,l=this.options.range,g=this.options,k=this,c=!this._animateOff?g.animate:!1,q={};if(this.options.values&&this.options.values.length)this.handles.each(function(b){j=100*((k.values(b)-k._valueMin())/(k._valueMax()-k._valueMin()));q["horizontal"===k.orientation?"left":"bottom"]=j+"%";e(this).stop(1,1)[c?"animate":"css"](q,g.animate);if(!0===k.options.range)if("horizontal"===k.orientation){if(0===b)k.range.stop(1,1)[c?
"animate":"css"]({left:j+"%"},g.animate);if(1===b)k.range[c?"animate":"css"]({width:j-a+"%"},{queue:!1,duration:g.animate})}else{if(0===b)k.range.stop(1,1)[c?"animate":"css"]({bottom:j+"%"},g.animate);if(1===b)k.range[c?"animate":"css"]({height:j-a+"%"},{queue:!1,duration:g.animate})}a=j});else{d=this.value();b=this._valueMin();f=this._valueMax();j=f!==b?100*((d-b)/(f-b)):0;q["horizontal"===this.orientation?"left":"bottom"]=j+"%";this.handle.stop(1,1)[c?"animate":"css"](q,g.animate);if("min"===l&&
"horizontal"===this.orientation)this.range.stop(1,1)[c?"animate":"css"]({width:j+"%"},g.animate);if("max"===l&&"horizontal"===this.orientation)this.range[c?"animate":"css"]({width:100-j+"%"},{queue:!1,duration:g.animate});if("min"===l&&"vertical"===this.orientation)this.range.stop(1,1)[c?"animate":"css"]({height:j+"%"},g.animate);if("max"===l&&"vertical"===this.orientation)this.range[c?"animate":"css"]({height:100-j+"%"},{queue:!1,duration:g.animate})}}})})(m);(function(e){function a(a){return function(){var d=
this.element.val();a.apply(this,arguments);this._refresh();d!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.0",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max);this._setOption("min",this.options.min);this._setOption("step",
this.options.step);this._value(this.element.val(),!0);this._draw();this._on(this._events);this._refresh();this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var a={},d=this.element;e.each(["min","max","step"],function(b,f){var e=d.attr(f);void 0!==e&&e.length&&(a[f]=e)});return a},_events:{keydown:function(a){this._start(a)&&this._keydown(a)&&a.preventDefault()},keyup:"_stop",focus:function(){this.uiSpinner.addClass("ui-state-active");
this.previous=this.element.val()},blur:function(a){this.cancelBlur?delete this.cancelBlur:(this._refresh(),this.uiSpinner.removeClass("ui-state-active"),this.previous!==this.element.val()&&this._trigger("change",a))},mousewheel:function(a,d){if(d){if(!this.spinning&&!this._start(a))return!1;this._spin((0<d?1:-1)*this.options.step,a);clearTimeout(this.mousewheelTimer);this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(a)},100);a.preventDefault()}},"mousedown .ui-spinner-button":function(a){function d(){this.element[0]!==
this.document[0].activeElement&&(this.element.focus(),this.previous=b,this._delay(function(){this.previous=b}))}var b;b=this.element[0]===this.document[0].activeElement?this.previous:this.element.val();a.preventDefault();d.call(this);this.cancelBlur=!0;this._delay(function(){delete this.cancelBlur;d.call(this)});!1!==this._start(a)&&this._repeat(null,e(a.currentTarget).hasClass("ui-spinner-up")?1:-1,a)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(a){if(e(a.currentTarget).hasClass("ui-state-active")){if(!1===
this._start(a))return!1;this._repeat(null,e(a.currentTarget).hasClass("ui-spinner-up")?1:-1,a)}},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var a=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this._hoverable(a);this.element.attr("role","spinbutton");this.buttons=a.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all");this.buttons.height()>Math.ceil(0.5*
a.height())&&0<a.height()&&a.height(a.height());this.options.disabled&&this.disable()},_keydown:function(a){var d=this.options,b=e.ui.keyCode;switch(a.keyCode){case b.UP:return this._repeat(null,1,a),!0;case b.DOWN:return this._repeat(null,-1,a),!0;case b.PAGE_UP:return this._repeat(null,d.page,a),!0;case b.PAGE_DOWN:return this._repeat(null,-d.page,a),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-state-default ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+
this.options.icons.up+"'>&#9650;</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>&#9660;</span></a>"},_start:function(a){if(!this.spinning&&!1===this._trigger("start",a))return!1;this.counter||(this.counter=1);return this.spinning=!0},_repeat:function(a,d,b){a=a||500;clearTimeout(this.timer);this.timer=this._delay(function(){this._repeat(40,d,b)},a);this._spin(d*this.options.step,b)},_spin:function(a,d){var b=this.value()||0;this.counter||
(this.counter=1);b=this._adjustValue(b+a*this._increment(this.counter));if(!this.spinning||!1!==this._trigger("spin",d,{value:b}))this._value(b),this.counter++},_increment:function(a){var d=this.options.incremental;return d?e.isFunction(d)?d(a):Math.floor(a*a*a/5E4-a*a/500+17*a/200+1):1},_precision:function(){var a=this._precisionOf(this.options.step);null!==this.options.min&&(a=Math.max(a,this._precisionOf(this.options.min)));return a},_precisionOf:function(a){var a=a.toString(),d=a.indexOf(".");
return-1===d?0:a.length-d-1},_adjustValue:function(a){var d,b=this.options;d=null!==b.min?b.min:0;a=Math.round((a-d)/b.step)*b.step;a=parseFloat((d+a).toFixed(this._precision()));return null!==b.max&&a>b.max?b.max:null!==b.min&&a<b.min?b.min:a},_stop:function(a){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",a))},_setOption:function(a,d){if("culture"===a||"numberFormat"===a){var b=this._parse(this.element.val());this.options[a]=
d;this.element.val(this._format(b))}else{if("max"===a||"min"===a||"step"===a)"string"===typeof d&&(d=this._parse(d));this._super(a,d);"disabled"===a&&(d?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))}},_setOptions:a(function(a){this._super(a);this._value(this.element.val())}),_parse:function(a){"string"===typeof a&&""!==a&&(a=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(a,10,this.options.culture):
+a);return""===a||isNaN(a)?null:a},_format:function(a){return""===a?"":window.Globalize&&this.options.numberFormat?Globalize.format(a,this.options.numberFormat,this.options.culture):a},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(a,d){var b;""!==a&&(b=this._parse(a),null!==b&&(d||(b=this._adjustValue(b)),a=this._format(b)));this.element.val(a);this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",
!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.uiSpinner.replaceWith(this.element)},stepUp:a(function(a){this._stepUp(a)}),_stepUp:function(a){this._spin((a||1)*this.options.step)},stepDown:a(function(a){this._stepDown(a)}),_stepDown:function(a){this._spin((a||1)*-this.options.step)},pageUp:a(function(a){this._stepUp((a||1)*this.options.page)}),pageDown:a(function(a){this._stepDown((a||1)*this.options.page)}),
value:function(e){if(!arguments.length)return this._parse(this.element.val());a(this._value).call(this,e)},widget:function(){return this.uiSpinner}})})(m);(function(e,a){function j(a){a=a.cloneNode(!1);return 1<a.hash.length&&a.href.replace(b,"")===location.href.replace(b,"")}var d=0,b=/#.*$/;e.widget("ui.tabs",{version:"1.9.0",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var a=
this,b=this.options,d=b.active;this.running=!1;this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",b.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(a){e(this).is(".ui-state-disabled")&&a.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()});this._processTabs();if(null===d&&(location.hash&&this.anchors.each(function(a,
b){if(b.hash===location.hash)return d=a,!1}),null===d&&(d=this.tabs.filter(".ui-tabs-active").index()),null===d||-1===d))d=this.tabs.length?0:!1;!1!==d&&(d=this.tabs.index(this.tabs.eq(d)),-1===d&&(d=b.collapsible?!1:0));b.active=d;!b.collapsible&&(!1===b.active&&this.anchors.length)&&(b.active=0);e.isArray(b.disabled)&&(b.disabled=e.unique(b.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(b){return a.tabs.index(b)}))).sort());this.active=!1!==this.options.active&&this.anchors.length?
this._findActive(this.options.active):e();this._refresh();this.active.length&&this.load(b.active)},_getCreateEventData:function(){return{tab:this.active,panel:!this.active.length?e():this._getPanelForTab(this.active)}},_tabKeydown:function(a){var b=e(this.document[0].activeElement).closest("li"),d=this.tabs.index(b),k=!0;if(!this._handlePageNav(a)){switch(a.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:d++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:k=!1;d--;break;case e.ui.keyCode.END:d=
this.anchors.length-1;break;case e.ui.keyCode.HOME:d=0;break;case e.ui.keyCode.SPACE:a.preventDefault();clearTimeout(this.activating);this._activate(d);return;case e.ui.keyCode.ENTER:a.preventDefault();clearTimeout(this.activating);this._activate(d===this.options.active?!1:d);return;default:return}a.preventDefault();clearTimeout(this.activating);d=this._focusNextTab(d,k);a.ctrlKey||(b.attr("aria-selected","false"),this.tabs.eq(d).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",
d)},this.delay))}},_panelKeydown:function(a){!this._handlePageNav(a)&&(a.ctrlKey&&a.keyCode===e.ui.keyCode.UP)&&(a.preventDefault(),this.active.focus())},_handlePageNav:function(a){if(a.altKey&&a.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(a.altKey&&a.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(a,b){function d(){a>k&&(a=0);0>a&&(a=k);return a}for(var k=this.tabs.length-
1;-1!==e.inArray(d(),this.options.disabled);)a=b?a+1:a-1;return a},_focusNextTab:function(a,b){a=this._findNextTab(a,b);this.tabs.eq(a).focus();return a},_setOption:function(a,b){"active"===a?this._activate(b):"disabled"===a?this._setupDisabled(b):(this._super(a,b),"collapsible"===a&&(this.element.toggleClass("ui-tabs-collapsible",b),!b&&!1===this.options.active&&this._activate(0)),"event"===a&&this._setupEvents(b),"heightStyle"===a&&this._setupHeightStyle(b))},_tabId:function(a){return a.attr("aria-controls")||
"ui-tabs-"+ ++d},_sanitizeSelector:function(a){return a?a.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var a=this.options,b=this.tablist.children(":has(a[href])");a.disabled=e.map(b.filter(".ui-state-disabled"),function(a){return b.index(a)});this._processTabs();!1===a.active||!this.anchors.length?(a.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===a.disabled.length?(a.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,
a.active-1),!1)):a.active=this.tabs.index(this.active);this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"});this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",
tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var a=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist");this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1});this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",
tabIndex:-1});this.panels=e();this.anchors.each(function(b,d){var k,c,q,m=e(d).uniqueId().attr("id"),o=e(d).closest("li"),p=o.attr("aria-controls");j(d)?(k=d.hash,c=a.element.find(a._sanitizeSelector(k))):(q=a._tabId(o),k="#"+q,c=a.element.find(k),c.length||(c=a._createPanel(q),c.insertAfter(a.panels[b-1]||a.tablist)),c.attr("aria-live","polite"));c.length&&(a.panels=a.panels.add(c));p&&o.data("ui-tabs-aria-controls",p);o.attr({"aria-controls":k.substring(1),"aria-labelledby":m});c.attr("aria-labelledby",
m)});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(a){return e("<div>").attr("id",a).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(a){e.isArray(a)&&(a.length?a.length===this.anchors.length&&(a=!0):a=!1);for(var b=0,d;d=this.tabs[b];b++)!0===a||-1!==e.inArray(b,a)?e(d).addClass("ui-state-disabled").attr("aria-disabled",
"true"):e(d).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=a},_setupEvents:function(a){var b={click:function(a){a.preventDefault()}};a&&e.each(a.split(" "),function(a,d){b[d]="_eventHandler"});this._off(this.anchors.add(this.tabs).add(this.panels));this._on(this.anchors,b);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs)},_setupHeightStyle:function(a){var b,d,k=this.element.parent();
"fill"===a?(e.support.minHeight||(d=k.css("overflow"),k.css("overflow","hidden")),b=k.height(),this.element.siblings(":visible").each(function(){var a=e(this),d=a.css("position");d==="absolute"||d==="fixed"||(b=b-a.outerHeight(true))}),d&&k.css("overflow",d),this.element.children().not(this.panels).each(function(){b=b-e(this).outerHeight(true)}),this.panels.each(function(){e(this).height(Math.max(0,b-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===a&&(b=0,this.panels.each(function(){b=
Math.max(b,e(this).height("").height())}).height(b))},_eventHandler:function(a){var b=this.options,d=this.active,k=e(a.currentTarget).closest("li"),c=k[0]===d[0],j=c&&b.collapsible,m=j?e():this._getPanelForTab(k),o=!d.length?e():this._getPanelForTab(d),d={oldTab:d,oldPanel:o,newTab:j?e():k,newPanel:m};a.preventDefault();if(!k.hasClass("ui-state-disabled")&&!k.hasClass("ui-tabs-loading")&&!this.running&&!(c&&!b.collapsible||!1===this._trigger("beforeActivate",a,d)))b.active=j?!1:this.tabs.index(k),
this.active=c?e():k,this.xhr&&this.xhr.abort(),!o.length&&!m.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),m.length&&this.load(this.tabs.index(k),a),this._toggle(a,d)},_toggle:function(a,b){function d(){c.running=!1;c._trigger("activate",a,b)}function k(){b.newTab.closest("li").addClass("ui-tabs-active ui-state-active");j.length&&c.options.show?c._show(j,c.options.show,d):(j.show(),d())}var c=this,j=b.newPanel,m=b.oldPanel;this.running=!0;m.length&&this.options.hide?this._hide(m,
this.options.hide,function(){b.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");k()}):(b.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),m.hide(),k());m.attr({"aria-expanded":"false","aria-hidden":"true"});b.oldTab.attr("aria-selected","false");j.length&&m.length?b.oldTab.attr("tabIndex",-1):j.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1);j.attr({"aria-expanded":"true","aria-hidden":"false"});b.newTab.attr({"aria-selected":"true",
tabIndex:0})},_activate:function(a){a=this._findActive(a);a[0]!==this.active[0]&&(a.length||(a=this.active),a=a.find(".ui-tabs-anchor")[0],this._eventHandler({target:a,currentTarget:a,preventDefault:e.noop}))},_findActive:function(a){return!1===a?e():this.tabs.eq(a)},_getIndex:function(a){"string"===typeof a&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']")));return a},_destroy:function(){this.xhr&&this.xhr.abort();this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible");
this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role");this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId();this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")});
this.tabs.each(function(){var a=e(this),b=a.data("ui-tabs-aria-controls");b?a.attr("aria-controls",b):a.removeAttr("aria-controls")});"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(b){var d=this.options.disabled;!1!==d&&(b===a?d=!1:(b=this._getIndex(b),d=e.isArray(d)?e.map(d,function(a){return a!==b?a:null}):e.map(this.tabs,function(a,d){return d!==b?d:null})),this._setupDisabled(d))},disable:function(b){var d=this.options.disabled;if(!0!==d){if(b===a)d=!0;else{b=
this._getIndex(b);if(-1!==e.inArray(b,d))return;d=e.isArray(d)?e.merge([b],d).sort():[b]}this._setupDisabled(d)}},load:function(a,b){var a=this._getIndex(a),d=this,k=this.tabs.eq(a),c=k.find(".ui-tabs-anchor"),q=this._getPanelForTab(k),m={tab:k,panel:q};if(!j(c[0])&&(this.xhr=e.ajax(this._ajaxSettings(c,b,m)))&&"canceled"!==this.xhr.statusText)k.addClass("ui-tabs-loading"),q.attr("aria-busy","true"),this.xhr.success(function(a){setTimeout(function(){q.html(a);d._trigger("load",b,m)},1)}).complete(function(a,
b){setTimeout(function(){"abort"===b&&d.panels.stop(!1,!0);k.removeClass("ui-tabs-loading");q.removeAttr("aria-busy");a===d.xhr&&delete d.xhr},1)})},_ajaxSettings:function(a,b,d){var k=this;return{url:a.attr("href"),beforeSend:function(a,f){return k._trigger("beforeLoad",b,e.extend({jqXHR:a,ajaxSettings:f},d))}}},_getPanelForTab:function(a){return this.element.find(this._sanitizeSelector("#"+e(a).attr("aria-controls")))}});!1!==e.uiBackCompat&&(e.ui.tabs.prototype._ui=function(a,b){return{tab:a,panel:b,
index:this.anchors.index(a)}},e.widget("ui.tabs",e.ui.tabs,{url:function(a,b){this.anchors.eq(a).attr("href",b)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var a=this;this._on({tabsbeforeload:function(b,d){e.data(d.tab[0],"cache.tabs")?b.preventDefault():d.jqXHR.success(function(){a.options.cache&&e.data(d.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(a,b,d){var k=this.options.ajaxOptions;return e.extend({},k,{error:function(a,b){try{k.error(a,
b,d.tab.closest("li").index(),d.tab[0])}catch(f){}}},this._superApply(arguments))},_setOption:function(a,b){"cache"===a&&!1===b&&this.anchors.removeData("cache.tabs");this._super(a,b)},_destroy:function(){this.anchors.removeData("cache.tabs");this._super()},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs");this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"<em>Loading&#8230;</em>"},
_create:function(){this._super();this._on({tabsbeforeload:function(a,b){if(a.target===this.element[0]&&this.options.spinner){var d=b.tab.find("span"),e=d.html();d.html(this.options.spinner);b.jqXHR.complete(function(){d.html(e)})}}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(a){var b=this.options,d;if(a&&!0===b.disabled||e.isArray(b.disabled)&&-1!==e.inArray(a,b.disabled))d=!0;this._superApply(arguments);d&&this._trigger("enable",null,this._ui(this.anchors[a],
this.panels[a]))},disable:function(a){var b=this.options,d;if(a&&!1===b.disabled||e.isArray(b.disabled)&&-1===e.inArray(a,b.disabled))d=!0;this._superApply(arguments);d&&this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(b,d,g){g===a&&(g=this.anchors.length);var k,c=this.options,d=e(c.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,
d)),j=!b.indexOf("#")?b.replace("#",""):this._tabId(d);d.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0);d.attr("aria-controls",j);b=g>=this.tabs.length;k=this.element.find("#"+j);k.length||(k=this._createPanel(j),b?0<g?k.insertAfter(this.panels.eq(-1)):k.appendTo(this.element):k.insertBefore(this.panels[g]));k.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide();b?d.appendTo(this.tablist):d.insertBefore(this.tabs[g]);c.disabled=e.map(c.disabled,function(a){return a>=
g?++a:a});this.refresh();1===this.tabs.length&&!1===c.active&&this.option("active",0);this._trigger("add",null,this._ui(this.anchors[g],this.panels[g]));return this},remove:function(a){var a=this._getIndex(a),b=this.options,d=this.tabs.eq(a).remove(),k=this._getPanelForTab(d).remove();d.hasClass("ui-tabs-active")&&2<this.anchors.length&&this._activate(a+(a+1<this.anchors.length?1:-1));b.disabled=e.map(e.grep(b.disabled,function(b){return b!==a}),function(b){return b>=a?--b:b});this.refresh();this._trigger("remove",
null,this._ui(d.find("a")[0],k[0]));return this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(a){a=a.is("li")?a.find("a[href]"):a;a=a[0];return e(a).closest("li").attr("aria-controls")||a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+ ++d}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(a){return e(this.options.panelTemplate).attr("id",
a).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var b=this.options;null===b.active&&b.selected!==a&&(b.active=-1===b.selected?!1:b.selected);this._super();b.selected=b.active;!1===b.selected&&(b.selected=-1)},_setOption:function(a,b){if("selected"!==a)return this._super(a,b);var d=this.options;this._super("active",-1===b?!1:b);d.selected=d.active;!1===d.selected&&(d.selected=-1)},_eventHandler:function(a){this._superApply(arguments);
this.options.selected=this.options.active;!1===this.options.selected&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super();!1!==this.options.active&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(a,b,d){var e=this._superApply(arguments);if(!e)return!1;"beforeActivate"===a&&d.newTab.length?e=this._super("select",b,{tab:d.newTab.find(".ui-tabs-anchor")[0],
panel:d.newPanel[0],index:d.newTab.closest("li").index()}):"activate"===a&&d.newTab.length&&(e=this._super("show",b,{tab:d.newTab.find(".ui-tabs-anchor")[0],panel:d.newPanel[0],index:d.newTab.closest("li").index()}));return e}}),e.widget("ui.tabs",e.ui.tabs,{select:function(a){a=this._getIndex(a);if(-1===a)if(this.options.collapsible&&-1!==this.options.selected)a=this.options.selected;else return;this.anchors.eq(a).trigger(this.options.event+this.eventNamespace)}}),function(){var a=0;e.widget("ui.tabs",
e.ui.tabs,{options:{cookie:null},_create:function(){var a=this.options,b;null==a.active&&a.cookie&&(b=parseInt(this._cookie(),10),-1===b&&(b=!1),a.active=b);this._super()},_cookie:function(b){var d=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++a)];arguments.length&&(d.push(!1===b?-1:b),d.push(this.options.cookie));return e.cookie.apply(null,d)},_refresh:function(){this._super();this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(a){this._superApply(arguments);
this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super();this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(a,b,d){d=e.extend({},d);"load"===a&&(d.panel=d.panel[0],d.tab=d.tab.find(".ui-tabs-anchor")[0]);return this._super(a,b,d)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var a,b,d=this.options.fx;d&&(e.isArray(d)?(a=d[0],b=d[1]):a=b=d);return d?{show:b,hide:a}:
null},_toggle:function(a,b){function d(){c.running=!1;c._trigger("activate",a,b)}function e(){b.newTab.closest("li").addClass("ui-tabs-active ui-state-active");j.length&&o.show?j.animate(o.show,o.show.duration,function(){d()}):(j.show(),d())}var c=this,j=b.newPanel,m=b.oldPanel,o=this._getFx();if(!o)return this._super(a,b);c.running=!0;m.length&&o.hide?m.animate(o.hide,o.hide.duration,function(){b.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");e()}):(b.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),
m.hide(),e())}}))})(m);(function(e){function a(a,d){var l=(a.attr("aria-describedby")||"").split(/\s+/);l.push(d);a.data("ui-tooltip-id",d).attr("aria-describedby",e.trim(l.join(" ")))}function j(a){var d=a.data("ui-tooltip-id"),l=(a.attr("aria-describedby")||"").split(/\s+/),d=e.inArray(d,l);-1!==d&&l.splice(d,1);a.removeData("ui-tooltip-id");(l=e.trim(l.join(" ")))?a.attr("aria-describedby",l):a.removeAttr("aria-describedby")}var d=0;e.widget("ui.tooltip",{version:"1.9.0",options:{content:function(){return e(this).attr("title")},
hide:!0,items:"[title]",position:{my:"left+15 center",at:"right center",collision:"flipfit flipfit"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={}},_setOption:function(a,d){var l=this;"disabled"===a?(this[d?"_disable":"_enable"](),this.options[a]=d):(this._super(a,d),"content"===a&&e.each(this.tooltips,function(a,b){l._updateContent(b)}))},_disable:function(){var a=this;e.each(this.tooltips,function(d,l){var g=
e.Event("blur");g.target=g.currentTarget=l[0];a.close(g,!0)});this.element.find(this.options.items).andSelf().each(function(){var a=e(this);a.is("[title]")&&a.data("ui-tooltip-title",a.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var a=e(this);a.data("ui-tooltip-title")&&a.attr("title",a.data("ui-tooltip-title"))})},open:function(a){var d=e(a?a.target:this.element).closest(this.options.items);d.length&&(this.options.track&&d.data("ui-tooltip-id")?
(this._find(d).position(e.extend({of:d},this.options.position)),this._off(this.document,"mousemove")):(d.attr("title")&&d.data("ui-tooltip-title",d.attr("title")),d.data("tooltip-open",!0),this._updateContent(d,a)))},_updateContent:function(a,d){var e;e=this.options.content;var g=this;if("string"===typeof e)return this._open(d,a,e);(e=e.call(a[0],function(e){a.data("tooltip-open")&&g._delay(function(){this._open(d,a,e)})}))&&this._open(d,a,e)},_open:function(b,d,l){function g(a){c.of=a;k.position(c)}
var k,c;l&&(k=this._find(d),k.length?k.find(".ui-tooltip-content").html(l):(d.is("[title]")&&(b&&"mouseover"===b.type?d.attr("title",""):d.removeAttr("title")),k=this._tooltip(d),a(d,k.attr("id")),k.find(".ui-tooltip-content").html(l),this.options.track&&b&&/^mouse/.test(b.originalEvent.type)?(c=e.extend({},this.options.position),this._on(this.document,{mousemove:g}),g(b)):k.position(e.extend({of:d},this.options.position)),k.hide(),this._show(k,this.options.show),this._trigger("open",b,{tooltip:k}),
this._on(d,{mouseleave:"close",focusout:"close",keyup:function(a){if(a.keyCode===e.ui.keyCode.ESCAPE){a=e.Event(a);a.currentTarget=d[0];this.close(a,true)}}})))},close:function(a,d){var l=this,g=e(a?a.currentTarget:this.element),k=this._find(g);if(!this.closing&&(d||!a||!("focusout"!==a.type&&this.document[0].activeElement===g[0])))g.data("ui-tooltip-title")&&g.attr("title",g.data("ui-tooltip-title")),j(g),k.stop(!0),this._hide(k,this.options.hide,function(){e(this).remove();delete l.tooltips[this.id]}),
g.removeData("tooltip-open"),this._off(g,"mouseleave focusout keyup"),this._off(this.document,"mousemove"),this.closing=!0,this._trigger("close",a,{tooltip:k}),this.closing=!1},_tooltip:function(a){var f="ui-tooltip-"+d++,l=e("<div>").attr({id:f,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));e("<div>").addClass("ui-tooltip-content").appendTo(l);l.appendTo(this.document[0].body);e.fn.bgiframe&&l.bgiframe();this.tooltips[f]=a;return l},
_find:function(a){return(a=a.data("ui-tooltip-id"))?e("#"+a):e()},_destroy:function(){var a=this;e.each(this.tooltips,function(d,l){var g=e.Event("blur");g.target=g.currentTarget=l[0];a.close(g,!0);e("#"+d).remove();l.data("ui-tooltip-title")&&(l.attr("title",l.data("ui-tooltip-title")),l.removeData("ui-tooltip-title"))})}})})(m);m.effects||function(e,a){var j=!1!==e.uiBackCompat;e.effects={effect:{}};(function(a,b){function f(a,b,c){var d=o[b.type]||{};if(null==a)return c||!b.def?null:b.def;a=d.floor?
~~a:parseFloat(a);return isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max<a?d.max:a}function l(b){var f=j(),g=f._rgba=[],b=b.toLowerCase();x(c,function(a,c){var d,e=c.re.exec(b);d=e&&c.parse(e);e=c.space||"rgba";if(d)return d=f[e](d),f[m[e].cache]=d[m[e].cache],g=f._rgba=d._rgba,!1});return g.length?("0,0,0,0"===g.join()&&a.extend(g,t.transparent),f):t[b]}function g(a,b,c){c=(c+1)%1;return 1>6*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}var k=/^([\-+])=\s*(\d+\.?\d*)/,c=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],a[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
space:"hsla",parse:function(a){return[a[1],a[2]/100,a[3]/100,a[4]]}}],j=a.Color=function(b,c,f,g){return new a.Color.fn.parse(b,c,f,g)},m={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},o={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},p=j.support={},r=a("<p>")[0],t,x=a.each;r.style.cssText="background-color:rgba(1,1,1,.5)";
p.rgba=-1<r.style.backgroundColor.indexOf("rgba");x(m,function(a,b){b.cache="_"+a;b.props.alpha={idx:3,type:"percent",def:1}});j.fn=a.extend(j.prototype,{parse:function(c,g,k,p){if(c===b)return this._rgba=[null,null,null,null],this;if(c.jquery||c.nodeType)c=a(c).css(g),g=b;var o=this,r=a.type(c),E=this._rgba=[];g!==b&&(c=[c,g,k,p],r="array");if("string"===r)return this.parse(l(c)||t._default);if("array"===r)return x(m.rgba.props,function(a,b){E[b.idx]=f(c[b.idx],b)}),this;if("object"===r)return c instanceof
j?x(m,function(a,b){c[b.cache]&&(o[b.cache]=c[b.cache].slice())}):x(m,function(a,b){var d=b.cache;x(b.props,function(a,g){if(!o[d]&&b.to){if(a==="alpha"||c[a]==null)return;o[d]=b.to(o._rgba)}o[d][g.idx]=f(c[a],g,true)});if(o[d]&&e.inArray(null,o[d].slice(0,3))<0){o[d][3]=1;if(b.from)o._rgba=b.from(o[d])}}),this},is:function(a){var b=j(a),c=!0,d=this;x(m,function(a,g){var f,e=b[g.cache];e&&(f=d[g.cache]||g.to&&g.to(d._rgba)||[],x(g.props,function(a,b){if(null!=e[b.idx])return c=e[b.idx]===f[b.idx]}));
return c});return c},_space:function(){var a=[],b=this;x(m,function(c,d){b[d.cache]&&a.push(c)});return a.pop()},transition:function(a,b){var c=j(a),d=c._space(),g=m[d],e=0===this.alpha()?j("transparent"):this,k=e[g.cache]||g.to(e._rgba),l=k.slice(),c=c[g.cache];x(g.props,function(a,d){var g=d.idx,e=k[g],j=c[g],p=o[d.type]||{};null!==j&&(null===e?l[g]=j:(p.mod&&(j-e>p.mod/2?e+=p.mod:e-j>p.mod/2&&(e-=p.mod)),l[g]=f((j-e)*b+e,d)))});return this[d](l)},blend:function(b){if(1===this._rgba[3])return this;
var c=this._rgba.slice(),g=c.pop(),f=j(b)._rgba;return j(a.map(c,function(a,b){return(1-g)*f[b]+g*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return null==a?2<b?1:0:a});1===c[3]&&(c.pop(),b="rgb(");return b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){null==a&&(a=2<b?1:0);b&&3>b&&(a=Math.round(100*a)+"%");return a});1===c[3]&&(c.pop(),b="hsl(");return b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),g=c.pop();
b&&c.push(~~(255*g));return"#"+a.map(c,function(a){a=(a||0).toString(16);return 1===a.length?"0"+a:a}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}});j.fn.parse.prototype=j.fn;m.hsla.to=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b=a[0]/255,c=a[1]/255,d=a[2]/255,a=a[3],g=Math.max(b,c,d),f=Math.min(b,c,d),e=g-f,k=g+f,l=0.5*k;return[Math.round(f===g?0:b===g?60*(c-d)/e+360:c===g?60*(d-b)/e+120:60*(b-c)/e+240)%360,0===
l||1===l?l:0.5>=l?e/k:e/(2-k),l,null==a?1:a]};m.hsla.from=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],a=a[3],c=0.5>=d?d*(1+c):d+c-d*c,d=2*d-c;return[Math.round(255*g(d,c,b+1/3)),Math.round(255*g(d,c,b)),Math.round(255*g(d,c,b-1/3)),a]};x(m,function(c,g){var e=g.props,l=g.cache,p=g.to,o=g.from;j.fn[c]=function(c){p&&!this[l]&&(this[l]=p(this._rgba));if(c===b)return this[l].slice();var g,k=a.type(c),m="array"===k||"object"===k?c:arguments,
r=this[l].slice();x(e,function(a,b){var c=m["object"===k?a:b.idx];null==c&&(c=r[b.idx]);r[b.idx]=f(c,b)});return o?(g=j(o(r)),g[l]=r,g):j(r)};x(e,function(b,g){j.fn[b]||(j.fn[b]=function(f){var e=a.type(f),l="alpha"===b?this._hsla?"hsla":"rgba":c,j=this[l](),p=j[g.idx];if("undefined"===e)return p;"function"===e&&(f=f.call(this,p),e=a.type(f));if(null==f&&g.empty)return this;"string"===e&&(e=k.exec(f))&&(f=p+parseFloat(e[2])*("+"===e[1]?1:-1));j[g.idx]=f;return this[l](j)})})});x("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),
function(b,c){a.cssHooks[c]={set:function(b,g){var f,e="";if(a.type(g)!=="string"||(f=l(g))){g=j(f||g);if(!p.rgba&&g._rgba[3]!==1){for(f=c==="backgroundColor"?b.parentNode:b;(e===""||e==="transparent")&&f&&f.style;)try{e=a.css(f,"backgroundColor");f=f.parentNode}catch(k){}g=g.blend(e&&e!=="transparent"?e:"_default")}g=g.toRgbaString()}try{b.style[c]=g}catch(o){}}};a.fx.step[c]=function(b){if(!b.colorInit){b.start=j(b.elem,c);b.end=j(b.end);b.colorInit=true}a.cssHooks[c].set(b.elem,b.start.transition(b.end,
b.pos))}});a.cssHooks.borderColor={expand:function(a){var b={};x(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a});return b}};t=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}})(m);(function(){function d(){var a=
this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,b={},d,c;if(a&&a.length&&a[0]&&a[a[0]])for(c=a.length;c--;)d=a[c],"string"===typeof a[d]&&(b[e.camelCase(d)]=a[d]);else for(d in a)"string"===typeof a[d]&&(b[d]=a[d]);return b}var b=["add","remove","toggle"],f={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],
function(a,b){e.fx.step[b]=function(a){if("none"!==a.end&&!a.setAttr||1===a.pos&&!a.setAttr)m.style(a.elem,b,a.end),a.setAttr=!0}});e.effects.animateClass=function(a,g,k,c){var j=e.speed(g,k,c);return this.queue(function(){var c=e(this),g=c.attr("class")||"",k,r=j.children?c.find("*").andSelf():c,r=r.map(function(){return{el:e(this),start:d.call(this)}});k=function(){e.each(b,function(b,d){if(a[d])c[d+"Class"](a[d])})};k();r=r.map(function(){this.end=d.call(this.el[0]);var a=this.start,b=this.end,
c={},g,k;for(g in b)if(k=b[g],a[g]!==k&&!f[g]&&(e.fx.step[g]||!isNaN(parseFloat(k))))c[g]=k;this.diff=c;return this});c.attr("class",g);r=r.map(function(){var a=this,b=e.Deferred();this.el.animate(this.diff,m.extend({},j,{queue:!1,complete:function(){b.resolve(a)}}));return b.promise()});e.when.apply(e,r.get()).done(function(){k();e.each(arguments,function(){var a=this.el;e.each(this.diff,function(b){a.css(b,"")})});j.complete.call(c[0])})})};e.fn.extend({_addClass:e.fn.addClass,addClass:function(a,
b,d,c){return b?e.effects.animateClass.call(this,{add:a},b,d,c):this._addClass(a)},_removeClass:e.fn.removeClass,removeClass:function(a,b,d,c){return b?e.effects.animateClass.call(this,{remove:a},b,d,c):this._removeClass(a)},_toggleClass:e.fn.toggleClass,toggleClass:function(b,d,f,c,j){return"boolean"===typeof d||d===a?f?e.effects.animateClass.call(this,d?{add:b}:{remove:b},f,c,j):this._toggleClass(b,d):e.effects.animateClass.call(this,{toggle:b},d,f,c)},switchClass:function(a,b,d,c,f){return e.effects.animateClass.call(this,
{add:b,remove:a},d,c,f)}})})();(function(){function d(b,d,g,k){e.isPlainObject(b)&&(d=b,b=b.effect);b={effect:b};d===a&&(d={});e.isFunction(d)&&(k=d,g=null,d={});if("number"===typeof d||e.fx.speeds[d])k=g,g=d,d={};e.isFunction(g)&&(k=g,g=null);d&&e.extend(b,d);g=g||d.duration;b.duration=e.fx.off?0:"number"===typeof g?g:g in e.fx.speeds?e.fx.speeds[g]:e.fx.speeds._default;b.complete=k||d.complete;return b}function b(a){return!a||"number"===typeof a||e.fx.speeds[a]?!0:"string"===typeof a&&!e.effects.effect[a]?
j&&e.effects[a]?!1:!0:!1}e.extend(e.effects,{version:"1.9.0",save:function(a,b){for(var d=0;d<b.length;d++)null!==b[d]&&a.data("ui-effects-"+b[d],a[0].style[b[d]])},restore:function(b,d){var g,e;for(e=0;e<d.length;e++)null!==d[e]&&(g=b.data("ui-effects-"+d[e]),g===a&&(g=""),b.css(d[e],g))},setMode:function(a,b){"toggle"===b&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var d,e;switch(a[0]){case "top":d=0;break;case "middle":d=0.5;break;case "bottom":d=1;break;default:d=a[0]/
b.height}switch(a[1]){case "left":e=0;break;case "center":e=0.5;break;case "right":e=1;break;default:e=a[1]/b.width}return{x:e,y:d}},createWrapper:function(a){if(a.parent().is(".ui-effects-wrapper"))return a.parent();var b={width:a.outerWidth(!0),height:a.outerHeight(!0),"float":a.css("float")},d=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),k={width:a.width(),height:a.height()},c=document.activeElement;try{c.id}catch(j){c=
document.body}a.wrap(d);(a[0]===c||e.contains(a[0],c))&&e(c).focus();d=a.parent();"static"===a.css("position")?(d.css({position:"relative"}),a.css({position:"relative"})):(e.extend(b,{position:a.css("position"),zIndex:a.css("z-index")}),e.each(["top","left","bottom","right"],function(c,d){b[d]=a.css(d);isNaN(parseInt(b[d],10))&&(b[d]="auto")}),a.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));a.css(k);return d.css(b).show()},removeWrapper:function(a){var b=document.activeElement;
a.parent().is(".ui-effects-wrapper")&&(a.parent().replaceWith(a),(a[0]===b||e.contains(a[0],b))&&e(b).focus());return a},setTransition:function(a,b,d,k){k=k||{};e.each(b,function(b,e){var l=a.cssUnit(e);0<l[0]&&(k[e]=l[0]*d+l[1])});return k}});e.fn.extend({effect:function(a,b,g,k){function c(a){function b(){e.isFunction(d)&&d.call(c[0]);e.isFunction(a)&&a()}var c=e(this),d=q.complete,g=q.mode;(c.is(":hidden")?"hide"===g:"show"===g)?b():p.call(c[0],q,b)}var q=d.apply(this,arguments),m=q.mode,o=q.queue,
p=e.effects.effect[q.effect],r=!p&&j&&e.effects[q.effect];return e.fx.off||!p&&!r?m?this[m](q.duration,q.complete):this.each(function(){q.complete&&q.complete.call(this)}):p?!1===o?this.each(c):this.queue(o||"fx",c):r.call(this,{options:q,duration:q.duration,callback:q.complete,mode:q.mode})},_show:e.fn.show,show:function(a){if(b(a))return this._show.apply(this,arguments);var e=d.apply(this,arguments);e.mode="show";return this.effect.call(this,e)},_hide:e.fn.hide,hide:function(a){if(b(a))return this._hide.apply(this,
arguments);var e=d.apply(this,arguments);e.mode="hide";return this.effect.call(this,e)},__toggle:e.fn.toggle,toggle:function(a){if(b(a)||"boolean"===typeof a||e.isFunction(a))return this.__toggle.apply(this,arguments);var l=d.apply(this,arguments);l.mode="toggle";return this.effect.call(this,l)},cssUnit:function(a){var b=this.css(a),d=[];e.each(["em","px","%","pt"],function(a,c){0<b.indexOf(c)&&(d=[parseFloat(b),c])});return d}})})();(function(){var a={};e.each(["Quad","Cubic","Quart","Quint","Expo"],
function(b,f){a[f]=function(a){return Math.pow(a,b+2)}});e.extend(a,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return 0===a||1===a?a:-Math.pow(2,8*(a-1))*Math.sin((80*(a-1)-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var d,e=4;a<((d=Math.pow(2,--e))-1)/11;);return 1/Math.pow(4,3-e)-7.5625*Math.pow((3*d-2)/22-a,2)}});e.each(a,function(a,d){e.easing["easeIn"+a]=d;e.easing["easeOut"+a]=function(a){return 1-
d(1-a)};e.easing["easeInOut"+a]=function(a){return 0.5>a?d(2*a)/2:1-d(-2*a+2)/2}})})()}(m);(function(e){var a=/up|down|vertical/,j=/up|left|vertical|horizontal/;e.effects.effect.blind=function(d,b){var f=e(this),l="position top bottom left right height width".split(" "),g=e.effects.setMode(f,d.mode||"hide"),k=d.direction||"up",c=a.test(k),q=c?"height":"width",m=c?"top":"left",k=j.test(k),o={},p="show"===g,r,t,x;f.parent().is(".ui-effects-wrapper")?e.effects.save(f.parent(),l):e.effects.save(f,l);
f.show();r=e.effects.createWrapper(f).css({overflow:"hidden"});t=r[q]();x=parseFloat(r.css(m))||0;o[q]=p?t:0;k||(f.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),o[m]=p?x:t+x);p&&(r.css(q,0),k||r.css(m,x+t));r.animate(o,{duration:d.duration,easing:d.easing,queue:!1,complete:function(){g==="hide"&&f.hide();e.effects.restore(f,l);e.effects.removeWrapper(f);b()}})}})(m);(function(e){e.effects.effect.bounce=function(a,j){var d=e(this),b="position top bottom left right height width".split(" "),
f=e.effects.setMode(d,a.mode||"effect"),l="hide"===f,g="show"===f,k=a.direction||"up",f=a.distance,c=a.times||5,m=2*c+(g||l?1:0),n=a.duration/m,o=a.easing,p="up"===k||"down"===k?"top":"left",k="up"===k||"left"===k,r,t,x=d.queue(),v=x.length;(g||l)&&b.push("opacity");e.effects.save(d,b);d.show();e.effects.createWrapper(d);f||(f=d["top"===p?"outerHeight":"outerWidth"]()/3);g&&(t={opacity:1},t[p]=0,d.css("opacity",0).css(p,k?2*-f:2*f).animate(t,n,o));l&&(f/=Math.pow(2,c-1));t={};for(g=t[p]=0;g<c;g++)r=
{},r[p]=(k?"-=":"+=")+f,d.animate(r,n,o).animate(t,n,o),f=l?2*f:f/2;l&&(r={opacity:0},r[p]=(k?"-=":"+=")+f,d.animate(r,n,o));d.queue(function(){l&&d.hide();e.effects.restore(d,b);e.effects.removeWrapper(d);j()});1<v&&x.splice.apply(x,[1,0].concat(x.splice(v,m+1)));d.dequeue()}})(m);(function(e){e.effects.effect.clip=function(a,j){var d=e(this),b="position top bottom left right height width".split(" "),f="show"===e.effects.setMode(d,a.mode||"hide"),l="vertical"===(a.direction||"vertical"),g=l?"height":
"width",l=l?"top":"left",k={},c,m;e.effects.save(d,b);d.show();c=e.effects.createWrapper(d).css({overflow:"hidden"});c="IMG"===d[0].tagName?c:d;m=c[g]();f&&(c.css(g,0),c.css(l,m/2));k[g]=f?m:0;k[l]=f?0:m/2;c.animate(k,{queue:!1,duration:a.duration,easing:a.easing,complete:function(){f||d.hide();e.effects.restore(d,b);e.effects.removeWrapper(d);j()}})}})(m);(function(e){e.effects.effect.drop=function(a,j){var d=e(this),b="position top bottom left right opacity height width".split(" "),f=e.effects.setMode(d,
a.mode||"hide"),l="show"===f,g=a.direction||"left",k="up"===g||"down"===g?"top":"left",g="up"===g||"left"===g?"pos":"neg",c={opacity:l?1:0},m;e.effects.save(d,b);d.show();e.effects.createWrapper(d);m=a.distance||d["top"===k?"outerHeight":"outerWidth"](!0)/2;l&&d.css("opacity",0).css(k,"pos"===g?-m:m);c[k]=(l?"pos"===g?"+=":"-=":"pos"===g?"-=":"+=")+m;d.animate(c,{queue:!1,duration:a.duration,easing:a.easing,complete:function(){"hide"===f&&d.hide();e.effects.restore(d,b);e.effects.removeWrapper(d);
j()}})}})(m);(function(e){e.effects.effect.explode=function(a,j){function d(){n.push(this);n.length===b*f&&(l.css({visibility:"visible"}),e(n).remove(),g||l.hide(),j())}var b=a.pieces?Math.round(Math.sqrt(a.pieces)):3,f=b,l=e(this),g="show"===e.effects.setMode(l,a.mode||"hide"),k=l.show().css("visibility","hidden").offset(),c=Math.ceil(l.outerWidth()/f),m=Math.ceil(l.outerHeight()/b),n=[],o,p,r,t,x,v;for(o=0;o<b;o++){t=k.top+o*m;v=o-(b-1)/2;for(p=0;p<f;p++)r=k.left+p*c,x=p-(f-1)/2,l.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",
visibility:"visible",left:-p*c,top:-o*m}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:c,height:m,left:r+(g?x*c:0),top:t+(g?v*m:0),opacity:g?0:1}).animate({left:r+(g?0:x*c),top:t+(g?0:v*m),opacity:g?1:0},a.duration||500,a.easing,d)}}})(m);(function(e){e.effects.effect.fade=function(a,j){var d=e(this),b=e.effects.setMode(d,a.mode||"toggle");d.animate({opacity:b},{queue:!1,duration:a.duration,easing:a.easing,complete:j})}})(m);(function(e){e.effects.effect.fold=
function(a,j){var d=e(this),b="position top bottom left right height width".split(" "),f=e.effects.setMode(d,a.mode||"hide"),l="show"===f,g="hide"===f,f=a.size||15,k=/([0-9]+)%/.exec(f),c=!!a.horizFirst,m=l!==c,n=m?["width","height"]:["height","width"],o=a.duration/2,p,r={},t={};e.effects.save(d,b);d.show();p=e.effects.createWrapper(d).css({overflow:"hidden"});m=m?[p.width(),p.height()]:[p.height(),p.width()];k&&(f=parseInt(k[1],10)/100*m[g?0:1]);l&&p.css(c?{height:0,width:f}:{height:f,width:0});
r[n[0]]=l?m[0]:f;t[n[1]]=l?m[1]:0;p.animate(r,o,a.easing).animate(t,o,a.easing,function(){g&&d.hide();e.effects.restore(d,b);e.effects.removeWrapper(d);j()})}})(m);(function(e){e.effects.effect.highlight=function(a,j){var d=e(this),b=["backgroundImage","backgroundColor","opacity"],f=e.effects.setMode(d,a.mode||"show"),l={backgroundColor:d.css("backgroundColor")};"hide"===f&&(l.opacity=0);e.effects.save(d,b);d.show().css({backgroundImage:"none",backgroundColor:a.color||"#ffff99"}).animate(l,{queue:!1,
duration:a.duration,easing:a.easing,complete:function(){f==="hide"&&d.hide();e.effects.restore(d,b);j()}})}})(m);(function(e){e.effects.effect.pulsate=function(a,j){var d=e(this),b=e.effects.setMode(d,a.mode||"show"),f="show"===b,l="hide"===b,b=2*(a.times||5)+(f||"hide"===b?1:0),g=a.duration/b,k=0,c=d.queue(),m=c.length;if(f||!d.is(":visible"))d.css("opacity",0).show(),k=1;for(f=1;f<b;f++)d.animate({opacity:k},g,a.easing),k=1-k;d.animate({opacity:k},g,a.easing);d.queue(function(){l&&d.hide();j()});
1<m&&c.splice.apply(c,[1,0].concat(c.splice(m,b+1)));d.dequeue()}})(m);(function(e){e.effects.effect.puff=function(a,j){var d=e(this),b=e.effects.setMode(d,a.mode||"hide"),f="hide"===b,l=parseInt(a.percent,10)||150,g=l/100,k={height:d.height(),width:d.width()};e.extend(a,{effect:"scale",queue:!1,fade:!0,mode:b,complete:j,percent:f?l:100,from:f?k:{height:k.height*g,width:k.width*g}});d.effect(a)};e.effects.effect.scale=function(a,j){var d=e(this),b=e.extend(!0,{},a),f=e.effects.setMode(d,a.mode||"effect"),
l=parseInt(a.percent,10)||(0===parseInt(a.percent,10)?0:"hide"===f?0:100),g=a.direction||"both",k=a.origin,c={height:d.height(),width:d.width(),outerHeight:d.outerHeight(),outerWidth:d.outerWidth()},m="horizontal"!==g?l/100:1,l="vertical"!==g?l/100:1;b.effect="size";b.queue=!1;b.complete=j;"effect"!==f&&(b.origin=k||["middle","center"],b.restore=!0);b.from=a.from||("show"===f?{height:0,width:0}:c);b.to={height:c.height*m,width:c.width*l,outerHeight:c.outerHeight*m,outerWidth:c.outerWidth*l};if(b.fade&&
("show"===f&&(b.from.opacity=0,b.to.opacity=1),"hide"===f))b.from.opacity=1,b.to.opacity=0;d.effect(b)};e.effects.effect.size=function(a,j){var d,b,f,l,g=e(this),k="position top bottom left right width height overflow opacity".split(" "),c="position top bottom left right overflow opacity".split(" "),m=["width","height","overflow"],n=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],p=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=e.effects.setMode(g,
a.mode||"effect"),t=a.restore||"effect"!==r,x=a.scale||"both",v=a.origin||["middle","center"],u,z=g.css("position");"show"===r&&g.show();u={height:g.height(),width:g.width(),outerHeight:g.outerHeight(),outerWidth:g.outerWidth()};g.from=a.from||u;g.to=a.to||u;f=g.from.height/u.height;l=g.from.width/u.width;d=g.to.height/u.height;b=g.to.width/u.width;if("box"===x||"both"===x)if(f!==d&&(k=k.concat(o),g.from=e.effects.setTransition(g,o,f,g.from),g.to=e.effects.setTransition(g,o,d,g.to)),l!==b)k=k.concat(p),
g.from=e.effects.setTransition(g,p,l,g.from),g.to=e.effects.setTransition(g,p,b,g.to);if(("content"===x||"both"===x)&&f!==d)k=k.concat(n),g.from=e.effects.setTransition(g,n,f,g.from),g.to=e.effects.setTransition(g,n,d,g.to);e.effects.save(g,t?k:c);g.show();e.effects.createWrapper(g);g.css("overflow","hidden").css(g.from);v&&(v=e.effects.getBaseline(v,u),g.from.top=(u.outerHeight-g.outerHeight())*v.y,g.from.left=(u.outerWidth-g.outerWidth())*v.x,g.to.top=(u.outerHeight-g.to.outerHeight)*v.y,g.to.left=
(u.outerWidth-g.to.outerWidth)*v.x);g.css(g.from);if("content"===x||"both"===x)o=o.concat(["marginTop","marginBottom"]).concat(n),p=p.concat(["marginLeft","marginRight"]),m=k.concat(o).concat(p),g.find("*[width]").each(function(){var c=e(this),g=c.height(),k=c.width();t&&e.effects.save(c,m);c.from={height:g*f,width:k*l};c.to={height:g*d,width:k*b};if(f!==d){c.from=e.effects.setTransition(c,o,f,c.from);c.to=e.effects.setTransition(c,o,d,c.to)}if(l!==b){c.from=e.effects.setTransition(c,p,l,c.from);
c.to=e.effects.setTransition(c,p,b,c.to)}c.css(c.from);c.animate(c.to,a.duration,a.easing,function(){t&&e.effects.restore(c,m)})});g.animate(g.to,{queue:!1,duration:a.duration,easing:a.easing,complete:function(){g.to.opacity===0&&g.css("opacity",g.from.opacity);r==="hide"&&g.hide();e.effects.restore(g,t?k:c);t||(z==="static"?g.css({position:"relative",top:g.to.top,left:g.to.left}):e.each(["top","left"],function(a,b){g.css(b,function(b,c){var d=parseInt(c,10),f=a?g.to.left:g.to.top;return c==="auto"?
f+"px":d+f+"px"})}));e.effects.removeWrapper(g);j()}})}})(m);(function(e){e.effects.effect.shake=function(a,j){var d=e(this),b="position top bottom left right height width".split(" "),f=e.effects.setMode(d,a.mode||"effect"),l=a.direction||"left",g=a.distance||20,k=a.times||3,c=2*k+1,m=Math.round(a.duration/c),n="up"===l||"down"===l?"top":"left",o="up"===l||"left"===l,l={},p={},r={},t=d.queue(),x=t.length;e.effects.save(d,b);d.show();e.effects.createWrapper(d);l[n]=(o?"-=":"+=")+g;p[n]=(o?"+=":"-=")+
2*g;r[n]=(o?"-=":"+=")+2*g;d.animate(l,m,a.easing);for(g=1;g<k;g++)d.animate(p,m,a.easing).animate(r,m,a.easing);d.animate(p,m,a.easing).animate(l,m/2,a.easing).queue(function(){"hide"===f&&d.hide();e.effects.restore(d,b);e.effects.removeWrapper(d);j()});1<x&&t.splice.apply(t,[1,0].concat(t.splice(x,c+1)));d.dequeue()}})(m);(function(e){e.effects.effect.slide=function(a,j){var d=e(this),b="position top bottom left right width height".split(" "),f=e.effects.setMode(d,a.mode||"show"),l="show"===f,g=
a.direction||"left",k="up"===g||"down"===g?"top":"left",g="up"===g||"left"===g,c,m={};e.effects.save(d,b);d.show();c=a.distance||d["top"===k?"outerHeight":"outerWidth"](!0);e.effects.createWrapper(d).css({overflow:"hidden"});l&&d.css(k,g?isNaN(c)?"-"+c:-c:c);m[k]=(l?g?"+=":"-=":g?"-=":"+=")+c;d.animate(m,{queue:!1,duration:a.duration,easing:a.easing,complete:function(){"hide"===f&&d.hide();e.effects.restore(d,b);e.effects.removeWrapper(d);j()}})}})(m);(function(e){e.effects.effect.transfer=function(a,
j){var d=e(this),b=e(a.to),f="fixed"===b.css("position"),l=e("body"),g=f?l.scrollTop():0,l=f?l.scrollLeft():0,k=b.offset(),b={top:k.top-g,left:k.left-l,height:b.innerHeight(),width:b.innerWidth()},k=d.offset(),c=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.className).css({top:k.top-g,left:k.left-l,height:d.innerHeight(),width:d.innerWidth(),position:f?"fixed":"absolute"}).animate(b,a.duration,a.easing,function(){c.remove();j()})}})(m)});define("ui/tab","aloha/core jquery ui/container ui/component PubSub jqueryui".split(" "),
function(m,e,a,j,d){var b=0,f={},m=a.extend({_elemBySlot:null,_groupBySlot:null,_groupByComponent:null,_constructor:function(a,d,f){var c,j,m,o,p;this._elemBySlot={};this._groupBySlot={};this._groupByComponent={};this._slotsList=[];this._super(a,d);this.container=d.container;this.list=this.container.data("list");this.panels=this.container.data("panels");this.id="tab-ui-container-"+ ++b;this.panel=e("<div>",{id:this.id,unselectable:"on"});this.handle=e('<li><a href="'+location.href.replace(/#.*$/,
"")+"#"+this.id+'">'+d.label+"</a></li>");for(a=0;a<f.length;a++)if(typeof f[a]==="string")if(1===f[a].length&&f[a].charCodeAt(0)===10)this.panel.append("<div>",{unselectable:"on"});else{j=e("<span>",{unselectable:"on"});this._elemBySlot[f[a]]=j;this.panel.append(j)}else{o=e("<div>",{"class":"aloha-ui-component-group aloha-ui-hidden",unselectable:"on"}).appendTo(this.panel);p={element:o,visibleCounter:0};m=f[a];for(c=0;c<m.length;c++){this._groupBySlot[m[c]]=p;if(m[c]&&1===m[c].length&&m[c].charCodeAt(0)===
10)o.append(e("<div>",{unselectable:"on"}));else{j=e("<span>",{unselectable:"on"});this._elemBySlot[m[c]]=j;o.append(j)}}}this.panel.append(e("<div>",{"class":"aloha-ui-clear",unselectable:"on"}));this.handle.appendTo(this.list);this.panel.appendTo(this.panels);this.container.tabs("refresh");d=d.container.data("aloha-tabs");this.index=d.length;d.push(this)},adoptInto:function(a,b){var d=this._elemBySlot[a];if(!d)return false;f[a]=b;b.adoptParent(this);d.append(b.element);d=this._groupBySlot[a];this._slotsList.push(a);
if(d){this._groupByComponent[b.id]=d;if(b.isVisible()){d.visibleCounter||d.element.removeClass("aloha-ui-hidden");d.visibleCounter=d.visibleCounter+1}}return true},foreground:function(){this.container.tabs("select",this.index)},childForeground:function(){this.foreground()},hasVisibleComponents:function(){var a=this._elemBySlot,b;for(b in a)if(a.hasOwnProperty(b)&&f[b]&&f[b].visible)return true;return false},childVisible:function(a,b){b?a.container.show():a.container.hasVisibleComponents()||a.container.hide();
var d=this._groupByComponent[a.id];if(d)if(b){0===d.visibleCounter&&d.element.removeClass("aloha-ui-hidden");d.visibleCounter=d.visibleCounter+1}else{d.visibleCounter=d.visibleCounter-1;0===d.visibleCounter&&d.element.addClass("aloha-ui-hidden")}},show:function(){if(this.list.children().length&&this.hasVisibleComponents()){this.handle.show();this.visible=true;this.container.show();(!this.container.find(".ui-tabs-active").length||this.container.tabs("option","selected")===this.index)&&this.foreground()}},
hide:function(){var a=this.list.children();if(0!==a.length){this.handle.hide();this.visible=false;if(this.index===this.container.tabs("option","selected")){var a=this.container.data("aloha-tabs"),b;for(b=0;b<a.length;++b)if(a[b].visible){this.container.tabs("select",b);return}this.handle.removeClass("ui-tabs-active");this.container.hide()}}}});e.extend(m,{createContainer:function(){var a=e("<div>",{unselectable:"on"}),b=e("<ul>",{unselectable:"on"}).appendTo(a),f=e("<div>",{unselectable:"on"}).appendTo(a);
a.data("list",b).data("panels",f).data("aloha-tabs",[]).tabs({select:function(b,g){var f=a.data("aloha-tabs");a.data("aloha-active-container",f[g.index]);d.pub("aloha.ui.container.selected",{data:f[g.index]})}});return a}});return m});define("ui/subguarded",["aloha/core","jquery","PubSub"],function(m,e,a){function j(a){a.alohaUid||(a.alohaUid=++l);return a.alohaUid}function d(a,b){g[a.alohaUid]||(g[a.alohaUid]=[]);g[a.alohaUid].push(b);return g[a.alohaUid]}function b(a,b){k[a]||(k[a]=[]);k[a].push(b);
return k[a]}function f(a){var b=k[a]||[],d;for(d=0;d<b.length;d++)b[d].apply(null,[g[b[d].alohaUid]||[]].concat(arguments))}var l=0,g={},k={};return function(){var c=Array.prototype.slice.call(arguments),g=c.shift();"string"===typeof g&&(g=[g]);var e=c.shift();j(e);d(e,c);for(var k,l=function(a,b,c){f(k,a,b,c)},r=function(){f(k)},c=0;c<g.length;c++)k=g[c],b(k,e),m.bind(k,l),a.sub(k,r)}});define("vendor/amplify.store",["util/json2"],function(){var m={};(function(e,a){function j(g,c){d.addType(g,function(f,
e,l){var j,m=e,t=(new Date).getTime();if(!f){m={};l=[];e=0;try{for(f=c.length;f=c.key(e++);)b.test(f)&&(j=ha.parse(c.getItem(f)),j.expires&&j.expires<=t?l.push(f):m[f.replace(b,"")]=j.data);for(;f=l.pop();)c.removeItem(f)}catch(x){}return m}f="__amplify__"+f;if(e===a)if(j=(j=c.getItem(f))?ha.parse(j):{expires:-1},j.expires&&j.expires<=t)c.removeItem(f);else return j.data;else if(null===e)c.removeItem(f);else{j=ha.stringify({data:e,expires:l.expires?t+l.expires:null});try{c.setItem(f,j)}catch(v){d[g]();
try{c.setItem(f,j)}catch(u){throw d.error();}}}return m})}var d=e.store=function(a,b,g,f){f=d.type;g&&(g.type&&g.type in d.types)&&(f=g.type);return d.types[f](a,b,g||{})};d.types={};d.type=null;d.addType=function(a,b){d.type||(d.type=a);d.types[a]=b;d[a]=function(b,c,g){g=g||{};g.type=a;return d(b,c,g)}};d.error=function(){return"amplify.store quota exceeded"};var b=/^__amplify__/,f;for(f in{localStorage:1,sessionStorage:1})try{window[f].getItem&&j(f,window[f])}catch(l){}if(window.globalStorage)try{j("globalStorage",
window.globalStorage[window.location.hostname]),"sessionStorage"===d.type&&(d.type="globalStorage")}catch(g){}(function(){if(!d.types.localStorage){var b=document.createElement("div");b.style.display="none";document.getElementsByTagName("head")[0].appendChild(b);try{b.addBehavior("#default#userdata"),b.load("amplify")}catch(c){b.parentNode.removeChild(b);return}d.addType("userData",function(c,g,f){b.load("amplify");var e,l,j=g,m=(new Date).getTime();if(!c){j={};l=[];for(c=0;g=b.XMLDocument.documentElement.attributes[c++];)e=
ha.parse(g.value),e.expires&&e.expires<=m?l.push(g.name):j[g.name]=e.data;for(;c=l.pop();)b.removeAttribute(c);b.save("amplify");return j}c=c.replace(/[^-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g,"-");if(g===a)if(e=(g=b.getAttribute(c))?ha.parse(g):{expires:-1},e.expires&&e.expires<=m)b.removeAttribute(c);else return e.data;else null===g?b.removeAttribute(c):(l=b.getAttribute(c),e=ha.stringify({data:g,expires:f.expires?m+f.expires:null}),b.setAttribute(c,
e));try{b.save("amplify")}catch(v){null===l?b.removeAttribute(c):b.setAttribute(c,l);d.userData();try{b.setAttribute(c,e),b.save("amplify")}catch(u){throw null===l?b.removeAttribute(c):b.setAttribute(c,l),d.error();}}return j})}})();(function(){var b={},c={};d.addType("memory",function(d,g,f){if(!d)return b===a?a:ha.parse(ha.stringify(b));if(g===a)return b[d]===a?a:ha.parse(ha.stringify(b[d]));c[d]&&(clearTimeout(c[d]),delete c[d]);if(null===g)return delete b[d],null;b[d]=g;f.expires&&(c[d]=setTimeout(function(){delete b[d];
delete c[d]},f.expires));return g})})()})(m);return m});define("ui/floating","jquery aloha/core ui/surface ui/subguarded PubSub vendor/amplify.store util/browser".split(" "),function(m,e,a,j,d,b,f){function l(a,b,c,g){if("absolute"===n){b.top=b.top+q.scrollTop();b.left=b.left+q.scrollLeft()}o.offset=b;a.stop().animate(b,c,function(){g(b);d.pub("aloha.floating.changed",{position:m.extend({},o)})})}function g(a){b.store("Aloha.FloatingMenu.pinned","true");b.store("Aloha.FloatingMenu.top",a.top);b.store("Aloha.FloatingMenu.left",
a.left)}function k(a,b,c,d,g){for(b=0;b<a.length;b++)if(a[b][0].isActive())a[b][1](c,d,g)}function c(a){if(m.browser.msie){var b=a.$element.parent();a.$element.appendTo("body");a.$element.css("position",n);b.length?a.$element.appendTo(b):a.$element.detach()}else a.$element.css("position",n)}var q=m(window),n=f.ie7?"absolute":"fixed",o={style:n,offset:{top:0,left:0}};return{getPinState:function(){return b.store("Aloha.FloatingMenu.pinned")==="true"?{top:parseInt(b.store("Aloha.FloatingMenu.top"),10),
left:parseInt(b.store("Aloha.FloatingMenu.left"),10),isPinned:true}:{top:null,left:null,isPinned:false}},makeFloating:function(a,b){j(["aloha-selection-changed","aloha.ui.container.selected"],k,a,function(){a._move()});var d=function(){var c;c=b.pinLeft;var d=b.pinTop;d<0?d=0:d>q.height()&&(d=q.height()/2);c<0?c=0:c>q.width()&&(c=q.width()/2);c={top:d,left:c};b.setFloatingPosition(c);a.$element.css({top:c.top,left:c.left})};q.scroll(function(){a._move(0)});q.resize(function(){b.isFloatingMode||d()});
a.addPin();c(a);b.isFloatingMode||d();a.$element.css("z-index",10100).draggable({distance:20,stop:function(a,c){b.setFloatingPosition(c.position);b.isFloatingMode||g(c.position)}})},floatSurface:function(a,b,c,d){typeof c!=="number"&&(c=500);var g=(parseInt(m("body").css("marginTop"),10)||0)+(parseInt(m("body").css("paddingTop"),10)||0),a=a.$element,f=b.obj.offset(),e=f.top,f=f.left,k=q.scrollTop(),j=q.scrollLeft(),o=e-k-g,f=f-j,j=f+a.width()-q.width();j>0&&(f=Math.max(0,f-j));f=Math.max(0,f);if(o>=
a.height()){b={top:e-k,left:f};b.top=b.top-(a.height()+10)}else{b=o+a.height()>o+b.obj.height()?{top:e+b.obj.height()-k,left:f}:{top:g,left:f};b.top=b.top+10}l(a,b,c,d)},togglePinSurface:function(a,c,d){a=a.$element;if(d){b.store("Aloha.FloatingMenu.pinned",null);b.store("Aloha.FloatingMenu.top",null);b.store("Aloha.FloatingMenu.left",null);a.find(".aloha-ui-pin").removeClass("aloha-ui-pin-down")}else{g(c);a.find(".aloha-ui-pin").addClass("aloha-ui-pin-down")}a.css({position:"fixed",top:c.top})},
POSITION_STYLE:n}});(function(){function m(a,b,f,e,g,k){b[a]&&(f.push(a),(!0===b[a]||1===b[a])&&e.push(g+a+"/"+k))}function e(a,b,f,e,g){b=e+b+"/"+g;require._fileExists(a.toUrl(b))&&f.push(b)}function a(d,b,f){for(var e in b)b.hasOwnProperty(e)&&(!d.hasOwnProperty(e)||f)?d[e]=b[e]:"object"===typeof b[e]&&a(d[e],b[e],f)}var j=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(d){var b=d.config();return{version:"2.0.1",load:function(d,l,g,k){k=k||{};k.locale&&(b.locale=k.locale);
var c=j.exec(d),q=c[1],n=c[4],o=c[5],p=n.split("-"),r=[],t={},x,v="";c[5]?(q=c[1],d=q+o):(o=c[4],n=b.locale,n||(n=b.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),p=n.split("-"));if(k.isBuild){r.push(d);e(l,"root",r,q,o);for(x=0;x<p.length;x++)k=p[x],v+=(v?"-":"")+k,e(l,v,r,q,o);l(r,function(){g()})}else l([d],function(b){var c=[],d;m("root",b,c,r,q,o);for(x=0;x<p.length;x++){d=p[x];v=v+((v?"-":"")+d);m(v,b,c,r,q,o)}l(r,function(){var d,
f,e;for(d=c.length-1;d>-1&&c[d];d--){e=c[d];f=b[e];if(f===true||f===1)f=l(q+e+"/"+o);a(t,f)}t.t=function(a,b){return this[a]?this[a]:b?b:a};g(t)})})}}})})();define("ui/nls/i18n",{root:{"button.dismiss.label":"Dismiss","button.bold.label":"Bold","button.italic.label":"Italic","button.strikethrough.label":"Strikethrough","button.subscript.label":"Subscript","button.superscript.label":"Superscript","button.underline.label":"Underline","button.yes.label":"Yes","button.no.label":"No","button.p.label":"Paragraph",
"button.h1.label":"Heading 1","button.h2.label":"Heading 2","button.h3.label":"Heading 3","button.h4.label":"Heading 4","button.h5.label":"Heading 5","button.h6.label":"Heading 6","button.pre.label":"Preformatted text","button.removeFormatting.label":"Remove formatting","button.ol.label":"Insert ordered list","button.ul.label":"Insert unordered list","button.indent.label":"Indent list","button.outdent.label":"Outdent list","button.createLink.label":"Insert link","button.removeLink.label":"Remove link",
"button.createAbbr.label":"Insert abbreviation","button.characterPicker.label":"Pick special characters","button.createLink.label":"Insert link","button.removeLink.label":"Remove link","button.createAbbr.label":"Insert abbreviation","button.characterPicker.label":"Pick special characters","button.justifyLeft.label":"Align to the left","button.justifyRight.label":"Align to the right","button.justifyCenter.label":"Center","button.justifyFull.label":"Justify","button.horizontalRule.label":"Insert horizontal rule",
"button.createLanguageAnnotation.label":"Insert language annotation","button.metaview.label":"Switch between meta and normal view","button.quote.label":"Format selection as quote","button.blockquote.label":"Format selection as blockquote","tab.format.label":"Format","tab.insert.label":"Insert","tab.abbr.label":"Abbreviation","tab.img.label":"Image","tab.link.label":"Link","tab.cite.label":"Cite","tab.list.label":"List","tab.table.label":"Table","tab.col.label":"Table Column","tab.row.label":"Table Row",
"tab.cell.label":"Table Cell","tab.wai-lang.label":"Language annotation"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("ui/toolbar","jquery aloha/core ui/surface ui/tab ui/floating ui/context i18n!ui/nls/i18n jqueryui".split(" "),function(m,e,a,j,d,b,f){function l(){return!e.settings||!e.settings.toolbar||e.settings.toolbar.floating!==false}var g=a.extend({_moveTimeout:null,$_container:null,_tabBySlot:null,_tabs:[],_constructor:function(a,b){var e,n,o,p;this._super(a);this.$element=
m("<div>",{"class":"aloha-ui aloha-ui-toolbar",unselectable:"on"});this.$_container=j.createContainer().appendTo(this.$element);this._tabBySlot={};for(o=0;o<b.length;o++){e=b[o];n=new j(a,{label:f.t(e.label,e.label),showOn:e.showOn,container:this.$_container},e.components);for(p in n._elemBySlot)n._elemBySlot.hasOwnProperty(p)&&(this._tabBySlot[p]=n);this._tabs.push({tab:n,settings:e})}l()&&d.makeFloating(this,g)},adoptInto:function(a,b){var d=this._tabBySlot[a];return d&&d.adoptInto(a,b)},getActiveContainer:function(){return this.$_container.data("aloha-active-container")},
getContainers:function(){return this.$_container.data("aloha-tabs")},_move:function(a){var b=this;b._moveTimeout&&window.clearTimeout(b._moveTimeout);b._moveTimeout=window.setTimeout(function(){b._moveTimeout=null;e.activeEditable&&g.isFloatingMode&&d.floatSurface(b,e.activeEditable,a,g.setFloatingPosition)},20)},addPin:function(){var a=m('<div class="aloha-ui-pin">'),b=this.$element;b.find(".ui-tabs").append(a);b.find(".ui-tabs").hover(function(){b.addClass("aloha-ui-hover")},function(){b.removeClass("aloha-ui-hover")});
g.isFloatingMode||a.addClass("aloha-ui-pin-down");var f=this;a.click(function(){g.isFloatingMode=!g.isFloatingMode;var a;if(g.isFloatingMode)a={top:g.pinTop,left:g.pinLeft};else{a=f.$element.offset();a.top=a.top-m(window).scrollTop()}g.setFloatingPosition(a);d.togglePinSurface(f,a,g.isFloatingMode)})},show:function(){g.$surfaceContainer.children().detach();g.$surfaceContainer.append(this.$element);g.$surfaceContainer.stop().fadeTo(200,1);if(l()){var a=g.getFloatingPosition();this.$element.stop().css({top:a.top,
left:a.left});this._move()}},hide:function(){g.$surfaceContainer.stop().fadeOut(200,function(){g.$surfaceContainer.children().detach()})}});m.extend(g,{$surfaceContainer:null,isFloatingMode:true,pinLeft:0,pinTop:0,init:function(){g.$surfaceContainer=m("<div>",{"class":"aloha aloha-surface aloha-toolbar",unselectable:"on"}).hide();m(function(){g.$surfaceContainer.appendTo("body")});a.trackRange(g.$surfaceContainer);var b=d.getPinState();g.pinTop=b.top;g.pinLeft=b.left;g.isFloatingMode=!b.isPinned},
setFloatingPosition:function(a){g.pinTop=a.top;g.pinLeft=a.left},getFloatingPosition:function(){return{top:g.pinTop,left:g.pinLeft}}});g.init();return g});define("ui/settings",["jquery","util/arrays","util/maps","util/trees"],function(m,e,a,j){function d(a,b,d){var c,f,e=[],o;for(c=0;c<a.length;c++)if(f=a[c],!b[f.label]&&(o=j.postprune(f.components,d)))f=m.extend({},f),f.components=o,e.push(f);return e}function b(a,b,d){var c,f,e=[],o,p,r;for(c=0;c<a.length;c++)f=a[c],o=f.components||[],p=b[f.label],
!f.exclusive&&p&&(r=j.postprune(p.components,d))&&(o=o.concat(r)),f=m.extend({},p||{},f),f.components=o,e.push(f);return e}function f(b,d){var f,c=a.fillKeys({},d,!0);for(f=0;f<b.length;f++)c[b[f].label]=!0,a.fillKeys(c,j.flatten(b[f].components),!0);return c}return{defaultToolbarSettings:{tabs:[{label:"tab.format.label",showOn:{scope:"Aloha.continuoustext"},components:["bold strong italic emphasis underline \n subscript superscript strikethrough code quote".split(" "),"formatLink formatAbbr formatNumeratedHeaders toggleDragDrop \n toggleMetaView wailang toggleFormatlessPaste".split(" "),
"alignLeft alignCenter alignRight alignJustify \n orderedListFormatSelector unorderedListFormatSelector definitionListFormatSelector \n indentList outdentList colorPicker".split(" "),["formatBlock"]]},{label:"tab.insert.label",showOn:{scope:"Aloha.continuoustext"},components:["createTable characterPicker insertLink insertImage insertAbbr insertToc insertHorizontalRule insertTag".split(" ")]},{label:"tab.link.label",showOn:{scope:"link"},components:["editLink","toggleAnchor","editAnchor","removeLink",
"linkBrowser"]},{label:"tab.cite.label",showOn:{scope:"cite"},components:["editCite","removeCite","\n","editNote"]},{label:"tab.img.label",showOn:{scope:"image"},components:[["imageSource","\n","imageTitle"],["imageResizeWidth","\n","imageResizeHeight"],"imageAlignLeft imageAlignRight imageAlignNone imageIncPadding \n imageCropButton imageCnrReset imageCnrRatio imageDecPadding".split(" "),["imageBrowser"]]},{label:"tab.abbr.label",showOn:{scope:"abbr"},components:[["abbrText","removeAbbr"]]},{label:"tab.wai-lang.label",
showOn:{scope:"wai-lang"},components:[["wailangfield","removewailang"]]},{label:"tab.table.label",showOn:{scope:"table.cell"},components:["mergecells splitcells deleteTable tableCaption naturalFit tableSummary".split(" "),["formatTable"]]},{label:"tab.col.label",showOn:{scope:"table.column"},components:["addcolumnleft addcolumnright deletecolumns columnheader mergecellsColumn splitcellsColumn formatColumn".split(" ")]},{label:"tab.row.label",showOn:{scope:"table.row"},components:["addrowbefore addrowafter deleterows rowheader mergecellsRow splitcellsRow formatRow".split(" ")]},
{label:"tab.cell.label",showOn:{scope:"table.cell"},components:[["alignTop","alignMiddle","alignBottom","formatCell"]]}]},combineToolbarSettings:function(l,g,k){function c(a){return"array"===m.type(a)?!a.length:n[a]}var j=a.fillTuples({},e.map(g,function(a){return[a.label,a]})),n=f(l,k),l=b(l,j,c),g=d(g,n,c);return l.concat(g)}}});define("ui/ui-plugin","jquery aloha ui/context ui/container ui/surface ui/toolbar ui/scopes ui/settings PubSub jqueryui".split(" "),function(m,e,a,j,d,b,f,l,g){var k=new a,
c=new b(k,function(){var a=e.settings.toolbar,b=l.defaultToolbarSettings;return!a?b.tabs:l.combineToolbarSettings(a.tabs||[],b.tabs,a.exclude||[])}());e.bind("aloha-editable-activated",function(a){d.show(k);j.showContainersForContext(k,a)});e.bind("aloha-editable-deactivated",function(){d.suppressHide||d.hide(k)});g.sub("aloha.ui.scope.change",function(){j.showContainersForContext(k);f.getPrimaryScope();var a=c._tabs,b=f.getPrimaryScope(),d,g;for(g=0;g<a.length;g++){d=a[g].settings;if("object"===
m.type(d.showOn)&&d.showOn.scope===b){a[g].tab.foreground();break}}});return{adoptInto:function(a,b){return c.adoptInto(a,b)},showToolbar:function(a){d.show(k);j.showContainersForContext(k,a)}}});define("ui/ui",["jquery","ui/ui-plugin"],function(m,e){var a={};return{adopt:function(j,d,b){"string"!==m.type(j)?(b=d,d=j,j=b.name):b=m.extend({name:j},b);d.isInstance||(d=b?d.extend(b):d,d=new d);a[j]=d;e.adoptInto(j,d);return d},getAdoptedComponent:function(e){return a[e]||null}}});define("ui/utils",["jquery",
"jqueryui"],function(m){function e(a){return a.html||a.text||a.tooltip}function a(a){return'<img class="aloha-ui-inline-icon" src="'+a+'">'}return{wrapWithLabel:function(a,d){return m("<label>",{"class":"aloha-ui-label"}).append(m("<span>",{"class":"aloha-ui-label-text",text:a})).append(d)},makeButton:function(j,d,b){j.button({label:e(d),text:!(!d.text&&!d.html),icons:{primary:d.icon||d.iconUrl&&"aloha-ui-inline-icon-container"||null,secondary:b&&"aloha-jqueryui-icon ui-icon-triangle-1-s"||null}});
d.iconUrl&&j.button("widget").children(".ui-button-icon-primary").append(a(d.iconUrl));return j},makeButtonElement:function(a){return m("<button>",a).attr("type","button")},makeButtonLabel:e,makeButtonLabelWithIcon:function(j){var d=e(j);j.iconUrl&&(d=a(j.iconUrl)+d);return d},makeButtonIconFromUrl:a}});define("ui/vendor/jquery-ui-autocomplete-html",["jquery","jqueryui"],function(m){(function(e){function a(a,d){var l=RegExp(e.ui.autocomplete.escapeRegex(d),"i");return e.grep(a,function(a){return l.test(e("<div>").html(a.label||
a.value||a).text())})}var j=e.ui.autocomplete.prototype,d=j._initSource;e.extend(j,{_initSource:function(){this.options.html&&e.isArray(this.options.source)?this.source=function(b,d){d(a(this.options.source,b.term))}:d.call(this)},_renderItem:function(a,d){return e("<li></li>").data("item.autocomplete",d).append(e("<a></a>")[this.options.html?"html":"text"](d.label)).appendTo(a)}})})(m)});define("ui/port-helper-attribute-field","jquery ui/ui ui/component ui/scopes ui/context ui/utils aloha/repositorymanager aloha/selection aloha/console ui/vendor/jquery-ui-autocomplete-html".split(" "),
function(m,e,a,j,d,b,f,l){return function(g){function k(){if(G&&N!==v())N=G=null;G||C(H,v())}function c(a,b){b.item&&z(b.item.obj);n()}function j(){n()}function n(){r();if(B&&R!==m(B).attr(H)){G||f.markObject(B);v()===""&&x()}}function o(a){var b=m(B);a(b);for(var b=0,c=L.length;b<c;b++)a(m(L[b]))}function p(){var a=m(B);O&&o(function(a){a.addClass(O)});if(!K){r();a.context&&(a.context.style&&a.context.style["background-color"])&&o(function(a){a.attr("data-original-background-color",a.context.style["background-color"])});
o(function(a){a.css("background-color","#80B5F2")})}}function r(){var a=m(B);O&&o(function(a){a.removeClass(O)});if(!K){var b=a.attr("data-original-background-color");o(function(a){a.css("background-color",b||"")});a.attr("style")||o(function(a){a.removeAttr("style")});o(function(a){a.removeAttr("data-original-background-color")})}}function t(a,b){return a.replace(/\{([^}]+)\}/g,function(a,c){return c in b?b[c]:""})}function x(){if(null!==J){y.css("color","#AAA");y.val(J)}}function v(){return y.val()}
function u(a){y.val(a);y.css("color","black")}function z(a){if(G=a){var b=a[A];u(b);N=b;C(H,a[F]);f.markObject(B,a)}else N=null;y.trigger("item-change")}function C(a,b,c,d){B&&(typeof d==="undefined"||d.match(RegExp(c))?o(function(c){c.attr(a,b)}):m(B).removeAttr(a))}var F=g.valueField||"id",A=g.displayField||"name",E=g.objectTypeFilter||["all"],J=g.placeholder,K=!!g.noTargetHighlight,O=g.targetHighlightClass,y=g.element?m(g.element):m('<input id="aloha-attribute-field-'+g.name+'">'),Y,D,G,N,B,H,
R,L=[];g.cls&&y.addClass(g.cls);g.width&&y.width(g.width);Y=e.adopt(g.name,a,{scope:g.scope,init:function(){if(g.element)this.element=y;else if(g.label){this.element=b.wrapWithLabel(g.label,y);g.labelClass&&this.element.addClass(g.labelClass)}else this.element=m("<span>").append(y);y.autocomplete({html:true,appendTo:d.selector,source:function(a,b){f.query({queryString:a.term,objectTypeFilter:E},function(a){b(m.map(a.items,function(a){return{label:t(D,a),value:a.name,obj:a}}))})},open:g.open,select:c})}});
y.bind("focus",function(a){if(m(a.target).is(":visible")){p();v()===J&&u("")}}).bind("blur",j).bind("keydown",function(a){(a.keyCode==13||a.keyCode==27)&&a.preventDefault()}).bind("keyup",function(a){k();if(a.keyCode==13||a.keyCode==27){l.getRangeObject().select();n()}}).bind("change",function(){k()});x();Aloha.bind("aloha-editable-deactivated",j);var S={getInputElem:function(){return y[0]},hasInputElem:function(){return true},getInputId:function(){return y.attr("id")},hide:function(){y.hide()},show:function(){y.show()},
foreground:function(){Y.foreground()},focus:function(){Y.focus();y.focus()},getTargetObject:function(){return B},setTargetObject:function(a,b){var c=m(a);B=a;H=b;L=[];if(a&&b){R=c.attr(b);u(R);z(null);var d=c.attr("data-ignore-auto-values");f.getObject(a,function(a){if(a&&a.length>0){d&&c.attr("data-ignore-auto-values",d);z(a[0]);d&&c.removeAttr("data-ignore-auto-values")}})}else{u("");z(null)}},addAdditionalTargetObject:function(a){L.push(a)},setAttribute:C,getItem:function(){return G},setItem:z,
setValue:u,getValue:v,addListener:function(a,b){y.bind(a,m.proxy(b,S))},setObjectTypeFilter:function(a){E=a},setTemplate:function(a){D=a},setPlaceholder:x,getInputJQuery:function(){return y},enableInput:function(){y.removeAttr("disabled")},disableInput:function(){y.attr("disabled","disabled")}};return S}});define("ui/button",["jquery","ui/component","ui/utils","jqueryui"],function(m,e,a){return e.extend({init:function(){this._super();this.createButtonElement();a.makeButton(this.buttonElement,this).button("widget").tooltip({tooltipClass:"aloha aloha-ui-tooltip",
position:{my:"left top",at:"right bottom"}}).zIndex(0).click(m.proxy(function(){this.closeTooltip();this._onClick()},this))},closeTooltip:function(){this.buttonElement.tooltip("close",null,!0)},_onClick:function(){this.click()},click:function(){},createButtonElement:function(){var e=a.makeButtonElement();this["class"]&&e.addClass(this["class"]);this.element=this.buttonElement=e;var d=this;e.bind("mouseleave",function(){d.closeTooltip()});return e},disable:function(){this.element.button("option","disabled",
!1)},enable:function(a){this.element.button("option","disabled",!1===a)}})});define("ui/toggleButton",["jquery","ui/button","jqueryui"],function(m,e){return e.extend({_checked:!1,setState:function(a){this._checked!==a&&((this._checked=a)?this.element.addClass("aloha-button-active"):this.element.removeClass("aloha-button-active"))},getState:function(){return this._checked},_onClick:function(){this.setState(!this._checked);this.click()}})});define("ui/text",["jquery","ui/component"],function(m,e){return e.extend({init:function(){this._super();
this.element=m("<input>").on("change",m.proxy(function(a){this.setValue(a.target.value)},this)).on("keyup",m.proxy(function(a){this.updateValue(a.target.value)},this))},setValue:function(){},getValue:function(){return this.element.val()},updateValue:function(){}})});define("link/nls/i18n",{root:{"button.addlink.tooltip":"Insert Link","button.removelink.tooltip":"Remove Link","button.toggleanchor.tooltip":"Add/Remove anchor","newlink.defaulttext":"New Link","floatingmenu.tab.link":"Link","link.target.self":"Self",
"link.target.blank":"Blank","link.target.parent":"Parent","link.target.top":"Top","link.target.framename":"Framename","link.target.legend":"Target","link.title.legend":"Title","href.lang.legend":"Language",insertLink:"ctrl+k"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("util/keys",["jquery"],function(m){var e=function(){var a={};m.each({8:"backspace",9:"tab",13:"enter",16:"shift control alt",20:"capslock",27:"escape",32:"space",33:"pageup",34:"pagedown",37:"left up right down",
45:"insert",46:"delete",48:"0 1 2 3 4 5 6 7 8 9",65:"a b c d e f g h i j k l m n o p q r s t u v w x y z",112:"f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15"},function(e,d){var b=parseInt(e,10);m.each(d.split(" "),function(d,e){a[b+d]=e})});return a}();return{getToken:function(a){return e[a]},keyCodeTokenMap:m.extend({},e)}});define("link/../../../shared/languages/./iso639-1-de",[],function(){return{aa:{name:"Afar"},ab:{name:"Abchasen"},af:{name:"Afrikaans"},ak:{name:"Akan"},sq:{name:"Albanisch"},
am:{name:"Amharisch"},ar:{name:"Arabisch",flag:"ae"},an:{name:"Aragonesisch"},hy:{name:"Armenisch"},as:{name:"Assamesisch"},av:{name:"Avarisch"},ae:{name:"Avestan"},ay:{name:"Aymara"},az:{name:"Aserbaidschanisch"},ba:{name:"Baschkirisch"},bm:{name:"Bambara"},eu:{name:"Baskisch"},be:{name:"Weißrussisch",flag:"by"},bn:{name:"Bengalisch"},bh:{name:"Bihari Sprachen"},bi:{name:"Bislama"},bs:{name:"Bosnisch"},br:{name:"Bretonisch"},bg:{name:"Bulgarisch",flag:"bg"},my:{name:"Birmanisch"},ca:{name:"Katalanisch, Valencia",
flag:"es"},ch:{name:"Chamorro"},ce:{name:"Tschetschenisch"},zh:{name:"Chinesisch"},cu:{name:"Kirchenslawisch; Altslawisch; Altbulgarisch; Altkirchenslawisch"},cv:{name:"Tschuwaschische Sprache"},kw:{name:"Cornish"},co:{name:"Korsisch"},cr:{name:"Cree"},cs:{name:"Tschechisch"},da:{name:"Dänisch",flag:"dk"},dv:{name:"Divehi; Dhivehi; maledivische"},nl:{name:"Niederländisch, Flämisch"},dz:{name:"Dzongkha"},en:{name:"Englisch",flag:"gb"},eo:{name:"Esperanto"},et:{name:"Estnisch",flag:"ee"},ee:{name:"Ewe"},
fo:{name:"Färöisch"},fj:{name:"Fidschi"},fi:{name:"Finnisch",flag:"fi"},fr:{name:"Französisch"},fy:{name:"Westfriesisch"},ff:{name:"Fulah"},ka:{name:"Georgisch"},de:{name:"Deutsch",flag:"de"},gd:{name:"Gälisch, Schottisch-Gälisch"},ga:{name:"Irisch",flag:"ie"},gl:{name:"Galizisch"},gv:{name:"Manx"},el:{name:"Griechisch, Modern (1453 -)"},gn:{name:"Guarani"},gu:{name:"Gujarati"},ht:{name:"Haitianisch"},ha:{name:"Hausa"},he:{name:"Hebräisch",flag:"il"},hz:{name:"Herero"},hi:{name:"Hindi",flag:"in"},
ho:{name:"Hiri Motu"},hr:{name:"Kroatisch",flag:"hr"},hu:{name:"Ungarisch",flag:"hu"},ig:{name:"Igbo"},is:{name:"Isländisch"},io:{name:"Ido"},ii:{name:"Sichuan Yi; Nuosu"},iu:{name:"Inuktitut"},ie:{name:"Interlingue; Okzidental"},ia:{name:"Interlingua (International Auxiliary Language Association)"},id:{name:"Indonesisch",flag:"id"},ik:{name:"Inupiaq"},it:{name:"Italienisch",flag:"it"},jv:{name:"Javaner"},ja:{name:"Japanisch",flag:"jp"},kl:{name:"Kalaallisut; Grönländisch"},kn:{name:"Kannada"},ks:{name:"Kashmiri"},
kr:{name:"Kanuri"},kk:{name:"Kasachisch"},km:{name:"Mittel-Khmer"},ki:{name:"Kikuyu; Gikuyu"},rw:{name:"Kinyarwanda"},ky:{name:"Kirgisisch"},kv:{name:"Komi"},kg:{name:"Kongo"},ko:{name:"Koreanisch",flag:"kr"},kj:{name:"Kuanyama; Kwanyama"},ku:{name:"Kurdisch"},lo:{name:"Lao"},la:{name:"Latein"},lv:{name:"Lettisch",flag:"lv"},li:{name:"Limburgisch"},ln:{name:"Lingála"},lt:{name:"Litauisch",flag:"lt"},lb:{name:"Luxemburgisch, Lëtzebuergesch"},lu:{name:"Luba-Katanga"},lg:{name:"Ganda"},mk:{name:"Mazedonisch"},
mh:{name:"Marshallese"},ml:{name:"Malayalam"},mi:{name:"Maori"},mr:{name:"Marathi"},ms:{name:"Malaiisch"},mg:{name:"Malagasy"},mt:{name:"Maltesisch",flag:"mt"},mn:{name:"Mongolisch"},na:{name:"Nauru"},nv:{name:"Navajo; Navaho"},nr:{name:"Ndebele, Süd, Süd-Ndebele"},nd:{name:"Ndebele, Nord, Nord-Ndebele"},ng:{name:"Ndonga"},ne:{name:"Nepali"},nn:{name:"Norwegisch Nynorsk"},nb:{name:"Bokmål, Norwegisch, Norwegisch Bokmål"},no:{name:"Norwegisch",flag:"no"},ny:{name:"Chichewa; Chewa; Nyanja"},oc:{name:"Occitan (post 1500); provenzalischen"},
oj:{name:"Ojibwa"},or:{name:"Oriya"},om:{name:"Oromo"},os:{name:"Ossetisch"},pa:{name:"Panjabi, Punjabi"},fa:{name:"Persisch"},pi:{name:"Pali"},pl:{name:"Polnisch",flag:"pl"},pt:{name:"Portugiesisch",flag:"pt"},ps:{name:"Paschtu, Paschtu"},qu:{name:"Quechua"},rm:{name:"Rätoromanisch"},ro:{name:"Rumänisch; Moldawisch; Moldauisch"},rn:{name:"Rundi"},ru:{name:"Russisch",flag:"ru"},sg:{name:"Sango"},sa:{name:"Sanskrit"},si:{name:"Singhalesisch"},sk:{name:"Slowakisch"},sl:{name:"Slowenisch",flag:"si"},
se:{name:"Nord Sami"},sm:{name:"Samoaner"},sn:{name:"Shona"},sd:{name:"Sindhi"},so:{name:"Somali"},st:{name:"Sotho, Südlich"},es:{name:"Spanisch, Kastilisch",flag:"es"},sc:{name:"Sardisch"},sr:{name:"Serbisch",flag:"rs"},ss:{name:"Swati"},su:{name:"Sundanesisch"},sw:{name:"Swahili"},sv:{name:"Schwedisch",flag:"se"},ty:{name:"Tahitianisch"},ta:{name:"Tamilisch"},tt:{name:"Tatar"},te:{name:"Telugu"},tg:{name:"Tadschikisch"},tl:{name:"Tagalog"},th:{name:"Thailändisch",flag:"th"},bo:{name:"Tibetisch"},
ti:{name:"Tigrinya"},to:{name:"Tonga (Tonga-Inseln)"},tn:{name:"Tswana"},ts:{name:"Tsonga"},tk:{name:"Turkmenisch"},tr:{name:"Türkisch",flag:"tr"},tw:{name:"Twi"},ug:{name:"Uigurisch"},uk:{name:"Ukrainisch",flag:"ua"},ur:{name:"Urdu"},uz:{name:"Usbekisch"},ve:{name:"Venda"},vi:{name:"Vietnamesisch",flag:"vn"},vo:{name:"Volapük"},cy:{name:"Walisisch"},wa:{name:"Wallonisch"},wo:{name:"Wolof"},xh:{name:"Xhosa"},yi:{name:"Jiddisch"},yo:{name:"Yoruba"},za:{name:"Zhuang; Chuang"},zu:{name:"Zulu"}}});define("link/../../../shared/languages/./iso639-2-de",
[],function(){return{aar:{name:"Afar"},abk:{name:"Abchasen"},ace:{name:"Achinese"},ach:{name:"Acholi"},ada:{name:"Adangme"},ady:{name:"Adyghe; Adygei"},afa:{name:"Afro-Asiatische Sprachen"},afh:{name:"Afrihili"},afr:{name:"Afrikaans"},ain:{name:"Ainu"},aka:{name:"Akan"},akk:{name:"Akkadisch"},alb:{name:"Albanisch"},sqi:{name:"Albanisch",flag:"al"},ale:{name:"Aleutisch"},alg:{name:"Algonkin-Sprachen"},alt:{name:"Südaltai"},amh:{name:"Amharisch"},ang:{name:"Englisch, Alt (ca.450-1100)"},anp:{name:"Angika"},
apa:{name:"Apache Sprachen"},ara:{name:"Arabisch",flag:"ae"},arc:{name:"Offizielles Aramäisch (700-300 v. Chr.); Reichsaramäisch (700-300 v. Chr.)"},arg:{name:"Aragonesisch"},arm:{name:"Armenisch"},hye:{name:"Armenisch"},arn:{name:"Mapudungun; Mapuche"},arp:{name:"Arapaho"},art:{name:"Künstliche Sprachen"},arw:{name:"Arawak"},asm:{name:"Assamesisch"},ast:{name:"Asturisch"},ath:{name:"Athapascan Sprachen"},aus:{name:"Australische Sprachen"},ava:{name:"Avarisch"},ave:{name:"Avestan"},awa:{name:"Awadhi"},
aym:{name:"Aymara"},aze:{name:"Aserbaidschanisch"},bad:{name:"Banda Sprachen"},bai:{name:"Bamileke Sprachen"},bak:{name:"Baschkirisch"},bal:{name:"Baluchi"},bam:{name:"Bambara"},ban:{name:"Balinesisch"},baq:{name:"Baskisch"},eus:{name:"Baskisch"},bas:{name:"Basa"},bat:{name:"Baltische Sprachen"},bej:{name:"Beja; Bedawiyet"},bel:{name:"Weißrussisch",flag:"by"},bem:{name:"Bemba"},ben:{name:"Bengalisch"},ber:{name:"Berbersprachen"},bho:{name:"Bhojpuri"},bih:{name:"Bihari Sprachen"},bik:{name:"Bikol"},
bin:{name:"Bini, Edo"},bis:{name:"Bislama"},bla:{name:"Siksika"},bnt:{name:"Bantusprachen"},bos:{name:"Bosnisch"},bra:{name:"Braj"},bre:{name:"Bretonisch"},btk:{name:"Batak Sprachen"},bua:{name:"Buriatisch"},bug:{name:"Buginesisch"},bul:{name:"Bulgarisch",flag:"bg"},bur:{name:"Birmanisch"},mya:{name:"Birmanisch"},byn:{name:"Blin; Bilin"},cad:{name:"Caddo"},cai:{name:"Zentralamerikanische indische Sprachen"},car:{name:"Galibi Carib"},cat:{name:"Katalanisch, Valencia",flag:"es"},cau:{name:"Kaukasische Sprachen"},
ceb:{name:"Cebuano"},cel:{name:"Keltische Sprachen"},cha:{name:"Chamorro"},chb:{name:"Chibcha"},che:{name:"Tschetschenisch"},chg:{name:"Dschag."},chi:{name:"Chinesisch"},zho:{name:"Chinesisch",flag:"cn"},chk:{name:"Chuukese"},chm:{name:"Mari"},chn:{name:"Chinook-Jargon"},cho:{name:"Choctaw"},chp:{name:"Chipewyan; Dene Suline"},chr:{name:"Cherokee"},chu:{name:"Kirchenslawisch; Altslawisch; Altbulgarisch; Altkirchenslawisch"},chv:{name:"Tschuwaschische Sprache"},chy:{name:"Cheyenne"},cmc:{name:"Chamic Sprachen"},
cop:{name:"Koptisch"},cor:{name:"Cornish"},cos:{name:"Korsisch"},cpe:{name:"Kreolsprachen, englisch-basiert"},cpf:{name:"Kreolsprachen, französisch-basiert"},cpp:{name:"Kreolsprachen, portugiesisch-basiert"},cre:{name:"Cree"},crh:{name:"Krimtatarisch; Krim-türkisch"},crp:{name:"Kreolsprachen"},csb:{name:"Kaschubisch"},cus:{name:"Kuschitische Sprachen"},cze:{name:"Tschechisch"},ces:{name:"Tschechisch",flag:"cz"},dak:{name:"Dakota"},dan:{name:"Dänisch",flag:"dk"},dar:{name:"Dargwa"},day:{name:"Land Dayak Sprachen"},
del:{name:"Delaware"},den:{name:"Slave (Athapascan)"},dgr:{name:"Dogrib"},din:{name:"Dinka"},div:{name:"Divehi; Dhivehi; maledivische"},doi:{name:"Dogri"},dra:{name:"Dravidische Sprachen"},dsb:{name:"Niedersorbisch"},dua:{name:"Duala"},dum:{name:"Niederländisch, Mittel (ca.1050-1350)"},dut:{name:"Niederländisch, Flämisch"},nld:{name:"Niederländisch, Flämisch",flag:"nl"},dyu:{name:"Dyula"},dzo:{name:"Dzongkha"},efi:{name:"Efik"},egy:{name:"Ägyptisch (Altertümlich)"},eka:{name:"Ekajuk"},elx:{name:"Elamite"},
eng:{name:"Englisch",flag:"gb"},enm:{name:"Englisch, Mittle (1100-1500)"},epo:{name:"Esperanto"},est:{name:"Estnisch",flag:"ee"},ewe:{name:"Ewe"},ewo:{name:"Ewondo"},fan:{name:"Fang"},fao:{name:"Färöisch"},fat:{name:"Fanti"},fij:{name:"Fidschi"},fil:{name:"Filipinisch"},fin:{name:"Finnisch",flag:"fi"},fiu:{name:"Finno-ugrischen Sprachen"},fon:{name:"Fon"},fre:{name:"Französisch"},fra:{name:"Französisch",flag:"fr"},frm:{name:"Französisch, Mittel (ca.1400-1600)"},fro:{name:"Französisch, Alt (842-ca.1400)"},
frr:{name:"Nordfriesisch"},frs:{name:"Ostfriesisch"},fry:{name:"Westfriesisch"},ful:{name:"Fulah"},fur:{name:"Friaulisch"},gaa:{name:"Ga"},gay:{name:"Gayo"},gba:{name:"Gbaya"},gem:{name:"Germanische Sprachen"},geo:{name:"Georgisch"},kat:{name:"Georgisch"},ger:{name:"Deutsch",flag:"de"},deu:{name:"Deutsch",flag:"de"},gez:{name:"Geez"},gil:{name:"Gilbertesisch"},gla:{name:"Gälisch, Schottisch-Gälisch"},gle:{name:"Irisch",flag:"ie"},glg:{name:"Galizisch"},glv:{name:"Manx"},gmh:{name:"Deutsch, Mittlehoch (ca.1050-1500)"},
goh:{name:"Deutsch, Althoch (ca.750-1050)"},gon:{name:"Gondi"},gor:{name:"Gorontalo"},got:{name:"Gotisch"},grb:{name:"Grebo"},grc:{name:"Altgriechisch (bis 1453)"},gre:{name:"Griechisch, Modern (1453 -)"},ell:{name:"Griechisch, Modern (1453 -)",flag:"gr"},grn:{name:"Guarani"},gsw:{name:"Schweizerdeutsch, Alemannisch, Elsässisch"},guj:{name:"Gujarati"},gwi:{name:"Gwich'in"},hai:{name:"Haida"},hat:{name:"Haitianisch"},hau:{name:"Hausa"},haw:{name:"Hawaii"},heb:{name:"Hebräisch",flag:"il"},her:{name:"Herero"},
hil:{name:"Hiligaynon"},him:{name:"Himachali Sprachen; Pahari westliche Sprachen"},hin:{name:"Hindi",flag:"in"},hit:{name:"Hethitisch"},hmn:{name:"Hmong, Mong"},hmo:{name:"Hiri Motu"},hrv:{name:"Kroatisch",flag:"hr"},hsb:{name:"Obersorbisch"},hun:{name:"Ungarisch",flag:"hu"},hup:{name:"Hupa"},iba:{name:"Iban"},ibo:{name:"Igbo"},ice:{name:"Isländisch"},isl:{name:"Isländisch",flag:"is"},ido:{name:"Ido"},iii:{name:"Sichuan Yi; Nuosu"},ijo:{name:"Ijo Sprachen"},iku:{name:"Inuktitut"},ile:{name:"Interlingue; Okzidental"},
ilo:{name:"Iloko"},ina:{name:"Interlingua (International Auxiliary Language Association)"},inc:{name:"Indische Sprachen"},ind:{name:"Indonesisch",flag:"id"},ine:{name:"Indoeuropäische Sprachen"},inh:{name:"Inguschisch"},ipk:{name:"Inupiaq"},ira:{name:"Iranische Sprachen"},iro:{name:"Irokesen Sprachen"},ita:{name:"Italienisch",flag:"it"},jav:{name:"Javaner"},jbo:{name:"Lojban"},jpn:{name:"Japanisch",flag:"jp"},jpr:{name:"Jüdisch-persisch"},jrb:{name:"Jüdisch-arabisch"},kaa:{name:"Kara-Kalpak"},kab:{name:"Kabyle"},
kac:{name:"Kachin; Jingpho"},kal:{name:"Kalaallisut; Grönländisch"},kam:{name:"Kamba"},kan:{name:"Kannada"},kar:{name:"Karen Sprachen"},kas:{name:"Kashmiri"},kau:{name:"Kanuri"},kaw:{name:"Kawi"},kaz:{name:"Kasachisch"},kbd:{name:"Kabardinisch"},kha:{name:"Khasi"},khi:{name:"Khoisan-Sprache"},khm:{name:"Mittel-Khmer"},kho:{name:"Khotanesisch; Sakan"},kik:{name:"Kikuyu; Gikuyu"},kin:{name:"Kinyarwanda"},kir:{name:"Kirgisisch"},kmb:{name:"Kimbundu"},kok:{name:"Konkani"},kom:{name:"Komi"},kon:{name:"Kongo"},
kor:{name:"Koreanisch",flag:"kr"},kos:{name:"Kosraeanisch"},kpe:{name:"Kpelle"},krc:{name:"Karatschai-Balkar"},krl:{name:"Karelisch"},kro:{name:"Kru Sprachen"},kru:{name:"Kurukh"},kua:{name:"Kuanyama; Kwanyama"},kum:{name:"Kumykisch"},kur:{name:"Kurdisch"},kut:{name:"Kutenai"},lad:{name:"Ladino"},lah:{name:"Lahnda"},lam:{name:"Lamba"},lao:{name:"Lao"},lat:{name:"Latein"},lav:{name:"Lettisch",flag:"lv"},lez:{name:"Lesgisch"},lim:{name:"Limburgisch"},lin:{name:"Lingála"},lit:{name:"Litauisch",flag:"lt"},
lol:{name:"Mongo"},loz:{name:"Lozi"},ltz:{name:"Luxemburgisch, Lëtzebuergesch"},lua:{name:"Luba-Lulua"},lub:{name:"Luba-Katanga"},lug:{name:"Ganda"},lui:{name:"Luiseno"},lun:{name:"Lunda"},luo:{name:"Luo (Kenia und Tansania)"},lus:{name:"Lushai"},mac:{name:"Mazedonisch"},mkd:{name:"Mazedonisch",flag:"mk"},mad:{name:"Maduresisch"},mag:{name:"Magahi"},mah:{name:"Marshallese"},mai:{name:"Maithili"},mak:{name:"Makasar"},mal:{name:"Malayalam"},man:{name:"Mandingo"},mao:{name:"Maori"},mri:{name:"Maori"},
map:{name:"Austronesische Sprachen"},mar:{name:"Marathi"},mas:{name:"Masai"},may:{name:"Malaiisch"},msa:{name:"Malaiisch",flag:"my"},mdf:{name:"Moksha"},mdr:{name:"Mandar"},men:{name:"Mende"},mga:{name:"Irisch, Mittel (900-1200)"},mic:{name:"Mi'kmaq; Micmac"},min:{name:"Minangkabau"},mis:{name:"Unkodierte Sprachen"},mkh:{name:"Mon-Khmer-Sprachen"},mlg:{name:"Malagasy"},mlt:{name:"Maltesisch",flag:"mt"},mnc:{name:"Manchu"},mni:{name:"Manipuri"},mno:{name:"Manobo Sprachen"},moh:{name:"Mohawk"},mon:{name:"Mongolisch"},
mos:{name:"Mossi"},mul:{name:"Mehrere Sprachen"},mun:{name:"Munda-Sprachen"},mus:{name:"Bach"},mwl:{name:"Mirandesisch"},mwr:{name:"Marwari"},myn:{name:"Maya-Sprachen"},myv:{name:"Erzya"},nah:{name:"Nahuatl Sprachen"},nai:{name:"Nordamerikanische Indianer Sprachen"},nap:{name:"Neapolitanisch"},nau:{name:"Nauru"},nav:{name:"Navajo; Navaho"},nbl:{name:"Ndebele, Süd, Süd-Ndebele"},nde:{name:"Ndebele, Nord, Nord-Ndebele"},ndo:{name:"Ndonga"},nds:{name:"Plattdeutsch; Niedersächsisch, Deutsch"},nep:{name:"Nepali"},
"new":{name:"Nepal Bhasa; Newari"},nia:{name:"Nias"},nic:{name:"Niger-Kordofanianische Sprachen"},niu:{name:"Niuean"},nno:{name:"Norwegisch Nynorsk"},nob:{name:"Bokmål, Norwegisch, Norwegisch Bokmål"},nog:{name:"Nogai"},non:{name:"Norwegisch, Alt"},nor:{name:"Norwegisch",flag:"no"},nqo:{name:"N'Ko"},nso:{name:"Pedi; Sepedi; Nord Sotho"},nub:{name:"Nubische Sprachen"},nwc:{name:"Klassische Newari; Alt Newari; Klassische Nepal Bhasa"},nya:{name:"Chichewa; Chewa; Nyanja"},nym:{name:"Nyamwezi"},nyn:{name:"Nyankole"},
nyo:{name:"Nyoro"},nzi:{name:"Nzima"},oci:{name:"Occitan (post 1500); provenzalischen"},oji:{name:"Ojibwa"},ori:{name:"Oriya"},orm:{name:"Oromo"},osa:{name:"Osage"},oss:{name:"Ossetisch"},ota:{name:"Türkisch, osmanische (1500-1928)"},oto:{name:"Otomian Sprachen"},paa:{name:"Papua-Sprachen"},pag:{name:"Pangasinan"},pal:{name:"Pahlavi"},pam:{name:"Pampanga; Kapampangan"},pan:{name:"Panjabi, Punjabi"},pap:{name:"Papiamento"},pau:{name:"Palau"},peo:{name:"Persisch, Alt (ca.600-400 v. Chr.)"},per:{name:"Persisch"},
fas:{name:"Persisch"},phi:{name:"Philippinische Sprachen"},phn:{name:"Phönizisch"},pli:{name:"Pali"},pol:{name:"Polnisch",flag:"pl"},pon:{name:"Pohnpeian"},por:{name:"Portugiesisch",flag:"pt"},pra:{name:"Prakrit Sprachen"},pro:{name:"Provençal, Alt (bis 1500)"},pus:{name:"Paschtu, Paschtu"},"qaa-qtz":{name:"Reserviert für den lokalen Gebrauch"},que:{name:"Quechua"},raj:{name:"Rajasthani"},rap:{name:"Rapanui"},rar:{name:"Rarotongan; Cook Islands Maori"},roa:{name:"Romanische Sprachen"},roh:{name:"Rätoromanisch"},
rom:{name:"Roma"},rum:{name:"Rumänisch; Moldawisch; Moldauisch"},ron:{name:"Rumänisch; Moldawisch; Moldauisch",flag:"ro"},run:{name:"Rundi"},rup:{name:"Aromunischen; Arumanian; Macedo-Rumänischen"},rus:{name:"Russisch",flag:"ru"},sad:{name:"Sandawe"},sag:{name:"Sango"},sah:{name:"Yakut"},sai:{name:"Südamerikanische Indianer (Andere)"},sal:{name:"Salishan Sprachen"},sam:{name:"Samariter Aramäisch"},san:{name:"Sanskrit"},sas:{name:"Sasak"},sat:{name:"Santali"},scn:{name:"Sizilianisch"},sco:{name:"Schottisch"},
sel:{name:"Selkupisch"},sem:{name:"Semitische Sprachen"},sga:{name:"Irisch, Alt (bis 900)"},sgn:{name:"Registrierte Sprachen"},shn:{name:"Shan"},sid:{name:"Sidamo"},sin:{name:"Singhalesisch"},sio:{name:"Sioux-Sprachen"},sit:{name:"Sino-tibetische Sprachen"},sla:{name:"Slawische Sprachen"},slo:{name:"Slowakisch"},slk:{name:"Slowakisch",flag:"sk"},slv:{name:"Slowenisch",flag:"si"},sma:{name:"Süd Sami"},sme:{name:"Nord Sami"},smi:{name:"Sami Sprachen"},smj:{name:"Lulesamisch"},smn:{name:"Inari-Samen"},
smo:{name:"Samoaner"},sms:{name:"Skolt Sami"},sna:{name:"Shona"},snd:{name:"Sindhi"},snk:{name:"Soninke"},sog:{name:"Sogdisch"},som:{name:"Somali"},son:{name:"Songhai Sprachen"},sot:{name:"Sotho, Südlich"},spa:{name:"Spanisch, Kastilisch",flag:"es"},srd:{name:"Sardisch"},srn:{name:"Sranan Tongo"},srp:{name:"Serbisch",flag:"rs"},srr:{name:"Serer"},ssa:{name:"Nilosaharanische Sprachen"},ssw:{name:"Swati"},suk:{name:"Sukuma"},sun:{name:"Sundanesisch"},sus:{name:"Susu"},sux:{name:"Sumerisch"},swa:{name:"Swahili"},
swe:{name:"Schwedisch",flag:"se"},syc:{name:"Klassisch Syrisch"},syr:{name:"Syrisch"},tah:{name:"Tahitianisch"},tai:{name:"Tai Sprachen"},tam:{name:"Tamilisch"},tat:{name:"Tatar"},tel:{name:"Telugu"},tem:{name:"Timne"},ter:{name:"Tereno"},tet:{name:"Tetum"},tgk:{name:"Tadschikisch"},tgl:{name:"Tagalog"},tha:{name:"Thailändisch",flag:"th"},tib:{name:"Tibetisch"},bod:{name:"Tibetisch"},tig:{name:"Tigre"},tir:{name:"Tigrinya"},tiv:{name:"Tiv"},tkl:{name:"Tokelau"},tlh:{name:"Klingonisch; tlhIngan-Hol"},
tli:{name:"Tlingit"},tmh:{name:"Tamashek"},tog:{name:"Tonga (Nyasa)"},ton:{name:"Tonga (Tonga-Inseln)"},tpi:{name:"Tok Pisin"},tsi:{name:"Tsimshian"},tsn:{name:"Tswana"},tso:{name:"Tsonga"},tuk:{name:"Turkmenisch"},tum:{name:"Tumbuka"},tup:{name:"Tupi-Sprachen"},tur:{name:"Türkisch",flag:"tr"},tut:{name:"Altaische Sprachen"},tvl:{name:"Tuvalu"},twi:{name:"Twi"},tyv:{name:"Tuvinisch"},udm:{name:"Udmurtisch"},uga:{name:"Ugaritisch"},uig:{name:"Uigurisch"},ukr:{name:"Ukrainisch",flag:"ua"},umb:{name:"Umbundu"},
und:{name:"Unbestimmt"},urd:{name:"Urdu"},uzb:{name:"Usbekisch"},vai:{name:"Vai"},ven:{name:"Venda"},vie:{name:"Vietnamesisch",flag:"vn"},vol:{name:"Volapük"},vot:{name:"Wotisch"},wak:{name:"Wakashan Sprachen"},wal:{name:"Walamo"},war:{name:"Waray"},was:{name:"Washo"},wel:{name:"Walisisch"},cym:{name:"Walisisch"},wen:{name:"Sorbische Sprachen"},wln:{name:"Wallonisch"},wol:{name:"Wolof"},xal:{name:"Kalmücken; Oirat"},xho:{name:"Xhosa"},yao:{name:"Yao"},yap:{name:"Yap"},yid:{name:"Jiddisch"},yor:{name:"Yoruba"},
ypk:{name:"Yupik Sprachen"},zap:{name:"Zapoteken"},zbl:{name:"Bliss-Symbole; Blissymbolics; Bliss"},zen:{name:"Zenaga"},zha:{name:"Zhuang; Chuang"},znd:{name:"Zande Sprachen"},zul:{name:"Zulu"},zun:{name:"Zuni"},zxx:{name:"Kein sprachlicher Inhalt; Entfällt"},zza:{name:"Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki"}}});define("link/../../../shared/languages/./iso639-1-en",[],function(){return{aa:{name:"Afar"},ab:{name:"Abkhazian"},af:{name:"Afrikaans"},ak:{name:"Akan"},sq:{name:"Albanian"},am:{name:"Amharic"},
ar:{name:"Arabic",flag:"ae"},an:{name:"Aragonese"},hy:{name:"Armenian"},as:{name:"Assamese"},av:{name:"Avaric"},ae:{name:"Avestan"},ay:{name:"Aymara"},az:{name:"Azerbaijani"},ba:{name:"Bashkir"},bm:{name:"Bambara"},eu:{name:"Basque"},be:{name:"Belarusian",flag:"by"},bn:{name:"Bengali"},bh:{name:"Bihari languages"},bi:{name:"Bislama"},bs:{name:"Bosnian"},br:{name:"Breton"},bg:{name:"Bulgarian",flag:"bg"},my:{name:"Burmese"},ca:{name:"Catalan; Valencian",flag:"es"},ch:{name:"Chamorro"},ce:{name:"Chechen"},
zh:{name:"Chinese"},cu:{name:"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"},cv:{name:"Chuvash"},kw:{name:"Cornish"},co:{name:"Corsican"},cr:{name:"Cree"},cs:{name:"Czech"},da:{name:"Danish",flag:"dk"},dv:{name:"Divehi; Dhivehi; Maldivian"},nl:{name:"Dutch; Flemish"},dz:{name:"Dzongkha"},en:{name:"English",flag:"gb"},eo:{name:"Esperanto"},et:{name:"Estonian",flag:"ee"},ee:{name:"Ewe"},fo:{name:"Faroese"},fj:{name:"Fijian"},fi:{name:"Finnish",flag:"fi"},fr:{name:"French"},
fy:{name:"Western Frisian"},ff:{name:"Fulah"},ka:{name:"Georgian"},de:{name:"German",flag:"de"},gd:{name:"Gaelic; Scottish Gaelic"},ga:{name:"Irish",flag:"ie"},gl:{name:"Galician"},gv:{name:"Manx"},el:{name:"Greek, Modern (1453-)"},gn:{name:"Guarani"},gu:{name:"Gujarati"},ht:{name:"Haitian; Haitian Creole"},ha:{name:"Hausa"},he:{name:"Hebrew",flag:"il"},hz:{name:"Herero"},hi:{name:"Hindi",flag:"in"},ho:{name:"Hiri Motu"},hr:{name:"Croatian",flag:"hr"},hu:{name:"Hungarian",flag:"hu"},ig:{name:"Igbo"},
is:{name:"Icelandic"},io:{name:"Ido"},ii:{name:"Sichuan Yi; Nuosu"},iu:{name:"Inuktitut"},ie:{name:"Interlingue; Occidental"},ia:{name:"Interlingua (International Auxiliary Language Association)"},id:{name:"Indonesian",flag:"id"},ik:{name:"Inupiaq"},it:{name:"Italian",flag:"it"},jv:{name:"Javanese"},ja:{name:"Japanese",flag:"jp"},kl:{name:"Kalaallisut; Greenlandic"},kn:{name:"Kannada"},ks:{name:"Kashmiri"},kr:{name:"Kanuri"},kk:{name:"Kazakh"},km:{name:"Central Khmer"},ki:{name:"Kikuyu; Gikuyu"},
rw:{name:"Kinyarwanda"},ky:{name:"Kirghiz; Kyrgyz"},kv:{name:"Komi"},kg:{name:"Kongo"},ko:{name:"Korean",flag:"kr"},kj:{name:"Kuanyama; Kwanyama"},ku:{name:"Kurdish"},lo:{name:"Lao"},la:{name:"Latin"},lv:{name:"Latvian",flag:"lv"},li:{name:"Limburgan; Limburger; Limburgish"},ln:{name:"Lingala"},lt:{name:"Lithuanian",flag:"lt"},lb:{name:"Luxembourgish; Letzeburgesch"},lu:{name:"Luba-Katanga"},lg:{name:"Ganda"},mk:{name:"Macedonian"},mh:{name:"Marshallese"},ml:{name:"Malayalam"},mi:{name:"Maori"},mr:{name:"Marathi"},
ms:{name:"Malay"},mg:{name:"Malagasy"},mt:{name:"Maltese",flag:"mt"},mn:{name:"Mongolian"},na:{name:"Nauru"},nv:{name:"Navajo; Navaho"},nr:{name:"Ndebele, South; South Ndebele"},nd:{name:"Ndebele, North; North Ndebele"},ng:{name:"Ndonga"},ne:{name:"Nepali"},nn:{name:"Norwegian Nynorsk; Nynorsk, Norwegian"},nb:{name:"Bokmål, Norwegian; Norwegian Bokmål"},no:{name:"Norwegian",flag:"no"},ny:{name:"Chichewa; Chewa; Nyanja"},oc:{name:"Occitan (post 1500); Provençal"},oj:{name:"Ojibwa"},or:{name:"Oriya"},
om:{name:"Oromo"},os:{name:"Ossetian; Ossetic"},pa:{name:"Panjabi; Punjabi"},fa:{name:"Persian"},pi:{name:"Pali"},pl:{name:"Polish",flag:"pl"},pt:{name:"Portuguese",flag:"pt"},ps:{name:"Pushto; Pashto"},qu:{name:"Quechua"},rm:{name:"Romansh"},ro:{name:"Romanian; Moldavian; Moldovan"},rn:{name:"Rundi"},ru:{name:"Russian",flag:"ru"},sg:{name:"Sango"},sa:{name:"Sanskrit"},si:{name:"Sinhala; Sinhalese"},sk:{name:"Slovak"},sl:{name:"Slovenian",flag:"si"},se:{name:"Northern Sami"},sm:{name:"Samoan"},sn:{name:"Shona"},
sd:{name:"Sindhi"},so:{name:"Somali"},st:{name:"Sotho, Southern"},es:{name:"Spanish; Castilian",flag:"es"},sc:{name:"Sardinian"},sr:{name:"Serbian",flag:"rs"},ss:{name:"Swati"},su:{name:"Sundanese"},sw:{name:"Swahili"},sv:{name:"Swedish",flag:"se"},ty:{name:"Tahitian"},ta:{name:"Tamil"},tt:{name:"Tatar"},te:{name:"Telugu"},tg:{name:"Tajik"},tl:{name:"Tagalog"},th:{name:"Thai",flag:"th"},bo:{name:"Tibetan"},ti:{name:"Tigrinya"},to:{name:"Tonga (Tonga Islands)"},tn:{name:"Tswana"},ts:{name:"Tsonga"},
tk:{name:"Turkmen"},tr:{name:"Turkish",flag:"tr"},tw:{name:"Twi"},ug:{name:"Uighur; Uyghur"},uk:{name:"Ukrainian",flag:"ua"},ur:{name:"Urdu"},uz:{name:"Uzbek"},ve:{name:"Venda"},vi:{name:"Vietnamese",flag:"vn"},vo:{name:"Volapük"},cy:{name:"Welsh"},wa:{name:"Walloon"},wo:{name:"Wolof"},xh:{name:"Xhosa"},yi:{name:"Yiddish"},yo:{name:"Yoruba"},za:{name:"Zhuang; Chuang"},zu:{name:"Zulu"}}});define("link/../../../shared/languages/./iso639-2-en",[],function(){return{aar:{name:"Afar"},abk:{name:"Abkhazian"},
ace:{name:"Achinese"},ach:{name:"Acoli"},ada:{name:"Adangme"},ady:{name:"Adyghe; Adygei"},afa:{name:"Afro-Asiatic languages"},afh:{name:"Afrihili"},afr:{name:"Afrikaans"},ain:{name:"Ainu"},aka:{name:"Akan"},akk:{name:"Akkadian"},alb:{name:"Albanian"},sqi:{name:"Albanian",flag:"al"},ale:{name:"Aleut"},alg:{name:"Algonquian languages"},alt:{name:"Southern Altai"},amh:{name:"Amharic"},ang:{name:"English, Old (ca.450-1100)"},anp:{name:"Angika"},apa:{name:"Apache languages"},ara:{name:"Arabic",flag:"ae"},
arc:{name:"Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)"},arg:{name:"Aragonese"},arm:{name:"Armenian"},hye:{name:"Armenian"},arn:{name:"Mapudungun; Mapuche"},arp:{name:"Arapaho"},art:{name:"Artificial languages"},arw:{name:"Arawak"},asm:{name:"Assamese"},ast:{name:"Asturian; Bable; Leonese; Asturleonese"},ath:{name:"Athapascan languages"},aus:{name:"Australian languages"},ava:{name:"Avaric"},ave:{name:"Avestan"},awa:{name:"Awadhi"},aym:{name:"Aymara"},aze:{name:"Azerbaijani"},bad:{name:"Banda languages"},
bai:{name:"Bamileke languages"},bak:{name:"Bashkir"},bal:{name:"Baluchi"},bam:{name:"Bambara"},ban:{name:"Balinese"},baq:{name:"Basque"},eus:{name:"Basque"},bas:{name:"Basa"},bat:{name:"Baltic languages"},bej:{name:"Beja; Bedawiyet"},bel:{name:"Belarusian",flag:"by"},bem:{name:"Bemba"},ben:{name:"Bengali"},ber:{name:"Berber languages"},bho:{name:"Bhojpuri"},bih:{name:"Bihari languages"},bik:{name:"Bikol"},bin:{name:"Bini; Edo"},bis:{name:"Bislama"},bla:{name:"Siksika"},bnt:{name:"Bantu (Other)"},
bos:{name:"Bosnian"},bra:{name:"Braj"},bre:{name:"Breton"},btk:{name:"Batak languages"},bua:{name:"Buriat"},bug:{name:"Buginese"},bul:{name:"Bulgarian",flag:"bg"},bur:{name:"Burmese"},mya:{name:"Burmese"},byn:{name:"Blin; Bilin"},cad:{name:"Caddo"},cai:{name:"Central American Indian languages"},car:{name:"Galibi Carib"},cat:{name:"Catalan; Valencian",flag:"es"},cau:{name:"Caucasian languages"},ceb:{name:"Cebuano"},cel:{name:"Celtic languages"},cha:{name:"Chamorro"},chb:{name:"Chibcha"},che:{name:"Chechen"},
chg:{name:"Chagatai"},chi:{name:"Chinese"},zho:{name:"Chinese",flag:"cn"},chk:{name:"Chuukese"},chm:{name:"Mari"},chn:{name:"Chinook jargon"},cho:{name:"Choctaw"},chp:{name:"Chipewyan; Dene Suline"},chr:{name:"Cherokee"},chu:{name:"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"},chv:{name:"Chuvash"},chy:{name:"Cheyenne"},cmc:{name:"Chamic languages"},cop:{name:"Coptic"},cor:{name:"Cornish"},cos:{name:"Corsican"},cpe:{name:"Creoles and pidgins, English based"},cpf:{name:"Creoles and pidgins, French-based "},
cpp:{name:"Creoles and pidgins, Portuguese-based "},cre:{name:"Cree"},crh:{name:"Crimean Tatar; Crimean Turkish"},crp:{name:"Creoles and pidgins "},csb:{name:"Kashubian"},cus:{name:"Cushitic languages"},cze:{name:"Czech"},ces:{name:"Czech",flag:"cz"},dak:{name:"Dakota"},dan:{name:"Danish",flag:"dk"},dar:{name:"Dargwa"},day:{name:"Land Dayak languages"},del:{name:"Delaware"},den:{name:"Slave (Athapascan)"},dgr:{name:"Dogrib"},din:{name:"Dinka"},div:{name:"Divehi; Dhivehi; Maldivian"},doi:{name:"Dogri"},
dra:{name:"Dravidian languages"},dsb:{name:"Lower Sorbian"},dua:{name:"Duala"},dum:{name:"Dutch, Middle (ca.1050-1350)"},dut:{name:"Dutch; Flemish"},nld:{name:"Dutch; Flemish",flag:"nl"},dyu:{name:"Dyula"},dzo:{name:"Dzongkha"},efi:{name:"Efik"},egy:{name:"Egyptian (Ancient)"},eka:{name:"Ekajuk"},elx:{name:"Elamite"},eng:{name:"English",flag:"gb"},enm:{name:"English, Middle (1100-1500)"},epo:{name:"Esperanto"},est:{name:"Estonian",flag:"ee"},ewe:{name:"Ewe"},ewo:{name:"Ewondo"},fan:{name:"Fang"},
fao:{name:"Faroese"},fat:{name:"Fanti"},fij:{name:"Fijian"},fil:{name:"Filipino; Pilipino"},fin:{name:"Finnish",flag:"fi"},fiu:{name:"Finno-Ugrian languages"},fon:{name:"Fon"},fre:{name:"French"},fra:{name:"French",flag:"fr"},frm:{name:"French, Middle (ca.1400-1600)"},fro:{name:"French, Old (842-ca.1400)"},frr:{name:"Northern Frisian"},frs:{name:"Eastern Frisian"},fry:{name:"Western Frisian"},ful:{name:"Fulah"},fur:{name:"Friulian"},gaa:{name:"Ga"},gay:{name:"Gayo"},gba:{name:"Gbaya"},gem:{name:"Germanic languages"},
geo:{name:"Georgian"},kat:{name:"Georgian"},ger:{name:"German",flag:"de"},deu:{name:"German",flag:"de"},gez:{name:"Geez"},gil:{name:"Gilbertese"},gla:{name:"Gaelic; Scottish Gaelic"},gle:{name:"Irish",flag:"ie"},glg:{name:"Galician"},glv:{name:"Manx"},gmh:{name:"German, Middle High (ca.1050-1500)"},goh:{name:"German, Old High (ca.750-1050)"},gon:{name:"Gondi"},gor:{name:"Gorontalo"},got:{name:"Gothic"},grb:{name:"Grebo"},grc:{name:"Greek, Ancient (to 1453)"},gre:{name:"Greek, Modern (1453-)"},ell:{name:"Greek, Modern (1453-)",
flag:"gr"},grn:{name:"Guarani"},gsw:{name:"Swiss German; Alemannic; Alsatian"},guj:{name:"Gujarati"},gwi:{name:"Gwich'in"},hai:{name:"Haida"},hat:{name:"Haitian; Haitian Creole"},hau:{name:"Hausa"},haw:{name:"Hawaiian"},heb:{name:"Hebrew",flag:"il"},her:{name:"Herero"},hil:{name:"Hiligaynon"},him:{name:"Himachali languages; Western Pahari languages"},hin:{name:"Hindi",flag:"in"},hit:{name:"Hittite"},hmn:{name:"Hmong; Mong"},hmo:{name:"Hiri Motu"},hrv:{name:"Croatian",flag:"hr"},hsb:{name:"Upper Sorbian"},
hun:{name:"Hungarian",flag:"hu"},hup:{name:"Hupa"},iba:{name:"Iban"},ibo:{name:"Igbo"},ice:{name:"Icelandic"},isl:{name:"Icelandic",flag:"is"},ido:{name:"Ido"},iii:{name:"Sichuan Yi; Nuosu"},ijo:{name:"Ijo languages"},iku:{name:"Inuktitut"},ile:{name:"Interlingue; Occidental"},ilo:{name:"Iloko"},ina:{name:"Interlingua (International Auxiliary Language Association)"},inc:{name:"Indic languages"},ind:{name:"Indonesian",flag:"id"},ine:{name:"Indo-European languages"},inh:{name:"Ingush"},ipk:{name:"Inupiaq"},
ira:{name:"Iranian languages"},iro:{name:"Iroquoian languages"},ita:{name:"Italian",flag:"it"},jav:{name:"Javanese"},jbo:{name:"Lojban"},jpn:{name:"Japanese",flag:"jp"},jpr:{name:"Judeo-Persian"},jrb:{name:"Judeo-Arabic"},kaa:{name:"Kara-Kalpak"},kab:{name:"Kabyle"},kac:{name:"Kachin; Jingpho"},kal:{name:"Kalaallisut; Greenlandic"},kam:{name:"Kamba"},kan:{name:"Kannada"},kar:{name:"Karen languages"},kas:{name:"Kashmiri"},kau:{name:"Kanuri"},kaw:{name:"Kawi"},kaz:{name:"Kazakh"},kbd:{name:"Kabardian"},
kha:{name:"Khasi"},khi:{name:"Khoisan languages"},khm:{name:"Central Khmer"},kho:{name:"Khotanese; Sakan"},kik:{name:"Kikuyu; Gikuyu"},kin:{name:"Kinyarwanda"},kir:{name:"Kirghiz; Kyrgyz"},kmb:{name:"Kimbundu"},kok:{name:"Konkani"},kom:{name:"Komi"},kon:{name:"Kongo"},kor:{name:"Korean",flag:"kr"},kos:{name:"Kosraean"},kpe:{name:"Kpelle"},krc:{name:"Karachay-Balkar"},krl:{name:"Karelian"},kro:{name:"Kru languages"},kru:{name:"Kurukh"},kua:{name:"Kuanyama; Kwanyama"},kum:{name:"Kumyk"},kur:{name:"Kurdish"},
kut:{name:"Kutenai"},lad:{name:"Ladino"},lah:{name:"Lahnda"},lam:{name:"Lamba"},lao:{name:"Lao"},lat:{name:"Latin"},lav:{name:"Latvian",flag:"lv"},lez:{name:"Lezghian"},lim:{name:"Limburgan; Limburger; Limburgish"},lin:{name:"Lingala"},lit:{name:"Lithuanian",flag:"lt"},lol:{name:"Mongo"},loz:{name:"Lozi"},ltz:{name:"Luxembourgish; Letzeburgesch"},lua:{name:"Luba-Lulua"},lub:{name:"Luba-Katanga"},lug:{name:"Ganda"},lui:{name:"Luiseno"},lun:{name:"Lunda"},luo:{name:"Luo (Kenya and Tanzania)"},lus:{name:"Lushai"},
mac:{name:"Macedonian"},mkd:{name:"Macedonian",flag:"mk"},mad:{name:"Madurese"},mag:{name:"Magahi"},mah:{name:"Marshallese"},mai:{name:"Maithili"},mak:{name:"Makasar"},mal:{name:"Malayalam"},man:{name:"Mandingo"},mao:{name:"Maori"},mri:{name:"Maori"},map:{name:"Austronesian languages"},mar:{name:"Marathi"},mas:{name:"Masai"},may:{name:"Malay"},msa:{name:"Malay",flag:"my"},mdf:{name:"Moksha"},mdr:{name:"Mandar"},men:{name:"Mende"},mga:{name:"Irish, Middle (900-1200)"},mic:{name:"Mi'kmaq; Micmac"},
min:{name:"Minangkabau"},mis:{name:"Uncoded languages"},mkh:{name:"Mon-Khmer languages"},mlg:{name:"Malagasy"},mlt:{name:"Maltese",flag:"mt"},mnc:{name:"Manchu"},mni:{name:"Manipuri"},mno:{name:"Manobo languages"},moh:{name:"Mohawk"},mon:{name:"Mongolian"},mos:{name:"Mossi"},mul:{name:"Multiple languages"},mun:{name:"Munda languages"},mus:{name:"Creek"},mwl:{name:"Mirandese"},mwr:{name:"Marwari"},myn:{name:"Mayan languages"},myv:{name:"Erzya"},nah:{name:"Nahuatl languages"},nai:{name:"North American Indian languages"},
nap:{name:"Neapolitan"},nau:{name:"Nauru"},nav:{name:"Navajo; Navaho"},nbl:{name:"Ndebele, South; South Ndebele"},nde:{name:"Ndebele, North; North Ndebele"},ndo:{name:"Ndonga"},nds:{name:"Low German; Low Saxon; German, Low; Saxon, Low"},nep:{name:"Nepali"},"new":{name:"Nepal Bhasa; Newari"},nia:{name:"Nias"},nic:{name:"Niger-Kordofanian languages"},niu:{name:"Niuean"},nno:{name:"Norwegian Nynorsk; Nynorsk, Norwegian"},nob:{name:"Bokmål, Norwegian; Norwegian Bokmål"},nog:{name:"Nogai"},non:{name:"Norse, Old"},
nor:{name:"Norwegian",flag:"no"},nqo:{name:"N'Ko"},nso:{name:"Pedi; Sepedi; Northern Sotho"},nub:{name:"Nubian languages"},nwc:{name:"Classical Newari; Old Newari; Classical Nepal Bhasa"},nya:{name:"Chichewa; Chewa; Nyanja"},nym:{name:"Nyamwezi"},nyn:{name:"Nyankole"},nyo:{name:"Nyoro"},nzi:{name:"Nzima"},oci:{name:"Occitan (post 1500); Provençal"},oji:{name:"Ojibwa"},ori:{name:"Oriya"},orm:{name:"Oromo"},osa:{name:"Osage"},oss:{name:"Ossetian; Ossetic"},ota:{name:"Turkish, Ottoman (1500-1928)"},
oto:{name:"Otomian languages"},paa:{name:"Papuan languages"},pag:{name:"Pangasinan"},pal:{name:"Pahlavi"},pam:{name:"Pampanga; Kapampangan"},pan:{name:"Panjabi; Punjabi"},pap:{name:"Papiamento"},pau:{name:"Palauan"},peo:{name:"Persian, Old (ca.600-400 B.C.)"},per:{name:"Persian"},fas:{name:"Persian"},phi:{name:"Philippine languages"},phn:{name:"Phoenician"},pli:{name:"Pali"},pol:{name:"Polish",flag:"pl"},pon:{name:"Pohnpeian"},por:{name:"Portuguese",flag:"pt"},pra:{name:"Prakrit languages"},pro:{name:"Provençal, Old (to 1500)"},
pus:{name:"Pushto; Pashto"},"qaa-qtz":{name:"Reserved for local use"},que:{name:"Quechua"},raj:{name:"Rajasthani"},rap:{name:"Rapanui"},rar:{name:"Rarotongan; Cook Islands Maori"},roa:{name:"Romance languages"},roh:{name:"Romansh"},rom:{name:"Romany"},rum:{name:"Romanian; Moldavian; Moldovan"},ron:{name:"Romanian; Moldavian; Moldovan",flag:"ro"},run:{name:"Rundi"},rup:{name:"Aromanian; Arumanian; Macedo-Romanian"},rus:{name:"Russian",flag:"ru"},sad:{name:"Sandawe"},sag:{name:"Sango"},sah:{name:"Yakut"},
sai:{name:"South American Indian (Other)"},sal:{name:"Salishan languages"},sam:{name:"Samaritan Aramaic"},san:{name:"Sanskrit"},sas:{name:"Sasak"},sat:{name:"Santali"},scn:{name:"Sicilian"},sco:{name:"Scots"},sel:{name:"Selkup"},sem:{name:"Semitic languages"},sga:{name:"Irish, Old (to 900)"},sgn:{name:"Sign Languages"},shn:{name:"Shan"},sid:{name:"Sidamo"},sin:{name:"Sinhala; Sinhalese"},sio:{name:"Siouan languages"},sit:{name:"Sino-Tibetan languages"},sla:{name:"Slavic languages"},slo:{name:"Slovak"},
slk:{name:"Slovak",flag:"sk"},slv:{name:"Slovenian",flag:"si"},sma:{name:"Southern Sami"},sme:{name:"Northern Sami"},smi:{name:"Sami languages"},smj:{name:"Lule Sami"},smn:{name:"Inari Sami"},smo:{name:"Samoan"},sms:{name:"Skolt Sami"},sna:{name:"Shona"},snd:{name:"Sindhi"},snk:{name:"Soninke"},sog:{name:"Sogdian"},som:{name:"Somali"},son:{name:"Songhai languages"},sot:{name:"Sotho, Southern"},spa:{name:"Spanish; Castilian",flag:"es"},srd:{name:"Sardinian"},srn:{name:"Sranan Tongo"},srp:{name:"Serbian",
flag:"rs"},srr:{name:"Serer"},ssa:{name:"Nilo-Saharan languages"},ssw:{name:"Swati"},suk:{name:"Sukuma"},sun:{name:"Sundanese"},sus:{name:"Susu"},sux:{name:"Sumerian"},swa:{name:"Swahili"},swe:{name:"Swedish",flag:"se"},syc:{name:"Classical Syriac"},syr:{name:"Syriac"},tah:{name:"Tahitian"},tai:{name:"Tai languages"},tam:{name:"Tamil"},tat:{name:"Tatar"},tel:{name:"Telugu"},tem:{name:"Timne"},ter:{name:"Tereno"},tet:{name:"Tetum"},tgk:{name:"Tajik"},tgl:{name:"Tagalog"},tha:{name:"Thai",flag:"th"},
tib:{name:"Tibetan"},bod:{name:"Tibetan"},tig:{name:"Tigre"},tir:{name:"Tigrinya"},tiv:{name:"Tiv"},tkl:{name:"Tokelau"},tlh:{name:"Klingon; tlhIngan-Hol"},tli:{name:"Tlingit"},tmh:{name:"Tamashek"},tog:{name:"Tonga (Nyasa)"},ton:{name:"Tonga (Tonga Islands)"},tpi:{name:"Tok Pisin"},tsi:{name:"Tsimshian"},tsn:{name:"Tswana"},tso:{name:"Tsonga"},tuk:{name:"Turkmen"},tum:{name:"Tumbuka"},tup:{name:"Tupi languages"},tur:{name:"Turkish",flag:"tr"},tut:{name:"Altaic languages"},tvl:{name:"Tuvalu"},twi:{name:"Twi"},
tyv:{name:"Tuvinian"},udm:{name:"Udmurt"},uga:{name:"Ugaritic"},uig:{name:"Uighur; Uyghur"},ukr:{name:"Ukrainian",flag:"ua"},umb:{name:"Umbundu"},und:{name:"Undetermined"},urd:{name:"Urdu"},uzb:{name:"Uzbek"},vai:{name:"Vai"},ven:{name:"Venda"},vie:{name:"Vietnamese",flag:"vn"},vol:{name:"Volapük"},vot:{name:"Votic"},wak:{name:"Wakashan languages"},wal:{name:"Walamo"},war:{name:"Waray"},was:{name:"Washo"},wel:{name:"Welsh"},cym:{name:"Welsh"},wen:{name:"Sorbian languages"},wln:{name:"Walloon"},wol:{name:"Wolof"},
xal:{name:"Kalmyk; Oirat"},xho:{name:"Xhosa"},yao:{name:"Yao"},yap:{name:"Yapese"},yid:{name:"Yiddish"},yor:{name:"Yoruba"},ypk:{name:"Yupik languages"},zap:{name:"Zapotec"},zbl:{name:"Blissymbols; Blissymbolics; Bliss"},zen:{name:"Zenaga"},zha:{name:"Zhuang; Chuang"},znd:{name:"Zande languages"},zul:{name:"Zulu"},zun:{name:"Zuni"},zxx:{name:"No linguistic content; Not applicable"},zza:{name:"Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki"}}});define("link/../../../shared/languages/languages","aloha jquery ./iso639-1-de ./iso639-2-de ./iso639-1-en ./iso639-2-en".split(" "),
function(m,e,a,j,d,b){var f={"iso639-1-de":a,"iso639-2-de":j,"iso639-1-en":d,"iso639-2-en":b},l=m.getAlohaUrl()+"/../plugins/shared/languages/";return m.AbstractRepository.extend({languageCodes:[],locale:"de",iso:"iso639-1",objectType:"language",flags:false,_constructor:function(a,b,c,d,e){this._super(a);if(typeof b!=="undefined")this.flags=b;if(typeof c!=="undefined")this.iso="iso639-1"===c?"iso639-1":"iso639-2";if(typeof d!=="undefined")this.locale=d;if(typeof e!=="undefined")this.objectType=e;
a=f[this.iso+"-"+this.locale];this.storeLanguageCodes(a);this.languageData=a},init:function(){},markObject:function(){},errorHandler:function(a){console.log("error",this,"Error while loading languages. "+a)},storeLanguageCodes:function(a){var b=this,c=l+"img/";e.each(a,function(a,d){d.id=a;d.repositoryId=b.repositoryId;d.type=b.objectType;if(b.flags)d.url=d.flag?c+d.flag+".png":c+"default.png";b.languageCodes.push(new m.RepositoryDocument(d))})},_searchInLanguageCodes:function(a,b){var c=RegExp("^"+
a.queryString,"i"),d,f=[],l,j,m;for(d=0;d<this.languageCodes.length;++d){m=this.languageCodes[d];l=!a.queryString||m.name.match(c);j=!a.objectTypeFilter||!a.objectTypeFilter.length||e.inArray(m.type,a.objectTypeFilter)>-1;l&&j&&f.push(m)}b.call(this,f)},query:function(a,b){this._searchInLanguageCodes(a,b)},getObjectById:function(a,b){var c,d;for(c=0;c<this.languageCodes.length;++c){d=this.languageCodes[c];if(d.id===a){b.call(this,[d]);break}}}})});define("link/link-plugin","jquery aloha aloha/plugin aloha/ephemera aloha/content-rules util/dom ui/port-helper-attribute-field ui/ui ui/scopes ui/button ui/toggleButton ui/text i18n!link/nls/i18n PubSub util/keys ../../../shared/languages/languages".split(" "),
function(m,e,a,j,d,b,f,l,g,k,c,q,n,o,p,r){function t(a,b){O=f({name:"hreflangfield",valueField:"id",minChars:1,scope:"Aloha.continuoustext",open:function(){e.browser.mozilla&&O.getInputJQuery().autocomplete("widget").css("z-index","9999999999")}});a.flags?O.setTemplate('<div class="aloha-wai-lang-img-item"><img class="aloha-wai-lang-img" src="{url}" /><div class="aloha-wai-lang-label-item">{name} ({id})</div></div>'):O.setTemplate('<div class="aloha-wai-lang-img-item"><div class="aloha-wai-lang-label-item">{name} ({id})</div></div>');
O.setObjectTypeFilter(["language/link"]);O.addListener("item-change",function(){this.getItem()&&A(b.effective).attr("hreflang",this.getItem().id)});O.addListener("keyup",function(){if(A.trim(this.getValue()).length===0){this.setValue("");A(b.effective).attr("hreflang","")}})}function x(){A(document).bind("keydown.aloha-link.pointer-fix",function(a){(a.metaKey||p.getToken(a.keyCode)==="control")&&A("body").addClass("aloha-link-pointer")}).bind("keyup.aloha-link.pointer-fix",function(a){(a.metaKey||
p.getToken(a.keyCode)==="control")&&A("body").removeClass("aloha-link-pointer")})}function v(a){a.obj.delegate("a","click.aloha-link.meta-click-link",function(a){if(a.metaKey||a.ctrlKey){e.activeEditable.blur();window.setTimeout(function(){location.href=a.target},0);a.stopPropagation();return false}})}function u(a){if(!a)return"";if(a.hasOwnProperty(e.settings.locale))return a[e.settings.locale];for(var b in a)if(a.hasOwnProperty(b))return a[b];return""}function z(a,b){for(var c=a.findAllMarkupByTagName("A",
a),d=0,f=c.length;d<f;d++)b.addAdditionalTargetObject(c[d])}function C(a,b){var c,d=false;if(!a.ignoreNextSelectionChangedEvent&&e.Selection.isSelectionEditable()&&e.activeEditable!=null){c=A(a.findLinkMarkup(b));if(c.length>0){a.toggleLinkScope(true);a.prepareAnchor(c.attr("href"));c.attr("data-ignore-auto-values","true");a.hrefField.setTargetObject(c,"href");c.removeAttr("data-ignore-auto-values");z(b,a.hrefField);a.stripAnchor();a.hrefField.getItem()&&a.addAnchor(c);a.hrefChange();if(A("#"+a.hrefField.getInputId()).length==
0){a.hrefUpdateInt!==null&&clearInterval(a.hrefUpdateInt);a.hrefUpdateInt=setInterval(function(){if(A("#"+a.hrefField.getInputId()).length>0){a.prepareAnchor(c.attr("href"));a.hrefField.setTargetObject(c,"href");a.stripAnchor();a.hrefField.getItem()&&a.addAnchor(c);a.hrefChange();clearInterval(a.hrefUpdateInt)}},200)}e.trigger("aloha-link-selected");d=true;o.pub("aloha.link.selected",{input:a.hrefField.getInputElem(),href:a.hrefField.getTargetObject().attr("href"),element:a.hrefField.getTargetObject()})}else{a.toggleLinkScope(false);
a.hrefField.setTargetObject(null);e.trigger("aloha-link-unselected")}}else a.toggleLinkScope(false);a.ignoreNextSelectionChangedEvent=false;return d?c:false}var F={},A=m,E="",J,K=/^([a-z]){3,10}:\/\/.+/i,O,y,Y={merge:true,mergeable:function(a){return"aloha-new-link"===a.className&&a.nextSibling&&"aloha-new-link"===a.nextSibling.className}};j.classes("aloha-link-pointer","aloha-link-text");return a.create("link",{config:["a"],title:null,titleregex:null,targetregex:"",target:"",cssclassregex:null,cssclass:"",
objectTypeFilter:[],onHrefChange:null,ignoreNextSelectionChangedEvent:false,hrefUpdateInt:null,hotKey:{insertLink:n.t("insertLink","ctrl+k")},hrefValue:"http://",flags:true,anchorLinks:false,init:function(){var a=this;if("undefined"!==typeof this.settings.title)this.title=this.settings.title;if("undefined"!==typeof this.settings.titleregex)this.titleregex=this.settings.titleregex;if(typeof this.settings.targetregex!="undefined")this.targetregex=this.settings.targetregex;if(typeof this.settings.target!=
"undefined")this.target=this.settings.target;if(typeof this.settings.cssclassregex!="undefined")this.cssclassregex=this.settings.cssclassregex;if(typeof this.settings.cssclass!="undefined")this.cssclass=this.settings.cssclass;if(typeof this.settings.objectTypeFilter!="undefined")this.objectTypeFilter=this.settings.objectTypeFilter;if(typeof this.settings.onHrefChange!="undefined")this.onHrefChange=this.settings.onHrefChange;typeof this.settings.hotKey!="undefined"&&A.extend(true,this.hotKey,this.settings.hotKey);
if(typeof this.settings.hrefValue!="undefined")this.hrefValue=this.settings.hrefValue;if(typeof this.settings.anchorLinks!="undefined"){var b=this.settings.anchorLinks;this.anchorLinks=b===true||typeof b=="string"&&b.toLowerCase()!="false"}this.createButtons();this.subscribeEvents();this.bindInteractions();e.bind("aloha-plugins-loaded",function(){a.initSidebar(e.Sidebar.right);o.pub("aloha.link.ready",{plugin:a})});y=new r("link-languages",this.flags,"iso639-1",e.settings.locale,"language/link")},
nsSel:function(){var a=[];A.each(arguments,function(){a.push("."+(this==""?"aloha-link":"aloha-link-"+this))});return A.trim(a.join(" "))},nsClass:function(){var a=[];A.each(arguments,function(){a.push(this==""?"aloha-link":"aloha-link-"+this)});return A.trim(a.join(" "))},initSidebar:function(a){var b=this;a.addPanel({id:b.nsClass("sidebar-panel-target"),title:n.t("floatingmenu.tab.link"),content:"",expanded:true,activeOn:"a, link",onInit:function(){t(b,this);var a="";A.isArray(b.settings.sidebar)&&
A.each(b.settings.sidebar,function(){a=a+('<div class="'+b.nsClass("title-container")+'"><fieldset><legend>'+u(this.title)+'</legend><span class="'+b.nsClass(this.attr)+'"></span></fieldset></div>')});var c=this,d=this.setContent('<div class="'+b.nsClass("target-container")+'"><fieldset><legend>'+n.t("link.target.legend")+'</legend><ul><li><input type="radio" name="targetGroup" class="'+b.nsClass("radioTarget")+'" value="_self" /><span>'+n.t("link.target.self")+'</span></li><li><input type="radio" name="targetGroup" class="'+
b.nsClass("radioTarget")+'" value="_blank" /><span>'+n.t("link.target.blank")+'</span></li><li><input type="radio" name="targetGroup" class="'+b.nsClass("radioTarget")+'" value="_parent" /><span>'+n.t("link.target.parent")+'</span></li><li><input type="radio" name="targetGroup" class="'+b.nsClass("radioTarget")+'" value="_top" /><span>'+n.t("link.target.top")+'</span></li><li><input type="radio" name="targetGroup" class="'+b.nsClass("radioTarget")+'" value="framename" /><span>'+n.t("link.target.framename")+
'</span></li><li><input type="text" class="'+b.nsClass("framename")+'" /></li></ul></fieldset></div><div class="'+b.nsClass("title-container")+'" ><fieldset><legend>'+n.t("link.title.legend")+'</legend><input type="text" class="'+b.nsClass("linkTitle")+'" /></fieldset></div><div class="'+b.nsClass("href-lang-container")+'" ><fieldset><legend>'+n.t("href.lang.legend")+"</legend></fieldset></div>"+a).content;A(O.getInputElem()).addClass(b.nsClass("hrefLang"));A(d).find("."+b.nsClass("href-lang-container")+
" fieldset").append(O.getInputElem());A(b.nsSel("framename")).live("keyup",function(){A(c.effective).attr("target",A(this).val().replace('"',"&quot;").replace("'","&#39;"))});A(b.nsSel("radioTarget")).live("change",function(){if(A(this).val()=="framename")A(b.nsSel("framename")).slideDown();else{A(b.nsSel("framename")).slideUp().val("");A(c.effective).attr("target",A(this).val())}});A(b.nsSel("linkTitle")).live("keyup",function(){A(c.effective).attr("title",A(this).val().replace('"',"&quot;").replace("'",
"&#39;"))})},onActivate:function(a){var c=this;c.effective=a;if(A(c.effective).attr("target")!=null){var d=true;A(b.nsSel("framename")).hide().val("");A(b.nsSel("radioTarget")).each(function(){A(this).removeAttr("checked");if(A(this).val()===A(c.effective).attr("target")){d=false;A(this).attr("checked","checked")}});if(d){A(b.nsSel('radioTarget[value="framename"]')).attr("checked","checked");A(b.nsSel("framename")).val(A(c.effective).attr("target")).show()}}else{A(b.nsSel("radioTarget")).first().attr("checked",
"checked");A(c.effective).attr("target",A(b.nsSel("radioTarget")).first().val())}c=this;c.effective=a;A(b.nsSel("linkTitle")).val(A(c.effective).attr("title"));var f=A(a).attr("hreflang");f&&f.length>0?O.setValue(y.languageData?y.languageData[f].name:f):O.setValue("");K.test(A(a).attr("href"))?O.enableInput():O.disableInput()}});a.show()},subscribeEvents:function(){var a=this,b=0;o.sub("aloha.editable.created",function(c){var c=c.editable,f=a.getEditableConfig(c.obj),f=f&&A.inArray("a",f)>-1&&d.isAllowed(c.obj[0],
"a");F[c.getId()]=!!f;if(f){c.obj.bind("keydown.aloha-link",a.hotKey.insertLink,function(){if(a.findLinkMarkup()){a.hrefField.foreground();a.hrefField.focus()}else a.insertLink(true);return false});c.obj.find("a").each(function(){a.addLinkEventHandlers(this)});0===b++&&x()}});o.sub("aloha.editable.destroyed",function(a){a.editable.obj.unbind(".aloha-link");0===--b&&A(document).unbind(".aloha-link.pointer-fix")});o.sub("aloha.editable.activated",function(b){if(F[b.editable.getId()]){a._formatLinkButton.show();
a._insertLinkButton.show()}else{a._formatLinkButton.hide();a._insertLinkButton.hide()}v(b.editable)});o.sub("aloha.selection.context-change",function(b){if(e.activeEditable){var c=false;if(F[e.activeEditable.getId()]){c=C(a,b.range);c!==false&&!c.is(a.lastActiveLink)&&setTimeout(function(){a.hrefField.foreground()},10)}a.lastActiveLink=c}else a.lastActiveLink=false});o.sub("aloha.editable.deactivated",function(b){if(a.lastActiveLink!==false){setTimeout(function(){a.lastActiveLink||a.toggleLinkScope(false)},
100);a.lastActiveLink=false}b.editable.obj.unbind(".aloha-link.meta-click-link")})},toggleLinkScope:function(a){if(!(this._isScopeActive===a&&e.activeEditable&&this._isScopeActive_editableId===e.activeEditable.getId())){this._isScopeActive=a;this._isScopeActive_editableId=e.activeEditable&&e.activeEditable.getId();if(F[this._isScopeActive_editableId])if(a){this.hrefField.show();this.anchorLinks&&this.toggleAnchor.show();this._insertLinkButton.hide();e.activeEditable&&e.activeEditable.obj[0].nodeName===
"A"?this._removeLinkButton.hide():this._removeLinkButton.show();this._formatLinkButton.setState(true);g.enterScope(this.name,"link")}else{this.hrefField.hide();if(this.anchorLinks){this.anchorField.hide();this.toggleAnchor.hide()}this._insertLinkButton.show();this._removeLinkButton.hide();this._formatLinkButton.setState(false);g.leaveScope(this.name,"link",true)}else{this.hrefField.hide();if(this.anchorLinks){this.anchorField.hide();this.toggleAnchor.setState(false);this.toggleAnchor.hide()}this._insertLinkButton.hide();
this._removeLinkButton.hide();this._formatLinkButton.setState(false);g.leaveScope(this.name,"link",true)}}},addLinkEventHandlers:function(a){var b=this;A(a).mouseenter(function(){e.Log.debug(b,"mouse over link.");b.mouseOverLink=a;b.updateMousePointer()});A(a).mouseleave(function(){e.Log.debug(b,"mouse left link.");b.mouseOverLink=null;b.updateMousePointer()});A(a).click(function(a){if(a.metaKey){e.activeEditable.blur();window.setTimeout(function(){location.href=a.target},0);a.stopPropagation();return false}})},
createButtons:function(){var a=this;this._formatLinkButton=l.adopt("formatLink",c,{tooltip:n.t("button.addlink.tooltip"),icon:"aloha-icon aloha-icon-link",scope:"Aloha.continuoustext",click:function(){a.formatLink()}});this._insertLinkButton=l.adopt("insertLink",k,{tooltip:n.t("button.addlink.tooltip"),icon:"aloha-icon aloha-icon-link",scope:"Aloha.continuoustext",click:function(){a.insertLink(false)}});this.hrefField=f({name:"editLink",width:320,valueField:"url",cls:"aloha-link-href-field",scope:"Aloha.continuoustext",
noTargetHighlight:false,targetHighlightClass:"aloha-focus"});this.hrefField.setTemplate("<span><b>{name}</b><br/>{url}</span>");this.hrefField.setObjectTypeFilter(this.objectTypeFilter);if(this.anchorLinks){this.toggleAnchor=l.adopt("toggleAnchor",c,{tooltip:n.t("button.toggleanchor.tooltip"),icon:"aloha-icon aloha-icon-anchor",click:function(){if(a.anchorField.isVisible()){a.anchorField.clear();a.hrefField.focus()}else{a.anchorField.show();a.anchorField.focus()}return false}});this.anchorField=l.adopt("editAnchor",
q,{clear:function(){this.setInputValue("");this.updateValue("")},setInputValue:function(b){this.element.val(b);if(b&&(!this.isVisible()||!a.toggleAnchor.getState())){this.show();a.toggleAnchor.setState(true)}else if(!b&&(this.isVisible()||a.toggleAnchor.getState())){this.hide();a.toggleAnchor.setState(false)}},updateValue:function(b){if(a.lastActiveLink){var c=a.hrefField.getItem(),c=c?c.url?c.url:"":a.hrefField.getValue();if(/^https?:\/\/$/.test(c)&&b){c="";a.hrefField.setValue("")}a.lastActiveLink.attr("href",
c+(!c||b?"#":"")+b);a.hrefChange()}}});this.anchorField.hide()}this._removeLinkButton=l.adopt("removeLink",k,{tooltip:n.t("button.removelink.tooltip"),icon:"aloha-icon aloha-icon-unlink",scope:"Aloha.continuoustext",click:function(){a.removeLink()}})},prepareAnchor:function(a){if(this.anchorLinks){var b=a.indexOf("#");this.anchorField.setInputValue(b<0?"":a.substring(b+1))}},stripAnchor:function(){if(this.anchorLinks&&!this.hrefField.getItem()){var a=this.hrefField.getValue(),b=a.indexOf("#");if(!(b<
0)){a=a.substring(0,b);this.hrefField.setValue(a)}}},addAnchor:function(a){if(this.anchorLinks){var b=this.anchorField.getValue();if(b){if(!a)a=this.lastActiveLink;a.attr("href",a.attr("href")+"#"+b)}}},splitAnchor:function(){if(this.anchorLinks){var a=this.hrefField.getValue(),b=a.indexOf("#");if(b<0)this.anchorField.isVisible()&&this.anchorField.clear();else{var c=a.substring(b+1),a=a.substring(0,b);this.anchorField.setInputValue(c);this.hrefField.setValue(a);c&&this.anchorField.element.focus()}}},
bindInteractions:function(){var a=this;this.hrefField.addListener("item-change",function(){a.hrefChange()});if(this.anchorLinks){this.hrefField.addListener("change",function(){a.addAnchor()});this.hrefField.addListener("keypress",function(b){if(String.fromCharCode(b.charCode||b.keyCode)=="#"){if(a.anchorField.isVisible())a.anchorField.element.select();else{a.toggleAnchor.setState(true);a.anchorField.show()}a.anchorField.focus();return false}return true});this.hrefField.addListener("paste",function(){setTimeout(function(){a.splitAnchor();
a.hrefChange()},0)})}this.hrefField.addListener("keyup",function(b){if(p.getToken(b.keyCode)==="escape"){var c=a.hrefField.getValue();if(!(c[0]=="/"||c[0]=="#"||c.match(/^.*\.([a-z]){2,4}$/i)||c.match(K)||c.match(/^(mailto|tel):.+/i))){c=a.hrefField.getValue();a.hrefField.setValue(c);(c==a.hrefValue||c=="")&&a.removeLink(false)}}a.addAnchor();a.hrefChange();if(p.getToken(b.keyCode)==="enter"){b=e.Selection.getRangeObject();a.ignoreNextSelectionChangedEvent=true;b.startContainer=b.endContainer;b.startOffset=
b.endOffset;b.select();b=m(b.startContainer).closest(".aloha-editable,.aloha-table-cell-editable");b.length>0&&(e.browser.mozilla&&document.activeElement!==b[0])&&b.focus();c=A(a.hrefField.getInputElem()).attr("value");(c==a.hrefValue||c=="")&&a.removeLink(false);window.setTimeout(function(){g.setScope("Aloha.continuoustext")},100)}else{J=A(a.hrefField.getInputElem()).attr("value");E!=J&&(E=J)}});A(document).keydown(function(b){e.Log.debug(a,"Meta key down.");a.metaKey=b.metaKey;a.updateMousePointer()}).keyup(function(b){e.Log.debug(a,
"Meta key up.");a.metaKey=b.metaKey;a.updateMousePointer()})},updateMousePointer:function(){if(this.metaKey&&this.mouseOverLink){e.Log.debug(this,"set pointer");A(this.mouseOverLink).removeClass("aloha-link-text");A(this.mouseOverLink).addClass("aloha-link-pointer")}else{A(this.mouseOverLink).removeClass("aloha-link-pointer");A(this.mouseOverLink).addClass("aloha-link-text")}},findLinkMarkup:function(a){typeof a=="undefined"&&(a=e.Selection.getRangeObject());if(e.activeEditable){var b=e.activeEditable.obj;
b[0]&&b[0].nodeName==="A"&&(b=b.parent());return a.findMarkup(function(){return this.nodeName=="A"},b)}return null},formatLink:function(){e.activeEditable&&(this.findLinkMarkup(e.Selection.getRangeObject())?this.removeLink():this.insertLink())},insertLink:function(a){var c=this,d=e.Selection.getRangeObject(),f;if(d.startContainer&&d.endContainer&&!this.findLinkMarkup(d)){this.hrefField.foreground();d.isCollapsed()&&a!==false&&b.extendToWord(d);if(d.isCollapsed()){a=n.t("newlink.defaulttext");f=A('<a href="'+
c.hrefValue+'" class="aloha-new-link">'+a+"</a>");b.insertIntoDOM(f,d,A(e.activeEditable.obj));d.startContainer=d.endContainer=f.contents().get(0);d.startOffset=0;d.endOffset=a.length}else{f=A('<a href="'+c.hrefValue+'" class="aloha-new-link"></a>');b.addMarkup(d,f,false);b.doCleanup(Y,d)}e.activeEditable.obj.find("a.aloha-new-link").each(function(){c.addLinkEventHandlers(this);A(this).removeClass("aloha-new-link")});d.select();this.hrefField.focus();this.hrefField.hasInputElem()&&A(this.hrefField.getInputElem()).attr("value",
c.hrefValue).select();a=e.createRange();a.setStart(d.startContainer,d.startOffset);a.setEnd(d.endContainer,d.endOffset);o.pub("aloha.link.insert",{range:a});this.hrefChange()}},removeLink:function(a){var c=e.Selection.getRangeObject(),d=this.findLinkMarkup(),f;this.hrefField.setItem(null);this.anchorLinks&&this.anchorField.clear();if(d){f=A(d).text();b.removeFromDOM(d,c,true);c.startContainer=c.endContainer;c.startOffset=c.endOffset;c.select();(typeof a=="undefined"||a===true)&&g.setScope("Aloha.continuoustext");
a=e.createRange();a.setStart(c.startContainer,c.startOffset);a.setEnd(c.endContainer,c.endOffset);o.pub("aloha.link.remove",{range:a,text:f})}},automaticallySetTitle:function(a,b,c){var d=A(a.getTargetObject()).attr("title");b&&(!d||b===d)&&a.setAttribute("title",b,c,a.getValue())},hrefChange:function(){var a=A(this.hrefField.getTargetObject()),a=a&&!a.attr("data-ignore-auto-values"),b=this;this.automaticallySetTitle(this.hrefField,this.title,this.titleregex);a&&this.target&&this.hrefField.setAttribute("target",
this.target,this.targetregex,this.hrefField.getValue());a&&null!=this.cssclassregex&&this.hrefField.setAttribute("class",this.cssclass,this.cssclassregex,this.hrefField.getValue());var a=b.hrefField.getValue(),c=b.hrefField.getTargetObject();if(this.anchorLinks){var d=b.anchorField.getValue();d&&(a=a+("#"+d))}e.trigger("aloha-link-href-change",{href:a,obj:c,item:b.hrefField.getItem()});o.pub("aloha.link.changed",{href:a,element:c,input:b.hrefField.getInputElem()});typeof this.onHrefChange=="function"&&
this.onHrefChange.call(this,this.hrefField.getTargetObject(),a,this.hrefField.getItem());var f=this.hrefField.getItem();if(f&&f.language){a=y.languageData?y.languageData[f.language].name:f.language;this.hrefField.setAttribute("hreflang",f.language);O.setValue(a);O.disableInput()}else if(K.test(a))O.enableInput();else{O.setValue("");this.hrefField.setAttribute("hreflang","");O.disableInput()}e.Sidebar.right.checkActivePanels(e.Selection.getRangeObject());A.isArray(b.settings.sidebar)&&A.each(b.settings.sidebar,
function(){f&&f.hasOwnProperty(this.attr)?A(b.nsSel(this.attr)).text(f[this.attr]):A(b.nsSel(this.attr)).text("")})}})});define("ui/dialog",["jquery","ui/component","i18n!ui/nls/i18n"],function(m,e,a){function j(a){var b={};a.text&&(b.text=a.text);a.html&&(b.html=a.html);return m("<div>",b)}function d(a){return function(){a.apply(this);m(this).dialog("destroy").remove()}}function b(a){for(var b in a)a.hasOwnProperty(b)&&(a[b]=d(a[b]));return a}function f(a,b){var d="aloha aloha-dialog aloha-ui";a.cls&&
(d+=" "+a.cls);return{resizable:!1,modal:!0,title:a.title||b,dialogClass:d,zIndex:10200}}return{confirm:function(d){var g=d.buttons||{},e=a.t("button.yes.label"),c=a.t("button.no.label");null!==g.Yes&&"Yes"!==e&&(g[e]=g.Yes,delete g.Yes);null!==g.No&&"No"!==c&&(g[c]=g.No,delete g.No);g[e]=g[e]||d.yes||m.noop;g[c]=g[c]||d.no||m.noop;if(d.answer){var q=g[e],n=g[c];g[e]=function(){q();d.answer(true)};g[c]=function(){n();d.answer(false)}}var o=j(d).dialog(m.extend(f(d,"Confirm"),{buttons:b(g)}));return function(){o.dialog("destroy").remove()}},
alert:function(d){var g={};g[a.t("button.dismiss.label")]=m.noop;var e=j(d).dialog(m.extend(f(d,"Alert"),{buttons:b(g)}));return function(){e.dialog("destroy").remove()}},modal:function(a){a=j(a).dialog(m.extend(f(a,""),a));a.parent().find(".ui-dialog-titlebar").remove();return a},progress:function(a){var b=m("<div>").progressbar({value:null!=a.value?a.value:100}),d=j(a).dialog(m.extend(f(a,"Progress"),{open:function(){m(this).append(b)}}));return function(a){null!=a?b.progressbar({value:a}):d.dialog("destroy").remove()}}}});
define("ui/multiSplit",["jquery","ui/component","ui/button","ui/utils"],function(m,e,a,j){return e.extend({_activeButton:null,_isOpen:!1,init:function(){this._super();var a=this,b=this.element=m("<div>",{"class":"aloha-multisplit"});this.contentElement=m("<div>",{"class":"aloha-multisplit-content"}).appendTo(b);this.toggleButton=j.makeButtonElement({"class":"aloha-multisplit-toggle",click:function(){a.toggle()}}).button().appendTo(b);this.buttons=[];var f=this.getButtons();0===f.length&&(b.hide(),
this.visible=!1);for(b=0;b<f.length;b++)this.addButton(f[b]);m("body").click(function(b){a._isOpen&&(!a.element.is(b.target)&&0===a.element.find(b.target).length)&&a.close()})},addButton:function(d){var b=this,f=new (a.extend({tooltip:d.tooltip,icon:d.wide?d.icon:"aloha-large-icon "+d.icon,iconOnly:d.wide?!1:!0,init:function(){this._super();d.init&&d.init.call(this)},click:function(){d.click.apply(b,arguments);b.close()}}));d.wide||f.element.addClass("aloha-large-button");b.buttons[d.name]={settings:d,
component:f,element:f.element,visible:!0};var e=this.contentElement.children(".aloha-ui-multisplit-fullwidth");!d.wide&&e.length?e.before(f.element[0]):this.contentElement.append(f.element[0])},setActiveButton:function(a){a||(a=null);null!==this._activeButton&&this.buttons[this._activeButton].element.removeClass("aloha-multisplit-active");this._activeButton=a;null!==a&&this.buttons[a].element.addClass("aloha-multisplit-active")},toggle:function(){this.element.toggleClass("aloha-multisplit-open");
this._isOpen=!this._isOpen},open:function(){this.element.addClass("aloha-multisplit-open");this._isOpen=!0},close:function(){this.element.removeClass("aloha-multisplit-open");this._isOpen=!1},show:function(a){a||(a=null);null!==a&&void 0!==this.buttons[a]&&(this.buttons[a].element.show(),this.buttons[a].visible=!0,this.element.show(),this.visible=!0)},hide:function(a){var b,f=!1;a||(a=null);if(null!==a&&void 0!==this.buttons[a]){this.buttons[a].element.hide();this.buttons[a].visible=!1;for(b in this.buttons)if(this.buttons.hasOwnProperty(b)&&
this.buttons[b].visible){this.element.show();f=this.visible=!0;break}f||(this.element.hide(),this.visible=!1)}}})});define("ui/port-helper-multi-split",["aloha/core","jquery","ui/ui","ui/multiSplit"],function(m,e,a,j){return function(d){var b;b=a.adopt(d.name,j,{scope:d.scope,getButtons:function(){var a=[];e.each(d.items,function(b,d){a.push({tooltip:d.tooltip,text:d.text,name:d.name,icon:d.iconClass,click:d.click,init:function(){d.cls&&this.element.addClass(d.cls);d.init&&d.init.call(this)},wide:d.wide})});
return a}});return{pushItem:function(a){b.addButton(a)},showItem:function(a){b.show(a)},hideItem:function(a){b.hide(a)},setActiveItem:function(a){b.setActiveButton(a)}}}});define("table/nls/i18n",{root:{"floatingmenu.tab.table":"Table","floatingmenu.tab.tablelayout":"Table Layout","deleterows.confirm":"Do you really want to delete the selected rows?","deletecolumns.confirm":"Do you really want to delete the selected columns?","deletetable.confirm":"Do you really want to delete the table?",Table:"Table",
"button.createtable.tooltip":"Insert Table","button.addcolleft.tooltip":"Add Column left","button.addcolright.tooltip":"Add Column right","button.delcols.tooltip":"Delete Columns","button.addrowbefore.tooltip":"Add Row before","button.addrowafter.tooltip":"Add Row after","button.delrows.tooltip":"Delete Rows","button.caption.tooltip":"Table caption","button.naturalfit.tooltip":"Reset table sizing","empty.caption":"Table caption","button.removeFormat.tooltip":"Remove formatting","button.removeFormat.text":"Remove formatting",
"button.rowheader.tooltip":"Format row as table header","button.columnheader.tooltip":"Format column as table header","button.mergecells.tooltip":"Merge Cells","button.splitcells.tooltip":"Split Cells","table.label.target":"Summary","table.sidebar.title":"Table","table.mergeCells.notRectangular":"Only a rectangular selection can be merged","table.addColumns.nonConsecutive":"Please select a single column or a consecutive range of columns","table.createTable.nestedTablesNoSupported":"Sorry, nested tables are not supported",
"button.deltable.tooltip":"Delete table"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("aloha/nls/i18n",{root:{"plugin.abbr.floatingmenu.tab.abbr":"Abbreviation","floatingmenu.tab.format":"Format","floatingmenu.tab.insert":"Insert",yes:"Yes",no:"No",cancel:"Cancel","repository.no_item_found":"No item found.","repository.loading":"Loading","repository.no_items_found_yet":"No items found yet..."},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("table/table-create-layer",
["jquery"],function(m){CreateLayer=function(e){this.TablePlugin=e};CreateLayer.prototype.parameters={elemId:"aloha-table-createLayer",className:"aloha-table-createdialog",numX:10,numY:10,layer:void 0,target:void 0};CreateLayer.prototype.config={};CreateLayer.prototype.visible=!1;CreateLayer.prototype.show=function(){var e=this.get("layer");null==e?this.create():(this.setPosition(e),e.find("td").removeClass("hover"),e.show());this.visible=!0};CreateLayer.prototype.create=function(){var e=this,a=m("<div></div>");
a.id=this.get("elemId");a.addClass(this.get("className"));var j=m("<table></table>");j.css("width",15*(this.get("numX")+6));for(var d,b,f=0;f<this.get("numY");f++){d=m("<tr></tr>");for(var l=0;l<this.get("numX");l++)b=m("<td> </td>"),0==f&&0==l&&b.addClass("hover"),b.bind("mouseover",{rowId:f,colId:l},function(a){e.handleMouseOver(a,j)}),b.bind("click",{rowId:f,colId:l},function(a){e.TablePlugin.createTable(a.data.colId+1,a.data.rowId+1);e.hide()}),d.append(b);j.append(d)}a.append(j);this.set("layer",
a);this.setPosition();a.bind("click",function(a){a.stopPropagation()}).mousedown(function(a){a.stopPropagation()});m("body").append(a).bind("click",function(a){e.visible&&!(a.target===e.get("target")[0]||m.contains(e.get("target")[0],a.target))&&e.hide()})};CreateLayer.prototype.handleMouseOver=function(e,a){for(var j=e.data.rowId,d=e.data.colId,b=a.find("tr"),f=0;f<=b.length;f++)for(var l=m(b[f]).find("td"),g=0;g<=l.length;g++)f<=j&&g<=d?m(l[g]).addClass("hover"):m(l[g]).removeClass("hover")};CreateLayer.prototype.setPosition=
function(){var e=m(this.get("target")),a=e.offset();this.get("layer").css("left",a.left+"px");this.get("layer").css("top",a.top+e.height()+"px")};CreateLayer.prototype.hide=function(){this.get("layer").hide();this.visible=!1};CreateLayer.prototype.get=function(e){if(this.config[e])return this.config[e];if(this.parameters[e])return this.parameters[e]};CreateLayer.prototype.set=function(e,a){this.config[e]?this.config[e]=a:this.parameters[e]=a};return CreateLayer});define("table/table-plugin-utils",
["jquery","aloha/copypaste","util/browser","aloha/console"],function(m,e,a,j){var d={cellIndexToGridColumn:function(a,f,e){var g=null;d.walkCells(a,function(a,b,d){if(a===f&&b===e)return g=d,!1});return g},walkCells:function(a,f){for(var e=[],g=0;g<a.length;g++){for(var k=a[g].cells,c=0,j=0;j<k.length;j++){for(var m=k[j],o=d.colspan(m),m=d.rowspan(m);e[j+c];)e[j+c]-=1,c+=1;if(!1===f(g,j,j+c,o,m))return;for(var p=0;p<o;p++){if(e[j+c+p])throw"an impossible case has occurred";e[j+c+p]=m-1}c+=o-1}for(;j+
c<e.length;c++)e[j+c]&&(e[j+c]-=1)}},makeGrid:function(a){var f=[];d.walkCells(a,function(d,g,e,c,j){for(var g=a[d].cells[g],m=0;m<j;m++){f[d+m]=f[d+m]||[];for(var o=0;o<c;o++)f[d+m][e+o]={cell:g,colspan:c,rowspan:j,spannedX:o,spannedY:m}}});return f},containsDomCell:function(a){return 0===a.spannedX&&0===a.spannedY},leftDomCell:function(a,d,e){do{var g=a[d][e];if(0===g.spannedY)return g.cell;e-=g.spannedX+1}while(0<=e);return null},splitCell:function(a,f){var e=m(a),g=d.colspan(a),k=d.rowspan(a);
if(!(1===g&&1===k)){for(var c=e.parent(),j=c.parent().children(),c=c.index(),n=e.index(),o=d.makeGrid(j),n=d.cellIndexToGridColumn(j,c,n),p=0;p<k;p++)for(var r=0===p?1:0;r<g;r++){var t=d.leftDomCell(o,c+p,n);null==t?j.eq(c+p).prepend(f()):m(t).after(f())}e.removeAttr("colSpan");e.removeAttr("rowSpan")}},rowspan:function(a){return parseInt(m(a).attr("rowspan"))||1},colspan:function(a){return parseInt(m(a).attr("colspan"))||1},walkGrid:function(a,d){for(var e,g=0,k=a.length;g<k;g++){e=a[g];for(var c=
0,j=e.length;c<j;c++)if(!1===d(e[c],c,g))return}},walkGridInsideRect:function(a,f,e){d.walkGrid(a,function(a,b,c){if(c>=f.top&&c<f.bottom&&b>=f.left&&b<f.right)return e(a,b,c)})},leftTrimArray:function(a){for(var d=0;d<a.length;d++)if(null!=a[d])return a.slice(d,a.length);return[]},makeContour:function(a,f){var e=[],g=[],k=[],c=[];d.walkGrid(a,function(a,b,d){if(f(a,b,d)){if(null==e[d]||b<e[d])e[d]=b;if(null==g[d]||b>g[d])g[d]=b;if(null==k[b]||d<k[b])k[b]=d;if(null==c[b]||d>c[b])c[b]=d}});e=d.leftTrimArray(e);
g=d.leftTrimArray(g);k=d.leftTrimArray(k);c=d.leftTrimArray(c);return{left:e,right:g,top:k,bottom:c}},indexOfAnyBut:function(a,d){for(var e=0;e<a.length;e++)if(d!==a[e])return e;return-1},isConsecutive:function(a){for(var d=1;d<a.length;d++)if(1!==Math.abs(a[d]-a[d-1]))return!1;return!0},resizeCellWidth:function(a,d){m(a).css("width",d);m(a).find(".aloha-table-cell-editable").eq(0).css({width:d,"word-wrap":"break-word"})},convertCellWidthToPercent:function(a){var f=[];d.walkCells(a,function(d,g,e,
c){var d=m(a[d]),e=d.find(".aloha-table-selectrow").outerWidth(),e=d.width()-e,g=m(d.children()[g]),j=g.outerWidth();if(g.hasClass("aloha-table-selectrow")||d.hasClass("aloha-table-selectcolumn")||1<c)return!0;f.push({cell:g,width:Math.round(100*(j/e))+"%"})});m.each(f,function(a,b){b.cell.css("width",b.width)})},getMinColWidth:function(a){var f=a.closest("tbody").children("tr"),e=a.closest("tr"),g=d.cellIndexToGridColumn(f,f.index(e),e.children().index(a)),k="";d.walkCells(f,function(a,b,d,e){if(d===
g&&(a=m(m(f[a]).children()[b]),!(1<e))){e=a.text().split(" ");for(a=0;a<e.length;a++)e[a].length>k.length&&(k=e[a])}});e=m("<span></span>");e.css("text-indent",-9999);e.css("display","inline");e.text(k);m(a).append(e);a=e.width();m(e).remove();return a},getCellResizeBoundaries:function(a,f,e){var g,k;d.walkCells(f,function(c,j,n,o){c=m(m(f[c]).children()[j]);if(c.hasClass("aloha-table-selectrow")||c.closest("tr").hasClass("aloha-table-selectcolumn"))return!0;n===a&&1===o&&(g=c.offset().left+d.getCellBorder(c)+
c.width()-d.getMinColWidth(c));n===a-1&&1===o&&(k=c.offset().left+d.getCellBorder(c)+d.getCellPadding(c)+d.getMinColWidth(c));if(g&&k)return e(g,k),!1})},getCellBorder:function(a){return(a.outerWidth()-a.innerWidth())/2},getCellPadding:function(a){return a.innerWidth()-a.width()},selectAnchorContents:function(b){a:if(0===b.length)b=null;else{var d,l;(d=e.getRange())&&(l=m(d.commonAncestorContainer).closest(".aloha-table-cell-editable")[0]);if(l)for(d=0;d<b.length;d++)if(m(b[d]).find(l).length){b=
b[d];break a}b=b[0]}if(b)if(l=m(">.aloha-table-cell-editable",b)[0],a.ie&&8>=b.ownerDocument.documentMode)try{e.selectAllOf(l)}catch(g){j.warn("Table Plugin",g.message)}else e.selectAllOf(l)}};return d});define("table/table-cell","aloha aloha/jquery aloha/ephemera table/table-plugin-utils util/browser util/misc util/dom".split(" "),function(m,e,a,j,d,b,f){var l=function(a,b){null==a&&(a="<td></td>");a=e(a).get(0);this.obj=e(a);this.tableObj=b;b.cells.push(this)};l.prototype.tableObj=void 0;l.prototype.obj=
void 0;l.prototype.wrapper=void 0;l.prototype.hasFocus=false;l.prototype.activate=function(){var d=this,f=d.obj;f.wrapInner("<div/>");var c=f.children("div").eq(0);c.contentEditable(true);c.addClass("aloha-table-cell-editable");a.markWrapper(c);c.on("focus",function(a){j.colspan(d.obj)>1||j.rowspan(d.obj)>1?d.tableObj.tablePlugin._splitcellsButton.enable(true):d.tableObj.tablePlugin._splitcellsButton.enable(false);if(a.currentTarget)a.currentTarget.indexOf=function(){return-1};d._editableFocus(a)});
c.on("mousedown",function(a){if(a.currentTarget)a.currentTarget.indexOf=function(){return-1};if(!e(a.target).hasClass("aloha-block-draghandle")){d._editableMouseDown(a);d.tableObj.selection.baseCellPosition=[d._virtualY(),d._virtualX()];if(a.shiftKey){var a=d.tableObj.selection.lastBaseCellPosition[1],b=d.tableObj.selection.lastBaseCellPosition[0],c=d.tableObj.selection.baseCellPosition,f=c[1];if(f>a){f=a;a=c[1]}var k=c[0];if(k>b){k=b;b=c[0]}var l={top:k,right:a,bottom:b,left:f},m=d.tableObj,a=m.obj.children().children("tr"),
a=j.makeGrid(a);m.selection.selectedCells=[];m.selection.currentRectangle=l;var q=m.get("classCellSelected");j.walkGrid(a,function(a,b,c){if(j.containsDomCell(a))if(c>=l.top&&c<=l.bottom&&b>=l.left&&b<=l.right){e(a.cell).addClass(q);m.selection.selectedCells.push(a.cell)}else e(a.cell).removeClass(q)});m.selection.notifyCellsSelected()}else{d.tableObj.selection.lastBaseCellPosition=d.tableObj.selection.baseCellPosition;d._editableMouseDown(a);d._startCellSelection()}}});c.on("blur",function(a){d._editableBlur(a)});
c.on("keyup",function(a){d._editableKeyUp(a)});c.on("keydown",function(a){d._editableKeyDown(a)});c.on("mouseover",function(){d._selectCellRange()});f.on("mouseover",function(){d._selectCellRange()});c.contentEditableSelectionChange(function(a){m.Selection.onChange(c,a);return c});f.on("mousedown",function(a){if(!e(a.target).hasClass("aloha-block-draghandle")){if(a.target==f[0]){window.setTimeout(function(){d.wrapper.trigger("focus");d._selectAll(c)},1);d.tableObj.selection.baseCellPosition=[d._virtualY(),
d._virtualX()];if(!d.tableObj.selection.lastBaseCellPosition)d.tableObj.selection.lastBaseCellPosition=d.tableObj.selection.baseCellPosition;if(a.shiftKey){var b=d.tableObj.selection.lastBaseCellPosition[1],l=d.tableObj.selection.lastBaseCellPosition[0],m=d.tableObj.selection.baseCellPosition,q=m[1];if(q>b){q=b;b=m[1]}var x=m[0];if(x>l){x=l;l=m[0]}var v={top:x,right:b,bottom:l,left:q},u=d.tableObj,b=u.obj.children().children("tr"),b=j.makeGrid(b);u.selection.selectedCells=[];var z=u.get("classCellSelected");
u.selection.currentRectangle=v;j.walkGrid(b,function(a,b,c){if(j.containsDomCell(a))if(c>=v.top&&c<=v.bottom&&b>=v.left&&b<=v.right){e(a.cell).addClass(z);u.selection.selectedCells.push(a.cell)}else e(a.cell).removeClass(z)});u.selection.notifyCellsSelected()}else{d.tableObj.selection.lastBaseCellPosition=d.tableObj.selection.baseCellPosition;d._startCellSelection()}}a.stopPropagation()}});if(f[0])f[0].onselectstart=function(){return false};f.on("mouseenter",function(){b.addEditingHelpers(c)});f.on("mouseleave",
function(){b.removeEditingHelpers(c)});m.bind("aloha-smart-content-changed",function(a,d){d.editable.isActive&&d.triggerType==="block-change"&&b.addEditingHelpers(c)});this.wrapper=c;if(c[0]){var l=c[0];l.onselectstart=function(){window.event.cancelBubble=true};l.ondragstart=function(){return false}}return this};l.prototype.deactivate=function(){var a=e(this.obj.children(".aloha-table-cell-editable"));if(a.length){b.removeEditingHelpers(a);a.parent().append(a.contents());a.remove();this.obj.unbind("click");
this.obj.unbind("mousedown");this.obj.unbind("mouseenter");this.obj.unbind("mouseleave");this.obj.get(0).onselectstart=null;e.trim(this.obj.attr("class"))==""&&this.obj.removeAttr("class")}};l.prototype.toString=function(){return"TableCell"};l.prototype._editableFocus=function(){if(!this.hasFocus){this.tableObj.focus();this.obj.addClass("aloha-table-cell_active");this.hasFocus=true;this.tableObj.selection.selectionType="cell"}};l.prototype._editableBlur=function(){this.hasFocus=false;this.obj.removeClass("aloha-table-cell_active");
this.wrapper.children().length===1&&this.wrapper.find("p").filter(function(){var a=e(this).clone();a.find("br:last-child").remove();return f.isEmpty(a[0])}).remove()};l.prototype._virtualX=function(){var a=this.tableObj.obj.children().children("tr"),b=this.obj.parent().index(),c=this.obj.index();return j.cellIndexToGridColumn(a,b,c)};l.prototype._virtualY=function(){return this.obj.parent("tr").index()};l.prototype._startCellSelection=function(){if(!this.tableObj.selection.cellSelectionMode){this.tableObj.selection.unselectCells();
this.tableObj.selection.cellSelectionMode=true;var a=this;e("body").bind("mouseup.cellselection",function(){a._endCellSelection()});this.tableObj.selection.baseCellPosition=[this._virtualY(),this._virtualX()]}};l.prototype._endCellSelection=function(){if(this.tableObj.selection.cellSelectionMode){j.selectAnchorContents(this.tableObj.selection.selectedCells);this.tableObj.selection.cellSelectionMode=false;this.tableObj.selection.baseCellPosition=null;this.tableObj.selection.lastSelectionRange=null;
this.tableObj.selection.selectionType="cell";e("body").unbind("mouseup.cellselection")}};l.prototype._getSelectedRect=function(){var a=this._virtualX(),b=this._virtualY(),c=this.tableObj.selection.baseCellPosition,d=c[1];if(d>a){d=a;a=c[1]}var f=c[0];if(f>b){f=b;b=c[0]}return{top:f,right:a,bottom:b,left:d}};l.prototype._selectCellRange=function(){if(!this.tableObj.selection.resizeMode&&this.tableObj.selection.cellSelectionMode){var a=this._getSelectedRect(),b=this.tableObj;if(!(a.top===a.bottom&&
a.left===a.right&&b.selection.selectedCells.length===0)){var c=b.obj.children().children("tr"),c=j.makeGrid(c);b.selection.selectedCells=[];b.selection.currentRectangle=a;var d=b.get("classCellSelected");j.walkGrid(c,function(c,f,l){if(j.containsDomCell(c))if(l>=a.top&&l<=a.bottom&&f>=a.left&&f<=a.right){e(c.cell).addClass(d);b.selection.selectedCells.push(c.cell)}else e(c.cell).removeClass(d)});b.selection.notifyCellsSelected()}}};l.prototype._selectAll=function(a){a=a.jquery?a.get(0):a;if(e.browser.msie)if(document.getSelection){b=
document.getSelection();c=document.createRange();c.selectNodeContents(a);b.removeAllRanges();b.addRange(c)}else{if(document.selection){c=document.body.createTextRange();c.moveToElementText(a);c.select()}}else{var b=window.getSelection();if(b.setBaseAndExtent)b.setBaseAndExtent(a,0,a,Math.max(0,a.innerText.length-1));else{if(window.opera&&a.innerHTML.substring(a.innerHTML.length-4)=="<BR>")a.innerHTML=a.innerHTML+"&#160;";var c=document.createRange();c.selectNodeContents(a);b.removeAllRanges();b.addRange(c)}}};
l.prototype._editableMouseDown=function(a){this.tableObj.selection.unselectCells();if(this.tableObj.hasFocus)if(typeof a.stopPropagation==="function")a.stopPropagation();else if(typeof a.cancelBubble!=="undefined")a.cancelBubble=true};l.prototype._editableKeyUp=function(){};l.prototype._editableKeyDown=function(a){this._checkForEmptyEvent(a);if(this.obj[0]===this.tableObj.obj.find("tr:last td:last")[0]&&9==a.keyCode&&!a.altKey&&!a.shiftKey&&!a.ctrlKey){var b=this.tableObj.addRow(this.obj.parent().index()+
1);if(d.mozilla){a.preventDefault();$(b).find("td:nth-child(2) .aloha-table-cell-editable").focus()}}};l.prototype._checkForEmptyEvent=function(){var a=e(this.wrapper),b=a.text();if(!(a.children().length>0)&&b===""){this.wrapper.text("");this.wrapper.get(0).blur();this.wrapper.get(0).focus()}};l.getContainer=function(a){return e(a.firstChild).hasClass("aloha-table-cell-editable")?a.firstChild:a};return l});define("table/table-selection","aloha aloha/jquery table/table-plugin-utils table/table-cell ui/dialog i18n!table/nls/i18n".split(" "),
function(m,e,a,j,d,b){function f(a){return{top:a.top[0],right:a.right[0]+1,bottom:a.bottom[0]+1,left:a.left[0]}}function l(b,d,e){var g=true;if(-1!==a.indexOfAnyBut(d.top,d.top[0])||-1!==a.indexOfAnyBut(d.right,d.right[0])||-1!==a.indexOfAnyBut(d.bottom,d.bottom[0])||-1!==a.indexOfAnyBut(d.left,d.left[0]))g=false;else{d=f(d);a.walkGridInsideRect(b,d,function(a){if(!e(a))return g=false})}return g}var g=function(a){this.table=a},k=["cell","column","row"];g.getPossibleSelectionTypes=function(){return k};
g.prototype.selectionType=void 0;g.prototype.currentRectangle={};g.prototype.selectedCells=[];g.prototype.selectedColumnIdxs=[];g.prototype.selectedRowIdxs=[];g.prototype.cellSelectionMode=false;g.prototype.baseCellPosition=null;g.prototype.lastSelectionRange=null;g.prototype.selectColumns=function(b){this.unselectCells();var d=this.table.getRows();d.shift();for(var d=a.makeGrid(d),f=0;f<b.length;f++)if(-1===e.inArray(b[f],this.selectedColumnIdxs)){this.selectedColumnIdxs.push(b[f]);for(var g=0;g<
d.length;g++){var k=d[g][b[f]];if(a.containsDomCell(k)){e(k.cell).addClass(this.table.get("classCellSelected"));this.selectedCells.push(k.cell)}}}this.currentRectangle.columns=this.selectedColumnIdxs;this.selectionType="column"};g.prototype.selectRows=function(a){this.unselectCells();var b=this.table.getRows();a.sort(function(a,b){return a-b});for(var d=0;d<a.length;d++)if(b[a[d]]){for(var f=0;f<this.selectedRowIdxs.length;f++)if(a[d]==this.selectedRowIdxs[f])return;this.selectedRowIdxs.push(a[d]);
for(f=1;f<b[a[d]].cells.length;f++){this.selectedCells.push(b[a[d]].cells[f]);e(b[a[d]].cells[f]).addClass(this.table.get("classCellSelected"))}}this.currentRectangle.rows=this.selectedRowIdxs;this.selectionType="row"};g.prototype.selectAll=function(){var a=e.map(this.table.getRows(),function(a,b){return b});a.shift();this.selectRows(a);this.selectionType="all"};g.prototype.notifyCellsSelected=function(){m.trigger("aloha-table-selection-changed")};g.prototype._notifyCellsUnselected=function(){m.trigger("aloha-table-selection-changed")};
g.prototype.isHeader=function(){if(this.selectedCells.length==0)return false;for(var a=0;a<this.selectedCells.length;a++)if(!this.selectedCells[a]||this.selectedCells[a].nodeName.toLowerCase()!="th")return false;return true};g.prototype.unselectCells=function(){if(!this.cellSelectionMode&&this.selectedCells.length>0){for(var a=this.selectedCells,b=this.table.get("classCellSelected"),d=0,f=a.length;d<f;d++)e(a[d]).removeClass(b);this.selectedCells=[];this.selectedColumnIdxs=[];this.selectedRowIdxs=
[];this.currentRectangle={};this.selectionType="cell";this._notifyCellsUnselected()}};g.prototype.selectionIndex=function(a){for(var b=0;b<this.selectedCells.length;b++)if(this.selectedCells[b]===a)return b;return-1};g.prototype.mergeCells=function(){var c=this.selectedCells;if(0!==c.length){var g=function(a){return-1!=e.inArray(a.cell,c)},k=a.makeGrid(this.table.getRows()),o=a.makeContour(k,g);if(l(k,o,g)){var p=f(o),g=e(k[p.top][p.left].cell),r=e(j.getContainer(g.get(0)));a.walkGridInsideRect(k,
p,function(a,b,c){if(!(b-a.spannedX===p.left&&c-a.spannedY===p.top)){a=a.cell;b=e(j.getContainer(a)).contents();for(c=0;c<b.length;c++)if("string"===typeof b[c]&&""!==e.trim(b[c])||b[c].nodeType&&3===b[c].nodeType&&""!==e.trim(b[c].data)||1===b[c].nodeType){r.append(" ");r.append(b);break}e(a).remove()}});g.attr({rowspan:p.bottom-p.top,colspan:p.right-p.left});this.selectedCells=[g.get(0)];this.cellSelectionMode=false;this.lastSelectionRange=this.baseCellPosition=null;this.selectionType="cell";m.trigger("aloha-table-selection-changed")}else d.alert({title:b.t("Table"),
text:b.t("table.mergeCells.notRectangular")})}};g.prototype.splitCells=function(){var b=this,d=this.selectedCells;if(d.length>0){e(d).each(function(){a.splitCell(this,function(){return b.table.newActiveCell().obj})});this.cellSelectionMode=false;this.lastSelectionRange=this.baseCellPosition=null;this.selectionType="cell";m.trigger("aloha-table-selection-changed")}};g.prototype.cellsAreMergeable=function(){var b=this.selectedCells;if(b.length<2)return false;var d=function(a){return-1!=e.inArray(a.cell,
b)},f=a.makeGrid(this.table.getRows()),g=a.makeContour(f,d);return l(f,g,d)?true:false};g.prototype.cellsAreSplitable=function(){var b=0;if(this.selectedCells.length>0){e(this.selectedCells).each(function(){var d=a.colspan(this),f=a.rowspan(this);(d>1||f>1)&&b++});return b>0?true:false}return false};g.prototype.getCurrentSelectionTypes=function(){var a=this.currentRectangle,b=this.table,d=[];(a.rows||a.left===1&&a.right>=b.numCols)&&d.push("row");(a.columns||a.top===1&&a.bottom>=b.numRows)&&d.push("column");
a.rows&&a.rows.length===b.numRows||a.columns&&a.columns.length===b.numCols||e.inArray("row",d)!==-1&&e.inArray("column",d)!==-1?d.unshift("cell"):!a.rows&&!a.columns&&d.push("cell");d.length===0&&d.push(this.selectionType);return d};return g});define("table/table","aloha jquery ui/scopes ui/dialog i18n!table/nls/i18n table/table-cell table/table-selection table/table-plugin-utils aloha/ephemera util/html util/dom aloha/console".split(" "),function(m,e,a,j,d,b,f,l,g,k,c,q){function n(a,b,c,d){for(var f,
g=false,k=0;k<c.length;k++)d.showItem(c[k].name);d.setActiveItem();for(k=0;k<b.length;k++)if(e(a[0]).hasClass(b[k].cssClass)){g=true;f=b[k].name;break}e(a).each(function(){e(this).hasClass(f)||(g=false)});g&&d.setActiveItem(f)}function o(a,b){var c=-1,d=null;"before"===a?d=b.selectedCells[0]:"after"===a&&(d=b.selectedCells[b.selectedCells.length-1]);if(d&&d.nodeType==1)c=d.parentNode.rowIndex;return c}var p=window.GENTICS,a=function(a,b){this.obj=e(a);var c,d,k=this.getRows(),j=k.length,m,o=0,q=[j],
n;for(c=0;c<j;c++){d=e(k[c]);d=d.children("td, th");m=d.length;m=l.cellIndexToGridColumn(k,c,m-1)+1;n=parseInt(d.last().attr("colspan"),10);if(n!=0&&!isNaN(n)){n==1&&d.last().removeAttr("colspan");m=m+(n-1)}rowSpan=parseInt(d.last().attr("rowspan"),10);if(rowSpan>1)for(d=1;d<rowSpan-1;d++)q[c+d]=n>1?q[c+d]+n:q[c+d]+1;q[c]=q[c]+m;q[c]>o&&(o=q[c])}for(c=0;c<j;c++){d=o-q[c];d>0&&e(k[c]).append(Array(d+1).join("<td></td>"))}this.obj.attr("id")||this.obj.attr("id",p.Utils.guid());g.markAttr(this.obj,"id");
this.tablePlugin=b;this.selection=new f(this);this.refresh()};e.extend(a.prototype,{obj:void 0,tableWrapper:void 0,cells:void 0,numRows:void 0,numCols:void 0,isActive:false,hasFocus:false,parentEditable:void 0,mousedown:false,clickedColumnId:-1,clickedRowId:-1,columnsToSelect:[],rowsToSelect:[],fmPluginId:void 0});a.prototype.refresh=function(){this.numCols=this.countVirtualCols();var a=this.getRows();this.numRows=a.length;this.cells=[];for(var b=0;b<a.length;b++)for(var c=e(a[b]).children(),d=0;d<
c.length;d++)this.newCell(c[d])};a.prototype.countVirtualCols=function(){var a=this.obj.children().children("tr:first-child").children();return a.length-a.filter("."+this.get("classLeftUpperCorner")).length};a.prototype.get=function(a){return this.tablePlugin.get(a)};a.prototype.set=function(a,b){this.tablePlugin.set(a,b)};a.prototype.activate=function(){if(!this.isActive){var a=this,b,c=new m.Selection.SelectionRange(true);if(e(c.startContainer).closest("table").is(this.obj)||e(c.endContainer).closest("table").is(this.obj)){if(c.startContainer&&
(c.startContainer.nodeType===1&&c.startContainer.nodeName.toLowerCase()==="tr")&&c.startOffset<c.startContainer.childNodes.length){c.startContainer=c.startContainer.childNodes[c.startOffset];c.startOffset=0}if(c.endContainer&&(c.endContainer.nodeType===1&&c.endContainer.nodeName.toLowerCase()==="tr")&&c.endOffset<c.endContainer.childNodes.length){c.endContainer=c.endContainer.childNodes[c.endOffset];c.endOffset=0}}else c=null;this.obj.addClass(this.get("className"));this.obj.contentEditable(false);
this.obj.attr("id")==""&&this.obj.attr("id",p.Utils.guid());this.selection.selectionType=void 0;b=this.obj.children("tbody");if(b.length===0)b=this.obj;b.bind("keydown",function(b){!b.ctrlKey&&!b.shiftKey&&a.selection.selectedCells.length>0&&a.selection.selectedCells[0].length>0&&a.selection.selectedCells[0][0].firstChild.focus()});this.obj.on("keydown",function(b){if(b.keyCode===46){if(a.selection.selectionType==="row")a.deleteRows();else if(a.selection.selectionType==="column")a.deleteColumns();
else return;typeof b.stopPropagation==="function"?b.stopPropagation():b.cancelBubble=true}});b.delegate("th, td","mousemove",function(b){var c=e(this);if(!e(this).hasClass("aloha-table-selectrow")&&!e(this).closest("tr").hasClass("aloha-table-selectcolumn")){var d=a.tablePlugin.rowResize;if(a.tablePlugin.colResize&&b.pageX-c.offset().left<3){c.css("cursor","col-resize");return a.attachColumnResize(c)}if(d&&b.pageY-c.offset().top<3){c.css("cursor","row-resize");return a.attachRowResize(c)}if(d){d=
c.closest("tr");if(d.next("tr").length>0)d=false;else{b=b.pageY-(d.offset().top+d.outerHeight());d=b>-3&&b<3}}if(d){c.css("cursor","row-resize");return a.attachRowResize(c,true)}c.css("cursor","default");return a.detachRowColResize(c)}});b.bind("mousemove",function(b){var c=e(this).closest("table"),d;if(d=a.tablePlugin.tableResize){b=b.pageX-(c.offset().left+c.outerWidth());d=b>-5&&b<5}if(d)return a.attachTableResizeWidth(c)});b.bind("mousedown",function(b){a.hasFocus||a.focus();b.stopPropagation();
b.preventDefault();return false});b=e('<div class="'+this.get("classTableWrapper")+' aloha-block-collection" data-block-skip-scope="true"></div>');b.contentEditable(false);g.markWrapper(b);this.obj.wrap(b);b=this.obj.parent();b.alohaBlock&&b.alohaBlock();b=this.obj.parents("."+this.get("classTableWrapper"));b.get(0).onresizestart=function(){return false};b.get(0).oncontrolselect=function(){return false};b.get(0).ondragstart=function(){return false};b.get(0).onmovestart=function(){return false};this.tableWrapper=
this.obj.parents("."+this.get("classTableWrapper")).get(0);e(this.cells).each(function(){this.activate()});this.attachSelectionColumn();this.attachSelectionRow();this.makeCaptionEditable();this.checkWai();this.isActive=true;if(c){e(this.cells).each(function(){if(this.obj.is(c.startContainer)){this.wrapper.contents().length===0&&this.wrapper.html("&nbsp;");c.startContainer=this.wrapper.contents().get(0);c.startOffset=0}if(this.obj.is(c.endContainer)){this.wrapper.contents().length===0&&this.wrapper.html("&nbsp;");
c.endContainer=this.wrapper.contents().get(0);c.endOffset=0}});this.focus();window.setTimeout(function(){c.select()},1)}m.trigger("aloha-table-activated")}};a.prototype.makeCaptionEditable=function(){var a=this.obj.find("caption").eq(0);a&&this.tablePlugin.makeCaptionEditable(a)};a.prototype.checkWai=function(){var a=this.wai;if(!a)return false;var b=this.get("waiGreen"),c=this.get("waiRed");a.removeClass(b+" "+c);if(e.trim(this.obj[0].summary)!==""){a.addClass(b);return true}a.addClass(c);return false};
a.prototype.attachSelectionColumn=function(){var a=e("<td>"),b,c,d,f;a.html(" ");d=this.obj.context.rows;for(f=0;f<d.length;f++){c=e(d[f]);b=a.clone();b.addClass(this.get("classSelectionColumn"));b.css("width",this.get("selectionArea")+"px");c.prepend(b);this.attachRowSelectionEventsToCell(b)}};a.prototype.attachRowSelectionEventsToCell=function(a){var b=this;g.markElement(a);a.unbind("mousedown");a.unbind("mouseover");a.get(0).onselectstart=function(){return false};a.bind("mousedown",function(a){return b.rowSelectionMouseDown(a)});
a.bind("mouseover",function(a){if(b.mousedown)return b.rowSelectionMouseOver(a)})};a.prototype.rowSelectionMouseDown=function(a){this.focus();if(this.selection.selectedCells.length==0)this.rowsToSelect=[];this.clickedRowId=a.currentTarget.parentNode.rowIndex;if(a.metaKey){var b=e.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],b=
this.clickedRowId;if(c>b){c=b;b=this.rowsToSelect[0]}for(this.rowsToSelect=[];c<=b;c++)this.rowsToSelect.push(c)}else this.rowsToSelect=[this.clickedRowId];this.selectRows();a.preventDefault();a.stopPropagation();return false};a.prototype.rowSelectionMouseOver=function(a){var b=a.currentTarget.parentNode.rowIndex,c;if(this.mousedown&&this.clickedRowId>=0){e.inArray(b,this.rowsToSelect);c=b<this.clickedRowId?b:this.clickedRowId;b=b<this.clickedRowId?this.clickedRowId:b;for(this.rowsToSelect=[];c<=
b;c++)this.rowsToSelect.push(c);this.selectRows();a.preventDefault();a.stopPropagation();return false}};a.prototype.attachSelectionRow=function(){var a=this,b=e("<td>");b.html(" ");for(var c=0,d=0;d<this.obj.context.rows.length;d++){for(var f=0,k=0;k<this.obj.context.rows[d].cells.length;k++)var j=l.colspan(this.obj.context.rows[d].cells[k]),f=f+j;c<f&&(c=f)}f=e("<tr>");f.addClass(this.get("classSelectionRow"));f.css("height",this.get("selectionArea")+"px");g.markElement(f);for(d=0;d<c;d++){k=b.clone();
if(d>0)this.attachColumnSelectEventsToCell(k);else{k=e("<td>").clone();k.addClass(this.get("classLeftUpperCorner"));this.wai=e("<div/>").width(25).height(12).click(function(b){a.focus();a.selection.selectAll();a.tablePlugin.activeTable.selection.selectionType="cell";a.tablePlugin.updateFloatingMenuScope();a._removeCursorSelection();if(a.tablePlugin.settings.summaryinsidebar){a.tablePlugin.sidebar.open();a.tablePlugin.sidebarPanel.activate(a.obj);a.tablePlugin.sidebar.correctHeight()}try{a.tablePlugin.summary.focus();
b.stopPropagation();b.preventDefault()}catch(c){q.error("Table",c.message)}return false});k.append(this.wai)}f.append(k)}e(document).bind("mouseup",function(b){a.columnSelectionMouseUp(b)});this.obj.find("tr:first").before(f)};a.prototype.attachColumnSelectEventsToCell=function(a){var b=this;a.unbind("mousedown");a.unbind("mouseover");a.get(0).onselectstart=function(){return false};a.bind("mousedown",function(a){b.columnSelectionMouseDown(a)});a.bind("mouseover",function(a){b.columnSelectionMouseOver(a)})};
a.prototype.columnSelectionMouseDown=function(a){this.focus();if(this.selection.selectedCells.length==0)this.columnsToSelect=[];this.clickedColumnId=e(a.currentTarget.parentNode).children().index(a.currentTarget);if(a.metaKey){var b=e.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],b=this.clickedColumnId;if(c>
b){c=b;b=this.columnsToSelect[0]}for(this.columnsToSelect=[];c<=b;c++)this.columnsToSelect.push(c)}else this.columnsToSelect=[this.clickedColumnId];this.selectColumns();a.preventDefault();a.stopPropagation();return false};a.prototype.columnSelectionMouseOver=function(a){var b=a.currentTarget.cellIndex,a=[],c;if(this.mouseDownColIdx){c=b<this.mouseDownColIdx?b:this.mouseDownColIdx;for(b=b<this.mouseDownColIdx?this.mouseDownColIdx:b;c<=b;c++)a.push(c);this.selectColumns(a)}};a.prototype.columnSelectionMouseUp=
function(){this.mouseDownColIdx=false};a.prototype.deleteRows=function(){var a=[],b={},c=this;if(0!==this.selection.selectedCells.length){for(var f=0;f<this.selection.selectedCells.length;f++)b[this.selection.selectedCells[f].parentNode.rowIndex]=true;for(rowId in b)a.push(rowId);b=false;a.length==this.numRows&&(b=true);if(b){var g=this;j.confirm({title:d.t("Table"),text:d.t("deletetable.confirm"),yes:function(){g.deleteTable()}})}else{a.sort(function(a,b){return a-b});var k=a[0];k>this.numRows-a.length&&
k--;var m=this.getRows();e.each(a,function(a,b){for(var d=m[b],f=0;f<d.cells.length;f++)l.splitCell(d.cells[f],function(){return c.newActiveCell().obj})});var p=l.makeGrid(m);e.each(a,function(a,b){for(var c=p[b],d=0;d<c.length;){var f=c[d],g=l.rowspan(f.cell);1<g&&e(f.cell).attr("rowspan",g-1);d=d+f.colspan}e(m[b]).remove()});this.numRows=this.numRows-a.length;window.setTimeout(function(){e(m[1].cells[k+1]).focus()},5);this.selection.unselectCells()}}};a.prototype.deleteColumns=function(){var a=
[],b=this.getRows(),c=this,f,g=l.makeGrid(b);f=this.selection.selectedColumnIdxs;if((!f||f.length===0)&&this.selection.currentRectangle&&this.selection.currentRectangle.top===1&&this.selection.currentRectangle.bottom>=this.numRows&&this.selection.currentRectangle.right>0&&this.selection.currentRectangle.left>0){f=[];for(var k=this.selection.currentRectangle.left;k<=this.selection.currentRectangle.right;k++)f.push(k)}if(f.length==g[0].length-1)j.confirm({title:d.t("Table"),text:d.t("deletetable.confirm"),
yes:function(){c.deleteTable()}});else{a.sort(function(a,b){return a-b});for(var k=f.sort(function(a,b){return b-a}),m=0;m<k.length;m++){for(var p=k[m],o=0;o<b.length;o++)if(f=g[o][p]){if(0===f.spannedX){if(1<f.colspan){var q=this.newActiveCell().obj;e(f.cell).after(q);q.attr("rowspan",f.rowspan);q.attr("colspan",f.colspan-1)}e(f.cell).remove()}else e(f.cell).attr("colspan",f.colspan-1);o=o+(f.rowspan-1)}g=l.makeGrid(b)}this.numCols=this.numCols-a.length;window.setTimeout(function(){e(b[1].cells[1]).focus()},
5);this.selection.unselectCells()}};a.prototype.deleteTable=function(){for(var a=-1,b=0;b<this.tablePlugin.TableRegistry.length;b++)if(this.tablePlugin.TableRegistry[b].obj.attr("id")==this.obj.attr("id")){a=b;break}if(a>=0){this.deactivate();this.selection.selectionType=void 0;this.tablePlugin.TableRegistry.splice(b,1);a=m.Selection.rangeObject;a.endContainer=this.obj.get(0).parentNode;a.startContainer=a.endContainer;a.endOffset=c.getIndexInParent(this.obj.get(0));a.startOffset=a.endOffset;a.clearCaches();
this.obj.remove();window.setTimeout(function(){this.parentEditable.obj.focus()},5);a.correctRange();a.select()}};a.prototype.addRowBeforeSelection=function(){var a=o("before",this.selection);-1!==a&&this.addRow(a)};a.prototype.addRowAfterSelection=function(){var a=o("after",this.selection);-1!==a&&this.addRow(a+1)};a.prototype.addRow=function(a){for(var b,c=this.get("classSelectionColumn"),d=this.obj.children().children("tr"),f=0;f<1;f++){b=e("<tr>");var g=e("<td>");g.addClass(c);this.attachRowSelectionEventsToCell(g);
b.append(g);var k=l.makeGrid(d);if(a>=k.length)for(g=1;g<k[0].length;g++)b.append(this.newActiveCell().obj);else for(var k=k[a],g=1,j=k.length;g<j;){var m=k[g];if(l.containsDomCell(m))for(var p=m.colspan;p--;)b.append(this.newActiveCell().obj);else e(m.cell).attr("rowspan",m.rowspan+1);g=g+m.colspan}a>=d.length?d.eq(d.length-1).after(b):d.eq(a).before(b)}this.numRows=this.numRows+1;return b[0]};a.prototype.addColumnsRight=function(){this.addColumns("right")};a.prototype.addColumnsLeft=function(){this.addColumns("left")};
a.prototype.addColumns=function(a){var b=e("<td>"),c=this.getRows(),f,g;f=this.selection.selectedColumnIdxs;if(0!==f.length){f.sort(function(a,b){return a-b});if(l.isConsecutive(f)){if("left"===a){g=f[0];for(var k=0;k<this.selection.selectedColumnIdxs.length;k++)this.selection.selectedColumnIdxs[k]=this.selection.selectedColumnIdxs[k]+1}else g=f[f.length-1];for(var m=l.makeGrid(c),k=0;k<c.length;k++){f=b.clone();f.html(" ");if(k==0)this.attachColumnSelectEventsToCell(f);else{cellObj=this.newActiveCell(f.get(0));
f=cellObj.obj}var p=l.leftDomCell(m,k,g);null==p?e(c[k]).prepend(f):"left"===a&&l.containsDomCell(m[k][g])?e(p).before(f):e(p).after(f);this.numCols++}}else j.alert({title:d.t("Table"),text:d.t("table.addColumns.nonConsecutive")})}};a.prototype.focus=function(){if(!this.hasFocus){this.parentEditable.isActive||this.parentEditable.obj.focus();this.tablePlugin.setFocusedTable(this)}};a.prototype.focusOut=function(){if(this.hasFocus){this.tablePlugin.setFocusedTable(void 0);this.selection.selectionType=
void 0}};a.prototype._removeCursorSelection=function(){var a=m.getSelection();if(a&&a._nativeSelection&&a._nativeSelection._ranges.length!=0){a=a.getRangeAt(0);if(null!=a.startContainer&&0===e(a.startContainer).closest("table").length&&0!==this.selection.selectedCells.length){a=b.getContainer(this.selection.selectedCells[0]);e(a).focus()}}};a.prototype.selectColumns=function(a){this.selection.selectColumns(a?a:this.columnsToSelect);this.tablePlugin._columnheaderButton.setState(this.selection.isHeader());
n(this.selection.selectedCells,this.tablePlugin.columnConfig,this.tablePlugin.columnMSItems,this.tablePlugin.columnMSButton);this.obj.find("div.aloha-ui-table-cell-editable").blur();l.selectAnchorContents(this.selection.selectedCells);this.selection.notifyCellsSelected();this._removeCursorSelection()};a.prototype.selectRows=function(){this.selection.selectRows(this.rowsToSelect);this.tablePlugin._rowheaderButton.setState(this.selection.isHeader());n(this.selection.selectedCells,this.tablePlugin.rowConfig,
this.tablePlugin.rowMSItems,this.tablePlugin.rowMSButton);this.obj.find("div.aloha-ui-table-cell-editable").blur();l.selectAnchorContents(this.selection.selectedCells);this.selection.notifyCellsSelected();this._removeCursorSelection()};a.prototype.deactivate=function(){var a=this.obj.parent();a.mahaloBlock&&a.mahaloBlock();this.obj.removeClass(this.get("className"));e.trim(this.obj.attr("class"))==""&&this.obj.removeAttr("class");this.obj.removeAttr("contenteditable");this.obj.parents("."+this.get("classTableWrapper")).length&&
this.obj.unwrap();this.obj.find("tr."+this.get("classSelectionRow")+":first").remove();var b=this;e.each(this.obj.context.rows,function(){e(this).children("td."+b.get("classSelectionColumn")).remove()});this.obj.find("td, th").removeClass(this.get("classCellSelected"));this.obj.find("td, th").removeClass("aloha-table-cell_active");this.obj.find("td, th").css("cursor","");this.obj.unbind();this.obj.children("tbody").unbind();for(a=0;a<this.cells.length;a++)this.cells[a].deactivate();this.obj.find("caption div").each(function(){e(this).contents().unwrap()});
this.isActive=false};a.prototype.attachColumnResize=function(a){var b=this;b.detachRowColResize(a);var c=a.closest("tbody").children("tr"),d=a.closest("tr"),f=l.cellIndexToGridColumn(c,c.index(d),d.children().index(a)),g=function(a){var d,g;l.walkCells(c,function(b,k,j,m){b=e(e(c[b]).children()[k]);if(b.hasClass("aloha-table-selectrow")||b.closest("tr").hasClass("aloha-table-selectcolumn")||m>1)return true;if(j===f){g||(g=b.width()-a);l.resizeCellWidth(b,g)}else if(j===f-1){d||(d=b.width()+a);l.resizeCellWidth(b,
d)}return true});b.tablePlugin.colResize=="%"&&l.convertCellWidthToPercent(c)};a.bind("mousedown.resize",function(d){if(!e(d.target).hasClass("aloha-block-draghandle")){var k=e("<div></div>"),j=false;l.getCellResizeBoundaries(f,c,function(c,d){j=true;b.selection.resizeMode=true;e("body").bind("mousemove.dnd_col_resize",function(a){a.pageX>d&&a.pageX<c&&k.css("left",a.pageX)});e("body").bind("mouseup.dnd_col_resize",function(f){var j=0;f.pageX<d?j=d-a.offset().left:f.pageX>d&&f.pageX<c?j=f.pageX-a.offset().left:
f.pageX>c&&(j=c-a.offset().left);j!==0&&g(j);e("body").unbind("mousemove.dnd_col_resize");e("body").unbind("mouseup.dnd_col_resize");b.selection.resizeMode=false;k.remove()})});if(j){var d=e(a),m=d.outerWidth()-d.innerWidth(),p=d.closest("tbody").innerHeight();k.css({height:p<1?1:p,width:m<1?1:m,top:d.closest("tbody").offset().top,left:d.offset().left,position:"absolute","background-color":"#80B5F2"}).appendTo("body")}}})};a.prototype.attachRowResize=function(a,b){var c=this;c.detachRowColResize(a);
a.bind("mousedown.resize",function(d){if(!e(d.target).hasClass("aloha-block-draghandle")){var f=e("<div></div>"),d=a.closest("tbody").innerWidth(),g=a.outerHeight()-a.innerHeight();f.css({width:d<1?1:d,height:g<1?1:g,top:b?a.offset().top+a.outerHeight():a.offset().top,left:a.closest("tbody").offset().left,position:"absolute","background-color":"#80B5F2"});e("body").append(f);c.selection.resizeMode=true;e("body").bind("mousemove.dnd_row_resize",function(c){var d=c.pageY,e;e=b?a.closest("tr").offset().top:
a.closest("tr").prev("tr").offset().top;d>e&&f.css("top",c.pageY)});e("body").bind("mouseup.dnd_row_resize",function(d){var g=0,g=b?d.pageY-(a.offset().top+a.outerHeight()):d.pageY-a.offset().top,d=b?a.closest("tr"):a.closest("tr").prev("tr"),g=d.height()+g;g<0&&(g=1);d.css("height",g);e("body").unbind("mousemove.dnd_row_resize");e("body").unbind("mouseup.dnd_row_resize");c.selection.resizeMode=false;f.remove()})}})};a.prototype.attachTableResizeWidth=function(a){var b=this,c=a.closest(".aloha-table-wrapper"),
d=a.find("tr:not(.aloha-table-selectcolumn) th:last-child, tr:not(.aloha-table-selectcolumn) td:last-child"),f;e.each(d,function(){if(!e(this).attr("colspan")||e(this).attr("colspan")<2){f=e(this);return false}});d.css("cursor","col-resize");var g=function(c){var d=a.find("tr"),g=f.closest("tr"),k=l.cellIndexToGridColumn(d,d.index(g),g.children().index(f)),j=c-l.getCellBorder(f)-l.getCellPadding(f),m=[],p=0,c=a.width();l.walkCells(d,function(a,b,c,f){a=e(e(d[a]).children()[b]);if(a.hasClass("aloha-table-selectrow")||
a.closest("tr").hasClass("aloha-table-selectcolumn")||f>1)return true;if(c===k){p=a.width();m.push({cell:a,width:j})}else m.push({cell:a,width:a.width()});return true});e.each(m,function(a,b){l.resizeCellWidth(b.cell,b.width)});a.css("width",c+(j-p)+"px");b.tablePlugin.colResize=="%"&&l.convertCellWidthToPercent(d)};d.bind("mousedown.resize",function(){var k=e("<div></div>"),j=a.children("tbody").innerHeight(),m=f.outerWidth()-f.innerWidth();k.css({height:j<1?1:j,width:m<1?1:m,top:a.find("tbody").offset().top,
left:a.offset().left+a.outerWidth(),position:"absolute","background-color":"#80B5F2"});e("body").append(k);var p=c.offset().left+c.width(),o=f.offset().left+(f.innerWidth()-f.width())+l.getMinColWidth(f);b.selection.resizeMode=true;e("body").bind("mousemove.dnd_col_resize",function(a){a.pageX>o&&a.pageX<p&&k.css("left",a.pageX)});e("body").bind("mouseup.dnd_col_resize",function(a){var c=0;a.pageX<=o?c=o-f.offset().left:a.pageX>o&&a.pageX<p?c=a.pageX-f.offset().left:a.pageX>p&&(c=p-f.offset().left);
g(c);e("body").unbind("mousemove.dnd_col_resize");e("body").unbind("mouseup.dnd_col_resize");d.unbind("mousedown.resize");d.css("cursor","default");b.selection.resizeMode=false;k.remove()})})};a.prototype.detachRowColResize=function(a){return a.unbind("mousedown.resize")};a.prototype.toString=function(){return"Table"};a.prototype.newCell=function(a){return new b(a,this)};a.prototype.newActiveCell=function(a){a=new b(a,this);a.activate();return a};a.prototype.getRows=function(){var a=this.obj.get(0).rows;
return e.makeArray(a)};return a});define("table/table-plugin","aloha jquery PubSub aloha/plugin aloha/pluginmanager aloha/content-rules ui/ui ui/scopes ui/button ui/toggleButton ui/dialog ui/port-helper-attribute-field ui/port-helper-multi-split i18n!table/nls/i18n i18n!aloha/nls/i18n table/table-create-layer table/table table/table-plugin-utils table/table-selection util/dom aloha/ephemera aloha/console".split(" "),function(m,e,a,j,d,b,f,l,g,k,c,q,n,o,p,r,t,x,v,u,z,C){function F(a){var b=e(a.summary.getInputElem()),
c=a.activeTable.get("waiRed"),d=a.activeTable.get("waiGreen");b.removeClass(c+" "+d);a.activeTable.checkWai()?b.addClass(d):b.addClass(c)}function A(a){var b=e(a),c;if(c=G.Utils.Dom.isEditable(a))if(c=!(0<b.parents(".aloha-editable table").length)){a:{var d,f=b.parents();for(c=0;c<f.length;c++){d=f.eq(c);if(d.is(".aloha-editable")){c=false;break a}if(d.is(".aloha-block")){c=true;break a}}c=false}c=!c}if(c){c=new t(a,B);a=e(u.getEditingHostOf(a));c.parentEditable=m.getEditableById(a.attr("id"));B.TableRegistry.push(c);
a=b.is("table")?"table":"table table";b.find(a).length&&C.warn("Table Plugin","Nested tables found. They will not be initialized.");m.activeEditable===c.parentEditable&&c.activate();return c}return null}function E(a,b){var c,d,f=a.selection.isHeader(),e;for(c=0;c<a.selection.selectedCells.length;c++){e=a.selection.selectedCells[c];for(d=0;d<a.cells.length;d++)if(e===a.cells[d].obj[0]){cell=a.cells[d];break}d=f?m.Markup.transformDomObject(e,"td").removeAttr("scope").get(0):m.Markup.transformDomObject(e,
"th").attr("scope",b).get(0);if(cell!=null){cell.obj[0]=d;cell.deactivate();cell.activate()}D(a.selection.selectedCells[c]).bind("mousedown",function(){var a=D(this).children("div").eq(0);window.setTimeout(function(){a.trigger("focus")},1)})}}function J(a,b,c){for(var d=true,f=0;f<c.length;f++)if(D(c[f]).attr("class").indexOf(b)<0){d=false;break}if(d)for(f=0;f<c.length;f++)D(c[f]).removeClass(b);else for(f=0;f<c.length;f++){D(c[f]).addClass(b);for(d=0;d<a.length;d++)a[d].cssClass!=b&&D(c[f]).removeClass(a[d].cssClass)}}
function K(){var a=[],b=H;D.each(arguments,function(){a.push("."+(this==""?b:b+"-"+this))});return D.trim(a.join(" "))}function O(){var a=[],b=H;D.each(arguments,function(){a.push(this==""?b:b+"-"+this)});return D.trim(a.join(" "))}function y(a,b){var c=a.endContainer,d=a.startContainer,f=c.nodeType==3?c.length:c.childNodes.length;if(d.nodeType==3&&d.parentNode.tagName=="P"&&d.parentNode.childNodes.length==1&&/^(\s|%A0)$/.test(escape(d.data))){d.data="";a.startOffset=0;if(c==d)a.endOffset=0}if(!G.Utils.Dom.allowsNesting(d.nodeType==
3?d.parentNode:d,b)){a.startOffset==0&&D(d.nodeType==3?d.parentNode:d).addClass("aloha-table-cleanme");a.endOffset==f&&D(c.nodeType==3?c.parentNode:c).addClass("aloha-table-cleanme")}}function Y(){for(var a=D(".aloha-table-cleanme").removeClass("aloha-table-cleanme"),b=0;b<a.length;b++)D.trim(D(a[b]).html())==""&&!G.Utils.Dom.isEditingHost(a[b])&&D(a[b]).remove()}var D=e,G=window.GENTICS,N={},B=new j("table");B.createLayer=void 0;B.config=["table"];B.TableRegistry=[];B.activeTable=void 0;B.parameters=
{className:"aloha-table",classSelectionRow:"aloha-table-selectcolumn",classSelectionColumn:"aloha-table-selectrow",classLeftUpperCorner:"aloha-table-leftuppercorner",classTableWrapper:"aloha-table-wrapper",classCellSelected:"aloha-cell-selected",waiRed:"aloha-wai-red",waiGreen:"aloha-wai-green",selectionArea:10};B.checkConfig=function(a){if(typeof a=="object"&&a.length){for(var b=[],c=0;c<a.length;c++)a[c]&&b.push({name:a[c].name,text:a[c].text?a[c].text:a[c].name,tooltip:a[c].tooltip?a[c].tooltip:
a[c].text,iconClass:a[c].iconClass?a[c].iconClass:"aloha-icon-"+a[c].name,cssClass:a[c].cssClass?a[c].cssClass:a[c].name});a=b}else a=[];return a};B.init=function(){var c=this;z.classes(this.get("className"),this.get("classCellSelected"));this.tableConfig=this.checkConfig(this.tableConfig||this.settings.tableConfig);this.columnConfig=this.checkConfig(this.columnConfig||this.settings.columnConfig);this.rowConfig=this.checkConfig(this.rowConfig||this.settings.rowConfig);this.cellConfig=this.checkConfig(this.cellConfig||
this.settings.cellConfig);this.tableResize=this.settings.tableResize===void 0?false:this.settings.tableResize;this.colResize=this.settings.colResize===void 0?false:this.settings.colResize;this.rowResize=this.settings.rowResize===void 0?false:this.settings.rowResize;if(D.browser.msie&&parseInt(D.browser.version,10)<8)this.rowResize=this.colResize=this.tableResize=false;this.createLayer=new r(this);a.sub("aloha.editable.created",function(a){var a=a.editable,d=c.getEditableConfig(a.obj),d=d&&e.inArray("table",
d)>-1&&b.isAllowed(a.obj[0],"table");N[a.getId()]=!!d;a.obj.bind("mousedown",function(){B.setFocusedTable(void 0)});a.obj.find("table").each(function(a,b){A(b)})});this.initTableButtons();m.bind("aloha-table-selection-changed",function(){if(B.activeTable&&B.activeTable.selection){B.updateFloatingMenuScope();if(B.activeTable.selection.cellsAreSplitable()){c._splitcellsButton.enable(true);c._splitcellsRowButton.enable(true);c._splitcellsColumnButton.enable(true)}else{c._splitcellsButton.enable(false);
c._splitcellsRowButton.enable(false);c._splitcellsColumnButton.enable(false)}if(B.activeTable.selection.cellsAreMergeable()){c._mergecellsButton.enable(true);c._mergecellsRowButton.enable(true);c._mergecellsColumnButton.enable(true)}else{c._mergecellsButton.enable(false);c._mergecellsRowButton.enable(false);c._mergecellsColumnButton.enable(false)}}});m.bind("aloha-selection-changed",function(a,b){var d=m.activeEditable;if(!b.startContainer||!d)B.leaveTableScopes();else{N[m.activeEditable.getId()]&&
m.Selection.mayInsertTag("table")?c._createTableButton.show():c._createTableButton.hide();if(c.activeTable)if(b.findMarkup(function(){return this.nodeName==="TABLE"},d.obj)){B.updateFloatingMenuScope();B.setActiveCellStyle()}else{B.leaveTableScopes();c.activeTable.selection.cellSelectionMode=false;c.activeTable.selection.baseCellPosition=null;c.activeTable.selection.lastSelectionRange=null;c.activeTable.focusOut()}else B.leaveTableScopes()}});a.sub("aloha.editable.activated",function(a){c._splitcellsButton.enable(false);
c._mergecellsButton.enable(false);c._splitcellsRowButton.enable(false);c._mergecellsRowButton.enable(false);c._splitcellsColumnButton.enable(false);c._mergecellsColumnButton.enable(false);a.editable.obj.find("table").each(function(){for(var a=B.TableRegistry,b=0;b<a.length;b++)if(a[b].obj.attr("id")===D(this).attr("id")){a[b].activate();return true}A(this)})});a.sub("aloha.editable.deactivated",function(){B.activeTable&&B.activeTable.selection.unselectCells();B.setFocusedTable(void 0);for(var a=B.TableRegistry,
b=0;b<a.length;b++)a[b].deactivate()});m.bind("aloha-smart-content-changed",function(){m.activeEditable&&m.activeEditable.obj.find("table").each(function(){if(B.indexOfTableInRegistry(this)==-1&&A(this))this.id=G.Utils.guid()})});this.settings.summaryinsidebar&&m.bind("aloha-plugins-loaded",function(){c.initSidebar(m.Sidebar.right.show())})};var H="aloha-table";B.initSidebar=function(a){var b=this;b.sidebar=a;b.sidebarPanel=a.addPanel({id:O("sidebar-panel"),title:o.t("table.sidebar.title"),content:"",
expanded:true,activeOn:"table",onInit:function(){var a=this;this.setContent('<label class="'+O("label")+'" for="'+O("textarea")+'" >'+o.t("table.label.target")+'</label><textarea id="'+O("textarea")+'" class="'+O("textarea")+'" />');D(K("textarea")).live("keyup",function(){D(a.effective).attr("summary",D(K("textarea")).val());var c=D('div[class*="wai"]',"table#"+D(a.effective).attr("id"));c.removeClass(b.get("waiGreen"));c.removeClass(b.get("waiRed"));D(K("textarea")).val().trim()!=""?c.addClass(b.get("waiGreen")):
c.addClass(b.get("waiRed"))})},onActivate:function(a){this.effective=a;D(K("textarea")).val(D(this.effective).attr("summary"))}});a.show()};B.isEditableTable=function(a){return G.Utils.Dom.isEditable(a)};B.indexOfTableInRegistry=function(a){for(var b=this.TableRegistry,c=0;c<b.length;c++)if(b[c].obj[0].id==a.id)return c;return-1};B.getTableFromRegistry=function(a){a=this.indexOfTableInRegistry(a);return a>-1?this.TableRegistry[a]:null};B.isSelectionInTable=function(){var a=m.Selection.getRangeObject(),
a=D(a.commonAncestorContainer);return a.length==0?false:a.parents(".aloha-editable table").length?true:false};B.preventNestedTables=function(){if(this.isSelectionInTable()){c.alert({title:o.t("Table"),text:o.t("table.createTable.nestedTablesNoSupported")});return true}return false};B.initMergeSplitCellsBtns=function(){this._mergecellsButton=f.adopt("mergecells",g,{tooltip:o.t("button.mergecells.tooltip"),icon:"aloha-icon aloha-icon-mergecells",scope:this.name+".cell",click:function(){B.activeTable&&
B.activeTable.selection.mergeCells()}});this._splitcellsButton=f.adopt("splitcells",g,{tooltip:o.t("button.splitcells.tooltip"),icon:"aloha-icon aloha-icon-splitcells",scope:this.name+".cell",click:function(){var a;if(B.activeTable)if(B.activeTable.selection.selectedCells.length>0)B.activeTable.selection.splitCells();else{a=B.selectedOrActiveCells();if(a.length>0){x.splitCell(a,function(){return B.activeTable.newActiveCell().obj});m.trigger("aloha-table-selection-changed")}}}});this._mergecellsRowButton=
f.adopt("mergecellsRow",g,{tooltip:o.t("button.mergecells.tooltip"),icon:"aloha-icon aloha-icon-mergecells",scope:this.name+".row",click:function(){B.activeTable&&B.activeTable.selection.mergeCells()}});this._splitcellsRowButton=f.adopt("splitcellsRow",g,{tooltip:o.t("button.splitcells.tooltip"),icon:"aloha-icon aloha-icon-splitcells",scope:this.name+".row",click:function(){B.activeTable&&B.activeTable.selection.splitCells()}});this._mergecellsColumnButton=f.adopt("mergecellsColumn",g,{tooltip:o.t("button.mergecells.tooltip"),
icon:"aloha-icon aloha-icon-mergecells",scope:this.name+".column",click:function(){B.activeTable&&B.activeTable.selection.mergeCells()}});this._splitcellsColumnButton=f.adopt("splitcellsColumn",g,{tooltip:o.t("button.splitcells.tooltip"),icon:"aloha-icon aloha-icon-splitcells",scope:this.name+".column",click:function(){B.activeTable&&B.activeTable.selection.splitCells()}})};B.initNaturalFitBtn=function(){var a=this;if(this.colResize||this.rowResize)this._tableNaturalFitButton=f.adopt("naturalFit",
g,{tooltip:o.t("button.naturalfit.tooltip"),icon:"aloha-icon aloha-icon-table-naturalfit",scope:this.name+".cell",click:function(){if(a.activeTable){var b=a.activeTable.obj;b.find("td, th").each(function(){D(this).find("div").css("width","");D(this).css("width","")});b.find("tr").each(function(){D(this).css("height","")});b.css("width","")}}})};B.initRowsBtns=function(){var a=this;this._addrowbeforeButton=f.adopt("addrowbefore",g,{tooltip:o.t("button.addrowbefore.tooltip"),icon:"aloha-icon aloha-icon-addrowbefore",
scope:this.name+".row",click:function(){a.activeTable&&a.activeTable.addRowBeforeSelection()}});this._addrowafterButton=f.adopt("addrowafter",g,{tooltip:o.t("button.addrowafter.tooltip"),icon:"aloha-icon aloha-icon-addrowafter",scope:this.name+".row",click:function(){a.activeTable&&a.activeTable.addRowAfterSelection()}});this._deleterowsButton=f.adopt("deleterows",g,{tooltip:o.t("button.delrows.tooltip"),icon:"aloha-icon aloha-icon-deleterows",scope:this.name+".row",click:function(){if(a.activeTable){var b=
a.activeTable;c.confirm({title:o.t("Table"),text:o.t("deleterows.confirm"),yes:function(){b.deleteRows()}})}}});this._rowheaderButton=f.adopt("rowheader",k,{tooltip:o.t("button.rowheader.tooltip"),icon:"aloha-icon aloha-icon-rowheader",scope:this.name+".row",click:function(){if(a.activeTable){a.activeTable.refresh();E(a.activeTable,"col");a.activeTable.selection.selectRows(a.activeTable.selection.selectedRowIdxs);a.activeTable.selection.unselectCells()}}});this.rowMSItems=[];D.each(this.rowConfig,
function(b,c){a.rowMSItems.push({name:c.name,text:o.t(c.text),tooltip:o.t(c.tooltip),iconClass:"aloha-icon aloha-row-layout "+c.iconClass,click:function(){if(a.activeTable){J(a.rowConfig,c.cssClass,a.activeTable.selection.selectedCells);a.activeTable.selectRows()}}})});this.rowMSItems.length>0&&this.rowMSItems.push({name:"removeFormat",text:o.t("button.removeFormat.text"),tooltip:o.t("button.removeFormat.tooltip"),cls:"aloha-ui-multisplit-fullwidth",wide:true,click:function(){if(a.activeTable){for(var b=
a.activeTable.selection.selectedCells,c=0;c<b.length;c++)for(var d=0;d<a.rowConfig.length;d++)D(b[c]).removeClass(a.rowConfig[d].cssClass);a.activeTable.selectRows()}}});this.rowMSButton=n({items:this.rowMSItems,name:"formatRow",hideIfEmpty:true,scope:this.name+".row"})};B.initColumnBtns=function(){var a=this;this._addcolumnleftButton=f.adopt("addcolumnleft",g,{tooltip:o.t("button.addcolleft.tooltip"),icon:"aloha-icon aloha-icon-addcolumnleft",scope:this.name+".column",click:function(){a.activeTable&&
a.activeTable.addColumnsLeft()}});this._addcolumnrightButton=f.adopt("addcolumnright",g,{tooltip:o.t("button.addcolright.tooltip"),icon:"aloha-icon aloha-icon-addcolumnright",scope:this.name+".column",click:function(){a.activeTable&&a.activeTable.addColumnsRight()}});this._deletecolumnsButton=f.adopt("deletecolumns",g,{tooltip:o.t("button.delcols.tooltip"),icon:"aloha-icon aloha-icon-deletecolumns",scope:this.name+".column",click:function(){if(a.activeTable){var b=a.activeTable;c.confirm({title:o.t("Table"),
text:o.t("deletecolumns.confirm"),yes:function(){b.deleteColumns()}})}}});this._columnheaderButton=f.adopt("columnheader",k,{tooltip:o.t("button.columnheader.tooltip"),icon:"aloha-icon aloha-icon-columnheader",scope:this.name+".column",click:function(){if(a.activeTable){a.activeTable.refresh();E(a.activeTable,"row");a.activeTable.selection.selectColumns(a.activeTable.selection.selectedColumnIdxs);a.activeTable.selection.unselectCells()}}});this.columnMSItems=[];D.each(this.columnConfig,function(b,
c){var d={name:c.name,text:o.t(c.text),tooltip:o.t(c.tooltip),iconClass:"aloha-icon aloha-column-layout "+c.iconClass,click:function(){if(a.activeTable){J(a.columnConfig,c.cssClass,a.activeTable.selection.selectedCells);a.activeTable.selectColumns()}}};a.columnMSItems.push(d)});this.columnMSItems.length>0&&this.columnMSItems.push({name:"removeFormat",text:o.t("button.removeFormat.text"),tooltip:o.t("button.removeFormat.tooltip"),cls:"aloha-ui-multisplit-fullwidth",wide:true,click:function(){if(a.activeTable){for(var b=
a.activeTable.selection.selectedCells,c=0;c<b.length;c++)for(var d=0;d<a.columnConfig.length;d++)D(b[c]).removeClass(a.columnConfig[d].cssClass);a.activeTable.selectColumns()}}});this.columnMSButton=n({items:this.columnMSItems,name:"formatColumn",hideIfEmpty:true,scope:this.name+".column"})};B.initCellBtns=function(){var a=this;this.cellMSItems=[];D.each(this.cellConfig,function(b,c){var d={name:c.name,text:o.t(c.text),tooltip:o.t(c.tooltip),iconClass:"aloha-icon aloha-column-layout "+c.iconClass,
click:function(){if(a.activeTable){J(a.cellConfig,c.cssClass,a.selectedOrActiveCells());a.setActiveCellStyle()}}};a.cellMSItems.push(d)});this.cellMSItems.length>0&&this.cellMSItems.push({name:"removeFormat",text:o.t("button.removeFormat.text"),tooltip:o.t("button.removeFormat.tooltip"),cls:"aloha-ui-multisplit-fullwidth",wide:true,click:function(){if(a.activeTable){for(var b=a.selectedOrActiveCells(),c=0;c<b.length;c++)for(var d=0;d<a.cellConfig.length;d++)D(b[c]).removeClass(a.cellConfig[d].cssClass);
a.setActiveCellStyle()}}});this.cellMSButton=n({items:this.cellMSItems,name:"formatCell",hideIfEmpty:true,scope:this.name+".cell"})};B.initTableButtons=function(){var a=this;l.createScope(this.name+".row","Aloha.continuoustext");l.createScope(this.name+".column","Aloha.continuoustext");l.createScope(this.name+".cell","Aloha.continuoustext");this._createTableButton=f.adopt("createTable",g,{tooltip:o.t("button.createtable.tooltip"),icon:"aloha-icon aloha-icon-createTable",scope:"Aloha.continuoustext",
click:function(){B.createDialog(this.element)}});this.initColumnBtns();this.initRowsBtns();this.initCellBtns();this.initMergeSplitCellsBtns();this.initNaturalFitBtn();this.tableMSItems=[];var b=this.tableConfig;D.each(b,function(c,d){a.tableMSItems.push({name:d.name,text:o.t(d.text),tooltip:o.t(d.tooltip),iconClass:"aloha-icon aloha-table-layout "+d.iconClass,click:function(){if(a.activeTable)if(a.activeTable.obj.hasClass(d.cssClass)){for(c=0;c<b.length;c++)a.activeTable.obj.removeClass(b[c].cssClass);
a.tableMSButton.setActiveItem()}else{for(var c=0;c<b.length;c++)a.activeTable.obj.removeClass(b[c].cssClass);a.activeTable.obj.addClass(d.cssClass);a.tableMSButton.setActiveItem(d.cssClass)}}})});this.tableMSItems.length>0&&this.tableMSItems.push({name:"removeFormat",text:o.t("button.removeFormat.text"),tooltip:o.t("button.removeFormat.tooltip"),cls:"aloha-ui-multisplit-fullwidth",wide:true,click:function(){if(a.activeTable){for(var c=0;c<b.length;c++)a.activeTable.obj.removeClass(a.tableConfig[c].cssClass);
a.tableMSButton.setActiveItem()}}});this.tableMSButton=n({items:this.tableMSItems,name:"formatTable",hideIfEmpty:true,scope:this.name+".cell"});this._deleteTableButton=f.adopt("deleteTable",g,{tooltip:o.t("button.deltable.tooltip"),icon:"aloha-icon aloha-icon-deletetable",scope:this.name+".cell",click:function(){if(a.activeTable){var b=a.activeTable;c.confirm({title:o.t("Table"),text:o.t("deletetable.confirm"),yes:function(){b.deleteTable()}})}}});this._tableCaptionButton=f.adopt("tableCaption",k,
{tooltip:o.t("button.caption.tooltip"),icon:"aloha-icon aloha-icon-table-caption",scope:this.name+".cell",click:function(){if(a.activeTable){var b=a.activeTable.obj.children("caption");if(b.is("caption")&&b.is(":visible"))b.hide();else{if(!b.is("caption")){b=D("<caption></caption>");a.activeTable.obj.prepend(b)}b.show();D.trim(b.text()).length===0&&b.text(o.t("empty.caption"));a.makeCaptionEditable(b,b.text());var b=b.find("div").eq(0),c=b.contents().eq(0);if(c.length>0){var d=new G.Utils.RangeObject;
d.startContainer=d.endContainer=c.get(0);d.startOffset=0;d.endOffset=c.text().length;a.activeTable.obj.find("div.aloha-table-cell-editable").blur();b.focus();d.select();m.Selection.updateSelection()}}}}});this.summary=q({width:275,name:"tableSummary",noTargetHighlight:true,scope:this.name+".cell",element:D('<input id="aloha-attribute-field-tableSummary" class="aloha-wai-red" style="color: black; padding-left: 32px; background-color: white"/>')});this.summary.addListener("keyup",function(){a.activeTable&&
F(a)})};B.makeCaptionEditable=function(a,b){var c=a.children("div");if(c.length===0){c=D("<div></div>");c.addClass("aloha-ui aloha-editable-caption aloha-block");z.markWrapper(c);a.contents().length>0?c.append(a.contents()):b&&c.text(b);a.append(c)}else if(c.length>1){a.children("div:not(:first-child)").each(function(){$this=D(this);c.eq(0).append($this.contents());$this.remove()});c=c.eq(0)}c.contentEditable(true)};B.createDialog=function(a){this.createLayer.set("target",a);this.createLayer.show()};
B.createTable=function(a,b){if(!this.preventNestedTables())if(m.activeEditable&&typeof m.activeEditable.obj!=="undefined"){for(var c=document.createElement("table"),d=c.id=G.Utils.guid(),f=document.createElement("tbody"),g=0;g<b;g++){for(var k=document.createElement("tr"),j=0;j<a;j++){var l=document.createTextNode(""),p=document.createElement("td");p.appendChild(l);k.appendChild(p)}f.appendChild(k)}c.appendChild(f);y(m.Selection.getRangeObject(),c);G.Utils.Dom.insertIntoDOM(D(c),m.Selection.getRangeObject(),
m.activeEditable.obj);Y();var c=document.getElementById(d),o=A(c);if(o){c=m.Selection.getRangeObject();c.startContainer=c.endContainer=o.cells[0].wrapper[0];c.startOffset=c.endOffset=0;c.select();e.browser.msie?window.setTimeout(function(){o.cells[0].wrapper.get(0).focus()},20):o.cells[0].wrapper.get(0).focus()}m.activeEditable.smartContentChange({type:"block-change"});o.focus();B.activeTable.selection.selectionType="cell";B.updateFloatingMenuScope()}else this.error("There is no active Editable where the table can be\t\t\t\tinserted!")};
B.setFocusedTable=function(a){null!=this.activeTable&&this.activeTable.selection.unselectCells();for(var b=0;b<B.TableRegistry.length;b++)B.TableRegistry[b].hasFocus=false;if(typeof a!="undefined"){this.summary.setTargetObject(a.obj,"summary");if(a.obj.children("caption").is("caption")){this._tableCaptionButton.setState(true);this.makeCaptionEditable(a.obj.children("caption"))}a.hasFocus=true}B.activeTable=a;B.activeTable&&F(B);for(b=0;b<this.tableMSItems.length;b++)this.tableMSButton.showItem(this.tableMSItems[b].name);
this.tableMSButton.setActiveItem();if(this.activeTable)for(b=0;b<this.tableConfig.length;b++)this.activeTable.obj.hasClass(this.tableConfig[b].cssClass)&&this.tableMSButton.setActiveItem(this.tableConfig[b].name)};B.error=function(a){m.Log.error(this,a)};B.debug=function(a){m.Log.debug(this,a)};B.info=function(a){m.Log.info(this,a)};B.log=function(a){m.log("log",this,a)};B.get=function(a){if(this.config[a])return this.config[a];if(this.parameters[a])return this.parameters[a]};B.set=function(a,b){this.config[a]?
this.config[a]=b:this.parameters[a]=b};B.makeClean=function(a){a.find("td, th").css("cursor","")};B.toString=function(){return this.prefix};B.leaveTableScopes=function(a){for(var b=0,c=[],a=e.isArray(a)?a:[],c=v.getPossibleSelectionTypes(),b=0;b<c.length;b++)e.inArray(c[b],a)===-1&&l.leaveScope(B.name+"."+c[b],void 0,true)};B.updateFloatingMenuScope=function(){var a=0,b,c;if(null!=B.activeTable&&null!=B.activeTable.selection.selectionType){b=l.getPrimaryScope();c=B.activeTable.selection.getCurrentSelectionTypes();
B.leaveTableScopes(c);for(a=0;a<c.length;a++)l.enterScope(B.name+"."+c[a]);c[0]!==b&&l.setScope(B.name+"."+c[0])}else B.leaveTableScopes()};B.setActiveCellStyle=function(){var a=false,b;this.cellMSButton.setActiveItem();for(var c=this.selectedOrActiveCells(),d=0;d<this.cellConfig.length;d++)if(D(c[0]).hasClass(this.cellConfig[d].cssClass)){b=this.cellConfig[d].name;a=true;break}D(c).each(function(){D(this).hasClass(b)||(a=false)});a&&this.cellMSButton.setActiveItem(b)};B.selectedOrActiveCells=function(){var a=
this.activeTable.selection.selectedCells;if(!a||a.length<1)return(a=function(){var a=m.Selection.getRangeObject();return m.activeEditable?a.findMarkup(function(){return this.nodeName.toLowerCase()==="td"},m.activeEditable.obj):null}())?[a]:[];return a};d.register(B);return B});define("format/nls/i18n",{root:{"button.strong.tooltip":"Strong","button.em.tooltip":"Emphasize","button.b.tooltip":"Bold","button.i.tooltip":"Italic","button.u.tooltip":"Underline","button.cite.tooltip":"Cite","button.q.tooltip":"Tooltip",
"button.code.tooltip":"Code","button.abbr.tooltip":"Abbreviation","button.del.tooltip":"Strikethrough","button.s.tooltip":"Strikethrough","button.sub.tooltip":"Subscript","button.sup.tooltip":"Superscript","button.p.tooltip":"Paragraph","button.h1.tooltip":"Heading 1","button.h2.tooltip":"Heading 2","button.h3.tooltip":"Heading 3","button.h4.tooltip":"Heading 4","button.h5.tooltip":"Heading 5","button.h6.tooltip":"Heading 6","button.pre.tooltip":"Preformatted text","button.title.tooltip":"Title",
"button.removeFormat.tooltip":"Remove formatting","button.removeFormat.text":"Remove formatting",GENTICS_button_p:"GENTICS_button_p",GENTICS_button_h1:"GENTICS_button_h1",GENTICS_button_h2:"GENTICS_button_h2",GENTICS_button_h3:"GENTICS_button_h3",GENTICS_button_h4:"GENTICS_button_h4",GENTICS_button_h5:"GENTICS_button_h5",GENTICS_button_h6:"GENTICS_button_h6",GENTICS_button_pre:"GENTICS_button_pre",GENTICS_button_title:"GENTICS_button_title",formatBold:"Ctrl+b",formatItalic:"Ctrl+i",formatUnderline:"Ctrl+u",
formatParagraph:"Alt+Ctrl+0",formatH1:"Alt+Ctrl+1",formatH2:"Alt+Ctrl+2",formatH3:"Alt+Ctrl+3",formatH4:"Alt+Ctrl+4",formatH5:"Alt+Ctrl+5",formatH6:"Alt+Ctrl+6",formatPre:"Alt+Ctrl+P",formatDel:"Ctrl+\\",formatSub:"Ctrl+,",formatSup:"Ctrl+.","floatingmenu.tab.format":"Format","format.class.legend":"CSS class","format.class.none":"none"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("format/format-plugin","jquery aloha PubSub aloha/plugin aloha/state-override aloha/content-rules aloha/ephemera aloha/selection util/arrays util/html util/dom util/browser util/maps util/strings ui/ui ui/toggleButton ui/port-helper-multi-split i18n!format/nls/i18n".split(" "),
function(m,e,a,j,d,b,f,l,g,k,c,q,n,o,p,r,t,x){function v(a){var b=a.startOffset,c=a.endContainer,d=a.endOffset;return a.startContainer===c&&b===0&&d===c.length}function u(a){var b=a.commonAncestorContainer;if(W(b)&&b.parentNode){b=b.parentNode;a.startContainer=b;a.endContainer=b;a.commonAncestorContainer=b;a.startOffset=0;a.endOffset=1;u(a)}else a.update()}function z(a){u(a);var b=a.commonAncestorContainer;if(la[b.nodeName]&&(v(a)||a.startContainer!==a.endContainer)){var c=m(a.startContainer.parentNode).nextUntil(m(a.endContainer.parentNode).next()).andSelf(),
d=m(a.startContainer.parentNode).prevAll(),f=m(a.endContainer.parentNode).nextAll(),a=a.startContainer.parentNode.parentNode.nodeName;if(c.length==1)if(d.length==0&&f.length==0)c.unwrap().contents().unwrap().wrap("<p>");else if(d.length===0)c.addClass("_moved").remove().insertBefore(f.parent());else if(f.length===0)c.addClass("_moved").remove().insertAfter(d.parent());else{c.addClass("_moved").remove().insertAfter(d.parent());m("<"+a.toLowerCase()+">").append(f).insertAfter(c)}else{c.addClass("_moved").remove().insertAfter(b);
f.length>0&&m("<"+a.toLowerCase()+">").append(f).insertAfter(c.last())}m("._moved").each(function(){var a=m("<p>"),b=m(this);b.after(a);b.contents().unwrap().appendTo(a)});d.length===0&&b.remove()}}function C(a){var b=m(".aloha-cell-selected");if(b.length>0){var c=0;b.each(function(){var b=m(this).find("div"),d=b.find(a);if(d.length>0){d.contents().unwrap();c++}b.contents().wrap("<"+a+"></"+a+">")});c===b.length&&b.find(a).contents().unwrap();return true}return false}function F(a,b){var c=H[b];R.hasOwnProperty(b)&&
(c=R[b]);return p.adopt(c,r,{tooltip:x.t("button."+b+".tooltip"),icon:"aloha-icon aloha-icon-"+c,scope:"Aloha.continuoustext",click:function(){C(b)||a.addMarkup(b);return false}})}function A(a,b){return{name:b,tooltip:x.t("button."+b+".tooltip"),iconClass:"aloha-icon "+x.t("aloha-large-icon-"+b),markup:m("<"+b+">"),click:function(){var c;if(C(b))c=false;else{a.changeMarkup(b);e.activeEditable&&(m.browser.mozilla&&document.activeElement!==e.activeEditable.obj[0])&&e.activeEditable.obj.focus();e.activeEditable&&
e.trigger("aloha-format-block")}return c}}}function E(a,b){return{name:b,text:x.t("button."+b+".text"),tooltip:x.t("button."+b+".tooltip"),wide:true,cls:"aloha-ui-multisplit-fullwidth",click:function(){a.removeFormat()}}}function J(a){var b=e.activeEditable.obj,c,d,f;if(a.length!==0){b.find(":not(h1,h2,h3,h4,h5,h6)").each(function(){B(this).removeClass("aloha-heading-hierarchy-violated")});for(var g=0;g<a.length;g++)m.inArray(a[g],["h1","h2","h3","h4","h5","h6"])>=0&&(typeof c!=="undefined"?parseInt(a[g].charAt(1),
10)<c&&(c=parseInt(a[g].charAt(1),10)):c=parseInt(a[g].charAt(1),10));typeof c!=="undefined"&&b.find("h1,h2,h3,h4,h5,h6").each(function(){f=parseInt(this.nodeName.charAt(1),10);if(typeof d!=="undefined")if(f<c)B(this).addClass("aloha-heading-hierarchy-violated");else if(f>d+1)B(this).addClass("aloha-heading-hierarchy-violated");else{d=f;B(this).removeClass("aloha-heading-hierarchy-violated")}else if(f===c){d=f;B(this).removeClass("aloha-heading-hierarchy-violated")}else B(this).addClass("aloha-heading-hierarchy-violated")})}}
function K(a,b){b.select();Y(a,l.getRangeObject())}function O(a,b,d){c.addMarkup(b,d);K(a,b)}function y(a,c,d){if(!b.isAllowed(d.obj[0],a))return false;return(c=c.getEditableConfig(d.obj))?B.inArray(a,c)>-1:false}function Y(a,b){var c,d,f,e,g;m.each(a.buttons,function(a,d){var g=false,k=P[d.markup[0].nodeName]||[d.markup[0].nodeName];for(f=0;f<b.markupEffectiveAtStart.length;f++){c=b.markupEffectiveAtStart[f];for(e=0;e<k.length;e++)if(l.standardTextLevelSemanticsComparator(c,m("<"+k[e]+">"))){d.handle.setState(true);
g=true}}g||d.handle.setState(false)});if(a.multiSplitItems.length>0){d=false;for(f=0;f<b.markupEffectiveAtStart.length&&!d;f++){c=b.markupEffectiveAtStart[f];for(e=0;e<a.multiSplitItems.length&&!d;e++){g=a.multiSplitItems[e];if(g.markup&&l.standardTextLevelSemanticsComparator(c,g.markup)){a.multiSplitButton.setActiveItem(g.name);d=true}}}d||a.multiSplitButton.setActiveItem(null)}D(b.commonAncestorContainer)}function D(a){a=m(a);if(a.is(".aloha-editing-p.aloha-placeholder")){a[0].className="";N();
a[0].className="aloha-editing-p aloha-placeholder"}else{N();if(a.is("pre")){var b=a[0].nextSibling,c=a[0].previousSibling;if(!c||!b){c||a.before(G());b||a.after(G())}}}}function G(){return m(q.ie?'<p class="aloha-editing-p aloha-placeholder">&#x2060;</p>':'<p class="aloha-editing-p aloha-placeholder"><br class="aloha-end-br"></p>')}function N(){e.activeEditable&&e.activeEditable.removePlaceholder(e.activeEditable.obj)}var B=m,H={b:"bold",strong:"bold",i:"italic",em:"italic",del:"strikethrough",sub:"subscript",
sup:"superscript",u:"underline",s:"strikethrough"},R={strong:"strong",em:"emphasis",s:"strikethrough2"},L={u:true,em:true,strong:true,b:true,i:true,cite:true,q:true,code:true,abbr:true,del:true,s:true,sub:true,sup:true},S={p:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,pre:true},P={B:["STRONG","B"],I:["EM","I"],STRONG:["STRONG","B"],EM:["EM","I"]},W=k.isInlineFormattable,la={OL:true,UL:true,LI:true,DL:true,DT:true,DD:true};return j.create("format",{config:["b","i","sub","sup","p","h1","h2",
"h3","h4","h5","h6","pre","removeFormat"],availableButtons:["u","strong","del","em","b","i","s","sub","sup","p","h1","h2","h3","h4","h5","h6","pre","removeFormat"],hotKey:{formatBold:"ctrl+b meta+b",formatItalic:"ctrl+i meta+i",formatUnderline:"ctrl+u meta+u",formatParagraph:"alt+ctrl+0 alt+meta+0",formatH1:"alt+ctrl+1 alt+meta+1",formatH2:"alt+ctrl+2 alt+meta+2",formatH3:"alt+ctrl+3 alt+meta+3",formatH4:"alt+ctrl+4 alt+meta+4",formatH5:"alt+ctrl+5 alt+meta+5",formatH6:"alt+ctrl+6 alt+meta+6",formatPre:"ctrl+p meta+p",
formatDel:"ctrl+d meta+d",formatSub:"alt+shift+s",formatSup:"ctrl+shift+s"},init:function(){var b=this;f.classes("aloha-heading-hierarchy-violated");typeof this.settings.hotKey!=="undefined"&&m.extend(true,this.hotKey,this.settings.hotKey);this.initButtons();e.bind("aloha-plugins-loaded",function(){b.initSidebar(e.Sidebar.right)});var c=o.parseBoolean(this.settings.checkHeadingHierarchy),d=function(){J(b.formatOptions)};if(c){e.bind("aloha-smart-content-changed",d);e.bind("aloha-markup-change",d)}a.sub("aloha.editable.activated",
function(a){var f=a.editable;b.applyButtonConfig(f.obj);c&&d();var a=function(a){return y(a,b,f)?function(){b.addMarkup(a);return false}:function(){return false}},e=function(a){return y(a,b,f)?function(){b.changeMarkup(a);return false}:function(){return false}},g=f.obj;g.bind("keydown.aloha.format",b.hotKey.formatBold,a("b"));g.bind("keydown.aloha.format",b.hotKey.formatItalic,a("i"));g.bind("keydown.aloha.format",b.hotKey.formatUnderline,a("u"));g.bind("keydown.aloha.format",b.hotKey.formatDel,a("del"));
g.bind("keydown.aloha.format",b.hotKey.formatSub,a("sub"));g.bind("keydown.aloha.format",b.hotKey.formatSup,a("sup"));g.bind("keydown.aloha.format",b.hotKey.formatParagraph,e("p"));g.bind("keydown.aloha.format",b.hotKey.formatH1,e("h1"));g.bind("keydown.aloha.format",b.hotKey.formatH2,e("h2"));g.bind("keydown.aloha.format",b.hotKey.formatH3,e("h3"));g.bind("keydown.aloha.format",b.hotKey.formatH4,e("h4"));g.bind("keydown.aloha.format",b.hotKey.formatH5,e("h5"));g.bind("keydown.aloha.format",b.hotKey.formatH6,
e("h6"));g.bind("keydown.aloha.format",b.hotKey.formatPre,e("pre"))});a.sub("aloha.editable.deactivated",function(a){a.editable.obj.unbind("keydown.aloha.format")})},applyButtonConfig:function(a){var c=this.getEditableConfig(a),d,f;if(typeof c==="object"){var g=[];m.each(c,function(a,b){typeof a==="number"&&typeof b==="string"||g.push(a)});g.length>0&&(c=g)}this.formatOptions=c;a=a[0];for(d in this.buttons)this.buttons.hasOwnProperty(d)&&(b.isAllowed(a,d)?m.inArray(d,c)!==-1?this.buttons[d].handle.show():
this.buttons[d].handle.hide():this.buttons[d].handle.hide());f=this.multiSplitItems.length;for(d=0;d<f;d++){var e=this.multiSplitItems[d].name;e!="removeFormat"&&!b.isAllowed(a,e)?this.multiSplitButton.hideItem(e):m.inArray(e,c)!==-1?this.multiSplitButton.showItem(e):this.multiSplitButton.hideItem(e)}},initButtons:function(){var b=this;this.buttons={};this.multiSplitItems=[];B.each(this.availableButtons,function(a,c){var d=false;if(typeof a!=="number"&&typeof c!=="string"){d=c;c=a}L[c]?b.buttons[c]=
{handle:F(b,c),markup:m("<"+c+">",{"class":d||""})}:S[c]?b.multiSplitItems.push(A(b,c)):"removeFormat"===c?b.multiSplitItems.push(E(b,c)):e.log("warn",b,'Button "'+c+'" is not defined')});this.multiSplitButton=new t({name:"formatBlock",items:this.multiSplitItems,hideIfEmpty:true,scope:"Aloha.continuoustext"});a.sub("aloha.selection.context-change",function(a){Y(b,a.range)})},initSidebar:function(a){var b=this;b.sidebar=a;a.addPanel({id:b.nsClass("sidebar-panel-class"),title:x.t("floatingmenu.tab.format"),
content:"",expanded:true,activeOn:this.formatOptions||false,onInit:function(){},onActivate:function(a){var c=this;c.effective=a;if(a[0]){c.format=a[0].nodeName.toLowerCase();var d=m("<div>").attr("class",b.nsClass("target-container")),f=m("<fieldset>");f.append(m("<legend>"+c.format+" "+x.t("format.class.legend")).append(m("<select>")));d.append(f);var e='<div class="'+b.nsClass("target-container")+'"><fieldset><legend>'+x.t("format.class.legend")+'</legend><select name="targetGroup" class="'+b.nsClass("radioTarget")+
'"><option value="">'+x.t("format.class.none")+"</option>";b.config[c.format]&&b.config[c.format]["class"]&&m.each(b.config[c.format]["class"],function(a,b){e=e+('<option value="'+a+'" >'+b+"</option>")});e=e+"</select></fieldset></div>";this.setContent(e);m(b.nsSel("framename")).live("keyup",function(){m(c.effective).attr("target",m(this).val().replace('"',"&quot;").replace("'","&#39;"))});c.effective=a;m(b.nsSel("linkTitle")).val(m(c.effective).attr("title"))}}});a.show()},nsClass:function(){var a=
[];m.each(arguments,function(){a.push(this==""?"aloha-format":"aloha-format-"+this)});return m.trim(a.join(" "))},nsSel:function(){var a=[];m.each(arguments,function(){a.push("."+(this==""?"aloha-format":"aloha-format-"+this))});return m.trim(a.join(" "))},addMarkup:function(a){var b=this,f=m("<"+a+">"),k=l.rangeObject;if(!(typeof a==="undefined"||a=="")){var j=P[f[0].nodeName]||[f[0].nodeName],p=k.findMarkup(function(){return-1!==g.indexOf(j,this.nodeName)},e.activeEditable.obj);if(p){k.isCollapsed()?
c.removeFromDOM(p,k,true):c.removeMarkup(k,m(p),e.activeEditable.obj);K(b,k)}else{if(k.isCollapsed()){c.extendToWord(k);if(k.isCollapsed()&&d.enabled()){d.setWithRangeObject(H[a],k,function(a,c){O(b,c,f)});return}}O(b,k,f)}}},changeMarkup:function(a){l.changeMarkupOnSelection(m("<"+a+">"));e.settings.plugins.format&&e.settings.plugins.format.checkHeadingHierarchy===true&&J(this.formatOptions)},removeFormat:function(){var a=["u","strong","em","b","i","q","del","s","code","sub","sup","h1","h2","h3",
"h4","h5","h6","pre","quote","blockquote","address","small","cite","dfn","abbr","time","var","samp","kbd","mark","span","ins"],b=l.rangeObject,d;if(this.settings.removeFormats)a=this.settings.removeFormats;if(!b.isCollapsed()){for(d=0;d<a.length;d++)c.removeMarkup(b,m("<"+a[d]+">"),e.activeEditable.obj,false);z(b);b.select();e.activeEditable.smartContentChange({type:"block-change"})}},toString:function(){return"format"}})});define("ui/menuButton",["jquery","ui/component","ui/utils","jqueryui"],function(m,
e,a){function j(b,f){var e=[];m.each(f,function(c,f){var g=m("<li>");g.append(m("<a>",{href:"javascript:void 0",html:a.makeButtonLabelWithIcon(f)}));f.click&&g.data("aloha-ui-menubutton-select",function(){b();f.click()});if(f.menu){var o=m("<ul>").appendTo(g);o.append(j(d(o,b),f.menu))}e.push(g[0])});return e}function d(a,b){b=b||m.noop;return function(){a.blur().hide();a.parent().removeClass("aloha-ui-menubutton-pressed");b()}}function b(a,b){var d=b.item.data("aloha-ui-menubutton-select");d&&d(a,
b);a.preventDefault()}var f=e.extend({init:function(){this.element=f.makeMenuButton(this)}});f.makeMenuButton=function(f){function e(a){a.hide().parent().removeClass("aloha-ui-menubutton-pressed");k.trigger("menuhidden")}var k=m("<div>",{"class":"aloha-ui-menubutton-container"}),c=a.makeButtonElement({"class":"aloha-ui-menubutton-expand"}),q=m("<ul>",{"class":"aloha-ui-menubutton-menu"}),n=null,o=null;m.browser.msie&&k.addClass("aloha-ui-menubutton-iehack");f.click?(n=a.makeButton(a.makeButtonElement({"class":"aloha-ui-menubutton-action"}),
f).click(f.click),a.makeButton(c,{},!0),o=m("<div>").buttonset().append(n).append(c)):a.makeButton(c,f,!0).addClass("aloha-ui-menubutton-single");f.tooltip&&(k.children("[title]").removeAttr("title").end().attr("title",f.tooltip).tooltip({tooltipClass:"aloha aloha-ui-tooltip",position:{my:"left top",at:"right bottom"}}),f.menu&&(k.on("menushown",function(){k.tooltip("disable")}),k.on("menuhidden",function(){k.tooltip("enable")})));if(!f.menu)return k.append(n);c.click(function(){k.addClass("aloha-ui-menubutton-pressed");
f.siblingContainer&&f.siblingContainer.find(".aloha-ui-menubutton-menu").each(function(){this!==q[0]&&e(m(this))});if(q.is(":visible"))e(q);else{q.show().position({my:"left top",at:"left bottom",of:n||c});k.trigger("menushown");var a=m(document);a.one("click",function(){a.one("click",function(){q.hide();k.removeClass("aloha-ui-menubutton-pressed").trigger("menuhidden")})})}});k.append(o||c).append(q);q.append(j(d(q),f.menu));q.hide().menu({select:b});return k};return f});define("list/nls/i18n",{root:{"button.createulist.tooltip":"Insert Unordered List",
"button.createolist.tooltip":"Insert Ordered List","button.createdlist.tooltip":"Insert Definition List","button.indentlist.tooltip":"Increase Indent","button.outdentlist.tooltip":"Decrease Indent","floatingmenu.tab.list":"Lists"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("list/list-plugin","aloha jquery aloha/plugin aloha/content-rules aloha/engine util/dom ui/ui ui/scopes ui/button ui/menuButton PubSub i18n!list/nls/i18n".split(" "),function(m,e,a,j,d,b,f,l,g,k,c,q){function n(a){if(a.templates.dl){e.each(a.templates.dl.classes,
function(b,c){a.definitionListStyleButtons.push(a.makeListStyleButton("dl",c))});a._definitionListFormatSelectorButton=f.adopt("definitionListFormatSelector",k,{click:function(){a.transformList("dl")},tooltip:q.t("button.createdlist.tooltip"),html:'<span class="ui-button-icon-primary ui-icon aloha-icon aloha-icon-definitionlist"></span>',menu:a.definitionListStyleButtons.length?a.definitionListStyleButtons:null})}if(a.templates.ol){e.each(a.templates.ol.classes,function(b,c){a.orderedListStyleButtons.push(a.makeListStyleButton("ol",
c))});a._orderedListFormatSelectorButton=f.adopt("orderedListFormatSelector",k,{click:function(){a.transformList("ol")},tooltip:q.t("button.createolist.tooltip"),html:'<span class="ui-button-icon-primary ui-icon aloha-icon aloha-icon-orderedlist"></span>',menu:a.orderedListStyleButtons.length?a.orderedListStyleButtons:null})}if(a.templates.ul){e.each(a.templates.ul.classes,function(b,c){a.unorderedListStyleButtons.push(a.makeListStyleButton("ul",c))});a._unorderedListFormatSelectorButton=f.adopt("unorderedListFormatSelector",
k,{click:function(){a.transformList("ul")},tooltip:q.t("button.createulist.tooltip"),html:'<span class="ui-button-icon-primary ui-icon aloha-icon aloha-icon-unorderedlist"></span>',menu:a.unorderedListStyleButtons.length?a.unorderedListStyleButtons:null})}}function o(a){c.sub("aloha.editable.created",function(b){var c=b.editable.obj[0],d=a.getEditableConfig(b.editable.obj);z[b.editable.getId()]={dl:d&&e.inArray("dl",d)>-1&&j.isAllowed(c,"dl"),ol:d&&e.inArray("ol",d)>-1&&j.isAllowed(c,"ol"),ul:d&&
e.inArray("ul",d)>-1&&j.isAllowed(c,"ul")}});c.sub("aloha.editable.destroyed",function(a){delete z[a.editable.getId()]});c.sub("aloha.editable.activated",function(b){if(b=z[b.editable.getId()]){r(a,"dl",b.dl);r(a,"ol",b.ol);r(a,"ul",b.ul)}});c.sub("aloha.selection.context-change",function(b){var c=e(".aloha-icon-definitionlist").parents(".aloha-ui-menubutton-container"),d=e(".aloha-icon-orderedlist").parents(".aloha-ui-menubutton-container"),f=e(".aloha-icon-unorderedlist").parents(".aloha-ui-menubutton-container");
c.removeClass("aloha-button-active");d.removeClass("aloha-button-active");f.removeClass("aloha-button-active");a._outdentListButton.show(false);a._indentListButton.show(false);for(var g,k=b.range,b=0;b<k.markupEffectiveAtStart.length;b++){g=k.markupEffectiveAtStart[b];switch(g.nodeName){case "DL":c.addClass("aloha-button-active");e(g).addClass("alohafocus");break;case "OL":d.addClass("aloha-button-active");a._outdentListButton.show(true);a._indentListButton.show(true);break;case "UL":f.addClass("aloha-button-active");
a._outdentListButton.show(true);a._indentListButton.show(true)}}e("div.aloha-list-templates ul").removeClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr("role","").attr("aria-hidden","").attr("aria-expanded","").css("display","block")});m.Markup.addKeyHandler(9,function(b){return a.processTab(b)})}function p(a,b){var c=function(a,c){return b[c]===void 0?a:b[c]},d=/\${\s*([a-z0-9\-_]+)\s*}/ig;do var f=a,a=a.replace(d,c),f=a!==f;while(f);return a}function r(a,b,c){switch(b){case "ul":a.templates.ul&&
a._unorderedListFormatSelectorButton.show(c);break;case "ol":a.templates.ol&&a._orderedListFormatSelectorButton.show(c);break;case "dl":a.templates.dl&&a._definitionListFormatSelectorButton.show(c)}}function t(a,b){u(a).find(a.nodeName).each(function(){x(this)&&m.Markup.transformDomObject(this,b,m.Selection.rangeObject)});m.Markup.transformDomObject(a,b,m.Selection.rangeObject)}function x(a){var b=m.Selection.getSelectionTree();return v(b,a)}function v(a,b){var c=false;u.each(a,function(a,d){if(d.domobj===
b&&d.selection!=="none"||v(d.children,b))c=true});return c}var u=e,z={},C=a.create("list",{config:["ul","ol","dl"],transformableElements:{p:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,ul:true,ol:true,dl:true},templates:{ul:{classes:["aloha-list-disc","aloha-list-circle","aloha-list-square"],template:'<ul class="${cssClass}"><li>${first}<ul class="${cssClass}"><li>${second}<ul class="${cssClass}"><li>${third}</li></ul></li></ul></li></ul>',locale:{fallback:{first:"first layer",second:"second layer",
third:"third layer"},de:{first:"erste Ebene",second:"zweite Ebene",third:"dritte Ebene"}}},ol:{classes:["aloha-list-decimal","aloha-list-decimal-leading-zero","aloha-list-lower-roman","aloha-list-upper-roman","aloha-list-lower-greek","aloha-list-lower-latin","aloha-list-upper-latin"],template:'<ol class="${cssClass}"><li>${first}<ol class="${cssClass}"><li>${second}<ol class="${cssClass}"><li>${third}</li></ol></li></ol></li></ol>',locale:{fallback:{first:"first layer",second:"second layer",third:"third layer"},
de:{first:"erste Ebene",second:"zweite Ebene",third:"dritte Ebene"}}},dl:{classes:["aloha-list-blue","aloha-list-green","aloha-list-red"],template:'<dl class="${cssClass}"><dt>${first}<dt><dd>${second}</dd></dl>',locale:{fallback:{first:"first item",second:"second item"},de:{first:"erstes Element",second:"zweites Element"}}}},setListStyle:function(a,b){var c=this.getStartingDomObjectToTransform(),d=c.nodeName.toLowerCase(),f=u(c),e=this;if(d!=="ul"&&d!=="ol"&&d!=="dl"){this.transformList(a);c=this.getStartingDomObjectToTransform();
d=c.nodeName.toLowerCase();f=u(this.getStartingDomObjectToTransform())}if(a===d){u.each(this.templates[d].classes,function(){f.removeClass(this)});f.addClass(b);f.find(a).each(function(){if(x(this)){var c=u(this);u.each(e.templates[a].classes,function(){c.removeClass(this)});c.addClass(b)}})}},orderedListStyleButtons:[],unorderedListStyleButtons:[],definitionListStyleButtons:[],makeListStyleButton:function(a,b){var c=this,d=c.templates[a],f=d.locale[m.settings.locale]||d.locale.fallback;return{html:'<div class="aloha-list-templates">'+
p(d.template,{cssClass:b,first:f.first,second:f.second,third:f.third})+"</div>",click:function(){c.setListStyle(a,b)}}},init:function(){var a=this;a._indentListButton=f.adopt("indentList",g,{tooltip:q.t("button.indentlist.tooltip"),icon:"aloha-icon aloha-icon-indent",scope:"Aloha.continuoustext",click:function(){a.indentList()}});a._outdentListButton=f.adopt("outdentList",g,{tooltip:q.t("button.outdentlist.tooltip"),icon:"aloha-icon aloha-icon-outdent",scope:"Aloha.continuoustext",click:function(){a.outdentList()}});
if(m.settings.plugins&&m.settings.plugins.list&&m.settings.plugins.list.templates)a.templates=m.settings.plugins.list.templates;n(a);o(a);l.createScope("Aloha.List","Aloha.continuoustext")},processTab:function(a){return a.keyCode===9?a.shiftKey?this.outdentList():this.indentList():true},getStartingDomObjectToTransform:function(){m.Selection.checkForFirefoxIncorrectRange();var a=m.Selection.rangeObject,b,c;for(b=0;b<a.markupEffectiveAtStart.length;b++){c=a.markupEffectiveAtStart[b];if(this.transformableElements[c.nodeName.toLowerCase()])return c}return false},
getNearestSelectedListItem:function(){var a=m.Selection.rangeObject,c,d;for(c=0;c<a.markupEffectiveAtStart.length;c++){d=a.markupEffectiveAtStart[c];if(b.isListElement(d))return d}return false},transformListToParagraph:function(a,b){var c,f=u(a);u.each(f.children(b),function(a,b){c=m.Markup.transformDomObject(b,"p",m.Selection.rangeObject);c.after(c.children("ol,ul,dl"));d.ensureContainerEditable(c.get(0))});f.children().unwrap()},fixupNestedLists:function(a,b){if(a.get(0).nodeName.toLowerCase()===
"li"){u.each(b.children(),function(a,b){m.Markup.transformDomObject(b,"li",m.Selection.rangeObject)});a.after(b.children());b.remove()}else b.children().unwrap()},createList:function(a,c){var d=m.Selection.rangeObject.getSelectedSiblings(c),f,e,g;switch(a){case "ol":f=u("<ol></ol>");e=u("<li></li>");break;case "ul":f=u("<ul></ul>");e=u("<li></li>");break;case "dl":f=u("<dl></dl>");e=u("<dt></dt>")}f.append(e);u(c).contents().appendTo(e);u(c).replaceWith(f);if(m.Selection.rangeObject.startContainer==
c)m.Selection.rangeObject.startContainer=e.get(0);if(m.Selection.rangeObject.endContainer==c)m.Selection.rangeObject.endContainer=e.get(0);g=e;if(d)for(var k=true,j=false,l=0;l<d.length;++l)if(b.isBlockLevelElement(d[l])){j&&(j=false);if(a==="dl"){e=k?m.Markup.transformDomObject(d[l],"dd",m.Selection.rangeObject):m.Markup.transformDomObject(d[l],"dt",m.Selection.rangeObject);k=!k}else e=m.Markup.transformDomObject(d[l],"li",m.Selection.rangeObject);f.append(e);g=e}else if(!(d[l].nodeType==3&&u.trim(d[l].data).length===
0)){if(!j){j=e;f.append(j);g=j}j.append(d[l])}this.mergeAdjacentLists(f);d=g.get(0);if(b.isEmpty(d)){f=m.createRange();e=m.getSelection();d.appendChild(document.createTextNode(""));f.selectNodeContents(d.lastChild);e.removeAllRanges();e.addRange(f);m.Selection.updateSelection()}},prepareNewList:function(a){var c,d,f;m.Selection.updateSelection();m.Selection.changeMarkupOnSelection(u("<p></p>"));f=this.getStartingDomObjectToTransform();if(!f)if(u(m.Selection.rangeObject.startContainer).contentEditable()){switch(a){case "ol":c=
u("<ol></ol>");d=u("<li></li>");break;case "ul":c=u("<ul></ul>");d=u("<li></li>");break;case "dl":c=u("<dl></dl>");d=u("<dt></dt>")}c.append(d);a=d.get(0);a.appendChild(document.createTextNode(""));if(b.insertIntoDOM(c,m.Selection.rangeObject)){f=m.createRange();d=m.getSelection();f.setStart(a.firstChild,0);f.setEnd(a.firstChild,0);d.removeAllRanges();d.addRange(f);m.Selection.updateSelection();f=c.get(0)}else m.Log.error(this,"Could not transform selection into a list")}else m.Log.error(this,"Could not transform selection into a list");
return f},transformList:function(a){var c=this.getStartingDomObjectToTransform(),d,f;this._outdentListButton.show(true);this._indentListButton.show(true);if(!c||!c.parentNode){c=this.prepareNewList(a);this.refreshSelection();if(c&&c.nodeName.toLowerCase()===a)return}d=c.nodeName.toLowerCase();if(d===a){d=u(c);f=d.parent();f.length>0&&b.isListElement(f.get(0))?this.fixupNestedLists(f,d):a==="dl"?this.transformListToParagraph(c,"dd, dt"):this.transformListToParagraph(c,"li")}else if(d=="ul"&&a==="ol"){t(c,
"ol");this.mergeAdjacentLists(u(c))}else if(d=="ol"&&a==="ul"){t(c,"ul");this.mergeAdjacentLists(u(c))}else{if(d==="ul"&&a==="dl"){this.transformListToParagraph(c,"li");c=this.prepareNewList(a)}else if(d==="ol"&&a==="dl"){this.transformListToParagraph(c,"li");c=this.prepareNewList(a)}else if(d==="dl"&&a==="ol"){this.transformListToParagraph(c,"dd, dt");c=this.prepareNewList(a)}else if(d==="dl"&&a==="ul"){this.transformListToParagraph(c,"dd, dt");c=this.prepareNewList(a)}this.createList(a,c)}this.refreshSelection()},
indentList:function(){var a=this.getNearestSelectedListItem(),b,c,d;if(a){d=u(a).prev("li");if(d.length===0)return false;u(a).parent();c=m.Selection.rangeObject.getSelectedSiblings(a);b=u(a).parent().clone(false).empty();b.append(a);d.append(b);if(c)for(a=0;a<c.length;++a)b.append(u(c[a]));this.mergeAdjacentLists(b,true);this.refreshSelection();return false}return true},outdentList:function(){var a=this.getNearestSelectedListItem(),c,d,f,e,g;if(a){d=u(a);f=d.parent();c=f.parents("ul,ol");e=f.parent("li");
if(c.length>0&&b.isListElement(c.get(0))){g=(a=m.Selection.rangeObject.getSelectedSiblings(a))&&a.length>0?u(a[a.length-1]):d;if(g.nextAll("li").length>0){c=f.clone(false).empty();c.append(g.nextAll());g.append(c)}e.length>0?e.after(d):f.before(d);if(a&&a.length>0)for(c=a.length-1;c>=0;--c)d.after(u(a[c]));f.contents("li").length===0&&f.remove();e.length>0&&e.contents().length===0&&e.remove();this.refreshSelection()}return false}return true},refreshSelection:function(){m.Selection.rangeObject.update();
m.Selection.rangeObject.select();m.Selection.updateSelection()},mergeAdjacentLists:function(a,b){for(var c=a.get(0),d;c.previousSibling&&c.previousSibling.nodeType===1&&this.isMergable(c.previousSibling,c,b);)c=c.previousSibling;for(a=u(c);c.nextSibling&&(c.nextSibling.nodeType===1&&this.isMergable(c.nextSibling,c,b)||c.nextSibling.nodeType===3&&u.trim(c.nextSibling.data).length===0);){d=u(c.nextSibling);c.nextSibling.nodeType==1&&d.contents().appendTo(a);d.remove()}},isMergable:function(a,b,c){return c?
a.nodeName.toLowerCase()=="ul"||a.nodeName.toLowerCase()=="ol":a.nodeName==b.nodeName}});d.commands.insertdefinitionlist={action:function(a,b){C.transformList("dl");if(b&&m.Selection.rangeObject){b.startContainer=m.Selection.rangeObject.startContainer;b.startOffset=m.Selection.rangeObject.startOffset;b.endContainer=m.Selection.rangeObject.endContainer;b.endOffset=m.Selection.rangeObject.endOffset}},indeterm:function(){},state:function(){for(i=0;i<rangeObject.markupEffectiveAtStart.length;i++){effectiveMarkup=
rangeObject.markupEffectiveAtStart[i];if(m.Selection.standardTagNameComparator(effectiveMarkup,u("<ul></ul>")))break;if(m.Selection.standardTagNameComparator(effectiveMarkup,u("<ol></ol>")))break;if(m.Selection.standardTagNameComparator(effectiveMarkup,u("<dl></dl>")))return true}return false}};d.commands.insertorderedlist={action:function(a,b){C.transformList("ol");if(b&&m.Selection.rangeObject){b.startContainer=m.Selection.rangeObject.startContainer;b.startOffset=m.Selection.rangeObject.startOffset;
b.endContainer=m.Selection.rangeObject.endContainer;b.endOffset=m.Selection.rangeObject.endOffset}},indeterm:function(){},state:function(){for(i=0;i<rangeObject.markupEffectiveAtStart.length;i++){effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(m.Selection.standardTagNameComparator(effectiveMarkup,u("<ul></ul>")))break;if(m.Selection.standardTagNameComparator(effectiveMarkup,u("<ol></ol>")))return true;if(m.Selection.standardTagNameComparator(effectiveMarkup,u("<dl></dl>")))break}return false}};
d.commands.insertunorderedlist={action:function(a,b){C.transformList("ul");if(b&&m.Selection.rangeObject){b.startContainer=m.Selection.rangeObject.startContainer;b.startOffset=m.Selection.rangeObject.startOffset;b.endContainer=m.Selection.rangeObject.endContainer;b.endOffset=m.Selection.rangeObject.endOffset}},indeterm:function(){},state:function(){for(i=0;i<rangeObject.markupEffectiveAtStart.length;i++){effectiveMarkup=rangeObject.markupEffectiveAtStart[i];if(m.Selection.standardTagNameComparator(effectiveMarkup,
u("<ul></ul>")))return true;if(m.Selection.standardTagNameComparator(effectiveMarkup,u("<ol></ol>")))break;if(m.Selection.standardTagNameComparator(effectiveMarkup,u("<dl></dl>")))break}return false}};d.commands.indent={action:function(a,b){C.indentList();if(b&&m.Selection.rangeObject){b.startContainer=m.Selection.rangeObject.startContainer;b.startOffset=m.Selection.rangeObject.startOffset;b.endContainer=m.Selection.rangeObject.endContainer;b.endOffset=m.Selection.rangeObject.endOffset}},indeterm:function(){},
state:function(){return false}};d.commands.outdent={action:function(a,b){C.outdentList();if(b&&m.Selection.rangeObject){b.startContainer=m.Selection.rangeObject.startContainer;b.startOffset=m.Selection.rangeObject.startOffset;b.endContainer=m.Selection.rangeObject.endContainer;b.endOffset=m.Selection.rangeObject.endOffset}},indeterm:function(){},state:function(){return false}};return C});define("image/nls/i18n",{root:{"size.natural":"Original size","button.addimg.tooltip":"add image ref","floatingmenu.tab.img":"Image",
"floatingmenu.tab.formatting":"Formatting","floatingmenu.tab.resize":"Resize","floatingmenu.tab.crop":"Crop","button.uploadimg.tooltip":"Upload img","button.uploadimg.label":"Upload","button.img.align.left.tooltip":"Left align","button.img.align.right.tooltip":"Right Align","button.img.align.none.tooltip":"No alignment","field.img.title.label":"Title","field.img.title.tooltip":"Title","field.img.label":"URL","field.img.tooltip":"Source","border ":"Add Border to Image","padding.increase ":"Increase Padding",
"padding.decrease ":"Decrease Padding","size.increase ":"Increase Size","size.decrease ":"Decrease Size",Resize:"Resize",Crop:"Crop",Reset:"Reset",Accept:"Accept",Cancel:"Cancel",height:"Height",width:"Width","button.toggle.tooltip":"Toggle keep aspect ratio","field.img.src.label":"Source","field.img.src.tooltip":"Source"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("image/image-floatingMenu","jquery util/class i18n!image/nls/i18n i18n!aloha/nls/i18n ui/ui ui/scopes ui/button ui/toggleButton ui/port-helper-attribute-field".split(" "),
function(m,e,a,j,d,b,f,l,g){return e.extend({_constructor:function(){},init:function(a){a.floatingMenuControl=this;this.plugin=a;b.createScope(a.name,"Aloha.empty");this._addUIInsertButton();this._addUIMetaButtons();this._addUIResetButton();this._addUIAlignButtons();this._addUIMarginButtons();this._addUICropButtons();this._addUIResizeButtons();this._addUIAspectRatioToggleButton()},_addUIAspectRatioToggleButton:function(){var b=this.plugin;this._imageCnrRatioButton=d.adopt("imageCnrRatio",l,{tooltip:a.t("button.toggle.tooltip"),
icon:"aloha-icon-cnr-ratio",scope:b.name,click:function(){b.toggleKeepAspectRatio()}});if(b.settings.fixedAspectRatio!==false){this._imageCnrRatioButton.setState(true);b.keepAspectRatio=true}},_addUIResetButton:function(){var b=this.plugin;this._imageCnrResetButton=d.adopt("imageCnrReset",f,{tooltip:a.t("Reset"),icon:"aloha-icon-cnr-reset",scope:b.name,click:function(){b.reset()}})},_addUIInsertButton:function(){var b=this.plugin;this._insertImageButton=d.adopt("insertImage",f,{tooltip:a.t("button.addimg.tooltip"),
icon:"aloha-button aloha-image-insert",scope:"Aloha.continuoustext",click:function(){b.insertImg()}})},_addUIMetaButtons:function(){var b=this.plugin;this.imgSrcField=new g({label:a.t("field.img.src.label"),labelClass:"aloha-image-input-label",tooltip:a.t("field.img.src.tooltip"),name:"imageSource",scope:b.name});this.imgSrcField.setTemplate("<span><b>{name}</b><br/>{url}</span>");this.imgSrcField.setObjectTypeFilter(b.objectTypeFilter);this.imgTitleField=new g({label:a.t("field.img.title.label"),
labelClass:"aloha-image-input-label",tooltip:a.t("field.img.title.tooltip"),name:"imageTitle",scope:b.name});this.imgTitleField.setObjectTypeFilter()},_addUIAlignButtons:function(){var b=this.plugin;this._imageAlignLeftButton=d.adopt("imageAlignLeft",f,{tooltip:a.t("button.img.align.left.tooltip"),icon:"aloha-img aloha-image-align-left",scope:b.name,click:function(){var a=m(b.getPluginFocus());a.add(a.parent()).css("float","left")}});this._imageAlignRightButton=d.adopt("imageAlignRight",f,{tooltip:a.t("button.img.align.right.tooltip"),
icon:"aloha-img aloha-image-align-right",scope:b.name,click:function(){var a=m(b.getPluginFocus());a.add(a.parent()).css("float","right")}});this._imageAlignNoneButton=d.adopt("imageAlignNone",f,{tooltip:a.t("button.img.align.none.tooltip"),icon:"aloha-img aloha-image-align-none",scope:b.name,click:function(){var a=m(b.getPluginFocus());a.add(a.parent()).css({"float":"none",display:"inline-block"})}})},_addUIMarginButtons:function(){var b=this.plugin;this._imageIncPaddingButton=d.adopt("imageIncPadding",
f,{tooltip:a.t("padding.increase"),icon:"aloha-img aloha-image-padding-increase",scope:b.name,click:function(){m(b.getPluginFocus()).increase("padding")}});this._imageDecPaddingButton=d.adopt("imageDecPadding",f,{tooltip:a.t("padding.decrease"),icon:"aloha-img aloha-image-padding-decrease",scope:b.name,click:function(){m(b.getPluginFocus()).decrease("padding")}})},_addUICropButtons:function(){var f=this.plugin;b.createScope("Aloha.img",["Aloha.global"]);this._imageCropButton=d.adopt("imageCropButton",
l,{tooltip:a.t("Crop"),icon:"aloha-icon-cnr-crop",scope:f.name,click:function(){this.getState()?f.crop():f.endCrop()}})},_addUIResizeButtons:function(){var b=this.plugin;this.imgResizeHeightField=new g({label:a.t("height"),labelClass:"aloha-image-input-label",name:"imageResizeHeight",width:50,scope:b.name});this.imgResizeHeightField.maxValue=b.settings.maxHeight;this.imgResizeHeightField.minValue=b.settings.minHeight;this.imgResizeWidthField=new g({label:a.t("width"),labelClass:"aloha-image-input-label",
name:"imageResizeWidth",width:50,scope:b.name});this.imgResizeWidthField.maxValue=b.settings.maxWidth;this.imgResizeWidthField.minValue=b.settings.minWidth},setScope:function(){b.setScope(this.plugin.name)},doLayout:function(){}})});define("image/vendor/jcrop/jquery.jcrop.min",["jquery"],function(m){(function(e){e.Jcrop=function(a,j){function d(a){return""+parseInt(a)+"px"}function b(a){a=e(a).offset();return[a.left,a.top]}function f(a){return[a.pageX-S[0],a.pageY-S[1]]}function l(a,b){return function(c){if(u.aspectRatio)switch(a){case "e":c[1]=
b.y+1;break;case "w":c[1]=b.y+1;break;case "n":c[0]=b.x+1;break;case "s":c[0]=b.x+1}else switch(a){case "e":c[1]=b.y2;break;case "w":c[1]=b.y2;break;case "n":c[0]=b.x2;break;case "s":c[0]=b.x2}X.setCurrent(c);U.update()}}function g(a){var b=a;ga.watchKeys();return function(a){X.moveOffset([a[0]-b[0],a[1]-b[1]]);b=a;U.update()}}function k(a){switch(a){case "n":return"sw";case "s":return"nw";case "e":return"nw";case "w":return"ne";case "ne":return"sw";case "nw":return"se";case "se":return"nw";case "sw":return"ne"}}
function c(a){return function(c){if(u.disabled||"move"==a&&!u.allowMove)return!1;P=!0;var d=f(c);S=b(C);V.setCursor("move"==a?a:a+"-resize");if("move"==a)V.activateHandlers(g(d),n);else{var d=X.getFixed(),e=k(a),j=X.getCorner(k(e));X.setPressed(X.getCorner(e));X.setCurrent(j);V.activateHandlers(l(a,d),n)}c.stopPropagation();c.preventDefault();return!1}}function m(a){return{x:parseInt(a.x*R),y:parseInt(a.y*L),x2:parseInt(a.x2*R),y2:parseInt(a.y2*L),w:parseInt(a.w*R),h:parseInt(a.h*L)}}function n(){var a=
X.getFixed();a.w>u.minSelect[0]&&a.h>u.minSelect[1]?(U.enableHandles(),U.done()):U.release();V.setCursor(u.allowSelect?"crosshair":"default")}function o(a){X.setCurrent(a);U.update()}function p(){var a=e("<div></div>").addClass(u.baseClass+"-tracker");e.browser.msie&&a.css({opacity:0,backgroundColor:"white"});return a}function r(a){t([a[0]/R,a[1]/L,a[2]/R,a[3]/L])}function t(a){X.setPressed([a[0],a[1]]);X.setCurrent([a[2],a[3]]);U.update()}function x(a){"object"!=typeof a&&(a={});u=e.extend(u,a);
"function"!==typeof u.onChange&&(u.onChange=function(){});"function"!==typeof u.onSelect&&(u.onSelect=function(){})}function v(a){u.allowResize?a?U.enableOnly():U.enableHandles():U.disableHandles();V.setCursor(u.allowSelect?"crosshair":"default");U.setCursor(u.allowMove?"move":"default");E.css("backgroundColor",u.bgColor);"setSelect"in u&&(r(j.setSelect),U.done(),delete u.setSelect);"trueSize"in u&&(R=u.trueSize[0]/F,L=u.trueSize[1]/A);G=u.maxSize[0]||0;N=u.maxSize[1]||0;B=u.minSize[0]||0;H=u.minSize[1]||
0;"outerImage"in u&&(C.attr("src",u.outerImage),delete u.outerImage);U.refresh()}"object"!==typeof a&&(a=e(a)[0]);"object"!==typeof j&&(j={});"trackDocument"in j||(j.trackDocument=e.browser.msie?!1:!0,e.browser.msie&&"8"==e.browser.version.split(".")[0]&&(j.trackDocument=!0));"keySupport"in j||(j.keySupport=e.browser.msie?!1:!0);var u={trackDocument:!1,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:0.6,borderOpacity:0.4,handleOpacity:0.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,
aspectRatio:0,keySupport:!0,cornerHandles:!0,sideHandles:!0,drawBorders:!0,dragEdges:!0,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,allowSelect:!0,allowMove:!0,allowResize:!0,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};x(j);var z=e(a),C=z.clone().removeAttr("id").css({position:"absolute"});C.width(z.width());C.height(z.height());z.after(C).hide();(function(a,b,c){var d=a.width(),f=a.height();if(d>b&&b>0){d=b;f=b/a.width()*a.height()}if(f>
c&&c>0){f=c;d=c/a.height()*a.width()}R=a.width()/d;L=a.height()/f;a.width(d).height(f)})(C,u.boxWidth,u.boxHeight);var F=C.width(),A=C.height(),E=e("<div />").width(F).height(A).addClass(u.baseClass+"-holder").css({position:"relative",backgroundColor:u.bgColor}).insertAfter(z).append(C);u.addClass&&E.addClass(u.addClass);var J=e("<img />").attr("src",C.attr("src")).css("position","absolute").width(F).height(A),K=e("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}).append(J),
O=e("<div />").width("100%").height("100%").css("zIndex",320),y=e("<div />").css({position:"absolute",zIndex:300}).insertBefore(C).append(K,O),Y=u.boundary,D=p().width(F+2*Y).height(A+2*Y).css({position:"absolute",top:d(-Y),left:d(-Y),zIndex:290}).mousedown(function(a){if(u.disabled||!u.allowSelect)return false;P=true;S=b(C);U.disableHandles();if("crosshair"!=W){V.setCursor("crosshair");W="crosshair"}var c=f(a);X.setPressed(c);V.activateHandlers(o,n);ga.watchKeys();U.update();a.stopPropagation();
a.preventDefault();return false}),G,N,B,H,R,L,S=b(C),P,W,la,ka,X=function(){function a(){if(!u.aspectRatio){var b=g-f,j=k-e;G&&Math.abs(b)>G&&(g=b>0?f+G:f-G);N&&Math.abs(j)>N&&(k=j>0?e+N:e-N);H&&Math.abs(j)<H&&(k=j>0?e+H:e-H);B&&Math.abs(b)<B&&(g=b>0?f+B:f-B);if(f<0){g=g-f;f=f-f}if(e<0){k=k-e;e=e-e}if(g<0){f=f-g;g=g-g}if(k<0){e=e-k;k=k-k}if(g>F){b=g-F;f=f-b;g=g-b}if(k>A){b=k-A;e=e-b;k=k-b}if(f>F){b=f-A;k=k-b;e=e-b}if(e>A){b=e-A;k=k-b;e=e-b}return d(c(f,e,g,k))}var b=u.aspectRatio,j=u.minSize[0]/R,
l=u.maxSize[0]/R,m=g-f,p=k-e,o=Math.abs(m),q=Math.abs(p);l==0&&(l=F*10);if(o/q<b){o=k;w=q*b;q=m<0?f-w:w+f;if(q<0){q=0;h=Math.abs((q-f)/b);o=p<0?e-h:h+e}else if(q>F){q=F;h=Math.abs((q-f)/b);o=p<0?e-h:h+e}}else{q=g;h=o/b;o=p<0?e-h:e+h;if(o<0){o=0;w=Math.abs((o-e)*b);q=m<0?f-w:w+f}else if(o>A){o=A;w=Math.abs(o-e)*b;q=m<0?f-w:w+f}}if(q>f){q-f<j?q=f+j:q-f>l&&(q=f+l);o=o>e?e+(q-f)/b:e-(q-f)/b}else if(q<f){f-q<j?q=f-j:f-q>l&&(q=f-l);o=o>e?e+(f-q)/b:e-(f-q)/b}if(q<0){f=f-q;q=0}else if(q>F){f=f-(q-F);q=F}if(o<
0){e=e-o;o=0}else if(o>A){e=e-(o-A);o=A}return last=d(c(f,e,q,o))}function b(a){a[0]<0&&(a[0]=0);a[1]<0&&(a[1]=0);a[0]>F&&(a[0]=F);a[1]>A&&(a[1]=A);return[a[0],a[1]]}function c(a,b,d,f){var e=a,g=d,k=b,j=f;if(d<a){e=d;g=a}if(f<b){k=f;j=b}return[Math.round(e),Math.round(k),Math.round(g),Math.round(j)]}function d(a){return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]}}var f=0,e=0,g=0,k=0,j,l;return{flipCoords:c,setPressed:function(a){a=b(a);g=f=a[0];k=e=a[1]},setCurrent:function(a){a=b(a);
j=a[0]-g;l=a[1]-k;g=a[0];k=a[1]},getOffset:function(){return[j,l]},moveOffset:function(a){var b=a[0],a=a[1];0>f+b&&(b=b-(b+f));0>e+a&&(a=a-(a+e));A<k+a&&(a=a+(A-(k+a)));F<g+b&&(b=b+(F-(g+b)));f=f+b;g=g+b;e=e+a;k=k+a},getCorner:function(b){var c=a();switch(b){case "ne":return[c.x2,c.y];case "nw":return[c.x,c.y];case "se":return[c.x2,c.y2];case "sw":return[c.x,c.y2]}},getFixed:a}}(),U=function(){function a(b){b=e("<div />").css({position:"absolute",opacity:u.borderOpacity}).addClass(u.baseClass+"-"+
b);K.append(b);return b}function b(a,d){var f=e("<div />").mousedown(c(a)).css({cursor:a+"-resize",position:"absolute",zIndex:d});O.append(f);return f}function f(a){var c=u.handleSize,e=E,g=c;switch(a){case "n":case "s":c="100%";break;case "e":case "w":g="100%"}return b(a,x++).width(c).height(g).css({top:d(-e+1),left:d(-e+1)})}function g(a){for(i in a)z[a[i]]=b(a[i],x++).css({top:d(-E+1),left:d(-E+1),opacity:u.handleOpacity}).addClass(u.baseClass+"-handle")}function k(a){var b=Math.round(a.h/2-E),
c=Math.round(a.w/2-E);west=-E+1;var f=a.w-E,a=a.h-E;"e"in z&&z.e.css({top:d(b),left:d(f)})&&z.w.css({top:d(b)})&&z.s.css({top:d(a),left:d(c)})&&z.n.css({left:d(c)});"ne"in z&&z.ne.css({left:d(f)})&&z.se.css({top:d(a),left:d(f)})&&z.sw.css({top:d(a)});"b"in z&&z.b.css({top:d(a)})&&z.r.css({left:d(f)})}function j(){var a=X.getFixed();X.setPressed([a.x,a.y]);X.setCurrent([a.x2,a.y2]);l()}function l(){if(v)return o()}function o(){var a=X.getFixed(),b=a.h;y.width(a.w).height(b);var b=a.x,c=a.y;J.css({top:d(-c),
left:d(-b)});y.css({top:d(c),left:d(b)});u.drawBorders&&A.right.css({left:d(a.w-1)})&&A.bottom.css({top:d(a.h-1)});F&&k(a);if(!v){y.show();C.css("opacity",u.bgOpacity);v=true}u.onChange(m(a))}function r(){F=true;if(u.allowResize){k(X.getFixed());O.show();return true}}function n(){F=false;O.hide()}function t(a){(la=a)?n():r()}var v,x=370,A={},z={},F=false,E=u.handleOffset;u.drawBorders&&(A={top:a("hline").css("top",e.browser.msie?d(-1):d(0)),bottom:a("hline"),left:a("vline"),right:a("vline")});if(u.dragEdges){z.t=
f("n");z.b=f("s");z.r=f("e");z.l=f("w")}u.sideHandles&&g(["n","s","e","w"]);u.cornerHandles&&g(["sw","nw","ne","se"]);var D=p().mousedown(c("move")).css({cursor:"move",position:"absolute",zIndex:360});K.append(D);n();return{updateVisible:l,update:o,release:function(){n();y.hide();C.css("opacity",1);v=false},refresh:j,setCursor:function(a){D.css("cursor",a)},enableHandles:r,enableOnly:function(){F=true},showHandles:function(){if(F){k(X.getFixed());O.show()}},disableHandles:n,animMode:t,done:function(){t(false);
j()}}}(),V=function(){function a(b){c(f(b))}function b(k){k.preventDefault();k.stopPropagation();if(P){P=false;d(f(k));u.onSelect(m(X.getFixed()));D.css({zIndex:290});g&&e(document).unbind("mousemove",a).unbind("mouseup",b);c=function(){};d=function(){}}return false}var c=function(){},d=function(){},g=u.trackDocument;g||D.mousemove(a).mouseup(b).mouseout(b);C.before(D);return{activateHandlers:function(f,k){P=true;c=f;d=k;D.css({zIndex:450});g&&e(document).mousemove(a).mouseup(b);return false},setCursor:function(a){D.css("cursor",
a)}}}(),ga=function(){function a(b,c,d){if(u.allowMove){X.moveOffset([c,d]);U.updateVisible()}b.preventDefault();b.stopPropagation()}var b=e('<input type="radio" />').css({position:"absolute",left:"-30px"}).keypress(function(b){if(b.ctrlKey)return true;var c=(ka=b.shiftKey?true:false)?10:1;switch(b.keyCode){case 37:a(b,-c,0);break;case 39:a(b,c,0);break;case 38:a(b,0,-c);break;case 40:a(b,0,c);break;case 27:U.release();break;case 9:return true}return nothing(b)}).blur(function(){b.hide()}),c=e("<div />").css({position:"absolute",
overflow:"hidden"}).append(b);u.keySupport&&c.insertBefore(C);return{watchKeys:function(){if(u.keySupport){b.show();b.focus()}}}}();O.hide();v(!0);Y={animateTo:function(a){var b=a[0]/R,c=a[1]/L,d=a[2]/R,f=a[3]/L;if(!la){var a=X.flipCoords(b,c,d,f),b=X.getFixed(),e=initcr=[b.x,b.y,b.x2,b.y2],g=u.animationDelay,k=e[0],j=e[1],d=e[2],f=e[3],l=a[0]-initcr[0],m=a[1]-initcr[1],o=a[2]-initcr[2],p=a[3]-initcr[3],q=0,r=u.swingSpeed;U.animMode(true);var n=function(){return function(){q=q+(100-q)/r;e[0]=k+q/
100*l;e[1]=j+q/100*m;e[2]=d+q/100*o;e[3]=f+q/100*p;q<100?window.setTimeout(n,g):U.done();q>=99.8&&(q=100);t(e)}}();window.setTimeout(n,g)}},setSelect:r,setOptions:function(a){x(a);v()},tellSelect:function(){return m(X.getFixed())},tellScaled:function(){return X.getFixed()},disable:function(){u.disabled=true;U.disableHandles();U.setCursor("default");V.setCursor("default")},enable:function(){u.disabled=false;v()},cancel:function(){U.done();V.activateHandlers(null,null)},focus:ga.watchKeys,getBounds:function(){return[F*
R,A*L]},getWidgetSize:function(){return[F,A]},release:U.release,destroy:function(){E.remove();z.show()}};z.data("Jcrop",Y);return Y};e.fn.Jcrop=function(a){function j(d){var b=a.useImg||d.src,f=new Image;f.onload=function(){e.Jcrop(d,a)};f.src=b}"object"!==typeof a&&(a={});this.each(function(){if(e(this).data("Jcrop")){if("api"==a)return e(this).data("Jcrop");e(this).data("Jcrop").setOptions(a)}else j(this)});return this}})(m)});define("image/vendor/mousewheel/mousewheel",["jquery"],function(m){(function(e){function a(a){var d=
a||window.event,j=[].slice.call(arguments,1),g=0,k=0,c=0,a=e.event.fix(d);a.type="mousewheel";d.wheelDelta&&(g=d.wheelDelta/120);d.detail&&(g=-d.detail/3);c=g;void 0!==d.axis&&d.axis===d.HORIZONTAL_AXIS&&(c=0,k=-1*g);void 0!==d.wheelDeltaY&&(c=d.wheelDeltaY/120);void 0!==d.wheelDeltaX&&(k=-1*d.wheelDeltaX/120);j.unshift(a,g,k,c);return(e.event.dispatch||e.event.handle).apply(this,j)}var j=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var d=j.length;d;)e.event.fixHooks[j[--d]]=e.event.mouseHooks;
e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var b=j.length;b;)this.addEventListener(j[--b],a,!1);else this.onmousewheel=a},teardown:function(){if(this.removeEventListener)for(var b=j.length;b;)this.removeEventListener(j[--b],a,!1);else this.onmousewheel=null}};e.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(m)});define("image/image-plugin","jquery PubSub aloha/core aloha/plugin aloha/content-rules util/dom image/image-floatingMenu i18n!image/nls/i18n jqueryui image/vendor/jcrop/jquery.jcrop.min image/vendor/mousewheel/mousewheel".split(" "),
function(m,e,a,j,d,b,f,l){var g=m,k=false,c=false,q=false,n={};String.prototype.toInteger=String.prototype.toInteger||function(){return parseInt((""+this).replace(/px$/,"")||0,10)};String.prototype.toFloat=String.prototype.toInteger||function(){return parseFloat((""+this).replace(/px$/,"")||0,10)};Number.prototype.toInteger=Number.prototype.toInteger||String.prototype.toInteger;Number.prototype.toFloat=Number.prototype.toFloat||String.prototype.toFloat;g.extend(true,g.fn,{increase:g.fn.increase||
function(a){var b=g(this),c,d;if(!b.length)return b;c=b.css(a).toFloat();d=Math.round((c||1)*1.2);c===d&&d++;b.css(a,d);return b},decrease:g.fn.decrease||function(a){var b=g(this),c,d;if(!b.length)return b;c=b.css(a).toFloat();d=Math.round((c||0)*0.8);c===d&&d>0&&d--;b.css(a,d);return b}});return j.create("image",{defaultSettings:{maxWidth:1600,minWidth:3,maxHeight:1200,minHeight:3,autoCorrectManualInput:true,fixedAspectRatio:false,autoResize:false,ui:{meta:true,crop:true,resizable:true},handles:"ne, se, sw, nw",
onCropped:function(b,c){a.Log.info("Default onCropped invoked",b,c)},onReset:function(b){a.Log.info("Default onReset invoked",b);return false},onResize:function(b){a.Log.info("Default onResize invoked",b)},onResized:function(b){a.Log.info("Default onResized invoked",b)}},_onCropped:function(a,b){m("body").trigger("aloha-image-cropped",[a,b]);this.keepAspectRatio&&(c=this.imageObj.width()/this.imageObj.height());this.onCropped(a,b)},_onReset:function(a){m("body").trigger("aloha-image-reset",a);return this.onReset(a)},
_onResize:function(a){m("body").trigger("aloha-image-resize",a);this._applyValuesToFields(a.width(),a.height());this.onResize(a)},_onResized:function(a){m("body").trigger("aloha-image-resized",a);this._applyValuesToFields(a.width(),a.height());this.onResized(a)},imageObj:null,jcAPI:null,keepAspectRatio:false,restoreProps:[],objectTypeFilter:[],init:function(){a.getPluginUrl("image");if(typeof this.settings.objectTypeFilter!="undefined")this.objectTypeFilter=this.settings.objectTypeFilter;this.config=
this.defaultSettings;this.settings=g.extend(true,this.defaultSettings,this.settings);if(typeof this.settings.fixedAspectRatio==="number"){c=q=this.settings.fixedAspectRatio;this.keepAspectRatio=true}else this.keepAspectRatio=this.settings.fixedAspectRatio===true?true:false;this.initializeUI();this.bindInteractions();this.subscribeEvents()},initializeUI:function(){this.ui=new f;this.ui.init(this)},bindInteractions:function(){var b=this;if(b.settings.ui.resizable)try{document.execCommand("enableObjectResizing",
false,false)}catch(c){a.Log.info(c,"Could not disable enableObjectResizing")}if(b.settings.ui.meta){b.ui.imgSrcField.addListener("keyup",function(){b.srcChange()});b.ui.imgSrcField.addListener("blur",function(){var a=g(b.ui.imgSrcField.getTargetObject());a.attr("src")===""&&a.remove()})}if(b.settings.onCropped&&typeof b.settings.onCropped==="function")b.onCropped=b.settings.onCropped;if(b.settings.onReset&&typeof b.settings.onReset==="function")b.onReset=b.settings.onReset;if(b.settings.onResized&&
typeof b.settings.onResized==="function")b.onResized=b.settings.onResized;if(b.settings.onResize&&typeof b.settings.onResize==="function")b.onResize=this.settings.onResize},subscribeEvents:function(){var c=this,f=this.settings;g("img").filter(f.globalselector).unbind();g("img").filter(f.globalselector).click(function(a){c.clickImage(a)});e.sub("aloha.editable.created",function(a){var b=false,f=c.getEditableConfig(a.editable.obj);f&&(g.inArray("img",f)>-1&&d.isAllowed(a.editable.obj[0],"img"))&&(b=
true);n[a.editable.getId()]=b});e.sub("aloha.editable.destroyed",function(a){delete n[a.editable.getId()]});a.bind("aloha-drop-files-in-editable",function(d,f){for(var e,k=f.filesObjs.length,j;--k>=0;){j=f.filesObjs[k];if(j.file.type.match(/image\//)){c.getEditableConfig(f.editable);e=g("<img/>");e.css({"max-width":that.maxWidth,"max-height":that.maxHeight});e.attr("id",j.id);typeof j.src==="undefined"?e.attr("src",j.data):e.attr("src",j.src);b.insertIntoDOM(e,f.range,a.activeEditable.obj)}}});a.bind("aloha-selection-changed",
function(b,d,f){if(f&&f.target&&c.settings.ui.resizable&&!g(f.target).hasClass("ui-resizable-handle")){c.endResize();c.imageObj=null;a.trigger("aloha-image-unselected")}if(a.activeEditable)if(n[a.activeEditable.getId()]){c.ui._insertImageButton.show();if(b=c.findImgMarkup(d)){c.ui._insertImageButton.show();c.ui.setScope();if(c.settings.ui.meta){c.ui.imgSrcField.setTargetObject(b,"src");c.ui.imgTitleField.setTargetObject(b,"title")}c.ui.imgSrcField.foreground();c.ui.imgSrcField.focus()}else c.settings.ui.meta&&
c.ui.imgSrcField.setTargetObject(null);c.ui.doLayout()}else c.ui._insertImageButton.hide()});a.bind("aloha-editable-created",function(b,d){try{document.execCommand("enableObjectResizing",false,false)}catch(f){a.Log.info(f,"Could not disable enableObjectResizing")}d.obj.delegate("img","mouseup",function(a){if(!k){c.clickImage(a);a.stopPropagation()}})});c._subscribeToResizeFieldEvents()},autoResize:function(a){g("#"+this.ui.imgResizeWidthField.getInputId());g("#"+this.ui.imgResizeHeightField.getInputId());
var b=this.imageObj.width(),c=this.imageObj.height(),d=false;if(b<this.settings.minWidth||b>this.settings.maxWidth||c<this.settings.minHeight||c>this.settings.maxHeight)d=true;var f=b/c;if(d){if(b>this.settings.maxWidth){b=this.settings.maxWidth;c=b/f}if(c>this.settings.maxHeight){c=this.settings.maxHeight;b=c*f}if(b<this.settings.minWidth&&a){b=this.settings.minWidth;c=b/f}if(c<this.settings.minHeight&&a){c=this.settings.minHeight;b=b*f}this._applyValuesToFields(b,c);this.setSizeByFieldValue();return true}return false},
toggleKeepAspectRatio:function(){this.keepAspectRatio=!this.keepAspectRatio;if(typeof this.jcAPI!=="undefined"&&this.jcAPI!==null){var a=this.jcAPI.tellSelect();q=this.keepAspectRatio?typeof this.settings.fixedAspectRatio!=="number"?a.w/a.h>0?a.w/a.h:this.imageObj.width()/this.imageObj.height():this.settings.fixedAspectRatio:false;this.jcAPI.setOptions(this.keepAspectRatio?{aspectRatio:q}:{aspectRatio:0});this.jcAPI.focus()}else{this.endResize();c=this.keepAspectRatio?typeof this.settings.fixedAspectRatio!==
"number"?this.imageObj.width()/this.imageObj.height():this.settings.fixedAspectRatio:false;this.startResize()}},_subscribeToResizeFieldEvents:function(){function a(b){var d=b.data.fieldName;if(b.keyCode===8||b.keyCode===46)c._updateFields(d,m(this).val(),false)&&(typeof c.jcAPI!=="undefined"&&c.jcAPI!==null?c.setCropAreaByFieldValue():c.setSizeByFieldValue());else if(b.keyCode<=57&&b.keyCode>=48||b.keyCode<=105&&b.keyCode>=96)c._updateFields(d,m(this).val(),false)&&(typeof c.jcAPI!=="undefined"&&
c.jcAPI!==null?c.setCropAreaByFieldValue():c.setSizeByFieldValue());else{var f=0;if(b.keyCode===38||b.keyCode===107)f=1;else if(b.keyCode===40||b.keyCode===109)f=-1;if(b.shiftKey||b.metaKey||b.ctrlKey)f=f*10;var e=false;f<0&&(e=true);f=parseInt(m(this).val(),10)+f;c._updateFields(d,f,e)&&(typeof c.jcAPI!=="undefined"&&c.jcAPI!==null?c.setCropAreaByFieldValue():c.setSizeByFieldValue())}b.preventDefault();return false}function b(a,d){var f=a.data.fieldName;if(a.shiftKey||a.metaKey||a.ctrlKey)d=d*10;
var e=parseInt(m(this).val(),10)+d,g=false;d<0&&(g=true);c._updateFields(f,e,g)&&(typeof c.jcAPI!=="undefined"&&c.jcAPI!==null?c.setCropAreaByFieldValue():c.setSizeByFieldValue());return false}var c=this,d=m("#"+c.ui.imgResizeHeightField.getInputId()),f={fieldName:"height",maxValue:c.ui.imgResizeHeightField.maxValue,minValue:c.ui.imgResizeHeightField.minValue};d.live("keyup",f,a);d.live("mousewheel",f,b);d=m("#"+c.ui.imgResizeWidthField.getInputId());f={fieldName:"width",maxValue:c.ui.imgResizeWidthField.maxValue,
minValue:c.ui.imgResizeWidthField.minValue};d.live("keyup",f,a);d.live("mousewheel",f,b)},setSize:function(a,b){this.imageObj.width(a);this.imageObj.height(b);var c=this.imageObj.closest(".Aloha_Image_Resize");c.height(b);c.width(a);this._onResize(this.imageObj);this._onResized(this.imageObj)},clickImage:function(b){this.endResize();b=this.imageObj=g(b.target);if(!b.hasClass("aloha-ui")){this.ui.setScope();b.closest(".aloha-editable");this.ui._imageCnrRatioButton.setState(this.keepAspectRatio);this.restoreProps.push({obj:this.imageObj,
src:this.imageObj.attr("src"),width:this.imageObj.width(),height:this.imageObj.height()});this._applyValuesToFields(this.imageObj.width(),this.imageObj.height());if(this.settings.ui.meta){this.ui.imgSrcField.setTargetObject(this.imageObj,"src");this.ui.imgTitleField.setTargetObject(this.imageObj,"title")}a.Selection.preventSelectionChanged();try{this.ui.imgSrcField.focus()}catch(d){}q=c=this.imageObj.width()/this.imageObj.height();this.settings.ui.resizable&&this.startResize();this.settings.autoResize&&
this.autoResize(true);a.Selection.preventSelectionChangedFlag=false;a.trigger("aloha-image-selected")}},findImgMarkup:function(b){var c,d;typeof b==="undefined"&&(b=a.Selection.getRangeObject());d=g(b.startContainer);try{if(a.activeEditable&&(typeof b.startContainer!=="undefined"&&typeof b.startContainer.childNodes!=="undefined"&&typeof b.startOffset!=="undefined"&&typeof b.startContainer.childNodes[b.startOffset]!=="undefined"&&b.startContainer.childNodes[b.startOffset].nodeName.toLowerCase()===
"img"&&b.startOffset+1===b.endOffset||d.hasClass("Aloha_Image_Resize"))){c=d.find("img")[0];if(!c.css)c.css="";if(!c.title)c.title="";if(!c.src)c.src="";return c}}catch(f){a.Log.debug(f,"Error finding img markup.")}return null},getPluginFocus:function(){return this.imageObj},_updateFields:function(a,b,d){var f=null,e=null,g=null,k=null,j=null,l=null,n=null,g=typeof this.jcAPI!=="undefined"&&this.jcAPI!==null?q?q:c:c;if(a=="width"){f=m("#"+this.ui.imgResizeWidthField.getInputId());e=m("#"+this.ui.imgResizeHeightField.getInputId());
g=1/g;k=this.settings.minWidth;j=this.settings.maxWidth;l=this.settings.minHeight;n=this.settings.maxHeight}else if(a=="height"){f=m("#"+this.ui.imgResizeHeightField.getInputId());e=m("#"+this.ui.imgResizeWidthField.getInputId());k=this.settings.minHeight;j=this.settings.maxHeight;l=this.settings.minWidth;n=this.settings.maxWidth}else return false;if(isNaN(b)){f.css("background-color","red");return false}f.val(b);a=true;if(b>j)if(this.settings.autoCorrectManualInput){f.val(j);b=f.val();f.css("background-color",
"");a=true}else{f.css("background-color","red");a=false}else if(b<k)if(d){f.val(k);b=f.val();a=true}else{this.settings.autoCorrectManualInput?f.css("background-color","wheat"):f.css("background-color","red");a=false}else{f.css("background-color","");a=true}k=true;if(this.keepAspectRatio){b=Math.round(b*g);if(b>n)if(this.settings.autoCorrectManualInput){e.val(n);f.val(e.val()/g);f.val();f.css("background-color","");e.css("background-color","");k=true}else{b.css("background-color","red");k=false}else if(b<
l)if(d){e.val(l);f.val(e.val()/g);f.val();a=true}else{if(this.settings.autoCorrectManualInput){e.val(b);e.css("background-color","wheat")}else e.css("background-color","red");k=false}else{e.val(b);e.css("background-color","");k=true}}e.val()<l&&(k=false);return a&&k?true:false},setSizeByFieldValue:function(){var a=this.ui.imgResizeWidthField.getValue(),b=this.ui.imgResizeHeightField.getValue();this.setSize(a,b)},_applyValuesToFields:function(a,b){this.ui.imgResizeWidthField.setValue(a);this.ui.imgResizeHeightField.setValue(b);
this.ui.imgResizeWidthField.getInputJQuery().css("background-color","");this.ui.imgResizeHeightField.getInputJQuery().css("background-color","")},setCropAreaByFieldValue:function(){var a=this.jcAPI.tellSelect(),b=parseInt(this.ui.imgResizeWidthField.getValue(),10),c=parseInt(this.ui.imgResizeHeightField.getValue(),10);this.jcAPI.setSelect([a.x,a.y,a.x+b,a.y+c]);this._onCropSelect();this.jcAPI.enable()},insertImg:function(){var c=a.Selection.getRangeObject(),d=this.getEditableConfig(a.activeEditable.obj),
f=a.getPluginUrl("image");if(c.isCollapsed()){d="max-width: "+d.maxWidth+"; max-height: "+d.maxHeight;f=g('<img style="'+d+'" src="'+f+'/img/blank.jpg" title="" />');b.insertIntoDOM(f,c,a.activeEditable.obj)}else a.Log.error("img cannot markup a selection")},srcChange:function(){this.imageObj.attr("src",this.ui.imgSrcField.getValue())},positionCropButtons:function(){var a=g(".jcrop-tracker:first"),b=a.offset(),c=b.top,b=b.left,d=a.height(),a=a.width(),f=g("#aloha-CropNResize-btns");c===0&&b===0&&
f.hide();c=parseInt(c+d+3,10);b=parseInt(b+a/2-f.width()/2+10,10);(0!=b||0!=c)&&f.offset({top:c,left:b})},initCropButtons:function(){var a=this,b;g("body").append('<div id="aloha-CropNResize-btns" display="none"><button class="cnr-crop-apply" title="'+l.t("Accept")+'"></button><button class="cnr-crop-cancel" title="'+l.t("Cancel")+'"></button></div>');b=g("#aloha-CropNResize-btns");b.find(".cnr-crop-apply").click(function(){a.acceptCrop()});b.find(".cnr-crop-cancel").click(function(){a.endCrop()});
this.interval=window.setInterval(function(){a.positionCropButtons()},10)},destroyCropButtons:function(){g("#aloha-CropNResize-btns").remove();window.clearInterval(this.interval)},_disableSelection:function(a){a.find("*").attr("unselectable","on").css({"-moz-user-select":"none","-webkit-user-select":"none","user-select":"none"})},crop:function(){var a=this,b=a.keepAspectRatio?c:false;this.ui._imageCropButton.setState(true);a.initCropButtons();a.settings.ui.resizable&&a.endResize();a.jcAPI=g.Jcrop(a.imageObj,
{onSelect:function(){a._onCropSelect();window.setTimeout(function(){a.ui.setScope()},10)},aspectRatio:b,minSize:[a.settings.minWidth,a.settings.minHeight]});a._disableSelection(m(".jcrop-holder"));a._disableSelection(m("#imageContainer"));a._disableSelection(m("#aloha-CropNResize-btns"));m("body").trigger("aloha-image-crop-start",[a.imageObj])},_onCropSelect:function(){g(".jcrop-handle").mousedown(function(){g("#aloha-CropNResize-btns").hide()});g(".jcrop-tracker").mousedown(function(){g("#aloha-CropNResize-btns").hide()});
if(typeof this.jcAPI!=="undefined"&&this.jcAPI!==null){this.positionCropButtons();var a=this.jcAPI.tellSelect();a.h>0&&a.w>0&&g("#aloha-CropNResize-btns").fadeIn("slow");this._applyValuesToFields(a.w,a.h)}},endCrop:function(){if(this.jcAPI){this.jcAPI.destroy();this.jcAPI=null}this.destroyCropButtons();this.ui._imageCropButton.setState(false);this.settings.ui.resizable&&this.startResize();m("body").trigger("aloha-image-crop-stop",[this.imageObj]);this._applyValuesToFields(this.imageObj.width(),this.imageObj.height())},
acceptCrop:function(){this._onCropped(this.imageObj,this.jcAPI.tellSelect());this.endCrop()},startResize:function(){var a=this,b=this.imageObj,d=a.keepAspectRatio?c:false,b=this.imageObj.css({height:this.imageObj.height(),width:this.imageObj.width(),position:"relative","max-height":"","max-width":""});b.resizable({maxHeight:a.settings.maxHeight,minHeight:a.settings.minHeight,maxWidth:a.settings.maxWidth,minWidth:a.settings.minWidth,aspectRatio:d,handles:a.settings.handles,grid:a.settings.grid,resize:function(){k=
true;a._onResize(a.imageObj)},stop:function(b){k=false;a._onResized(a.imageObj);this.enableCrop&&window.setTimeout(function(){a.ui.setScope();that.done(b)},10)}});b.css("display","inline-block");g(".ui-wrapper").attr("contentEditable",false).addClass("aloha-image-box-active Aloha_Image_Resize aloha").css({position:"relative",display:"inline-block","float":a.imageObj.css("float")}).bind("resizestart",function(a){a.preventDefault()}).bind("mouseup",function(a){a.originalEvent.stopSelectionUpdate=true})},
endResize:function(){this.imageObj&&this.imageObj.closest(".aloha-editable");this.imageObj&&this.imageObj.is(":ui-resizable")&&this.imageObj.resizable("destroy").css({top:0,left:0})},resetSize:function(){var a=this,b=new Image;b.onload=function(){var c=a.getPluginFocus();a.settings.ui.resizable&&a.endResize();g(c).add(c.parent()).css({width:b.width+"px",height:b.height+"px","max-width":"","max-height":""});a.settings.ui.resizable&&a.resize()};b.src=a.getPluginFocus().attr("src")},reset:function(){this.settings.ui.crop&&
this.endCrop();this.settings.ui.resizable&&this.endResize();if(!this._onReset(this.imageObj))for(var a=0;a<this.restoreProps.length;a++)if(this.imageObj.get(0)===this.restoreProps[a].obj.get(0)){this.imageObj.attr("src",this.restoreProps[a].src);this.imageObj.width(this.restoreProps[a].width);this.imageObj.height(this.restoreProps[a].height);break}this._applyValuesToFields(this.imageObj.width(),this.imageObj.height())}})});define("highlighteditables/highlighteditables-plugin",["aloha","jquery","aloha/plugin",
"aloha/ephemera"],function(m,e,a,j){var d=window.GENTICS;return a.create("highlighteditables",{config:["highlight"],init:function(){var a=this,f;j.classes("aloha-editable-highlight");d.Utils.Position.addMouseMoveCallback(function(){var d,e;for(d=0;d<m.editables.length;d++)e=m.editables[d],f=a.getEditableConfig(e.obj),!m.activeEditable&&(!e.isDisabled()&&"highlight"==f)&&e.obj.addClass("aloha-editable-highlight")});d.Utils.Position.addMouseStopCallback(function(){a.fade()});m.bind("aloha-editable-activated",
function(){a.fade()})},fade:function(){var a,d,j=function(){e(this).css("outline","")};for(a=0;a<m.editables.length;a++)d=m.editables[a].obj,d.hasClass("aloha-editable-highlight")&&d.css("outline",d.css("outlineColor")+" "+d.css("outlineStyle")+" 5px").removeClass("aloha-editable-highlight").animate({outlineWidth:"0px"},300,"swing",j)}})});define("util/dom-to-xhtml",["util/dom2","util/browser","aloha/ephemera","aloha/console"],function(m,e,a,j){function d(a){return a.replace(/&/g,"&amp;").replace(/</g,
"&lt;").replace(/>/g,"&gt;")}function b(b,c){var f=m.attrs(b),g="",k,j,l;if(e.ie7)for(l in q)if(q.hasOwnProperty(l)&&b[l]){k=0;for(j=f.length;k<j;k++)if(l===f[k][0].toLowerCase()){f.splice(k,1);break}f.push([l,l])}k=0;for(j=f.length;k<j;k++){var n=f[k];l=n[0].toLowerCase();n=n[1];if(!c||!a.isAttrEphemeral(b,l,c.attrMap||{},c.attrRxs||{})){var C=q[l];if(C||""!==n)g+=" "+l+'="'+d(C?l:n).replace(/"/g,"&quot;")+'"'}}return g}function f(a){var b=a.nodeName,c=n[b];if(null!=c)return c;for(var d="/"+a.nodeName,
a=a.nextSibling,c=!1;null!=a;){if(d==a.nodeName){c=!0;break}a=a.nextSibling}return n[b]=c}function l(a,b,c,d,e){for(;null!=b;)if(1===b.nodeType&&c&&"/"+a.nodeName==b.nodeName){b=b.nextSibling;break}else 1===b.nodeType&&f(b)?b=g(b,b.nextSibling,!0,d,e):(k(b,d,e),b=b.nextSibling);return b}function g(a,d,f,e,g){var k=a.nodeName.toLowerCase();a.scopeName&&("HTML"!=a.scopeName&&-1===k.indexOf(":"))&&(k=a.scopeName.toLowerCase()+":"+k);!f&&null==d&&c[k]?g.push("<"+k+b(a,e)+"/>"):(g.push("<"+k+b(a,e)+">"),
d=l(a,d,f,e,g),g.push("</"+k+">"));return d}function k(a,b,c){1===a.nodeType?g(a,a.firstChild,f(a),b,c):3===a.nodeType?c.push(d(a.nodeValue)):8===a.nodeType?c.push("<\!--"+a.nodeValue+"--\>"):j.warn("Unknown node type encountered during serialization, ignoring it: type="+a.nodeType+" name="+a.nodeName+" value="+a.nodeValue)}var c={area:!0,base:!0,basefont:!0,br:!0,col:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,link:!0,meta:!0,param:!0,embed:!0},q={checked:!0,compact:!0,declare:!0,defer:!0,disabled:!0,
ismap:!0,multiple:!0,nohref:!0,noresize:!0,noshade:!0,nowrap:!0,readonly:!0,selected:!0},n={DIV:!1,SPAN:!1,UL:!1,OL:!1,LI:!1,TABLE:!1,TR:!1,TD:!1,TH:!1,I:!1,B:!1,EM:!1,STRONG:!1,A:!1,P:!1};return{contentsToXhtml:function(a,b){var c=[];l(a,a.firstChild,!1,b,c);return c.join("")},nodeToXhtml:function(a,b){var c=[];k(a,b,c);return c.join("")}}});define("dom-to-xhtml/dom-to-xhtml-plugin",["aloha","jquery","aloha/plugin","aloha/ephemera","util/dom-to-xhtml"],function(m,e,a,j,d){return a.create("dom-to-xhtml",
{init:function(){var a=this;m.Editable.setContentSerializer(function(f){return!a.settings.editables&&!a.settings.config?d.contentsToXhtml(f):a.settings.editables&&"dom-to-xhtml"==a.settings.editables["#"+e(f).attr("id")]?d.contentsToXhtml(f,j.ephemera()):a.settings.config&&"dom-to-xhtml"==a.settings.config&&!a.settings.editables["#"+e(f).attr("id")]?d.contentsToXhtml(f,j.ephemera()):e(f).html()})}})});define("contenthandler/contenthandler-utils",["jquery","util/html"],function(m,e){return{wrapContent:function(a){return"string"===
typeof a?m("<div>"+a+"</div>"):a instanceof m?m("<div>").append(a):null},isProppedParagraph:function(a){a=m.trim(a);if(!a)return!1;var a=m("<div>"+a+"</div>")[0],j=a.firstChild;if(!(j===a.lastChild&&"P"===j.nodeName))return!1;a=m(j.childNodes).filter(function(a,b){return e.isRenderedNode(b)});return 1===a.length&&"BR"===a[0].nodeName}}});define("contenthandler/wordcontenthandler","jquery aloha aloha/contenthandlermanager contenthandler/contenthandler-utils util/dom2 util/html".split(" "),function(m,
e,a,j,d,b){function f(a){switch(a[0].nodeName.toLowerCase()){case "table":return 0===a.find("tbody,tr").length;case "tbody":return 0===a.find("tr").length;case "tr":return 0===a.find("td,th").length;default:return""===m.trim(a.text())}}function l(a){if(0===a.length||!c.test(a[0].outerHTML))return false;var a=a.find("*"),b,d;for(b=0;b<a.length;b++){if((d=a.eq(b).attr("style"))&&d.toLowerCase().indexOf("mso")>=0)return true;if((d=a.eq(b).attr("class"))&&d.toLowerCase().indexOf("mso")>=0)return true}return false}
function g(a){a.find("p.MsoTitle").each(function(){e.Markup.transformDomObject(m(this),"h1")});a.find("p.MsoSubtitle").each(function(){e.Markup.transformDomObject(m(this),"h2")})}var k=m,c=/mso/i,q=/^(([0-9]{1,3}\.)|([0-9]{1,3}\))|([a-zA-Z]{1,5}\.)|([a-zA-Z]{1,5}\))|(.))$/,n=/^([0-9]{1,3}\.)|([0-9]{1,3}\)|([a-zA-Z]{1,5}\.)|([a-zA-Z]{1,5}\)))$/,o=a.createHandler({handleContent:function(a){var b=j.wrapContent(a);if(!b)return a;l(b)&&this.transformWordContent(b);return b.html()},isOrderedList:function(a){return a.css("fontFamily")==
"Wingdings"||a.css("fontFamily")=="Symbol"?false:m.trim(a.text()).match(/^([0-9]{1,3}\.)|([0-9]{1,3}\)|([a-zA-Z]{1,5}\.)|([a-zA-Z]{1,5}\)))$/)?true:false},checkElementIsEnclosedInListsComment:function(a,b){for(;a&&a!==b;){for(var c=a;(c=c.previousSibling)!==null;)if(Node.COMMENT_NODE===c.nodeType&&m.trim(c.textContent)==="[if !supportLists]")return true;a=a.parentNode}return false},detectListType:function(a){var b=false,c=true,d=k(a.find("span.aloha-list-bullet"));d.length===0&&(d=a.find("span").filter(function(){var a=
m(this).attr("style")||"";return a.indexOf("mso-list: Ignore")>=0||a.indexOf("mso-list:Ignore")>=0}));if(d.length===0){d=a.find("span").eq(0);d.length>0&&(c=o.checkElementIsEnclosedInListsComment(d.get(0),a.get(0)))}if(m.trim(d.text()).length!==0){b=this.isOrderedList(d);c&&d.remove()}else{d.remove();var f=function(){var a=k(this);if(q.test(m.trim(a.text()))){b=n.test(m.trim(a.text()));a.remove();return false}a.contents().each(f)};a.contents().each(f)}return b},transformListsFromWord:function(a){var b=
this,c,d;d=a.find("p.MsoListParagraphCxSpFirst,p.MsoListParagraphCxSpMiddle,p.MsoListParagraphCxSpLast,p.MsoListParagraph,p span");d.each(function(){var a=k(this),b=a.css("font-family")||"",c=a.css("mso-list")||"",d=a.attr("style")||"";a.hasClass("MsoListParagraphCxSpFirst")||a.hasClass("MsoListParagraph")?a.addClass("aloha-list-element"):b.indexOf("Symbol")>=0?a.closest("p").addClass("aloha-list-element"):b.indexOf("Wingdings")>=0?a.closest("p").addClass("aloha-list-element"):c!==""?a.closest("p").addClass("aloha-list-element"):
d.indexOf("mso-list")>=0&&a.closest("p").addClass("aloha-list-element")});a.find("p span span span").each(function(){var a=k(this),b;if(k.trim(a.text()).replace(/&nbsp;/g,"").length===0){b=k.trim(a.parent().parent().text()).replace(/&nbsp;/g,"");if(q.test(b)){a.closest("p").addClass("aloha-list-element");a.parent().parent().addClass("aloha-list-bullet")}}});d="p.aloha-list-element";c=":not("+d+", font)";d=a.find(d);d.length>0&&d.each(function(){var a=k(this),d,f,e,g,j,l,m;a.removeClass("aloha-list-element");
a.find("font").each(function(){k(this).contents().unwrap()});m=[];l=parseFloat(a.css("marginLeft"));isNaN(l)&&(l=0);j=[];g=a.nextUntil(c);e=b.detectListType(a);f=k(e?"<ol></ol>":"<ul></ul>");j.push(f);d=k("<li></li>");f.append(d);a.contents().appendTo(d);a.replaceWith(f);g.each(function(){var a=k(this),c,g;if(!a.is("font")){a.find("font").each(function(){k(this).contents().unwrap()});c=parseFloat(a.css("marginLeft"));isNaN(c)&&(c=0);e=b.detectListType(a);if(c>l){g=k(e?"<ol></ol>":"<ul></ul>");f.children(":last").append(g);
f=g;j.push(f);m.push(c);l=c}else if(c<l&&m.length>0){for(;m.length>0&&m[m.length-1]>c;){m.pop();j.pop()}f=j[j.length-1];l=c}d=k("<li></li>");f.append(d);a.contents().appendTo(d);a.remove()}})})},removeParagraphNumbering:function(a){a=a.find("h1,h2,h3,h4,h5,h6");a.length>0&&a.each(function(){var a=k(this),b=a.find("span"),a=a.find("a");b.each(function(){k.trim(k(this).text()).match(/^([\.\(]?[\d\D][\.\(]?){1,4}$/)&&k(this).remove()});a.each(function(){typeof k(this).attr("href")==="undefined"&&k(this).contents().unwrap()})})},
transformToc:function(a){a.find("[class*=MsoToc]").each(function(){var a=k(this),b=a.find("span"),a=a.find("a");b.each(function(){k(this).attr("style")&&k(this).attr("style").search("mso-hide")>-1&&k(this).remove();k(this).contents().unwrap()});a.each(function(){k(this).contents().unwrap()})})},transformWordContent:function(a){this.transformToc(a);this.removeParagraphNumbering(a);this.transformListsFromWord(a);g(a);var c=a.find("*"),d,e,k,j;k=0;for(j=c.length;k<j;k++){e=c.eq(k);d=e[0].nodeName.toLowerCase();
if("div"===d||"span"===d)e.contents().unwrap();else if("ul"===d||"ol"===d){if(e.parent().is("ul,ol")){d=e.prev("li");d.length>0&&d.append(e)}}else"td"!==d&&f(e)&&e.contents().unwrap()}c=a[0].childNodes;e=0;for(k=c.length;e<k;e++)c[e]&&b.isUnrenderedNode(c[e])&&a[0].removeChild(c[e])}});return o});define("contenthandler/genericcontenthandler",["jquery","aloha","aloha/contenthandlermanager","contenthandler/contenthandler-utils"],function(m,e,a,j){function d(a){a.find("table").removeAttr("cellpadding").removeAttr("cellspacing").removeAttr("border").removeAttr("border-top").removeAttr("border-bottom").removeAttr("border-left").removeAttr("border-right");
a.find("td").each(function(){j.isProppedParagraph(this.innerHTML)&&(this.innerHTML="&nbsp;");var a=m(">p",this);1===a.length&&a.contents().unwrap()});a.find("table,th,td,tr").removeAttr("width").removeAttr("height").removeAttr("valign");a.find("colgroup").remove()}function b(a){a.contents().each(function(a,d){3===d.nodeType?d.nodeValue=d.nodeValue.replace(/[\r\n]+/gm," "):b(m(d))})}var f=["strong","em","s","u","strike"];return a.createHandler({handleContent:function(a){var f=j.wrapContent(a);if(!f)return a;
if(f.find(".aloha-block").length)return f.html();d(f);this.cleanLists(f);this.removeComments(f);this.unwrapTags(f);this.removeStyles(f);this.removeNamespacedElements(f);a=!0;e.settings.contentHandler&&(e.settings.contentHandler.handler&&e.settings.contentHandler.handler.generic&&"undefinded"!==typeof e.settings.contentHandler.handler.generic.transformFormattings&&!e.settings.contentHandler.handler.generic.transformFormattings)&&(a=!1);a&&this.transformFormattings(f);b(f);return f.html()},cleanLists:function(a){a.find("ul,ol").find(">:not(li)").remove();
a.find("li").each(function(){var a=m(this),b=a.children();1===b.length&&b.is("p")&&(b.contents().appendTo(a),b.remove())})},transformFormattings:function(a){var b=[],d;for(d=0;d<f.length;d++)(!e.settings.contentHandler||!e.settings.contentHandler.allows||!(e.settings.contentHandler.allows.elements&&-1!==m.inArray(f[d].toLowerCase(),e.settings.contentHandler.allows.elements)))&&b.push(f[d]);a.find(b.join(",")).each(function(){"STRONG"===this.nodeName?e.Markup.transformDomObject(m(this),"b"):"EM"===
this.nodeName?e.Markup.transformDomObject(m(this),"i"):"S"===this.nodeName||"STRIKE"==this.nodeName?e.Markup.transformDomObject(m(this),"del"):"U"===this.nodeName&&m(this).contents().unwrap()})},transformLinks:function(a){a.find("a").each(function(){"undefined"===typeof m(this).attr("href")&&m(this).contents().unwrap()})},removeComments:function(a){var b=this;a.contents().each(function(){8===this.nodeType?m(this).remove():b.removeComments(m(this))})},unwrapTags:function(a){a.find("span,font,div").not(".aloha-wai-lang").each(function(){"DIV"==
this.nodeName?"<br>"===this.innerHTML?m(this).contents().unwrap():m(e.Markup.transformDomObject(m(this),"p").append("<br>")).contents().unwrap():m(this).contents().unwrap()})},removeStyles:function(a){var b=this;a.children("style").filter(function(){return"false"!==this.contentEditable}).remove();a.children().filter(function(){return"false"!==this.contentEditable}).each(function(){m(this).removeAttr("style").removeClass();b.removeStyles(m(this))})},removeNamespacedElements:function(a){a.find("*").each(function(){var a=
this.prefix?this.prefix:this.scopeName?this.scopeName:void 0;if(a&&"HTML"!==a||0<=this.nodeName.indexOf(":")){var a=m(this),b=a.contents();b.length?b.unwrap():a.remove()}})}})});Ga.REGEX_PROTOCOL=/^([A-Za-z0-9\+\-\.\&\;\*\s]*?)(?:\:|&*0*58|&*x0*3a)/i;Ga.RELATIVE="__relative__";Ga.prototype.clean_node=function(m){function e(a,b){var d,e=b.length;for(d=0;d<e;d++)if(b[d]===a)return d;return-1}function a(){var a=[],b={},d,e=arguments.length,c;for(d=0;d<e;d++)if((c=arguments[d])&&c.length)for(var j=0,
m=c.length;j<m;j++)b[c[j]]||(b[c[j]]=!0,a.push(c[j]));return a}function j(b){var d,g,k=this.filters.length;for(g=0;g<k;g++)if(!this.filters[g](b)){d=b.cloneNode(!0);this.current_element.appendChild(d);return}switch(b.nodeType){case 1:var c,m,n,o,p,r;g=b;c=[];b=g;m=!1;var t;n=this.transformers.length;for(t=0;t<n;t++)if(k=this.transformers[t]({allowed_elements:this.allowed_elements,config:this.config,node:g,node_name:g.nodeName.toLowerCase(),whitelist_nodes:this.whitelist_nodes,dom:this.dom}),null!=
k)if("object"==typeof k){if(k.whitelist_nodes&&k.whitelist_nodes instanceof Array){o=k.whitelist_nodes.length;for(m=0;m<o;m++)-1==e(k.whitelist_nodes[m],this.whitelist_nodes)&&this.whitelist_nodes.push(k.whitelist_nodes[m])}m=k.whitelist?!0:!1;k.attr_whitelist&&(c=a(c,k.attr_whitelist));b=k.node?k.node:b}else throw Error("transformer output must be an object or null");t=Aloha.browser.msie&&"7.0"===Aloha.browser.version;g=b;k=g.nodeName.toLowerCase();b=this.current_element;if(this.allowed_elements[k]||
m){this.current_element=this.dom.createElement(g.nodeName);b.appendChild(this.current_element);n=a(this.config.attributes[k],this.config.attributes.__ALL__,c);m=n.length;for(c=0;c<m;c++)if(d=n[c],o=g.attributes[d])p=!0,this.config.protocols[k]&&this.config.protocols[k][d]&&(p=this.config.protocols[k][d],p=(r=o.nodeValue.toLowerCase().match(Ga.REGEX_PROTOCOL))?-1!=e(r[1],p):-1!=e(Ga.RELATIVE,p)),p&&(!t||t&&"style"!==d)&&this.current_element.setAttribute(d,o.nodeValue);if(this.config.add_attributes[k])for(d in this.config.add_attributes[k])(!t||
t&&"style"!==d)&&this.current_element.setAttribute(d,this.config.add_attributes[k][d])}else if(-1!=e(g,this.whitelist_nodes)){this.current_element=g.cloneNode(!0);for(d=this.current_element.childNodes.length;0<d;)this.current_element.removeChild(this.current_element.firstChild);b.appendChild(this.current_element)}if(!this.config.remove_all_contents&&!this.config.remove_element_contents[k]){d=g.childNodes;m=d.length;for(c=0;c<m;c++)j.call(this,d[c])}this.current_element.normalize&&this.current_element.normalize();
this.current_element=b;break;case 3:d=b.cloneNode(!1);this.current_element.appendChild(d);break;case 5:d=b.cloneNode(!1);this.current_element.appendChild(d);break;case 8:this.config.allow_comments&&(d=b.cloneNode(!1),this.current_element.appendChild(d))}}var d=this.dom.createDocumentFragment();this.current_element=d;this.whitelist_nodes=[];var m=m.childNodes,b;b=0;for(len=m.length;b<len;b++)j.call(this,m[b]);d.normalize&&d.normalize();return d};define("vendor/sanitize",function(){});define("contenthandler/sanitizecontenthandler",
"aloha/core jquery aloha/contenthandlermanager aloha/plugin aloha/console vendor/sanitize".split(" "),function(m,e,a){function j(a){var f=["restricted","basic","relaxed"],j=m.defaults.supports;if(m.settings.contentHandler.allows)j=m.settings.contentHandler.allows;if(typeof m.settings.contentHandler.sanitize==="string"&&e.inArray(m.settings.contentHandler.sanitize,f)>-1)j=m.defaults.sanitize[m.settings.contentHandler.sanitize];else if(typeof m.settings.contentHandler.sanitize==="object")j=m.settings.contentHandler.sanitize;
else if(!j)j=m.defaults.sanitize.relaxed;a&&(j=a);j.filters=[function(a){return a.contentEditable!="false"}];d=new Ga(j,e)}var d;if(!m.defaults.sanitize)m.defaults.sanitize={};m.defaults.sanitize.restricted={elements:["b","em","i","strong","u","del","p","span","div","br"]};m.defaults.sanitize.basic={elements:["a","abbr","b","blockquote","br","cite","code","dd","del","dl","dt","em","i","li","ol","p","pre","q","small","strike","strong","sub","sup","u","ul"],attributes:{a:["href"],blockquote:["cite"],
q:["cite"],abbr:["title"]},protocols:{a:{href:["ftp","http","https","mailto","__relative__"]},blockquote:{cite:["http","https","__relative__"]},q:{cite:["http","https","__relative__"]}}};m.defaults.sanitize.relaxed={elements:["a","abbr","b","blockquote","br","caption","cite","code","col","colgroup","dd","del","dl","dt","em","h1","h2","h3","h4","h5","h6","i","img","li","ol","p","pre","q","small","strike","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul","span","hr","object",
"div"],attributes:{a:["href","title","id","class","target","data-gentics-aloha-repository","data-gentics-aloha-object-id"],div:["id","class","style"],abbr:["title"],blockquote:["cite"],br:["class"],col:["span","width"],colgroup:["span","width"],img:["align","alt","height","src","title","width","class","data-caption","data-align","data-width","data-original-image"],ol:["start","type"],p:["class","style","id"],q:["cite"],table:["summary","width"],td:["abbr","axis","colSpan","rowSpan","colspan","rowspan",
"width"],th:["abbr","axis","colSpan","rowSpan","colspan","rowspan","scope","width"],ul:["type"],span:["class","style","lang","xml:lang","role"]},protocols:{a:{href:["ftp","http","https","mailto","__relative__"]},blockquote:{cite:["http","https","__relative__"]},img:{src:["http","https","__relative__"]},q:{cite:["http","https","__relative__"]}}};return a.createHandler({handleContent:function(a,f,l){if(!l)return a;var g,k;if(m.settings.contentHandler&&m.settings.contentHandler.handler&&m.settings.contentHandler.handler.sanitize){if(m.settings.contentHandler.handler.sanitize)k=
m.settings.contentHandler.handler.sanitize;f=k["#"+l.getId()];l=l.obj.attr("class");if(typeof f!=="undefined")g=k;else if(typeof l!=="undefined"){l=l.split(" ");for(f=0;f<l.length;f++)typeof k["."+l[f]]!=="undefined"&&(g=k["."+l[f]])}}(typeof d==="undefined"||typeof g!=="undefined")&&j(g);typeof a==="string"?a=e("<div>"+a+"</div>").get(0):a instanceof e&&(a=e("<div>").append(a).get(0));return e("<div>").append(d.clean_node(a)).html()}})});define("contenthandler/blockelementcontenthandler","jquery aloha/core aloha/contenthandlermanager contenthandler/contenthandler-utils util/functions util/html util/arrays".split(" "),
function(m,e,a,j,d,b,f){function l(a,c){var d=b.findNodeRight(c.lastChild,p);d&&"br"===d.nodeName.toLowerCase()&&m(d).remove()}function g(a,b){var c=m(b);c.filter(n).filter(":empty").remove();if(m.browser.msie){c.filter("br.aloha-end-br").remove();c.filter(q).each(l)}c.children(o).each(g)}function k(a,b){var c=m(b);c.filter(n).append("​");c.children(o).each(k)}function c(a,b){var d=m(b);if(m.browser.msie){d.filter(n).filter(":empty").append("<br/>");d.children(o).each(c)}}var q=b.BLOCKLEVEL_ELEMENTS.join(),
n=f.subtract(b.BLOCKLEVEL_ELEMENTS,b.VOID_ELEMENTS).join(),o=":not(.aloha-block)",p=d.complement(b.isIgnorableWhitespace);return a.createHandler({handleContent:function(a,b){if(!b)return a;var d=j.wrapContent(a);if(!d)return a;switch(b.command){case "initEditable":d.children(o).each(g);m.browser.msie&&m.browser.version<=7&&d.children(o).each(k);break;case "getContents":d.children(o).each(c)}return d.html()}})});define("contenthandler/contenthandler-plugin","jquery aloha/plugin aloha/contenthandlermanager contenthandler/wordcontenthandler contenthandler/genericcontenthandler contenthandler/sanitizecontenthandler contenthandler/blockelementcontenthandler".split(" "),
function(m,e,a,j,d,b,f){var l={word:j,generic:d,sanitize:b,blockelement:f};return e.create("contenthandler",{init:function(){for(var b in l)l.hasOwnProperty(b)&&a.register(b,l[b])}})});define("characterpicker/nls/i18n",{root:{"button.addcharacter.tooltip":"pick special characters"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("characterpicker/characterpicker-plugin","aloha jquery aloha/plugin ui/ui ui/button ui/floating PubSub i18n!characterpicker/nls/i18n".split(" "),function(m,
e,a,j,d,b,f,l){function g(a){a.$element.click(function(a){a.stopPropagation()});e("body").click(function(b){a._overlayActive&&!(b.target===a.$element[0]||e(b.target).is(".aloha-icon-characterpicker")||e(b.target).find(".aloha-icon-characterpicker").length)&&a.hide()})}function k(a){x.keyup(function(b){27===b.keyCode&&a.$element.css("display")==="table"&&a.hide()})}function c(a,b,c){var d=function(a){return a.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()})};(a=a.currentStyle?a.currentStyle[d(c)]:
document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null).getPropertyValue(c):a.style[d(c)])&&b.css(c,a)}function q(a,b){var c={13:function(c){a.hide();b(c.text())},37:function(a){var b=a.prev();if(b.length){b.addClass("focused");a.removeClass("focused")}},38:function(a){var b=a.parent().prev();b.length&&e(b.children()[a.index()]).addClass("focused").length&&a.removeClass("focused")},39:function(a){a.next().addClass("focused").length&&a.removeClass("focused")},
40:function(a){var b=a.parent().next();b.length&&e(b.children()[a.index()]).addClass("focused").length&&a.removeClass("focused")}};x.keydown(function(b){b.stopPropagation();if(c[b.keyCode]&&a.$element.css("display")==="table"){c[b.keyCode](a.$element.find(".focused"));return false}})}function n(a,b){var c=document.createElement("textarea");c.innerHTML=b;for(var c=e.grep(c.value.split(" "),function(a){return""!==a}),d=["<tr>"],f=0,g;g=c[f];){0!==f&&0===f%15&&d.push("</tr><tr>");d.push('<td unselectable="on">'+
g+"</td>");f++}d.push("</tr>");a.$tbody.empty().append(d.join(""));a.$element.delegate("td","mouseover",function(){a.$element.find(".focused").removeClass("focused");e(this).addClass("focused")}).delegate("td","mouseout",function(){e(this).removeClass("focused")}).delegate("td","click",function(){a.$element.hide();a.onSelect(e(this).text())})}function o(a,c){var d=a.offset();if("fixed"===b.POSITION_STYLE){d.top=d.top-v.scrollTop();d.left=d.left-v.scrollLeft()}var f=v.width(),e=v.height()-C;if(f<d.left+
c.width())d.left=f-c.width();if(e<d.top+c.height())d.top=e-c.height();return d}function p(a){if(m.activeEditable){u.select();m.execCommand("insertHTML",false,a);u.endContainer=u.startContainer;u.endOffset=++u.startOffset;u.select()}}function r(a){var b=this;b.$element=e('<table class="aloha-character-picker-overlay" unselectable="on" role="dialog"><tbody></tbody></table>');b.$element.mousedown(function(){return false});b.onSelect=a;b.$tbody=b.$element.find("tbody");b.$element.appendTo(e("body"));
g(b);k(b);q(b,a);m.bind("aloha-editable-deactivated",function(){b.hide()})}function t(a,b){var c=a.getEditableConfig(b.obj);if(!c)return null;var c=e.isArray(c)?c.join(" "):c,d=z[c];if(!d){d=new r(p);n(d,c);z[c]=d}return d}var x=e(document),v=e(window),u,z={},C=function(){var a=e("<div>").css({visibility:"hidden",height:100,overflow:"scroll"}).appendTo("body"),b=e("<div>").css({height:"100%"}).appendTo(a).outerHeight();a.remove();return 100-b}();r.prototype={show:function(a){this.$element.css(o(a,
this.$element)).css("position",b.POSITION_STYLE).show().find(".focused").removeClass("focused");this.$element.find("td").eq(0).addClass("focused");this._overlayActive=true},hide:function(){this.$element.hide();this._overlayActive=false}};return a.create("characterpicker",{settings:{},config:"&#38; &#34; &#162; &#8364; &#163; &#165; &#169; &#174; &#8482; &#8240; &#181; &#183; &#8226; &#8230; &#8242; &#8243; &#167; &#182; &#223; &#8249; &#8250; &#171; &#187; &#8216; &#8217; &#8220; &#8221; &#8218; &#8222; &#60; &#62; &#8804; &#8805; &#8211; &#8212; &#175; &#8254; &#164; &#166; &#168; &#161; &#191; &#710; &#732; &#176; &#8722; &#177; &#247; &#8260; &#215; &#185; &#178; &#179; &#188; &#189; &#190; &#402; &#8747; &#8721; &#8734; &#8730; &#8764; &#8773; &#8776; &#8800; &#8801; &#8712; &#8713; &#8715; &#8719; &#8743; &#8744; &#172; &#8745; &#8746; &#8706; &#8704; &#8707; &#8709; &#8711; &#8727; &#8733; &#8736; &#180; &#184; &#170; &#186; &#8224; &#8225; &#192; &#193; &#194; &#195; &#196; &#197; &#198; &#199; &#200; &#201; &#202; &#203; &#204; &#205; &#206; &#207; &#208; &#209; &#210; &#211; &#212; &#213; &#214; &#216; &#338; &#352; &#217; &#218; &#219; &#220; &#221; &#376; &#222; &#224; &#225; &#226; &#227; &#228; &#229; &#230; &#231; &#232; &#233; &#234; &#235; &#236; &#237; &#238; &#239; &#240; &#241; &#242; &#243; &#244; &#245; &#246; &#248; &#339; &#353; &#249; &#250; &#251; &#252; &#253; &#254; &#255; &#913; &#914; &#915; &#916; &#917; &#918; &#919; &#920; &#921; &#922; &#923; &#924; &#925; &#926; &#927; &#928; &#929; &#931; &#932; &#933; &#934; &#935; &#936; &#937; &#945; &#946; &#947; &#948; &#949; &#950; &#951; &#952; &#953; &#954; &#955; &#956; &#957; &#958; &#959; &#960; &#961; &#962; &#963; &#964; &#965; &#966; &#967; &#968; &#969; &#8501; &#982; &#8476; &#977; &#978; &#8472; &#8465; &#8592; &#8593; &#8594; &#8595; &#8596; &#8629; &#8656; &#8657; &#8658; &#8659; &#8660; &#8756; &#8834; &#8835; &#8836; &#8838; &#8839; &#8853; &#8855; &#8869; &#8901; &#8968; &#8969; &#8970; &#8971; &#9001; &#9002; &#9674; &#9824; &#9827; &#9829; &#9830;",
_constructor:function(){this._super("characterpicker")},init:function(){function a(c){if(c<m.editables.length){t(b,m.editables[c]);window.setTimeout(function(){a(c+1)},100)}}var b=this;if(m.settings.plugins&&m.settings.plugins.characterpicker)b.settings=m.settings.plugins.characterpicker;var e=j.adopt("characterPicker",d,{tooltip:l.t("button.addcharacter.tooltip"),icon:"aloha-icon-characterpicker",scope:"Aloha.continuoustext",click:function(){if(b.overlay){u=m.Selection.rangeObject;var a=u.startContainer.parentNode,
d=b.overlay.$element;c(a,d,"font-family");c(a,d,"font-weight");c(a,d,"font-style");b.overlay.show(this.element)}}});window.setTimeout(function(){a(0)},100);m.bind("aloha-editable-activated",function(a,c){b.overlay=t(b,c.editable);b.overlay?e.show():e.hide()});f.sub("aloha.floating.changed",function(){b.overlay&&b.overlay.$element.css(o(e.element,b.overlay.$element))})}})});define("commands/inserthtml","aloha/core jquery aloha/command aloha/selection util/dom aloha/contenthandlermanager aloha/console".split(" "),
function(m,e,a,j,d,b,f){a.register("inserthtml",{action:function(a,g){function k(a){var b=e(a);if(!d.insertIntoDOM(b,g,c,false)){b=b.contents();(d.isBlockLevelElement(a)||d.isListElement(a))&&k(e("<br/>").get(0));for(a=b.length-1;a>=0;--a)k(b[a])}}var c=e(d.getEditingHostOf(g.startContainer)),j=g.commonAncestorContainer,n,o=[],a=b.handleContent(a,{contenthandler:m.settings.contentHandler.insertHtml});if(typeof a==="string")a=e("<div>"+a+"</div>");else if(a instanceof e)a=e("<div>").append(a);else throw"INVALID_VALUE_ERR";
o=a.contents();d.removeRange(g);for(n=o.length-1;n>=0;--n)k(o[n]);o.length>0?g=d.setCursorAfter(o.get(o.length-1)):g.select();d.doCleanup({merge:true,removeempty:true},g,j);try{g.select()}catch(p){f.warn("Error:",p)}}})});define("commands/commands-plugin",["aloha/command","./inserthtml"],function(){});define("block/block-utils",["jquery","util/dom","util/dom2","util/html","aloha/ephemera"],function(m,e,a,j,d){function b(a){var b;a.is("div")?(b=document.createElement("div"),b.style.display="inline-block"):
b=document.createElement("span");b.className=q+"_"+a.attr("id");b.appendChild(document.createTextNode(" "));d.markWhiteSpaceWrapper(b);return b}function f(b){return(j.isBlock(b)||a.isTextNode(b))&&!j.isUnrenderedNode(b)}function l(b){return b.lastChild?l(b.lastChild):a.forward(b)}function g(a){return/^(br|td|th)$/.test(a.nodeName.toLowerCase())||j.isBlock(a)||e.isEditingHost(a)}function k(a){return g(a)||"li"===a.nodeName.toLowerCase()||a.previousSibling&&e.isEditingHost(a.previousSibling)||m(a).data("aloha-block-type")||
!1}function c(a){return a.hasClass("aloha-table-wrapper")}var q="aloha-caret-landing";return{pad:function(c){if(!e.isBlockNode(c[0])){var d=q+"_"+c.attr("id"),j;0===c.prev("."+d).length&&((j=a.findBackward(a.backward(c[0]),f,g))||c.before(b(c)));0===c.next("."+d).length&&((d=a.findForward(l(c[0]),f,k))||c.after(b(c)))}},unpad:function(a){a=q+"_"+a.attr("id");m("."+a).each(function(a,b){j.hasOnlyWhiteSpaceChildren(b)?b.parentNode.removeChild(b):m(b.childNodes).unwrap()})},isDragdropEnabledForElement:function(a){a=
a.closest(".aloha-editable");return a.length?!!a.data("block-dragdrop"):!0},isTable:c,getEditableByBlock:function(a){return a.parents(".aloha-editable").filter(":first")},getTableByBlock:function(a){return c(a)?a.find("table").filter(":first"):null}}});define("block/blockmanager","aloha jquery ui/scopes aloha/observable aloha/registry util/class util/strings util/maps block/block-utils".split(" "),function(m,e,a,j,d,b,f,l,g){function k(a){a.$element.attr("data-aloha-block-copy-only-block","true");
q.Utils.Dom.selectDomNode(a.$element[0])}var c=e,q=window.GENTICS,n=new (b.extend(j,{defaults:{"aloha-block-type":"DefaultBlock"},blockTypes:null,blocks:null,_highlightedBlocks:null,_activeBlock:null,_dragdropEnabled:true,_constructor:function(){a.createScope("Aloha.Block");this.blockTypes=new d;this.blocks=new d;this._highlightedBlocks={}},registerEventHandlers:function(){var a=this;this._registerEventHandlersForDeactivatingAlohaBlock();this._registerEventHandlersForDeterminingCurrentlyActiveBlock();
this._registerEventHandlersForBlockDeletion();this._registerEventHandlersForCutCopyPaste();this._registerEventHandlersForEditableActivated();m.bind("aloha-selection-changed",function(b,d){d&&c(d.getCommonAncestorContainer()).parents(".aloha-block").length>0||a._deactivateHighlightedBlocks()})},_registerEventHandlersForDeactivatingAlohaBlock:function(){var a=this;c(document).bind("click",function(b){l.isEmpty(a._highlightedBlocks)||c(b.target).closest(".aloha-ui,.aloha-block-do-not-deactivate,.aloha-block").length>
0||a._deactivateHighlightedBlocks()})},_registerEventHandlersForDeterminingCurrentlyActiveBlock:function(){var a=this;this.bind("block-selection-change",function(b){a._activeBlock=b.length>0?b[0]:null})},_registerEventHandlersForBlockDeletion:function(){function a(b){if(b.getRangeCount()===0)return true;if(!e.browser.msie)return false;var b=b.getRangeAt(0),c=b.startContainer;if(c!==b.endContainer)return false;if(e("body").is(c))return true;if(b.startOffset+1===b.endOffset&&1===d.nodeType){var d=d.childNodes[b.startOffset];
return e(d).is(".aloha-block")}return false}var b=this;m.bind("aloha-command-will-execute",function(d,f){if(b._activeBlock&&b._activeBlock.$element.hasClass("aloha-table-wrapper"))return true;var e=f.commandId,g=m.getSelection(),k=a(g),e="delete"===e||"forwarddelete"===e;if(b._activeBlock&&e&&k){f.preventDefault=true;b._activeBlock.destroy()}else!b._activeBlock&&(e&&g.getRangeCount()===1&&g.getRangeAt(0).collapsed===false)&&function C(a){for(var b,d=0,f=a.length;d<f;d++){b=a[d];if(b.domobj.nodeType===
1){var e=c(b.domobj);b.selection==="full"&&e.is(".aloha-block")?e.remove():C(b.children)}}}(m.Selection.getSelectionTree())});c(window.document).keydown(function(a){if(e(a.target).closest(".aloha-ui").length>0)return true;if(b._activeBlock&&(a.which===46||a.which===8)&&b._activeBlock._isInsideNestedEditable===false){if(c.browser.msie&&parseInt(c.browser.version,10)<=8&&b._activeBlock.$element.parents(".aloha-editable,.aloha-block").first().hasClass("aloha-editable")){b._activeBlock.destroy();a.preventDefault();
return false}if(b._activeBlock.shouldDestroy()){b._activeBlock.destroy();a.preventDefault();return false}}})},_registerEventHandlersForCutCopyPaste:function(){var a=this,b=false,d=false,f=null;c(window.document).keydown(function(f){if(!m.activeEditable||!a._activeBlock||!c.contains(a._activeBlock.$element.get(0),m.activeEditable.obj.get(0))){var e;if(e=a._activeBlock)if(e=f.ctrlKey||f.metaKey){e=m.getSelection().getRangeCount()?!m.getSelection().getRangeAt(0).collapsed:false;e=!e&&!g.isTable(a._activeBlock.$element)}if(e)if(f.which===
67){b=true;k(a._activeBlock)}else if(f.which===88){d=true;k(a._activeBlock)}}});c(window.document).keyup(function(c){if(!d&&b&&(c.which===67||c.which===18||c.which===91)){b=false;a._activeBlock.$element.removeAttr("data-aloha-block-copy-only-block");f&&(f=null)}if(d&&(c.which===67||c.which===18||c.which===88))d=false})},_registerEventHandlersForEditableActivated:function(){var a=this;m.bind("aloha-editable-activated",function(b,c){if(c.editable){var d=a.getBlock(c.editable.obj.closest(".aloha-block"));
d&&d.activate()}})},initializeBlockLevelDragDrop:function(){var a=this;c.each(m.editables,function(b,c){c.obj.data("block-dragdrop",a._dragdropEnabled)});m.bind("aloha-editable-created",function(b,c){c.obj.data("block-dragdrop",a._dragdropEnabled)})},setDragDropState:function(a){this._dragdropEnabled=a},getDragDropState:function(){return this._dragdropEnabled},registerBlockType:function(b,c){a.createScope("Aloha.Block."+b,"Aloha.Block");this.blockTypes.register(b,c)},_blockify:function(a,b){var d=
c(a),f=m.require("block/block-plugin"),e=d[0].tagName.toLowerCase();if(c.inArray(e,f.settings.rootTags)===-1)m.Log.error("block/blockmanager","Blocks can only be created from ["+f.settings.rootTags.join(", ")+"] element. You passed "+e+".");else{f=this.getConfig(d,b);if(this.blockTypes.has(f["aloha-block-type"])){d=new (this.blockTypes.get(f["aloha-block-type"]))(d,f);d.$element.addClass("aloha-block-"+f["aloha-block-type"]);this.blocks.register(d.getId(),d)}else m.Log.error("block/blockmanager",
"Block Type "+f["aloha-block-type"]+" not found!")}},_unblockify:function(a){(a=this.getBlock(a))&&a.unblock()},getConfig:function(a,b){var d={},g=null,k=null;if(a.length>0){k=e(a[0].cloneNode(false));g=e.extend({},e.data(a[0]),k.data());k.removeData();for(var j in g)g.hasOwnProperty(j)&&(d[f.camelCaseToDashes(j)]=g[j])}return c.extend({},this.defaults,b,d)},getBlock:function(a){if(typeof a==="object"){a=c(a);a.hasClass("aloha-block-inner")&&(a=a.parent());a=a.attr("id")}return this.blocks.get(a)},
_unregisterBlock:function(a){this.blocks.unregister(typeof a==="object"?a.getId():a)},_deactivateHighlightedBlocks:function(){c.each(c.extend({},this._highlightedBlocks),function(a){(a=n.getBlock(a))&&a.deactivate()})},_getHighlightedBlocks:function(){var a={};c.each(this.blocks.getEntries(),function(b,c){c.isActive()&&(a[b]=c)});return a},_setHighlighted:function(a){this._highlightedBlocks[a.id]=true},_setUnhighlighted:function(a){delete this._highlightedBlocks[a.id]}}));m.Block=m.Block||{};return m.Block.BlockManager=
n});define("block/editormanager",["aloha/registry"],function(m){return new (m.extend({createEditor:function(e){if(!this.has(e.type))throw'Editor for type "'+e.type+'" not found.';return new (this.get(e.type))(e)}}))});define("block/sidebarattributeeditor",["jquery","block/blockmanager","aloha/sidebar","block/editormanager","util/class"],function(m,e,a,j,d){return new (d.extend({_sidebar:null,_blockPanels:[],init:function(){this._sidebar=a.right.show();e.bind("block-selection-change",this._onBlockSelectionChange,
this)},_onBlockSelectionChange:function(a){var d=this,e;if(this._sidebar){for(e in d._blockPanels)d._blockPanels.hasOwnProperty(e)&&(e=d._blockPanels[e],m(e.element).remove(),delete this._sidebar.panels[e.id]);this._blockPanels=[];m.each(a,function(){var a=this.getSchema(),b=this,c=[];a&&d._blockPanels.push(d._sidebar.addPanel({title:b.getTitle(),expanded:!0,onInit:function(){var d=m("<form />");d.submit(function(){return!1});m.each(a,function(a,f){var e=j.createEditor(f);e.bind("change",function(c){b.attr(a,
c)});b.bind("change",function(){e.setValue(b.attr(a))});d.append(e.render());e.setValue(b.attr(a));c.push(e)});this.setContent(d)},deactivate:function(){m.each(c,function(a,b){b._deactivate()});this.isActive=!1;this.effectiveElement=null}}))})}}}))});define("block/block","aloha jquery block/blockmanager aloha/observable ui/scopes util/class PubSub block/block-utils util/dom util/functions aloha/engine".split(" "),function(m,e,a,j,d,b,f,l,g,k,c){var q=window.GENTICS,j=b.extend(j,{title:null,id:null,
$element:null,_currentlyRendering:false,_initialized:false,_isInsideNestedEditable:false,_constructor:function(a,b){var c=this;this.$element=a;if(a.attr("id"))this.id=a.attr("id");else{this.id=q.Utils.guid();a.attr("id",this.id)}a.contentEditable(false);a.addClass("aloha-block");if(this.isDraggable()){a.find("img").attr("draggable","false");try{a.find("a").attr("draggable","false")}catch(d){a.find("a").each(function(){this.setAttribute("draggable","false")})}}e.each(b,function(a,b){c._setAttribute(a,
b)});this._onElementClickHandler=function(a){if(e(a.target).closest(".aloha-block").get(0)===c.$element.get(0)){c._fixScrollPositionBugsInIE();c.activate(a.target,a);a=e(a.target);!a.is("textarea, input")&&(!a.contentEditable()&&!a.hasClass("aloha-table-cell_active"))&&m.getSelection().removeAllRanges()}};this._connectThisBlockToDomElement(a,function(){f.pub("aloha.block.initialized",{block:c})});if(!g.isBlockNode(a[0])){a.closest(".aloha-editable-active").length>0&&l.pad(c.$element);m.bind("aloha-smart-content-changed",
function(a,b){b.editable.isActive&&b.editable.obj.find("#"+c.id).length>0&&l.pad(c.$element)});m.bind("aloha-editable-activated",function(a,b){b.editable&&b.editable.obj.find("#"+c.id).length!==0&&l.pad(c.$element)});m.bind("aloha-editable-deactivated",function(a,b){b.editable&&b.editable.obj.find("#"+c.id).length!==0&&l.unpad(c.$element)})}this._initialized=true},_onElementClickHandler:null,_preventSelectionChangedEventHandler:function(a){var b=e(a.target).closest(".aloha-editable");"dblclick"!==
a.type&&!this.contains(b[0])&&m.Selection.preventSelectionChanged()},_connectThisBlockToDomElement:function(a,b){var c=this,d=e(a);this._disconnectFromDomElement();this.$element=d;this.$element.bind("click",this._onElementClickHandler);this.$element.bind("mousedown",this._preventSelectionChangedEventHandler);this.$element.bind("focus",this._preventSelectionChangedEventHandler);this.$element.bind("dblclick",this._preventSelectionChangedEventHandler);this.init(this.$element,function(){window.setTimeout(function(){c._postProcessElementIfNeeded();
b&&b()},5)})},_disconnectFromDomElement:function(){if(this.$element){this.$element.unbind("click",this._onElementClickHandler);this.$element.unbind("mousedown",this._preventSelectionChangedEventHandler);this.$element.unbind("focus",this._preventSelectionChangedEventHandler);this.$element.unbind("dblclick",this._preventSelectionChangedEventHandler)}},_fixScrollPositionBugsInIE:function(){var a=e(window).scrollTop();window.setTimeout(function(){e(window).scrollTop()!==a&&e(window).scrollTop(a)},10)},
init:function(a,b){b()},shouldDestroy:function(){var a=this.$element.parent().closest(".aloha-block,.aloha-editable,.aloha-table-cell-editable,.aloha-block-collection");return a.hasClass("aloha-block-collection")&&this.$element[0].tagName.toLowerCase()==="div"?true:a.hasClass("aloha-editable")||a.hasClass("aloha-table-cell-editable")},destroy:function(b){if(this.shouldDestroy()||b===true){var c=this,d=new q.Utils.RangeObject;d.startContainer=d.endContainer=this.$element.parent()[0];d.startOffset=
d.endOffset=q.Utils.Dom.getIndexInParent(this.$element[0]);l.unpad(this.$element);a.trigger("block-delete",this);this.free();var f=this.$element[0].tagName.toLowerCase()==="span";this.$element.fadeOut("fast",function(){c.$element.remove();a.trigger("block-selection-change",[]);window.setTimeout(function(){f&&d.select()},5)})}},unblock:function(){l.unpad(this.$element);this.deactivate();this._disconnectFromDomElement();this.$element.removeClass("aloha-block");this.$element.children(".aloha-block-handle").remove();
this.free()},free:function(){a._unregisterBlock(this);this.unbindAll()},getId:function(){return this.id},getSchema:function(){return null},getTitle:function(){return this.title},isDraggable:function(){return this.$element[0].nodeName==="DIV"&&this.$element.parents(".aloha-editable,.aloha-block:not(.aloha-table-wrapper),.aloha-block-collection").first().hasClass("aloha-block-collection")?true:this.$element.parents(".aloha-block:not(.aloha-table-wrapper),.aloha-editable").first().hasClass("aloha-editable")},
activate:function(b,c){var f=[];e.each(a._getHighlightedBlocks(),function(){this.deactivate()});this.$element.attr("data-block-skip-scope")!=="true"&&d.setScope("Aloha.Block."+this.attr("aloha-block-type"));this.$element.addClass("aloha-block-active");this._highlight();f.push(this);this.$element.parents(".aloha-block").each(function(){var b=a.getBlock(this);if(b){b._highlight();f.push(b)}});if(e(b).closest(".aloha-editable,.aloha-block,.aloha-table-cell-editable,.aloha-table-cell_active").first().hasClass("aloha-block")){var g=
new m.Selection.SelectionRange(true);if(e(g.startContainer).closest(".aloha-editable,.aloha-block,.aloha-table-cell-editable,.aloha-table-cell_active").first().hasClass("aloha-editable")&&c){this._isInsideNestedEditable=true;m.Selection.updateSelection(c)}else this._isInsideNestedEditable=false}else{this._isInsideNestedEditable=true;c&&m.Selection.updateSelection(c)}if(!this._isInsideNestedEditable)(g=m.getEditableHost(this.$element))&&g.activate();a.trigger("block-activate",f);a.trigger("block-selection-change",
f)},deactivate:function(){var b=this,c=[this];this._unhighlight();this.$element.parents(".aloha-block").each(function(){c.push(this);b._unhighlight()});this.$element.removeClass("aloha-block-active");a.trigger("block-deactivate",c);a.trigger("block-selection-change",[])},isActive:function(){return this.$element.hasClass("aloha-block-active")},_highlight:function(){this.$element.addClass("aloha-block-highlighted");a._setHighlighted(this)},_unhighlight:function(){this.$element.removeClass("aloha-block-highlighted");
a._setUnhighlighted(this)},_update:function(){var a=this;if(!this._currentlyRendering&&this._initialized){this._currentlyRendering=true;this.update(this.$element,function(){a._postProcessElementIfNeeded()});this._currentlyRendering=false}},update:function(a,b){b()},_postProcessElementIfNeeded:function(){this.createEditablesIfNeeded();this._checkThatNestedBlocksAreStillConsistent();this.renderBlockHandlesIfNeeded();if(this.isDraggable()){var a=this.$element[0].nodeName;if(a==="SPAN"&&!this.$element.data("dd-setup-done")){this._setupDragDropForInlineElements();
this._disableUglyInternetExplorerDragHandles();this.$element.data("dd-setup-done",true)}else if(a==="DIV"){this._setupDragDropForBlockElements();this._disableUglyInternetExplorerDragHandles()}}this._hideDragHandlesIfDragDropDisabled();this._attachDropzoneHighlightEvents()},_checkThatNestedBlocksAreStillConsistent:function(){this.$element.find(".aloha-block").each(function(){var b=a.getBlock(this);b&&b.$element[0]!==this&&b._connectThisBlockToDomElement(this)})},_disableUglyInternetExplorerDragHandles:function(){if(m.browser.msie){var a=
this.$element.get(0);a.onresizestart=k.returnFalse;a.oncontrolselect=k.returnFalse;a.onmovestart=k.returnFalse}},_hideDragHandlesIfDragDropDisabled:function(){this._dd_isDragdropEnabled()||this.$element.find(".aloha-block-draghandle").each(function(){var a=e(this);l.isDragdropEnabledForElement(a)||a.removeClass("aloha-block-draghandle")})},_attachDropzoneHighlightEvents:function(){var a=this;this.$element.delegate(".aloha-block-draghandle","mousedown",function(){var b=a.$element.parents(".aloha-editable").first().data("block-dropzones")||
[];e.each(b,function(a,b){var c=e(b);e(c).each(function(){e(this).data("block-dragdrop")&&e(this).addClass("aloha-block-dropzone")})});e(document).one("mouseup.aloha-block-dropzone",function(){var b=a.$element.parents(".aloha-editable").first().data("block-dropzones")||[];e.each(b,function(a,b){e(b).removeClass("aloha-block-dropzone")})})})},_setupDragDropForInlineElements:function(){var a=this,b=null,d=false,f=null,g=null,k=function(){if(b){var k=e(b),j=f[0].parentNode;if(k.is(".aloha-block-dropInlineElementIntoEmptyBlock"))k.prepend(f);
else if(k.is(".aloha-block-droppable-right")){k.html(k.html()+" ");k.after(f)}else{k.prev("[data-i]").length>0&&k.prev("[data-i]").html(k.prev("[data-i]").html()+" ");k.html(" "+k.html());k.before(f)}c.ensureContainerEditable(j);f.removeClass("ui-draggable").css({left:0,top:0});a._fixScrollPositionBugsInIE()}e(".aloha-block-dropInlineElementIntoEmptyBlock").removeClass("aloha-block-dropInlineElementIntoEmptyBlock");if(g){g.filter(":data(droppable)").droppable("destroy");g=null}d=true},j=[];this.$element.get(0).ondragstart=
function(a){a?typeof a.stopPropagation==="function"?a.stopPropagation():a.cancelBubble=true:window.event.cancelBubble=true};this.$element.draggable({handle:".aloha-block-draghandle",scope:"aloha-block-inlinedragdrop",disabled:!this._dd_isDragdropEnabled(),revert:function(){return b===null||!d},revertDuration:250,stop:function(){e.browser.msie&&7===parseInt(e.browser.version,10)&&k();e.each(j,function(){a._dd_traverseDomTreeAndRemoveSpans(this)});f&&l.unpad(f);f=null;j=[];m.deactivateEditable();var b=
m.getEditableHost(a.$element);b&&b.activate()},start:function(){b=null;d=false;j=[];e(".aloha-editable").children("p:empty").html("&nbsp;");g=e(".aloha-editable.aloha-block-dropzone").children(":not(.aloha-block)");g=g.add(".aloha-editable:not(:has(*))");g=g.add(".aloha-table-cell-editable");g=g.add(e(".aloha-editable.aloha-block-dropzone .aloha-table-cell-editable").children(":not(.aloha-block)"));g.droppable({tolerance:"pointer",addClasses:false,scope:"aloha-block-inlinedragdrop",over:function(c,
d){e.inArray(this,j)===-1&&j.push(this);var g=1===e(this).contents().length&&1===e(this).children("br").length;f=d.draggable;if(e(this).is(":empty")||g||e.trim(e(this).text())===""){e(this).addClass("aloha-block-dropInlineElementIntoEmptyBlock");b=this}else{a._dd_traverseDomTreeAndWrapCharactersWithSpans(this);e("span[data-i]",this).droppable({tolerance:"pointer",addClasses:false,scope:"aloha-block-inlinedragdrop",over:function(){b&&e(b).removeClass("aloha-block-droppable");b=this;e(this).addClass("aloha-block-droppable")},
out:function(){e(this).removeClass("aloha-block-droppable");b===this&&(b=null)}});e.ui.ddmanager.prepareOffsets(d.draggable.data("draggable"),c)}},out:function(){e(this).removeClass("aloha-block-dropInlineElementIntoEmptyBlock")},drop:function(){e.browser.msie&&7===parseInt(e.browser.version,10)||k()}})}})},_dd_traverseDomTreeAndWrapCharactersWithSpans:function(a){for(var b,c=0,d=a.childNodes.length;c<d;c++){b=a.childNodes[c];if(b.nodeType===1)if(!~b.className.indexOf("aloha-block")&&b.attributes["data-i"]===
void 0)this._dd_traverseDomTreeAndWrapCharactersWithSpans(b);else{if(b.attributes["data-i"])break}else if(b.nodeType===3){b=this._dd_insertSpans(b);c=c+b;d=d+b}}},_dd_splitText:function(a){for(var a=a.split(/(?=\b)/),b=[],c=false,d=0,f=a.length;d<f;d++)if(/[^\t\n\r ]/.test(a[d]))if(c){b.push(" "+a[d]);c=false}else b.push(a[d]);else c=true;c&&(b[b.length-1]=b[b.length-1]+" ");return b},_dd_insertSpans:function(a){var b=a.nodeValue;if(!/[^\t\n\r ]/.test(b))return 0;for(var c=document.createDocumentFragment(),
b=this._dd_splitText(b),d=b.length,f,g,k,j=0,l=0;l<d;l++){g=b[l];if(g.length!==0){k=Math.floor(g.length/2);f=parseInt(e.browser.version,10);if(e.browser.msie&&(7===f||8===f))k=0;if(k>0){f=document.createElement("span");f.appendChild(document.createTextNode(g.substr(0,k)));f.setAttribute("data-i",l);c.appendChild(f);j++}f=document.createElement("span");g=g.substr(k);f.appendChild(document.createTextNode(g));f.setAttribute("data-i",l);f.setAttribute("class","aloha-block-droppable-right");c.appendChild(f);
j++}}a.parentNode.replaceChild(c,a);return j-1},_dd_traverseDomTreeAndRemoveSpans:function(a){var b=[],c;c=function(a){for(var d=false,f,e,g,k=0,j=a.childNodes.length;k<j;k++){g=a.childNodes[k];if(g.nodeType===1)if(g.attributes["data-i"]!==void 0){if(!d){d=true;f="";e=void 0}if(d){f=f+g.firstChild.nodeValue;e&&b.push(e);e=g}}else{if(d){d=false;e.parentNode.replaceChild(document.createTextNode(f),e)}~g.className.indexOf("aloha-block")||c(g)}}d&&e.parentNode.replaceChild(document.createTextNode(f),
e)};c(a);for(var a=0,d=b.length;a<d;a++)b[a].parentNode.removeChild(b[a])},_dd_isDragdropEnabled:function(){return l.isDragdropEnabledForElement(this.$element.parent())},_setupDragDropForBlockElements:function(){this.$element.find(".aloha-block-draghandle").addClass("aloha-block-draghandle-blocklevel")},createEditablesIfNeeded:function(){this.$element.find(".aloha-editable").aloha()},renderBlockHandlesIfNeeded:function(){this.isDraggable()&&this.$element.children(".aloha-block-draghandle").length===
0&&this.$element.prepend('<span class="aloha-block-handle aloha-block-draghandle aloha-cleanme"></span>')},attr:function(a,b,c){var d=this,f=false;if(arguments.length>=2){if(a.substr(0,12)==="aloha-block-"){m.Log.error("block/block","It is not allowed to set internal block attributes (starting with aloha-block-) through Block.attr() (You tried to set "+a+")");return}this._getAttribute(a)!==b&&(f=true);this._setAttribute(a,b)}else if(typeof a==="object")e.each(a,function(a,b){if(a.substr(0,12)==="aloha-block-")m.Log.error("block/block",
"It is not allowed to set internal block attributes (starting with aloha-block-) through Block.attr() (You tried to set "+a+")");else{d._getAttribute(a)!==b&&(f=true);d._setAttribute(a,b)}});else return typeof a==="string"?this._getAttribute(a):this._getAttributes();if(f&&!c){this._update();this.trigger("change");m.activeEditable&&m.activeEditable.smartContentChange({type:"block-change"})}return null},_setAttribute:function(a,b){this.$element.attr("data-"+a.toLowerCase(),b)},_getAttribute:function(a){return this.$element.attr("data-"+
a.toLowerCase())},_getAttributes:function(){var a={};e.each(this.$element[0].attributes,function(b,c){if(c.name.substr(0,5)==="data-")a[c.name.substr(5).toLowerCase()]=c.value});return a}}),b=j.extend({update:function(a,b){b()}}),n=j.extend({title:"Debugging",init:function(a,b){this.update(a,b)},update:function(a,b){a.css({display:"block"});var c='<table class="debug-block">';e.each(this.attr(),function(a,b){c=c+("<tr><th>"+a+"</th><td>"+b+"</td></tr>")});c=c+"</table>";a.html(c);b()}}),o=j.extend({title:"EmptyBlock",
init:function(){},activate:function(){},deactivate:function(){},renderBlockHandlesIfNeeded:function(){},_preventSelectionChangedEventHandler:function(){}});return{AbstractBlock:j,DefaultBlock:b,DebugBlock:n,EmptyBlock:o}});define("block/blockcontenthandler",["jquery","aloha/contenthandlermanager","block/blockmanager"],function(m,e,a){return e.createHandler({handleContent:function(e){"string"===typeof e?e=m("<div>"+e+"</div>"):e instanceof m&&(e=m("<div>").append(e));0<e.find('.aloha-block[data-aloha-block-copy-only-block="true"]').length&&
(e.find(".aloha-block:not([id])").remove(),e.find(".aloha-block + span:empty").remove(),e.find("div:empty").remove(),e.find("br.Apple-interchange-newline").remove(),e.find(".aloha-block").prev("br").remove(),e.find("div > br:only-child").parent().remove());e.find(".aloha-block").each(function(){var d=m(this),b={},f={};m.each(d[0].attributes,function(a,c){if(c.nodeName!=="id")c.nodeName.match(/^data-/)?f[c.nodeName.substr(5)]=c.nodeValue:b[c.nodeName]=c.nodeValue});var e=GENTICS.Utils.guid(),g=m("<"+
this.tagName+"/>").attr(b).attr("id",e).removeClass("aloha-block-active").removeClass("aloha-block").html(d.html());d.replaceWith(g);window.setTimeout(function(){a._blockify(m("#"+e),f)},50)});return e.html()}})});define("block/editor",["jquery","aloha/observable","util/class"],function(m,e,a){var e=a.extend(e,{schema:null,_constructor:function(a){this.schema=a},render:function(){},getValue:function(){},setValue:function(){},destroy:function(){},_deactivate:function(){this.trigger("change",this.getValue());
this.destroy()}}),a=e.extend({formInputElementDefinition:null,_$formInputElement:null,render:function(){var a=m('<div class="aloha-block-editor" />'),b=GENTICS.Utils.guid(),d=this.renderLabel().attr("id",b),b=this.renderFormElement().attr("id",b);this.schema.fieldsetLabel?d.append(b).appendTo(a):a.append(d).append(b);return a},renderLabel:function(){return this.schema.fieldsetLabel?m("<fieldset>").append(m("<legend>",{text:this.schema.label})):m("<label>",{text:this.schema.label})},renderFormElement:function(){var a=
this;this._$formInputElement=m(this.formInputElementDefinition);this.afterRenderFormElement(this._$formInputElement);this._$formInputElement.change(function(){a.trigger("change",a.getValue())});return this._$formInputElement},afterRenderFormElement:function(){},getValue:function(){return this._$formInputElement.val()},setValue:function(a){this._$formInputElement.val(a)},destroy:function(){this._$formInputElement.remove()}}),j=a.extend({formInputElementDefinition:'<input type="text" />'}),d=a.extend({formInputElementDefinition:'<input type="range" />',
afterRenderFormElement:function(a){this.schema.range&&(this.schema.range.min&&a.attr("min",this.schema.range.min),this.schema.range.max&&a.attr("max",this.schema.range.max),this.schema.range.step&&a.attr("step",this.schema.range.step))}}),b=a.extend({formInputElementDefinition:'<input type="url" />'}),f=a.extend({formInputElementDefinition:'<input type="email" />'}),l=a.extend({formInputElementDefinition:"<select />",afterRenderFormElement:function(a){m.each(this.schema.values,function(){a.append(m("<option />").attr("value",
this.key).html(this.label))})}}),g=a.extend({formInputElementDefinition:"<ul />",afterRenderFormElement:function(a){var b="rb_"+GENTICS.Utils.guid();m.each(this.schema.values,function(d,f){var e=b+"_"+f.key,g=$("<input>",{type:"radio",value:f.key,name:b,id:e}),e=$("<label>",{"for":e,"class":"input-label",text:f.label});$("<li>").append(g).append(e).appendTo(a)})},getValue:function(){return this._$formInputElement.find(":checked").val()},setValue:function(a){this._$formInputElement.find("[value="+
a+"]").prop("checked",!0)}}),k=a.extend({formInputElementDefinition:"<button />",afterRenderFormElement:function(a){var b=this;a.html(this.schema.buttonLabel);a.click(function(){b.schema.callback()})}});return{AbstractEditor:e,AbstractFormElementEditor:a,StringEditor:j,NumberEditor:d,UrlEditor:b,EmailEditor:f,SelectEditor:l,RadioButtonEditor:g,ButtonEditor:k}});define("block/dragbehavior","aloha/jquery aloha PubSub aloha/copypaste block/block-utils aloha/console ui/scopes".split(" "),function(m,e,
a,j,d,b,f){function l(a,b){return!a||!(a.is(".ui-draggable-dragging")||a.closest(b).length>0)}function g(a){this.blockObject=a;this.$element=a.$element;this.insertBeforeOrAfterMode=false;this.$element[0].nodeName==="DIV"&&this.setDraggable()}var k=["TABLE","TR","HR","TBODY","UL","OL","DL","B","STRONG","A","EM","I","PRE","CODE","SUP","SUB"],c=[".aloha-block",".aloha-block-handle",".aloha-table-selectrow","p","span","h1","h2","h3","h4","h5","h6","br"],q=[".aloha-table-selectcolumn",".aloha-ui",".ui-draggable-dragging"];
a.sub("aloha.block.initialized",function(a){g.follow(a.block)});g.follow=function(a){m(">.aloha-block-draghandle",a.$element).length>0&&new g(a)};var n=function(){var a=null,c=0,d=0;return m.browser.msie?{save:function(){c=window.scrollX||document.documentElement.scrollLeft;d=window.scrollY||document.documentElement.scrollTop;a=j.getRange()},restore:function(){if(a){var f=j.getEditableAt(a);f&&f.obj.focus();try{j.setSelectionAt(a)}catch(e){b.warn(e)}window.scrollTo(c,d)}}}:{save:function(){},restore:function(){}}}();
g.prototype.setDraggable=function(){var a=this,b=m(">.aloha-block-draghandle",this.$element),c=this.$element.get(0);c.onselectstart=function(){window.event.cancelBubble=true};c.ondragstart=function(a){a?typeof a.stopPropagation==="function"?a.stopPropagation():a.cancelBubble=true:window.event.cancelBubble=true};b.on("mousedown",function(){n.save()}).on("mouseup",function(){a._getHiglightElement().appendTo("body").css({position:"absolute"}).hide();a.stopListenMouseOver()});this.$element.draggable({handle:">.aloha-block-draghandle",
helper:"clone",cursorAt:{left:-10,top:-10},start:function(b,c){f.setScope("Aloha.empty");c.helper.css("zIndex",1E5);a._fillEmptyEditables();a.listenMouseOver();b.stopImmediatePropagation()},drag:function(a){a.stopImmediatePropagation()},stop:function(b,c){a._getHiglightElement().appendTo("body").css({position:"absolute"}).hide();a.stopListenMouseOver();a.onDragStop();a._removeFillers();c.helper.remove();n.restore();return true}})};g.prototype._getEditableChilds=function(){var a,b,c=[];for(a=0;a<e.editables.length;a++){b=
e.editables[a];c=c.concat(m("*:not("+k.join(",")+")",b.obj).toArray())}return m(c)};g.prototype._fillEmptyEditables=function(){var a,b,c;for(a=0;a<e.editables.length;a++){b=e.editables[a];if(b.obj.contents().length===0){c=m("<div class='aloha-block aloha-dragdrop-filler' style='height:inherit; min-height:inherit'></div>");c.contentEditable(false);b.obj.append(c)}}};g.prototype._removeFillers=function(){var a,b;for(a=0;a<e.editables.length;a++){b=e.editables[a];b.obj.children(".aloha-dragdrop-filler").remove()}};
g.prototype.listenMouseOver=function(){var a=this;this._getEditableChilds().bind("mouseover.blockbehavior",function(b){return a.onMouseover(this,b)})};g.prototype.stopListenMouseOver=function(){this._getEditableChilds().unbind(".blockbehavior")};g.prototype.onMouseover=function(a,b){if(this.$element.find(a).length||this.$element.is(a)){b.stopImmediatePropagation();return false}var c=m(a),d=this.$element.closest(".aloha-editable"),f=c.closest(".aloha-editable"),d=(d.data("block-dropzones")||[".aloha-editable"]).join();
if(!f.is(d)){e.Log.isDebugEnabled()&&e.Log.debug("block-plugin","Preventing drop because of defined dropzones: [ "+d+" ]");b.stopImmediatePropagation();return false}if(!this._isAllowedOverElement(a)){this.disableInsertBeforeOrAfter(this.$overElement);this.enableInsertBeforeOrAfter(a);this.$overElement=c;return true}if(!c.is(".aloha-editable, .aloha-table-cell-editable")||!c.children().length){this.disableInsertBeforeOrAfter(this.$overElement);this.$overElement=c;this.highlightElement(a)}b.stopImmediatePropagation();
return false};g.prototype.highlightElement=function(a){if(a.nodeName==="DIV"&&a.parentNode.nodeName==="TD"&&a.parentNode.firstChild===a&&a.parentNode.lastChild===a)a=a.parentNode;a=m(a);this._getHiglightElement().appendTo("body").css({position:"absolute"}).show().css("zIndex",parseInt(a.zIndex(),10)+1).offset(a.offset()).width(a.outerWidth()).height(a.outerHeight())};g.prototype.enableInsertBeforeOrAfter=function(a){var a=m(a),b=this,c=a.offset().top,d=a.outerHeight()/2;l(a,this.$element)&&a.bind("mousemove.brIBOA",
function(a){b.insertBeforeOrAfterMode=a.pageY-c>=d?"AFTER":"BEFORE";b.highlightEdge(this)})};g.prototype.disableInsertBeforeOrAfter=function(a){this.insertBeforeOrAfterMode=false;a&&a.unbind(".brIBOA")};g.prototype.highlightEdge=function(a){var a=m(a),b=this._getHiglightElement().css({position:"relative",top:"auto",left:"auto"}).show();if(this.insertBeforeOrAfterMode==="BEFORE"){b.css("zIndex",parseInt(a.zIndex(),10)+1).width(a.outerWidth()).height(4);a.before(b)}else{b.css("zIndex",parseInt(a.zIndex(),
10)+1).width(a.outerWidth()).height(4);a.after(b)}};g.prototype._isAllowedOverElement=function(a){if(m.inArray(a.nodeName,k)<0){var b;b=a;if(b.nodeType===1){if(b.contentEditable==="inherit")for(;b.contentEditable==="inherit";)b=b.parentNode;b=b.contentEditable==="true"}else b=false;if(!b)return false;a=m(a);return a.parents(q.join(",")).length>0||a.is(c.join(","))||a&&this.$element&&a.parents("table").length!==0&&d.isTable(this.$element)?false:true}return false};g.prototype.onDragStop=function(){if(l(this.$overElement,
this.$element)){if(this.$overElement&&!this._isAllowedOverElement(this.$overElement[0])){this.enableInsertBeforeOrAfter(this.$overElement[0]);if(this.insertBeforeOrAfterMode===false)this.insertBeforeOrAfterMode="AFTER"}this.insertBeforeOrAfterMode!==false?this.insertBeforeOrAfterMode==="BEFORE"?this.$overElement.before(this.$element):this.$overElement.after(this.$element):this.$element.appendTo(this.$overElement);e.deactivateEditable();var a=e.getEditableHost(this.$element);a&&a.activate()}this.disableInsertBeforeOrAfter(this.$overElement)};
g.prototype._getHiglightElement=function(){if(void 0===this.$hElm)this.$hElm=m("#aloha-highlight-element").length===0?m("<div>").attr("id","aloha-highlight-element").appendTo("body").css({position:"absolute",opacity:0.5,background:"blue"}).hide():m("#aloha-highlight-element");return this.$hElm}});define("block/nls/i18n",{root:{"button.toggledragdrop.tooltip":"Toggle Drag & Drop"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("block/block-plugin","aloha aloha/plugin aloha/ephemera jquery aloha/contenthandlermanager block/blockmanager block/sidebarattributeeditor block/block block/editormanager block/blockcontenthandler block/editor block/dragbehavior ui/ui ui/toggleButton i18n!block/nls/i18n i18n!aloha/nls/i18n jqueryui".split(" "),
function(m,e,a,j,d,b,f,l,g,k,c,q,n,o,p){var r=["div","span"],e=e.create("block",{config:[],settings:{},init:function(){var e=this;if(!this.settings.rootTags)this.settings.rootTags=r;a.classes("aloha-block-active");a.classes("aloha-block-highlighted");b.registerBlockType("DebugBlock",l.DebugBlock);b.registerBlockType("DefaultBlock",l.DefaultBlock);b.registerBlockType("EmptyBlock",l.EmptyBlock);g.register("string",c.StringEditor);g.register("number",c.NumberEditor);g.register("url",c.UrlEditor);g.register("email",
c.EmailEditor);g.register("select",c.SelectEditor);g.register("radio",c.RadioButtonEditor);g.register("button",c.ButtonEditor);d.register("block",k);b.setDragDropState(e.isDragDropEnabled());b.registerEventHandlers();b.initializeBlockLevelDragDrop();m.bind("aloha-plugins-loaded",function(){e._createBlocks();false!==e.settings.sidebarAttributeEditor&&f.init()});this.createButtons();m.bind("aloha-editable-created",function(a,b){e.setDropzones(b.obj);b.obj.on("mscontrolselect",function(a){a.preventDefault()})});
m.bind("aloha-editable-activated",function(a,b){e.applyButtonConfig(b.editable)})},applyButtonConfig:function(a){if(this._isDragdropToggleEnabled(a)){this._toggleDragDropButton.show();this._toggleDragDropButton.setState(this._getDragdropState(a))}else this._toggleDragDropButton.hide()},_isDragdropToggleEnabled:function(a){a=this.getEditableConfig(a.obj);return(this.settings&&this.settings.config&&this.settings.config.toggleDragdropGlobal||a[0]==="toggleDragdrop"||a.toggleDragdrop==true||a.toggleDragdrop==
"true"||a.toggleDragdrop==1||a.toggleDragdrop=="1")&&this.isDragDropEnabled()},_getDragdropState:function(a){return this.settings&&this.settings.config&&this.settings.config.toggleDragdropGlobal?b.getDragDropState():a.obj.data("block-dragdrop")},_toggleDragdropState:function(a){if(this.settings&&this.settings.config&&this.settings.config.toggleDragdropGlobal){var c=!b.getDragDropState();b.setDragDropState(c);for(var d=0;d<m.editables.length;d++){a=m.editables[d];this._setDragDropStateForEditable(a.obj,
c)}}else{c=!a.obj.data("block-dragdrop");this._setDragDropStateForEditable(a.obj,c)}},createButtons:function(){var a=this;this._toggleDragDropButton=n.adopt("toggleDragDrop",o,{tooltip:p.t("button.toggledragdrop.tooltip"),icon:"aloha-icon aloha-icon-toggledragdrop",scope:"Aloha.continuoustext",click:function(){a._toggleDragdropState(m.activeEditable)}})},setDropzones:function(a){var b=this.getEditableConfig(a);(b=b&&b.dropzones||this.settings.dropzones)?a.data("block-dropzones",b):a.data("block-dropzones",
[".aloha-editable"])},isDragDropEnabled:function(){return this.settings&&typeof this.settings.dragdrop!=="undefined"?this.settings.dragdrop===true||this.settings.dragdrop==="true"||this.settings.dragdrop===1||this.settings.dragdrop==="1":true},_createBlocks:function(){if(!this.settings.defaults)this.settings.defaults={};j.each(this.settings.defaults,function(a,b){j(a).alohaBlock(b)})},_setDragDropStateForEditable:function(a,b){a.data("block-dragdrop",b);a.hasClass("ui-sortable")&&a.sortable("option",
"disabled",!b);a.find(".aloha-block.ui-draggable").each(function(){j(this).draggable("option","disabled",!b)});a.find(".aloha-block-handle").each(function(){b?j(this).addClass("aloha-block-draghandle"):j(this).removeClass("aloha-block-draghandle")})},makeClean:function(a){a.find(".aloha-block").removeClass("ui-draggable ui-draggable-disabled")}});j.fn.alohaBlock=function(a){a=a||{};j(this).each(function(c,d){b._blockify(d,a)});return j(this)};j.fn.mahaloBlock=function(){j(this).each(function(a,c){b._unblockify(c)})};
return e});define("align/align-table-utils",["util/arrays","util/dom","jquery"],function(m,e,a){function j(a){for(;a&&!(e.isEditingHost(a)&&null==a.className.match("aloha-table-cell-editable"));){if("TD"===a.nodeName||"TH"===a.nodeName)return a;a=a.parentNode}return null}return{isInsideTable:function(a){return null!=j(a)},getSelectedTableCells:function(d,b){var f=j(d),e;a:{for(e=f;e;){if("TABLE"===e.nodeName)break a;e=e.parentNode}e=null}return 0!==a(e).find(".aloha-cell-selected").length?m.coerce(a(e).find(".aloha-cell-selected")):
m.isEmpty(b)?[f]:b}}});define("align/nls/i18n",{root:{"button.alignright.tooltip":"Align to the right","button.alignleft.tooltip":"Align to the left","button.aligncenter.tooltip":"Center","button.alignjustify.tooltip":"Justify","button.aligntop.tooltip":"Align to the top","button.alignmiddle.tooltip":"Align to the middle","button.alignbottom.tooltip":"Align to the bottom"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("align/align-plugin","aloha aloha/plugin align/align-table-utils util/arrays util/html util/dom ui/ui ui/toggleButton i18n!align/nls/i18n i18n!aloha/nls/i18n jquery PubSub".split(" "),
function(m,e,a,j,d,b,f,l,g,k,c,q){function n(){var f=m.Selection.getRangeObject(),e=f.getRangeTree(),g=f.getCommonAncestorContainer(),k=[];c.each(e,function(){var a=this.domobj;if(this.type!=="none"&&a)if(d.isBlock(a))k.push(a);else{for(;a&&!d.isBlock(a);){if(d.isBlock(g)&&g===a.parentNode||b.isEditingHost(a.parentNode))break;a=a.parentNode}d.isBlock(a)&&k.push(a)}});k.length===0&&(e.length>0&&d.isBlock(g)&&!b.isEditingHost(g))&&k.push(g);a.isInsideTable(g)&&(k=a.getSelectedTableCells(g,k));return k}
return e.create("align",{_constructor:function(){this._super("align")},config:{alignment:["right","left","center","justify","top","middle","bottom"]},alignment:"",verticalAlignment:"",lastAlignment:"",lastVerticalAlignment:"",init:function(){this.createButtons();var a=this;m.bind("aloha-editable-activated",function(b,c){a.applyButtonConfig(c.editable.obj)});q.sub("aloha.selection.context-change",function(b){b=b.range;m.activeEditable&&a.buttonPressed(b)})},buttonPressed:function(a){this.horizontalButtonPressed(a);
this.verticalButtonPressed(a)},horizontalButtonPressed:function(a){var b=this;this.lastAlignment=this.alignment;this.alignment="";a.findMarkup(function(){if(this.style.textAlign!==""){b.alignment=this.style.textAlign;return true}b.alignment=c(this).css("text-align")},m.activeEditable.obj);if(this.alignment!=this.lastAlignment){this._alignRightButton.setState(false);this._alignLeftButton.setState(false);this._alignCenterButton.setState(false);this._alignJustifyButton.setState(false);switch(this.alignment){case "right":this._alignRightButton.setState(true);
break;case "center":this._alignCenterButton.setState(true);break;case "justify":this._alignJustifyButton.setState(true);break;default:this._alignLeftButton.setState(true);this.alignment="left"}}},verticalButtonPressed:function(a){var b=this;this.lastVerticalAlignment=this.verticalAlignment;this.verticalAlignment="";a.findMarkup(function(){if(this.style.verticalAlign!==""){b.verticalAlignment=this.style.verticalAlign;return true}b.verticalAlignment=c(this).css("vertical-align")},m.activeEditable.obj);
if(this.verticalAlignment!=this.lastVerticalAlignment){this._alignTopButton.setState(false);this._alignMiddleButton.setState(false);this._alignBottomButton.setState(false);switch(this.verticalAlignment){case "top":this._alignTopButton.setState(true);break;case "middle":this._alignMiddleButton.setState(true);break;case "bottom":this._alignBottomButton.setState(true);break;default:this._alignTopButton.setState(true);this.verticalAlignment="top"}}},applyButtonConfig:function(a){a=this.getEditableConfig(a);
if(!a||!a.alignment||this.settings.alignment)if(a[0]&&a[0].alignment)a=a[0];else if(this.settings.alignment)a.alignment=this.settings.alignment;if(typeof a.alignment==="undefined")a=this.config;c.inArray("right",a.alignment)!=-1?this._alignRightButton.show(true):this._alignRightButton.show(false);c.inArray("left",a.alignment)!=-1?this._alignLeftButton.show(true):this._alignLeftButton.show(false);c.inArray("center",a.alignment)!=-1?this._alignCenterButton.show(true):this._alignCenterButton.show(false);
c.inArray("justify",a.alignment)!=-1?this._alignJustifyButton.show(true):this._alignJustifyButton.show(false);c.inArray("top",a.alignment)!=-1?this._alignTopButton.show(true):this._alignTopButton.show(false);c.inArray("middle",a.alignment)!=-1?this._alignMiddleButton.show(true):this._alignMiddleButton.show(false);c.inArray("bottom",a.alignment)!=-1?this._alignBottomButton.show(true):this._alignBottomButton.show(false)},createButtons:function(){var a=this;this._alignLeftButton=f.adopt("alignLeft",
l,{tooltip:g.t("button.alignleft.tooltip"),icon:"aloha-icon aloha-icon-align aloha-icon-align-left",scope:"Aloha.continuoustext",click:function(){a.align("left")}});this._alignCenterButton=f.adopt("alignCenter",l,{tooltip:g.t("button.aligncenter.tooltip"),icon:"aloha-icon aloha-icon-align aloha-icon-align-center",scope:"Aloha.continuoustext",click:function(){a.align("center")}});this._alignRightButton=f.adopt("alignRight",l,{tooltip:g.t("button.alignright.tooltip"),icon:"aloha-icon aloha-icon-align aloha-icon-align-right",
scope:"Aloha.continuoustext",click:function(){a.align("right")}});this._alignJustifyButton=f.adopt("alignJustify",l,{tooltip:g.t("button.alignjustify.tooltip"),icon:"aloha-icon aloha-icon-align aloha-icon-align-justify",scope:"Aloha.continuoustext",click:function(){a.align("justify")}});this._alignTopButton=f.adopt("alignTop",l,{tooltip:g.t("button.aligntop.tooltip"),icon:"aloha-icon aloha-icon-align aloha-icon-align-top",scope:"table.cell",click:function(){a.verticalAlign("top")}});this._alignMiddleButton=
f.adopt("alignMiddle",l,{tooltip:g.t("button.alignmiddle.tooltip"),icon:"aloha-icon aloha-icon-align aloha-icon-align-middle",scope:"table.cell",click:function(){a.verticalAlign("middle")}});this._alignBottomButton=f.adopt("alignBottom",l,{tooltip:g.t("button.alignbottom.tooltip"),icon:"aloha-icon aloha-icon-align aloha-icon-align-bottom",scope:"table.cell",click:function(){a.verticalAlign("bottom")}})},verticalAlign:function(a){var b=m.Selection.getRangeObject();this.lastVerticalAlignment=this.verticalAlignment;
this.verticalAlignment=a;(a=this.getSelectedCells(b))&&this.toggleAlign(a,"vertical-align");if(this.verticalAlignment!=this.lastVerticalAlignment)switch(this.lastVerticalAlignment){case "top":this._alignTopButton.setState(false);break;case "middle":this._alignMiddleButton.setState(false);break;case "bottom":this._alignBottomButton.setState(false)}b.select()},align:function(a){this.lastAlignment=this.alignment;this.alignment=a;this.toggleAlign(n());if(this.alignment!==this.lastAlignment)switch(this.lastAlignment){case "right":this._alignRightButton.setState(false);
break;case "left":this._alignLeftButton.setState(false);break;case "center":this._alignCenterButton.setState(false);break;case "justify":this._alignJustifyButton.setState(false)}},getSelectedCells:function(a){var b,a=a.findMarkup(function(){c(this).is("td,th")&&(b=this);return c(this).is("table.aloha-table")},m.activeEditable.obj),a=c(a).find(".aloha-cell-selected");return a.length?a:b},toggleAlign:function(a,b){var b=b||"text-align",d=b==="vertical-align"?this.verticalAlignment:this.alignment,f=
true;c(a).each(function(){if(c(this).css(b)!=d)return f=false});c(a).each(function(){c(this).css(b)==d&&f?c(this).css(b,""):c(this).css(b,d)})}})});define("abbr/nls/i18n",{root:{"floatingmenu.tab.abbr":"Abbreviation","button.addabbr.tooltip":"insert abbreviation","button.remabbr.tooltip":"remove abbreviation","button.abbr.tooltip":"format as abbreviation","newabbr.defaulttext":"Abbr"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("abbr/abbr-plugin","aloha jquery PubSub aloha/plugin aloha/content-rules ui/ui ui/toggleButton ui/button ui/scopes ui/port-helper-attribute-field i18n!abbr/nls/i18n i18n!aloha/nls/i18n".split(" "),
function(m,e,a,j,d,b,f,l,g,k,c){function q(b){a.sub("aloha.editable.created",function(a){var a=a.editable,c=b.getEditableConfig(a.obj),c=c&&o.inArray("abbr",c)>-1&&d.isAllowed(a.obj[0],"abbr");p[a.getId()]=!!c});a.sub("aloha.editable.destroyed",function(a){delete p[a.editable.getId()]});a.sub("aloha.selection.context-change",function(a){if(m.activeEditable)if(p[m.activeEditable.getId()]){b._formatAbbrButton.show();b._insertAbbrButton.show();var c=a.range;if(a=b.findAbbrMarkup(c)){b.abbrField.show();
b.remAbbrButton.show();b.abbrField.setTargetObject(a,"title");b._formatAbbrButton.setState(true);b._insertAbbrButton.hide();for(var a=b.abbrField,c=c.findAllMarkupByTagName("ABBR",c),d=0,f=c.length;d<f;d++)a.addAdditionalTargetObject(c[d]);g.enterScope(b.name,"abbr")}else{b.abbrField.hide();b.remAbbrButton.hide();b.abbrField.setTargetObject(null);b._formatAbbrButton.setState(false);g.leaveScope(b.name,"abbr",true)}}else{b._formatAbbrButton.hide();b._insertAbbrButton.hide()}})}var n=window.GENTICS,
o=e,p={};return j.create("abbr",{config:["abbr"],init:function(){this.createButtons();this.bindInteractions();q(this)},createButtons:function(){var a=this;this._formatAbbrButton=b.adopt("formatAbbr",f,{tooltip:c.t("button.abbr.tooltip"),icon:"aloha-icon aloha-icon-abbr",scope:"Aloha.continuoustext",click:function(){a.formatAbbr()}});this._insertAbbrButton=b.adopt("insertAbbr",l,{tooltip:c.t("button.addabbr.tooltip"),icon:"aloha-icon aloha-icon-abbr",scope:"Aloha.continuoustext",click:function(){a.insertAbbr(false)}});
this.abbrField=new k({width:320,name:"abbrText",scope:"Aloha.continuoustext"});this.remAbbrButton=b.adopt("removeAbbr",l,{tooltip:c.t("button.remabbr.tooltip"),icon:"aloha-icon aloha-icon-abbr-rem",scope:"Aloha.continuoustext",click:function(){a.removeAbbr()}})},bindInteractions:function(){var a=this;this.abbrField.addListener("blur",function(){this.getValue()==""&&a.removeAbbr()});for(var b=0;b<m.editables.length;b++)m.editables[b].obj.keydown(function(b){if(b.metaKey&&b.which==71){if(a.findAbbrMarkup()){a.abbrField.foreground();
a.abbrField.focus()}else a.insertAbbr();b.stopPropagation();b.preventDefault();return false}})},findAbbrMarkup:function(a){typeof a=="undefined"&&(a=m.Selection.getRangeObject());return m.activeEditable?a.findMarkup(function(){return this.nodeName.toLowerCase()=="abbr"},m.activeEditable.obj):null},formatAbbr:function(){var a=m.Selection.getRangeObject();m.activeEditable&&(this.findAbbrMarkup(a)?this.removeAbbr():this.insertAbbr())},insertAbbr:function(a){var b=m.Selection.getRangeObject();if(!this.findAbbrMarkup(b)){b.isCollapsed()&&
a!=false&&n.Utils.Dom.extendToWord(b);if(b.isCollapsed()){var a=c.t("newabbr.defaulttext"),d=e('<abbr title="">'+a+"</abbr>");n.Utils.Dom.insertIntoDOM(d,b,e(m.activeEditable.obj));b.startContainer=b.endContainer=d.contents().get(0);b.startOffset=0;b.endOffset=a.length}else{d=e('<abbr title=""></abbr>');n.Utils.Dom.addMarkup(b,d,false)}b.select();this.abbrField.foreground();this.abbrField.focus()}},removeAbbr:function(){var a=m.Selection.getRangeObject(),b=this.findAbbrMarkup();if(b){n.Utils.Dom.removeFromDOM(b,
a,true);a.select()}},makeClean:function(){},toString:function(){return"abbr"}})});define("horizontalruler/nls/i18n",{root:{"button.addhr.tooltip":"Add a horizontal ruler"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("horizontalruler/horizontalruler-plugin","aloha jquery PubSub aloha/plugin aloha/content-rules util/dom ui/ui ui/button i18n!horizontalruler/nls/i18n".split(" "),function(m,e,a,j,d,b,f,l,g){var k={},c=f.adopt("insertHorizontalRule",l,{tooltip:g.t("button.addhr.tooltip"),
iconOnly:true,icon:"aloha-icon-horizontalruler",scope:"Aloha.continuoustext",click:function(){if(m.activeEditable){var a=m.Selection.getRangeObject();b.insertIntoDOM(e("<hr>"),a,m.activeEditable.obj,true);a.select()}}});return j.create("horizontalruler",{_constructor:function(){this._super("horizontalruler")},config:["hr"],init:function(){var b=this;a.sub("aloha.editable.created",function(a){var a=a.editable,c=b.getEditableConfig(a.obj),c=c&&e.inArray("hr",c)>-1&&d.isAllowed(a.obj[0],"hr");k[a.getId()]=
!!c});a.sub("aloha.editable.destroyed",function(a){delete k[a.editable.getId()]});a.sub("aloha.editable.activated",function(a){c.show(!!k[a.editable.getId()])})}})});define("paste/paste-plugin","jquery aloha/core aloha/plugin aloha/command contenthandler/contenthandler-utils aloha/console aloha/copypaste aloha/contenthandlermanager util/browser".split(" "),function(m,e,a,j,d,b,f,l,g){var k,c;function q(a,b){b.css({top:p.scrollTop(),left:p.scrollLeft()-200,width:200,overflow:"hidden"}).contents().remove();
var c=f.getEditableAt(a);c&&c.obj.blur();f.setSelectionAt({startContainer:b[0],endContainer:b[0],startOffset:0,endOffset:0});b.focus()}function n(a,g,j){a.metaKey=null;a.stopPropagation();window.setTimeout(function(){if(g){var m;m=x.html();var q=/^<h\d+.*?>/i.exec(m),p;if(q!==null){q=q[0];p="</"+q.substr(1);m=m.replace(q,"").replace(p,"")}m=(q=l.get("formatless"))?q.handleContent(m):m;r&&/^&nbsp;/.test(m)&&(m=m.substring(6));(q=f.getEditableAt(g))&&(e.browser.mozilla&&document.activeElement!==q.obj[0])&&
q.obj.focus();f.setSelectionAt(g);window.scrollTo(k,c);q=g.startContainer;if(1===q.nodeType?"p"===q.nodeName.toLowerCase()&&d.isProppedParagraph(q.outerHTML):3===q.nodeType&&"p"===q.parentNode.nodeName.toLowerCase()&&1===q.parentNode.childNodes.length&&t.test(window.escape(q.data))){3===g.startContainer.nodeType?g.startContainer.data="":g.startContainer.innerHTML=" ";g.startOffset=0;if(g.endContainer===g.startContainer)g.endOffset=0}e.queryCommandSupported("insertHTML")?e.execCommand("insertHTML",
false,m):b.error("Common.Paste",'Command "insertHTML" not available. Enable the plugin "common/commands".');x.contents().remove();typeof j==="function"&&j()}e.activeEditable.smartContentChange(a)},10)}function o(a){var b=a[0].ownerDocument;g.ie&&b.documentMode>=9?a.bind("beforepaste",function(a){if(!(a.target.nodeName==="INPUT"||a.target.nodeName==="TEXTAREA")){k=window.scrollX||document.documentElement.scrollLeft;c=window.scrollY||document.documentElement.scrollTop;v=f.getRange();q(v,x);a.stopPropagation()}}):
a.bind("paste",function(a){if(!(a.target.nodeName==="INPUT"||a.target.nodeName==="TEXTAREA")){k=window.scrollX||document.documentElement.scrollLeft;c=window.scrollY||document.documentElement.scrollTop;var b=f.getRange();q(b,x);if(r){a.preventDefault();document.selection.createRange().execCommand("paste")}n(a,b)}})}var p=m(window),r=!!e.browser.msie,t=/^(\s|%A0)$/,x=m('<div style="position:absolute; clip:rect(0px,0px,0px,0px); width:1px; height:1px;"></div>').contentEditable(true),v=null;c=k=0;return a.create("paste",
{settings:{},init:function(){m("body").append(x);e.bind("aloha-editable-created",function(a,b){o(b.obj)});g.ie&&x[0].ownerDocument.documentMode>=9&&x.bind("paste",function(a){n(a,v,function(){v=null})})},register:function(){b.deprecated("Plugins.Paste","register() for pasteHandler is deprecated.  Use the ContentHandler Plugin instead.")}})});define("autoparagraph/autoparagraph-plugin","jquery PubSub aloha/plugin aloha/core aloha/content-rules util/html util/dom".split(" "),function(m,e,a,j,d,b,f){function l(a){if(a){var c=
a.obj;if(c){var d=c[0],e,g=j.Selection.rangeObject,l=false;if(f.allowsNesting(d,m("<p></p>")[0])){var r=[],t;c.contents().each(function(){if(b.isBlock(this))t=null;else{if(!t){t={objs:[]};r.push(t)}t.objs.push(this)}});for(c=0;c<r.length;c++){l=r[c];e=f.getIndexInParent(l.objs[0]);var x=f.getIndexInParent(l.objs[l.objs.length-1]),v=m("<p></p>");if(g.startContainer===d)if(g.startOffset>e&&g.startOffset<=x){g.startContainer=v[0];g.startOffset=g.startOffset-e}else if(g.startOffset>x)g.startOffset=g.startOffset-
(x-e);if(g.endContainer===d)if(g.endOffset>e&&g.endOffset<=x){g.endContainer=v[0];g.endOffset=g.endOffset-e}else if(g.endOffset>x)g.endOffset=g.endOffset-(x-e);m(l.objs[0]).before(v);for(e=0;e<l.objs.length;e++)v[0].appendChild(l.objs[e]);l=true}l&&a.isActive&&g.select()}}}}var g={};return a.create("autoparagraph",{config:["autoparagraph"],init:function(){var a=this;e.sub("aloha.editable.created",function(b){var b=b.editable,f=a.getEditableConfig(b.obj),f=f&&m.inArray("autoparagraph",f)>-1&&d.isAllowed(b.obj[0],
"p");g[b.getId()]=!!f;f&&l(b)});j.bind("aloha-smart-content-changed",function(a,b){g[b.editable.getId()]&&l(b.editable)})}})});define("toc/nls/i18n",{root:{"button.addtoc.tooltip":"Table of contents"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("toc/toc-plugin","jquery PubSub aloha aloha/plugin aloha/content-rules ui/ui ui/button util/dom i18n!toc/nls/i18n".split(" "),function(m,e,a,j,d,b,f,l,g){function k(a,b){return c(a,function(a){return a===b})}function c(a,b){for(var c=0;c<
a.length;c++)if(b(a[c]))return a[c];return null}function q(a,b){for(var c=[],d=0;d<a.length;d++)c.push(b(a[d]));return c}function n(){return m(q(a.editables,function(a){return document.getElementById(a.getId())}))}function o(a){var b;typeof a==="object"?b=m(a).text().replace(/[^a-zA-Z-]+/g,"-").replace(/^[^a-zA-Z]+/,""):a&&(b=a);for(var c=0;;c++){var d=b;c&&(d=d+("-"+c));var f=m("#"+d);if(f.length===0||typeof a==="object"&&f===a)return d}}var p=null,r=[],t={};return j.create("toc",{minEntries:0,updateInterval:5E3,
config:["toc"],init:function(){var a=this;if(typeof a.settings.minEntries==="undefined")a.settings.minEntries=a.minEntries;if(typeof a.settings.updateInterval==="undefined")a.settings.updateInterval=a.updateInterval;a._insertTocButton=b.adopt("insertToc",f,{tooltip:g.t("button.addtoc.tooltip"),icon:"aloha-icon aloha-icon-orderedlist",scope:"Aloha.continuoustext",click:function(){a.insertAtSelection(p)}});e.sub("aloha.editable.created",function(b){var c=b.editable,f=a.getEditableConfig(c.obj),c=f&&
m.inArray("toc",f)>-1&&d.isAllowed(c.obj[0],"ol");t[b.editable.getId()]=c});e.sub("aloha.editable.destroyed",function(a){delete t[a.editable.getId()]});e.sub("aloha.editable.activated",function(b){a._insertTocButton.show(t[b.editable.getId()])});m(document).ready(function(){a.spawn()})},register:function(a){p=a},insertAtSelection:function(b){if(a.activeEditable){var b=b||n(),c=o("toc"),d=m('<ol class="toc_root"></ol>').attr("id",c).attr("contentEditable","false");l.insertIntoDOM(d,a.Selection.getRangeObject(),
m("#"+a.activeEditable.getId()));this.create(c).register(b).update().tickTock()}},spawn:function(a,b){var c=this,a=a||m("body"),b=b||n();a.find("ol.toc_root").each(function(){var a=m(this).attr("id");if(!a){a=o("toc");m(this).attr("id",a)}c.create(a).register(b).tickTock()})},create:function(a){r.push(this);return{id:a,$containers:m(),settings:this.settings,root:function(){return m("#"+this.id)},register:function(a){var b=this;b.$containers=b.$containers.add(a);b.$containers.filter(function(){return!m(this).data("toc."+
b.id+".listening")}).each(function(){var a=m(this);a.data("toc."+b.id+".listening",true);a.bind("blur",function(){b.cleanupIds(a.get(0));b.update(a)})});return b},tickTock:function(a){var b=this;if(a=a||this.settings.updateInterval){window.setInterval(function(){b.register(n());b.update()},a);return b}},cleanupIds:function(a){var b=[];this.headings(this.$containers).each(function(){var c=m(this).attr("id");(c&&-1!=m.inArray(c,b)||a&&(m.contains(a,this)||a===this))&&m(this).attr("id",o(this));b.push(c)});
return this},update:function(){var a=this,b=this.outline(a.$containers),c=[a.root()];c[c.length-1].empty();(function F(b){var d=[];q(b,function(b){var f=a.linkSection(b[0],c,d);c.push(f);F(b.slice(1));c.pop();d.push(f)})})(b.slice(1));b=a.root().attr("data-TOC-minEntries")||this.settings.minEntries;a.root().find("li").length>=b?a.root().show():a.root().hide();return this},linkSection:function(a,b,c){var d=a.eq(0).attr("id");if(!d){d=o(a.get(0));a.eq(0).attr("id",d)}var f=this.root(),e=d?f.find('a[href $= "#'+
d+'"]'):m();e.length||(e=m("<li><a></a></li>"));e.find("a").attr("href","#"+d).text(a.eq(0).text());c[c.length-1]?c[c.length-1].after(e):b[b.length-1].get(0)===f.get(0)?f.append(e):b[b.length-1].append(m("<ol></ol>").append(e));return e},outline:function(a){var b=[m()],d=[b];this.headings(a).each(function(){var a=m(this),b=this.nodeName.toLowerCase(),f=["h6","h5","h4","h3","h2","h1"],b=m.inArray(b,f),f=f.slice(b).join(","),f=[a.nextUntil(f).andSelf()],b=c(d,function(b){b=b[0];return!b.length||c(b,
function(b){return a.get(0)===b||m.contains(b,a.get(0))})});b.push(f);d.splice(0,k(d,b),f)});return b},headings:function(a){return a.find(":header").add(a.filter(":header"))}}}})});define("cite/nls/i18n",{root:{"cite.button.add.quote":"Format selection as quote","cite.button.add.blockquote":"Format selection as blockquote","button.removeCite.tooltip":"Remove cite"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("cite/cite-plugin","aloha jquery PubSub aloha/plugin aloha/content-rules aloha/sidebar ui/ui ui/toggleButton ui/scopes ui/port-helper-attribute-field format/format-plugin util/dom i18n!cite/nls/i18n".split(" "),
function(m,e,a,j,d,b,f,l,g,k,c,q,n){function o(a,b){return a.replace(/\{([a-z0-9\-\_]+)\}/ig,function(a,c){var d=b[c]||a;return typeof d==="function"?d():d})}function p(){var a=[],b=z;e.each(arguments,function(){a.push("."+(""===this?b:b+"-"+this))});return e.trim(a.join(" "))}function r(){var a=[],b=z;e.each(arguments,function(){a.push(""===this?b:b+"-"+this)});return e.trim(a.join(" "))}function t(a){a.removeCiteButton=f.adopt("removeCite",l,{tooltip:n.t("button.removeCite.tooltip"),icon:"aloha-icon aloha-icon-unlink",
scope:"Aloha.continuoustext",click:function(){a.removeQuote()}});a.citeHrefField=k({name:"editCite",width:320,placeholder:"Link",cls:"aloha-cite-href-field",scope:"Aloha.continuoustext",noTargetHighlight:false,targetHighlightClass:"aloha-focus"});a.citeNoteField=k({name:"editNote",width:320,placeholder:"Note",cls:"aloha-cite-note-href-field",scope:"Aloha.continuoustext",noTargetHighlight:false,targetHighlightClass:"aloha-focus"});if(!a.referenceContainer){a.citeNoteField.setValue("");a.citeNoteField.hide()}var b=
function(){var b=a.citeHrefField.getValue(),c=null;a.referenceContainer&&(c=a.citeNoteField.getValue());if(typeof a.sideBarPanel!=="undefined"){a.sideBarPanel.content.find(p("link-field input")).val(b);a.sideBarPanel.content.find(p("note-field textarea")).val(c)}a.effective.attr("cite",b);a.addCiteDetails(a.effective.attr("data-cite-id"),b,c)};a.citeHrefField.getInputJQuery().bind("keyup change",b);a.citeNoteField.getInputJQuery().bind("keyup change",b)}function x(a){m.ready(function(){a.sidebar=
b.right.show().addPanel({id:r("sidebar-panel"),title:"Citation",content:"",expanded:true,activeOn:"q, blockquote",onInit:function(){var b=this,c=a.referenceContainer?'<label class="{panel-label}" for="{note-field}-textarea">Note</label><div class="{panel-field} {note-field}" style="margin: 5px;"><textarea id="{note-field}-textarea"></textarea></div>':"";this.setContent(typeof('<label class="{panel-label}" for="{link-field}-input">Link</label><div class="{panel-field} {link-field}" style="margin: 5px;"><input type="text" id="{link-field}-input" /></div>'+
c)==="string"?o('<label class="{panel-label}" for="{link-field}-input">Link</label><div class="{panel-field} {link-field}" style="margin: 5px;"><input type="text" id="{link-field}-input" /></div>'+c,F):'<label class="{panel-label}" for="{link-field}-input">Link</label><div class="{panel-field} {link-field}" style="margin: 5px;"><input type="text" id="{link-field}-input" /></div>'+c).content.find("input, textarea").bind("keyup change",function(){var c=b.content.find(p("note-field textarea")).val(),
d=b.content.find(p("link-field input")).val();if(a.showOnToolbar){a.citeNoteField.setValue(c);a.citeHrefField.setValue(d)}a.addCiteDetails(b.content.attr("data-cite-id"),d,c)})},onActivate:function(b){var c=v(b),d=a.getIndexOfCitation(c);this.content.attr("data-cite-id",c);this.content.find(p("link-field input")).val(b.attr("cite"));this.content.find(p("note-field textarea")).val(a.citations[d].note)}});a.sideBarPanel=b.right.getPanelById(r("sidebar-panel"))})}function v(a){var b=a.attr("data-cite-id");
if(!b){b=++C;a.addClass(""+r("wrapper"));a.addClass("aloha-cite-"+b);a.attr("data-cite-id",b)}return b}var u={},z="aloha-cite",C=(new Date).getTime(),F={quote:r("quote"),blockquote:r("blockquote"),"panel-label":r("panel-label"),"panel-field":r("panel-field"),"panel-btns":r("panel-btns"),"link-field":r("link-field"),"note-field":r("note-field"),references:r("references")};return j.create("cite",{citations:[],referenceContainer:null,settings:null,sidebar:null,config:["quote","blockquote"],init:function(){var b=
this;if(m.settings&&m.settings.plugins&&m.settings.plugins.cite){var k=e(m.settings.plugins.cite.referenceContainer);b.showOnToolbar=!!m.settings.plugins.cite.showOnToolbar;if(k.length)b.referenceContainer=k;if(typeof m.settings.plugins.cite!=="undefined")b.settings=m.settings.plugins.cite;if(typeof b.settings.sidebar==="undefined")b.settings.sidebar={};k=b.settings.sidebar;if(typeof k.open==="undefined")k.open=true;if(typeof k.open==="string")k.open=!(k.open==="0"||k.open.toLowerCase()==="false")}this._quoteButton=
f.adopt("quote",l,{tooltip:n.t("cite.button.add.quote"),icon:r("button","inline-button"),scope:"Aloha.continuoustext",click:function(){b.removeQuote()||b.addInlineQuote()}});x(this);c.multiSplitButton.pushItem({name:"blockquote",tooltip:n.t("cite.button.add.blockquote"),icon:r("button","block-button"),click:function(){b.removeQuote()||b.addBlockQuote()}});a.sub("aloha.editable.created",function(a){var a=a.editable,c=b.getEditableConfig(a.obj),f=c&&e.inArray("quote",c)>-1&&d.isAllowed(a.obj[0],"q"),
c=c&&e.inArray("blockquote",c)>-1&&d.isAllowed(a.obj[0],"blockquote");u[a.getId()]={quote:f,blockquote:c}});a.sub("aloha.editable.activated",function(a){a=u[a.editable.getId()];b._quoteButton.show(!!a.quote);a.blockquote?c.multiSplitButton.showItem("blockquote"):c.multiSplitButton.hideItem("blockquote")});b.showOnToolbar&&t(b);a.sub("aloha.editable.destroyed",function(a){delete u[a.editable.getId()]});a.sub("aloha.selection.context-change",function(a){var d=false,f=false,k=a.range.markupEffectiveAtStart,
j=k.length;for(b.effective=e();j;){a=k[--j].nodeName;if(a==="Q"){d=true;v(e(k[j]));e.merge(b.effective,e(k[j]))}else if(a==="BLOCKQUOTE"){f=true;v(e(k[j]));e.merge(b.effective,e(k[j]))}}if(b.showOnToolbar)if(d||f){b.citeHrefField.show();b.removeCiteButton.show();(a=b.effective.attr("cite"))?b.citeHrefField.setValue(a):b.citeHrefField.setPlaceholder();a=b.getIndexOfCitation(b.effective.attr("data-cite-id"));(a=b.citations[a].note)?b.citeNoteField.setValue(a):b.citeNoteField.setPlaceholder();g.enterScope(b.name,
"cite");b.citeHrefField.foreground()}else{b.citeHrefField.hide();b.removeCiteButton.hide();b.removeCiteButton.setState(false);g.leaveScope(b.name,"cite",true)}b._quoteButton.setState(d);f&&c.multiSplitButton.setActiveItem("blockquote");if(m.activeEditable){d=u[m.activeEditable.getId()];b._quoteButton.show(!!d.quote);d.blockquote?c.multiSplitButton.showItem("blockquote"):c.multiSplitButton.hideItem("blockquote")}})},getIndexOfCitation:function(a){for(var b=this.citations,c=b.length,d=0,f,e;d<c;){f=
d+c>>1;e=b[f].uid;if(e==a)return f;e>a?c=f:e<a&&(d=f+1)}return this.citations.push({uid:a,link:null,notes:null})-1},addBlockQuote:function(){m.activeEditable&&m.activeEditable.obj.click();var a=e('<blockquote class="aloha-cite-wrapper aloha-cite-'+ ++C+'" data-cite-id="'+C+'"></blockquote>');m.Selection.changeMarkupOnSelection(a);this.referenceContainer&&this.addCiteToReferences(C);this.sidebar&&(this.settings&&this.settings.sidebar&&this.settings.sidebar.open)&&this.sidebar.sidebar.open()},removeQuote:function(){var a,
b=m.Selection.rangeObject;m.activeEditable&&e(m.activeEditable.obj[0]).click();if(a=b.findMarkup(function(){return this.nodeName&&typeof this.nodeName==="string"?this.nodeName==="Q"||this.nodeName==="BLOCKQUOTE":false},m.activeEditable.obj)){a=e(a).attr("data-cite-id");this.removeCiteFromReferences(a);e("q[data-cite-id="+a+"],blockquote[data-cite-id="+a+"]").each(function(){if(this.nodeName==="BLOCKQUOTE"){var a=e("<p></p>");a.append(this.childNodes);this.parentNode.replaceChild(a[0],this)}else q.removeFromDOM(this,
b,true)});b.select();return true}return false},addInlineQuote:function(){var a=[r("wrapper"),r(++C)].join(" "),a=e(o('<q class="{classes}" data-cite-id="{uid}"></q>',{uid:C,classes:a})),c=m.Selection.rangeObject;c.isCollapsed()&&q.extendToWord(c);q.addMarkup(c,a);if(e("[data-cite-id="+C+"]").length!==0){c.select();this.referenceContainer&&this.addCiteToReferences(C);this.sidebar&&(this.settings&&this.settings.sidebar&&this.settings.sidebar.open)&&b.right.open();return false}},createCiteAnchor:function(a,
b,c){return o('<sup id="{ref}" contenteditable="false"><a href="#{note}">[{count}]</a></sup>',{ref:a,note:b,count:c+1})},removeCiteFromReferences:function(a){var b=this.getIndexOfCitation(a),c=e(".aloha-editable-active "+p(a)),d="cite-note-"+a,a="cite-ref-"+a;this.citations.splice(b,1);c.find("sup#"+a).remove();this.createCiteAnchor(a,d,b);if(this.referenceContainer){this.referenceContainer.find("ol.references li#"+d).remove();if(0===this.referenceContainer.find("ol.references li").length){this.referenceContainer.find("h2").remove();
this.referenceContainer.find("ol.references").remove()}else for(;b<this.citations.length;b++){c=e(".aloha-editable-active "+p(this.citations[b].uid));d="cite-note-"+this.citations[b].uid;a="cite-ref-"+this.citations[b].uid;c.find("sup#cite-ref-"+this.citations[b].uid).remove();c.append(this.createCiteAnchor(a,d,b))}}},addCiteToReferences:function(a){var b=this.getIndexOfCitation(a),c=e(".aloha-editable-active "+p(a)),d="cite-note-"+a,a="cite-ref-"+a;c.append(this.createCiteAnchor(a,d,b));0===this.referenceContainer.find("ol.references").length&&
this.referenceContainer.append("<h2>References</h2>").append('<ol class="references"></ol>');this.referenceContainer.find("ol.references").append(o('<li id="{note}"><a href="#{ref}">^</a> &nbsp; <span></span></li>',{ref:a,note:d}))},addCiteDetails:function(a,b,c){this.citations[this.getIndexOfCitation(a)]={uid:a,link:b,note:c};b&&e(".aloha-cite-"+a).attr("cite",b);this.referenceContainer&&e("li#cite-note-"+a+" span").html((b?'<a class="external" target="_blank" href="'+b+'">'+b+"</a>":"")+(c?". "+
c:""))},makeClean:function(a){var b=this;a.find("q,blockquote").each(function(){var a=e(this);e.trim(a.attr("class"))===""&&a.removeAttr("class");if(!b.referenceContainer){a.removeClass("aloha-cite-"+a.attr("data-cite-id"));a.attr("data-cite-id")!=null&&a.removeAttr("data-cite-id")}a.removeClass("aloha-cite-wrapper")})}})});define("numerated-headers/nls/i18n",{root:{"headerids.label.target":"Target","headerids.button.reset":"Reset","headerids.button.set":"Set","button.numeratedHeaders.tooltip":"Toggle header numeration"},
ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("numerated-headers/numerated-headers-plugin","aloha/core aloha/ephemera jquery aloha/plugin ui/ui ui/toggleButton util/browser i18n!numerated-headers/nls/i18n i18n!aloha/nls/i18n".split(" "),function(m,e,a,j,d,b,f,l){var g={};m.bind("aloha-editable-destroyed",function(a,b){delete g[b.getId()]});return j.create("numerated-headers",{config:{numeratedactive:true,headingselector:"h1, h2, h3, h4, h5, h6",trailingdot:false},init:function(){var a=
this;this._formatNumeratedHeadersButton=d.adopt("formatNumeratedHeaders",b,{tooltip:l.t("button.numeratedHeaders.tooltip"),icon:"aloha-icon aloha-icon-numerated-headers",scope:"Aloha.continuoustext",click:function(){a._formatNumeratedHeadersButton.getState()?a.createNumeratedHeaders():a.removeNumerations()}});m.bind("aloha-smart-content-changed",function(){a.cleanNumerations();a.showNumbers()&&a.createNumeratedHeaders()});m.bind("aloha-format-block",function(){a.cleanNumerations();a.showNumbers()&&
a.createNumeratedHeaders()});m.bind("aloha-editable-activated",function(){if(a.isNumeratingOn()){a._formatNumeratedHeadersButton.show();a.initForEditable(m.activeEditable.obj)}else a._formatNumeratedHeadersButton.hide()})},initForEditable:function(a){var b=a.attr("aloha-numerated-headers");if(b!=="true"&&b!=="false"){b=true===this.getCurrentConfig().numeratedactive?"true":"false";a.attr("aloha-numerated-headers",b)}if(b==="true"){this.createNumeratedHeaders();this._formatNumeratedHeadersButton.setState(true)}else this._formatNumeratedHeadersButton.setState(false)},
getCurrentConfig:function(){var b=this.getEditableConfig(m.activeEditable.obj);b.numeratedactive=b.numeratedactive===true||b.numeratedactive==="true"||b.numeratedactive==="1"?true:false;if(typeof b.headingselector!=="string")b.headingselector="h1, h2, h3, h4, h5, h6";b.headingselector=a.trim(b.headingselector);b.trailingdot=b.trailingdot===true||b.trailingdot==="true"||b.trailingdot==="1"?true:false;return b},isNumeratingOn:function(){return this.getCurrentConfig().headingselector!==""},showNumbers:function(){return m.activeEditable&&
this.isNumeratingOn()&&m.activeEditable.obj.attr("aloha-numerated-headers")==="true"},cleanNumerations:function(){var b=this.getBaseElement();if(b){a("div.aloha-numerated-headers-annotation-wrapper>span[role=annotation]").unwrap();this._safeRemoveAnnotations(a(b).find("span[role=annotation]"))}},_safeRemoveAnnotations:function(b){var c=this,d=m.Selection.getRangeObject(),f=false;b.each(function(){if(d.startContainer===this||a.inArray(this,a(d.startContainer).parents())>-1){d.startContainer=c._prevNode(this);
d.startOffset=0;f=true}if(d.startContainer===this.parentNode&&d.startOffset>=a(this).index()&&d.startOffset>0){d.startOffset--;f=true}if(d.endContainer===this||a.inArray(this,a(d.endContainer).parents())>-1){d.endContainer=c._prevNode(this);d.endOffset=0;f=true}if(d.endContainer===this.parentNode&&d.endOffset>=a(this).index()&&d.endOffset>0){d.endOffset--;f=true}a(this).remove()});if(f===true){d.update();d.select()}},_prependAnnotation:function(b,c){var d=m.Selection.getRangeObject(),g=false;if(d.startContainer===
c){d.startOffset++;g=true}if(d.endContainer===c){d.endOffset++;g=true}var j=a('<span role="annotation">'+b+"</span>"),j=a('<div class="aloha-numerated-headers-annotation-wrapper" style="display: '+(f.ie7?"inline":"inline-block")+';" contenteditable="false"></div>').append(j);e.markWrapper(j);a(c).prepend(j);if(g===true){d.update();d.select()}},_prevNode:function(a){var b=a.previousSibling;if(!b)return a.parentNode;for(;b.lastChild;)b=b.lastChild;return b},removeNumerations:function(){a(m.activeEditable.obj).attr("aloha-numerated-headers",
"false");this.cleanNumerations()},getBaseElement:function(){return typeof this.baseobjectSelector!=="undefined"?a(this.baseobjectSelector).length>0?a(this.baseobjectSelector):null:m.activeEditable?m.activeEditable.obj:null},hasNote:function(b){return!b||a(b).length<=0?false:a(b).find("span[role=annotation]").length>0},hasContent:function(b){if(!b||0===a(b).length)return false;b=a(b).clone().find("span[role=annotation]").remove().end();return a.trim(b.text()).length>0},createNumeratedHeaders:function(){var b=
this.getBaseElement();if(b){var c=this.getCurrentConfig(),b=b.find(c.headingselector);m.activeEditable.obj.attr("aloha-numerated-headers","true");if(!(typeof b==="undefined"||b.length===0)){var d=7,f=this;b.each(function(){if(f.hasContent(this)){var a=parseInt(this.nodeName.substr(1),10);a<d&&(d=a)}});if(!(d>6)){var e=null,g=[],j=0,l;for(l=0;l<6-d+1;l++)g[l]=0;b.each(function(){if(f.hasContent(this)){var b=parseInt(this.nodeName.substr(1),10);if(e===null&&b!==d)f._safeRemoveAnnotations(a(this).find("span[role=annotation]"));
else{if(e===null)g[j]++;else if(b>e)g[++j]++;else if(b===e)g[j]++;else if(b<e){var k=b-d,l;for(l=j;l>k;l--)g[l]=0;j=k;g[j]++}e=b;b="";if(c.trailingdot===true){b="";for(k=0;k<g.length;k++)g[k]!==0&&(b=b+(g[k]+"."))}else{b=g[0];for(k=1;k<g.length;k++)g[k]!==0&&(b=b+("."+g[k]))}b=b+"&nbsp;";f.hasNote(this)&&f._safeRemoveAnnotations(a(this).find("span[role=annotation]"));f._prependAnnotation(b,this)}}else f.hasNote(this)&&f._safeRemoveAnnotations(a(this).find("span[role=annotation]"))})}}}}})});define("formatlesspaste/formatlesshandler",
["aloha","jquery","aloha/contenthandlermanager"],function(m,e,a){function j(a,b){a.find(b.join(",")).each(function(){0===e(this).contents().length?e(this).remove():e(this).contents().unwrap()})}return a.createHandler({enabled:!1,handleContent:function(a){var b;"string"===typeof a?b=e("<div>"+a+"</div>"):a instanceof e&&(b=e("<div>").append(a));if(!b.find(".aloha-block").length)return this.enabled&&j(b,this.strippedElements),b.html()}})});define("formatlesspaste/nls/i18n",{root:{"button.formatlessPaste.tooltip":"Keep/Discard formatting"},
ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("formatlesspaste/formatlesspaste-plugin","aloha/core aloha/plugin jquery ui/ui ui/toggleButton formatlesspaste/formatlesshandler aloha/contenthandlermanager i18n!formatlesspaste/nls/i18n util/html".split(" "),function(m,e,a,j,d,b,f,l,g){function k(a){return!a?false:typeof a==="string"?"0"!==a&&"false"!==a.toLowerCase():true}function c(a){var b={};if(typeof a.formatlessPasteOption!=="undefined")b.formatlessPasteOption=k(a.formatlessPasteOption);
if(typeof a.strippedElements!=="undefined")b.strippedElements=a.strippedElements;if(typeof a.button!=="undefined")b.button=k(a.button);return b}function q(a,c){f.register("formatless",b);b.strippedElements=c.strippedElements||g.TEXT_LEVEL_SEMANTIC_ELEMENTS;a._toggleFormatlessPasteButton=j.adopt("toggleFormatlessPaste",d,{tooltip:l.t("button.formatlessPaste.tooltip"),icon:"aloha-icon aloha-icon-formatless-paste",scope:"Aloha.continuoustext",click:function(){b.enabled=!b.enabled}});a._toggleFormatlessPasteButton.show(a.button);
if(true===a.formatlessPasteOption){a._toggleFormatlessPasteButton.setState(true);b.enabled=true}else if(false===a.formatlessPasteOption){a._toggleFormatlessPasteButton.setState(false);b.enabled=false}}function n(a,b){var d=b.getId();if(!d)return null;if(o[d])return o[d];var f=a.getEditableConfig(b.obj);if(!f)return null;o[d]=c(f);return o[d]}var o={};m.bind("aloha-editable-destroyed",function(a,b){var c=b.getId();c&&o[c]&&delete o[c]});return e.create("formatlesspaste",{formatlessPasteOption:false,
button:true,init:function(){var d=this,f=c(d.settings.config||d.settings);a.extend(d,f);q(d,f);m.bind("aloha-editable-activated",function(a,c){var f=n(d,c.editable);if(f){var e=d._toggleFormatlessPasteButton;if(true===f.formatlessPasteOption){e.setState(true);b.enabled=true}else if(false===f.formatlessPasteOption){e.setState(false);b.enabled=false}b.strippedElements=f.strippedElements||g.TEXT_LEVEL_SEMANTIC_ELEMENTS;e.show(false!==f.button)}})}})});(function(){var m=!1,e=/xyz/.test(function(){xyz})?
/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(){function a(){!m&&this.init&&this.init.apply(this,arguments)}var j=this.prototype;m=!0;var d=new this;m=!1;for(var b=0;b<arguments.length;b++){var f=arguments[b],l;for(l in f)d[l]="function"==typeof f[l]&&"function"==typeof j[l]&&e.test(f[l])?function(a,b){return function(){var c=this._super;this._super=j[a];var d=b.apply(this,arguments);this._super=c;return d}}(l,f[l]):f[l]}a.prototype=d;a.constructor=a;a.extend=arguments.callee;return a}})();
"function"===typeof define&&define("Class",[],function(){return Class});define("jstree",["jquery"],function(m){(function(){if(!m||!m.jstree){var e=!1,a=!1,j=!1;(function(d){d.vakata={};d.vakata.css={get_css:function(a,b,d){var a=a.toLowerCase(),f=d.cssRules||d.rules,e=0;do{if(f.length&&e>f.length+5)break;if(f[e].selectorText&&f[e].selectorText.toLowerCase()==a)return!0===b?(d.removeRule&&d.removeRule(e),d.deleteRule&&d.deleteRule(e),!0):f[e]}while(f[++e]);return!1},add_css:function(a,b){if(d.jstree.css.get_css(a,
!1,b))return!1;b.insertRule?b.insertRule(a+" { }",0):b.addRule(a,null,0);return d.vakata.css.get_css(a)},remove_css:function(a,b){return d.vakata.css.get_css(a,!0,b)},add_sheet:function(a){var b=!1,f=!0;if(a.str)return a.title&&(b=d("style[id='"+a.title+"-stylesheet']")[0]),b?f=!1:(b=document.createElement("style"),b.setAttribute("type","text/css"),a.title&&b.setAttribute("id",a.title+"-stylesheet")),b.styleSheet?f?(document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet.cssText=a.str):
b.styleSheet.cssText=b.styleSheet.cssText+" "+a.str:(b.appendChild(document.createTextNode(a.str)),document.getElementsByTagName("head")[0].appendChild(b)),b.sheet||b.styleSheet;if(a.url)if(document.createStyleSheet)try{document.createStyleSheet(a.url)}catch(e){}else return b=document.createElement("link"),b.rel="stylesheet",b.type="text/css",b.media="all",b.href=a.url,document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet}};var b=[],f=-1,l={},g={};d.fn.jstree=function(a){var c="string"==
typeof a,f=Array.prototype.slice.call(arguments,1),e=this;if(c){if("_"==a.substring(0,1))return e;this.each(function(){var c=b[d.data(this,"jstree-instance-id")],c=c&&d.isFunction(c[a])?c[a].apply(c,f):c;if("undefined"!==typeof c&&(0===a.indexOf("is_")||!0!==c&&!1!==c))return e=c,!1})}else this.each(function(){var c=d.data(this,"jstree-instance-id"),e=[],g=a?d.extend({},!0,a):{},j=d(this),m=!1,n=[],e=e.concat(f);j.data("jstree")&&e.push(j.data("jstree"));g=e.length?d.extend.apply(null,[!0,g].concat(e)):
g;"undefined"!==typeof c&&b[c]&&b[c].destroy();c=parseInt(b.push({}),10)-1;d.data(this,"jstree-instance-id",c);g.plugins=d.isArray(g.plugins)?g.plugins:d.jstree.defaults.plugins.slice();g.plugins.unshift("core");g.plugins=g.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");m=d.extend(!0,{},d.jstree.defaults,g);m.plugins=g.plugins;d.each(l,function(a){-1===d.inArray(a,m.plugins)?(m[a]=null,delete m[a]):n.push(a)});m.plugins=n;b[c]=
new d.jstree._instance(c,d(this).addClass("jstree jstree-"+c),m);d.each(b[c]._get_settings().plugins,function(a,d){b[c].data[d]={}});d.each(b[c]._get_settings().plugins,function(a,d){l[d]&&l[d].__init.apply(b[c])});setTimeout(function(){b[c].init()},0)});return e};d.jstree={defaults:{plugins:[]},_focused:function(){return b[f]||null},_reference:function(a){if(b[a])return b[a];var c=d(a);!c.length&&"string"===typeof a&&(c=d("#"+a));return!c.length?null:b[c.closest(".jstree").data("jstree-instance-id")]||
null},_instance:function(a,b,f){this.data={core:{}};this.get_settings=function(){return d.extend(!0,{},f)};this._get_settings=function(){return f};this.get_index=function(){return a};this.get_container=function(){return b};this.get_container_ul=function(){return b.children("ul:eq(0)")};this._set_settings=function(a){f=d.extend(!0,{},f,a)}},_fn:{},plugin:function(a,b){b=d.extend({},{__init:d.noop,__destroy:d.noop,_fn:{},defaults:!1},b);l[a]=b;d.jstree.defaults[a]=b.defaults;d.each(b._fn,function(b,
c){c.plugin=a;c.old=d.jstree._fn[b];d.jstree._fn[b]=function(){var a,f=c,e=Array.prototype.slice.call(arguments);a=new d.Event("before.jstree");var g=!1;if(!(!0===this.data.core.locked&&"unlock"!==b&&"is_locked"!==b)){do{if(f&&f.plugin&&-1!==d.inArray(f.plugin,this._get_settings().plugins))break;f=f.old}while(f);if(f){if(0===b.indexOf("_"))a=f.apply(this,e);else{a=this.get_container().triggerHandler(a,{func:b,inst:this,args:e,plugin:f.plugin});if(!1===a)return;"undefined"!==typeof a&&(e=a);a=f.apply(d.extend({},
this,{__callback:function(a){this.get_container().triggerHandler(b+".jstree",{inst:this,args:e,rslt:a,rlbk:g})},__rollback:function(){return g=this.get_rollback()},__call_old:function(a){return f.old.apply(this,a?Array.prototype.slice.call(arguments,1):e)}}),e)}return a}}};d.jstree._fn[b].old=c.old;d.jstree._fn[b].plugin=a})},rollback:function(a){a&&(d.isArray(a)||(a=[a]),d.each(a,function(a,d){b[d.i].set_rollback(d.h,d.d)}))}};d.jstree._fn=d.jstree._instance.prototype={};d(function(){var b=navigator.userAgent.toLowerCase(),
c=(b.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],f=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";
if(/msie/.test(b)&&6==parseInt(c,10)){e=!0;try{document.execCommand("BackgroundImageCache",!1,!0)}catch(g){}f+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } "}/msie/.test(b)&&
7==parseInt(c,10)&&(a=!0,f+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } ");!/compatible/.test(b)&&(/mozilla/.test(b)&&1.9>parseFloat(c,10))&&(j=!0,f+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ");d.vakata.css.add_sheet({str:f,title:"jstree"})});d.jstree.plugin("core",{__init:function(){this.data.core.locked=!1;this.data.core.to_open=
this.get_settings().core.initially_open;this.data.core.to_load=this.get_settings().core.initially_load},defaults:{html_titles:!1,animation:500,initially_open:[],initially_load:[],open_parents:!0,notify_plugins:!0,rtl:!1,load_open:!1,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection"}},_fn:{init:function(){this.set_focus();this._get_settings().core.rtl&&this.get_container().addClass("jstree-rtl").css("direction","rtl");this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>"+
this._get_string("loading")+"</a></li></ul>");this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",d.proxy(function(a){var b=d(a.target);b.is("ins")&&a.pageY-b.offset().top<this.data.core.li_height&&this.toggle_node(b)},this)).bind("mousedown.jstree",d.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(){var a;if(document.selection&&document.selection.empty)document.selection.empty();
else if(window.getSelection){a=window.getSelection();try{a.removeAllRanges(),a.collapse()}catch(b){}}});this._get_settings().core.notify_plugins&&this.get_container().bind("load_node.jstree",d.proxy(function(a,b){var f=this._get_node(b.rslt.obj),e=this;-1===f&&(f=this.get_container_ul());f.length&&f.find("li").each(function(){var a=d(this);a.data("jstree")&&d.each(a.data("jstree"),function(b,c){e.data[b]&&d.isFunction(e["_"+b+"_notify"])&&e["_"+b+"_notify"].call(e,a,c)})})},this));this._get_settings().core.load_open&&
this.get_container().bind("load_node.jstree",d.proxy(function(a,b){var f=this._get_node(b.rslt.obj),e=this;-1===f&&(f=this.get_container_ul());f.length&&f.find("li.jstree-open:not(:has(ul))").each(function(){e.load_node(this,d.noop,d.noop)})},this));this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes()})},destroy:function(){var a,c=this.get_index(),e=this._get_settings(),g=this;d.each(e.plugins,function(a,b){try{l[b].__destroy.apply(g)}catch(c){}});this.__callback();if(this.is_focused())for(a in b)if(b.hasOwnProperty(a)&&
a!=c){b[a].set_focus();break}c===f&&(f=-1);this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree-instance-id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});d(document).unbind(".jstree-"+c).undelegate(".jstree-"+c);b[c]=null;delete b[c]},_core_notify:function(a,b){b.opened&&this.open_node(a,!1,!0)},lock:function(){this.data.core.locked=!0;this.get_container().children("ul").addClass("jstree-locked").css("opacity",
"0.7");this.__callback({})},unlock:function(){this.data.core.locked=!1;this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");this.__callback({})},is_locked:function(){return this.data.core.locked},save_opened:function(){var a=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){this.id&&a.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,
"\\.").replace(/\:/g,"\\:"))});this.__callback(a.data.core.to_open)},save_loaded:function(){},reload_nodes:function(a){var b=this,f=!0,e=[],g=[];a||(this.data.core.reopen=!1,this.data.core.refreshing=!0,this.data.core.to_open=d.map(d.makeArray(this.data.core.to_open),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.data.core.to_load=d.map(d.makeArray(this.data.core.to_load),function(a){return"#"+
a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.data.core.to_open.length&&(this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open)));this.data.core.to_load.length&&(d.each(this.data.core.to_load,function(a,b){if(b=="#")return true;d(b).length?e.push(b):g.push(b)}),e.length&&(this.data.core.to_load=g,d.each(e,function(a,d){if(!b._is_loaded(d)){b.load_node(d,function(){b.reload_nodes(true)},
function(){b.reload_nodes(true)});f=false}})));this.data.core.to_open.length&&d.each(this.data.core.to_open,function(a,d){b.open_node(d,false,true)});f&&(this.data.core.reopen&&clearTimeout(this.data.core.reopen),this.data.core.reopen=setTimeout(function(){b.__callback({},b)},50),this.data.core.refreshing=!1,this.reopen())},reopen:function(){var a=this;this.data.core.to_open.length&&d.each(this.data.core.to_open,function(b,d){a.open_node(d,!1,!0)});this.__callback({})},refresh:function(a){var b=this;
this.save_opened();a||(a=-1);(a=this._get_node(a))||(a=-1);-1!==a?a.children("UL").remove():this.get_container_ul().empty();this.load_node(a,function(){b.__callback({obj:a});b.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(!this.is_focused()){var a=d.jstree._focused();a&&a.unset_focus();this.get_container().addClass("jstree-focused");f=this.get_index();this.__callback()}},is_focused:function(){return f==this.get_index()},unset_focus:function(){this.is_focused()&&(this.get_container().removeClass("jstree-focused"),
f=-1);this.__callback()},_get_node:function(a){var b=d(a,this.get_container());if(b.is(".jstree")||-1==a)return-1;b=b.closest("li",this.get_container());return b.length?b:!1},_get_next:function(a,b){a=this._get_node(a);return-1===a?this.get_container().find("> ul > li:first-child"):!a.length?!1:b?0<a.nextAll("li").size()?a.nextAll("li:eq(0)"):!1:a.hasClass("jstree-open")?a.find("li:eq(0)"):0<a.nextAll("li").size()?a.nextAll("li:eq(0)"):a.parentsUntil(".jstree","li").next("li").eq(0)},_get_prev:function(a,
b){a=this._get_node(a);if(-1===a)return this.get_container().find("> ul > li:last-child");if(!a.length)return!1;if(b)return 0<a.prevAll("li").length?a.prevAll("li:eq(0)"):!1;if(a.prev("li").length){for(a=a.prev("li").eq(0);a.hasClass("jstree-open");)a=a.children("ul:eq(0)").children("li:last");return a}var d=a.parentsUntil(".jstree","li:eq(0)");return d.length?d:!1},_get_parent:function(a){a=this._get_node(a);if(-1==a||!a.length)return!1;a=a.parentsUntil(".jstree","li:eq(0)");return a.length?a:-1},
_get_children:function(a){a=this._get_node(a);return-1===a?this.get_container().children("ul:eq(0)").children("li"):!a.length?!1:a.children("ul:eq(0)").children("li")},get_path:function(a,b){var d=[],f=this,a=this._get_node(a);if(-1===a||!a||!a.length)return!1;a.parentsUntil(".jstree","li").each(function(){d.push(b?this.id:f.get_text(this))});d.reverse();d.push(b?a.attr("id"):this.get_text(a));return d},_get_string:function(a){return this._get_settings().core.strings[a]||a},is_open:function(a){return(a=
this._get_node(a))&&-1!==a&&a.hasClass("jstree-open")},is_closed:function(a){return(a=this._get_node(a))&&-1!==a&&a.hasClass("jstree-closed")},is_leaf:function(a){return(a=this._get_node(a))&&-1!==a&&a.hasClass("jstree-leaf")},correct_state:function(a){a=this._get_node(a);if(!a||-1===a)return!1;a.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:a})},open_node:function(a,b,d){a=this._get_node(a);if(!a.length)return!1;if(!a.hasClass("jstree-closed"))return b&&
b.call(),!1;var f=d||e?0:this._get_settings().core.animation,g=this;this._is_loaded(a)?(this._get_settings().core.open_parents&&a.parentsUntil(".jstree",".jstree-closed").each(function(){g.open_node(this,!1,!0)}),f&&a.children("ul").css("display","none"),a.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"),f?a.children("ul").stop(!0,!0).slideDown(f,function(){this.style.display="";g.after_open(a)}):g.after_open(a),this.__callback({obj:a}),b&&b.call()):
(a.children("a").addClass("jstree-loading"),this.load_node(a,function(){g.open_node(a,b,d)},b))},after_open:function(a){this.__callback({obj:a})},close_node:function(a,b){var a=this._get_node(a),d=b||e?0:this._get_settings().core.animation,f=this;if(!a.length||!a.hasClass("jstree-open"))return!1;d&&a.children("ul").attr("style","display:block !important");a.removeClass("jstree-open").addClass("jstree-closed");d?a.children("ul").stop(!0,!0).slideUp(d,function(){this.style.display="";f.after_close(a)}):
f.after_close(a);this.__callback({obj:a})},after_close:function(a){this.__callback({obj:a})},toggle_node:function(a){a=this._get_node(a);if(a.hasClass("jstree-closed"))return this.open_node(a);if(a.hasClass("jstree-open"))return this.close_node(a)},open_all:function(a,b,d){a=a?this._get_node(a):-1;if(!a||-1===a)a=this.get_container_ul();d?a=a.find("li.jstree-closed"):(d=a,a=a.is(".jstree-closed")?a.find("li.jstree-closed").andSelf():a.find("li.jstree-closed"));var f=this;a.each(function(){var a=this;
f._is_loaded(this)?f.open_node(this,false,!b):f.open_node(this,function(){f.open_all(a,b,d)},!b)});0===d.find("li.jstree-closed").length&&this.__callback({obj:d})},close_all:function(a,b){var d=this,a=a?this._get_node(a):this.get_container();if(!a||-1===a)a=this.get_container_ul();a.find("li.jstree-open").andSelf().each(function(){d.close_node(this,!b)});this.__callback({obj:a})},clean_node:function(a){a=a&&-1!=a?d(a):this.get_container_ul();a=a.is("li")?a.find("li").andSelf():a.find("li");a.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
a.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:a})},get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(!0),d:this.data}},set_rollback:function(a,b){this.get_container().empty().append(a);this.data=b;this.__callback()},load_node:function(a){this.__callback({obj:a})},_is_loaded:function(){return!0},create_node:function(a,b,f,e,g){var a=this._get_node(a),b="undefined"===typeof b?"last":
b,j=d("<li />"),l=this._get_settings().core,m;if(-1!==a&&!a.length)return!1;if(!g&&!this._is_loaded(a))return this.load_node(a,function(){this.create_node(a,b,f,e,!0)}),!1;this.__rollback();"string"===typeof f&&(f={data:f});f||(f={});f.attr&&j.attr(f.attr);f.metadata&&j.data(f.metadata);f.state&&j.addClass("jstree-"+f.state);f.data||(f.data=this._get_string("new_node"));d.isArray(f.data)||(m=f.data,f.data=[],f.data.push(m));d.each(f.data,function(a,b){m=d("<a />");d.isFunction(b)&&(b=b.call(this,
f));if(typeof b=="string")m.attr("href","#")[l.html_titles?"html":"text"](b);else{if(!b.attr)b.attr={};if(!b.attr.href)b.attr.href="#";m.attr(b.attr)[l.html_titles?"html":"text"](b.title);b.language&&m.addClass(b.language)}m.prepend("<ins class='jstree-icon'>&#160;</ins>");b.icon&&(b.icon.indexOf("/")===-1?m.children("ins").addClass(b.icon):m.children("ins").css("background","url('"+b.icon+"') center center no-repeat"));j.append(m)});j.prepend("<ins class='jstree-icon'>&#160;</ins>");-1===a&&(a=this.get_container(),
"before"===b&&(b="first"),"after"===b&&(b="last"));switch(b){case "before":a.before(j);m=this._get_parent(a);break;case "after":a.after(j);m=this._get_parent(a);break;case "inside":case "first":a.children("ul").length||a.append("<ul />");a.children("ul").prepend(j);m=a;break;case "last":a.children("ul").length||a.append("<ul />");a.children("ul").append(j);m=a;break;default:a.children("ul").length||a.append("<ul />"),b||(b=0),m=a.children("ul").children("li").eq(b),m.length?m.before(j):a.children("ul").append(j),
m=a}if(-1===m||m.get(0)===this.get_container().get(0))m=-1;this.clean_node(m);this.__callback({obj:j,parent:m});e&&e.call(this,j);return j},get_text:function(a){a=this._get_node(a);if(!a.length)return!1;var b=this._get_settings().core.html_titles,a=a.children("a:eq(0)");if(b)return a=a.clone(),a.children("INS").remove(),a.html();a=a.contents().filter(function(){return 3==this.nodeType})[0];return a.nodeValue},set_text:function(a,b){a=this._get_node(a);if(!a.length)return!1;a=a.children("a:eq(0)");
if(this._get_settings().core.html_titles){var d=a.children("INS").clone();a.html(b).prepend(d);this.__callback({obj:a,name:b});return!0}a=a.contents().filter(function(){return 3==this.nodeType})[0];this.__callback({obj:a,name:b});return a.nodeValue=b},rename_node:function(a,b){a=this._get_node(a);this.__rollback();a&&(a.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments)))&&this.__callback({obj:a,name:b})},delete_node:function(a){a=this._get_node(a);if(!a.length)return!1;this.__rollback();
var b=this._get_parent(a),f=d([]),e=this;a.each(function(){f=f.add(e._get_prev(this))});a=a.detach();-1!==b&&0===b.find("> ul > li").length&&b.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");this.clean_node(b);this.__callback({obj:a,prev:f,parent:b});return a},prepare_move:function(a,b,f,e,j){var l={};l.ot=d.jstree._reference(a)||this;l.o=l.ot._get_node(a);l.r=-1===b?-1:this._get_node(b);l.p="undefined"===typeof f||!1===f?"last":f;if(j||!g.o||!(g.o[0]===l.o[0]&&g.r[0]===l.r[0]&&g.p===
l.p)){l.ot=d.jstree._reference(l.o)||this;l.rt=d.jstree._reference(l.r)||this;if(-1===l.r||!l.r)switch(l.cr=-1,l.p){case "first":case "before":case "inside":l.cp=0;break;case "after":case "last":l.cp=l.rt.get_container().find(" > ul > li").length;break;default:l.cp=l.p}else{if(!/^(before|after)$/.test(l.p)&&!this._is_loaded(l.r))return this.load_node(l.r,function(){this.prepare_move(a,b,f,e,!0)});switch(l.p){case "before":l.cp=l.r.index();l.cr=l.rt._get_parent(l.r);break;case "after":l.cp=l.r.index()+
1;l.cr=l.rt._get_parent(l.r);break;case "inside":case "first":l.cp=0;l.cr=l.r;break;case "last":l.cp=l.r.find(" > ul > li").length;l.cr=l.r;break;default:l.cp=l.p,l.cr=l.r}}l.np=-1==l.cr?l.rt.get_container():l.cr;l.op=l.ot._get_parent(l.o);l.cop=l.o.index();-1===l.op&&(l.op=l.ot?l.ot.get_container():this.get_container());!/^(before|after)$/.test(l.p)&&(l.op&&l.np&&l.op[0]===l.np[0]&&l.o.index()<l.cp)&&l.cp++;l.or=l.np.find(" > ul > li:nth-child("+(l.cp+1)+")");g=l}this.__callback(g);e&&e.call(this,
g)},check_move:function(){var a=g,b=!0,d=-1===a.r?this.get_container():a.r;if(!a||(!a.o||a.or[0]===a.o[0])||a.op&&a.np&&a.op[0]===a.np[0]&&a.cp-1===a.o.index())return!1;a.o.each(function(){if(-1!==d.parentsUntil(".jstree","li").andSelf().index(this))return b=!1});return b},move_node:function(a,b,f,e,j,l){if(!j)return this.prepare_move(a,b,f,function(a){this.move_node(a,!1,!1,e,!0,l)});e&&(g.cy=!0);if(!l&&!this.check_move())return!1;this.__rollback();b=!1;e?(b=a.o.clone(!0),b.find("*[id]").andSelf().each(function(){if(this.id)this.id=
"copy_"+this.id})):b=a.o;a.or.length?a.or.before(b):(a.np.children("ul").length||d("<ul />").appendTo(a.np),a.np.children("ul:eq(0)").append(b));try{a.ot.clean_node(a.op),a.rt.clean_node(a.np),a.op.find("> ul > li").length||a.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}catch(m){}e&&(g.cy=!0,g.oc=b);this.__callback(g);return g},_get_move:function(){return g}}})})(m);(function(a){var b,f,e;a(function(){/msie/.test(navigator.userAgent.toLowerCase())?(f=
a('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1E3,left:0}).appendTo("body"),e=a('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1E3,left:0}).appendTo("body"),b=f.width()-e.width(),f.add(e).remove()):(f=a("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1E3,left:0}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200}),b=100-f.width(),f.parent().remove())});a.jstree.plugin("ui",
{__init:function(){this.data.ui.selected=a();this.data.ui.last_selected=!1;this.data.ui.hovered=null;this.data.ui.to_select=this.get_settings().ui.initially_select;this.get_container().delegate("a","click.jstree",a.proxy(function(b){b.preventDefault();b.currentTarget.blur();a(b.currentTarget).hasClass("jstree-loading")||this.select_node(b.currentTarget,!0,b)},this)).delegate("a","mouseenter.jstree",a.proxy(function(b){a(b.currentTarget).hasClass("jstree-loading")||this.hover_node(b.target)},this)).delegate("a",
"mouseleave.jstree",a.proxy(function(b){a(b.currentTarget).hasClass("jstree-loading")||this.dehover_node(b.target)},this)).bind("reopen.jstree",a.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",a.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",a.proxy(function(){this.reselect()},this)).bind("close_node.jstree",a.proxy(function(b,f){var c=this._get_settings().ui,e=this._get_node(f.rslt.obj),j=e&&e.length?e.children("ul").find("a.jstree-clicked"):
a(),l=this;!1!==c.selected_parent_close&&j.length&&j.each(function(){l.deselect_node(this);"select_parent"===c.selected_parent_close&&l.select_node(e)})},this)).bind("delete_node.jstree",a.proxy(function(a,b){var c=this._get_settings().ui.select_prev_on_delete,d=this._get_node(b.rslt.obj),d=d&&d.length?d.find("a.jstree-clicked"):[],f=this;d.each(function(){f.deselect_node(this)});c&&d.length&&b.rslt.prev.each(function(){if(this.parentNode)return f.select_node(this),!1})},this)).bind("move_node.jstree",
a.proxy(function(a,b){b.rslt.cy&&b.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked")},this))},defaults:{select_limit:-1,select_multiple_modifier:"ctrl",select_range_modifier:"shift",selected_parent_close:"select_parent",selected_parent_open:!0,select_prev_on_delete:!0,disable_selecting_children:!1,initially_select:[]},_fn:{_get_node:function(b,f){if("undefined"===typeof b||null===b)return f?this.data.ui.selected:this.data.ui.last_selected;var c=a(b,this.get_container());if(c.is(".jstree")||
-1==b)return-1;c=c.closest("li",this.get_container());return c.length?c:!1},_ui_notify:function(a,b){b.selected&&this.select_node(a,!1)},save_selected:function(){var a=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){this.id&&a.data.ui.to_select.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))});this.__callback(this.data.ui.to_select)},reselect:function(){var b=this,f=this.data.ui.to_select,
f=a.map(a.makeArray(f),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});a.each(f,function(a,d){d&&"#"!==d&&b.select_node(d)});this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode});this.__callback()},refresh:function(){this.save_selected();return this.__call_old()},hover_node:function(a){a=this._get_node(a);if(!a.length)return!1;a.hasClass("jstree-hovered")||
this.dehover_node();this.data.ui.hovered=a.children("a").addClass("jstree-hovered").parent();this._fix_scroll(a);this.__callback({obj:a})},dehover_node:function(){var a=this.data.ui.hovered;if(!a||!a.length)return!1;this.data.ui.hovered[0]===a.children("a").removeClass("jstree-hovered").parent()[0]&&(this.data.ui.hovered=null);this.__callback({obj:a})},select_node:function(a,b,c){a=this._get_node(a);if(-1==a||!a||!a.length)return!1;var d=this._get_settings().ui,f="on"==d.select_multiple_modifier||
!1!==d.select_multiple_modifier&&c&&c[d.select_multiple_modifier+"Key"],e=!1!==d.select_range_modifier&&c&&c[d.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==a[0]&&this.data.ui.last_selected.parent()[0]===a.parent()[0],j=this.is_selected(a),l=!0,m=this;if(b){if(d.disable_selecting_children&&f&&(a.parentsUntil(".jstree","li").children("a.jstree-clicked").length||a.children("ul").find("a.jstree-clicked:eq(0)").length))return!1;l=!1;switch(!0){case e:this.data.ui.last_selected.addClass("jstree-last-selected");
a=a[a.index()<this.data.ui.last_selected.index()?"nextUntil":"prevUntil"](".jstree-last-selected").andSelf();-1==d.select_limit||a.length<d.select_limit?(this.data.ui.last_selected.removeClass("jstree-last-selected"),this.data.ui.selected.each(function(){this!==m.data.ui.last_selected[0]&&m.deselect_node(this)}),j=!1,l=!0):l=!1;break;case j&&!f:this.deselect_all();j=!1;l=!0;break;case !j&&!f:if(-1==d.select_limit||0<d.select_limit)this.deselect_all(),l=!0;break;case j&&f:this.deselect_node(a);break;
case !j&&f:if(-1==d.select_limit||this.data.ui.selected.length+1<=d.select_limit)l=!0}}l&&!j&&(e||(this.data.ui.last_selected=a),a.children("a").addClass("jstree-clicked"),d.selected_parent_open&&a.parents(".jstree-closed").each(function(){m.open_node(this,false,true)}),this.data.ui.selected=this.data.ui.selected.add(a),this._fix_scroll(a.eq(0)),this.__callback({obj:a,e:c}))},_fix_scroll:function(a){var d=this.get_container()[0];if(d.scrollHeight>d.offsetHeight&&(a=this._get_node(a))&&!(-1===a||!a.length||
!a.is(":visible")))if(a=a.offset().top-this.get_container().offset().top,0>a&&(d.scrollTop=d.scrollTop+a-1),a+this.data.core.li_height+(d.scrollWidth>d.offsetWidth?b:0)>d.offsetHeight)d.scrollTop+=a-d.offsetHeight+this.data.core.li_height+1+(d.scrollWidth>d.offsetWidth?b:0)},deselect_node:function(a){a=this._get_node(a);if(!a.length)return!1;this.is_selected(a)&&(a.children("a").removeClass("jstree-clicked"),this.data.ui.selected=this.data.ui.selected.not(a),this.data.ui.last_selected.get(0)===a.get(0)&&
(this.data.ui.last_selected=this.data.ui.selected.eq(0)),this.__callback({obj:a}))},toggle_select:function(a){a=this._get_node(a);if(!a.length)return!1;this.is_selected(a)?this.deselect_node(a):this.select_node(a)},is_selected:function(a){return 0<=this.data.ui.selected.index(this._get_node(a))},get_selected:function(b){return b?a(b).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(b){b=b?a(b).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();
b.children("a.jstree-clicked").removeClass("jstree-clicked");this.data.ui.selected=a([]);this.data.ui.last_selected=!1;this.__callback({obj:b})}}});a.jstree.defaults.plugins.push("ui")})(m);(function(a){a.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",a.proxy(function(a,d){if(this._get_settings().crrm.move.open_onmove){var e=this;d.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function(){e.open_node(this,!1,!0)})}},this))},defaults:{input_width_limit:200,
move:{always_copy:!1,open_onmove:!0,default_position:"last",check_move:function(){return!0}}},_fn:{_show_input:function(b,f){var b=this._get_node(b),e=this._get_settings().core.rtl,g=this._get_settings().crrm.input_width_limit,j=b.children("ins").width(),c=b.find("> a:visible > ins").width()*b.find("> a:visible > ins").length,m=this.get_text(b),n=a("<div />",{css:{position:"absolute",top:"-200px",left:e?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),o=b.css("position","relative").append(a("<input />",
{value:m,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:e?"auto":j+c+4+"px",right:e?j+c+4+"px":"auto",top:"0px",height:this.data.core.li_height-2+"px",lineHeight:this.data.core.li_height-2+"px",width:"150px"},blur:a.proxy(function(){var a=b.children(".jstree-rename-input"),c=a.val();""===c&&(c=m);n.remove();a.remove();this.set_text(b,m);this.rename_node(b,c);f.call(this,b,c,m);b.css("position","")},this),keyup:function(a){a=a.keyCode||a.which;27==
a?(this.value=m,this.blur()):13==a?this.blur():o.width(Math.min(n.text("pW"+this.value).width(),g))},keypress:function(a){if(13==(a.keyCode||a.which))return!1}})).children(".jstree-rename-input");this.set_text(b,"");n.css({fontFamily:o.css("fontFamily")||"",fontSize:o.css("fontSize")||"",fontWeight:o.css("fontWeight")||"",fontStyle:o.css("fontStyle")||"",fontStretch:o.css("fontStretch")||"",fontVariant:o.css("fontVariant")||"",letterSpacing:o.css("letterSpacing")||"",wordSpacing:o.css("wordSpacing")||
""});o.width(Math.min(n.text("pW"+o[0].value).width(),g))[0].select()},rename:function(a){a=this._get_node(a);this.__rollback();var d=this.__callback;this._show_input(a,function(a,b,e){d.call(this,{obj:a,new_name:b,old_name:e})})},create:function(b,f,e,g,j){var c=this;(b=this._get_node(b))||(b=-1);this.__rollback();return this.create_node(b,f,e,function(b){var f=this._get_parent(b),e=a(b).index();g&&g.call(this,b);f.length&&f.hasClass("jstree-closed")&&this.open_node(f,!1,!0);j?c.__callback({obj:b,
name:this.get_text(b),parent:f,position:e}):this._show_input(b,function(a,b){c.__callback({obj:a,name:b,parent:f,position:e})})})},remove:function(a){var a=this._get_node(a,!0),d=this._get_parent(a),e=this._get_prev(a);this.__rollback();a=this.delete_node(a);!1!==a&&this.__callback({obj:a,prev:e,parent:d})},check_move:function(){return!this.__call_old()||!this._get_settings().crrm.move.check_move.call(this,this._get_move())?!1:!0},move_node:function(a,d,e,g,j,c){var m=this._get_settings().crrm.move;
if(!j)return"undefined"===typeof e&&(e=m.default_position),"inside"===e&&!m.default_position.match(/^(before|after)$/)&&(e=m.default_position),this.__call_old(!0,a,d,e,g,!1,c);if(!0===m.always_copy||"multitree"===m.always_copy&&a.rt.get_index()!==a.ot.get_index())g=!0;this.__call_old(!0,a,d,e,g,!0,c)},cut:function(a){a=this._get_node(a,!0);if(!a||!a.length)return!1;this.data.crrm.cp_nodes=!1;this.data.crrm.ct_nodes=a;this.__callback({obj:a})},copy:function(a){a=this._get_node(a,!0);if(!a||!a.length)return!1;
this.data.crrm.ct_nodes=!1;this.data.crrm.cp_nodes=a;this.__callback({obj:a})},paste:function(a){a=this._get_node(a);if(!a||!a.length)return!1;var d=this.data.crrm.ct_nodes?this.data.crrm.ct_nodes:this.data.crrm.cp_nodes;if(!this.data.crrm.ct_nodes&&!this.data.crrm.cp_nodes)return!1;this.data.crrm.ct_nodes&&(this.move_node(this.data.crrm.ct_nodes,a),this.data.crrm.ct_nodes=!1);this.data.crrm.cp_nodes&&this.move_node(this.data.crrm.cp_nodes,a,!1,!0);this.__callback({obj:a,nodes:d})}}})})(m);(function(a){var b=
[];a.jstree._themes=!1;a.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",a.proxy(function(){var a=this._get_settings().themes;this.data.themes.dots=a.dots;this.data.themes.icons=a.icons;this.set_theme(a.theme,a.url)},this)).bind("loaded.jstree",a.proxy(function(){this.data.themes.dots?this.show_dots():this.hide_dots();this.data.themes.icons?this.show_icons():this.hide_icons()},this))},defaults:{theme:"default",url:!1,dots:!0,icons:!0},_fn:{set_theme:function(f,e){if(!f)return!1;
e||(e=a.jstree._themes+f+"/style.css");-1==a.inArray(e,b)&&(a.vakata.css.add_sheet({url:e}),b.push(e));this.data.themes.theme!=f&&(this.get_container().removeClass("jstree-"+this.data.themes.theme),this.data.themes.theme=f);this.get_container().addClass("jstree-"+f);this.data.themes.dots?this.show_dots():this.hide_dots();this.data.themes.icons?this.show_icons():this.hide_icons();this.__callback()},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=!0;this.get_container().children("ul").removeClass("jstree-no-dots")},
hide_dots:function(){this.data.themes.dots=!1;this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){this.data.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this.data.themes.icons=!0;this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=!1;this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){this.data.themes.icons?this.hide_icons():this.show_icons()}}});
a(function(){!1===a.jstree._themes&&a("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/))return a.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/",!1});!1===a.jstree._themes&&(a.jstree._themes="themes/")});a.jstree.defaults.plugins.push("themes")})(m);(function(a){var b=[];a.jstree.plugin("hotkeys",{__init:function(){if("undefined"===typeof a.hotkeys)throw"jsTree hotkeys: jQuery hotkeys plugin not included.";if(!this.data.ui)throw"jsTree hotkeys: jsTree UI plugin not included.";
a.each(this._get_settings().hotkeys,function(f,e){!1!==e&&-1==a.inArray(f,b)&&(a(document).bind("keydown",f,function(b){var e;var c=a.jstree._focused(),j;c&&c.data&&c.data.hotkeys&&c.data.hotkeys.enabled&&(j=c._get_settings().hotkeys[f])&&(e=j.call(c,b));return e}),b.push(f))});this.get_container().bind("lock.jstree",a.proxy(function(){this.data.hotkeys.enabled&&(this.data.hotkeys.enabled=!1,this.data.hotkeys.revert=!0)},this)).bind("unlock.jstree",a.proxy(function(){this.data.hotkeys.revert&&(this.data.hotkeys.enabled=
!0)},this));this.enable_hotkeys()},defaults:{up:function(){this.hover_node(this._get_prev(this.data.ui.hovered||this.data.ui.last_selected||-1));return!1},"ctrl+up":function(){this.hover_node(this._get_prev(this.data.ui.hovered||this.data.ui.last_selected||-1));return!1},"shift+up":function(){this.hover_node(this._get_prev(this.data.ui.hovered||this.data.ui.last_selected||-1));return!1},down:function(){this.hover_node(this._get_next(this.data.ui.hovered||this.data.ui.last_selected||-1));return!1},
"ctrl+down":function(){this.hover_node(this._get_next(this.data.ui.hovered||this.data.ui.last_selected||-1));return!1},"shift+down":function(){this.hover_node(this._get_next(this.data.ui.hovered||this.data.ui.last_selected||-1));return!1},left:function(){var a=this.data.ui.hovered||this.data.ui.last_selected;a&&(a.hasClass("jstree-open")?this.close_node(a):this.hover_node(this._get_prev(a)));return!1},"ctrl+left":function(){var a=this.data.ui.hovered||this.data.ui.last_selected;a&&(a.hasClass("jstree-open")?
this.close_node(a):this.hover_node(this._get_prev(a)));return!1},"shift+left":function(){var a=this.data.ui.hovered||this.data.ui.last_selected;a&&(a.hasClass("jstree-open")?this.close_node(a):this.hover_node(this._get_prev(a)));return!1},right:function(){var a=this.data.ui.hovered||this.data.ui.last_selected;a&&a.length&&(a.hasClass("jstree-closed")?this.open_node(a):this.hover_node(this._get_next(a)));return!1},"ctrl+right":function(){var a=this.data.ui.hovered||this.data.ui.last_selected;a&&a.length&&
(a.hasClass("jstree-closed")?this.open_node(a):this.hover_node(this._get_next(a)));return!1},"shift+right":function(){var a=this.data.ui.hovered||this.data.ui.last_selected;a&&a.length&&(a.hasClass("jstree-closed")?this.open_node(a):this.hover_node(this._get_next(a)));return!1},space:function(){this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").click();return!1},"ctrl+space":function(a){a.type="click";this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").trigger(a);return!1},
"shift+space":function(a){a.type="click";this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").trigger(a);return!1},f2:function(){this.rename(this.data.ui.hovered||this.data.ui.last_selected)},del:function(){this.remove(this.data.ui.hovered||this._get_node(null))}},_fn:{enable_hotkeys:function(){this.data.hotkeys.enabled=!0},disable_hotkeys:function(){this.data.hotkeys.enabled=!1}}})})(m);(function(a){a.jstree.plugin("json_data",{__init:function(){this._get_settings().json_data.progressive_unload&&
this.get_container().bind("after_close.jstree",function(a,d){d.rslt.obj.children("ul").remove()})},defaults:{data:!1,ajax:!1,correct_state:!0,progressive_render:!1,progressive_unload:!1},_fn:{load_node:function(a,d,e){var g=this;this.load_node_json(a,function(){g.__callback({obj:g._get_node(a)});d.call(this)},e)},_is_loaded:function(b){var f=this._get_settings().json_data,b=this._get_node(b);return-1==b||!b||!f.ajax&&!f.progressive_render&&!a.isFunction(f.data)||b.is(".jstree-open, .jstree-leaf")||
0<b.children("ul").children("li").length},refresh:function(b){var b=this._get_node(b),f=this._get_settings().json_data;b&&(-1!==b&&f.progressive_unload&&(a.isFunction(f.data)||f.ajax))&&b.removeData("jstree-children");return this.__call_old()},load_node_json:function(b,f,e){var g=this.get_settings().json_data,j,c=function(){};j=function(){};if((b=this._get_node(b))&&-1!==b&&(g.progressive_render||g.progressive_unload)&&!b.is(".jstree-open, .jstree-leaf")&&0===b.children("ul").children("li").length&&
b.data("jstree-children")){if(j=this._parse_json(b.data("jstree-children"),b))b.append(j),g.progressive_unload||b.removeData("jstree-children");this.clean_node(b);f&&f.call(this)}else{if(b&&-1!==b){if(b.data("jstree-is-loading"))return;b.data("jstree-is-loading",!0)}switch(!0){case !g.data&&!g.ajax:throw"Neither data nor ajax settings supplied.";case a.isFunction(g.data):g.data.call(this,b,a.proxy(function(a){if(a=this._parse_json(a,b)){if(b===-1||!b)this.get_container().children("ul").empty().append(a.children());
else{b.append(a).children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading")}this.clean_node(b);f&&f.call(this)}else{if(b===-1||!b)g.correct_state&&this.get_container().children("ul").empty();else{b.children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading");g.correct_state&&this.correct_state(b)}e&&e.call(this)}},this));break;case !!g.data&&!g.ajax||!!g.data&&!!g.ajax&&(!b||-1===b):if(!b||-1==b)(j=this._parse_json(g.data,b))?(this.get_container().children("ul").empty().append(j.children()),
this.clean_node()):g.correct_state&&this.get_container().children("ul").empty();f&&f.call(this);break;case !g.data&&!!g.ajax||!!g.data&&!!g.ajax&&b&&-1!==b:c=function(a,c,d){var f=this.get_settings().json_data.ajax.error;f&&f.call(this,a,c,d);if(b!=-1&&b.length){b.children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading");c==="success"&&g.correct_state&&this.correct_state(b)}else c==="success"&&g.correct_state&&this.get_container().children("ul").empty();e&&e.call(this)},
j=function(e,j,l){var k=this.get_settings().json_data.ajax.success;k&&(e=k.call(this,e,j,l)||e);if(e===""||e&&e.toString&&e.toString().replace(/^[\s\n]+$/,"")===""||!a.isArray(e)&&!a.isPlainObject(e))return c.call(this,l,j,"");if(e=this._parse_json(e,b)){if(b===-1||!b)this.get_container().children("ul").empty().append(e.children());else{b.append(e).children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading")}this.clean_node(b);f&&f.call(this)}else if(b===-1||!b){if(g.correct_state){this.get_container().children("ul").empty();
f&&f.call(this)}}else{b.children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading");if(g.correct_state){this.correct_state(b);f&&f.call(this)}}},g.ajax.context=this,g.ajax.error=c,g.ajax.success=j,g.ajax.dataType||(g.ajax.dataType="json"),a.isFunction(g.ajax.url)&&(g.ajax.url=g.ajax.url.call(this,b)),a.isFunction(g.ajax.data)&&(g.ajax.data=g.ajax.data.call(this,b)),a.ajax(g.ajax)}}},_parse_json:function(b,f,e){var g=!1,j=this._get_settings(),c=j.json_data,m=j.core.html_titles,
n;if(!b)return g;c.progressive_unload&&(f&&-1!==f)&&f.data("jstree-children",g);if(a.isArray(b)){g=a();if(!b.length)return!1;j=0;for(c=b.length;j<c;j++)n=this._parse_json(b[j],f,!0),n.length&&(g=g.add(n))}else{"string"==typeof b&&(b={data:b});if(!b.data&&""!==b.data)return g;g=a("<li />");b.attr&&g.attr(b.attr);b.metadata&&g.data(b.metadata);b.state&&g.addClass("jstree-"+b.state);a.isArray(b.data)||(n=b.data,b.data=[],b.data.push(n));a.each(b.data,function(c,f){n=a("<a />");a.isFunction(f)&&(f=f.call(this,
b));if(typeof f=="string")n.attr("href","#")[m?"html":"text"](f);else{if(!f.attr)f.attr={};if(!f.attr.href)f.attr.href="#";n.attr(f.attr)[m?"html":"text"](f.title);f.language&&n.addClass(f.language)}n.prepend("<ins class='jstree-icon'>&#160;</ins>");if(!f.icon&&b.icon)f.icon=b.icon;f.icon&&(f.icon.indexOf("/")===-1?n.children("ins").addClass(f.icon):n.children("ins").css("background","url('"+f.icon+"') center center no-repeat"));g.append(n)});g.prepend("<ins class='jstree-icon'>&#160;</ins>");b.children&&
(c.progressive_render&&"open"!==b.state?g.addClass("jstree-closed").data("jstree-children",b.children):(c.progressive_unload&&g.data("jstree-children",b.children),a.isArray(b.children)&&b.children.length&&(n=this._parse_json(b.children,f,!0),n.length&&(f=a("<ul />"),f.append(n),g.append(f)))))}e||(e=a("<ul />"),e.append(g),g=e);return g},get_json:function(b,f,e,g){var j=[],c=this._get_settings(),m=this,n,o,p,r,t,x,b=this._get_node(b);if(!b||-1===b)b=this.get_container().find("> ul > li");f=a.isArray(f)?
f:["id","class"];!g&&this.data.types&&f.push(c.types.type_attr);e=a.isArray(e)?e:[];b.each(function(){p=a(this);n={data:[]};f.length&&(n.attr={});a.each(f,function(a,b){(o=p.attr(b))&&(o.length&&o.replace(/jstree[^ ]*/ig,"").length)&&(n.attr[b]=(" "+o).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))});p.hasClass("jstree-open")&&(n.state="open");p.hasClass("jstree-closed")&&(n.state="closed");p.data()&&(n.metadata=p.data());r=p.children("a");r.each(function(){t=
a(this);if(e.length||a.inArray("languages",c.plugins)!==-1||t.children("ins").get(0).style.backgroundImage.length||t.children("ins").get(0).className&&t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length){x=false;a.inArray("languages",c.plugins)!==-1&&(a.isArray(c.languages)&&c.languages.length)&&a.each(c.languages,function(a,b){if(t.hasClass(b)){x=b;return false}});o={attr:{},title:m.get_text(t,x)};a.each(e,function(a,b){o.attr[b]=(" "+(t.attr(b)||"")).replace(/ jstree[^ ]*/ig,
"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")});a.inArray("languages",c.plugins)!==-1&&(a.isArray(c.languages)&&c.languages.length)&&a.each(c.languages,function(a,b){if(t.hasClass(b)){o.language=b;return true}});if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length)o.icon=t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");if(t.children("ins").get(0).style.backgroundImage.length)o.icon=
t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")}else o=m.get_text(t);r.length>1?n.data.push(o):n.data=o});p=p.find("> ul > li");p.length&&(n.children=m.get_json(p,f,e,!0));j.push(n)});return j}}})})(m);(function(a){a.jstree.plugin("languages",{__init:function(){this._load_css()},defaults:[],_fn:{set_lang:function(b){var f=this._get_settings().languages,e=!1,g=".jstree-"+this.get_index()+" a";if(!a.isArray(f)||0===f.length)return!1;if(-1==a.inArray(b,f))if(f[b])b=
f[b];else return!1;if(b==this.data.languages.current_language)return!0;e=a.vakata.css.get_css(g+"."+this.data.languages.current_language,!1,this.data.languages.language_css);!1!==e&&(e.style.display="none");e=a.vakata.css.get_css(g+"."+b,!1,this.data.languages.language_css);!1!==e&&(e.style.display="");this.data.languages.current_language=b;this.__callback(b);return!0},get_lang:function(){return this.data.languages.current_language},_get_string:function(b,f){var e=this._get_settings().languages,g=
this._get_settings().core.strings;a.isArray(e)&&e.length&&(f=f&&-1!=a.inArray(f,e)?f:this.data.languages.current_language);return g[f]&&g[f][b]?g[f][b]:g[b]?g[b]:b},get_text:function(b,f){b=this._get_node(b)||this.data.ui.last_selected;if(!b.size())return!1;var e=this._get_settings().languages,g=this._get_settings().core.html_titles;a.isArray(e)&&e.length?(f=f&&-1!=a.inArray(f,e)?f:this.data.languages.current_language,b=b.children("a."+f)):b=b.children("a:eq(0)");if(g)return b=b.clone(),b.children("INS").remove(),
b.html();b=b.contents().filter(function(){return this.nodeType==3})[0];return b.nodeValue},set_text:function(b,f,e){b=this._get_node(b)||this.data.ui.last_selected;if(!b.size())return!1;var g=this._get_settings().languages,j=this._get_settings().core.html_titles;a.isArray(g)&&g.length?(e=e&&-1!=a.inArray(e,g)?e:this.data.languages.current_language,b=b.children("a."+e)):b=b.children("a:eq(0)");if(j)return g=b.children("INS").clone(),b.html(f).prepend(g),this.__callback({obj:b,name:f,lang:e}),!0;b=
b.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:b,name:f,lang:e});return b.nodeValue=f},_load_css:function(){var b=this._get_settings().languages,f="/* languages css */",e=".jstree-"+this.get_index()+" a",g;if(a.isArray(b)&&b.length){this.data.languages.current_language=b[0];for(g=0;g<b.length;g++)f+=e+"."+b[g]+" {",b[g]!=this.data.languages.current_language&&(f+=" display:none; "),f+=" } ";this.data.languages.language_css=a.vakata.css.add_sheet({str:f,title:"jstree-languages"})}},
create_node:function(b,f,e,g){return this.__call_old(!0,b,f,e,function(b){var c=this._get_settings().languages,f=b.children("a"),e;if(a.isArray(c)&&c.length){for(e=0;e<c.length;e++)f.is("."+c[e])||b.append(f.eq(0).clone().removeClass(c.join(" ")).addClass(c[e]));f.not("."+c.join(", .")).remove()}g&&g.call(this,b)})}}})})(m);(function(a){a.jstree.plugin("cookies",{__init:function(){if("undefined"===typeof a.cookie)throw"jsTree cookie: jQuery cookie plugin not included.";var b=this._get_settings().cookies,
f;if(b.save_loaded&&(f=a.cookie(b.save_loaded))&&f.length)this.data.core.to_load=f.split(",");if(b.save_opened&&(f=a.cookie(b.save_opened))&&f.length)this.data.core.to_open=f.split(",");if(b.save_selected&&(f=a.cookie(b.save_selected))&&f.length&&this.data.ui)this.data.ui.to_select=f.split(",");this.get_container().one((this.data.ui?"reselect":"reopen")+".jstree",a.proxy(function(){this.get_container().bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree",a.proxy(function(a){this._get_settings().cookies.auto_save&&
this.save_cookie((a.handleObj.namespace+a.handleObj.type).replace("jstree",""))},this))},this))},defaults:{save_loaded:"jstree_load",save_opened:"jstree_open",save_selected:"jstree_select",auto_save:!0,cookie_options:{}},_fn:{save_cookie:function(b){if(!this.data.core.refreshing){var f=this._get_settings().cookies;if(b)switch(b){case "open_node":case "close_node":f.save_opened&&(this.save_opened(),a.cookie(f.save_opened,this.data.core.to_open.join(","),f.cookie_options));f.save_loaded&&(this.save_loaded(),
a.cookie(f.save_loaded,this.data.core.to_load.join(","),f.cookie_options));break;case "select_node":case "deselect_node":f.save_selected&&this.data.ui&&(this.save_selected(),a.cookie(f.save_selected,this.data.ui.to_select.join(","),f.cookie_options))}else if(f.save_loaded&&(this.save_loaded(),a.cookie(f.save_loaded,this.data.core.to_load.join(","),f.cookie_options)),f.save_opened&&(this.save_opened(),a.cookie(f.save_opened,this.data.core.to_open.join(","),f.cookie_options)),f.save_selected&&this.data.ui)this.save_selected(),
a.cookie(f.save_selected,this.data.ui.to_select.join(","),f.cookie_options)}}}})})(m);(function(a){a.jstree.plugin("sort",{__init:function(){this.get_container().bind("load_node.jstree",a.proxy(function(a,d){var e=this._get_node(d.rslt.obj),e=-1===e?this.get_container().children("ul"):e.children("ul");this.sort(e)},this)).bind("rename_node.jstree create_node.jstree create.jstree",a.proxy(function(a,d){this.sort(d.rslt.obj.parent())},this)).bind("move_node.jstree",a.proxy(function(a,d){this.sort((-1==
d.rslt.np?this.get_container():d.rslt.np).children("ul"))},this))},defaults:function(a,d){return this.get_text(a)>this.get_text(d)?1:-1},_fn:{sort:function(b){var f=this._get_settings().sort,e=this;b.append(a.makeArray(b.children("li")).sort(a.proxy(f,e)));b.find("> li > ul").each(function(){e.sort(a(this))});this.clean_node(b)}}})})(m);(function(a){var b=!1,f=!1,e=!1,g=!1,j=!1,c=!1,m=!1,n=!1,o=!1;a.vakata.dnd={is_down:!1,is_drag:!1,helper:!1,scroll_spd:10,init_x:0,init_y:0,threshold:5,helper_left:5,
helper_top:10,user_data:{},drag_start:function(b,c,f){a.vakata.dnd.is_drag&&a.vakata.drag_stop({});try{b.currentTarget.unselectable="on",b.currentTarget.onselectstart=function(){return!1},b.currentTarget.style&&(b.currentTarget.style.MozUserSelect="none")}catch(e){}a.vakata.dnd.init_x=b.pageX;a.vakata.dnd.init_y=b.pageY;a.vakata.dnd.user_data=c;a.vakata.dnd.is_down=!0;a.vakata.dnd.helper=a("<div id='vakata-dragged' />").html(f);a(document).bind("mousemove",a.vakata.dnd.drag);a(document).bind("mouseup",
a.vakata.dnd.drag_stop);return!1},drag:function(b){if(a.vakata.dnd.is_down){if(!a.vakata.dnd.is_drag)if(5<Math.abs(b.pageX-a.vakata.dnd.init_x)||5<Math.abs(b.pageY-a.vakata.dnd.init_y))a.vakata.dnd.helper.appendTo("body"),a.vakata.dnd.is_drag=!0,a(document).triggerHandler("drag_start.vakata",{event:b,data:a.vakata.dnd.user_data});else return;if("mousemove"===b.type){var f=a(document),e=f.scrollTop(),f=f.scrollLeft();if(20>b.pageY-e){if(c&&"down"===m&&(clearInterval(c),c=!1),!c)m="up",c=setInterval(function(){a(document).scrollTop(a(document).scrollTop()-
a.vakata.dnd.scroll_spd)},150)}else c&&"up"===m&&(clearInterval(c),c=!1);if(20>a(window).height()-(b.pageY-e)){if(c&&"up"===m&&(clearInterval(c),c=!1),!c)m="down",c=setInterval(function(){a(document).scrollTop(a(document).scrollTop()+a.vakata.dnd.scroll_spd)},150)}else c&&"down"===m&&(clearInterval(c),c=!1);if(20>b.pageX-f){if(j&&"right"===n&&(clearInterval(j),j=!1),!j)n="left",j=setInterval(function(){a(document).scrollLeft(a(document).scrollLeft()-a.vakata.dnd.scroll_spd)},150)}else j&&"left"===
n&&(clearInterval(j),j=!1);if(20>a(window).width()-(b.pageX-f)){if(j&&"left"===n&&(clearInterval(j),j=!1),!j)n="right",j=setInterval(function(){a(document).scrollLeft(a(document).scrollLeft()+a.vakata.dnd.scroll_spd)},150)}else j&&"right"===n&&(clearInterval(j),j=!1)}a.vakata.dnd.helper.css({left:b.pageX+a.vakata.dnd.helper_left+"px",top:b.pageY+a.vakata.dnd.helper_top+"px"});a(document).triggerHandler("drag.vakata",{event:b,data:a.vakata.dnd.user_data})}},drag_stop:function(b){j&&clearInterval(j);
c&&clearInterval(c);a(document).unbind("mousemove",a.vakata.dnd.drag);a(document).unbind("mouseup",a.vakata.dnd.drag_stop);a(document).triggerHandler("drag_stop.vakata",{event:b,data:a.vakata.dnd.user_data});a.vakata.dnd.helper.remove();a.vakata.dnd.init_x=0;a.vakata.dnd.init_y=0;a.vakata.dnd.user_data={};a.vakata.dnd.is_down=!1;a.vakata.dnd.is_drag=!1}};a(function(){a.vakata.css.add_sheet({str:"#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ",
title:"vakata"})});a.jstree.plugin("dnd",{__init:function(){this.data.dnd={active:!1,after:!1,inside:!1,before:!1,off:!1,prepared:!1,w:0,to1:!1,to2:!1,cof:!1,cw:!1,ch:!1,i1:!1,i2:!1,mto:!1};this.get_container().bind("mouseenter.jstree",a.proxy(function(c){if(a.vakata.dnd.is_drag&&a.vakata.dnd.user_data.jstree&&(this.data.themes&&(e.attr("class","jstree-"+this.data.themes.theme),g&&g.attr("class","jstree-"+this.data.themes.theme),a.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)),
c.currentTarget===c.target&&a.vakata.dnd.user_data.obj&&a(a.vakata.dnd.user_data.obj).length&&a(a.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==c.target))c=a.jstree._reference(c.target),c.data.dnd.foreign?(c=c._get_settings().dnd.drag_check.call(this,{o:b,r:c.get_container(),is_root:!0}),(!0===c||!0===c.inside||!0===c.before||!0===c.after)&&a.vakata.dnd.helper.children("ins").attr("class","jstree-ok")):(c.prepare_move(b,c.get_container(),"last"),c.check_move()&&a.vakata.dnd.helper.children("ins").attr("class",
"jstree-ok"))},this)).bind("mouseup.jstree",a.proxy(function(c){if(a.vakata.dnd.is_drag&&a.vakata.dnd.user_data.jstree&&c.currentTarget===c.target&&a.vakata.dnd.user_data.obj&&a(a.vakata.dnd.user_data.obj).length&&a(a.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==c.target){var f=a.jstree._reference(c.currentTarget);f.data.dnd.foreign?(c=f._get_settings().dnd.drag_check.call(this,{o:b,r:f.get_container(),is_root:!0}),(!0===c||!0===c.inside||!0===c.before||!0===c.after)&&f._get_settings().dnd.drag_finish.call(this,
{o:b,r:f.get_container(),is_root:!0})):f.move_node(b,f.get_container(),"last",c[f._get_settings().dnd.copy_modifier+"Key"])}},this)).bind("mouseleave.jstree",a.proxy(function(b){if(b.relatedTarget&&b.relatedTarget.id&&"jstree-marker-line"===b.relatedTarget.id)return!1;a.vakata.dnd.is_drag&&a.vakata.dnd.user_data.jstree&&(this.data.dnd.i1&&clearInterval(this.data.dnd.i1),this.data.dnd.i2&&clearInterval(this.data.dnd.i2),this.data.dnd.to1&&clearTimeout(this.data.dnd.to1),this.data.dnd.to2&&clearTimeout(this.data.dnd.to2),
a.vakata.dnd.helper.children("ins").hasClass("jstree-ok")&&a.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"))},this)).bind("mousemove.jstree",a.proxy(function(b){if(a.vakata.dnd.is_drag&&a.vakata.dnd.user_data.jstree){var c=this.get_container()[0];b.pageX+24>this.data.dnd.cof.left+this.data.dnd.cw?(this.data.dnd.i1&&clearInterval(this.data.dnd.i1),this.data.dnd.i1=setInterval(a.proxy(function(){this.scrollLeft+=a.vakata.dnd.scroll_spd},c),100)):b.pageX-24<this.data.dnd.cof.left?(this.data.dnd.i1&&
clearInterval(this.data.dnd.i1),this.data.dnd.i1=setInterval(a.proxy(function(){this.scrollLeft-=a.vakata.dnd.scroll_spd},c),100)):this.data.dnd.i1&&clearInterval(this.data.dnd.i1);b.pageY+24>this.data.dnd.cof.top+this.data.dnd.ch?(this.data.dnd.i2&&clearInterval(this.data.dnd.i2),this.data.dnd.i2=setInterval(a.proxy(function(){this.scrollTop=this.scrollTop+a.vakata.dnd.scroll_spd},c),100)):b.pageY-24<this.data.dnd.cof.top?(this.data.dnd.i2&&clearInterval(this.data.dnd.i2),this.data.dnd.i2=setInterval(a.proxy(function(){this.scrollTop=
this.scrollTop-a.vakata.dnd.scroll_spd},c),100)):this.data.dnd.i2&&clearInterval(this.data.dnd.i2)}},this)).bind("scroll.jstree",a.proxy(function(){a.vakata.dnd.is_drag&&(a.vakata.dnd.user_data.jstree&&e&&g)&&(e.hide(),g.hide())},this)).delegate("a","mousedown.jstree",a.proxy(function(a){if(1===a.which)return this.start_drag(a.currentTarget,a),!1},this)).delegate("a","mouseenter.jstree",a.proxy(function(b){a.vakata.dnd.is_drag&&a.vakata.dnd.user_data.jstree&&this.dnd_enter(b.currentTarget)},this)).delegate("a",
"mousemove.jstree",a.proxy(function(b){a.vakata.dnd.is_drag&&a.vakata.dnd.user_data.jstree&&((!f||!f.length||f.children("a")[0]!==b.currentTarget)&&this.dnd_enter(b.currentTarget),"undefined"===typeof this.data.dnd.off.top&&(this.data.dnd.off=a(b.target).offset()),this.data.dnd.w=(b.pageY-(this.data.dnd.off.top||0))%this.data.core.li_height,0>this.data.dnd.w&&(this.data.dnd.w+=this.data.core.li_height),this.dnd_show())},this)).delegate("a","mouseleave.jstree",a.proxy(function(b){if(a.vakata.dnd.is_drag&&
a.vakata.dnd.user_data.jstree){if(b.relatedTarget&&b.relatedTarget.id&&"jstree-marker-line"===b.relatedTarget.id)return!1;e&&e.hide();g&&g.hide();this.data.dnd.mto=setTimeout(function(a){return function(){a.dnd_leave(b)}}(this),0)}},this)).delegate("a","mouseup.jstree",a.proxy(function(b){a.vakata.dnd.is_drag&&a.vakata.dnd.user_data.jstree&&this.dnd_finish(b)},this));a(document).bind("drag_stop.vakata",a.proxy(function(){this.data.dnd.to1&&clearTimeout(this.data.dnd.to1);this.data.dnd.to2&&clearTimeout(this.data.dnd.to2);
this.data.dnd.i1&&clearInterval(this.data.dnd.i1);this.data.dnd.i2&&clearInterval(this.data.dnd.i2);this.data.dnd.after=!1;this.data.dnd.before=!1;this.data.dnd.inside=!1;this.data.dnd.off=!1;this.data.dnd.prepared=!1;this.data.dnd.w=!1;this.data.dnd.to1=!1;this.data.dnd.to2=!1;this.data.dnd.i1=!1;this.data.dnd.i2=!1;this.data.dnd.active=!1;this.data.dnd.foreign=!1;e&&e.css({top:"-2000px"});g&&g.css({top:"-2000px"})},this)).bind("drag_start.vakata",a.proxy(function(b,c){if(c.data.jstree){var f=a(c.event.target);
f.closest(".jstree").hasClass("jstree-"+this.get_index())&&this.dnd_enter(f)}},this));var c=this._get_settings().dnd;c.drag_target&&a(document).delegate(c.drag_target,"mousedown.jstree-"+this.get_index(),a.proxy(function(c){b=c.target;a.vakata.dnd.drag_start(c,{jstree:!0,obj:c.target},"<ins class='jstree-icon'></ins>"+a(c.target).text());this.data.themes&&(e&&e.attr("class","jstree-"+this.data.themes.theme),g&&g.attr("class","jstree-"+this.data.themes.theme),a.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+
this.data.themes.theme));a.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");var f=this.get_container();this.data.dnd.cof=f.offset();this.data.dnd.cw=parseInt(f.width(),10);this.data.dnd.ch=parseInt(f.height(),10);this.data.dnd.foreign=!0;c.preventDefault()},this));c.drop_target&&a(document).delegate(c.drop_target,"mouseenter.jstree-"+this.get_index(),a.proxy(function(c){this.data.dnd.active&&this._get_settings().dnd.drop_check.call(this,{o:b,r:a(c.target),e:c})&&a.vakata.dnd.helper.children("ins").attr("class",
"jstree-ok")},this)).delegate(c.drop_target,"mouseleave.jstree-"+this.get_index(),a.proxy(function(){this.data.dnd.active&&a.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")},this)).delegate(c.drop_target,"mouseup.jstree-"+this.get_index(),a.proxy(function(c){this.data.dnd.active&&a.vakata.dnd.helper.children("ins").hasClass("jstree-ok")&&this._get_settings().dnd.drop_finish.call(this,{o:b,r:a(c.target),e:c})},this))},defaults:{copy_modifier:"ctrl",check_timeout:100,open_timeout:500,
drop_target:".jstree-drop",drop_check:function(){return!0},drop_finish:a.noop,drag_target:".jstree-draggable",drag_finish:a.noop,drag_check:function(){return{after:!1,before:!1,inside:!0}}},_fn:{dnd_prepare:function(){if(f&&f.length){this.data.dnd.off=f.offset();this._get_settings().core.rtl&&(this.data.dnd.off.right=this.data.dnd.off.left+f.width());if(this.data.dnd.foreign){var a=this._get_settings().dnd.drag_check.call(this,{o:b,r:f});this.data.dnd.after=a.after;this.data.dnd.before=a.before;this.data.dnd.inside=
a.inside;this.data.dnd.prepared=!0;return this.dnd_show()}this.prepare_move(b,f,"before");this.data.dnd.before=this.check_move();this.prepare_move(b,f,"after");this.data.dnd.after=this.check_move();this._is_loaded(f)?(this.prepare_move(b,f,"inside"),this.data.dnd.inside=this.check_move()):this.data.dnd.inside=!1;this.data.dnd.prepared=!0;return this.dnd_show()}},dnd_show:function(){if(this.data.dnd.prepared){var b=["before","inside","after"],c=!1,f=this._get_settings().core.rtl,b=this.data.dnd.w<
this.data.core.li_height/3?["before","inside","after"]:this.data.dnd.w<=2*this.data.core.li_height/3?this.data.dnd.w<this.data.core.li_height/2?["inside","before","after"]:["inside","after","before"]:["after","inside","before"];a.each(b,a.proxy(function(b,f){if(this.data.dnd[f])return a.vakata.dnd.helper.children("ins").attr("class","jstree-ok"),c=f,!1},this));!1===c&&a.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");b=f?this.data.dnd.off.right-18:this.data.dnd.off.left+10;switch(c){case "before":e.css({left:b+
"px",top:this.data.dnd.off.top-6+"px"}).show();g&&g.css({left:b+8+"px",top:this.data.dnd.off.top-1+"px"}).show();break;case "after":e.css({left:b+"px",top:this.data.dnd.off.top+this.data.core.li_height-6+"px"}).show();g&&g.css({left:b+8+"px",top:this.data.dnd.off.top+this.data.core.li_height-1+"px"}).show();break;case "inside":e.css({left:b+(f?-4:4)+"px",top:this.data.dnd.off.top+this.data.core.li_height/2-5+"px"}).show();g&&g.hide();break;default:e.hide(),g&&g.hide()}return o=c}},dnd_open:function(){this.data.dnd.to2=
!1;this.open_node(f,a.proxy(this.dnd_prepare,this),!0)},dnd_finish:function(a){this.data.dnd.foreign?(this.data.dnd.after||this.data.dnd.before||this.data.dnd.inside)&&this._get_settings().dnd.drag_finish.call(this,{o:b,r:f,p:o}):(this.dnd_prepare(),this.move_node(b,f,o,a[this._get_settings().dnd.copy_modifier+"Key"]));f=b=!1;e.hide();g&&g.hide()},dnd_enter:function(b){this.data.dnd.mto&&(clearTimeout(this.data.dnd.mto),this.data.dnd.mto=!1);var c=this._get_settings().dnd;this.data.dnd.prepared=!1;
f=this._get_node(b);c.check_timeout?(this.data.dnd.to1&&clearTimeout(this.data.dnd.to1),this.data.dnd.to1=setTimeout(a.proxy(this.dnd_prepare,this),c.check_timeout)):this.dnd_prepare();c.open_timeout?(this.data.dnd.to2&&clearTimeout(this.data.dnd.to2),f&&(f.length&&f.hasClass("jstree-closed"))&&(this.data.dnd.to2=setTimeout(a.proxy(this.dnd_open,this),c.open_timeout))):f&&(f.length&&f.hasClass("jstree-closed"))&&this.dnd_open()},dnd_leave:function(b){this.data.dnd.after=!1;this.data.dnd.before=!1;
this.data.dnd.inside=!1;a.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");e.hide();g&&g.hide();if(f&&f[0]===b.target.parentNode&&(this.data.dnd.to1&&(clearTimeout(this.data.dnd.to1),this.data.dnd.to1=!1),this.data.dnd.to2))clearTimeout(this.data.dnd.to2),this.data.dnd.to2=!1},start_drag:function(c,f){b=this._get_node(c);this.data.ui&&this.is_selected(b)&&(b=this._get_node(null,!0));var j=1<b.length?this._get_string("multiple_selection"):this.get_text(b),k=this.get_container();this._get_settings().core.html_titles||
(j=j.replace(/</ig,"&lt;").replace(/>/ig,"&gt;"));a.vakata.dnd.drag_start(f,{jstree:!0,obj:b},"<ins class='jstree-icon'></ins>"+j);this.data.themes&&(e&&e.attr("class","jstree-"+this.data.themes.theme),g&&g.attr("class","jstree-"+this.data.themes.theme),a.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme));this.data.dnd.cof=k.offset();this.data.dnd.cw=parseInt(k.width(),10);this.data.dnd.ch=parseInt(k.height(),10);this.data.dnd.active=!0}}});a(function(){a.vakata.css.add_sheet({str:"#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px;  -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; } #vakata-dragged .jstree-ok { background:green; } #vakata-dragged .jstree-invalid { background:red; } #jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } #jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43;  cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666;  -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; }",
title:"jstree"});e=a("<div />").attr({id:"jstree-marker"}).hide().html("&raquo;").bind("mouseleave mouseenter",function(a){e.hide();g.hide();a.preventDefault();a.stopImmediatePropagation();return!1}).appendTo("body");g=a("<div />").attr({id:"jstree-marker-line"}).hide().bind("mouseup",function(a){if(f&&f.length)return f.children("a").trigger(a),a.preventDefault(),a.stopImmediatePropagation(),!1}).bind("mouseleave",function(b){var c=a(b.relatedTarget);if((c.is(".jstree")||0===c.closest(".jstree").length)&&
f&&f.length)return f.children("a").trigger(b),e.hide(),g.hide(),b.preventDefault(),b.stopImmediatePropagation(),!1}).appendTo("body");a(document).bind("drag_start.vakata",function(a,b){b.data.jstree&&(e.show(),g&&g.show())});a(document).bind("drag_stop.vakata",function(a,b){b.data.jstree&&(e.hide(),g&&g.hide())})})})(m);(function(a){a.jstree.plugin("checkbox",{__init:function(){this.data.checkbox.noui=this._get_settings().checkbox.override_ui;this.data.ui&&this.data.checkbox.noui&&(this.select_node=
this.deselect_node=this.deselect_all=a.noop,this.get_selected=this.get_checked);this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",a.proxy(function(a,d){this._prepare_checkboxes(d.rslt.obj)},this)).bind("loaded.jstree",a.proxy(function(){this._prepare_checkboxes()},this)).delegate(this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox","click.jstree",a.proxy(function(a){a.preventDefault();this._get_node(a.target).hasClass("jstree-checked")?this.uncheck_node(a.target):
this.check_node(a.target);if(this.data.ui&&this.data.checkbox.noui){this.save_selected();this.data.cookies&&this.save_cookie("select_node")}else{a.stopImmediatePropagation();return false}},this))},defaults:{override_ui:!1,two_state:!1,real_checkboxes:!1,checked_parent_open:!0,real_checkboxes_names:function(a){return["check_"+(a[0].id||Math.ceil(1E4*Math.random())),1]}},__destroy:function(){this.get_container().find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end().find("ins.jstree-checkbox").remove()},
_fn:{_checkbox_notify:function(a,d){d.checked&&this.check_node(a,!1)},_prepare_checkboxes:function(b){b=!b||-1==b?this.get_container().find("> ul > li"):this._get_node(b);if(!1!==b){var f,e=this,g,j=this._get_settings().checkbox.two_state,c=this._get_settings().checkbox.real_checkboxes,m=this._get_settings().checkbox.real_checkboxes_names;b.each(function(){g=a(this);f=g.is("li")&&(g.hasClass("jstree-checked")||c&&g.children(":checked").length)?"jstree-checked":"jstree-unchecked";g.find("li").andSelf().each(function(){var b=
a(this),g;b.children("a"+(e.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(j?"jstree-unchecked":f);c&&(b.children(":checkbox").length?b.children(":checkbox").addClass("jstree-real-checkbox"):(g=m.call(e,b),b.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+g[0]+"' name='"+g[0]+"' value='"+g[1]+"' />")),"jstree-checked"===f&&b.children(":checkbox").attr("checked",
"checked"));"jstree-checked"===f&&!j&&b.find("li").addClass("jstree-checked")})});j||(1===b.length&&b.is("li")&&this._repair_state(b),b.is("li")?b.each(function(){e._repair_state(this)}):b.find("> ul > li").each(function(){e._repair_state(this)}),b.find(".jstree-checked").parent().parent().each(function(){e._repair_state(this)}))}},change_state:function(b,f){var b=this._get_node(b),e=!1,g=this._get_settings().checkbox.real_checkboxes;if(!b||-1===b)return!1;f=!1===f||!0===f?f:b.hasClass("jstree-checked");
if(this._get_settings().checkbox.two_state)f?(b.removeClass("jstree-checked").addClass("jstree-unchecked"),g&&b.children(":checkbox").removeAttr("checked")):(b.removeClass("jstree-unchecked").addClass("jstree-checked"),g&&b.children(":checkbox").attr("checked","checked"));else{if(f){e=b.find("li").andSelf();if(!e.filter(".jstree-checked, .jstree-undetermined").length)return!1;e.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");g&&e.children(":checkbox").removeAttr("checked")}else{e=
b.find("li").andSelf();if(!e.filter(".jstree-unchecked, .jstree-undetermined").length)return!1;e.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");g&&e.children(":checkbox").attr("checked","checked");this.data.ui&&(this.data.ui.last_selected=b);this.data.checkbox.last_selected=b}b.parentsUntil(".jstree","li").each(function(){var b=a(this);if(f){if(b.children("ul").children("li.jstree-checked, li.jstree-undetermined").length)return b.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),
g&&b.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked"),!1;b.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");g&&b.children(":checkbox").removeAttr("checked")}else{if(b.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length)return b.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),g&&b.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked"),
!1;b.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");g&&b.children(":checkbox").attr("checked","checked")}})}this.data.ui&&this.data.checkbox.noui&&(this.data.ui.selected=this.get_checked());this.__callback(b);return!0},check_node:function(a){if(this.change_state(a,!1)){a=this._get_node(a);if(this._get_settings().checkbox.checked_parent_open){var d=this;a.parents(".jstree-closed").each(function(){d.open_node(this,!1,!0)})}this.__callback({obj:a})}},uncheck_node:function(a){this.change_state(a,
!0)&&this.__callback({obj:this._get_node(a)})},check_all:function(){var a=this;(this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li")).each(function(){a.change_state(this,!1)});this.__callback()},uncheck_all:function(){var a=this;(this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li")).each(function(){a.change_state(this,!0)});this.__callback()},is_checked:function(a){a=this._get_node(a);
return a.length?a.is(".jstree-checked"):!1},get_checked:function(a,d){a=!a||-1===a?this.get_container():this._get_node(a);return d||this._get_settings().checkbox.two_state?a.find(".jstree-checked"):a.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(a,d){a=!a||-1===a?this.get_container():this._get_node(a);return d||this._get_settings().checkbox.two_state?a.find(".jstree-unchecked"):a.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},
show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(a){a=this._get_node(a);if(a.length){var d=this._get_settings().checkbox.real_checkboxes,e=a.find("> ul > .jstree-checked").length,g=a.find("> ul > .jstree-undetermined").length,j=a.find("> ul > li").length;0===j?a.hasClass("jstree-undetermined")&&this.change_state(a,!1):0===e&&0===
g?this.change_state(a,!0):e===j?this.change_state(a,!1):(a.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),d&&a.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked"))}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var b=this,f=this.data.ui.to_select,f=a.map(a.makeArray(f),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,
"\\.").replace(/\:/g,"\\:")});this.deselect_all();a.each(f,function(a,d){b.check_node(d)});this.__callback()}else this.__call_old()},save_loaded:function(){var a=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){this.id&&a.data.core.to_load.push("#"+this.id)})}}});a(function(){a.vakata.css.add_sheet({str:".jstree .jstree-real-checkbox { display:none; } ",title:"jstree"})})})(m);(function(a){a.vakata.xslt=function(b,f,e){var c="",j;
if(document.recalc)return j=document.createElement("xml"),c=document.createElement("xml"),j.innerHTML=b,c.innerHTML=f,a("body").append(j).append(c),setTimeout(function(b,c,f){return function(){f.call(null,b.transformNode(c.XMLDocument));setTimeout(function(b,c){return function(){a(b).remove();a(c).remove()}}(b,c),200)}}(j,c,e),100),!0;"undefined"!==typeof window.DOMParser&&("undefined"!==typeof window.XMLHttpRequest&&"undefined"===typeof window.XSLTProcessor)&&(b=(new DOMParser).parseFromString(b,
"text/xml"),f=(new DOMParser).parseFromString(f,"text/xml"));if("undefined"!==typeof window.DOMParser&&"undefined"!==typeof window.XMLHttpRequest&&"undefined"!==typeof window.XSLTProcessor){j=new XSLTProcessor;c=a.isFunction(j.transformDocument)?"undefined"!==typeof window.XMLSerializer:!0;if(!c)return!1;b=(new DOMParser).parseFromString(b,"text/xml");f=(new DOMParser).parseFromString(f,"text/xml");a.isFunction(j.transformDocument)?(c=document.implementation.createDocument("","",null),j.transformDocument(b,
f,c,null),e.call(null,(new XMLSerializer).serializeToString(c))):(j.importStylesheet(f),c=j.transformToFragment(b,document),e.call(null,a("<div />").append(c).html()));return!0}return!1};var b={nest:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" /><xsl:template match="/">\t<xsl:call-template name="nodes">\t\t<xsl:with-param name="node" select="/root" />\t</xsl:call-template></xsl:template><xsl:template name="nodes">\t<xsl:param name="node" />\t<ul>\t<xsl:for-each select="$node/item">\t\t<xsl:variable name="children" select="count(./item) &gt; 0" />\t\t<li>\t\t\t<xsl:attribute name="class">\t\t\t\t<xsl:if test="position() = last()">jstree-last </xsl:if>\t\t\t\t<xsl:choose>\t\t\t\t\t<xsl:when test="@state = \'open\'">jstree-open </xsl:when>\t\t\t\t\t<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>\t\t\t\t\t<xsl:otherwise>jstree-leaf </xsl:otherwise>\t\t\t\t</xsl:choose>\t\t\t\t<xsl:value-of select="@class" />\t\t\t</xsl:attribute>\t\t\t<xsl:for-each select="@*">\t\t\t\t<xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">\t\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t\t</xsl:if>\t\t\t</xsl:for-each>\t<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>\t\t\t<xsl:for-each select="content/name">\t\t\t\t<a>\t\t\t\t<xsl:attribute name="href">\t\t\t\t\t<xsl:choose>\t\t\t\t\t<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>\t\t\t\t\t<xsl:otherwise>#</xsl:otherwise>\t\t\t\t\t</xsl:choose>\t\t\t\t</xsl:attribute>\t\t\t\t<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>\t\t\t\t<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>\t\t\t\t<xsl:for-each select="@*">\t\t\t\t\t<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">\t\t\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t\t\t</xsl:if>\t\t\t\t</xsl:for-each>\t\t\t\t\t<ins>\t\t\t\t\t\t<xsl:attribute name="class">jstree-icon \t\t\t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>\t\t\t\t\t\t</xsl:attribute>\t\t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>\t\t\t\t\t\t<xsl:text>&#xa0;</xsl:text>\t\t\t\t\t</ins>\t\t\t\t\t<xsl:copy-of select="./child::node()" />\t\t\t\t</a>\t\t\t</xsl:for-each>\t\t\t<xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>\t\t</li>\t</xsl:for-each>\t</ul></xsl:template></xsl:stylesheet>',
flat:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" /><xsl:template match="/">\t<ul>\t<xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">\t\t<xsl:call-template name="nodes">\t\t\t<xsl:with-param name="node" select="." />\t\t\t<xsl:with-param name="is_last" select="number(position() = last())" />\t\t</xsl:call-template>\t</xsl:for-each>\t</ul></xsl:template><xsl:template name="nodes">\t<xsl:param name="node" />\t<xsl:param name="is_last" />\t<xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />\t<li>\t<xsl:attribute name="class">\t\t<xsl:if test="$is_last = true()">jstree-last </xsl:if>\t\t<xsl:choose>\t\t\t<xsl:when test="@state = \'open\'">jstree-open </xsl:when>\t\t\t<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>\t\t\t<xsl:otherwise>jstree-leaf </xsl:otherwise>\t\t</xsl:choose>\t\t<xsl:value-of select="@class" />\t</xsl:attribute>\t<xsl:for-each select="@*">\t\t<xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t</xsl:if>\t</xsl:for-each>\t<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>\t<xsl:for-each select="content/name">\t\t<a>\t\t<xsl:attribute name="href">\t\t\t<xsl:choose>\t\t\t<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>\t\t\t<xsl:otherwise>#</xsl:otherwise>\t\t\t</xsl:choose>\t\t</xsl:attribute>\t\t<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>\t\t<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>\t\t<xsl:for-each select="@*">\t\t\t<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t</xsl:if>\t\t</xsl:for-each>\t\t\t<ins>\t\t\t\t<xsl:attribute name="class">jstree-icon \t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>\t\t\t\t</xsl:attribute>\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>\t\t\t\t<xsl:text>&#xa0;</xsl:text>\t\t\t</ins>\t\t\t<xsl:copy-of select="./child::node()" />\t\t</a>\t</xsl:for-each>\t<xsl:if test="$children">\t\t<ul>\t\t<xsl:for-each select="//item[@parent_id=$node/attribute::id]">\t\t\t<xsl:call-template name="nodes">\t\t\t\t<xsl:with-param name="node" select="." />\t\t\t\t<xsl:with-param name="is_last" select="number(position() = last())" />\t\t\t</xsl:call-template>\t\t</xsl:for-each>\t\t</ul>\t</xsl:if>\t</li></xsl:template></xsl:stylesheet>'},
f=function(a){return a.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")};a.jstree.plugin("xml_data",{defaults:{data:!1,ajax:!1,xsl:"flat",clean_node:!1,correct_state:!0,get_skip_empty:!1,get_include_preamble:!0},_fn:{load_node:function(a,b,d){var c=this;this.load_node_xml(a,function(){c.__callback({obj:c._get_node(a)});b.call(this)},d)},_is_loaded:function(b){var f=this._get_settings().xml_data,b=this._get_node(b);return-1==b||
!b||!f.ajax&&!a.isFunction(f.data)||b.is(".jstree-open, .jstree-leaf")||0<b.children("ul").children("li").size()},load_node_xml:function(b,f,e){var c=this.get_settings().xml_data,j=function(){},m=function(){};if((b=this._get_node(b))&&-1!==b){if(b.data("jstree-is-loading"))return;b.data("jstree-is-loading",!0)}switch(!0){case !c.data&&!c.ajax:throw"Neither data nor ajax settings supplied.";case a.isFunction(c.data):c.data.call(this,b,a.proxy(function(e){this.parse_xml(e,a.proxy(function(e){if(e){e=
e.replace(/ ?xmlns="[^"]*"/ig,"");if(e.length>10){e=a(e);if(b===-1||!b)this.get_container().children("ul").empty().append(e.children());else{b.children("a.jstree-loading").removeClass("jstree-loading");b.append(e);b.removeData("jstree-is-loading")}c.clean_node&&this.clean_node(b);f&&f.call(this)}else if(b&&b!==-1){b.children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading");if(c.correct_state){this.correct_state(b);f&&f.call(this)}}else if(c.correct_state){this.get_container().children("ul").empty();
f&&f.call(this)}}},this))},this));break;case !!c.data&&!c.ajax||!!c.data&&!!c.ajax&&(!b||-1===b):(!b||-1==b)&&this.parse_xml(c.data,a.proxy(function(e){if(e){e=e.replace(/ ?xmlns="[^"]*"/ig,"");if(e.length>10){e=a(e);this.get_container().children("ul").empty().append(e.children());c.clean_node&&this.clean_node(b);f&&f.call(this)}}else if(c.correct_state){this.get_container().children("ul").empty();f&&f.call(this)}},this));break;case !c.data&&!!c.ajax||!!c.data&&!!c.ajax&&b&&-1!==b:j=function(a,d,
f){var g=this.get_settings().xml_data.ajax.error;g&&g.call(this,a,d,f);if(b!==-1&&b.length){b.children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading");d==="success"&&c.correct_state&&this.correct_state(b)}else d==="success"&&c.correct_state&&this.get_container().children("ul").empty();e&&e.call(this)},m=function(e,k,m){var e=m.responseText,n=this.get_settings().xml_data.ajax.success;n&&(e=n.call(this,e,k,m)||e);if(e===""||e&&e.toString&&e.toString().replace(/^[\s\n]+$/,
"")==="")return j.call(this,m,k,"");this.parse_xml(e,a.proxy(function(e){if(e){e=e.replace(/ ?xmlns="[^"]*"/ig,"");if(e.length>10){e=a(e);if(b===-1||!b)this.get_container().children("ul").empty().append(e.children());else{b.children("a.jstree-loading").removeClass("jstree-loading");b.append(e);b.removeData("jstree-is-loading")}c.clean_node&&this.clean_node(b);f&&f.call(this)}else if(b&&b!==-1){b.children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading");if(c.correct_state){this.correct_state(b);
f&&f.call(this)}}else if(c.correct_state){this.get_container().children("ul").empty();f&&f.call(this)}}},this))},c.ajax.context=this,c.ajax.error=j,c.ajax.success=m,c.ajax.dataType||(c.ajax.dataType="xml"),a.isFunction(c.ajax.url)&&(c.ajax.url=c.ajax.url.call(this,b)),a.isFunction(c.ajax.data)&&(c.ajax.data=c.ajax.data.call(this,b)),a.ajax(c.ajax)}},parse_xml:function(f,e){var j=this._get_settings().xml_data;a.vakata.xslt(f,b[j.xsl],e)},get_xml:function(b,e,j,c,m){var n="",o=this._get_settings(),
p=this,r,t,x,v,u;b||(b="flat");m||(m=0);e=this._get_node(e);if(!e||-1===e)e=this.get_container().find("> ul > li");j=a.isArray(j)?j:["id","class"];!m&&(this.data.types&&-1===a.inArray(o.types.type_attr,j))&&j.push(o.types.type_attr);c=a.isArray(c)?c:[];m||(o.xml_data.get_include_preamble&&(n+='<?xml version="1.0" encoding="UTF-8"?>'),n+="<root>");e.each(function(){n=n+"<item";x=a(this);a.each(j,function(a,b){var c=x.attr(b);if(!o.xml_data.get_skip_empty||typeof c!=="undefined")n=n+(" "+b+'="'+f((" "+
(c||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"')});x.hasClass("jstree-open")&&(n=n+' state="open"');x.hasClass("jstree-closed")&&(n=n+' state="closed"');b==="flat"&&(n=n+(' parent_id="'+f(m)+'"'));n=n+">";n=n+"<content>";v=x.children("a");v.each(function(){r=a(this);u=false;n=n+"<name";a.inArray("languages",o.plugins)!==-1&&a.each(o.languages,function(a,b){if(r.hasClass(b)){n=n+(' lang="'+f(b)+'"');u=b;return false}});c.length&&a.each(c,function(a,
b){var c=r.attr(b);if(!o.xml_data.get_skip_empty||typeof c!=="undefined")n=n+(" "+b+'="'+f((" "+c||"").replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"')});r.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length&&(n=n+(' icon="'+f(r.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'));r.children("ins").get(0).style.backgroundImage.length&&(n=n+(' icon="'+
f(r.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,""))+'"'));n=n+">";n=n+("<![CDATA["+p.get_text(r,u)+"]]\>");n=n+"</name>"});n=n+"</content>";t=x[0].id||true;x=x.find("> ul > li");t=x.length?p.get_xml(b,x,j,c,t):"";b=="nest"&&(n=n+t);n=n+"</item>";b=="flat"&&(n=n+t)});m||(n+="</root>");return n}}})})(m);(function(a){a.expr[":"].jstree_contains=function(a,d,e){return 0<=(a.textContent||a.innerText||"").toLowerCase().indexOf(e[3].toLowerCase())};
a.expr[":"].jstree_title_contains=function(a,d,e){return 0<=(a.getAttribute("title")||"").toLowerCase().indexOf(e[3].toLowerCase())};a.jstree.plugin("search",{__init:function(){this.data.search.str="";this.data.search.result=a();this._get_settings().search.show_only_matches&&this.get_container().bind("search.jstree",function(b,f){a(this).children("ul").find("li").hide().removeClass("jstree-last");f.rslt.nodes.parentsUntil(".jstree").andSelf().show().filter("ul").each(function(){a(this).children("li:visible").eq(-1).addClass("jstree-last")})}).bind("clear_search.jstree",
function(){a(this).children("ul").find("li").css("display","").end().end().jstree("clean_node",-1)})},defaults:{ajax:!1,search_method:"jstree_contains",show_only_matches:!1},_fn:{search:function(b,f){if(""===a.trim(b))this.clear_search();else{var e=this.get_settings().search,g=this,j=function(){};this.data.search.str=b;if(!f&&!1!==e.ajax&&0<this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length){this.search.supress_callback=!0;j=function(a,b,d){var f=this.get_settings().search.ajax.success;
f&&(a=f.call(this,a,b,d)||a);this.data.search.to_open=a;this._search_open()};e.ajax.context=this;e.ajax.error=function(){};e.ajax.success=j;a.isFunction(e.ajax.url)&&(e.ajax.url=e.ajax.url.call(this,b));a.isFunction(e.ajax.data)&&(e.ajax.data=e.ajax.data.call(this,b));e.ajax.data||(e.ajax.data={search_string:b});if(!e.ajax.dataType||/^json/.exec(e.ajax.dataType))e.ajax.dataType="json";a.ajax(e.ajax)}else this.data.search.result.length&&this.clear_search(),this.data.search.result=this.get_container().find("a"+
(this.data.languages?"."+this.get_lang():"")+":"+e.search_method+"("+this.data.search.str+")"),this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function(){g.open_node(this,!1,!0)}),this.__callback({nodes:this.data.search.result,str:b})}},clear_search:function(){this.data.search.result.removeClass("jstree-search");this.__callback(this.data.search.result);this.data.search.result=a()},_search_open:function(){var b=this,f=!0,e=[],g=[];this.data.search.to_open.length&&
(a.each(this.data.search.to_open,function(b,c){if("#"==c)return!0;a(c).length&&a(c).is(".jstree-closed")?e.push(c):g.push(c)}),e.length&&(this.data.search.to_open=g,a.each(e,function(a,c){b.open_node(c,function(){b._search_open(!0)})}),f=!1));f&&this.search(this.data.search.str,!0)}}})})(m);(function(a){a.vakata.context={hide_on_mouseleave:!1,cnt:a("<div id='vakata-contextmenu' />"),vis:!1,tgt:!1,par:!1,func:!1,data:!1,rtl:!1,show:function(b,f,e,g,j,c,m){a.vakata.context.rtl=!!m;if(b=a.vakata.context.parse(b)){a.vakata.context.vis=
!0;a.vakata.context.tgt=f;a.vakata.context.par=c||f||null;a.vakata.context.data=j||null;a.vakata.context.cnt.html(b).css({visibility:"hidden",display:"block",left:0,top:0});if(a.vakata.context.hide_on_mouseleave)a.vakata.context.cnt.one("mouseleave",function(){a.vakata.context.hide()});j=a.vakata.context.cnt.height();c=a.vakata.context.cnt.width();e+c>a(document).width()&&(e=a(document).width()-(c+5),a.vakata.context.cnt.find("li > ul").addClass("right"));g+j>a(document).height()&&(g-=j+f[0].offsetHeight,
a.vakata.context.cnt.find("li > ul").addClass("bottom"));a.vakata.context.cnt.css({left:e,top:g}).find("li:has(ul)").bind("mouseenter",function(){var b=a(document).width(),c=a(document).height(),f=a(this).children("ul").show();b!==a(document).width()&&f.toggleClass("right");c!==a(document).height()&&f.toggleClass("bottom")}).bind("mouseleave",function(){a(this).children("ul").hide()}).end().css({visibility:"visible"}).show();a(document).triggerHandler("context_show.vakata")}},hide:function(){a.vakata.context.vis=
!1;a.vakata.context.cnt.attr("class","").css({visibility:"hidden"});a(document).triggerHandler("context_hide.vakata")},parse:function(b,f){if(!b)return!1;var e="",g=!1,j=!0;f||(a.vakata.context.func={});e+="<ul>";a.each(b,function(b,f){if(!f)return true;a.vakata.context.func[b]=f.action;!j&&f.separator_before&&(e=e+"<li class='vakata-separator vakata-separator-before'></li>");j=false;e=e+("<li class='"+(f._class||"")+(f._disabled?" jstree-contextmenu-disabled ":"")+"'><ins ");f.icon&&f.icon.indexOf("/")===
-1&&(e=e+(" class='"+f.icon+"' "));f.icon&&f.icon.indexOf("/")!==-1&&(e=e+(" style='background:url("+f.icon+") center center no-repeat;' "));e=e+(">&#160;</ins><a href='#' rel='"+b+"'>");f.submenu&&(e=e+("<span style='float:"+(a.vakata.context.rtl?"left":"right")+";'>&raquo;</span>"));e=e+(f.label+"</a>");if(f.submenu)(g=a.vakata.context.parse(f.submenu,true))&&(e=e+g);e=e+"</li>";if(f.separator_after){e=e+"<li class='vakata-separator vakata-separator-after'></li>";j=true}});e=e.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,
"");e+="</ul>";a(document).triggerHandler("context_parse.vakata");return 10<e.length?e:!1},exec:function(b){return a.isFunction(a.vakata.context.func[b])?(a.vakata.context.func[b].call(a.vakata.context.data,a.vakata.context.par),!0):!1}};a(function(){a.vakata.css.add_sheet({str:"#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } #vakata-contextmenu ul { min-width:180px; *width:180px; } #vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } #vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } #vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } #vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } #vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } #vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } #vakata-contextmenu .right { right:100%; left:auto; } #vakata-contextmenu .bottom { bottom:-1px; top:auto; } #vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ",
title:"vakata"});a.vakata.context.cnt.delegate("a","click",function(a){a.preventDefault()}).delegate("a","mouseup",function(){!a(this).parent().hasClass("jstree-contextmenu-disabled")&&a.vakata.context.exec(a(this).attr("rel"))?a.vakata.context.hide():a(this).blur()}).delegate("a","mouseover",function(){a.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");a(document).bind("mousedown",function(b){a.vakata.context.vis&&!a.contains(a.vakata.context.cnt[0],b.target)&&
a.vakata.context.hide()});"undefined"!==typeof a.hotkeys&&a(document).bind("keydown","up",function(b){if(a.vakata.context.vis){var f=a.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();f.length||(f=a.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last());f.addClass("vakata-hover");b.stopImmediatePropagation();b.preventDefault()}}).bind("keydown","down",function(b){if(a.vakata.context.vis){var f=
a.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();f.length||(f=a.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first());f.addClass("vakata-hover");b.stopImmediatePropagation();b.preventDefault()}}).bind("keydown","right",function(b){a.vakata.context.vis&&(a.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover"),
b.stopImmediatePropagation(),b.preventDefault())}).bind("keydown","left",function(b){a.vakata.context.vis&&(a.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover"),b.stopImmediatePropagation(),b.preventDefault())}).bind("keydown","esc",function(b){a.vakata.context.hide();b.preventDefault()}).bind("keydown","space",function(b){a.vakata.context.cnt.find(".vakata-hover").last().children("a").click();b.preventDefault()})});a.jstree.plugin("contextmenu",
{__init:function(){this.get_container().delegate("a","contextmenu.jstree",a.proxy(function(b){b.preventDefault();a(b.currentTarget).hasClass("jstree-loading")||this.show_contextmenu(b.currentTarget,b.pageX,b.pageY)},this)).delegate("a","click.jstree",a.proxy(function(){this.data.contextmenu&&a.vakata.context.hide()},this)).bind("destroy.jstree",a.proxy(function(){this.data.contextmenu&&a.vakata.context.hide()},this));a(document).bind("context_hide.vakata",a.proxy(function(){this.data.contextmenu=
!1},this))},defaults:{select_node:!1,show_at_node:!0,items:{create:{separator_before:!1,separator_after:!0,label:"Create",action:function(a){this.create(a)}},rename:{separator_before:!1,separator_after:!1,label:"Rename",action:function(a){this.rename(a)}},remove:{separator_before:!1,icon:!1,separator_after:!1,label:"Delete",action:function(a){this.is_selected(a)?this.remove():this.remove(a)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,
separator_after:!1,label:"Cut",action:function(a){this.cut(a)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(a){this.copy(a)}},paste:{separator_before:!1,icon:!1,separator_after:!1,label:"Paste",action:function(a){this.paste(a)}}}}}},_fn:{show_contextmenu:function(b,f,e){var b=this._get_node(b),g=this.get_settings().contextmenu,j=b.children("a:visible:eq(0)"),c=!1,c=!1;g.select_node&&(this.data.ui&&!this.is_selected(b))&&(this.deselect_all(),this.select_node(b,
!0));if(g.show_at_node||"undefined"===typeof f||"undefined"===typeof e)c=j.offset(),f=c.left,e=c.top+this.data.core.li_height;c=b.data("jstree")&&b.data("jstree").contextmenu?b.data("jstree").contextmenu:g.items;a.isFunction(c)&&(c=c.call(this,b));this.data.contextmenu=!0;a.vakata.context.show(c,j,f,e,this,b,this._get_settings().core.rtl);this.data.themes&&a.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}})})(m);(function(a){a.jstree.plugin("types",{__init:function(){var b=
this._get_settings().types;this.data.types.attach_to=[];this.get_container().bind("init.jstree",a.proxy(function(){var f=b.type_attr,e="",g=this;a.each(b.types,function(b,c){a.each(c,function(a){/^(max_depth|max_children|icon|valid_children)$/.test(a)||g.data.types.attach_to.push(a)});if(!c.icon)return!0;if(c.icon.image||c.icon.position)e="default"==b?e+(".jstree-"+g.get_index()+" a > .jstree-icon { "):e+(".jstree-"+g.get_index()+" li["+f+'="'+b+'"] > a > .jstree-icon { '),c.icon.image&&(e+=" background-image:url("+
c.icon.image+"); "),e=c.icon.position?e+(" background-position:"+c.icon.position+"; "):e+" background-position:0 0; ",e+="} "});""!==e&&a.vakata.css.add_sheet({str:e,title:"jstree-types"})},this)).bind("before.jstree",a.proxy(function(b,e){var g,j;if((g=(g=this._get_settings().types.use_data?this._get_node(e.args[0]):!1)&&-1!==g&&g.length?g.data("jstree"):!1)&&g.types&&!1===g.types[e.func])return b.stopImmediatePropagation(),!1;if(-1!==a.inArray(e.func,this.data.types.attach_to)&&e.args[0]&&(e.args[0].tagName||
e.args[0].jquery))if(g=this._get_settings().types.types,j=this._get_type(e.args[0]),(g[j]&&"undefined"!==typeof g[j][e.func]||g["default"]&&"undefined"!==typeof g["default"][e.func])&&!1===this._check(e.func,e.args[0]))return b.stopImmediatePropagation(),!1},this));e&&this.get_container().bind("load_node.jstree set_type.jstree",a.proxy(function(b,e){var g=e&&e.rslt&&e.rslt.obj&&-1!==e.rslt.obj?this._get_node(e.rslt.obj).parent():this.get_container_ul(),j=!1,c=this._get_settings().types;a.each(c.types,
function(a,b){if(b.icon&&(b.icon.image||b.icon.position))j="default"===a?g.find("li > a > .jstree-icon"):g.find("li["+c.type_attr+"='"+a+"'] > a > .jstree-icon"),b.icon.image&&j.css("backgroundImage","url("+b.icon.image+")"),j.css("backgroundPosition",b.icon.position||"0 0")})},this))},defaults:{max_children:-1,max_depth:-1,valid_children:"all",use_data:!1,type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_types_notify:function(a,d){d.type&&this._get_settings().types.use_data&&
this.set_type(d.type,a)},_get_type:function(a){a=this._get_node(a);return!a||!a.length?!1:a.attr(this._get_settings().types.type_attr)||"default"},set_type:function(a,d){var d=this._get_node(d),e=!d.length||!a?!1:d.attr(this._get_settings().types.type_attr,a);e&&this.__callback({obj:d,type:a});return e},_check:function(b,f,e){var f=this._get_node(f),g=!1,j=this._get_type(f),c=0,m=this,n=this._get_settings().types,o=!1;if(-1===f)if(n[b])g=n[b];else return;else{if(!1===j)return;(o=n.use_data?f.data("jstree"):
!1)&&o.types&&"undefined"!==typeof o.types[b]?g=o.types[b]:n.types[j]&&"undefined"!==typeof n.types[j][b]?g=n.types[j][b]:n.types["default"]&&"undefined"!==typeof n.types["default"][b]&&(g=n.types["default"][b])}a.isFunction(g)&&(g=g.call(this,f));"max_depth"===b&&(-1!==f&&!1!==e&&-2!==n.max_depth&&0!==g)&&f.children("a:eq(0)").parentsUntil(".jstree","li").each(function(a){if(-1!==n.max_depth&&0>=n.max_depth-(a+1))return g=0,!1;c=0===a?g:m._check(b,this,!1);if(-1!==c&&0>=c-(a+1))return g=0,!1;if(0<=
c&&(c-(a+1)<g||0>g))g=c-(a+1);if(0<=n.max_depth&&(n.max_depth-(a+1)<g||0>g))g=n.max_depth-(a+1)});return g},check_move:function(){if(!this.__call_old())return!1;var b=this._get_move(),f=b.rt._get_settings().types,e=b.rt._check("max_children",b.cr),g=b.rt._check("max_depth",b.cr),j=b.rt._check("valid_children",b.cr),c=0,m=1;if("none"===j||a.isArray(j)&&(b.ot&&b.ot._get_type)&&(b.o.each(function(){if(-1===a.inArray(b.ot._get_type(this),j))return m=!1}),!1===m)||-2!==f.max_children&&-1!==e&&(c=-1===
b.cr?this.get_container().find("> ul > li").not(b.o).length:b.cr.find("> ul > li").not(b.o).length,c+b.o.length>e))return!1;if(-2!==f.max_depth&&-1!==g){m=0;if(0===g)return!1;if("undefined"===typeof b.o.d){for(f=b.o;0<f.length;)f=f.find("> ul > li"),m++;b.o.d=m}if(0>g-b.o.d)return!1}return!0},create_node:function(b,f,e,g,j,c){if(!c&&(j||this._is_loaded(b))){var m="string"==typeof f&&f.match(/^before|after$/i)&&-1!==b?this._get_parent(b):this._get_node(b),n=this._get_settings().types,o=this._check("max_children",
m),p=this._check("max_depth",m),r=this._check("valid_children",m);"string"===typeof e&&(e={data:e});e||(e={});if("none"===r)return!1;if(a.isArray(r))if(!e.attr||!e.attr[n.type_attr])e.attr||(e.attr={}),e.attr[n.type_attr]=r[0];else if(-1===a.inArray(e.attr[n.type_attr],r))return!1;if(-2!==n.max_children&&-1!==o&&(m=-1===m?this.get_container().find("> ul > li").length:m.find("> ul > li").length,m+1>o)||-2!==n.max_depth&&-1!==p&&0>p-1)return!1}return this.__call_old(!0,b,f,e,g,j,c)}}})})(m);(function(a){a.jstree.plugin("html_data",
{__init:function(){this.data.html_data.original_container_html=this.get_container().find(" > ul > li").clone(!0);this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function(){return 3==this.nodeType}).remove()},defaults:{data:!1,ajax:!1,correct_state:!0},_fn:{load_node:function(a,d,e){var g=this;this.load_node_html(a,function(){g.__callback({obj:g._get_node(a)});d.call(this)},e)},_is_loaded:function(b){b=this._get_node(b);return-1==b||!b||!this._get_settings().html_data.ajax&&
!a.isFunction(this._get_settings().html_data.data)||b.is(".jstree-open, .jstree-leaf")||0<b.children("ul").children("li").size()},load_node_html:function(b,f,e){var g,j=this.get_settings().html_data,c=function(){};g=function(){};if((b=this._get_node(b))&&-1!==b){if(b.data("jstree-is-loading"))return;b.data("jstree-is-loading",!0)}switch(!0){case a.isFunction(j.data):j.data.call(this,b,a.proxy(function(c){if(c&&c!==""&&c.toString&&c.toString().replace(/^[\s\n]+$/,"")!==""){c=a(c);c.is("ul")||(c=a("<ul />").append(c));
if(b==-1||!b)this.get_container().children("ul").empty().append(c.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");else{b.children("a.jstree-loading").removeClass("jstree-loading");b.append(c).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||
this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");b.removeData("jstree-is-loading")}this.clean_node(b);f&&f.call(this)}else if(b&&b!==-1){b.children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading");if(j.correct_state){this.correct_state(b);f&&f.call(this)}}else if(j.correct_state){this.get_container().children("ul").empty();f&&f.call(this)}},
this));break;case !j.data&&!j.ajax:if(!b||-1==b)this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),this.clean_node();f&&f.call(this);break;case !!j.data&&!j.ajax||!!j.data&&!!j.ajax&&(!b||-1===b):if(!b||
-1==b)g=a(j.data),g.is("ul")||(g=a("<ul />").append(g)),this.get_container().children("ul").empty().append(g.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),this.clean_node();f&&f.call(this);break;case !j.data&&!!j.ajax||!!j.data&&!!j.ajax&&b&&-1!==b:b=this._get_node(b),c=function(a,
c,d){var f=this.get_settings().html_data.ajax.error;f&&f.call(this,a,c,d);if(b!=-1&&b.length){b.children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading");c==="success"&&j.correct_state&&this.correct_state(b)}else c==="success"&&j.correct_state&&this.get_container().children("ul").empty();e&&e.call(this)},g=function(e,g,l){var m=this.get_settings().html_data.ajax.success;m&&(e=m.call(this,e,g,l)||e);if(e===""||e&&e.toString&&e.toString().replace(/^[\s\n]+$/,"")===
"")return c.call(this,l,g,"");if(e){e=a(e);e.is("ul")||(e=a("<ul />").append(e));if(b==-1||!b)this.get_container().children("ul").empty().append(e.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");else{b.children("a.jstree-loading").removeClass("jstree-loading");b.append(e).children("ul").find("li, a").filter(function(){return!this.firstChild||
!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");b.removeData("jstree-is-loading")}this.clean_node(b);f&&f.call(this)}else if(b&&b!==-1){b.children("a.jstree-loading").removeClass("jstree-loading");b.removeData("jstree-is-loading");if(j.correct_state){this.correct_state(b);f&&f.call(this)}}else if(j.correct_state){this.get_container().children("ul").empty();
f&&f.call(this)}},j.ajax.context=this,j.ajax.error=c,j.ajax.success=g,j.ajax.dataType||(j.ajax.dataType="html"),a.isFunction(j.ajax.url)&&(j.ajax.url=j.ajax.url.call(this,b)),a.isFunction(j.ajax.data)&&(j.ajax.data=j.ajax.data.call(this,b)),a.ajax(j.ajax)}}}});a.jstree.defaults.plugins.push("html_data")})(m);(function(a){a.jstree.plugin("themeroller",{__init:function(){var b=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").addClass("jstree-themeroller").delegate("a",
"mouseenter.jstree",function(f){a(f.currentTarget).hasClass("jstree-loading")||a(this).addClass(b.item_h)}).delegate("a","mouseleave.jstree",function(){a(this).removeClass(b.item_h)}).bind("init.jstree",a.proxy(function(a,b){b.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");this._themeroller(b.inst.get_container().find("> ul > li"))},this)).bind("open_node.jstree create_node.jstree",a.proxy(function(a,b){this._themeroller(b.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",
a.proxy(function(){this._themeroller()},this)).bind("close_node.jstree",a.proxy(function(a,b){this._themeroller(b.rslt.obj)},this)).bind("delete_node.jstree",a.proxy(function(a,b){this._themeroller(b.rslt.parent)},this)).bind("correct_state.jstree",a.proxy(function(a,d){d.rslt.obj.children("ins.jstree-icon").removeClass(b.opened+" "+b.closed+" ui-icon").end().find("> a > ins.ui-icon").filter(function(){return-1===this.className.toString().replace(b.item_clsd,"").replace(b.item_open,"").replace(b.item_leaf,
"").indexOf("ui-icon-")}).removeClass(b.item_open+" "+b.item_clsd).addClass(b.item_leaf||"jstree-no-icon")},this)).bind("select_node.jstree",a.proxy(function(a,d){d.rslt.obj.children("a").addClass(b.item_a)},this)).bind("deselect_node.jstree deselect_all.jstree",a.proxy(function(){this.get_container().find("a."+b.item_a).removeClass(b.item_a).end().find("a.jstree-clicked").addClass(b.item_a)},this)).bind("dehover_node.jstree",a.proxy(function(a,d){d.rslt.obj.children("a").removeClass(b.item_h)},this)).bind("hover_node.jstree",
a.proxy(function(a,d){this.get_container().find("a."+b.item_h).not(d.rslt.obj).removeClass(b.item_h);d.rslt.obj.children("a").addClass(b.item_h)},this)).bind("move_node.jstree",a.proxy(function(a,b){this._themeroller(b.rslt.o);this._themeroller(b.rslt.op)},this))},__destroy:function(){var b=this._get_settings().themeroller,f=["ui-icon"];a.each(b,function(a,b){b=b.split(" ");b.length&&(f=f.concat(b))});this.get_container().removeClass("ui-widget-content").find("."+f.join(", .")).removeClass(f.join(" "))},
_fn:{_themeroller:function(a){var d=this._get_settings().themeroller,a=!a||-1==a?this.get_container_ul():this._get_node(a).parent();a.find("li.jstree-closed").children("ins.jstree-icon").removeClass(d.opened).addClass("ui-icon "+d.closed).end().children("a").addClass(d.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return-1===this.className.toString().replace(d.item_clsd,"").replace(d.item_open,"").replace(d.item_leaf,"").indexOf("ui-icon-")}).removeClass(d.item_leaf+" "+
d.item_open).addClass(d.item_clsd||"jstree-no-icon").end().end().end().end().find("li.jstree-open").children("ins.jstree-icon").removeClass(d.closed).addClass("ui-icon "+d.opened).end().children("a").addClass(d.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return-1===this.className.toString().replace(d.item_clsd,"").replace(d.item_open,"").replace(d.item_leaf,"").indexOf("ui-icon-")}).removeClass(d.item_leaf+" "+d.item_clsd).addClass(d.item_open||"jstree-no-icon").end().end().end().end().find("li.jstree-leaf").children("ins.jstree-icon").removeClass(d.closed+
" ui-icon "+d.opened).end().children("a").addClass(d.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return-1===this.className.toString().replace(d.item_clsd,"").replace(d.item_open,"").replace(d.item_leaf,"").indexOf("ui-icon-")}).removeClass(d.item_clsd+" "+d.item_open).addClass(d.item_leaf||"jstree-no-icon")}},defaults:{opened:"ui-icon-triangle-1-se",closed:"ui-icon-triangle-1-e",item:"ui-state-default",item_h:"ui-state-hover",item_a:"ui-state-active",item_open:"ui-icon-folder-open",
item_clsd:"ui-icon-folder-collapsed",item_leaf:"ui-icon-document"}});a(function(){a.vakata.css.add_sheet({str:".jstree-themeroller .ui-icon { overflow:visible; } .jstree-themeroller a { padding:0 2px; } .jstree-themeroller .jstree-no-icon { display:none; }",title:"jstree"})})})(m);(function(a){a.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",a.proxy(function(b,f){var e=[],g=!0,j;"move_node"==f.func&&(!0===f.args[4]&&f.args[0].o&&f.args[0].o.length)&&(f.args[0].o.children("a").each(function(){e.push(a(this).text().replace(/^\s+/g,
""))}),g=this._check_unique(e,f.args[0].np.find("> ul > li").not(f.args[0].o),"move_node"));if("create_node"==f.func&&(f.args[4]||this._is_loaded(f.args[0]))){g=this._get_node(f.args[0]);if(f.args[1]&&("before"===f.args[1]||"after"===f.args[1]))if(g=this._get_parent(f.args[0]),!g||-1===g)g=this.get_container();"string"===typeof f.args[2]?e.push(f.args[2]):!f.args[2]||!f.args[2].data?e.push(this._get_string("new_node")):e.push(f.args[2].data);g=this._check_unique(e,g.find("> ul > li"),"create_node")}if("rename_node"==
f.func){e.push(f.args[1]);j=this._get_node(f.args[0]);g=this._get_parent(j);if(!g||-1===g)g=this.get_container();g=this._check_unique(e,g.find("> ul > li").not(j),"rename_node")}if(!g)return b.stopPropagation(),!1},this))},defaults:{error_callback:a.noop},_fn:{_check_unique:function(b,f,e){var g=[];f.children("a").each(function(){g.push(a(this).text().replace(/^\s+/g,""))});if(!g.length||!b.length)return!0;g=g.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,
"").split(",");return g.length+b.length!=g.concat(b).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length?(this._get_settings().unique.error_callback.call(null,b,f,e),!1):!0},check_move:function(){if(!this.__call_old())return!1;var b=this._get_move(),f=[];return b.o&&b.o.length?(b.o.children("a").each(function(){f.push(a(this).text().replace(/^\s+/g,""))}),this._check_unique(f,b.np.find("> ul > li").not(b.o),"check_move")):!0}}})})(m);
(function(d){d.jstree.plugin("wholerow",{__init:function(){if(!this.data.ui)throw"jsTree wholerow: jsTree UI plugin not included.";this.data.wholerow.html=!1;this.data.wholerow.to=!1;this.get_container().bind("init.jstree",d.proxy(function(){this._get_settings().core.animation=0},this)).bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree",d.proxy(function(a,d){this._prepare_wholerow_span(d&&d.rslt&&d.rslt.obj?d.rslt.obj:-1)},this)).bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree",
d.proxy(function(a,d){this.data.to&&clearTimeout(this.data.to);this.data.to=setTimeout(function(a,b){return function(){a._prepare_wholerow_ul(b)}}(this,d&&d.rslt&&d.rslt.obj?d.rslt.obj:-1),0)},this)).bind("deselect_all.jstree",d.proxy(function(){this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked "+(this.data.themeroller?this._get_settings().themeroller.item_a:""))},this)).bind("select_node.jstree deselect_node.jstree ",d.proxy(function(a,f){f.rslt.obj.each(function(){f.inst.get_container().find(" > .jstree-wholerow li:visible:eq("+
parseInt((d(this).offset().top-f.inst.get_container().offset().top+f.inst.get_container()[0].scrollTop)/f.inst.data.core.li_height,10)+")").children("a").attr("class",f.rslt.obj.children("a").attr("class"))})},this)).bind("hover_node.jstree dehover_node.jstree",d.proxy(function(a,d){this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered "+(this.data.themeroller?this._get_settings().themeroller.item_h:""));"hover_node"===a.type&&this.get_container().find(" > .jstree-wholerow li:visible:eq("+
parseInt((d.rslt.obj.offset().top-this.get_container().offset().top+this.get_container()[0].scrollTop)/this.data.core.li_height,10)+")").children("a").attr("class",d.rslt.obj.children(".jstree-hovered").attr("class"))},this)).delegate(".jstree-wholerow-span, ins.jstree-icon, li","click.jstree",function(a){var f=d(a.currentTarget);"A"===a.target.tagName||"INS"===a.target.tagName&&f.closest("li").is(".jstree-open, .jstree-closed")||(f.closest("li").children("a:visible:eq(0)").click(),a.stopImmediatePropagation())}).delegate("li",
"mouseover.jstree",d.proxy(function(a){a.stopImmediatePropagation();if(d(a.currentTarget).children(".jstree-hovered, .jstree-clicked").length)return!1;this.hover_node(a.currentTarget);return!1},this)).delegate("li","mouseleave.jstree",d.proxy(function(a){d(a.currentTarget).children("a").hasClass("jstree-hovered").length||this.dehover_node(a.currentTarget)},this));(a||e)&&d.vakata.css.add_sheet({str:".jstree-"+this.get_index()+" { position:relative; } ",title:"jstree"})},defaults:{},__destroy:function(){this.get_container().children(".jstree-wholerow").remove();
this.get_container().find(".jstree-wholerow-span").remove()},_fn:{_prepare_wholerow_span:function(a){a=!a||-1==a?this.get_container().find("> ul > li"):this._get_node(a);!1!==a&&a.each(function(){d(this).find("li").andSelf().each(function(){var a=d(this);if(a.children(".jstree-wholerow-span").length)return!0;a.prepend("<span class='jstree-wholerow-span' style='width:"+18*a.parentsUntil(".jstree","li").length+"px;'>&#160;</span>")})})},_prepare_wholerow_ul:function(){var b=this.get_container().children("ul").eq(0),
d=b.html();b.addClass("jstree-wholerow-real");this.data.wholerow.last_html!==d&&(this.data.wholerow.last_html=d,this.get_container().children(".jstree-wholerow").remove(),this.get_container().append(b.clone().removeClass("jstree-wholerow-real").wrapAll("<div class='jstree-wholerow' />").parent().width(b.parent()[0].scrollWidth).css("top",-1*(b.height()+(a?5:0))).find("li[id]").each(function(){this.removeAttribute("id")}).end()))}}});d(function(){var b=".jstree .jstree-wholerow-real { position:relative; z-index:1; } .jstree .jstree-wholerow-real li { cursor:pointer; } .jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } .jstree .jstree-wholerow { position:relative; z-index:0; height:0; } .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } .jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }";
j&&(b+=".jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } .jstree .jstree-wholerow-real a { border-color:transparent !important; } ");if(a||e)b+=".jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } .jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ";d.vakata.css.add_sheet({str:b,title:"jstree"})})})(m);(function(a){var b=
["getChildren","getChildrenCount","getAttr","getName","getProps"],e=function(b,e){var f=!0,b=b||{},e=[].concat(e);a.each(e,function(c,e){if(!a.isFunction(b[e]))return f=!1});return f};a.jstree.plugin("model",{__init:function(){if(!this.data.json_data)throw"jsTree model: jsTree json_data plugin not included.";this._get_settings().json_data.data=function(j,g){var k=-1==j?this._get_settings().model.object:j.data("jstree_model");if(!e(k,b))return g.call(null,!1);this._get_settings().model.async?k.getChildren(a.proxy(function(a){this.model_done(a,
g)},this)):this.model_done(k.getChildren(),g)}},defaults:{object:!1,id_prefix:!1,async:!1},_fn:{model_done:function(b,e){var f=[],c=this._get_settings(),j=this;a.isArray(b)||(b=[b]);a.each(b,function(b,e){var g=e.getProps()||{};g.attr=e.getAttr()||{};e.getChildrenCount()&&(g.state="closed");g.data=e.getName();a.isArray(g.data)||(g.data=[g.data]);j.data.types&&a.isFunction(e.getType)&&(g.attr[c.types.type_attr]=e.getType());g.attr.id&&c.model.id_prefix&&(g.attr.id=c.model.id_prefix+g.attr.id);g.metadata||
(g.metadata={});g.metadata.jstree_model=e;f.push(g)});e.call(null,f)}}})})(m)}})()});define("jqgrid",["jquery","jqgrid-locale-"+(window&&window.__DEPS__&&window.__DEPS__.lang||"en"),"jqueryui"],function(m){(function(a){a.jgrid=a.jgrid||{};a.extend(a.jgrid,{htmlDecode:function(a){return a&&("&nbsp;"==a||"&#160;"==a||1==a.length&&160==a.charCodeAt(0))?"":!a?a:(""+a).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},htmlEncode:function(a){return!a?a:(""+a).replace(/&/g,
"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\"/g,"&quot;")},format:function(e){var d=a.makeArray(arguments).slice(1);void 0===e&&(e="");return e.replace(/\{(\d+)\}/g,function(a,e){return d[e]})},getCellIndex:function(e){e=a(e);if(e.is("tr"))return-1;e=(!e.is("td")&&!e.is("th")?e.closest("td,th"):e)[0];return a.browser.msie?a.inArray(e,e.parentNode.cells):e.cellIndex},stripHtml:function(a){var a=a+"",d=/<("[^"]*"|'[^']*'|[^'">])*>/gi;return a?(a=a.replace(d,""))&&"&nbsp;"!==a&&"&#160;"!==
a?a.replace(/\"/g,"'"):"":a},stringToDoc:function(a){var d;if("string"!==typeof a)return a;try{d=(new DOMParser).parseFromString(a,"text/xml")}catch(b){d=new ActiveXObject("Microsoft.XMLDOM"),d.async=!1,d.loadXML(a)}return d&&d.documentElement&&"parsererror"!=d.documentElement.tagName?d:null},parse:function(e){"while(1);"==e.substr(0,9)&&(e=e.substr(9));"/*"==e.substr(0,2)&&(e=e.substr(2,e.length-4));e||(e="{}");return!0===a.jgrid.useJSON&&"object"===typeof ha&&"function"===typeof ha.parse?ha.parse(e):
eval("("+e+")")},parseDate:function(e,d){var b={m:1,d:1,y:1970,h:0,i:0,s:0},f,l,g;f=/[\\\/:_;.,\t\T\s-]/;if(d&&null!==d&&void 0!==d){var d=a.trim(d),d=d.split(f),e=e.split(f),k=a.jgrid.formatter.date.monthNames,c=a.jgrid.formatter.date.AmPm,m=function(a,b){0===a?12==b&&(b=0):12!=b&&(b+=12);return b};f=0;for(l=e.length;f<l;f++)"M"==e[f]&&(g=a.inArray(d[f],k),-1!==g&&12>g&&(d[f]=g+1)),"F"==e[f]&&(g=a.inArray(d[f],k),-1!==g&&11<g&&(d[f]=g+1-12)),"a"==e[f]&&(g=a.inArray(d[f],c),-1!==g&&(2>g&&d[f]==c[g])&&
(d[f]=g,b.h=m(d[f],b.h))),"A"==e[f]&&(g=a.inArray(d[f],c),-1!==g&&(1<g&&d[f]==c[g])&&(d[f]=g-2,b.h=m(d[f],b.h))),void 0!==d[f]&&(b[e[f].toLowerCase()]=parseInt(d[f],10));b.m=parseInt(b.m,10)-1;f=b.y;70<=f&&99>=f?b.y=1900+b.y:0<=f&&69>=f&&(b.y=2E3+b.y)}return new Date(b.y,b.m,b.d,b.h,b.i,b.s,0)},jqID:function(a){return(a+"").replace(/([\.\:\[\]])/g,"\\$1")},guid:1,uidPref:"jqg",randId:function(e){return(e?e:a.jgrid.uidPref)+a.jgrid.guid++},getAccessor:function(a,d){var b,e,l=[],g;if("function"===typeof d)return d(a);
b=a[d];if(void 0===b)try{if("string"===typeof d&&(l=d.split(".")),g=l.length)for(b=a;b&&g--;)e=l.shift(),b=b[e]}catch(k){}return b},ajaxOptions:{},from:function(e){return new function(d,b){"string"==typeof d&&(d=a.data(d));var e=this,j=d,g=!0,k=!1,c=b,m=/[\$,%]/g,n=null,o=null,p=!1,r="",t=[],x=!0;if("object"==typeof d&&d.push)0<d.length&&(x="object"!=typeof d[0]?!1:!0);else throw"data provides is not an array";this._hasData=function(){return null===j?!1:0===j.length?!1:!0};this._getStr=function(a){var b=
[];k&&b.push("jQuery.trim(");b.push("String("+a+")");k&&b.push(")");g||b.push(".toLowerCase()");return b.join("")};this._strComp=function(a){return"string"==typeof a?".toString()":""};this._group=function(a,b){return{field:a.toString(),unique:b,items:[]}};this._toStr=function(b){k&&(b=a.trim(b));g||(b=b.toLowerCase());return b.toString().replace(/\\/g,"\\\\").replace(/\"/g,'\\"')};this._funcLoop=function(b){var c=[];a.each(j,function(a,d){c.push(b(d))});return c};this._append=function(a){c=null===
c?"":c+(""===r?" && ":r);p&&(c+="!");c+="("+a+")";p=!1;r=""};this._setCommand=function(a,b){n=a;o=b};this._resetNegate=function(){p=!1};this._repeatCommand=function(a,b){return null===n?e:null!==a&&null!==b?n(a,b):null===o||!x?n(a):n(o,a)};this._equals=function(a,b){return 0===e._compare(a,b,1)};this._compare=function(a,b,c){void 0===c&&(c=1);void 0===a&&(a=null);void 0===b&&(b=null);if(null===a&&null===b)return 0;if(null===a&&null!==b)return 1;if(null!==a&&null===b)return-1;!g&&("number"!==typeof a&&
"number"!==typeof b)&&(a=(""+a).toLowerCase(),b=(""+b).toLowerCase());return a<b?-c:a>b?c:0};this._performSort=function(){0!==t.length&&(j=e._doSort(j,0))};this._doSort=function(a,b){var c=t[b].by,d=t[b].dir,g=t[b].type,j=t[b].datefmt;if(b==t.length-1)return e._getOrder(a,c,d,g,j);b++;c=e._getGroup(a,c,d,g,j);d=[];for(g=0;g<c.length;g++)for(var j=e._doSort(c[g].items,b),k=0;k<j.length;k++)d.push(j[k]);return d};this._getOrder=function(b,c,d,g,j){var k=[],l=[],n="a"==d?1:-1,o,p;void 0===g&&(g="text");
p="float"==g||"number"==g||"currency"==g||"numeric"==g?function(a){a=parseFloat((""+a).replace(m,""));return isNaN(a)?0:a}:"int"==g||"integer"==g?function(a){return a?parseFloat((""+a).replace(m,"")):0}:"date"==g||"datetime"==g?function(b){return a.jgrid.parseDate(j,b).getTime()}:a.isFunction(g)?g:function(b){b||(b="");return a.trim((""+b).toUpperCase())};a.each(b,function(b,d){o=""!==c?a.jgrid.getAccessor(d,c):d;void 0===o&&(o="");o=p(o,d);l.push({vSort:o,index:b})});l.sort(function(a,b){a=a.vSort;
b=b.vSort;return e._compare(a,b,n)});for(var g=0,r=b.length;g<r;)d=l[g].index,k.push(b[d]),g++;return k};this._getGroup=function(b,c,d,g,j){var k=[],l=null,m=null,n;a.each(e._getOrder(b,c,d,g,j),function(b,d){n=a.jgrid.getAccessor(d,c);void 0===n&&(n="");e._equals(m,n)||(m=n,null!==l&&k.push(l),l=e._group(c,n));l.items.push(d)});null!==l&&k.push(l);return k};this.ignoreCase=function(){g=!1;return e};this.useCase=function(){g=!0;return e};this.trim=function(){k=!0;return e};this.noTrim=function(){k=
!1;return e};this.execute=function(){var b=c,d=[];if(null===b)return e;a.each(j,function(){eval(b)&&d.push(this)});j=d;return e};this.data=function(){return j};this.select=function(b){e._performSort();if(!e._hasData())return[];e.execute();if(a.isFunction(b)){var c=[];a.each(j,function(a,d){c.push(b(d))});return c}return j};this.hasMatch=function(){if(!e._hasData())return!1;e.execute();return 0<j.length};this.andNot=function(a,b,c){p=!p;return e.and(a,b,c)};this.orNot=function(a,b,c){p=!p;return e.or(a,
b,c)};this.not=function(a,b,c){return e.andNot(a,b,c)};this.and=function(a,b,c){r=" && ";return void 0===a?e:e._repeatCommand(a,b,c)};this.or=function(a,b,c){r=" || ";return void 0===a?e:e._repeatCommand(a,b,c)};this.isNot=function(a){p=!p;return e.is(a)};this.is=function(a){e._append("this."+a);e._resetNegate();return e};this._compareValues=function(b,c,d,g,j){var k;k=x?"jQuery.jgrid.getAccessor(this,'"+c+"')":"this";void 0===d&&(d=null);var l=d,n=void 0===j.stype?"text":j.stype;if(null!==d)switch(n){case "int":case "integer":l=
isNaN(Number(l))||""===l?"0":l;k="parseInt("+k+",10)";l="parseInt("+l+",10)";break;case "float":case "number":case "numeric":l=(""+l).replace(m,"");l=isNaN(Number(l))||""===l?"0":l;k="parseFloat("+k+")";l="parseFloat("+l+")";break;case "date":case "datetime":l=""+a.jgrid.parseDate(j.newfmt||"Y-m-d",l).getTime();k='jQuery.jgrid.parseDate("'+j.srcfmt+'",'+k+").getTime()";break;default:k=e._getStr(k),l=e._getStr('"'+e._toStr(l)+'"')}e._append(k+" "+g+" "+l);e._setCommand(b,c);e._resetNegate();return e};
this.equals=function(a,b,c){return e._compareValues(e.equals,a,b,"==",c)};this.notEquals=function(a,b,c){return e._compareValues(e.equals,a,b,"!==",c)};this.isNull=function(a,b,c){return e._compareValues(e.equals,a,null,"===",c)};this.greater=function(a,b,c){return e._compareValues(e.greater,a,b,">",c)};this.less=function(a,b,c){return e._compareValues(e.less,a,b,"<",c)};this.greaterOrEquals=function(a,b,c){return e._compareValues(e.greaterOrEquals,a,b,">=",c)};this.lessOrEquals=function(a,b,c){return e._compareValues(e.lessOrEquals,
a,b,"<=",c)};this.startsWith=function(b,c){var d=void 0===c||null===c?b:c,d=k?a.trim(d.toString()).length:d.toString().length;x?e._append(e._getStr("jQuery.jgrid.getAccessor(this,'"+b+"')")+".substr(0,"+d+") == "+e._getStr('"'+e._toStr(c)+'"')):(d=k?a.trim(c.toString()).length:c.toString().length,e._append(e._getStr("this")+".substr(0,"+d+") == "+e._getStr('"'+e._toStr(b)+'"')));e._setCommand(e.startsWith,b);e._resetNegate();return e};this.endsWith=function(b,c){var d=void 0===c||null===c?b:c,d=k?
a.trim(d.toString()).length:d.toString().length;x?e._append(e._getStr("jQuery.jgrid.getAccessor(this,'"+b+"')")+".substr("+e._getStr("jQuery.jgrid.getAccessor(this,'"+b+"')")+".length-"+d+","+d+') == "'+e._toStr(c)+'"'):e._append(e._getStr("this")+".substr("+e._getStr("this")+'.length-"'+e._toStr(b)+'".length,"'+e._toStr(b)+'".length) == "'+e._toStr(b)+'"');e._setCommand(e.endsWith,b);e._resetNegate();return e};this.contains=function(a,b){x?e._append(e._getStr("jQuery.jgrid.getAccessor(this,'"+a+
"')")+'.indexOf("'+e._toStr(b)+'",0) > -1'):e._append(e._getStr("this")+'.indexOf("'+e._toStr(a)+'",0) > -1');e._setCommand(e.contains,a);e._resetNegate();return e};this.groupBy=function(a,b,c,d){return!e._hasData()?null:e._getGroup(j,a,b,c,d)};this.orderBy=function(b,c,d,g){c=void 0===c||null===c?"a":a.trim(c.toString().toLowerCase());if(null===d||void 0===d)d="text";if(null===g||void 0===g)g="Y-m-d";if("desc"==c||"descending"==c)c="d";if("asc"==c||"ascending"==c)c="a";t.push({by:b,dir:c,type:d,
datefmt:g});return e};return e}(e,null)},extend:function(e){a.extend(a.fn.jqGrid,e);this.no_legacy_api||a.fn.extend(e)}});a.fn.jqGrid=function(e){if("string"==typeof e){var d=a.jgrid.getAccessor(a.fn.jqGrid,e);if(!d)throw"jqGrid - No such method: "+e;var b=a.makeArray(arguments).slice(1);return d.apply(this,b)}return this.each(function(){if(!this.grid){var b=a.extend(!0,{url:"",height:150,page:1,rowNum:20,rowTotal:null,records:0,pager:"",pgbuttons:!0,pginput:!0,colModel:[],rowList:[],colNames:[],
sortorder:"asc",sortname:"",datatype:"xml",mtype:"GET",altRows:!1,selarrrow:[],savedRow:[],shrinkToFit:!0,xmlReader:{},jsonReader:{},subGrid:!1,subGridModel:[],reccount:0,lastpage:0,lastsort:0,selrow:null,beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,onHeaderClick:null,viewrecords:!1,loadonce:!1,multiselect:!1,multikey:!1,
editurl:null,search:!1,caption:"",hidegrid:!0,hiddengrid:!1,postData:{},userData:{},treeGrid:!1,treeGridModel:"nested",treeReader:{},treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del",subgridid:"id",npage:null,totalrows:"totalrows"},forceFit:!1,gridstate:"visible",cellEdit:!1,cellsubmit:"remote",nv:0,loadui:"enable",toolbar:[!1,""],scroll:!1,multiboxonly:!1,
deselectAfterSort:!0,scrollrows:!1,autowidth:!1,scrollOffset:18,cellLayout:5,subGridWidth:20,multiselectWidth:20,gridview:!1,rownumWidth:25,rownumbers:!1,pagerpos:"center",recordpos:"right",footerrow:!1,userDataOnFooter:!1,hoverrows:!0,altclass:"ui-priority-secondary",viewsortcols:[!1,"vertical",!0],resizeclass:"",autoencode:!1,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:!1,headertitles:!1,scrollTimeout:40,data:[],_index:{},grouping:!1,groupingView:{groupField:[],groupOrder:[],groupText:[],
groupColumnShow:[],groupSummary:[],showSummaryOnHide:!1,sortitems:[],sortnames:[],groupDataSorted:!1,summary:[],summaryval:[],plusicon:"ui-icon-circlesmall-plus",minusicon:"ui-icon-circlesmall-minus"},ignoreCase:!1,cmTemplate:{}},a.jgrid.defaults,e||{}),d={headers:[],cols:[],footers:[],dragStart:function(c,d,e){this.resizing={idx:c,startX:d.clientX,sOL:e[0]};this.hDiv.style.cursor="col-resize";this.curGbox=a("#rs_m"+a.jgrid.jqID(b.id),"#gbox_"+a.jgrid.jqID(b.id));this.curGbox.css({display:"block",
left:e[0],top:e[1],height:e[2]});a.isFunction(b.resizeStart)&&b.resizeStart.call(this,d,c);document.onselectstart=function(){return!1}},dragMove:function(a){if(this.resizing){var c=a.clientX-this.resizing.startX,a=this.headers[this.resizing.idx],d="ltr"===b.direction?a.width+c:a.width-c,e;33<d&&(this.curGbox.css({left:this.resizing.sOL+c}),!0===b.forceFit?(e=this.headers[this.resizing.idx+b.nv],c="ltr"===b.direction?e.width-c:e.width+c,33<c&&(a.newWidth=d,e.newWidth=c)):(this.newWidth="ltr"===b.direction?
b.tblwidth+c:b.tblwidth-c,a.newWidth=d))}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var c=this.resizing.idx,d=this.headers[c].newWidth||this.headers[c].width,d=parseInt(d,10);this.resizing=!1;a("#rs_m"+a.jgrid.jqID(b.id)).css("display","none");b.colModel[c].width=d;this.headers[c].width=d;this.headers[c].el.style.width=d+"px";this.cols[c].style.width=d+"px";0<this.footers.length&&(this.footers[c].style.width=d+"px");!0===b.forceFit?(d=this.headers[c+b.nv].newWidth||this.headers[c+
b.nv].width,this.headers[c+b.nv].width=d,this.headers[c+b.nv].el.style.width=d+"px",this.cols[c+b.nv].style.width=d+"px",0<this.footers.length&&(this.footers[c+b.nv].style.width=d+"px"),b.colModel[c+b.nv].width=d):(b.tblwidth=this.newWidth||b.tblwidth,a("table:first",this.bDiv).css("width",b.tblwidth+"px"),a("table:first",this.hDiv).css("width",b.tblwidth+"px"),this.hDiv.scrollLeft=this.bDiv.scrollLeft,b.footerrow&&(a("table:first",this.sDiv).css("width",b.tblwidth+"px"),this.sDiv.scrollLeft=this.bDiv.scrollLeft));
a.isFunction(b.resizeStop)&&b.resizeStop.call(this,d,c)}this.curGbox=null;document.onselectstart=function(){return!0}},populateVisible:function(){d.timer&&clearTimeout(d.timer);d.timer=null;var c=a(d.bDiv).height();if(c){var e=a("table:first",d.bDiv),g,j;if(e[0].rows.length)try{j=(g=e[0].rows[1])?a(g).outerHeight()||d.prevRowHeight:d.prevRowHeight}catch(k){j=d.prevRowHeight}if(j){d.prevRowHeight=j;var m=b.rowNum;g=d.scrollTop=d.bDiv.scrollTop;var n=Math.round(e.position().top)-g,o=n+e.height();j*=
m;var q,p,r;if(o<c&&0>=n&&(void 0===b.lastpage||parseInt((o+g+j-1)/j,10)<=b.lastpage))p=parseInt((c-o+j-1)/j,10),0<=o||2>p||!0===b.scroll?(q=Math.round((o+g)/j)+1,n=-1):n=1;0<n&&(q=parseInt(g/j,10)+1,p=parseInt((g+c)/j,10)+2-q,r=!0);if(p&&!(b.lastpage&&q>b.lastpage||1==b.lastpage||q===b.page&&q===b.lastpage))d.hDiv.loading?d.timer=setTimeout(d.populateVisible,b.scrollTimeout):(b.page=q,r&&(d.selectionPreserver(e[0]),d.emptyRows(d.bDiv,!1,!1)),d.populate(p))}}},scrollGrid:function(a){if(b.scroll){var c=
d.bDiv.scrollTop;void 0===d.scrollTop&&(d.scrollTop=0);c!=d.scrollTop&&(d.scrollTop=c,d.timer&&clearTimeout(d.timer),d.timer=setTimeout(d.populateVisible,b.scrollTimeout))}d.hDiv.scrollLeft=d.bDiv.scrollLeft;b.footerrow&&(d.sDiv.scrollLeft=d.bDiv.scrollLeft);a.stopPropagation()},selectionPreserver:function(b){var c=b.p,d=c.selrow,e=c.selarrrow?a.makeArray(c.selarrrow):null,f=b.grid.bDiv.scrollLeft,g=c.gridComplete;c.gridComplete=function(){c.selrow=null;c.selarrrow=[];if(c.multiselect&&e&&0<e.length)for(var j=
0;j<e.length;j++)e[j]!=d&&a(b).jqGrid("setSelection",e[j],!1);d&&a(b).jqGrid("setSelection",d,!1);b.grid.bDiv.scrollLeft=f;c.gridComplete=g;c.gridComplete&&g()}}};if("TABLE"!=this.tagName)alert("Element is not a table");else{a(this).empty().attr("tabindex","1");this.p=b;var g,k,c;if(0===this.p.colNames.length)for(g=0;g<this.p.colModel.length;g++)this.p.colNames[g]=this.p.colModel[g].label||this.p.colModel[g].name;if(this.p.colNames.length!==this.p.colModel.length)alert(a.jgrid.errors.model);else{var m=
a("<div class='ui-jqgrid-view'></div>"),n,o=a.browser.msie?!0:!1,p=a.browser.webkit||a.browser.safari?!0:!1;c=this;c.p.direction=a.trim(c.p.direction.toLowerCase());-1==a.inArray(c.p.direction,["ltr","rtl"])&&(c.p.direction="ltr");k=c.p.direction;a(m).insertBefore(this);a(this).appendTo(m).removeClass("scroll");var r=a("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");a(r).insertBefore(m).attr({id:"gbox_"+this.id,dir:k});a(m).appendTo(r).attr("id","gview_"+this.id);n=o&&6>=
a.browser.version?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"";a("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+this.id+"'></div>").append(n).insertBefore(m);a("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").insertBefore(m);a(this).attr({cellspacing:"0",cellpadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+
this.id});var t=function(a,b){a=parseInt(a,10);return isNaN(a)?b?b:0:a},x=function(b,e,f,g,j,k){var m=c.p.colModel[b],n=m.align,o='style="',q=m.classes,p=m.name,r=[];n&&(o=o+("text-align:"+n+";"));m.hidden===true&&(o=o+"display:none;");if(e===0)o=o+("width: "+d.headers[b].width+"px;");else if(m.cellattr&&a.isFunction(m.cellattr)&&(b=m.cellattr.call(c,j,f,g,m,k))&&typeof b==="string"){b=b.replace(/style/i,"style").replace(/title/i,"title");if(b.indexOf("title")>-1)m.title=false;b.indexOf("class")>
-1&&(q=void 0);r=b.split("style");if(r.length===2){r[1]=a.trim(r[1].replace("=",""));if(r[1].indexOf("'")===0||r[1].indexOf('"')===0)r[1]=r[1].substring(1);o=o+r[1].replace(/'/gi,'"')}else o=o+'"'}if(!r.length){r[0]="";o=o+'"'}o=o+((q!==void 0?' class="'+q+'"':"")+(m.title&&f?' title="'+a.jgrid.stripHtml(f)+'"':""));o=o+(' aria-describedby="'+c.p.id+"_"+p+'"');return o+r[0]},v=function(b){return b===void 0||b===null||b===""?"&#160;":c.p.autoencode?a.jgrid.htmlEncode(b):b+""},u=function(b,d,e,f,g){var j=
c.p.colModel[e];if(typeof j.formatter!=="undefined"){b={rowId:b,colModel:j,gid:c.p.id,pos:e};d=a.isFunction(j.formatter)?j.formatter.call(c,d,b,f,g):a.fmatter?a.fn.fmatter(j.formatter,d,b,f,g):v(d)}else d=v(d);return d},z=function(a,b,c,d,e){b=u(a,b,c,e,"add");return'<td role="gridcell" '+x(c,d,b,e,a,true)+">"+b+"</td>"},C=function(a,b,d){var e='<input role="checkbox" type="checkbox" id="jqg_'+c.p.id+"_"+a+'" class="cbox" name="jqg_'+c.p.id+"_"+a+'"/>';return'<td role="gridcell" '+x(b,d,"",null,a,
true)+">"+e+"</td>"},F=function(a,b,c,d){c=(parseInt(c,10)-1)*parseInt(d,10)+1+b;return'<td role="gridcell" class="ui-state-default jqgrid-rownum" '+x(a,b,c,null,b,true)+">"+c+"</td>"},A=function(a){var b,d=[],e=0,f;for(f=0;f<c.p.colModel.length;f++){b=c.p.colModel[f];if(b.name!=="cb"&&b.name!=="subgrid"&&b.name!=="rn"){d[e]=a=="local"?b.name:a=="xml"?b.xmlmap||b.name:b.jsonmap||b.name;e++}}return d},E=function(b){var d=c.p.remapColumns;if(!d||!d.length)d=a.map(c.p.colModel,function(a,b){return b});
b&&(d=a.map(d,function(a){return a<b?null:a-b}));return d},J=function(b,d,e){if(c.p.deepempty)a("#"+a.jgrid.jqID(c.p.id)+" tbody:first tr:gt(0)").remove();else{var f=a("#"+a.jgrid.jqID(c.p.id)+" tbody:first tr:first")[0];a("#"+a.jgrid.jqID(c.p.id)+" tbody:first").empty().append(f)}if(d&&c.p.scroll){a(">div:first",b).css({height:"auto"}).children("div:first").css({height:0,display:"none"});b.scrollTop=0}if(e===true&&c.p.treeGrid===true){c.p.data=[];c.p._index={}}},K=function(){var b=c.p.data.length,
d,e,f;d=c.p.rownumbers===true?1:0;e=c.p.multiselect===true?1:0;f=c.p.subGrid===true?1:0;d=c.p.keyIndex===false||c.p.loadonce===true?c.p.localReader.id:c.p.colModel[c.p.keyIndex+e+f+d].name;for(e=0;e<b;e++){f=a.jgrid.getAccessor(c.p.data[e],d);c.p._index[f]=e}},O=function(b,d,e,f,g){var j=new Date,k=c.p.datatype!="local"&&c.p.loadonce||c.p.datatype=="xmlstring",l=c.p.datatype=="local"?"local":"xml";if(k){c.p.data=[];c.p._index={};c.p.localReader.id="_id_"}c.p.reccount=0;if(a.isXMLDoc(b)){if(c.p.treeANode===
-1&&!c.p.scroll){J(d,false,true);e=1}else e=e>1?e:1;var m,n,o=0,q,p=0,r=0,t=0,u,v=[],x,y={},D,K,B=[],O=c.p.altRows===true?" "+c.p.altclass:"";c.p.xmlReader.repeatitems||(v=A(l));u=c.p.keyIndex===false?c.p.xmlReader.id:c.p.keyIndex;if(v.length>0&&!isNaN(u)){c.p.remapColumns&&c.p.remapColumns.length&&(u=a.inArray(u,c.p.remapColumns));u=v[u]}l=(u+"").indexOf("[")===-1?v.length?function(b,c){return a(u,b).text()||c}:function(b,d){return a(c.p.xmlReader.cell,b).eq(u).text()||d}:function(a,b){return a.getAttribute(u.replace(/[\[\]]/g,
""))||b};c.p.userData={};a(c.p.xmlReader.page,b).each(function(){c.p.page=this.textContent||this.text||0});a(c.p.xmlReader.total,b).each(function(){c.p.lastpage=this.textContent||this.text;if(c.p.lastpage===void 0)c.p.lastpage=1});a(c.p.xmlReader.records,b).each(function(){c.p.records=this.textContent||this.text||0});a(c.p.xmlReader.userdata,b).each(function(){c.p.userData[this.getAttribute("name")]=this.textContent||this.text});(b=a(c.p.xmlReader.root+" "+c.p.xmlReader.row,b))||(b=[]);var G=b.length,
I=0,H={},W;if(b&&G){W=parseInt(c.p.rowNum,10);var X=c.p.scroll?a.jgrid.randId():1;g&&(W=W*(g+1));var g=a.isFunction(c.p.afterInsertRow),V="";for(c.p.grouping&&c.p.groupingView.groupCollapse===true&&(V=' style="display:none;"');I<G;){D=b[I];K=l(D,X+I);m=e===0?0:e+1;m=(m+I)%2==1?O:"";B.push("<tr"+V+' id="'+K+'" tabindex="-1" role="row" class ="ui-widget-content jqgrow ui-row-'+c.p.direction+""+m+'">');if(c.p.rownumbers===true){B.push(F(0,I,c.p.page,c.p.rowNum));t=1}if(c.p.multiselect===true){B.push(C(K,
t,I));p=1}if(c.p.subGrid===true){B.push(a(c).jqGrid("addSubGridCell",p+t,I+e));r=1}if(c.p.xmlReader.repeatitems){x||(x=E(p+r+t));var la=a(c.p.xmlReader.cell,D);a.each(x,function(a){var b=la[this];if(!b)return false;q=b.textContent||b.text;y[c.p.colModel[a+p+r+t].name]=q;B.push(z(K,q,a+p+r+t,I+e,D))})}else for(m=0;m<v.length;m++){q=a(v[m],D).text();y[c.p.colModel[m+p+r+t].name]=q;B.push(z(K,q,m+p+r+t,I+e,D))}B.push("</tr>");if(c.p.grouping){m=c.p.groupingView.groupField.length;for(var N=[],L=0;L<m;L++)N.push(y[c.p.groupingView.groupField[L]]);
H=a(c).jqGrid("groupingPrepare",B,N,H,y);B=[]}if(k||c.p.treeGrid===true){y._id_=K;c.p.data.push(y);c.p._index[K]=c.p.data.length-1}if(c.p.gridview===false){a("tbody:first",d).append(B.join(""));g&&c.p.afterInsertRow.call(c,K,y,D);B=[]}y={};o++;I++;if(o==W)break}}if(c.p.gridview===true){n=c.p.treeANode>-1?c.p.treeANode:0;if(c.p.grouping){a(c).jqGrid("groupingRender",H,c.p.colModel.length);H=null}else c.p.treeGrid===true&&n>0?a(c.rows[n]).after(B.join("")):a("tbody:first",d).append(B.join(""))}if(c.p.subGrid===
true)try{a(c).jqGrid("addSubGrid",p+t)}catch(U){}c.p.totaltime=new Date-j;if(o>0&&c.p.records===0)c.p.records=G;B=null;if(c.p.treeGrid===true)try{a(c).jqGrid("setTreeNode",n+1,o+n+1)}catch(Y){}if(!c.p.treeGrid&&!c.p.scroll)c.grid.bDiv.scrollTop=0;c.p.reccount=o;c.p.treeANode=-1;c.p.userDataOnFooter&&a(c).jqGrid("footerData","set",c.p.userData,true);if(k){c.p.records=G;c.p.lastpage=Math.ceil(G/W)}f||c.updatepager(false,true);if(k)for(;o<G;){D=b[o];K=l(D,o);if(c.p.xmlReader.repeatitems){x||(x=E(p+r+
t));var Z=a(c.p.xmlReader.cell,D);a.each(x,function(a){var b=Z[this];if(!b)return false;q=b.textContent||b.text;y[c.p.colModel[a+p+r+t].name]=q})}else for(m=0;m<v.length;m++){q=a(v[m],D).text();y[c.p.colModel[m+p+r+t].name]=q}y._id_=K;c.p.data.push(y);c.p._index[K]=c.p.data.length-1;y={};o++}}},y=function(b,d,e,f,g){var j=new Date;if(b){if(c.p.treeANode===-1&&!c.p.scroll){J(d,false,true);e=1}else e=e>1?e:1;var k,l=c.p.datatype!="local"&&c.p.loadonce||c.p.datatype=="jsonstring";if(l){c.p.data=[];c.p._index=
{};c.p.localReader.id="_id_"}c.p.reccount=0;if(c.p.datatype=="local"){d=c.p.localReader;k="local"}else{d=c.p.jsonReader;k="json"}var m=0,n,o,q=[],p,r=0,t=0,u=0,v,x,y={},D,B,K=[],G=c.p.altRows===true?" "+c.p.altclass:"";c.p.page=a.jgrid.getAccessor(b,d.page)||0;v=a.jgrid.getAccessor(b,d.total);c.p.lastpage=v===void 0?1:v;c.p.records=a.jgrid.getAccessor(b,d.records)||0;c.p.userData=a.jgrid.getAccessor(b,d.userdata)||{};d.repeatitems||(p=q=A(k));k=c.p.keyIndex===false?d.id:c.p.keyIndex;if(q.length>0&&
!isNaN(k)){c.p.remapColumns&&c.p.remapColumns.length&&(k=a.inArray(k,c.p.remapColumns));k=q[k]}(x=a.jgrid.getAccessor(b,d.root))||(x=[]);v=x.length;var b=0,O=parseInt(c.p.rowNum,10),I=c.p.scroll?a.jgrid.randId():1;g&&(O=O*(g+1));var H=a.isFunction(c.p.afterInsertRow),W={},X="";for(c.p.grouping&&c.p.groupingView.groupCollapse===true&&(X=' style="display:none;"');b<v;){g=x[b];B=a.jgrid.getAccessor(g,k);if(B===void 0){B=I+b;q.length===0&&d.cell&&(B=a.jgrid.getAccessor(g,d.cell)[k]||B)}n=e===1?0:e;n=
(n+b)%2==1?G:"";K.push("<tr"+X+' id="'+B+'" tabindex="-1" role="row" class= "ui-widget-content jqgrow ui-row-'+c.p.direction+""+n+'">');if(c.p.rownumbers===true){K.push(F(0,b,c.p.page,c.p.rowNum));u=1}if(c.p.multiselect){K.push(C(B,u,b));r=1}if(c.p.subGrid){K.push(a(c).jqGrid("addSubGridCell",r+u,b+e));t=1}if(d.repeatitems){d.cell&&(g=a.jgrid.getAccessor(g,d.cell));p||(p=E(r+t+u))}for(o=0;o<p.length;o++){n=a.jgrid.getAccessor(g,p[o]);K.push(z(B,n,o+r+t+u,b+e,g));y[c.p.colModel[o+r+t+u].name]=n}K.push("</tr>");
if(c.p.grouping){n=c.p.groupingView.groupField.length;o=[];for(var V=0;V<n;V++)o.push(y[c.p.groupingView.groupField[V]]);W=a(c).jqGrid("groupingPrepare",K,o,W,y);K=[]}if(l||c.p.treeGrid===true){y._id_=B;c.p.data.push(y);c.p._index[B]=c.p.data.length-1}if(c.p.gridview===false){a("#"+a.jgrid.jqID(c.p.id)+" tbody:first").append(K.join(""));H&&c.p.afterInsertRow.call(c,B,y,g);K=[]}y={};m++;b++;if(m==O)break}if(c.p.gridview===true){D=c.p.treeANode>-1?c.p.treeANode:0;c.p.grouping?a(c).jqGrid("groupingRender",
W,c.p.colModel.length):c.p.treeGrid===true&&D>0?a(c.rows[D]).after(K.join("")):a("#"+a.jgrid.jqID(c.p.id)+" tbody:first").append(K.join(""))}if(c.p.subGrid===true)try{a(c).jqGrid("addSubGrid",r+u)}catch(la){}c.p.totaltime=new Date-j;if(m>0&&c.p.records===0)c.p.records=v;if(c.p.treeGrid===true)try{a(c).jqGrid("setTreeNode",D+1,m+D+1)}catch(N){}if(!c.p.treeGrid&&!c.p.scroll)c.grid.bDiv.scrollTop=0;c.p.reccount=m;c.p.treeANode=-1;c.p.userDataOnFooter&&a(c).jqGrid("footerData","set",c.p.userData,true);
if(l){c.p.records=v;c.p.lastpage=Math.ceil(v/O)}f||c.updatepager(false,true);if(l)for(;m<v&&x[m];){g=x[m];B=a.jgrid.getAccessor(g,k);if(B===void 0){B=I+m;q.length===0&&d.cell&&(B=a.jgrid.getAccessor(g,d.cell)[k]||B)}if(g){if(d.repeatitems){d.cell&&(g=a.jgrid.getAccessor(g,d.cell));p||(p=E(r+t+u))}for(o=0;o<p.length;o++){n=a.jgrid.getAccessor(g,p[o]);y[c.p.colModel[o+r+t+u].name]=n}y._id_=B;c.p.data.push(y);c.p._index[B]=c.p.data.length-1;y={}}m++}}},Y=function(){function b(c){var d=0,e,g,j;if(c.groups!==
void 0)for(e=0;e<c.groups.length;e++){try{b(c.groups[e])}catch(k){alert(k)}d++}if(c.rules!==void 0){if(d>0){var l=q.select();q=a.jgrid.from(l)}try{for(e=0;e<c.rules.length;e++){j=c.rules[e];g=c.groupOp.toString().toUpperCase();if(o[j.op]&&j.field){d>0&&(g&&g==="OR")&&(q=q.or());q=o[j.op](q,g)(j.field,j.data,f[j.field])}d++}}catch(m){alert(m)}}}var d,e=false,f={},g=[],j=[],k,l,m;if(a.isArray(c.p.data)){var n=c.p.grouping?c.p.groupingView:false;a.each(c.p.colModel,function(){l=this.sorttype||"text";
if(l=="date"||l=="datetime"){if(this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"){k=this.formatoptions&&this.formatoptions.srcformat?this.formatoptions.srcformat:a.jgrid.formatter.date.srcformat;m=this.formatoptions&&this.formatoptions.newformat?this.formatoptions.newformat:a.jgrid.formatter.date.newformat}else k=m=this.datefmt||"Y-m-d";f[this.name]={stype:l,srcfmt:k,newfmt:m}}else f[this.name]={stype:l,srcfmt:"",newfmt:""};if(c.p.grouping&&this.name==n.groupField[0]){var b=
this.name;if(typeof this.index!="undefined")b=this.index;g[0]=f[b];j.push(b)}if(!e&&(this.index==c.p.sortname||this.name==c.p.sortname)){d=this.name;e=true}});if(c.p.treeGrid)a(c).jqGrid("SortTree",d,c.p.sortorder,f[d].stype,f[d].srcfmt);else{var o={eq:function(a){return a.equals},ne:function(a){return a.notEquals},lt:function(a){return a.less},le:function(a){return a.lessOrEquals},gt:function(a){return a.greater},ge:function(a){return a.greaterOrEquals},cn:function(a){return a.contains},nc:function(a,
b){return b==="OR"?a.orNot().contains:a.andNot().contains},bw:function(a){return a.startsWith},bn:function(a,b){return b==="OR"?a.orNot().startsWith:a.andNot().startsWith},en:function(a,b){return b==="OR"?a.orNot().endsWith:a.andNot().endsWith},ew:function(a){return a.endsWith},ni:function(a,b){return b==="OR"?a.orNot().equals:a.andNot().equals},"in":function(a){return a.equals},nu:function(a){return a.isNull},nn:function(a,b){return b==="OR"?a.orNot().isNull:a.andNot().isNull}},q=a.jgrid.from(c.p.data);
c.p.ignoreCase&&(q=q.ignoreCase());if(c.p.search===true){var p=c.p.postData.filters;if(p){typeof p=="string"&&(p=a.jgrid.parse(p));b(p)}else try{q=o[c.p.postData.searchOper](q)(c.p.postData.searchField,c.p.postData.searchString,f[c.p.postData.searchField])}catch(r){}}if(c.p.grouping){q.orderBy(j,n.groupOrder[0],g[0].stype,g[0].srcfmt);n.groupDataSorted=true}d&&(c.p.sortorder&&e)&&(c.p.sortorder.toUpperCase()=="DESC"?q.orderBy(c.p.sortname,"d",f[d].stype,f[d].srcfmt):q.orderBy(c.p.sortname,"a",f[d].stype,
f[d].srcfmt));var p=q.select(),t=parseInt(c.p.rowNum,10),u=p.length,v=parseInt(c.p.page,10),x=Math.ceil(u/t),C={},p=p.slice((v-1)*t,v*t),f=q=null;C[c.p.localReader.total]=x;C[c.p.localReader.page]=v;C[c.p.localReader.records]=u;C[c.p.localReader.root]=p;p=null;return C}}},D=function(){c.grid.hDiv.loading=true;if(!c.p.hiddengrid)switch(c.p.loadui){case "enable":a("#load_"+a.jgrid.jqID(c.p.id)).show();break;case "block":a("#lui_"+a.jgrid.jqID(c.p.id)).show();a("#load_"+a.jgrid.jqID(c.p.id)).show()}},
G=function(){c.grid.hDiv.loading=false;switch(c.p.loadui){case "enable":a("#load_"+a.jgrid.jqID(c.p.id)).hide();break;case "block":a("#lui_"+a.jgrid.jqID(c.p.id)).hide();a("#load_"+a.jgrid.jqID(c.p.id)).hide()}},N=function(b){if(!c.grid.hDiv.loading){var d=c.p.scroll&&b===false,e={},f,g=c.p.prmNames;if(c.p.page<=0)c.p.page=1;if(g.search!==null)e[g.search]=c.p.search;g.nd!==null&&(e[g.nd]=(new Date).getTime());if(g.rows!==null)e[g.rows]=c.p.rowNum;if(g.page!==null)e[g.page]=c.p.page;if(g.sort!==null)e[g.sort]=
c.p.sortname;if(g.order!==null)e[g.order]=c.p.sortorder;if(c.p.rowTotal!==null&&g.totalrows!==null)e[g.totalrows]=c.p.rowTotal;var j=c.p.loadComplete,k=a.isFunction(j);k||(j=null);var l=0,b=b||1;if(b>1)if(g.npage!==null){e[g.npage]=b;l=b-1;b=1}else j=function(a){c.p.page++;c.grid.hDiv.loading=false;k&&c.p.loadComplete.call(c,a);N(b-1)};else g.npage!==null&&delete c.p.postData[g.npage];if(c.p.grouping){a(c).jqGrid("groupingSetup");c.p.groupingView.groupDataSorted===true&&(e[g.sort]=c.p.groupingView.groupField[0]+
" "+c.p.groupingView.groupOrder[0]+", "+e[g.sort])}a.extend(c.p.postData,e);var m=!c.p.scroll?1:c.rows.length-1;if(a.isFunction(c.p.datatype))c.p.datatype.call(c,c.p.postData,"load_"+c.p.id);else{a.isFunction(c.p.beforeRequest)&&c.p.beforeRequest.call(c);f=c.p.datatype.toLowerCase();switch(f){case "json":case "jsonp":case "xml":case "script":a.ajax(a.extend({url:c.p.url,type:c.p.mtype,dataType:f,data:a.isFunction(c.p.serializeGridData)?c.p.serializeGridData.call(c,c.p.postData):c.p.postData,success:function(a){f===
"xml"?O(a,c.grid.bDiv,m,b>1,l):y(a,c.grid.bDiv,m,b>1,l);j&&j.call(c,a);d&&c.grid.populateVisible();if(c.p.loadonce||c.p.treeGrid)c.p.datatype="local";G()},error:function(b,d,e){a.isFunction(c.p.loadError)&&c.p.loadError.call(c,b,d,e);G()},beforeSend:function(b){D();a.isFunction(c.p.loadBeforeSend)&&c.p.loadBeforeSend.call(c,b)}},a.jgrid.ajaxOptions,c.p.ajaxGridOptions));break;case "xmlstring":D();e=a.jgrid.stringToDoc(c.p.datastr);O(e,c.grid.bDiv);k&&c.p.loadComplete.call(c,e);c.p.datatype="local";
c.p.datastr=null;G();break;case "jsonstring":D();e=typeof c.p.datastr=="string"?a.jgrid.parse(c.p.datastr):c.p.datastr;y(e,c.grid.bDiv);k&&c.p.loadComplete.call(c,e);c.p.datatype="local";c.p.datastr=null;G();break;case "local":case "clientside":D();c.p.datatype="local";e=Y();y(e,c.grid.bDiv,m,b>1,l);j&&j.call(c,e);d&&c.grid.populateVisible();G()}}}};n=function(b,d){var e="",f="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",g="",j,l,m,
n,o=function(b){var d;a.isFunction(c.p.onPaging)&&(d=c.p.onPaging.call(c,b));c.p.selrow=null;if(c.p.multiselect){c.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false)}c.p.savedRow=[];return d=="stop"?false:true},b=b.substr(1);j="pg_"+b;l=b+"_left";m=b+"_center";n=b+"_right";a("#"+a.jgrid.jqID(b)).append("<div id='"+j+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;' role='row'><tbody><tr><td id='"+
l+"' align='left'></td><td id='"+m+"' align='center' style='white-space:pre;'></td><td id='"+n+"' align='right'></td></tr></tbody></table></div>").attr("dir","ltr");if(c.p.rowList.length>0){g="<td dir='"+k+"'>";g=g+"<select class='ui-pg-selbox' role='listbox'>";for(l=0;l<c.p.rowList.length;l++)g=g+('<option role="option" value="'+c.p.rowList[l]+'"'+(c.p.rowNum==c.p.rowList[l]?' selected="selected"':"")+">"+c.p.rowList[l]+"</option>");g=g+"</select></td>"}k=="rtl"&&(f=f+g);c.p.pginput===true&&(e="<td dir='"+
k+"'>"+a.jgrid.format(c.p.pgtext||"","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1'></span>")+"</td>");if(c.p.pgbuttons===true){l=["first"+d,"prev"+d,"next"+d,"last"+d];k=="rtl"&&l.reverse();f=f+("<td id='"+l[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>");f=f+("<td id='"+l[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>");f=f+(e!==""?"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>"+
e+"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>":"")+("<td id='"+l[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>");f=f+("<td id='"+l[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>")}else e!==""&&(f=f+e);k=="ltr"&&(f=f+g);f=f+"</tr></tbody></table>";c.p.viewrecords===true&&a("td#"+b+"_"+c.p.recordpos,"#"+j).append("<div dir='"+k+"' style='text-align:"+
c.p.recordpos+"' class='ui-paging-info'></div>");a("td#"+b+"_"+c.p.pagerpos,"#"+j).append(f);g=a(".ui-jqgrid").css("font-size")||"11px";a(document.body).append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+g+";visibility:hidden;' ></div>");f=a(f).clone().appendTo("#testpg").width();a("#testpg").remove();if(f>0){e!==""&&(f=f+50);a("td#"+b+"_"+c.p.pagerpos,"#"+j).width(f)}c.p._nvtd=[];c.p._nvtd[0]=f?Math.floor((c.p.width-f)/2):Math.floor(c.p.width/3);c.p._nvtd[1]=
0;f=null;a(".ui-pg-selbox","#"+j).bind("change",function(){c.p.page=Math.round(c.p.rowNum*(c.p.page-1)/this.value-0.5)+1;c.p.rowNum=this.value;d?a(".ui-pg-selbox",c.p.pager).val(this.value):c.p.toppager&&a(".ui-pg-selbox",c.p.toppager).val(this.value);if(!o("records"))return false;N();return false});if(c.p.pgbuttons===true){a(".ui-pg-button","#"+j).hover(function(){if(a(this).hasClass("ui-state-disabled"))this.style.cursor="default";else{a(this).addClass("ui-state-hover");this.style.cursor="pointer"}},
function(){if(!a(this).hasClass("ui-state-disabled")){a(this).removeClass("ui-state-hover");this.style.cursor="default"}});a("#first"+d+", #prev"+d+", #next"+d+", #last"+d,"#"+b).click(function(){var a=t(c.p.page,1),b=t(c.p.lastpage,1),e=false,f=true,g=true,j=true,k=true;if(b===0||b===1)k=j=g=f=false;else if(b>1&&a>=1)a===1?g=f=false:a>1&&a<b||a===b&&(k=j=false);else if(b>1&&a===0){k=j=false;a=b-1}if(this.id==="first"+d&&f){c.p.page=1;e=true}if(this.id==="prev"+d&&g){c.p.page=a-1;e=true}if(this.id===
"next"+d&&j){c.p.page=a+1;e=true}if(this.id==="last"+d&&k){c.p.page=b;e=true}if(e){if(!o(this.id))return false;N()}return false})}c.p.pginput===true&&a("input.ui-pg-input","#"+j).keypress(function(b){if((b.charCode?b.charCode:b.keyCode?b.keyCode:0)==13){c.p.page=a(this).val()>0?a(this).val():c.p.page;if(!o("user"))return false;N();return false}return this})};var B=function(b,d,e,f){if(c.p.colModel[d].sortable&&!(c.p.savedRow.length>0)){if(!e){if(c.p.lastsort==d)if(c.p.sortorder=="asc")c.p.sortorder=
"desc";else{if(c.p.sortorder=="desc")c.p.sortorder="asc"}else c.p.sortorder=c.p.colModel[d].firstsortorder||"asc";c.p.page=1}if(f){if(c.p.lastsort==d&&c.p.sortorder==f&&!e)return;c.p.sortorder=f}e=a("thead:first",c.grid.hDiv).get(0);a("tr th:eq("+c.p.lastsort+") span.ui-grid-ico-sort",e).addClass("ui-state-disabled");a("tr th:eq("+c.p.lastsort+")",e).attr("aria-selected","false");a("tr th:eq("+d+") span.ui-icon-"+c.p.sortorder,e).removeClass("ui-state-disabled");a("tr th:eq("+d+")",e).attr("aria-selected",
"true");if(!c.p.viewsortcols[0]&&c.p.lastsort!=d){a("tr th:eq("+c.p.lastsort+") span.s-ico",e).hide();a("tr th:eq("+d+") span.s-ico",e).show()}b=b.substring(5);c.p.sortname=c.p.colModel[d].index||b;e=c.p.sortorder;if(a.isFunction(c.p.onSortCol)&&c.p.onSortCol.call(c,b,d,e)=="stop")c.p.lastsort=d;else{if(c.p.datatype=="local")c.p.deselectAfterSort&&a(c).jqGrid("resetSelection");else{c.p.selrow=null;c.p.multiselect&&a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false);c.p.selarrrow=[];c.p.savedRow=
[]}if(c.p.scroll){e=c.grid.bDiv.scrollLeft;J(c.grid.bDiv,true,false);c.grid.hDiv.scrollLeft=e}c.p.subGrid&&c.p.datatype=="local"&&a("td.sgexpanded","#"+a.jgrid.jqID(c.p.id)).each(function(){a(this).trigger("click")});N();c.p.lastsort=d;if(c.p.sortname!=b&&d)c.p.lastsort=d}}},H=function(b){var d,e={},f=p?0:c.p.cellLayout;for(d=e[0]=e[1]=e[2]=0;d<=b;d++)c.p.colModel[d].hidden===false&&(e[0]=e[0]+(c.p.colModel[d].width+f));c.p.direction=="rtl"&&(e[0]=c.p.width-e[0]);e[0]=e[0]-c.grid.bDiv.scrollLeft;
a(c.grid.cDiv).is(":visible")&&(e[1]=e[1]+(a(c.grid.cDiv).height()+parseInt(a(c.grid.cDiv).css("padding-top"),10)+parseInt(a(c.grid.cDiv).css("padding-bottom"),10)));if(c.p.toolbar[0]===true&&(c.p.toolbar[1]=="top"||c.p.toolbar[1]=="both"))e[1]=e[1]+(a(c.grid.uDiv).height()+parseInt(a(c.grid.uDiv).css("border-top-width"),10)+parseInt(a(c.grid.uDiv).css("border-bottom-width"),10));c.p.toppager&&(e[1]=e[1]+(a(c.grid.topDiv).height()+parseInt(a(c.grid.topDiv).css("border-bottom-width"),10)));e[2]=e[2]+
(a(c.grid.bDiv).height()+a(c.grid.hDiv).height());return e};this.p.id=this.id;-1==a.inArray(c.p.multikey,["shiftKey","altKey","ctrlKey"])&&(c.p.multikey=!1);c.p.keyIndex=!1;for(g=0;g<c.p.colModel.length;g++)c.p.colModel[g]=a.extend(!0,{},c.p.cmTemplate,c.p.colModel[g].template||{},c.p.colModel[g]),!1===c.p.keyIndex&&!0===c.p.colModel[g].key&&(c.p.keyIndex=g);c.p.sortorder=c.p.sortorder.toLowerCase();!0===c.p.grouping&&(c.p.scroll=!1,c.p.rownumbers=!1,c.p.subGrid=!1,c.p.treeGrid=!1,c.p.gridview=!0);
if(!0===this.p.treeGrid){try{a(this).jqGrid("setTreeGrid")}catch(R){}"local"!=c.p.datatype&&(c.p.localReader={id:"_id_"})}if(this.p.subGrid)try{a(c).jqGrid("setSubGrid")}catch(L){}this.p.multiselect&&(this.p.colNames.unshift("<input role='checkbox' id='cb_"+this.p.id+"' class='cbox' type='checkbox'/>"),this.p.colModel.unshift({name:"cb",width:p?c.p.multiselectWidth+c.p.cellLayout:c.p.multiselectWidth,sortable:!1,resizable:!1,hidedlg:!0,search:!1,align:"center",fixed:!0}));this.p.rownumbers&&(this.p.colNames.unshift(""),
this.p.colModel.unshift({name:"rn",width:c.p.rownumWidth,sortable:!1,resizable:!1,hidedlg:!0,search:!1,align:"center",fixed:!0}));c.p.xmlReader=a.extend(!0,{root:"rows",row:"row",page:"rows>page",total:"rows>total",records:"rows>records",repeatitems:!0,cell:"cell",id:"[id]",userdata:"userdata",subgrid:{root:"rows",row:"row",repeatitems:!0,cell:"cell"}},c.p.xmlReader);c.p.jsonReader=a.extend(!0,{root:"rows",page:"page",total:"total",records:"records",repeatitems:!0,cell:"cell",id:"id",userdata:"userdata",
subgrid:{root:"rows",repeatitems:!0,cell:"cell"}},c.p.jsonReader);c.p.localReader=a.extend(!0,{root:"rows",page:"page",total:"total",records:"records",repeatitems:!1,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:!0,cell:"cell"}},c.p.localReader);c.p.scroll&&(c.p.pgbuttons=!1,c.p.pginput=!1,c.p.rowList=[]);c.p.data.length&&K();var S="<thead><tr class='ui-jqgrid-labels' role='rowheader'>",P,W,la,ka,X,U,V,ga;W=ga="";if(!0===c.p.shrinkToFit&&!0===c.p.forceFit)for(g=c.p.colModel.length-
1;0<=g;g--)if(!c.p.colModel[g].hidden){c.p.colModel[g].resizable=!1;break}"horizontal"==c.p.viewsortcols[1]&&(ga=" ui-i-asc",W=" ui-i-desc");P=o?"class='ui-th-div-ie'":"";ga="<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+ga+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+k+"'></span>"+("<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+W+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+k+"'></span></span>");for(g=0;g<this.p.colNames.length;g++)W=
c.p.headertitles?' title="'+a.jgrid.stripHtml(c.p.colNames[g])+'"':"",S+="<th id='"+c.p.id+"_"+c.p.colModel[g].name+"' role='columnheader' class='ui-state-default ui-th-column ui-th-"+k+"'"+W+">",W=c.p.colModel[g].index||c.p.colModel[g].name,S+="<div id='jqgh_"+c.p.colModel[g].name+"' "+P+">"+c.p.colNames[g],c.p.colModel[g].width=c.p.colModel[g].width?parseInt(c.p.colModel[g].width,10):150,"boolean"!==typeof c.p.colModel[g].title&&(c.p.colModel[g].title=!0),W==c.p.sortname&&(c.p.lastsort=g),S+=ga+
"</div></th>";ga=null;a(this).append(S+"</tr></thead>");a("thead tr:first th",this).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});if(this.p.multiselect){var Z=[],ea;a("#cb_"+a.jgrid.jqID(c.p.id),this).bind("click",function(){c.p.selarrrow=[];if(this.checked){a(c.rows).each(function(b){if(b>0&&!a(this).hasClass("subgrid")&&!a(this).hasClass("jqgroup")&&!a(this).hasClass("ui-state-disabled")){a("#jqg_"+a.jgrid.jqID(c.p.id)+"_"+a.jgrid.jqID(this.id)).attr("checked",
"checked");a(this).addClass("ui-state-highlight").attr("aria-selected","true");c.p.selarrrow.push(this.id);c.p.selrow=this.id}});ea=true;Z=[]}else{a(c.rows).each(function(b){if(b>0&&!a(this).hasClass("subgrid")&&!a(this).hasClass("ui-state-disabled")){a("#jqg_"+a.jgrid.jqID(c.p.id)+"_"+a.jgrid.jqID(this.id)).removeAttr("checked");a(this).removeClass("ui-state-highlight").attr("aria-selected","false");Z.push(this.id)}});c.p.selrow=null;ea=false}a.isFunction(c.p.onSelectAll)&&c.p.onSelectAll.call(c,
ea?c.p.selarrrow:Z,ea)})}!0===c.p.autowidth&&(S=a(r).innerWidth(),c.p.width=0<S?S:"nw");(function(){var b=0,e=p?0:c.p.cellLayout,f=0,g,j=c.p.scrollOffset,k,m=false,o,n=0,q=0,r;a.each(c.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;this.widthOrg=k=t(this.width,0);if(this.hidden===false){b=b+(k+e);this.fixed?n=n+(k+e):f++;q++}});isNaN(c.p.width)?c.p.width=d.width=b:d.width=c.p.width;c.p.tblwidth=b;if(c.p.shrinkToFit===false&&c.p.forceFit===true)c.p.forceFit=false;if(c.p.shrinkToFit===
true&&f>0){o=d.width-e*f-n;if(!isNaN(c.p.height)){o=o-j;m=true}b=0;a.each(c.p.colModel,function(a){if(this.hidden===false&&!this.fixed){this.width=k=Math.round(o*this.width/(c.p.tblwidth-e*f-n));b=b+k;g=a}});r=0;m?d.width-n-(b+e*f)!==j&&(r=d.width-n-(b+e*f)-j):!m&&Math.abs(d.width-n-(b+e*f))!==1&&(r=d.width-n-(b+e*f));c.p.colModel[g].width=c.p.colModel[g].width+r;c.p.tblwidth=b+r+e*f+n;if(c.p.tblwidth>c.p.width){c.p.colModel[g].width=c.p.colModel[g].width-(c.p.tblwidth-parseInt(c.p.width,10));c.p.tblwidth=
c.p.width}}})();a(r).css("width",d.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+c.p.id+"'>&#160;</div>");a(m).css("width",d.width+"px");var S=a("thead:first",c).get(0),I="";c.p.footerrow&&(I+="<table role='grid' style='width:"+c.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+k+"'>");var m=a("tr:first",S),Ka="<tr class='jqgfirstrow' role='row' style='height:auto'>";c.p.disableClick=
!1;a("th",m).each(function(b){la=c.p.colModel[b].width;if(typeof c.p.colModel[b].resizable==="undefined")c.p.colModel[b].resizable=true;if(c.p.colModel[b].resizable){ka=document.createElement("span");a(ka).html("&#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+k);a.browser.opera||a(ka).css("cursor","col-resize");a(this).addClass(c.p.resizeclass)}else ka="";a(this).css("width",la+"px").prepend(ka);var e="";if(c.p.colModel[b].hidden){a(this).css("display","none");e="display:none;"}Ka=Ka+("<td role='gridcell' style='height:0px;width:"+
la+"px;"+e+"'></td>");d.headers[b]={width:la,el:this};X=c.p.colModel[b].sortable;if(typeof X!=="boolean")X=c.p.colModel[b].sortable=true;e=c.p.colModel[b].name;e=="cb"||e=="subgrid"||e=="rn"||c.p.viewsortcols[2]&&a("div",this).addClass("ui-jqgrid-sortable");if(X)if(c.p.viewsortcols[0]){a("div span.s-ico",this).show();b==c.p.lastsort&&a("div span.ui-icon-"+c.p.sortorder,this).removeClass("ui-state-disabled")}else if(b==c.p.lastsort){a("div span.s-ico",this).show();a("div span.ui-icon-"+c.p.sortorder,
this).removeClass("ui-state-disabled")}c.p.footerrow&&(I=I+("<td role='gridcell' "+x(b,0,"",null,"",false)+">&#160;</td>"))}).mousedown(function(b){if(a(b.target).closest("th>span.ui-jqgrid-resize").length==1){var e=a.jgrid.getCellIndex(this);if(c.p.forceFit===true){var f=c.p,g=e,j;for(j=e+1;j<c.p.colModel.length;j++)if(c.p.colModel[j].hidden!==true){g=j;break}f.nv=g-e}d.dragStart(e,b,H(e));return false}}).click(function(b){if(c.p.disableClick)return c.p.disableClick=false;var d="th>div.ui-jqgrid-sortable",
e,f;c.p.viewsortcols[2]||(d="th>div>span>span.ui-grid-ico-sort");b=a(b.target).closest(d);if(b.length==1){d=a.jgrid.getCellIndex(this);if(!c.p.viewsortcols[2]){e=true;f=b.attr("sort")}B(a("div",this)[0].id,d,e,f);return false}});if(c.p.sortable&&a.fn.sortable)try{a(c).jqGrid("sortableColumns",m)}catch(Da){}c.p.footerrow&&(I+="</tr></tbody></table>");Ka+="</tr>";this.appendChild(document.createElement("tbody"));a(this).addClass("ui-jqgrid-btable").append(Ka);var Ka=null,m=a("<table class='ui-jqgrid-htable' style='width:"+
c.p.tblwidth+"px' role='grid' aria-labelledby='gbox_"+this.id+"' cellspacing='0' cellpadding='0' border='0'></table>").append(S),da=c.p.caption&&!0===c.p.hiddengrid?!0:!1;g=a("<div class='ui-jqgrid-hbox"+("rtl"==k?"-rtl":"")+"'></div>");S=null;d.hDiv=document.createElement("div");a(d.hDiv).css({width:d.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(g);a(g).append(m);m=null;da&&a(d.hDiv).hide();c.p.pager&&("string"==typeof c.p.pager?"#"!=c.p.pager.substr(0,1)&&(c.p.pager="#"+c.p.pager):
c.p.pager="#"+a(c.p.pager).attr("id"),a(c.p.pager).css({width:d.width+"px"}).appendTo(r).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom"),da&&a(c.p.pager).hide(),n(c.p.pager,""));!1===c.p.cellEdit&&!0===c.p.hoverrows&&a(c).bind("mouseover",function(b){V=a(b.target).closest("tr.jqgrow");a(V).attr("class")!=="subgrid"&&a(V).addClass("ui-state-hover");return false}).bind("mouseout",function(b){V=a(b.target).closest("tr.jqgrow");a(V).removeClass("ui-state-hover");return false});var va,pa;
a(c).before(d.hDiv).click(function(b){U=b.target;V=a(U,c.rows).closest("tr.jqgrow");if(a(V).length===0||V[0].className.indexOf("ui-state-disabled")>-1)return this;var d=a(U).hasClass("cbox"),e=true;a.isFunction(c.p.beforeSelectRow)&&(e=c.p.beforeSelectRow.call(c,V[0].id,b));if(!(U.tagName=="A"||(U.tagName=="INPUT"||U.tagName=="TEXTAREA"||U.tagName=="OPTION"||U.tagName=="SELECT")&&!d)&&e===true){if(c.p.cellEdit===true)if(c.p.multiselect&&d)a(c).jqGrid("setSelection",V[0].id,true);else{va=V[0].rowIndex;
pa=a.jgrid.getCellIndex(U);try{a(c).jqGrid("editCell",va,pa,true)}catch(f){}}else if(c.p.multikey)if(b[c.p.multikey])a(c).jqGrid("setSelection",V[0].id,true);else{if(c.p.multiselect&&d){d=a("[id^=jqg_"+a.jgrid.jqID(c.p.id)+"_]").attr("checked");a("[id^=jqg_"+a.jgrid.jqID(c.p.id)+"_]").attr("checked",!d)}}else{if(c.p.multiselect&&c.p.multiboxonly&&!d){a(c.p.selarrrow).each(function(b,d){var e=c.rows.namedItem(d);a(e).removeClass("ui-state-highlight");a("#jqg_"+a.jgrid.jqID(c.p.id)+"_"+a.jgrid.jqID(d)).attr("checked",
false)});c.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false)}a(c).jqGrid("setSelection",V[0].id,true)}if(a.isFunction(c.p.onCellSelect)){va=V[0].id;pa=a.jgrid.getCellIndex(U);c.p.onCellSelect.call(c,va,pa,a(U).html(),b)}b.stopPropagation()}else return this}).bind("reloadGrid",function(b,d){if(c.p.treeGrid===true)c.p.datatype=c.p.treedatatype;d&&d.current&&c.grid.selectionPreserver(c);if(c.p.datatype=="local"){a(c).jqGrid("resetSelection");c.p.data.length&&K()}else if(!c.p.treeGrid){c.p.selrow=
null;if(c.p.multiselect){c.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(c.p.id),c.grid.hDiv).attr("checked",false)}c.p.savedRow=[]}c.p.scroll&&J(c.grid.bDiv,true,false);if(d&&d.page){var e=d.page;if(e>c.p.lastpage)e=c.p.lastpage;e<1&&(e=1);c.p.page=e;c.grid.bDiv.scrollTop=c.grid.prevRowHeight?(e-1)*c.grid.prevRowHeight*c.p.rowNum:0}if(c.grid.prevRowHeight&&c.p.scroll){delete c.p.lastpage;c.grid.populateVisible()}else c.grid.populate();return false});a.isFunction(this.p.ondblClickRow)&&a(this).dblclick(function(b){U=
b.target;V=a(U,c.rows).closest("tr.jqgrow");if(a(V).length===0)return false;va=V[0].rowIndex;pa=a.jgrid.getCellIndex(U);c.p.ondblClickRow.call(c,a(V).attr("id"),va,pa,b);return false});a.isFunction(this.p.onRightClickRow)&&a(this).bind("contextmenu",function(b){U=b.target;V=a(U,c.rows).closest("tr.jqgrow");if(a(V).length===0)return false;c.p.multiselect||a(c).jqGrid("setSelection",V[0].id,true);va=V[0].rowIndex;pa=a.jgrid.getCellIndex(U);c.p.onRightClickRow.call(c,a(V).attr("id"),va,pa,b);return false});
d.bDiv=document.createElement("div");o&&"auto"===(""+c.p.height).toLowerCase()&&(c.p.height="100%");a(d.bDiv).append(a('<div style="position:relative;'+(o&&8>a.browser.version?"height:0.01%;":"")+'"></div>').append("<div></div>").append(this)).addClass("ui-jqgrid-bdiv").css({height:c.p.height+(isNaN(c.p.height)?"":"px"),width:d.width+"px"}).scroll(d.scrollGrid);a("table:first",d.bDiv).css({width:c.p.tblwidth+"px"});o?(2==a("tbody",this).size()&&a("tbody:gt(0)",this).remove(),c.p.multikey&&a(d.bDiv).bind("selectstart",
function(){return false})):c.p.multikey&&a(d.bDiv).bind("mousedown",function(){return false});da&&a(d.bDiv).hide();d.cDiv=document.createElement("div");var qa=!0===c.p.hidegrid?a("<a role='link' href='javascript:void(0)'/>").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){qa.addClass("ui-state-hover")},function(){qa.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css("rtl"==k?"left":"right","0px"):"";a(d.cDiv).append(qa).append("<span class='ui-jqgrid-title"+
("rtl"==k?"-rtl":"")+"'>"+c.p.caption+"</span>").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");a(d.cDiv).insertBefore(d.hDiv);c.p.toolbar[0]&&(d.uDiv=document.createElement("div"),"top"==c.p.toolbar[1]?a(d.uDiv).insertBefore(d.hDiv):"bottom"==c.p.toolbar[1]&&a(d.uDiv).insertAfter(d.hDiv),"both"==c.p.toolbar[1]?(d.ubDiv=document.createElement("div"),a(d.uDiv).insertBefore(d.hDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id),a(d.ubDiv).insertAfter(d.hDiv).addClass("ui-userdata ui-state-default").attr("id",
"tb_"+this.id),da&&a(d.ubDiv).hide()):a(d.uDiv).width(d.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id),da&&a(d.uDiv).hide());c.p.toppager&&(c.p.toppager=a.jgrid.jqID(c.p.id)+"_toppager",d.topDiv=a("<div id='"+c.p.toppager+"'></div>")[0],c.p.toppager="#"+c.p.toppager,a(d.topDiv).insertBefore(d.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(d.width),n(c.p.toppager,"_t"));c.p.footerrow&&(d.sDiv=a("<div class='ui-jqgrid-sdiv'></div>")[0],g=a("<div class='ui-jqgrid-hbox"+
("rtl"==k?"-rtl":"")+"'></div>"),a(d.sDiv).append(g).insertAfter(d.hDiv).width(d.width),a(g).append(I),d.footers=a(".ui-jqgrid-ftable",d.sDiv)[0].rows[0].cells,c.p.rownumbers&&(d.footers[0].className="ui-state-default jqgrid-rownum"),da&&a(d.sDiv).hide());g=null;if(c.p.caption){var ha=c.p.datatype;!0===c.p.hidegrid&&(a(".ui-jqgrid-titlebar-close",d.cDiv).click(function(b){var e=a.isFunction(c.p.onHeaderClick),f=".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",g,j=this;if(c.p.toolbar[0]===
true){c.p.toolbar[1]=="both"&&(f=f+(", #"+a(d.ubDiv).attr("id")));f=f+(", #"+a(d.uDiv).attr("id"))}g=a(f,"#gview_"+a.jgrid.jqID(c.p.id)).length;c.p.gridstate=="visible"?a(f,"#gbox_"+a.jgrid.jqID(c.p.id)).slideUp("fast",function(){g--;if(g===0){a("span",j).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");c.p.gridstate="hidden";a("#gbox_"+a.jgrid.jqID(c.p.id)).hasClass("ui-resizable")&&a(".ui-resizable-handle","#gbox_"+a.jgrid.jqID(c.p.id)).hide();e&&(da||c.p.onHeaderClick.call(c,
c.p.gridstate,b))}}):c.p.gridstate=="hidden"&&a(f,"#gbox_"+a.jgrid.jqID(c.p.id)).slideDown("fast",function(){g--;if(g===0){a("span",j).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(da){c.p.datatype=ha;N();da=false}c.p.gridstate="visible";a("#gbox_"+a.jgrid.jqID(c.p.id)).hasClass("ui-resizable")&&a(".ui-resizable-handle","#gbox_"+a.jgrid.jqID(c.p.id)).show();e&&(da||c.p.onHeaderClick.call(c,c.p.gridstate,b))}});return false}),da&&(c.p.datatype="local",a(".ui-jqgrid-titlebar-close",
d.cDiv).trigger("click")))}else a(d.cDiv).hide();a(d.hDiv).after(d.bDiv).mousemove(function(a){if(d.resizing){d.dragMove(a);return false}});a(".ui-jqgrid-labels",d.hDiv).bind("selectstart",function(){return false});a(document).mouseup(function(){if(d.resizing){d.dragEnd();return false}return true});c.formatCol=x;c.sortData=B;c.updatepager=function(b,d){var e,f,g,j,k,l,m,n="";g=parseInt(c.p.page,10)-1;g<0&&(g=0);g=g*parseInt(c.p.rowNum,10);k=g+c.p.reccount;if(c.p.scroll){e=a("tbody:first > tr:gt(0)",
c.grid.bDiv);g=k-e.length;c.p.reccount=e.length;if(f=e.outerHeight()||c.grid.prevRowHeight){e=g*f;f=f*parseInt(c.p.records,10);a(">div:first",c.grid.bDiv).css({height:f}).children("div:first").css({height:e,display:e?"":"none"})}c.grid.bDiv.scrollLeft=c.grid.hDiv.scrollLeft}n=c.p.pager?c.p.pager:"";if(n=n+(c.p.toppager?n?","+c.p.toppager:c.p.toppager:"")){m=a.jgrid.formatter.integer||{};e=t(c.p.page);f=t(c.p.lastpage);a(".selbox",n).attr("disabled",false);if(c.p.pginput===true){a(".ui-pg-input",n).val(c.p.page);
a("#sp_1",n).html(a.fmatter?a.fmatter.util.NumberFormat(c.p.lastpage,m):c.p.lastpage)}if(c.p.viewrecords)if(c.p.reccount===0)a(".ui-paging-info",n).html(c.p.emptyrecords);else{j=g+1;l=c.p.records;if(a.fmatter){j=a.fmatter.util.NumberFormat(j,m);k=a.fmatter.util.NumberFormat(k,m);l=a.fmatter.util.NumberFormat(l,m)}a(".ui-paging-info",n).html(a.jgrid.format(c.p.recordtext,j,k,l))}if(c.p.pgbuttons===true){e<=0&&(e=f=0);if(e==1||e===0){a("#first, #prev",c.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");
c.p.toppager&&a("#first_t, #prev_t",c.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#first, #prev",c.p.pager).removeClass("ui-state-disabled");c.p.toppager&&a("#first_t, #prev_t",c.p.toppager).removeClass("ui-state-disabled")}if(e==f||e===0){a("#next, #last",c.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover");c.p.toppager&&a("#next_t, #last_t",c.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")}else{a("#next, #last",c.p.pager).removeClass("ui-state-disabled");
c.p.toppager&&a("#next_t, #last_t",c.p.toppager).removeClass("ui-state-disabled")}}}b===true&&c.p.rownumbers===true&&a("td.jqgrid-rownum",c.rows).each(function(b){a(this).html(g+1+b)});d&&c.p.jqgdnd&&a(c).jqGrid("gridDnD","updateDnD");a.isFunction(c.p.gridComplete)&&c.p.gridComplete.call(c)};c.refreshIndex=K;c.formatter=function(a,b,c,d,e){return u(a,b,c,d,e)};a.extend(d,{populate:N,emptyRows:J});this.grid=d;c.addXmlData=function(a){O(a,c.grid.bDiv)};c.addJSONData=function(a){y(a,c.grid.bDiv)};this.grid.cols=
this.rows[0].cells;N();c.p.hiddengrid=!1;a(window).unload(function(){c=null})}}}})};a.jgrid.extend({getGridParam:function(a){var d=this[0];if(d&&d.grid)return a?"undefined"!=typeof d.p[a]?d.p[a]:null:d.p},setGridParam:function(e){return this.each(function(){this.grid&&"object"===typeof e&&a.extend(!0,this.p,e)})},getDataIDs:function(){var e=[],d=0,b,f=0;this.each(function(){if((b=this.rows.length)&&0<b)for(;d<b;)a(this.rows[d]).hasClass("jqgrow")&&(e[f]=this.rows[d].id,f++),d++});return e},setSelection:function(e,
d){return this.each(function(){var b,f,l;if(void 0!==e&&(d=!1===d?!1:!0,(f=this.rows.namedItem(e+""))&&!(-1<f.className.indexOf("ui-state-disabled")))){if(!0===this.p.scrollrows&&(b=this.rows.namedItem(e).rowIndex,0<=b)){l=a(this.grid.bDiv)[0].clientHeight;var g=a(this.grid.bDiv)[0].scrollTop,k=this.rows[b].offsetTop;b=this.rows[b].clientHeight;k+b>=l+g?a(this.grid.bDiv)[0].scrollTop=k-(l+g)+b+g:k<l+g&&k<g&&(a(this.grid.bDiv)[0].scrollTop=k)}this.p.multiselect?(this.p.selrow=f.id,l=a.inArray(this.p.selrow,
this.p.selarrrow),-1===l?("ui-subgrid"!==f.className&&a(f).addClass("ui-state-highlight").attr("aria-selected","true"),b=!0,a("#jqg_"+a.jgrid.jqID(this.p.id)+"_"+a.jgrid.jqID(this.p.selrow)).attr("checked",b),this.p.selarrrow.push(this.p.selrow)):("ui-subgrid"!==f.className&&a(f).removeClass("ui-state-highlight").attr("aria-selected","false"),b=!1,a("#jqg_"+a.jgrid.jqID(this.p.id)+"_"+a.jgrid.jqID(this.p.selrow)).attr("checked",b),this.p.selarrrow.splice(l,1),l=this.p.selarrrow[0],this.p.selrow=void 0===
l?null:l),this.p.onSelectRow&&d&&this.p.onSelectRow.call(this,f.id,b)):"ui-subgrid"!==f.className&&(this.p.selrow!=f.id?(a(this.rows.namedItem(this.p.selrow)).removeClass("ui-state-highlight").attr({"aria-selected":"false",tabindex:"-1"}),a(f).addClass("ui-state-highlight").attr({"aria-selected":!0,tabindex:"0"}),b=!0):b=!1,this.p.selrow=f.id,this.p.onSelectRow&&d&&this.p.onSelectRow.call(this,f.id,b))}})},resetSelection:function(e){return this.each(function(){var d=this,b,f;"undefined"!==typeof e?
(f=e===d.p.selrow?d.p.selrow:e,a("#"+a.jgrid.jqID(d.p.id)+" tbody:first tr#"+a.jgrid.jqID(f)).removeClass("ui-state-highlight").attr("aria-selected","false"),d.p.multiselect&&(a("#jqg_"+a.jgrid.jqID(d.p.id)+"_"+a.jgrid.jqID(f)).attr("checked",!1),a("#cb_"+a.jgrid.jqID(d.p.id)).attr("checked",!1)),f=null):d.p.multiselect?(a(d.p.selarrrow).each(function(e,f){b=d.rows.namedItem(f);a(b).removeClass("ui-state-highlight").attr("aria-selected","false");a("#jqg_"+a.jgrid.jqID(d.p.id)+"_"+a.jgrid.jqID(f)).attr("checked",
!1)}),a("#cb_"+a.jgrid.jqID(d.p.id)).attr("checked",!1),d.p.selarrrow=[]):d.p.selrow&&(a("#"+a.jgrid.jqID(d.p.id)+" tbody:first tr#"+a.jgrid.jqID(d.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected","false"),d.p.selrow=null);d.p.savedRow=[]})},getRowData:function(e){var d={},b,f=!1,l,g=0;this.each(function(){var k=this,c,m;if("undefined"==typeof e)f=!0,b=[],l=k.rows.length;else{m=k.rows.namedItem(e);if(!m)return d;l=2}for(;g<l;)f&&(m=k.rows[g]),a(m).hasClass("jqgrow")&&(a("td",m).each(function(b){c=
k.p.colModel[b].name;if("cb"!==c&&"subgrid"!==c&&"rn"!==c)if(!0===k.p.treeGrid&&c==k.p.ExpandColumn)d[c]=a.jgrid.htmlDecode(a("span:first",this).html());else try{d[c]=a.unformat(this,{rowId:m.id,colModel:k.p.colModel[b]},b)}catch(e){d[c]=a.jgrid.htmlDecode(a(this).html())}}),f&&(b.push(d),d={})),g++});return b?b:d},delRowData:function(e){var d=!1,b,f;this.each(function(){if(b=this.rows.namedItem(e)){if(a(b).remove(),this.p.records--,this.p.reccount--,this.updatepager(!0,!1),d=!0,this.p.multiselect&&
(f=a.inArray(e,this.p.selarrrow),-1!=f&&this.p.selarrrow.splice(f,1)),e==this.p.selrow)this.p.selrow=null}else return!1;if("local"==this.p.datatype){var l=this.p._index[e];"undefined"!=typeof l&&(this.p.data.splice(l,1),this.refreshIndex())}if(!0===this.p.altRows&&d){var g=this.p.altclass;a(this.rows).each(function(b){1==b%2?a(this).addClass(g):a(this).removeClass(g)})}});return d},setRowData:function(e,d,b){var f,l=!0,g;this.each(function(){if(!this.grid)return!1;var k=this,c,m,n=typeof b,o={};m=
k.rows.namedItem(e);if(!m)return!1;if(d)try{if(a(this.p.colModel).each(function(b){f=this.name;void 0!==d[f]&&(o[f]=this.formatter&&"string"===typeof this.formatter&&"date"==this.formatter?a.unformat.date(d[f],this):d[f],c=k.formatter(e,d[f],b,d,"edit"),g=this.title?{title:a.jgrid.stripHtml(c)}:{},!0===k.p.treeGrid&&f==k.p.ExpandColumn?a("td:eq("+b+") > span:first",m).html(c).attr(g):a("td:eq("+b+")",m).html(c).attr(g))}),"local"==k.p.datatype){var p=k.p._index[e];if(k.p.treeGrid)for(var r in k.p.treeReader)o.hasOwnProperty(k.p.treeReader[r])&&
delete o[k.p.treeReader[r]];"undefined"!=typeof p&&(k.p.data[p]=a.extend(!0,k.p.data[p],o));o=null}}catch(t){l=!1}l&&("string"===n?a(m).addClass(b):"object"===n&&a(m).css(b))});return l},addRowData:function(e,d,b,f){b||(b="last");var l=!1,g,k,c,m,n,o,p,r,t="",x,v,u,z,C;d&&(a.isArray(d)?(x=!0,b="last",v=e):(d=[d],x=!1),this.each(function(){var F=d.length;n=this.p.rownumbers===true?1:0;c=this.p.multiselect===true?1:0;m=this.p.subGrid===true?1:0;if(!x)if(typeof e!="undefined")e=e+"";else{e=a.jgrid.randId();
if(this.p.keyIndex!==false){v=this.p.colModel[this.p.keyIndex+c+m+n].name;typeof d[0][v]!="undefined"&&(e=d[0][v])}}u=this.p.altclass;for(var A=0,E="",J={},K=a.isFunction(this.p.afterInsertRow)?true:false;A<F;){z=d[A];k="";if(x){try{e=z[v]}catch(O){e=a.jgrid.randId()}E=this.p.altRows===true?(this.rows.length-1)%2===0?u:"":""}if(n){t=this.formatCol(0,1,"",null,e,true);k=k+('<td role="gridcell" aria-describedby="'+this.p.id+'_rn" class="ui-state-default jqgrid-rownum" '+t+">0</td>")}if(c){r='<input role="checkbox" type="checkbox" id="jqg_'+
this.p.id+"_"+e+'" class="cbox"/>';t=this.formatCol(n,1,"",null,e,true);k=k+('<td role="gridcell" aria-describedby="'+this.p.id+'_cb" '+t+">"+r+"</td>")}m&&(k=k+a(this).jqGrid("addSubGridCell",c+n,1));for(p=c+m+n;p<this.p.colModel.length;p++){C=this.p.colModel[p];g=C.name;J[g]=C.formatter&&typeof C.formatter==="string"&&C.formatter=="date"?a.unformat.date(z[g],C):z[g];r=this.formatter(e,a.jgrid.getAccessor(z,g),p,z,"edit");t=this.formatCol(p,1,r,e,z,true);k=k+('<td role="gridcell" aria-describedby="'+
this.p.id+"_"+g+'" '+t+">"+r+"</td>")}k='<tr id="'+e+'" role="row" tabindex="-1" class="ui-widget-content jqgrow ui-row-'+this.p.direction+" "+E+'">'+k+"</tr>";if(this.p.subGrid===true){k=a(k)[0];a(this).jqGrid("addSubGrid",k,c+n)}if(this.rows.length===0)a("table:first",this.grid.bDiv).append(k);else switch(b){case "last":a(this.rows[this.rows.length-1]).after(k);break;case "first":a(this.rows[0]).after(k);break;case "after":if(o=this.rows.namedItem(f))a(this.rows[o.rowIndex+1]).hasClass("ui-subgrid")?
a(this.rows[o.rowIndex+1]).after(k):a(o).after(k);break;case "before":if(o=this.rows.namedItem(f)){a(o).before(k);o=o.rowIndex}}this.p.records++;this.p.reccount++;K&&this.p.afterInsertRow.call(this,e,z,z);A++;if(this.p.datatype=="local"){J[this.p.localReader.id]=e;this.p._index[e]=this.p.data.length;this.p.data.push(J);J={}}}this.p.altRows===true&&!x&&(b=="last"?(this.rows.length-1)%2==1&&a(this.rows[this.rows.length-1]).addClass(u):a(this.rows).each(function(b){b%2==1?a(this).addClass(u):a(this).removeClass(u)}));
this.updatepager(true,true);l=true}));return l},footerData:function(e,d,b){function f(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}var l,g=!1,k={},c;"undefined"==typeof e&&(e="get");"boolean"!=typeof b&&(b=!0);e=e.toLowerCase();this.each(function(){var m=this,n;if(!m.grid||!m.p.footerrow||"set"==e&&f(d))return!1;g=!0;a(this.p.colModel).each(function(f){l=this.name;"set"==e?void 0!==d[l]&&(n=b?m.formatter("",d[l],f,d,"edit"):d[l],c=this.title?{title:a.jgrid.stripHtml(n)}:{},a("tr.footrow td:eq("+
f+")",m.grid.sDiv).html(n).attr(c),g=!0):"get"==e&&(k[l]=a("tr.footrow td:eq("+f+")",m.grid.sDiv).html())})});return"get"==e?k:g},showHideCol:function(e,d){return this.each(function(){var b=this,f=!1,l=a.browser.webkit||a.browser.safari?0:b.p.cellLayout,g;if(b.grid){"string"===typeof e&&(e=[e]);d="none"!=d?"":"none";var k=""===d?!0:!1;a(this.p.colModel).each(function(c){-1!==a.inArray(this.name,e)&&this.hidden===k&&(a("tr",b.grid.hDiv).each(function(){a(this).children("th:eq("+c+")").css("display",
d)}),a(b.rows).each(function(){a(this).children("td:eq("+c+")").css("display",d)}),b.p.footerrow&&a(b.grid.sDiv).children("td:eq("+c+")").css("display",d),g=this.widthOrg?this.widthOrg:parseInt(this.width,10),b.p.tblwidth="none"===d?b.p.tblwidth-(g+l):b.p.tblwidth+(g+l),this.hidden=!k,f=!0)});!0===f&&b.grid.width!==b.p.tblwidth&&a(b).jqGrid("setGridWidth",!0===b.p.shrinkToFit?b.grid.width:b.p.tblwidth,!0)}})},hideCol:function(e){return this.each(function(){a(this).jqGrid("showHideCol",e,"none")})},
showCol:function(e){return this.each(function(){a(this).jqGrid("showHideCol",e,"")})},remapColumns:function(e,d,b){function f(b){var c;c=b.length?a.makeArray(b):a.extend({},b);a.each(e,function(a){b[a]=c[this]})}function l(b,c){a(">tr"+(c||""),b).each(function(){var b=this,c=a.makeArray(b.cells);a.each(e,function(){var a=c[this];a&&b.appendChild(a)})})}var g=this.get(0);f(g.p.colModel);f(g.p.colNames);f(g.grid.headers);l(a("thead:first",g.grid.hDiv),b&&":not(.ui-jqgrid-labels)");d&&l(a("#"+a.jgrid.jqID(g.p.id)+
" tbody:first"),".jqgfirstrow, tr.jqgrow, tr.jqfoot");g.p.footerrow&&l(a("tbody:first",g.grid.sDiv));g.p.remapColumns&&(g.p.remapColumns.length?f(g.p.remapColumns):g.p.remapColumns=a.makeArray(e));g.p.lastsort=a.inArray(g.p.lastsort,e);g.p.treeGrid&&(g.p.expColInd=a.inArray(g.p.expColInd,e))},setGridWidth:function(e,d){return this.each(function(){if(this.grid){var b=this,f,l=0,g=a.browser.webkit||a.browser.safari?0:b.p.cellLayout,k,c=0,m=!1,n=b.p.scrollOffset,o,p=0,r=0,t;"boolean"!=typeof d&&(d=b.p.shrinkToFit);
if(!isNaN(e)&&(e=parseInt(e,10),b.grid.width=b.p.width=e,a("#gbox_"+a.jgrid.jqID(b.p.id)).css("width",e+"px"),a("#gview_"+a.jgrid.jqID(b.p.id)).css("width",e+"px"),a(b.grid.bDiv).css("width",e+"px"),a(b.grid.hDiv).css("width",e+"px"),b.p.pager&&a(b.p.pager).css("width",e+"px"),b.p.toppager&&a(b.p.toppager).css("width",e+"px"),!0===b.p.toolbar[0]&&(a(b.grid.uDiv).css("width",e+"px"),"both"==b.p.toolbar[1]&&a(b.grid.ubDiv).css("width",e+"px")),b.p.footerrow&&a(b.grid.sDiv).css("width",e+"px"),!1===
d&&!0===b.p.forceFit&&(b.p.forceFit=!1),!0===d))if(a.each(b.p.colModel,function(){if(this.hidden===false){f=this.widthOrg?this.widthOrg:parseInt(this.width,10);l=l+(f+g);this.fixed?p=p+(f+g):c++;r++}}),0!==c){b.p.tblwidth=l;o=e-g*c-p;if(!isNaN(b.p.height)&&(a(b.grid.bDiv)[0].clientHeight<a(b.grid.bDiv)[0].scrollHeight||1===b.rows.length))m=!0,o-=n;var l=0,x=0<b.grid.cols.length;a.each(b.p.colModel,function(a){if(this.hidden===false&&!this.fixed){f=this.widthOrg?this.widthOrg:parseInt(this.width,10);
f=Math.round(o*f/(b.p.tblwidth-g*c-p));if(!(f<0)){this.width=f;l=l+f;b.grid.headers[a].width=f;b.grid.headers[a].el.style.width=f+"px";if(b.p.footerrow)b.grid.footers[a].style.width=f+"px";if(x)b.grid.cols[a].style.width=f+"px";k=a}}});t=0;m?e-p-(l+g*c)!==n&&(t=e-p-(l+g*c)-n):1!==Math.abs(e-p-(l+g*c))&&(t=e-p-(l+g*c));b.p.colModel[k].width+=t;b.p.tblwidth=l+t+g*c+p;b.p.tblwidth>e?(m=b.p.tblwidth-parseInt(e,10),b.p.tblwidth=e,f=b.p.colModel[k].width-=m):f=b.p.colModel[k].width;b.grid.headers[k].width=
f;b.grid.headers[k].el.style.width=f+"px";x&&(b.grid.cols[k].style.width=f+"px");a("table:first",b.grid.bDiv).css("width",b.p.tblwidth+"px");a("table:first",b.grid.hDiv).css("width",b.p.tblwidth+"px");b.grid.hDiv.scrollLeft=b.grid.bDiv.scrollLeft;b.p.footerrow&&(b.grid.footers[k].style.width=f+"px",a("table:first",b.grid.sDiv).css("width",b.p.tblwidth+"px"))}}})},setGridHeight:function(e){return this.each(function(){this.grid&&(a(this.grid.bDiv).css({height:e+(isNaN(e)?"":"px")}),this.p.height=e,
this.p.scroll&&this.grid.populateVisible())})},setCaption:function(e){return this.each(function(){this.p.caption=e;a("span.ui-jqgrid-title",this.grid.cDiv).html(e);a(this.grid.cDiv).show()})},setLabel:function(e,d,b,f){return this.each(function(){var l=-1;if(this.grid&&(isNaN(e)?a(this.p.colModel).each(function(a){if(this.name==e)return l=a,!1}):l=parseInt(e,10),0<=l)){var g=a("tr.ui-jqgrid-labels th:eq("+l+")",this.grid.hDiv);if(d){var k=a(".s-ico",g);a("[id^=jqgh_]",g).empty().html(d).append(k);
this.p.colNames[l]=d}b&&("string"===typeof b?a(g).addClass(b):a(g).css(b));"object"===typeof f&&a(g).attr(f)}})},setCell:function(e,d,b,f,l,g){return this.each(function(){var k=-1,c,m;if(this.grid&&(isNaN(d)?a(this.p.colModel).each(function(a){if(this.name==d)return k=a,!1}):k=parseInt(d,10),0<=k&&(c=this.rows.namedItem(e)))){var n=a("td:eq("+k+")",c);if(""!==b||!0===g)c=this.formatter(e,b,k,c,"edit"),m=this.p.colModel[k].title?{title:a.jgrid.stripHtml(c)}:{},this.p.treeGrid&&0<a(".tree-wrap",a(n)).length?
a("span",a(n)).html(c).attr(m):a(n).html(c).attr(m),"local"==this.p.datatype&&(c=this.p.colModel[k],b=c.formatter&&"string"===typeof c.formatter&&"date"==c.formatter?a.unformat.date(b,c):b,m=this.p._index[e],"undefined"!=typeof m&&(this.p.data[m][c.name]=b));"string"===typeof f?a(n).addClass(f):f&&a(n).css(f);"object"===typeof l&&a(n).attr(l)}})},getCell:function(e,d){var b=!1;this.each(function(){var f=-1;if(this.grid&&(isNaN(d)?a(this.p.colModel).each(function(a){if(this.name===d)return f=a,!1}):
f=parseInt(d,10),0<=f)){var l=this.rows.namedItem(e);if(l)try{b=a.unformat(a("td:eq("+f+")",l),{rowId:l.id,colModel:this.p.colModel[f]},f)}catch(g){b=a.jgrid.htmlDecode(a("td:eq("+f+")",l).html())}}});return b},getCol:function(e,d,b){var f=[],l,g=0,k=0,c=0,m,d="boolean"!=typeof d?!1:d;"undefined"==typeof b&&(b=!1);this.each(function(){var n=-1;if(this.grid&&(isNaN(e)?a(this.p.colModel).each(function(a){if(this.name===e)return n=a,!1}):n=parseInt(e,10),0<=n)){var o=this.rows.length,p=0;if(o&&0<o){for(;p<
o;){if(a(this.rows[p]).hasClass("jqgrow")){try{l=a.unformat(a(this.rows[p].cells[n]),{rowId:this.rows[p].id,colModel:this.p.colModel[n]},n)}catch(r){l=a.jgrid.htmlDecode(this.rows[p].cells[n].innerHTML)}b?(m=parseFloat(l),g+=m,k=Math.min(k,m),c=Math.max(k,m)):d?f.push({id:this.rows[p].id,value:l}):f.push(l)}p++}if(b)switch(b.toLowerCase()){case "sum":f=g;break;case "avg":f=g/o;break;case "count":f=o;break;case "min":f=k;break;case "max":f=c}}}});return f},clearGridData:function(e){return this.each(function(){if(this.grid){"boolean"!=
typeof e&&(e=!1);if(this.p.deepempty)a("#"+a.jgrid.jqID(this.p.id)+" tbody:first tr:gt(0)").remove();else{var d=a("#"+a.jgrid.jqID(this.p.id)+" tbody:first tr:first")[0];a("#"+a.jgrid.jqID(this.p.id)+" tbody:first").empty().append(d)}this.p.footerrow&&e&&a(".ui-jqgrid-ftable td",this.grid.sDiv).html("&#160;");this.p.selrow=null;this.p.selarrrow=[];this.p.savedRow=[];this.p.records=0;this.p.page=1;this.p.lastpage=0;this.p.reccount=0;this.p.data=[];this.p_index={};this.updatepager(!0,!1)}})},getInd:function(a,
d){var b=!1,e;this.each(function(){if(e=this.rows.namedItem(a))b=!0===d?e:e.rowIndex});return b},bindKeys:function(e){var d=a.extend({onEnter:null,onSpace:null,onLeftKey:null,onRightKey:null,scrollingRows:!0},e||{});return this.each(function(){var b=this;a("body").is("[role]")||a("body").attr("role","application");b.p.scrollrows=d.scrollingRows;a(b).keydown(function(e){var j=a(b).find("tr[tabindex=0]")[0],g,k,c,m=b.p.treeReader.expanded_field;if(j){c=b.p._index[j.id];if(37===e.keyCode||38===e.keyCode||
39===e.keyCode||40===e.keyCode){if(38===e.keyCode){k=j.previousSibling;g="";if(k)if(a(k).is(":hidden"))for(;k;){if(k=k.previousSibling,!a(k).is(":hidden")&&a(k).hasClass("jqgrow")){g=k.id;break}}else g=k.id;a(b).jqGrid("setSelection",g)}if(40===e.keyCode){k=j.nextSibling;g="";if(k)if(a(k).is(":hidden"))for(;k;){if(k=k.nextSibling,!a(k).is(":hidden")&&a(k).hasClass("jqgrow")){g=k.id;break}}else g=k.id;a(b).jqGrid("setSelection",g)}37===e.keyCode&&(b.p.treeGrid&&b.p.data[c][m]&&a(j).find("div.treeclick").trigger("click"),
a.isFunction(d.onLeftKey)&&d.onLeftKey.call(b,b.p.selrow));39===e.keyCode&&(b.p.treeGrid&&!b.p.data[c][m]&&a(j).find("div.treeclick").trigger("click"),a.isFunction(d.onRightKey)&&d.onRightKey.call(b,b.p.selrow));return!1}if(13===e.keyCode)return a.isFunction(d.onEnter)&&d.onEnter.call(b,b.p.selrow),!1;if(32===e.keyCode)return a.isFunction(d.onSpace)&&d.onSpace.call(b,b.p.selrow),!1}})})},unbindKeys:function(){return this.each(function(){a(this).unbind("keydown")})},getLocalRow:function(a){var d=!1,
b;this.each(function(){"undefined"!==typeof a&&(b=this.p._index[a],0<=b&&(d=this.p.data[b]))});return d}})})(m);(function(a){a.fmatter={};a.extend(a.fmatter,{isBoolean:function(a){return"boolean"===typeof a},isObject:function(e){return e&&("object"===typeof e||a.isFunction(e))||!1},isString:function(a){return"string"===typeof a},isNumber:function(a){return"number"===typeof a&&isFinite(a)},isNull:function(a){return null===a},isUndefined:function(a){return"undefined"===typeof a},isValue:function(a){return this.isObject(a)||
this.isString(a)||this.isNumber(a)||this.isBoolean(a)},isEmpty:function(e){if(!this.isString(e)&&this.isValue(e))return!1;if(!this.isValue(e))return!0;e=a.trim(e).replace(/\&nbsp\;/ig,"").replace(/\&#160\;/ig,"");return""===e}});a.fn.fmatter=function(e,d,b,f,l){var g=d,b=a.extend({},a.jgrid.formatter,b);a.fn.fmatter[e]&&(g=a.fn.fmatter[e](d,b,f,l));return g};a.fmatter.util={NumberFormat:function(e,d){a.fmatter.isNumber(e)||(e*=1);if(a.fmatter.isNumber(e)){var b=0>e,f=e+"",l=d.decimalSeparator?d.decimalSeparator:
".",g;if(a.fmatter.isNumber(d.decimalPlaces)){var k=d.decimalPlaces,f=Math.pow(10,k),f=Math.round(e*f)/f+"";g=f.lastIndexOf(".");if(0<k){0>g?(f+=l,g=f.length-1):"."!==l&&(f=f.replace(".",l));for(;f.length-1-g<k;)f+="0"}}if(d.thousandsSeparator){k=d.thousandsSeparator;g=f.lastIndexOf(l);g=-1<g?g:f.length;for(var l=f.substring(g),c=-1,m=g;0<m;m--){c++;if(0===c%3&&m!==g&&(!b||1<m))l=k+l;l=f.charAt(m-1)+l}f=l}f=d.prefix?d.prefix+f:f;return d.suffix?f+d.suffix:f}return e},DateFormat:function(e,d,b,f){var l=
/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/,g="string"===typeof d?d.match(l):null,l=function(a,b){a=""+a;for(b=parseInt(b,10)||2;a.length<b;)a="0"+a;return a},k={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},c=0,m,n=["i18n"];n.i18n={dayNames:f.dayNames,monthNames:f.monthNames};e in f.masks&&(e=f.masks[e]);if(d.constructor===Number)"u"==(""+e).toLowerCase()&&(d*=1E3),c=new Date(d);else if(d.constructor===Date)c=d;else if(null!==g)c=new Date(parseInt(g[1],10)),g[3]&&(e=60*Number(g[5])+Number(g[6]),
e*="-"==g[4]?1:-1,e-=c.getTimezoneOffset(),c.setTime(Number(Number(c)+6E4*e)));else{d=(""+d).split(/[\\\/:_;.,\t\T\s-]/);e=e.split(/[\\\/:_;.,\t\T\s-]/);g=0;for(m=e.length;g<m;g++)"M"==e[g]&&(c=a.inArray(d[g],n.i18n.monthNames),-1!==c&&12>c&&(d[g]=c+1)),"F"==e[g]&&(c=a.inArray(d[g],n.i18n.monthNames),-1!==c&&11<c&&(d[g]=c+1-12)),d[g]&&(k[e[g].toLowerCase()]=parseInt(d[g],10));k.f&&(k.m=k.f);if(0===k.m&&0===k.y&&0===k.d)return"&#160;";k.m=parseInt(k.m,10)-1;c=k.y;70<=c&&99>=c?k.y=1900+k.y:0<=c&&69>=
c&&(k.y=2E3+k.y);c=new Date(k.y,k.m,k.d,k.h,k.i,k.s,k.u)}b in f.masks?b=f.masks[b]:b||(b="Y-m-d");e=c.getHours();d=c.getMinutes();k=c.getDate();g=c.getMonth()+1;m=c.getTimezoneOffset();var o=c.getSeconds(),p=c.getMilliseconds(),r=c.getDay(),t=c.getFullYear(),x=(r+6)%7+1,v=(new Date(t,g-1,k)-new Date(t,0,1))/864E5,u={d:l(k),D:n.i18n.dayNames[r],j:k,l:n.i18n.dayNames[r+7],N:x,S:f.S(k),w:r,z:v,W:5>x?Math.floor((v+x-1)/7)+1:Math.floor((v+x-1)/7)||(4>((new Date(t-1,0,1)).getDay()+6)%7?53:52),F:n.i18n.monthNames[g-
1+12],m:l(g),M:n.i18n.monthNames[g-1],n:g,t:"?",L:"?",o:"?",Y:t,y:(""+t).substring(2),a:12>e?f.AmPm[0]:f.AmPm[1],A:12>e?f.AmPm[2]:f.AmPm[3],B:"?",g:e%12||12,G:e,h:l(e%12||12),H:l(e),i:l(d),s:l(o),u:p,e:"?",I:"?",O:(0<m?"-":"+")+l(100*Math.floor(Math.abs(m)/60)+Math.abs(m)%60,4),P:"?",T:((""+c).match(/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g)||[""]).pop().replace(/[^-+\dA-Z]/g,""),Z:"?",c:"?",r:"?",U:Math.floor(c/
1E3)};return b.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(a){return a in u?u[a]:a.substring(1)})}};a.fn.fmatter.defaultFormat=function(e,d){return a.fmatter.isValue(e)&&""!==e?e:d.defaultValue?d.defaultValue:"&#160;"};a.fn.fmatter.email=function(e,d){return a.fmatter.isEmpty(e)?a.fn.fmatter.defaultFormat(e,d):'<a href="mailto:'+e+'">'+e+"</a>"};a.fn.fmatter.checkbox=function(e,d){var b=a.extend({},d.checkbox),f;a.fmatter.isUndefined(d.colModel.formatoptions)||(b=a.extend({},b,
d.colModel.formatoptions));f=!0===b.disabled?'disabled="disabled"':"";if(a.fmatter.isEmpty(e)||a.fmatter.isUndefined(e))e=a.fn.fmatter.defaultFormat(e,b);e=(e+"").toLowerCase();return'<input type="checkbox" '+(0>e.search(/(false|0|no|off)/i)?" checked='checked' ":"")+' value="'+e+'" offval="no" '+f+"/>"};a.fn.fmatter.link=function(e,d){var b={target:d.target},f="";a.fmatter.isUndefined(d.colModel.formatoptions)||(b=a.extend({},b,d.colModel.formatoptions));b.target&&(f="target="+b.target);return a.fmatter.isEmpty(e)?
a.fn.fmatter.defaultFormat(e,d):"<a "+f+' href="'+e+'">'+e+"</a>"};a.fn.fmatter.showlink=function(e,d){var b={baseLinkUrl:d.baseLinkUrl,showAction:d.showAction,addParam:d.addParam||"",target:d.target,idName:d.idName},f="";a.fmatter.isUndefined(d.colModel.formatoptions)||(b=a.extend({},b,d.colModel.formatoptions));b.target&&(f="target="+b.target);b=b.baseLinkUrl+b.showAction+"?"+b.idName+"="+d.rowId+b.addParam;return a.fmatter.isString(e)||a.fmatter.isNumber(e)?"<a "+f+' href="'+b+'">'+e+"</a>":a.fn.fmatter.defaultFormat(e,
d)};a.fn.fmatter.integer=function(e,d){var b=a.extend({},d.integer);a.fmatter.isUndefined(d.colModel.formatoptions)||(b=a.extend({},b,d.colModel.formatoptions));return a.fmatter.isEmpty(e)?b.defaultValue:a.fmatter.util.NumberFormat(e,b)};a.fn.fmatter.number=function(e,d){var b=a.extend({},d.number);a.fmatter.isUndefined(d.colModel.formatoptions)||(b=a.extend({},b,d.colModel.formatoptions));return a.fmatter.isEmpty(e)?b.defaultValue:a.fmatter.util.NumberFormat(e,b)};a.fn.fmatter.currency=function(e,
d){var b=a.extend({},d.currency);a.fmatter.isUndefined(d.colModel.formatoptions)||(b=a.extend({},b,d.colModel.formatoptions));return a.fmatter.isEmpty(e)?b.defaultValue:a.fmatter.util.NumberFormat(e,b)};a.fn.fmatter.date=function(e,d,b,f){b=a.extend({},d.date);a.fmatter.isUndefined(d.colModel.formatoptions)||(b=a.extend({},b,d.colModel.formatoptions));return!b.reformatAfterEdit&&"edit"==f?a.fn.fmatter.defaultFormat(e,d):a.fmatter.isEmpty(e)?a.fn.fmatter.defaultFormat(e,d):a.fmatter.util.DateFormat(b.srcformat,
e,b.newformat,b)};a.fn.fmatter.select=function(e,d){var e=e+"",b=!1,f=[];a.fmatter.isUndefined(d.colModel.formatoptions)?a.fmatter.isUndefined(d.colModel.editoptions)||(b=d.colModel.editoptions.value):b=d.colModel.formatoptions.value;if(b){var l=!0===d.colModel.editoptions.multiple?!0:!1,g=[],k;l&&(g=e.split(","),g=a.map(g,function(b){return a.trim(b)}));if(a.fmatter.isString(b))for(var c=b.split(";"),q=0,n=0;n<c.length;n++)if(k=c[n].split(":"),2<k.length&&(k[1]=m.map(k,function(a,b){if(b>0)return a}).join(":")),
l)-1<m.inArray(k[0],g)&&(f[q]=k[1],q++);else{if(a.trim(k[0])==a.trim(e)){f[0]=k[1];break}}else a.fmatter.isObject(b)&&(l?f=m.map(g,function(a){return b[a]}):f[0]=b[e]||"")}e=f.join(", ");return""===e?a.fn.fmatter.defaultFormat(e,d):e};a.fn.fmatter.rowactions=function(e,d,b,f){var l={keys:!1,editbutton:!0,delbutton:!0,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{oper:"edit"},url:null,delOptions:{}},f=a("#"+d)[0].p.colModel[f];a.fmatter.isUndefined(f.formatoptions)||
(l=a.extend(l,f.formatoptions));var f=function(b){l.afterSave&&l.afterSave(b);a("tr#"+e+" div.ui-inline-edit, tr#"+e+" div.ui-inline-del","#"+d).show();a("tr#"+e+" div.ui-inline-save, tr#"+e+" div.ui-inline-cancel","#"+d).hide()},g=function(b){l.afterRestore&&l.afterRestore(b);a("tr#"+e+" div.ui-inline-edit, tr#"+e+" div.ui-inline-del","#"+d).show();a("tr#"+e+" div.ui-inline-save, tr#"+e+" div.ui-inline-cancel","#"+d).hide()};switch(b){case "edit":a("#"+d).jqGrid("editRow",e,l.keys,l.onEdit,l.onSuccess,
l.url,l.extraparam,f,l.onError,g);a("tr#"+e+" div.ui-inline-edit, tr#"+e+" div.ui-inline-del","#"+d).hide();a("tr#"+e+" div.ui-inline-save, tr#"+e+" div.ui-inline-cancel","#"+d).show();break;case "save":a("#"+d).jqGrid("saveRow",e,l.onSuccess,l.url,l.extraparam,f,l.onError,g)&&(a("tr#"+e+" div.ui-inline-edit, tr#"+e+" div.ui-inline-del","#"+d).show(),a("tr#"+e+" div.ui-inline-save, tr#"+e+" div.ui-inline-cancel","#"+d).hide());break;case "cancel":a("#"+d).jqGrid("restoreRow",e,g);a("tr#"+e+" div.ui-inline-edit, tr#"+
e+" div.ui-inline-del","#"+d).show();a("tr#"+e+" div.ui-inline-save, tr#"+e+" div.ui-inline-cancel","#"+d).hide();break;case "del":a("#"+d).jqGrid("delGridRow",e,l.delOptions)}};a.fn.fmatter.actions=function(e,d){var b={keys:!1,editbutton:!0,delbutton:!0};a.fmatter.isUndefined(d.colModel.formatoptions)||(b=a.extend(b,d.colModel.formatoptions));var f=d.rowId,l="",g;if("undefined"==typeof f||a.fmatter.isEmpty(f))return"";b.editbutton&&(g="onclick=$.fn.fmatter.rowactions('"+f+"','"+d.gid+"','edit',"+
d.pos+");",l=l+"<div style='margin-left:8px;'><div title='"+a.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+g+"><span class='ui-icon ui-icon-pencil'></span></div>");b.delbutton&&(g="onclick=$.fn.fmatter.rowactions('"+f+"','"+d.gid+"','del',"+d.pos+");",l=l+"<div title='"+a.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+g+"><span class='ui-icon ui-icon-trash'></span></div>");g="onclick=$.fn.fmatter.rowactions('"+
f+"','"+d.gid+"','save',"+d.pos+");";l=l+"<div title='"+a.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save'><span class='ui-icon ui-icon-disk' "+g+"></span></div>";g="onclick=$.fn.fmatter.rowactions('"+f+"','"+d.gid+"','cancel',"+d.pos+");";return l+"<div title='"+a.jgrid.edit.bCancel+"' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel'><span class='ui-icon ui-icon-cancel' "+g+"></span></div></div>"};a.unformat=function(e,d,b,
f){var l,g=d.colModel.formatter,k=d.colModel.formatoptions||{},c=/([\.\*\_\'\(\)\{\}\+\?\\])/g,m=d.colModel.unformat||a.fn.fmatter[g]&&a.fn.fmatter[g].unformat;if("undefined"!==typeof m&&a.isFunction(m))l=m(a(e).text(),d,e);else if(!a.fmatter.isUndefined(g)&&a.fmatter.isString(g))switch(l=a.jgrid.formatter||{},g){case "integer":k=a.extend({},l.integer,k);d=k.thousandsSeparator.replace(c,"\\$1");l=a(e).text().replace(RegExp(d,"g"),"");break;case "number":k=a.extend({},l.number,k);d=k.thousandsSeparator.replace(c,
"\\$1");l=a(e).text().replace(RegExp(d,"g"),"").replace(k.decimalSeparator,".");break;case "currency":k=a.extend({},l.currency,k);d=k.thousandsSeparator.replace(c,"\\$1");l=a(e).text().replace(RegExp(d,"g"),"").replace(k.decimalSeparator,".").replace(k.prefix,"").replace(k.suffix,"");break;case "checkbox":k=d.colModel.editoptions?d.colModel.editoptions.value.split(":"):["Yes","No"];l=a("input",e).attr("checked")?k[0]:k[1];break;case "select":l=a.unformat.select(e,d,b,f);break;case "actions":return"";
default:l=a(e).text()}return l?l:!0===f?a(e).text():a.jgrid.htmlDecode(a(e).html())};a.unformat.select=function(e,d,b,f){b=[];e=a(e).text();if(!0===f)return e;d=a.extend({},d.colModel.editoptions);if(d.value){var l=d.value,d=!0===d.multiple?!0:!1,f=[],g;d&&(f=e.split(","),f=a.map(f,function(b){return a.trim(b)}));if(a.fmatter.isString(l))for(var k=l.split(";"),c=0,q=0;q<k.length;q++)if(g=k[q].split(":"),2<g.length&&(g[1]=m.map(g,function(a,b){if(b>0)return a}).join(":")),d)-1<m.inArray(g[1],f)&&(b[c]=
g[0],c++);else{if(a.trim(g[1])==a.trim(e)){b[0]=g[0];break}}else if(a.fmatter.isObject(l)||a.isArray(l))d||(f[0]=e),b=m.map(f,function(b){var c;a.each(l,function(a,d){if(d==b){c=a;return false}});if(typeof c!="undefined")return c});return b.join(", ")}return e||""};a.unformat.date=function(e,d){var b=a.jgrid.formatter.date||{};a.fmatter.isUndefined(d.formatoptions)||(b=a.extend({},b,d.formatoptions));return a.fmatter.isEmpty(e)?a.fn.fmatter.defaultFormat(e,d):a.fmatter.util.DateFormat(b.newformat,
e,b.srcformat,b)}})(m);(function(a){a.jgrid.extend({getColProp:function(a){var d={},b=this[0];if(!b.grid)return!1;for(var b=b.p.colModel,e=0;e<b.length;e++)if(b[e].name==a){d=b[e];break}return d},setColProp:function(e,d){return this.each(function(){if(this.grid&&d)for(var b=this.p.colModel,f=0;f<b.length;f++)if(b[f].name==e){a.extend(this.p.colModel[f],d);break}})},sortGrid:function(a,d,b){return this.each(function(){var e=-1;if(this.grid){a||(a=this.p.sortname);for(var l=0;l<this.p.colModel.length;l++)if(this.p.colModel[l].index==
a||this.p.colModel[l].name==a){e=l;break}-1!=e&&(l=this.p.colModel[e].sortable,"boolean"!==typeof l&&(l=!0),"boolean"!==typeof d&&(d=!1),l&&this.sortData("jqgh_"+a,e,d,b))}})},GridDestroy:function(){return this.each(function(){if(this.grid){this.p.pager&&a(this.p.pager).remove();var e=this.id;try{a("#gbox_"+e).remove()}catch(d){}}})},GridUnload:function(){return this.each(function(){if(this.grid){var e={id:a(this).attr("id"),cl:a(this).attr("class")};this.p.pager&&a(this.p.pager).empty().removeClass("ui-state-default ui-jqgrid-pager corner-bottom");
var d=document.createElement("table");a(d).attr({id:e.id});d.className=e.cl;e=this.id;a(d).removeClass("ui-jqgrid-btable");1===a(this.p.pager).parents("#gbox_"+e).length?(a(d).insertBefore("#gbox_"+e).show(),a(this.p.pager).insertBefore("#gbox_"+e)):a(d).insertBefore("#gbox_"+e).show();a("#gbox_"+e).remove()}})},setGridState:function(e){return this.each(function(){this.grid&&("hidden"==e?(a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+this.p.id).slideUp("fast"),this.p.pager&&a(this.p.pager).slideUp("fast"),
this.p.toppager&&a(this.p.toppager).slideUp("fast"),!0===this.p.toolbar[0]&&("both"==this.p.toolbar[1]&&a(this.grid.ubDiv).slideUp("fast"),a(this.grid.uDiv).slideUp("fast")),this.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+this.p.id).slideUp("fast"),a(".ui-jqgrid-titlebar-close span",this.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s"),this.p.gridstate="hidden"):"visible"==e&&(a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+this.p.id).slideDown("fast"),this.p.pager&&
a(this.p.pager).slideDown("fast"),this.p.toppager&&a(this.p.toppager).slideDown("fast"),!0===this.p.toolbar[0]&&("both"==this.p.toolbar[1]&&a(this.grid.ubDiv).slideDown("fast"),a(this.grid.uDiv).slideDown("fast")),this.p.footerrow&&a(".ui-jqgrid-sdiv","#gbox_"+this.p.id).slideDown("fast"),a(".ui-jqgrid-titlebar-close span",this.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n"),this.p.gridstate="visible"))})},filterToolbar:function(e){e=a.extend({autosearch:!0,
searchOnEnter:!0,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:!1,groupOp:"AND",defaultSearch:"bw"},e||{});return this.each(function(){function d(b,c){var d=a(b);d[0]&&m.each(c,function(){void 0!==this.data?d.bind(this.type,this.data,this.fn):d.bind(this.type,this.fn)})}var b=this;if(!this.ftoolbar){var f=function(){var d={},c=0,f,g,l={},m;a.each(b.p.colModel,function(){g=this.index||this.name;switch(this.stype){case "select":m=this.searchoptions&&this.searchoptions.sopt?
this.searchoptions.sopt[0]:"eq";if(f=a("#gs_"+a.jgrid.jqID(g),b.grid.hDiv).val())d[g]=f,l[g]=m,c++;else try{delete b.p.postData[g]}catch(r){}break;case "text":if(m=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:e.defaultSearch,f=a("#gs_"+a.jgrid.jqID(g),b.grid.hDiv).val())d[g]=f,l[g]=m,c++;else try{delete b.p.postData[g]}catch(t){}}});var r=0<c?!0:!1;if(!0===e.stringResult||"local"==b.p.datatype){var t='{"groupOp":"'+e.groupOp+'","rules":[',x=0;a.each(d,function(a,b){0<x&&
(t+=",");t+='{"field":"'+a+'",';t+='"op":"'+l[a]+'",';t+='"data":"'+(b+"").replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';x++});t+="]}";a.extend(b.p.postData,{filters:t});a.each(["searchField","searchString","searchOper"],function(a,c){b.p.postData.hasOwnProperty(c)&&delete b.p.postData[c]})}else a.extend(b.p.postData,d);var v;b.p.searchurl&&(v=b.p.url,a(b).jqGrid("setGridParam",{url:b.p.searchurl}));var u=!1;a.isFunction(e.beforeSearch)&&(u=e.beforeSearch.call(b));u||a(b).jqGrid("setGridParam",
{search:r}).trigger("reloadGrid",[{page:1}]);v&&a(b).jqGrid("setGridParam",{url:v});a.isFunction(e.afterSearch)&&e.afterSearch()},l=a("<tr class='ui-search-toolbar' role='rowheader'></tr>"),g;a.each(b.p.colModel,function(){var k=this,c,m,n,o;m=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+b.p.direction+"'></th>");c=a("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");!0===this.hidden&&a(m).css("display","none");this.search=!1===this.search?
!1:!0;"undefined"==typeof this.stype&&(this.stype="text");n=a.extend({},this.searchoptions||{});if(this.search)switch(this.stype){case "select":if(o=this.surl||n.dataUrl)a.ajax(a.extend({url:o,dataType:"html",complete:function(b){n.buildSelect!==void 0?(b=n.buildSelect(b))&&a(c).append(b):a(c).append(b.responseText);n.defaultValue&&a("select",c).val(n.defaultValue);a("select",c).attr({name:k.index||k.name,id:"gs_"+k.name});n.attr&&a("select",c).attr(n.attr);a("select",c).css({width:"100%"});n.dataInit!==
void 0&&n.dataInit(a("select",c)[0]);n.dataEvents!==void 0&&d(a("select",c)[0],n.dataEvents);e.autosearch===true&&a("select",c).change(function(){f();return false});b=null}},a.jgrid.ajaxOptions,b.p.ajaxSelectOptions||{}));else{var p;k.searchoptions&&k.searchoptions.value?p=k.searchoptions.value:k.editoptions&&k.editoptions.value&&(p=k.editoptions.value);if(p){o=document.createElement("select");o.style.width="100%";a(o).attr({name:k.index||k.name,id:"gs_"+k.name});var r,t;if("string"===typeof p){p=
p.split(";");for(var x=0;x<p.length;x++)r=p[x].split(":"),t=document.createElement("option"),t.value=r[0],t.innerHTML=r[1],o.appendChild(t)}else if("object"===typeof p)for(r in p)p.hasOwnProperty(r)&&(t=document.createElement("option"),t.value=r,t.innerHTML=p[r],o.appendChild(t));n.defaultValue&&a(o).val(n.defaultValue);n.attr&&a(o).attr(n.attr);void 0!==n.dataInit&&n.dataInit(o);void 0!==n.dataEvents&&d(o,n.dataEvents);a(c).append(o);!0===e.autosearch&&a(o).change(function(){f();return false})}}break;
case "text":o=n.defaultValue?n.defaultValue:"",a(c).append("<input type='text' style='width:95%;padding:0px;' name='"+(k.index||k.name)+"' id='gs_"+k.name+"' value='"+o+"'/>"),n.attr&&a("input",c).attr(n.attr),void 0!==n.dataInit&&n.dataInit(a("input",c)[0]),void 0!==n.dataEvents&&d(a("input",c)[0],n.dataEvents),!0===e.autosearch&&(e.searchOnEnter?a("input",c).keypress(function(a){if((a.charCode?a.charCode:a.keyCode?a.keyCode:0)==13){f();return false}return this}):a("input",c).keydown(function(a){switch(a.which){case 13:return false;
case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:g&&clearTimeout(g);g=setTimeout(function(){f()},500)}}))}a(m).append(c);a(l).append(m)});a("table thead",b.grid.hDiv).append(l);this.ftoolbar=!0;this.triggerToolbar=f;this.clearToolbar=function(d){var c={},f,g=0,l,d="boolean"!=typeof d?!0:d;a.each(b.p.colModel,function(){f=this.searchoptions&&this.searchoptions.defaultValue?this.searchoptions.defaultValue:"";l=this.index||this.name;switch(this.stype){case "select":var d;a("#gs_"+
a.jgrid.jqID(l)+" option",b.grid.hDiv).each(function(b){0===b&&(this.selected=!0);if(a(this).text()==f)return this.selected=!0,d=a(this).val(),!1});if(d)c[l]=d,g++;else try{delete b.p.postData[l]}catch(e){}break;case "text":if(a("#gs_"+a.jgrid.jqID(l),b.grid.hDiv).val(f),f)c[l]=f,g++;else try{delete b.p.postData[l]}catch(j){}}});var m=0<g?!0:!1;if(!0===e.stringResult||"local"==b.p.datatype){var r='{"groupOp":"'+e.groupOp+'","rules":[',t=0;a.each(c,function(a,b){0<t&&(r+=",");r+='{"field":"'+a+'",';
r+='"op":"eq",';r+='"data":"'+(b+"").replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';t++});r+="]}";a.extend(b.p.postData,{filters:r});a.each(["searchField","searchString","searchOper"],function(a,c){b.p.postData.hasOwnProperty(c)&&delete b.p.postData[c]})}else a.extend(b.p.postData,c);var x;b.p.searchurl&&(x=b.p.url,a(b).jqGrid("setGridParam",{url:b.p.searchurl}));var v=!1;a.isFunction(e.beforeClear)&&(v=e.beforeClear.call(b));v||d&&a(b).jqGrid("setGridParam",{search:m}).trigger("reloadGrid",[{page:1}]);
x&&a(b).jqGrid("setGridParam",{url:x});a.isFunction(e.afterClear)&&e.afterClear()};this.toggleToolbar=function(){var d=a("tr.ui-search-toolbar",b.grid.hDiv);"none"==d.css("display")?d.show():d.hide()}}})}})})(m);(function(a){a.extend(a.jgrid,{showModal:function(a){a.w.show()},closeModal:function(a){a.w.hide().attr("aria-hidden","true");a.o&&a.o.remove()},hideModal:function(e,d){d=a.extend({jqm:!0,gb:""},d||{});if(d.onClose){var b=d.onClose(e);if("boolean"==typeof b&&!b)return}if(a.fn.jqm&&!0===d.jqm)a(e).attr("aria-hidden",
"true").jqmHide();else{if(""!==d.gb)try{a(".jqgrid-overlay:first",d.gb).hide()}catch(f){}a(e).hide().attr("aria-hidden","true")}},findPos:function(a){var d=0,b=0;if(a.offsetParent){do d+=a.offsetLeft,b+=a.offsetTop;while(a=a.offsetParent)}return[d,b]},createModal:function(e,d,b,f,l,g,k){var c=document.createElement("div"),m,n=this,k=a.extend({},k||{});m="rtl"==a(b.gbox).attr("dir")?!0:!1;c.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";c.id=e.themodal;var o=document.createElement("div");
o.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";o.id=e.modalhead;a(o).append("<span class='ui-jqdialog-title'>"+b.caption+"</span>");var p=a("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){p.addClass("ui-state-hover")},function(){p.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");a(o).append(p);m?(c.dir="rtl",a(".ui-jqdialog-title",o).css("float","right"),a(".ui-jqdialog-titlebar-close",
o).css("left","0.3em")):(c.dir="ltr",a(".ui-jqdialog-title",o).css("float","left"),a(".ui-jqdialog-titlebar-close",o).css("right","0.3em"));var r=document.createElement("div");a(r).addClass("ui-jqdialog-content ui-widget-content").attr("id",e.modalcontent);a(r).append(d);c.appendChild(r);a(c).prepend(o);!0===g?a("body").append(c):"string"==typeof g?a(g).append(c):a(c).insertBefore(f);a(c).css(k);"undefined"===typeof b.jqModal&&(b.jqModal=!0);d={};if(a.fn.jqm&&!0===b.jqModal)0===b.left&&(0===b.top&&
b.overlay)&&(k=[],k=this.findPos(l),b.left=k[0]+4,b.top=k[1]+4),d.top=b.top+"px",d.left=b.left;else if(0!==b.left||0!==b.top)d.left=b.left,d.top=b.top+"px";a("a.ui-jqdialog-titlebar-close",o).click(function(){var c=a("#"+e.themodal).data("onClose")||b.onClose,d=a("#"+e.themodal).data("gbox")||b.gbox;n.hideModal("#"+e.themodal,{gb:d,jqm:b.jqModal,onClose:c});return false});if(0===b.width||!b.width)b.width=300;if(0===b.height||!b.height)b.height=200;b.zIndex||(f=a(f).parents("*[role=dialog]").filter(":first").css("z-index"),
b.zIndex=f?parseInt(f,10)+1:950);f=0;m&&(d.left&&!g)&&(f=a(b.gbox).width()-(!isNaN(b.width)?parseInt(b.width,10):0)-8,d.left=parseInt(d.left,10)+parseInt(f,10));d.left&&(d.left+="px");a(c).css(a.extend({width:isNaN(b.width)?"auto":b.width+"px",height:isNaN(b.height)?"auto":b.height+"px",zIndex:b.zIndex,overflow:"hidden"},d)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":e.modalhead,"aria-hidden":"true"});"undefined"==typeof b.drag&&(b.drag=!0);"undefined"==typeof b.resize&&(b.resize=!0);if(b.drag)if(a(o).css("cursor",
"move"),a.fn.jqDrag)a(c).jqDrag(o);else try{a(c).draggable({handle:a("#"+o.id)})}catch(t){}if(b.resize)if(a.fn.jqResize)a(c).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>"),a("#"+e.themodal).jqResize(".jqResize",e.scrollelm?"#"+e.scrollelm:!1);else try{a(c).resizable({handles:"se, sw",alsoResize:e.scrollelm?"#"+e.scrollelm:!1})}catch(x){}!0===b.closeOnEscape&&a(c).keydown(function(c){if(c.which==27){c=a("#"+
e.themodal).data("onClose")||b.onClose;n.hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:c})}})},viewModal:function(e,d){d=a.extend({toTop:!0,overlay:10,modal:!1,onShow:this.showModal,onHide:this.closeModal,gbox:"",jqm:!0,jqM:!0},d||{});if(a.fn.jqm&&!0===d.jqm)d.jqM?a(e).attr("aria-hidden","false").jqm(d).jqmShow():a(e).attr("aria-hidden","false").jqmShow();else{""!==d.gbox&&(a(".jqgrid-overlay:first",d.gbox).show(),a(e).data("gbox",d.gbox));a(e).show().attr("aria-hidden","false");try{a(":input:visible",
e)[0].focus()}catch(b){}}},info_dialog:function(e,d,b,f){var l={width:290,height:"auto",dataheight:"auto",drag:!0,resize:!1,caption:"<b>"+e+"</b>",left:250,top:170,zIndex:1E3,jqModal:!0,modal:!1,closeOnEscape:!0,align:"center",buttonalign:"center",buttons:[]};a.extend(l,f||{});var g=l.jqModal,k=this;a.fn.jqm&&!g&&(g=!1);e="";if(0<l.buttons.length)for(f=0;f<l.buttons.length;f++)"undefined"==typeof l.buttons[f].id&&(l.buttons[f].id="info_button_"+f),e+="<a href='javascript:void(0)' id='"+l.buttons[f].id+
"' class='fm-button ui-state-default ui-corner-all'>"+l.buttons[f].text+"</a>";f=isNaN(l.dataheight)?l.dataheight:l.dataheight+"px";d="<div id='info_id'>"+("<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+f+";"+("text-align:"+l.align+";")+"'>"+d+"</div>");d+=b?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+l.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+
b+"</a>"+e+"</div>":""!==e?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+l.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'>"+e+"</div>":"";d+="</div>";try{"false"==a("#info_dialog").attr("aria-hidden")&&this.hideModal("#info_dialog",{jqm:g}),a("#info_dialog").remove()}catch(c){}this.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},d,l,"","",!0);e&&a.each(l.buttons,
function(b){a("#"+this.id,"#info_id").bind("click",function(){l.buttons[b].onClick.call(a("#info_dialog"));return!1})});a("#closedialog","#info_id").click(function(){k.hideModal("#info_dialog",{jqm:g});return!1});a(".fm-button","#info_dialog").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a.isFunction(l.beforeOpen)&&l.beforeOpen();this.viewModal("#info_dialog",{onHide:function(a){a.w.hide().remove();a.o&&a.o.remove()},modal:l.modal,jqm:g});
a.isFunction(l.afterOpen)&&l.afterOpen();try{a("#info_dialog").focus()}catch(m){}},createEl:function(e,d,b,f,l){function g(b,c){a.isFunction(c.dataInit)&&c.dataInit(b);c.dataEvents&&a.each(c.dataEvents,function(){void 0!==this.data?a(b).bind(this.type,this.data,this.fn):a(b).bind(this.type,this.fn)});return c}function k(b,c){var d="dataInit dataEvents dataUrl buildSelect sopt searchhidden defaultValue attr".split(" ");a.each(c,function(c,e){-1===a.inArray(c,d)&&a(b).attr(c,e)});c.hasOwnProperty("id")||
a(b).attr("id",a.jgrid.randId())}var c="";switch(e){case "textarea":c=document.createElement("textarea");f?d.cols||a(c).css({width:"98%"}):d.cols||(d.cols=20);d.rows||(d.rows=2);if("&nbsp;"==b||"&#160;"==b||1==b.length&&160==b.charCodeAt(0))b="";c.value=b;k(c,d);d=g(c,d);a(c).attr({role:"textbox",multiline:"true"});break;case "checkbox":c=document.createElement("input");c.type="checkbox";d.value?(e=d.value.split(":"),b===e[0]&&(c.checked=!0,c.defaultChecked=!0),c.value=e[0],a(c).attr("offval",e[1])):
(e=b.toLowerCase(),0>e.search(/(false|0|no|off|undefined)/i)&&""!==e?(c.checked=!0,c.defaultChecked=!0,c.value=b):c.value="on",a(c).attr("offval","off"));k(c,d);d=g(c,d);a(c).attr("role","checkbox");break;case "select":c=document.createElement("select");c.setAttribute("role","select");f=[];!0===d.multiple?(e=!0,c.multiple="multiple",a(c).attr("aria-multiselectable","true")):e=!1;if("undefined"!=typeof d.dataUrl)a.ajax(a.extend({url:d.dataUrl,type:"GET",dataType:"html",context:{elem:c,options:d,vl:b},
success:function(b){var c=[],d=this.elem,e=this.vl,f=a.extend({},this.options),j=f.multiple===true;typeof f.buildSelect!="undefined"&&(b=f.buildSelect(b));if(b=a(b).html()){a(d).append(b);k(d,f);f=g(d,f);if(typeof f.size==="undefined")f.size=j?3:1;if(j){c=e.split(",");c=a.map(c,function(b){return a.trim(b)})}else c[0]=a.trim(e);setTimeout(function(){a("option",d).each(function(){a(this).attr("role","option");if(a.inArray(a.trim(a(this).text()),c)>-1||a.inArray(a.trim(a(this).val()),c)>-1)this.selected=
"selected"})},0)}}},l||{}));else if(d.value){var m;e?(f=b.split(","),f=a.map(f,function(b){return a.trim(b)}),"undefined"===typeof d.size&&(d.size=3)):d.size=1;"function"===typeof d.value&&(d.value=d.value());var n,o;if("string"===typeof d.value){n=d.value.split(";");for(m=0;m<n.length;m++){o=n[m].split(":");2<o.length&&(o[1]=a.map(o,function(a,b){if(b>0)return a}).join(":"));l=document.createElement("option");l.setAttribute("role","option");l.value=o[0];l.innerHTML=o[1];if(!e&&(a.trim(o[0])==a.trim(b)||
a.trim(o[1])==a.trim(b)))l.selected="selected";if(e&&(-1<a.inArray(a.trim(o[1]),f)||-1<a.inArray(a.trim(o[0]),f)))l.selected="selected";c.appendChild(l)}}else if("object"===typeof d.value)for(m in n=d.value,n)if(n.hasOwnProperty(m)){l=document.createElement("option");l.setAttribute("role","option");l.value=m;l.innerHTML=n[m];if(!e&&(a.trim(m)==a.trim(b)||a.trim(n[m])==a.trim(b)))l.selected="selected";if(e&&(-1<a.inArray(a.trim(n[m]),f)||-1<a.inArray(a.trim(m),f)))l.selected="selected";c.appendChild(l)}k(c,
d);d=g(c,d)}break;case "text":case "password":case "button":m="button"==e?"button":"textbox";c=document.createElement("input");c.type=e;c.value=b;k(c,d);d=g(c,d);"button"!=e&&(f?d.size||a(c).css({width:"98%"}):d.size||(d.size=20));a(c).attr("role",m);break;case "image":case "file":c=document.createElement("input");c.type=e;k(c,d);d=g(c,d);break;case "custom":c=document.createElement("span");try{if(a.isFunction(d.custom_element))if(n=d.custom_element.call(this,b,d))n=a(n).addClass("customelement").attr({id:d.id,
name:d.name}),a(c).empty().append(n);else throw"e2";else throw"e1";}catch(p){"e1"==p&&this.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose),"e2"==p?this.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.novalue,a.jgrid.edit.bClose):this.info_dialog(a.jgrid.errors.errcap,"string"===typeof p?p:p.message,a.jgrid.edit.bClose)}}return c},checkDate:function(a,d){var b={},e,a=a.toLowerCase();e=-1!=a.indexOf("/")?
"/":-1!=a.indexOf("-")?"-":-1!=a.indexOf(".")?".":"/";a=a.split(e);d=d.split(e);if(3!=d.length)return!1;e=-1;for(var l,g=-1,k=-1,c=0;c<a.length;c++)l=isNaN(d[c])?0:parseInt(d[c],10),b[a[c]]=l,l=a[c],-1!=l.indexOf("y")&&(e=c),-1!=l.indexOf("m")&&(k=c),-1!=l.indexOf("d")&&(g=c);l="y"==a[e]||"yyyy"==a[e]?4:"yy"==a[e]?2:-1;var c=function(a){for(var b=1;b<=a;b++){this[b]=31;if(4==b||6==b||9==b||11==b)this[b]=30;2==b&&(this[b]=29)}return this}(12),m;if(-1===e)return!1;m=b[a[e]].toString();2==l&&1==m.length&&
(l=1);if(m.length!=l||0===b[a[e]]&&"00"!=d[e]||-1===k)return!1;m=b[a[k]].toString();if(1>m.length||(1>b[a[k]]||12<b[a[k]])||-1===g)return!1;m=b[a[g]].toString();return 1>m.length||1>b[a[g]]||31<b[a[g]]||2==b[a[k]]&&b[a[g]]>(0===b[a[e]]%4&&(0!==b[a[e]]%100||0===b[a[e]]%400)?29:28)||b[a[g]]>c[b[a[k]]]?!1:!0},isEmpty:function(a){return a.match(/^\s+$/)||""===a?!0:!1},checkTime:function(a){var d=/^(\d{1,2}):(\d{2})([ap]m)?$/;if(!this.isEmpty(a))if(a=a.match(d)){if(a[3]){if(1>a[1]||12<a[1])return!1}else if(23<
a[1])return!1;if(59<a[2])return!1}else return!1;return!0},checkValues:function(e,d,b,f,l){var g,k;if("undefined"===typeof f)if("string"==typeof d){f=0;for(l=b.p.colModel.length;f<l;f++)if(b.p.colModel[f].name==d){g=b.p.colModel[f].editrules;d=f;try{k=b.p.colModel[f].formoptions.label}catch(c){}break}}else 0<=d&&(g=b.p.colModel[d].editrules);else g=f,k=void 0===l?"_":l;if(g){k||(k=b.p.colNames[d]);if(!0===g.required&&this.isEmpty(e))return[!1,k+": "+a.jgrid.edit.msg.required,""];f=!1===g.required?
!1:!0;if(!0===g.number&&!(!1===f&&this.isEmpty(e))&&isNaN(e))return[!1,k+": "+a.jgrid.edit.msg.number,""];if("undefined"!=typeof g.minValue&&!isNaN(g.minValue)&&parseFloat(e)<parseFloat(g.minValue))return[!1,k+": "+a.jgrid.edit.msg.minValue+" "+g.minValue,""];if("undefined"!=typeof g.maxValue&&!isNaN(g.maxValue)&&parseFloat(e)>parseFloat(g.maxValue))return[!1,k+": "+a.jgrid.edit.msg.maxValue+" "+g.maxValue,""];if(!0===g.email&&!(!1===f&&this.isEmpty(e))&&(l=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
!l.test(e)))return[!1,k+": "+a.jgrid.edit.msg.email,""];if(!0===g.integer&&!(!1===f&&this.isEmpty(e))&&(isNaN(e)||0!==e%1||-1!=e.indexOf(".")))return[!1,k+": "+a.jgrid.edit.msg.integer,""];if(!0===g.date&&!(!1===f&&this.isEmpty(e))&&(d=b.p.colModel[d].formatoptions&&b.p.colModel[d].formatoptions.newformat?b.p.colModel[d].formatoptions.newformat:b.p.colModel[d].datefmt||"Y-m-d",!this.checkDate(d,e)))return[!1,k+": "+a.jgrid.edit.msg.date+" - "+d,""];if(!0===g.time&&!(!1===f&&this.isEmpty(e))&&!this.checkTime(e))return[!1,
k+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(!0===g.url&&!(!1===f&&this.isEmpty(e))&&(l=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i,!l.test(e)))return[!1,k+": "+a.jgrid.edit.msg.url,""];if(!0===g.custom&&!(!1===f&&this.isEmpty(e)))return a.isFunction(g.custom_func)?(e=g.custom_func.call(b,e,k),a.isArray(e)?e:[!1,a.jgrid.edit.msg.customarray,""]):[!1,a.jgrid.edit.msg.customfcheck,""]}return[!0,"",""]}})})(m);(function(a){var j=
null;a.jgrid.extend({searchGrid:function(d){d=a.extend({recreateFilter:!1,drag:!0,sField:"searchField",sValue:"searchString",sOper:"searchOper",sFilter:"filters",loadDefaults:!0,beforeShowSearch:null,afterShowSearch:null,onInitializeSearch:null,closeAfterSearch:!1,closeAfterReset:!1,closeOnEscape:!1,multipleSearch:!1,multipleGroup:!1,top:0,left:0,jqModal:!0,modal:!1,resize:!1,width:450,height:"auto",dataheight:"auto",showQuery:!1,errorcheck:!0,sopt:null,stringResult:void 0,onClose:null,onSearch:null,
onReset:null,toTop:!0,overlay:10,columns:[],tmplNames:null,tmplFilters:null,tmplLabel:" Template: ",showOnLoad:!1,layer:null},a.jgrid.search,d||{});return this.each(function(){function b(){a.isFunction(d.beforeShowSearch)&&(g=d.beforeShowSearch(a("#"+j)),"undefined"===typeof g&&(g=!0));g&&(a.jgrid.viewModal("#"+k.themodal,{gbox:"#gbox_"+j,jqm:d.jqModal,modal:d.modal,overlay:d.overlay,toTop:d.toTop}),a.isFunction(d.afterShowSearch)&&d.afterShowSearch(a("#"+j)))}var f=this;if(f.grid){var j="fbox_"+
f.p.id,g=!0,k={themodal:"searchmod"+j,modalhead:"searchhd"+j,modalcontent:"searchcnt"+j,scrollelm:j},c=f.p.postData[d.sFilter];"string"===typeof c&&(c=a.jgrid.parse(c));!0===d.recreateFilter&&a("#"+k.themodal).remove();if(null!==a("#"+k.themodal).html())b();else{var m=a("<span><div id='"+j+"' class='searchFilter' style='overflow:auto'></div></span>").insertBefore("#gview_"+f.p.id);if(a.isFunction(d.onInitializeSearch))d.onInitializeSearch(a("#"+j));var n=a.extend([],f.p.colModel),o="<a href='javascript:void(0)' id='"+
j+"_search' class='fm-button ui-state-default ui-corner-all fm-button-icon-right ui-reset'><span class='ui-icon ui-icon-search'></span>"+d.Find+"</a>",p="<a href='javascript:void(0)' id='"+j+"_reset' class='fm-button ui-state-default ui-corner-all fm-button-icon-left ui-search'><span class='ui-icon ui-icon-arrowreturnthick-1-w'></span>"+d.Reset+"</a>",r="",t="",x,v=!1;d.showQuery&&(r="<a href='javascript:void(0)' id='"+j+"_query' class='fm-button ui-state-default ui-corner-all fm-button-icon-left'><span class='ui-icon ui-icon-comment'></span>Query</a>");
d.columns.length?n=d.columns:a.each(n,function(a,b){b.label||(b.label=f.p.colNames[a]);if(!v){var c="undefined"===typeof b.search?!0:b.search,d=!0===b.hidden;if(b.searchoptions&&!0===b.searchoptions.searchhidden&&c||c&&!d)v=!0,x=b.index||b.name}});if(!c&&x||!1===d.multipleSearch)c={groupOp:"AND",rules:[{field:x,op:"eq",data:""}]};v=!1;d.tmplNames&&d.tmplNames.length&&(v=!0,t=d.tmplLabel,t+="<select class='ui-template'>",t+="<option value='default'>Default</option>",a.each(d.tmplNames,function(a,b){t+=
"<option value='"+a+"'>"+b+"</option>"}),t+="</select>");o="<table class='EditTable' style='border:0px none;margin-top:5px' id='"+j+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='EditButton' style='text-align:left'>"+p+t+"</td><td class='EditButton'>"+r+o+"</td></tr></tbody></table>";a("#"+j).jqFilter({columns:n,filter:d.loadDefaults?c:null,showQuery:d.showQuery,errorcheck:d.errorcheck,sopt:d.sopt,groupButton:d.multipleGroup,_gridsopt:a.jgrid.search.odata,
onChange:function(){this.p.showQuery&&a(".query",this).html(this.toUserFriendlyString())}});m.append(o);v&&d.tmplFilters&&d.tmplFilters.length&&a(".ui-template",m).bind("change",function(){var b=a(this).val();b=="default"?a("#"+j).jqFilter("addFilter",c):a("#"+j).jqFilter("addFilter",d.tmplFilters[parseInt(b,10)]);return false});!1===d.multipleSearch&&(a(".add-rule","#"+j).hide(),a(".delete-rule","#"+j).hide());if(a.isFunction(d.onInitializeSearch))d.onInitializeSearch(a("#"+j));d.layer?a.jgrid.createModal(k,
m,d,"#gview_"+f.p.id,a("#gbox_"+f.p.id)[0],"#"+d.layer,{position:"relative"}):a.jgrid.createModal(k,m,d,"#gview_"+f.p.id,a("#gbox_"+f.p.id)[0]);r&&a("#"+j+"_query").bind("click",function(){a(".queryresult",m).toggle();return false});void 0===d.stringResult&&(d.stringResult=d.multipleSearch);a("#"+j+"_search").bind("click",function(){var b=a("#"+j),c={},g,m=b.jqFilter("filterData");if(d.errorcheck){b[0].hideError();d.showQuery||b.jqFilter("toSQLString");if(b[0].p.error){b[0].showError();return false}}if(d.stringResult){try{g=
e.toJson(m,"","",false)}catch(n){try{g=ha.stringify(m)}catch(o){}}if(typeof g==="string"){c[d.sFilter]=g;a.each([d.sField,d.sValue,d.sOper],function(){c[this]=""})}}else if(d.multipleSearch){c[d.sFilter]=m;a.each([d.sField,d.sValue,d.sOper],function(){c[this]=""})}else{c[d.sField]=m.rules[0].field;c[d.sValue]=m.rules[0].data;c[d.sOper]=m.rules[0].op;c[d.sFilter]=""}f.p.search=true;a.extend(f.p.postData,c);if(a.isFunction(d.onSearch))d.onSearch();a(f).trigger("reloadGrid",[{page:1}]);d.closeAfterSearch&&
a.jgrid.hideModal("#"+k.themodal,{gb:"#gbox_"+f.p.id,jqm:d.jqModal,onClose:d.onClose});return false});a("#"+j+"_reset").bind("click",function(){var b={},c=a("#"+j);f.p.search=false;d.multipleSearch===false?b[d.sField]=b[d.sValue]=b[d.sOper]="":b[d.sFilter]="";c[0].resetFilter();v&&a(".ui-template",m).val("default");a.extend(f.p.postData,b);if(a.isFunction(d.onReset))d.onReset();a(f).trigger("reloadGrid",[{page:1}]);return false});b();a(".fm-button:not(.ui-state-disabled)",m).hover(function(){a(this).addClass("ui-state-hover")},
function(){a(this).removeClass("ui-state-hover")})}}})},editGridRow:function(d,b){j=b=a.extend({top:0,left:0,width:300,height:"auto",dataheight:"auto",modal:!1,overlay:10,drag:!0,resize:!0,url:null,mtype:"POST",clearAfterAdd:!0,closeAfterEdit:!1,reloadAfterSubmit:!0,onInitializeForm:null,beforeInitData:null,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:!1,jqModal:!0,
closeOnEscape:!1,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],closeicon:[],savekey:[!1,13],navkeys:[!1,38,40],checkOnSubmit:!1,checkOnUpdate:!1,_savedData:{},processing:!1,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:!0},a.jgrid.edit,b||{});return this.each(function(){function e(){a(".FormElement","#"+u).each(function(){var b=a(".customelement",this);if(b.length){var c=a(b[0]).attr("name");a.each(t.p.colModel,function(){if(this.name===c&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{if(y[c]=
this.editoptions.custom_value(a("#"+a.jgrid.jqID(c),"#"+u),"get"),void 0===y[c])throw"e1";}catch(b){"e1"===b?a.jgrid.info_dialog(m.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,m.jgrid.edit.bClose):a.jgrid.info_dialog(m.jgrid.errors.errcap,b.message,m.jgrid.edit.bClose)}return!0}})}else{switch(a(this).get(0).type){case "checkbox":a(this).attr("checked")?y[this.name]=a(this).val():(b=a(this).attr("offval"),y[this.name]=b);break;case "select-one":y[this.name]=a("option:selected",
this).val();Y[this.name]=a("option:selected",this).text();break;case "select-multiple":y[this.name]=a(this).val();y[this.name]=y[this.name]?y[this.name].join(","):"";var d=[];a("option:selected",this).each(function(b,c){d[b]=a(c).text()});Y[this.name]=d.join(",");break;case "password":case "text":case "textarea":case "button":y[this.name]=a(this).val()}t.p.autoencode&&(y[this.name]=a.jgrid.htmlEncode(y[this.name]))}});return!0}function l(b,c,d,e){var f,g,k=0,l,m,n,o=[],p=!1,q="",r;for(r=1;r<=e;r++)q+=
"<td class='CaptionTD'>&#160;</td><td class='DataTD'>&#160;</td>";"_empty"!=b&&(p=a(c).jqGrid("getInd",b));a(c.p.colModel).each(function(r){f=this.name;m=(this.editrules&&!0===this.editrules.edithidden?0:!0===this.hidden)?"style='display:none'":"";if("cb"!==f&&"subgrid"!==f&&!0===this.editable&&"rn"!==f){if(!1===p)l="";else if(f==c.p.ExpandColumn&&!0===c.p.treeGrid)l=a("td:eq("+r+")",c.rows[p]).text();else try{l=a.unformat(a("td:eq("+r+")",c.rows[p]),{rowId:b,colModel:this},r)}catch(u){l=a("td:eq("+
r+")",c.rows[p]).text()}var v=a.extend({},this.editoptions||{},{id:f,name:f}),x=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:!1,rowcontent:""},this.formoptions||{}),C=parseInt(x.rowpos,10)||k+1,y=parseInt(2*(parseInt(x.colpos,10)||1),10);"_empty"==b&&v.defaultValue&&(l=a.isFunction(v.defaultValue)?v.defaultValue():v.defaultValue);this.edittype||(this.edittype="text");t.p.autoencode&&(l=a.jgrid.htmlDecode(l));n=a.jgrid.createEl(this.edittype,v,l,!1,a.extend({},a.jgrid.ajaxOptions,c.p.ajaxSelectOptions||
{}));""===l&&"checkbox"==this.edittype&&(l=a(n).attr("offval"));""===l&&"select"==this.edittype&&(l=a("option:eq(0)",n).text());if(j.checkOnSubmit||j.checkOnUpdate)j._savedData[f]=l;a(n).addClass("FormElement");("text"==this.edittype||"textarea"==this.edittype)&&a(n).addClass("ui-widget-content ui-corner-all");g=a(d).find("tr[rowpos="+C+"]");x.rowabove&&(v=a("<tr><td class='contentinfo' colspan='"+2*e+"'>"+x.rowcontent+"</td></tr>"),a(d).append(v),v[0].rp=C);0===g.length&&(g=a("<tr "+m+" rowpos='"+
C+"'></tr>").addClass("FormData").attr("id","tr_"+f),a(g).append(q),a(d).append(g),g[0].rp=C);a("td:eq("+(y-2)+")",g[0]).html("undefined"===typeof x.label?c.p.colNames[r]:x.label);a("td:eq("+(y-1)+")",g[0]).append(x.elmprefix).append(n).append(x.elmsuffix);o[k]=r;k++}});if(0<k&&(r=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(2*e-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+c.p.id+"_id' value='"+b+"'/></td></tr>"),r[0].rp=
k+999,a(d).append(r),j.checkOnSubmit||j.checkOnUpdate))j._savedData[c.p.id+"_id"]=b;return o}function g(b,c,d){var e,f=0,g,k,l,n,o;if(j.checkOnSubmit||j.checkOnUpdate)j._savedData={},j._savedData[c.p.id+"_id"]=b;var p=c.p.colModel;if("_empty"==b)a(p).each(function(){e=this.name;l=a.extend({},this.editoptions||{});if((k=a("#"+a.jgrid.jqID(e),"#"+d))&&null!==k[0])if(n="",l.defaultValue?(n=a.isFunction(l.defaultValue)?l.defaultValue():l.defaultValue,"checkbox"==k[0].type?(o=n.toLowerCase(),0>o.search(/(false|0|no|off|undefined)/i)&&
""!==o?(k[0].checked=!0,k[0].defaultChecked=!0,k[0].value=n):k.attr({checked:"",defaultChecked:""})):k.val(n)):"checkbox"==k[0].type?(k[0].checked=!1,k[0].defaultChecked=!1,n=a(k).attr("offval")):k[0].type&&"select"==k[0].type.substr(0,6)?k[0].selectedIndex=0:k.val(n),!0===j.checkOnSubmit||j.checkOnUpdate)j._savedData[e]=n}),a("#id_g","#"+d).val(b);else{var q=a(c).jqGrid("getInd",b,!0);q&&(a("td",q).each(function(k){e=p[k].name;if("cb"!==e&&"subgrid"!==e&&"rn"!==e&&!0===p[k].editable){if(e==c.p.ExpandColumn&&
!0===c.p.treeGrid)g=a(this).text();else try{g=a.unformat(a(this),{rowId:b,colModel:p[k]},k)}catch(l){g=a(this).text()}t.p.autoencode&&(g=a.jgrid.htmlDecode(g));if(!0===j.checkOnSubmit||j.checkOnUpdate)j._savedData[e]=g;e=a.jgrid.jqID(e);switch(p[k].edittype){case "password":case "text":case "button":case "image":a("#"+e,"#"+d).val(g);break;case "textarea":if("&nbsp;"==g||"&#160;"==g||1==g.length&&160==g.charCodeAt(0))g="";a("#"+e,"#"+d).val(g);break;case "select":var n=g.split(","),n=a.map(n,function(b){return a.trim(b)});
a("#"+e+" option","#"+d).each(function(){this.selected=!p[k].editoptions.multiple&&(n[0]==a.trim(a(this).text())||n[0]==a.trim(a(this).val()))?!0:p[k].editoptions.multiple?-1<a.inArray(a.trim(a(this).text()),n)||-1<a.inArray(a.trim(a(this).val()),n)?!0:!1:!1});break;case "checkbox":g+="";p[k].editoptions&&p[k].editoptions.value?p[k].editoptions.value.split(":")[0]==g?(a("#"+e,"#"+d).attr("checked",!0),a("#"+e,"#"+d).attr("defaultChecked",!0)):(a("#"+e,"#"+d).attr("checked",!1),a("#"+e,"#"+d).attr("defaultChecked",
"")):(g=g.toLowerCase(),0>g.search(/(false|0|no|off|undefined)/i)&&""!==g?(a("#"+e,"#"+d).attr("checked",!0),a("#"+e,"#"+d).attr("defaultChecked",!0)):(a("#"+e,"#"+d).attr("checked",!1),a("#"+e,"#"+d).attr("defaultChecked","")));break;case "custom":try{if(p[k].editoptions&&a.isFunction(p[k].editoptions.custom_value))p[k].editoptions.custom_value(a("#"+e,"#"+d),"set",g);else throw"e1";}catch(o){"e1"==o?a.jgrid.info_dialog(m.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,
m.jgrid.edit.bClose):a.jgrid.info_dialog(m.jgrid.errors.errcap,o.message,m.jgrid.edit.bClose)}}f++}}),0<f&&a("#id_g","#"+u).val(b))}}function k(){var c,d=[!0,"",""],e={},f=t.p.prmNames,k,l,m,n;if(a.isFunction(j.beforeCheckValues)){var o=j.beforeCheckValues(y,a("#"+v),"_empty"==y[t.p.id+"_id"]?f.addoper:f.editoper);o&&"object"===typeof o&&(y=o)}for(m in y)if(y.hasOwnProperty(m)&&(d=a.jgrid.checkValues(y[m],m,t),!1===d[0]))break;d[0]&&(a.isFunction(j.onclickSubmit)&&(e=j.onclickSubmit(j,y)||{}),a.isFunction(j.beforeSubmit)&&
(d=j.beforeSubmit(y,a("#"+v))));if(d[0]&&!j.processing){j.processing=!0;a("#sData","#"+u+"_2").addClass("ui-state-active");l=f.oper;k=f.id;y[l]="_empty"==a.trim(y[t.p.id+"_id"])?f.addoper:f.editoper;y[l]!=f.addoper?y[k]=y[t.p.id+"_id"]:void 0===y[k]&&(y[k]=y[t.p.id+"_id"]);delete y[t.p.id+"_id"];y=a.extend(y,j.editData,e);if(!0===t.p.treeGrid)for(i in y[l]==f.addoper&&(n=a(t).jqGrid("getGridParam","selrow"),y["adjacency"==t.p.treeGridModel?t.p.treeReader.parent_id_field:"parent_id"]=n),t.p.treeReader)e=
t.p.treeReader[i],y.hasOwnProperty(e)&&(y[l]==f.addoper&&"parent_id_field"===i||delete y[e]);e=a.extend({url:j.url?j.url:a(t).jqGrid("getGridParam","editurl"),type:j.mtype,data:a.isFunction(j.serializeEditData)?j.serializeEditData(y):y,complete:function(e,m){if(m!="success"){d[0]=false;d[1]=a.isFunction(j.errorTextFormat)?j.errorTextFormat(e):m+" Status: '"+e.statusText+"'. Error code: "+e.status}else a.isFunction(j.afterSubmit)&&(d=j.afterSubmit(e,y));if(d[0]===false){a("#FormError>td","#"+u).html(d[1]);
a("#FormError","#"+u).show()}else{a.each(t.p.colModel,function(){if(Y[this.name]&&this.formatter&&this.formatter=="select")try{delete Y[this.name]}catch(a){}});y=a.extend(y,Y);t.p.autoencode&&a.each(y,function(b,c){y[b]=a.jgrid.htmlDecode(c)});j.reloadAfterSubmit=j.reloadAfterSubmit&&t.p.datatype!="local";if(y[l]==f.addoper){d[2]||(d[2]=a.jgrid.randId());y[k]=d[2];if(j.closeAfterAdd){if(j.reloadAfterSubmit)a(t).trigger("reloadGrid");else if(t.p.treeGrid===true)a(t).jqGrid("addChildNode",d[2],n,y);
else{a(t).jqGrid("addRowData",d[2],y,b.addedrow);a(t).jqGrid("setSelection",d[2])}a.jgrid.hideModal("#"+z.themodal,{gb:"#gbox_"+x,jqm:b.jqModal,onClose:j.onClose})}else if(j.clearAfterAdd){j.reloadAfterSubmit?a(t).trigger("reloadGrid"):t.p.treeGrid===true?a(t).jqGrid("addChildNode",d[2],n,y):a(t).jqGrid("addRowData",d[2],y,b.addedrow);g("_empty",t,v)}else j.reloadAfterSubmit?a(t).trigger("reloadGrid"):t.p.treeGrid===true?a(t).jqGrid("addChildNode",d[2],n,y):a(t).jqGrid("addRowData",d[2],y,b.addedrow)}else{if(j.reloadAfterSubmit){a(t).trigger("reloadGrid");
j.closeAfterEdit||setTimeout(function(){a(t).jqGrid("setSelection",y[k])},1E3)}else t.p.treeGrid===true?a(t).jqGrid("setTreeRow",y[k],y):a(t).jqGrid("setRowData",y[k],y);j.closeAfterEdit&&a.jgrid.hideModal("#"+z.themodal,{gb:"#gbox_"+x,jqm:b.jqModal,onClose:j.onClose})}if(a.isFunction(j.afterComplete)){c=e;setTimeout(function(){j.afterComplete(c,y,a("#"+v));c=null},500)}if(j.checkOnSubmit||j.checkOnUpdate){a("#"+v).data("disabled",false);if(j._savedData[t.p.id+"_id"]!="_empty")for(var o in j._savedData)y[o]&&
(j._savedData[o]=y[o])}}j.processing=false;a("#sData","#"+u+"_2").removeClass("ui-state-active");try{a(":input:visible","#"+v)[0].focus()}catch(p){}}},a.jgrid.ajaxOptions,j.ajaxEditOptions);!e.url&&!j.useDataProxy&&(a.isFunction(t.p.dataProxy)?j.useDataProxy=!0:(d[0]=!1,d[1]+=" "+a.jgrid.errors.nourl));d[0]&&(j.useDataProxy?t.p.dataProxy.call(t,e,"set_"+t.p.id):a.ajax(e))}!1===d[0]&&(a("#FormError>td","#"+u).html(d[1]),a("#FormError","#"+u).show())}function c(a,b){var c=!1,d;for(d in a)if(a[d]!=b[d]){c=
!0;break}return c}function q(){a.each(t.p.colModel,function(a,b){b.editoptions&&!0===b.editoptions.NullIfEmpty&&y.hasOwnProperty(b.name)&&""==y[b.name]&&(y[b.name]="null")})}function n(){var b=!0;a("#FormError","#"+u).hide();j.checkOnUpdate&&(y={},Y={},e(),D=a.extend({},y,Y),c(D,j._savedData)?(a("#"+v).data("disabled",!0),a(".confirm","#"+z.themodal).show(),b=!1):q());return b}function o(){if("_empty"!==d&&"undefined"!==typeof t.p.savedRow&&0<t.p.savedRow.length&&a.isFunction(a.fn.jqGrid.restoreRow))for(var b=
0;b<t.p.savedRow.length;b++)if(t.p.savedRow[b].id==d){a(t).jqGrid("restoreRow",d);break}}function p(b,c){0===b?a("#pData","#"+u+"_2").addClass("ui-state-disabled"):a("#pData","#"+u+"_2").removeClass("ui-state-disabled");b==c?a("#nData","#"+u+"_2").addClass("ui-state-disabled"):a("#nData","#"+u+"_2").removeClass("ui-state-disabled")}function r(){var b=a(t).jqGrid("getDataIDs"),c=a("#id_g","#"+u).val();return[a.inArray(c,b),b]}var t=this;if(t.grid&&d){var x=t.p.id,v="FrmGrid_"+x,u="TblGrid_"+x,z={themodal:"editmod"+
x,modalhead:"edithd"+x,modalcontent:"editcnt"+x,scrollelm:v},C=a.isFunction(j.beforeShowForm)?j.beforeShowForm:!1,F=a.isFunction(j.afterShowForm)?j.afterShowForm:!1,A=a.isFunction(j.beforeInitData)?j.beforeInitData:!1,E=a.isFunction(j.onInitializeForm)?j.onInitializeForm:!1,J=!0,K=1,O=0,y,Y,D;"new"===d?(d="_empty",b.caption=j.addCaption):b.caption=j.editCaption;!0===b.recreateForm&&null!==a("#"+z.themodal).html()&&a("#"+z.themodal).remove();var G=!0;b.checkOnUpdate&&(b.jqModal&&!b.modal)&&(G=!1);
if(null!==a("#"+z.themodal).html()){A&&(J=A(a("#"+v)),"undefined"==typeof J&&(J=!0));if(!1===J)return;o();a(".ui-jqdialog-title","#"+z.modalhead).html(b.caption);a("#FormError","#"+u).hide();j.topinfo?(a(".topinfo","#"+u+"_2").html(j.topinfo),a(".tinfo","#"+u+"_2").show()):a(".tinfo","#"+u+"_2").hide();j.bottominfo?(a(".bottominfo","#"+u+"_2").html(j.bottominfo),a(".binfo","#"+u+"_2").show()):a(".binfo","#"+u+"_2").hide();g(d,t,v);"_empty"==d||!j.viewPagerButtons?a("#pData, #nData","#"+u+"_2").hide():
a("#pData, #nData","#"+u+"_2").show();!0===j.processing&&(j.processing=!1,a("#sData","#"+u+"_2").removeClass("ui-state-active"));!0===a("#"+v).data("disabled")&&(a(".confirm","#"+z.themodal).hide(),a("#"+v).data("disabled",!1));C&&C(a("#"+v));a("#"+z.themodal).data("onClose",j.onClose);a.jgrid.viewModal("#"+z.themodal,{gbox:"#gbox_"+x,jqm:b.jqModal,jqM:!1,overlay:b.overlay,modal:b.modal});G||a(".jqmOverlay").click(function(){if(!n())return false;a.jgrid.hideModal("#"+z.themodal,{gb:"#gbox_"+x,jqm:b.jqModal,
onClose:j.onClose});return false});F&&F(a("#"+v))}else{var N=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px",N=a("<form name='FormPost' id='"+v+"' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:"+N+";'></form>").data("disabled",!1),B=a("<table id='"+u+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");A&&(J=A(a("#"+v)),"undefined"==typeof J&&(J=!0));if(!1===J)return;o();a(t.p.colModel).each(function(){var a=
this.formoptions;K=Math.max(K,a?a.colpos||0:0);O=Math.max(O,a?a.rowpos||0:0)});a(N).append(B);A=a("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+2*K+"'></td></tr>");A[0].rp=0;a(B).append(A);A=a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+2*K+"'>"+j.topinfo+"</td></tr>");A[0].rp=0;a(B).append(A);var J=(A="rtl"==t.p.direction?!0:!1)?"nData":"pData",H=A?"pData":"nData";l(d,t,B,K);var J="<a href='javascript:void(0)' id='"+J+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>",
H="<a href='javascript:void(0)' id='"+H+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>",R="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>",L="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>",J="<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+u+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+
(A?H+J:J+H)+"</td><td class='EditButton'>"+R+L+"</td></tr>"+("<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+j.bottominfo+"</td></tr>"),J=J+"</tbody></table>";if(0<O){var S=[];a.each(a(B)[0].rows,function(a,b){S[a]=b});S.sort(function(a,b){return a.rp>b.rp?1:a.rp<b.rp?-1:0});a.each(S,function(b,c){a("tbody",B).append(c)})}b.gbox="#gbox_"+x;var P=!1;!0===b.closeOnEscape&&(b.closeOnEscape=!1,P=!0);N=a("<span></span>").append(N).append(J);a.jgrid.createModal(z,N,b,"#gview_"+
t.p.id,a("#gbox_"+t.p.id)[0]);A&&(a("#pData, #nData","#"+u+"_2").css("float","right"),a(".EditButton","#"+u+"_2").css("text-align","left"));j.topinfo&&a(".tinfo","#"+u+"_2").show();j.bottominfo&&a(".binfo","#"+u+"_2").show();J=N=null;a("#"+z.themodal).keydown(function(c){var d=c.target;if(a("#"+v).data("disabled")===true)return false;if(j.savekey[0]===true&&c.which==j.savekey[1]&&d.tagName!="TEXTAREA"){a("#sData","#"+u+"_2").trigger("click");return false}if(c.which===27){if(!n())return false;P&&a.jgrid.hideModal(this,
{gb:b.gbox,jqm:b.jqModal,onClose:j.onClose});return false}if(j.navkeys[0]===true){if(a("#id_g","#"+u).val()=="_empty")return true;if(c.which==j.navkeys[1]){a("#pData","#"+u+"_2").trigger("click");return false}if(c.which==j.navkeys[2]){a("#nData","#"+u+"_2").trigger("click");return false}}});b.checkOnUpdate&&(a("a.ui-jqdialog-titlebar-close span","#"+z.themodal).removeClass("jqmClose"),a("a.ui-jqdialog-titlebar-close","#"+z.themodal).unbind("click").click(function(){if(!n())return false;a.jgrid.hideModal("#"+
z.themodal,{gb:"#gbox_"+x,jqm:b.jqModal,onClose:j.onClose});return false}));b.saveicon=a.extend([!0,"left","ui-icon-disk"],b.saveicon);b.closeicon=a.extend([!0,"left","ui-icon-close"],b.closeicon);!0===b.saveicon[0]&&a("#sData","#"+u+"_2").addClass("right"==b.saveicon[1]?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.saveicon[2]+"'></span>");!0===b.closeicon[0]&&a("#cData","#"+u+"_2").addClass("right"==b.closeicon[1]?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+
b.closeicon[2]+"'></span>");if(j.checkOnSubmit||j.checkOnUpdate)R="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bYes+"</a>",H="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bNo+"</a>",L="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+b.bExit+"</a>",N=b.zIndex||999,N++,a("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+
N+";display:none;'>&#160;"+(a.browser.msie&&6==a.browser.version?'<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>':"")+"</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(N+1)+"'>"+b.saveData+"<br/><br/>"+R+H+L+"</div>").insertAfter("#"+v),a("#sNew","#"+z.themodal).click(function(){k();a("#"+v).data("disabled",false);a(".confirm","#"+z.themodal).hide();return false}),a("#nNew","#"+z.themodal).click(function(){a(".confirm",
"#"+z.themodal).hide();a("#"+v).data("disabled",false);setTimeout(function(){a(":input","#"+v)[0].focus()},0);return false}),a("#cNew","#"+z.themodal).click(function(){a(".confirm","#"+z.themodal).hide();a("#"+v).data("disabled",false);a.jgrid.hideModal("#"+z.themodal,{gb:"#gbox_"+x,jqm:b.jqModal,onClose:j.onClose});return false});E&&E(a("#"+v));"_empty"==d||!j.viewPagerButtons?a("#pData,#nData","#"+u+"_2").hide():a("#pData,#nData","#"+u+"_2").show();C&&C(a("#"+v));a("#"+z.themodal).data("onClose",
j.onClose);a.jgrid.viewModal("#"+z.themodal,{gbox:"#gbox_"+x,jqm:b.jqModal,overlay:b.overlay,modal:b.modal});G||a(".jqmOverlay").click(function(){if(!n())return false;a.jgrid.hideModal("#"+z.themodal,{gb:"#gbox_"+x,jqm:b.jqModal,onClose:j.onClose});return false});F&&F(a("#"+v));a(".fm-button","#"+z.themodal).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a("#sData","#"+u+"_2").click(function(){y={};Y={};a("#FormError","#"+u).hide();e();q();
if(y[t.p.id+"_id"]=="_empty")k();else if(b.checkOnSubmit===true){D=a.extend({},y,Y);if(c(D,j._savedData)){a("#"+v).data("disabled",true);a(".confirm","#"+z.themodal).show()}else k()}else k();return false});a("#cData","#"+u+"_2").click(function(){if(!n())return false;a.jgrid.hideModal("#"+z.themodal,{gb:"#gbox_"+x,jqm:b.jqModal,onClose:j.onClose});return false});a("#nData","#"+u+"_2").click(function(){if(!n())return false;a("#FormError","#"+u).hide();var c=r();c[0]=parseInt(c[0],10);if(c[0]!=-1&&c[1][c[0]+
1]){if(a.isFunction(b.onclickPgButtons))b.onclickPgButtons("next",a("#"+v),c[1][c[0]]);g(c[1][c[0]+1],t,v);a(t).jqGrid("setSelection",c[1][c[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",a("#"+v),c[1][c[0]+1]);p(c[0]+1,c[1].length-1)}return false});a("#pData","#"+u+"_2").click(function(){if(!n())return false;a("#FormError","#"+u).hide();var c=r();if(c[0]!=-1&&c[1][c[0]-1]){if(a.isFunction(b.onclickPgButtons))b.onclickPgButtons("prev",a("#"+v),c[1][c[0]]);g(c[1][c[0]-1],
t,v);a(t).jqGrid("setSelection",c[1][c[0]-1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("prev",a("#"+v),c[1][c[0]-1]);p(c[0]-1,c[1].length-1)}return false})}C=r();p(C[0],C[1].length-1)}})},viewGridRow:function(d,b){b=a.extend({top:0,left:0,width:0,height:"auto",dataheight:"auto",modal:!1,overlay:10,drag:!0,resize:!0,jqModal:!0,closeOnEscape:!1,labelswidth:"30%",closeicon:[],navkeys:[!1,38,40],onClose:null,beforeShowForm:null,beforeInitData:null,viewPagerButtons:!0},a.jgrid.view,b||
{});return this.each(function(){function e(){(!0===b.closeOnEscape||!0===b.navkeys[0])&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+r.modalhead).focus()},0)}function j(c,d,e,f){for(var g,k,l,m=0,n,o,p=[],q=!1,r="<td class='CaptionTD form-view-label ui-widget-content' width='"+b.labelswidth+"'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>",t="",u=["integer","number","currency"],v=0,x=0,C,A,F,z=1;z<=f;z++)t+=1==z?r:"<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>";
a(d.p.colModel).each(function(){k=this.editrules&&!0===this.editrules.edithidden?!1:!0===this.hidden?!0:!1;!k&&"right"===this.align&&(this.formatter&&-1!==a.inArray(this.formatter,u)?v=Math.max(v,parseInt(this.width,10)):x=Math.max(x,parseInt(this.width,10)))});C=0!==v?v:0!==x?x:0;q=a(d).jqGrid("getInd",c);a(d.p.colModel).each(function(b){g=this.name;A=!1;o=(k=this.editrules&&!0===this.editrules.edithidden?!1:!0===this.hidden?!0:!1)?"style='display:none'":"";F="boolean"!=typeof this.viewable?!0:this.viewable;
if("cb"!==g&&"subgrid"!==g&&"rn"!==g&&F){n=!1===q?"":g==d.p.ExpandColumn&&!0===d.p.treeGrid?a("td:eq("+b+")",d.rows[q]).text():a("td:eq("+b+")",d.rows[q]).html();A="right"===this.align&&0!==C?!0:!1;a.extend({},this.editoptions||{},{id:g,name:g});var c=a.extend({},{rowabove:!1,rowcontent:""},this.formoptions||{}),j=parseInt(c.rowpos,10)||m+1,r=parseInt(2*(parseInt(c.colpos,10)||1),10);if(c.rowabove){var u=a("<tr><td class='contentinfo' colspan='"+2*f+"'>"+c.rowcontent+"</td></tr>");a(e).append(u);
u[0].rp=j}l=a(e).find("tr[rowpos="+j+"]");0===l.length&&(l=a("<tr "+o+" rowpos='"+j+"'></tr>").addClass("FormData").attr("id","trv_"+g),a(l).append(t),a(e).append(l),l[0].rp=j);a("td:eq("+(r-2)+")",l[0]).html("<b>"+("undefined"===typeof c.label?d.p.colNames[b]:c.label)+"</b>");a("td:eq("+(r-1)+")",l[0]).append("<span>"+n+"</span>").attr("id","v_"+g);A&&a("td:eq("+(r-1)+") span",l[0]).css({"text-align":"right",width:C+"px"});p[m]=b;m++}});0<m&&(c=a("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+
(2*f-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+c+"'/></td></tr>"),c[0].rp=m+99,a(e).append(c));return p}function g(b,c){var d,e,f=0,g,j;if(j=a(c).jqGrid("getInd",b,!0))a("td",j).each(function(b){d=c.p.colModel[b].name;e=c.p.colModel[b].editrules&&!0===c.p.colModel[b].editrules.edithidden?!1:!0===c.p.colModel[b].hidden?!0:!1;"cb"!==d&&("subgrid"!==d&&"rn"!==d)&&(g=d==c.p.ExpandColumn&&!0===c.p.treeGrid?a(this).text():a(this).html(),a.extend({},c.p.colModel[b].editoptions||
{}),d=a.jgrid.jqID("v_"+d),a("#"+d+" span","#"+p).html(g),e&&a("#"+d,"#"+p).parents("tr:first").hide(),f++)}),0<f&&a("#id_g","#"+p).val(b)}function k(b,c){0===b?a("#pData","#"+p+"_2").addClass("ui-state-disabled"):a("#pData","#"+p+"_2").removeClass("ui-state-disabled");b==c?a("#nData","#"+p+"_2").addClass("ui-state-disabled"):a("#nData","#"+p+"_2").removeClass("ui-state-disabled")}function c(){var b=a(m).jqGrid("getDataIDs"),c=a("#id_g","#"+p).val();return[a.inArray(c,b),b]}var m=this;if(m.grid&&
d){b.imgpath||(b.imgpath=m.p.imgpath);var n=m.p.id,o="ViewGrid_"+n,p="ViewTbl_"+n,r={themodal:"viewmod"+n,modalhead:"viewhd"+n,modalcontent:"viewcnt"+n,scrollelm:o},t=a.isFunction(b.beforeInitData)?b.beforeInitData:!1,x=!0,v=1,u=0;if(null!==a("#"+r.themodal).html()){t&&(x=t(a("#"+o)),"undefined"==typeof x&&(x=!0));if(!1===x)return;a(".ui-jqdialog-title","#"+r.modalhead).html(b.caption);a("#FormError","#"+p).hide();g(d,m);a.isFunction(b.beforeShowForm)&&b.beforeShowForm(a("#"+o));a.jgrid.viewModal("#"+
r.themodal,{gbox:"#gbox_"+n,jqm:b.jqModal,jqM:!1,overlay:b.overlay,modal:b.modal});e()}else{var z=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px",z=a("<form name='FormPost' id='"+o+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+z+";'></form>"),C=a("<table id='"+p+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");t&&(x=t(a("#"+o)),"undefined"==typeof x&&(x=!0));if(!1===x)return;a(m.p.colModel).each(function(){var a=
this.formoptions;v=Math.max(v,a?a.colpos||0:0);u=Math.max(u,a?a.rowpos||0:0)});a(z).append(C);j(d,m,C,v);var t="rtl"==m.p.direction?!0:!1,x="<a href='javascript:void(0)' id='"+(t?"nData":"pData")+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",F="<a href='javascript:void(0)' id='"+(t?"pData":"nData")+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",A="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+
b.bClose+"</a>";if(0<u){var E=[];a.each(a(C)[0].rows,function(a,b){E[a]=b});E.sort(function(a,b){return a.rp>b.rp?1:a.rp<b.rp?-1:0});a.each(E,function(b,c){a("tbody",C).append(c)})}b.gbox="#gbox_"+n;var J=!1;!0===b.closeOnEscape&&(b.closeOnEscape=!1,J=!0);z=a("<span></span>").append(z).append("<table border='0' class='EditTable' id='"+p+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+b.labelswidth+"'>"+(t?F+x:x+F)+"</td><td class='EditButton'>"+A+"</td></tr></tbody></table>");a.jgrid.createModal(r,
z,b,"#gview_"+m.p.id,a("#gview_"+m.p.id)[0]);t&&(a("#pData, #nData","#"+p+"_2").css("float","right"),a(".EditButton","#"+p+"_2").css("text-align","left"));b.viewPagerButtons||a("#pData, #nData","#"+p+"_2").hide();z=null;a("#"+r.themodal).keydown(function(c){if(c.which===27){J&&a.jgrid.hideModal(this,{gb:b.gbox,jqm:b.jqModal,onClose:b.onClose});return false}if(b.navkeys[0]===true){if(c.which===b.navkeys[1]){a("#pData","#"+p+"_2").trigger("click");return false}if(c.which===b.navkeys[2]){a("#nData",
"#"+p+"_2").trigger("click");return false}}});b.closeicon=a.extend([!0,"left","ui-icon-close"],b.closeicon);!0===b.closeicon[0]&&a("#cData","#"+p+"_2").addClass("right"==b.closeicon[1]?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.closeicon[2]+"'></span>");a.isFunction(b.beforeShowForm)&&b.beforeShowForm(a("#"+o));a.jgrid.viewModal("#"+r.themodal,{gbox:"#gbox_"+n,jqm:b.jqModal,modal:b.modal});a(".fm-button:not(.ui-state-disabled)","#"+p+"_2").hover(function(){a(this).addClass("ui-state-hover")},
function(){a(this).removeClass("ui-state-hover")});e();a("#cData","#"+p+"_2").click(function(){a.jgrid.hideModal("#"+r.themodal,{gb:"#gbox_"+n,jqm:b.jqModal,onClose:b.onClose});return false});a("#nData","#"+p+"_2").click(function(){a("#FormError","#"+p).hide();var d=c();d[0]=parseInt(d[0],10);if(d[0]!=-1&&d[1][d[0]+1]){if(a.isFunction(b.onclickPgButtons))b.onclickPgButtons("next",a("#"+o),d[1][d[0]]);g(d[1][d[0]+1],m);a(m).jqGrid("setSelection",d[1][d[0]+1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("next",
a("#"+o),d[1][d[0]+1]);k(d[0]+1,d[1].length-1)}e();return false});a("#pData","#"+p+"_2").click(function(){a("#FormError","#"+p).hide();var d=c();if(d[0]!=-1&&d[1][d[0]-1]){if(a.isFunction(b.onclickPgButtons))b.onclickPgButtons("prev",a("#"+o),d[1][d[0]]);g(d[1][d[0]-1],m);a(m).jqGrid("setSelection",d[1][d[0]-1]);a.isFunction(b.afterclickPgButtons)&&b.afterclickPgButtons("prev",a("#"+o),d[1][d[0]-1]);k(d[0]-1,d[1].length-1)}e();return false})}z=c();k(z[0],z[1].length-1)}})},delGridRow:function(d,b){j=
b=a.extend({top:0,left:0,width:240,height:"auto",dataheight:"auto",modal:!1,overlay:10,drag:!0,resize:!0,url:"",mtype:"POST",reloadAfterSubmit:!0,beforeShowForm:null,beforeInitData:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,jqModal:!0,closeOnEscape:!1,delData:{},delicon:[],cancelicon:[],onClose:null,ajaxDelOptions:{},processing:!1,serializeDelData:null,useDataProxy:!1},a.jgrid.del,b||{});return this.each(function(){var e=this;if(e.grid&&d){var l="function"===typeof b.beforeShowForm?
!0:!1,g="function"===typeof b.afterShowForm?!0:!1,k=a.isFunction(b.beforeInitData)?b.beforeInitData:!1,c=e.p.id,q={},n=!0,o="DelTbl_"+c,p,r,t,x,v={themodal:"delmod"+c,modalhead:"delhd"+c,modalcontent:"delcnt"+c,scrollelm:o};m.isArray(d)&&(d=d.join());if(null!==a("#"+v.themodal).html()){k&&(n=k(a("#"+o)),"undefined"==typeof n&&(n=!0));if(!1===n)return;a("#DelData>td","#"+o).text(d);a("#DelError","#"+o).hide();!0===j.processing&&(j.processing=!1,a("#dData","#"+o).removeClass("ui-state-active"));l&&
b.beforeShowForm(a("#"+o));a.jgrid.viewModal("#"+v.themodal,{gbox:"#gbox_"+c,jqm:b.jqModal,jqM:!1,overlay:b.overlay,modal:b.modal})}else{var u=isNaN(b.dataheight)?b.dataheight:b.dataheight+"px",u="<div id='"+o+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+u+";'><table class='DelTable'><tbody><tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>"+("<tr id='DelData' style='display:none'><td >"+d+"</td></tr>"),u=u+('<tr><td class="delmsg" style="white-space:pre;">'+
b.msg+"</td></tr><tr><td >&#160;</td></tr>"),u=u+"</tbody></table></div>"+("<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+o+"_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr></tr><tr><td class='DelButton EditButton'>"+("<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+b.bSubmit+"</a>")+"&#160;"+("<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+b.bCancel+"</a>")+
"</td></tr></tbody></table>");b.gbox="#gbox_"+c;a.jgrid.createModal(v,u,b,"#gview_"+e.p.id,a("#gview_"+e.p.id)[0]);k&&(n=k(a("#"+o)),"undefined"==typeof n&&(n=!0));if(!1===n)return;a(".fm-button","#"+o+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});b.delicon=a.extend([!0,"left","ui-icon-scissors"],b.delicon);b.cancelicon=a.extend([!0,"left","ui-icon-cancel"],b.cancelicon);!0===b.delicon[0]&&a("#dData","#"+o+"_2").addClass("right"==b.delicon[1]?
"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.delicon[2]+"'></span>");!0===b.cancelicon[0]&&a("#eData","#"+o+"_2").addClass("right"==b.cancelicon[1]?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+b.cancelicon[2]+"'></span>");a("#dData","#"+o+"_2").click(function(){var d=[true,""];q={};var g=a("#DelData>td","#"+o).text();typeof b.onclickSubmit==="function"&&(q=b.onclickSubmit(j,g)||{});typeof b.beforeSubmit==="function"&&(d=b.beforeSubmit(g));
if(d[0]&&!j.processing){j.processing=true;a(this).addClass("ui-state-active");t=e.p.prmNames;p=a.extend({},j.delData,q);x=t.oper;p[x]=t.deloper;r=t.id;p[r]=g;var k=a.extend({url:j.url?j.url:a(e).jqGrid("getGridParam","editurl"),type:b.mtype,data:a.isFunction(b.serializeDelData)?b.serializeDelData(p):p,complete:function(k,l){if(l!="success"){d[0]=false;d[1]=a.isFunction(j.errorTextFormat)?j.errorTextFormat(k):l+" Status: '"+k.statusText+"'. Error code: "+k.status}else typeof j.afterSubmit==="function"&&
(d=j.afterSubmit(k,p));if(d[0]===false){a("#DelError>td","#"+o).html(d[1]);a("#DelError","#"+o).show()}else{if(j.reloadAfterSubmit&&e.p.datatype!="local")a(e).trigger("reloadGrid");else{var m=[],m=g.split(",");if(e.p.treeGrid===true)try{a(e).jqGrid("delTreeNode",m[0])}catch(n){}else for(var q=0;q<m.length;q++)a(e).jqGrid("delRowData",m[q]);e.p.selrow=null;e.p.selarrrow=[]}a.isFunction(j.afterComplete)&&setTimeout(function(){j.afterComplete(k,g)},500)}j.processing=false;a("#dData","#"+o+"_2").removeClass("ui-state-active");
d[0]&&a.jgrid.hideModal("#"+v.themodal,{gb:"#gbox_"+c,jqm:b.jqModal,onClose:j.onClose})}},a.jgrid.ajaxOptions,b.ajaxDelOptions);if(!k.url&&!j.useDataProxy)if(a.isFunction(e.p.dataProxy))j.useDataProxy=true;else{d[0]=false;d[1]=d[1]+(" "+a.jgrid.errors.nourl)}d[0]&&(j.useDataProxy?e.p.dataProxy.call(e,k,"del_"+e.p.id):a.ajax(k))}if(d[0]===false){a("#DelError>td","#"+o).html(d[1]);a("#DelError","#"+o).show()}return false});a("#eData","#"+o+"_2").click(function(){a.jgrid.hideModal("#"+v.themodal,{gb:"#gbox_"+
c,jqm:b.jqModal,onClose:j.onClose});return false});l&&b.beforeShowForm(a("#"+o));a.jgrid.viewModal("#"+v.themodal,{gbox:"#gbox_"+c,jqm:b.jqModal,overlay:b.overlay,modal:b.modal})}g&&b.afterShowForm(a("#"+o));!0===b.closeOnEscape&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+v.modalhead).focus()},0)}})},navGrid:function(d,b,e,j,g,k,c){b=a.extend({edit:!0,editicon:"ui-icon-pencil",add:!0,addicon:"ui-icon-plus",del:!0,delicon:"ui-icon-trash",search:!0,searchicon:"ui-icon-search",refresh:!0,
refreshicon:"ui-icon-refresh",refreshstate:"firstpage",view:!1,viewicon:"ui-icon-document",position:"left",closeOnEscape:!0,beforeRefresh:null,afterRefresh:null,cloneToTop:!1},a.jgrid.nav,b||{});return this.each(function(){if(!this.nav){var m={themodal:"alertmod",modalhead:"alerthd",modalcontent:"alertcnt"},n=this,o,p,r;if(n.grid&&"string"==typeof d){null===a("#"+m.themodal).html()&&("undefined"!=typeof window.innerWidth?(o=window.innerWidth,p=window.innerHeight):"undefined"!=typeof document.documentElement&&
"undefined"!=typeof document.documentElement.clientWidth&&0!==document.documentElement.clientWidth?(o=document.documentElement.clientWidth,p=document.documentElement.clientHeight):(o=1024,p=768),a.jgrid.createModal(m,"<div>"+b.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+n.p.id,jqModal:!0,drag:!0,resize:!0,caption:b.alertcap,top:p/2-25,left:o/2-100,width:200,height:"auto",closeOnEscape:b.closeOnEscape},"","",!0));o=1;b.cloneToTop&&n.p.toppager&&
(o=2);for(p=0;p<o;p++){var t=a("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),x,v;0===p?(x=d,v=n.p.id,x==n.p.toppager&&(v+="_top",o=1)):(x=n.p.toppager,v=n.p.id+"_top");"rtl"==n.p.direction&&a(t).attr("dir","rtl").css("float","right");b.add&&(j=j||{},r=a("<td class='ui-pg-button ui-corner-all'></td>"),a(r).append("<div class='ui-pg-div'><span class='ui-icon "+b.addicon+"'></span>"+b.addtext+"</div>"),
a("tr",t).append(r),a(r,t).attr({title:b.addtitle||"",id:j.id||"add_"+v}).click(function(){a(this).hasClass("ui-state-disabled")||(typeof b.addfunc=="function"?b.addfunc():a(n).jqGrid("editGridRow","new",j));return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}),r=null);b.edit&&(r=a("<td class='ui-pg-button ui-corner-all'></td>"),e=e||{},a(r).append("<div class='ui-pg-div'><span class='ui-icon "+
b.editicon+"'></span>"+b.edittext+"</div>"),a("tr",t).append(r),a(r,t).attr({title:b.edittitle||"",id:e.id||"edit_"+v}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var c=n.p.selrow;if(c)typeof b.editfunc=="function"?b.editfunc(c):a(n).jqGrid("editGridRow",c,e);else{a.jgrid.viewModal("#"+m.themodal,{gbox:"#gbox_"+n.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}),
r=null);b.view&&(r=a("<td class='ui-pg-button ui-corner-all'></td>"),c=c||{},a(r).append("<div class='ui-pg-div'><span class='ui-icon "+b.viewicon+"'></span>"+b.viewtext+"</div>"),a("tr",t).append(r),a(r,t).attr({title:b.viewtitle||"",id:c.id||"view_"+v}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var b=n.p.selrow;if(b)a(n).jqGrid("viewGridRow",b,c);else{a.jgrid.viewModal("#"+m.themodal,{gbox:"#gbox_"+n.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||
a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}),r=null);b.del&&(r=a("<td class='ui-pg-button ui-corner-all'></td>"),g=g||{},a(r).append("<div class='ui-pg-div'><span class='ui-icon "+b.delicon+"'></span>"+b.deltext+"</div>"),a("tr",t).append(r),a(r,t).attr({title:b.deltitle||"",id:g.id||"del_"+v}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var c;if(n.p.multiselect){c=n.p.selarrrow;c.length===0&&(c=null)}else c=n.p.selrow;if(c)"function"==typeof b.delfunc?
b.delfunc(c):a(n).jqGrid("delGridRow",c,g);else{a.jgrid.viewModal("#"+m.themodal,{gbox:"#gbox_"+n.p.id,jqm:true});a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}),r=null);(b.add||b.edit||b.del||b.view)&&a("tr",t).append("<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>");b.search&&(r=a("<td class='ui-pg-button ui-corner-all'></td>"),
k=k||{},a(r).append("<div class='ui-pg-div'><span class='ui-icon "+b.searchicon+"'></span>"+b.searchtext+"</div>"),a("tr",t).append(r),a(r,t).attr({title:b.searchtitle||"",id:k.id||"search_"+v}).click(function(){a(this).hasClass("ui-state-disabled")||a(n).jqGrid("searchGrid",k);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}),k.showOnLoad&&!0===k.showOnLoad&&a(r,t).click(),r=null);b.refresh&&
(r=a("<td class='ui-pg-button ui-corner-all'></td>"),a(r).append("<div class='ui-pg-div'><span class='ui-icon "+b.refreshicon+"'></span>"+b.refreshtext+"</div>"),a("tr",t).append(r),a(r,t).attr({title:b.refreshtitle||"",id:"refresh_"+v}).click(function(){if(!a(this).hasClass("ui-state-disabled")){a.isFunction(b.beforeRefresh)&&b.beforeRefresh();n.p.search=false;try{var c=n.p.id;n.p.postData.filters="";a("#fbox_"+c).jqFilter("resetFilter");a.isFunction(n.clearToolbar)&&n.clearToolbar(false)}catch(d){}switch(b.refreshstate){case "firstpage":a(n).trigger("reloadGrid",
[{page:1}]);break;case "current":a(n).trigger("reloadGrid",[{current:true}])}a.isFunction(b.afterRefresh)&&b.afterRefresh()}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}),r=null);r=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+r+";visibility:hidden;' ></div>");r=a(t).clone().appendTo("#testpg2").width();
a("#testpg2").remove();a(x+"_"+b.position,x).append(t);n.p._nvtd&&(r>n.p._nvtd[0]&&(a(x+"_"+b.position,x).width(r),n.p._nvtd[0]=r),n.p._nvtd[1]=r);t=r=r=null;this.nav=!0}}}})},navButtonAdd:function(d,b){b=a.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",onClickButton:null,position:"last",cursor:"pointer"},b||{});return this.each(function(){if(this.grid){0!==d.indexOf("#")&&(d="#"+d);var e=a(".navtable",d)[0],j=this;if(e&&!(b.id&&null!==a("#"+b.id,e).html())){var g=a("<td></td>");
"NONE"==b.buttonicon.toString().toUpperCase()?a(g).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+b.caption+"</div>"):a(g).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+b.buttonicon+"'></span>"+b.caption+"</div>");b.id&&a(g).attr("id",b.id);"first"==b.position?0===e.rows[0].cells.length?a("tr",e).append(g):a("tr td:eq(0)",e).before(g):a("tr",e).append(g);a(g,e).attr("title",b.title||"").click(function(d){a(this).hasClass("ui-state-disabled")||
a.isFunction(b.onClickButton)&&b.onClickButton.call(j,d);return!1}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},navSeparatorAdd:function(d,b){b=a.extend({sepclass:"ui-separator",sepcontent:""},b||{});return this.each(function(){if(this.grid){0!==d.indexOf("#")&&(d="#"+d);var e=a(".navtable",d)[0];if(e){var j="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+b.sepclass+
"'></span>"+b.sepcontent+"</td>";a("tr",e).append(j)}}})},GridToForm:function(d,b){return this.each(function(){if(this.grid){var e=a(this).jqGrid("getRowData",d);if(e)for(var j in e)a("[name="+a.jgrid.jqID(j)+"]",b).is("input:radio")||a("[name="+a.jgrid.jqID(j)+"]",b).is("input:checkbox")?a("[name="+a.jgrid.jqID(j)+"]",b).each(function(){a(this).val()==e[j]?a(this).attr("checked","checked"):a(this).attr("checked","")}):a("[name="+a.jgrid.jqID(j)+"]",b).val(e[j])}})},FormToGrid:function(d,b,e,j){return this.each(function(){if(this.grid){e||
(e="set");j||(j="first");var g=a(b).serializeArray(),k={};a.each(g,function(a,b){k[b.name]=b.value});"add"==e?a(this).jqGrid("addRowData",d,k,j):"set"==e&&a(this).jqGrid("setRowData",d,k)}})}})})(m);(function(a){a.fn.jqFilter=function(e){if("string"===typeof e){var d=a.fn.jqFilter[e];if(!d)throw"jqFilter - No such method: "+e;var b=a.makeArray(arguments).slice(1);return d.apply(this,b)}var f=a.extend(!0,{filter:null,columns:[],onChange:null,checkValues:null,error:!1,errmsg:"",errorcheck:!0,showQuery:!0,
sopt:null,ops:[{name:"eq",description:"equal",operator:"="},{name:"ne",description:"not equal",operator:"<>"},{name:"lt",description:"less",operator:"<"},{name:"le",description:"less or equal",operator:"<="},{name:"gt",description:"greater",operator:">"},{name:"ge",description:"greater or equal",operator:">="},{name:"bw",description:"begins with",operator:"LIKE"},{name:"bn",description:"does not begin with",operator:"NOT LIKE"},{name:"in",description:"in",operator:"IN"},{name:"ni",description:"not in",
operator:"NOT IN"},{name:"ew",description:"ends with",operator:"LIKE"},{name:"en",description:"does not end with",operator:"NOT LIKE"},{name:"cn",description:"contains",operator:"LIKE"},{name:"nc",description:"does not contain",operator:"NOT LIKE"},{name:"nu",description:"is null",operator:"IS NULL"},{name:"nn",description:"is not null",operator:"IS NOT NULL"}],numopts:"eq ne lt le gt ge nu nn in ni".split(" "),stropts:"eq ne bw bn ew en cn nc nu nn in ni".split(" "),_gridsopt:[],groupOps:["AND",
"OR"],groupButton:!0},e||{});return this.each(function(){if(!this.filter){this.p=f;if(null===this.p.filter||void 0===this.p.filter)this.p.filter={groupOp:this.p.groupOps[0],rules:[],groups:[]};var b,d=this.p.columns.length,e,c=/msie/i.test(navigator.userAgent)&&!window.opera;if(this.p._gridsopt.length)for(b=0;b<this.p._gridsopt.length;b++)this.p.ops[b].description=this.p._gridsopt[b];this.p.initFilter=a.extend(!0,{},this.p.filter);if(d){for(b=0;b<d;b++)if(e=this.p.columns[b],e.stype?e.inputtype=e.stype:
e.inputtype||(e.inputtype="text"),e.sorttype?e.searchtype=e.sorttype:e.searchtype||(e.searchtype="string"),void 0===e.hidden&&(e.hidden=!1),e.label||(e.label=e.name),e.index&&(e.name=e.index),e.hasOwnProperty("searchoptions")||(e.searchoptions={}),!e.hasOwnProperty("searchrules"))e.searchrules={};this.p.showQuery&&a(this).append("<table class='queryresult ui-widget ui-widget-content' style='display:block;max-width:440px;border:0px none;'><tbody><tr><td class='query'></td></tr></tbody></table>");var j=
function(b,c){var d=[!0,""];if(a.isFunction(c.searchrules))d=c.searchrules(b,c);else if(a.jgrid&&a.jgrid.checkValues)try{d=a.jgrid.checkValues(b,-1,null,c.searchrules,c.label)}catch(e){}d&&(d.length&&!1===d[0])&&(f.error=!d[0],f.errmsg=d[1])};this.onchange=function(){this.p.error=!1;this.p.errmsg="";return a.isFunction(this.p.onChange)?this.p.onChange.call(this,this.p):!1};this.reDraw=function(){a("table.group:first",this).remove();var b=this.createTableForGroup(f.filter,null);a(this).append(b)};
this.createTableForGroup=function(b,c){var d=this,e,g=a("<table class='group ui-widget ui-widget-content' style='border:0px none;'><tbody></tbody></table>");null===c&&a(g).append("<tr class='error' style='display:none;'><th colspan='5' class='ui-state-error' align='left'></th></tr>");var j=a("<tr></tr>");a(g).append(j);var k=a("<th colspan='5' align='left'></th>");j.append(k);var l=a("<select class='opsel'></select>");k.append(l);var j="",m;for(e=0;e<f.groupOps.length;e++)m=b.groupOp===d.p.groupOps[e]?
" selected='selected'":"",j+="<option value='"+d.p.groupOps[e]+"'"+m+">"+d.p.groupOps[e]+"</option>";l.append(j).bind("change",function(){b.groupOp=a(l).val();d.onchange()});j="<span></span>";this.p.groupButton&&(j=a("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>"),j.bind("click",function(){void 0===b.groups&&(b.groups=[]);b.groups.push({groupOp:f.groupOps[0],rules:[],groups:[]});d.reDraw();d.onchange();return!1}));k.append(j);var j=a("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>"),
q;j.bind("click",function(){if(b.rules===void 0)b.rules=[];for(e=0;e<d.p.columns.length;e++){var a=typeof d.p.columns[e].search==="undefined"?true:d.p.columns[e].search,c=d.p.columns[e].hidden===true;if(d.p.columns[e].searchoptions.searchhidden===true&&a||a&&!c){q=d.p.columns[e];break}}b.rules.push({field:q.name,op:(q.searchoptions.sopt?q.searchoptions.sopt:d.p.sopt?d.p.sopt:q.searchtype==="string"?d.p.stropts:d.p.numopts)[0],data:""});d.reDraw();return false});k.append(j);null!==c&&(j=a("<input type='button' value='-' title='Delete group' class='delete-group'/>"),
k.append(j),j.bind("click",function(){for(e=0;e<c.groups.length;e++)if(c.groups[e]===b){c.groups.splice(e,1);break}d.reDraw();d.onchange();return false}));if(void 0!==b.groups)for(e=0;e<b.groups.length;e++)k=a("<tr></tr>"),g.append(k),j=a("<td class='first'></td>"),k.append(j),j=a("<td colspan='4'></td>"),j.append(this.createTableForGroup(b.groups[e],b)),k.append(j);void 0===b.groupOp&&(b.groupOp=d.p.groupOps[0]);if(void 0!==b.rules)for(e=0;e<b.rules.length;e++)g.append(this.createTableRowForRule(b.rules[e],
b));return g};this.createTableRowForRule=function(b,d){var e=this,g=a("<tr></tr>"),j,k,l,m,q="",C;g.append("<td class='first'></td>");var F=a("<td class='columns'></td>");g.append(F);var A=a("<select></select>");F.append(A);A.bind("change",function(){b.field=a(A).val();l=a(this).parents("tr:first");for(j=0;j<e.p.columns.length;j++)if(e.p.columns[j].name===b.field){m=e.p.columns[j];break}if(m){m.searchoptions.id=a.jgrid.randId();c&&"text"===m.inputtype&&!m.searchoptions.size&&(m.searchoptions.size=
10);var d=a.jgrid.createEl(m.inputtype,m.searchoptions,"",!0,e.p.ajaxSelectOptions,!0);a(d).addClass("input-elm");k=m.searchoptions.sopt?m.searchoptions.sopt:e.p.sopt?e.p.sopt:"string"===m.searchtype?e.p.stropts:e.p.numopts;var f="",g="";for(j=0;j<e.p.ops.length;j++)-1!==a.inArray(e.p.ops[j].name,k)&&(g=b.op===e.p.ops[j].name?" selected=selected":"",f+="<option value='"+e.p.ops[j].name+"'"+g+">"+e.p.ops[j].description+"</option>");a(".selectopts",l).empty().append(f);a(".data",l).empty().append(d);
a(".input-elm",l).bind("change",function(){b.data=a(this).val();if(a.isArray(b.data))b.data=b.data.join(",");e.onchange()});setTimeout(function(){b.data=a(d).val();e.onchange()},0)}});for(j=F=0;j<e.p.columns.length;j++){C="undefined"===typeof e.p.columns[j].search?!0:e.p.columns[j].search;var E=!0===e.p.columns[j].hidden;if(!0===e.p.columns[j].searchoptions.searchhidden&&C||C&&!E)C="",b.field===e.p.columns[j].name&&(C=" selected='selected'",F=j),q+="<option value='"+e.p.columns[j].name+"'"+C+">"+
e.p.columns[j].label+"</option>"}A.append(q);q=a("<td class='operators'></td>");g.append(q);m=f.columns[F];m.searchoptions.id=a.jgrid.randId();c&&"text"===m.inputtype&&!m.searchoptions.size&&(m.searchoptions.size=10);var F=a.jgrid.createEl(m.inputtype,m.searchoptions,b.data,!0,e.p.ajaxSelectOptions,!0),J=a("<select class='selectopts'></select>");q.append(J);J.bind("change",function(){b.op=a(J).val();l=a(this).parents("tr:first");var c=a(".input-elm",l)[0];if(b.op==="nu"||b.op==="nn"){b.data="";c.value=
"";c.setAttribute("readonly","true");c.setAttribute("disabled","true")}else{c.removeAttribute("readonly");c.removeAttribute("disabled")}e.onchange()});k=m.searchoptions.sopt?m.searchoptions.sopt:e.p.sopt?e.p.sopt:"string"===m.searchtype?f.stropts:e.p.numopts;q="";for(j=0;j<e.p.ops.length;j++)-1!==a.inArray(e.p.ops[j].name,k)&&(C=b.op===e.p.ops[j].name?" selected='selected'":"",q+="<option value='"+e.p.ops[j].name+"'"+C+">"+e.p.ops[j].description+"</option>");J.append(q);q=a("<td class='data'></td>");
g.append(q);q.append(F);a(F).addClass("input-elm").bind("change",function(){b.data=a(this).val();if(a.isArray(b.data))b.data=b.data.join(",");e.onchange()});q=a("<td></td>");g.append(q);F=a("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>");q.append(F);F.bind("click",function(){for(j=0;j<d.rules.length;j++)if(d.rules[j]===b){d.rules.splice(j,1);break}e.reDraw();e.onchange();return false});return g};this.getStringForGroup=function(a){var b="(",c;if(void 0!==a.groups)for(c=
0;c<a.groups.length;c++){1<b.length&&(b+=" "+a.groupOp+" ");try{b+=this.getStringForGroup(a.groups[c])}catch(d){alert(d)}}if(void 0!==a.rules)try{for(c=0;c<a.rules.length;c++)1<b.length&&(b+=" "+a.groupOp+" "),b+=this.getStringForRule(a.rules[c])}catch(e){alert(e)}b+=")";return"()"===b?"":b};this.getStringForRule=function(b){var c="",d="",e,g;for(e=0;e<this.p.ops.length;e++)if(this.p.ops[e].name===b.op){c=this.p.ops[e].operator;d=this.p.ops[e].name;break}for(e=0;e<this.p.columns.length;e++)if(this.p.columns[e].name===
b.field){g=this.p.columns[e];break}e=b.data;if("bw"===d||"bn"===d)e+="%";if("ew"===d||"en"===d)e="%"+e;if("cn"===d||"nc"===d)e="%"+e+"%";if("in"===d||"ni"===d)e=" ("+e+")";f.errorcheck&&j(b.data,g);return-1!==a.inArray(g.searchtype,["int","integer","float","number","currency"])||"nn"===d||"nu"===d?b.field+" "+c+" "+e:b.field+" "+c+' "'+e+'"'};this.resetFilter=function(){this.p.filter=a.extend(!0,{},this.p.initFilter);this.reDraw();this.onchange()};this.hideError=function(){a("th.ui-state-error",this).html("");
a("tr.error",this).hide()};this.showError=function(){a("th.ui-state-error",this).html(this.p.errmsg);a("tr.error",this).show()};this.toUserFriendlyString=function(){return this.getStringForGroup(f.filter)};this.toString=function(){function a(c){var d="(",e;if(void 0!==c.groups)for(e=0;e<c.groups.length;e++)1<d.length&&(d+="OR"===c.groupOp?" || ":" && "),d+=a(c.groups[e]);if(void 0!==c.rules)for(e=0;e<c.rules.length;e++){1<d.length&&(d+="OR"===c.groupOp?" || ":" && ");var f=c.rules[e];if(b.p.errorcheck){for(var g=
void 0,k=void 0,g=0;g<b.p.columns.length;g++)if(b.p.columns[g].name===f.field){k=b.p.columns[g];break}k&&j(f.data,k)}d+=f.op+"(item."+f.field+",'"+f.data+"')"}d+=")";return"()"===d?"":d}var b=this;return a(this.p.filter)};this.reDraw();if(this.p.showQuery)this.onchange();this.filter=!0}}})};a.extend(a.fn.jqFilter,{toSQLString:function(){var a="";this.each(function(){a=this.toUserFriendlyString()});return a},filterData:function(){var a;this.each(function(){a=this.p.filter});return a},getParameter:function(a){return void 0!==
a&&this.p.hasOwnProperty(a)?this.p[a]:this.p},resetFilter:function(){return this.each(function(){this.resetFilter()})},addFilter:function(a){"string"===typeof a&&(a=m.jgrid.parse(a));this.each(function(){this.p.filter=a;this.reDraw();this.onchange()})}})})(m);(function(a){a.jgrid.extend({editRow:function(e,d,b,f,l,g,k,c,m){var n={keys:d||!1,oneditfunc:b||null,successfunc:f||null,url:l||null,extraparam:g||{},aftersavefunc:k||null,errorfunc:c||null,afterrestorefunc:m||null,restoreAfterErorr:!0},o=a.makeArray(arguments).slice(1),
p;p=o[0]&&"object"==typeof o[0]&&!a.isFunction(o[0])?a.extend(n,o[0]):n;return this.each(function(){var b=this,c,d,f=0,g=null,k={},l,n;if(b.grid&&(l=a(b).jqGrid("getInd",e,!0),!1!==l&&"0"==(a(l).attr("editable")||"0")&&!a(l).hasClass("not-editable-row")))n=b.p.colModel,a("td",l).each(function(l){c=n[l].name;var m=!0===b.p.treeGrid&&c==b.p.ExpandColumn;if(m)d=a("span:first",this).html();else try{d=a.unformat(this,{rowId:e,colModel:n[l]},l)}catch(o){d=a(this).html()}if("cb"!=c&&("subgrid"!=c&&"rn"!=
c)&&(b.p.autoencode&&(d=a.jgrid.htmlDecode(d)),k[c]=d,!0===n[l].editable)){null===g&&(g=l);m?a("span:first",this).html(""):a(this).html("");var q=a.extend({},n[l].editoptions||{},{id:e+"_"+c,name:c});n[l].edittype||(n[l].edittype="text");q=a.jgrid.createEl(n[l].edittype,q,d,!0,a.extend({},a.jgrid.ajaxOptions,b.p.ajaxSelectOptions||{}));a(q).addClass("editable");m?a("span:first",this).append(q):a(this).append(q);"select"==n[l].edittype&&!0===n[l].editoptions.multiple&&a.browser.msie&&a(q).width(a(q).width());
f++}}),0<f&&(k.id=e,b.p.savedRow.push(k),a(l).attr("editable","1"),a("td:eq("+g+") input",l).focus(),!0===p.keys&&a(l).bind("keydown",function(c){27===c.keyCode&&a(b).jqGrid("restoreRow",e,m);if(13===c.keyCode){if("TEXTAREA"==c.target.tagName)return!0;a(b).jqGrid("saveRow",e,p);return!1}c.stopPropagation()}),a.isFunction(p.oneditfunc)&&p.oneditfunc.call(b,e))})},saveRow:function(e,d,b,f,l,g,k){var c={successfunc:d||null,url:b||null,extraparam:f||{},aftersavefunc:l||null,errorfunc:g||null,afterrestorefunc:k||
null,restoreAfterErorr:!0},q=a.makeArray(arguments).slice(1),n;n=q[0]&&"object"==typeof q[0]&&!a.isFunction(q[0])?a.extend(c,q[0]):c;var o=!1,p=this[0],r,t={},x={},v={},u,z,C;if(!p.grid)return o;C=a(p).jqGrid("getInd",e,!0);if(!1===C)return o;c=a(C).attr("editable");n.url=n.url?n.url:p.p.editurl;if("1"===c){var F;a("td",C).each(function(b){F=p.p.colModel[b];r=F.name;if("cb"!=r&&"subgrid"!=r&&!0===F.editable&&"rn"!=r&&!a(this).hasClass("not-editable-cell")){switch(F.edittype){case "checkbox":var c=
["Yes","No"];F.editoptions&&(c=F.editoptions.value.split(":"));t[r]=a("input",this).attr("checked")?c[0]:c[1];break;case "text":case "password":case "textarea":case "button":t[r]=a("input, textarea",this).val();break;case "select":if(F.editoptions.multiple){var c=a("select",this),d=[];t[r]=a(c).val();t[r]=t[r]?t[r].join(","):"";a("select > option:selected",this).each(function(b,c){d[b]=a(c).text()});x[r]=d.join(",")}else t[r]=a("select>option:selected",this).val(),x[r]=a("select>option:selected",
this).text();F.formatter&&"select"==F.formatter&&(x={});break;case "custom":try{if(F.editoptions&&a.isFunction(F.editoptions.custom_value)){if(t[r]=F.editoptions.custom_value.call(p,a(".customelement",this),"get"),void 0===t[r])throw"e2";}else throw"e1";}catch(e){"e1"==e&&a.jgrid.info_dialog(m.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,m.jgrid.edit.bClose),"e2"==e?a.jgrid.info_dialog(m.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,m.jgrid.edit.bClose):
a.jgrid.info_dialog(m.jgrid.errors.errcap,e.message,m.jgrid.edit.bClose)}}z=a.jgrid.checkValues(t[r],b,p);if(!1===z[0])return z[1]=t[r]+" "+z[1],!1;p.p.autoencode&&(t[r]=a.jgrid.htmlEncode(t[r]));"clientArray"!==n.url&&F.editoptions&&!0===F.editoptions.NullIfEmpty&&""==t[r]&&(v[r]="null")}});if(!1===z[0]){try{var A=a.jgrid.findPos(a("#"+a.jgrid.jqID(e),p.grid.bDiv)[0]);a.jgrid.info_dialog(a.jgrid.errors.errcap,z[1],a.jgrid.edit.bClose,{left:A[0],top:A[1]})}catch(E){alert(z[1])}return o}t&&(c=p.p.prmNames,
q=c.oper,A=c.id,t[q]=c.editoper,t[A]=e,"undefined"==typeof p.p.inlineData&&(p.p.inlineData={}),t=a.extend({},t,p.p.inlineData,n.extraparam));if("clientArray"==n.url){t=a.extend({},t,x);p.p.autoencode&&a.each(t,function(b,c){t[b]=a.jgrid.htmlDecode(c)});A=a(p).jqGrid("setRowData",e,t);a(C).attr("editable","0");for(c=0;c<p.p.savedRow.length;c++)if(p.p.savedRow[c].id==e){u=c;break}0<=u&&p.p.savedRow.splice(u,1);a.isFunction(n.aftersavefunc)&&n.aftersavefunc.call(p,e,A);o=!0}else a("#lui_"+p.p.id).show(),
v=a.extend({},t,v),a.ajax(a.extend({url:n.url,data:a.isFunction(p.p.serializeRowData)?p.p.serializeRowData.call(p,v):v,type:"POST",async:!1,complete:function(b,c){a("#lui_"+p.p.id).hide();if(c==="success")if((a.isFunction(n.succesfunc)?n.succesfunc.call(p,b):true)===true){p.p.autoencode&&a.each(t,function(b,c){t[b]=a.jgrid.htmlDecode(c)});t=a.extend({},t,x);a(p).jqGrid("setRowData",e,t);a(C).attr("editable","0");for(var d=0;d<p.p.savedRow.length;d++)if(p.p.savedRow[d].id==e){u=d;break}u>=0&&p.p.savedRow.splice(u,
1);a.isFunction(n.aftersavefunc)&&n.aftersavefunc.call(p,e,b);o=true}else{a.isFunction(n.errorfunc)&&n.errorfunc.call(p,e,b,c);n.restoreAfterError===true&&a(p).jqGrid("restoreRow",e,n.afterrestorefunc)}},error:function(b,c){a("#lui_"+p.p.id).hide();if(a.isFunction(n.errorfunc))n.errorfunc.call(p,e,b,c);else try{m.jgrid.info_dialog(m.jgrid.errors.errcap,'<div class="ui-state-error">'+b.responseText+"</div>",m.jgrid.edit.bClose,{buttonalign:"right"})}catch(d){alert(b.responseText)}n.restoreAfterError===
true&&a(p).jqGrid("restoreRow",e,n.afterrestorefunc)}},a.jgrid.ajaxOptions,p.p.ajaxRowOptions||{}));a(C).unbind("keydown")}return o},restoreRow:function(e,d){return this.each(function(){var b=this,f,l,g={};if(b.grid&&(l=a(b).jqGrid("getInd",e,!0),!1!==l)){for(var k=0;k<b.p.savedRow.length;k++)if(b.p.savedRow[k].id==e){f=k;break}if(0<=f){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker","#"+a.jgrid.jqID(l.id)).datepicker("hide")}catch(c){}a.each(b.p.colModel,function(){!0===this.editable&&
(this.name in b.p.savedRow[f]&&!a(this).hasClass("not-editable-cell"))&&(g[this.name]=b.p.savedRow[f][this.name])});a(b).jqGrid("setRowData",e,g);a(l).attr("editable","0").unbind("keydown");b.p.savedRow.splice(f,1)}a.isFunction(d)&&d.call(b,e)}})}})})(m);(function(a){a.jgrid.extend({editCell:function(e,d,b){return this.each(function(){var f=this,l,g,k;if(f.grid&&!0===f.p.cellEdit){d=parseInt(d,10);f.p.selrow=f.rows[e].id;f.p.knv||a(f).jqGrid("GridNav");if(0<f.p.savedRow.length){if(!0===b&&e==f.p.iRow&&
d==f.p.iCol)return;a(f).jqGrid("saveCell",f.p.savedRow[0].id,f.p.savedRow[0].ic)}else window.setTimeout(function(){a("#"+f.p.knv).attr("tabindex","-1").focus()},0);l=f.p.colModel[d].name;if(!("subgrid"==l||"cb"==l||"rn"==l)){k=a("td:eq("+d+")",f.rows[e]);if(!0===f.p.colModel[d].editable&&!0===b&&!k.hasClass("not-editable-cell")){0<=parseInt(f.p.iCol,10)&&0<=parseInt(f.p.iRow,10)&&(a("td:eq("+f.p.iCol+")",f.rows[f.p.iRow]).removeClass("edit-cell ui-state-highlight"),a(f.rows[f.p.iRow]).removeClass("selected-row ui-state-hover"));
a(k).addClass("edit-cell ui-state-highlight");a(f.rows[e]).addClass("selected-row ui-state-hover");try{g=a.unformat(k,{rowId:f.rows[e].id,colModel:f.p.colModel[d]},d)}catch(c){g=a(k).html()}f.p.autoencode&&(g=a.jgrid.htmlDecode(g));f.p.colModel[d].edittype||(f.p.colModel[d].edittype="text");f.p.savedRow.push({id:e,ic:d,name:l,v:g});if(a.isFunction(f.p.formatCell)){var m=f.p.formatCell.call(f,f.rows[e].id,l,g,e,d);void 0!==m&&(g=m)}var m=a.extend({},f.p.colModel[d].editoptions||{},{id:e+"_"+l,name:l}),
n=a.jgrid.createEl(f.p.colModel[d].edittype,m,g,!0,a.extend({},a.jgrid.ajaxOptions,f.p.ajaxSelectOptions||{}));a.isFunction(f.p.beforeEditCell)&&f.p.beforeEditCell.call(f,f.rows[e].id,l,g,e,d);a(k).html("").append(n).attr("tabindex","0");window.setTimeout(function(){a(n).focus()},0);a("input, select, textarea",k).bind("keydown",function(b){b.keyCode===27&&(a("input.hasDatepicker",k).length>0?a(".ui-datepicker").is(":hidden")?a(f).jqGrid("restoreCell",e,d):a("input.hasDatepicker",k).datepicker("hide"):
a(f).jqGrid("restoreCell",e,d));b.keyCode===13&&a(f).jqGrid("saveCell",e,d);if(b.keyCode==9){if(f.grid.hDiv.loading)return false;b.shiftKey?a(f).jqGrid("prevCell",e,d):a(f).jqGrid("nextCell",e,d)}b.stopPropagation()});a.isFunction(f.p.afterEditCell)&&f.p.afterEditCell.call(f,f.rows[e].id,l,g,e,d)}else if(0<=parseInt(f.p.iCol,10)&&0<=parseInt(f.p.iRow,10)&&(a("td:eq("+f.p.iCol+")",f.rows[f.p.iRow]).removeClass("edit-cell ui-state-highlight"),a(f.rows[f.p.iRow]).removeClass("selected-row ui-state-hover")),
k.addClass("edit-cell ui-state-highlight"),a(f.rows[e]).addClass("selected-row ui-state-hover"),a.isFunction(f.p.onSelectCell))g=k.html().replace(/\&#160\;/ig,""),f.p.onSelectCell.call(f,f.rows[e].id,l,g,e,d);f.p.iCol=d;f.p.iRow=e}}})},saveCell:function(e,d){return this.each(function(){var b=this,f;if(b.grid&&!0===b.p.cellEdit){f=1<=b.p.savedRow.length?0:null;if(null!==f){var l=a("td:eq("+d+")",b.rows[e]),g,k,c=b.p.colModel[d],q=c.name,n=a.jgrid.jqID(q);switch(c.edittype){case "select":if(c.editoptions.multiple){var n=
a("#"+e+"_"+n,b.rows[e]),o=[];(g=a(n).val())?g.join(","):g="";a("option:selected",n).each(function(b,c){o[b]=a(c).text()});k=o.join(",")}else g=a("#"+e+"_"+n+">option:selected",b.rows[e]).val(),k=a("#"+e+"_"+n+">option:selected",b.rows[e]).text();c.formatter&&(k=g);break;case "checkbox":var p=["Yes","No"];c.editoptions&&(p=c.editoptions.value.split(":"));k=g=a("#"+e+"_"+n,b.rows[e]).attr("checked")?p[0]:p[1];break;case "password":case "text":case "textarea":case "button":k=g=a("#"+e+"_"+n,b.rows[e]).val();
break;case "custom":try{if(c.editoptions&&a.isFunction(c.editoptions.custom_value)){g=c.editoptions.custom_value.call(b,a(".customelement",l),"get");if(void 0===g)throw"e2";k=g}else throw"e1";}catch(r){"e1"==r&&a.jgrid.info_dialog(m.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,m.jgrid.edit.bClose),"e2"==r?a.jgrid.info_dialog(m.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,m.jgrid.edit.bClose):a.jgrid.info_dialog(m.jgrid.errors.errcap,r.message,
m.jgrid.edit.bClose)}}if(k!=b.p.savedRow[f].v){if(a.isFunction(b.p.beforeSaveCell)&&(f=b.p.beforeSaveCell.call(b,b.rows[e].id,q,g,e,d)))k=g=f;var t=a.jgrid.checkValues(g,d,b);if(!0===t[0]){f={};a.isFunction(b.p.beforeSubmitCell)&&((f=b.p.beforeSubmitCell.call(b,b.rows[e].id,q,g,e,d))||(f={}));0<a("input.hasDatepicker",l).length&&a("input.hasDatepicker",l).datepicker("hide");if("remote"==b.p.cellsubmit)if(b.p.cellurl){var x={};b.p.autoencode&&(g=a.jgrid.htmlEncode(g));x[q]=g;p=b.p.prmNames;c=p.id;
n=p.oper;x[c]=b.rows[e].id;x[n]=p.editoper;x=a.extend(f,x);a("#lui_"+b.p.id).show();b.grid.hDiv.loading=!0;a.ajax(a.extend({url:b.p.cellurl,data:a.isFunction(b.p.serializeCellData)?b.p.serializeCellData.call(b,x):x,type:"POST",complete:function(c,f){a("#lui_"+b.p.id).hide();b.grid.hDiv.loading=!1;if("success"==f)if(a.isFunction(b.p.afterSubmitCell)){var m=b.p.afterSubmitCell.call(b,c,x.id,q,g,e,d);!0===m[0]?(a(l).empty(),a(b).jqGrid("setCell",b.rows[e].id,d,k,!1,!1,!0),a(l).addClass("dirty-cell"),
a(b.rows[e]).addClass("edited"),a.isFunction(b.p.afterSaveCell)&&b.p.afterSaveCell.call(b,b.rows[e].id,q,g,e,d),b.p.savedRow.splice(0,1)):(a.jgrid.info_dialog(a.jgrid.errors.errcap,m[1],a.jgrid.edit.bClose),a(b).jqGrid("restoreCell",e,d))}else a(l).empty(),a(b).jqGrid("setCell",b.rows[e].id,d,k,!1,!1,!0),a(l).addClass("dirty-cell"),a(b.rows[e]).addClass("edited"),a.isFunction(b.p.afterSaveCell)&&b.p.afterSaveCell.call(b,b.rows[e].id,q,g,e,d),b.p.savedRow.splice(0,1)},error:function(c,f){a("#lui_"+
b.p.id).hide();b.grid.hDiv.loading=!1;a.isFunction(b.p.errorCell)?b.p.errorCell.call(b,c,f):a.jgrid.info_dialog(a.jgrid.errors.errcap,c.status+" : "+c.statusText+"<br/>"+f,a.jgrid.edit.bClose);a(b).jqGrid("restoreCell",e,d)}},a.jgrid.ajaxOptions,b.p.ajaxCellOptions||{}))}else try{a.jgrid.info_dialog(a.jgrid.errors.errcap,a.jgrid.errors.nourl,a.jgrid.edit.bClose),a(b).jqGrid("restoreCell",e,d)}catch(v){}"clientArray"==b.p.cellsubmit&&(a(l).empty(),a(b).jqGrid("setCell",b.rows[e].id,d,k,!1,!1,!0),a(l).addClass("dirty-cell"),
a(b.rows[e]).addClass("edited"),a.isFunction(b.p.afterSaveCell)&&b.p.afterSaveCell.call(b,b.rows[e].id,q,g,e,d),b.p.savedRow.splice(0,1))}else try{window.setTimeout(function(){a.jgrid.info_dialog(a.jgrid.errors.errcap,g+" "+t[1],a.jgrid.edit.bClose)},100),a(b).jqGrid("restoreCell",e,d)}catch(u){}}else a(b).jqGrid("restoreCell",e,d)}a.browser.opera?a("#"+b.p.knv).attr("tabindex","-1").focus():window.setTimeout(function(){a("#"+b.p.knv).attr("tabindex","-1").focus()},0)}})},restoreCell:function(e,d){return this.each(function(){var b=
this,f;if(b.grid&&!0===b.p.cellEdit){f=1<=b.p.savedRow.length?0:null;if(null!==f){var l=a("td:eq("+d+")",b.rows[e]);if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker",l).datepicker("hide")}catch(g){}a(l).empty().attr("tabindex","-1");a(b).jqGrid("setCell",b.rows[e].id,d,b.p.savedRow[f].v,!1,!1,!0);a.isFunction(b.p.afterRestoreCell)&&b.p.afterRestoreCell.call(b,b.rows[e].id,b.p.savedRow[f].v,e,d);b.p.savedRow.splice(0,1)}window.setTimeout(function(){a("#"+b.p.knv).attr("tabindex","-1").focus()},
0)}})},nextCell:function(e,d){return this.each(function(){var b=!1;if(this.grid&&!0===this.p.cellEdit){for(var f=d+1;f<this.p.colModel.length;f++)if(!0===this.p.colModel[f].editable){b=f;break}!1!==b?a(this).jqGrid("editCell",e,b,!0):0<this.p.savedRow.length&&a(this).jqGrid("saveCell",e,d)}})},prevCell:function(e,d){return this.each(function(){var b=!1;if(this.grid&&!0===this.p.cellEdit){for(var f=d-1;0<=f;f--)if(!0===this.p.colModel[f].editable){b=f;break}!1!==b?a(this).jqGrid("editCell",e,b,!0):
0<this.p.savedRow.length&&a(this).jqGrid("saveCell",e,d)}})},GridNav:function(){return this.each(function(){function e(d,c,f){if("v"==f.substr(0,1)){var g=a(b.grid.bDiv)[0].clientHeight,j=a(b.grid.bDiv)[0].scrollTop,l=b.rows[d].offsetTop+b.rows[d].clientHeight,m=b.rows[d].offsetTop;"vd"==f&&l>=g&&(a(b.grid.bDiv)[0].scrollTop=a(b.grid.bDiv)[0].scrollTop+b.rows[d].clientHeight);"vu"==f&&m<j&&(a(b.grid.bDiv)[0].scrollTop=a(b.grid.bDiv)[0].scrollTop-b.rows[d].clientHeight)}"h"==f&&(f=a(b.grid.bDiv)[0].clientWidth,
g=a(b.grid.bDiv)[0].scrollLeft,j=b.rows[d].cells[c].offsetLeft,b.rows[d].cells[c].offsetLeft+b.rows[d].cells[c].clientWidth>=f+parseInt(g,10)?a(b.grid.bDiv)[0].scrollLeft=a(b.grid.bDiv)[0].scrollLeft+b.rows[d].cells[c].clientWidth:j<g&&(a(b.grid.bDiv)[0].scrollLeft=a(b.grid.bDiv)[0].scrollLeft-b.rows[d].cells[c].clientWidth))}function d(a,c){var d,e;if("lft"==c){d=a+1;for(e=a;0<=e;e--)if(!0!==b.p.colModel[e].hidden){d=e;break}}if("rgt"==c){d=a-1;for(e=a;e<b.p.colModel.length;e++)if(!0!==b.p.colModel[e].hidden){d=
e;break}}return d}var b=this;if(b.grid&&!0===b.p.cellEdit){b.p.knv=b.p.id+"_kn";var f=a("<span style='width:0px;height:0px;background-color:black;' tabindex='0'><span tabindex='-1' style='width:0px;height:0px;background-color:grey' id='"+b.p.knv+"'></span></span>"),l,g;a(f).insertBefore(b.grid.cDiv);a("#"+b.p.knv).focus().keydown(function(f){g=f.keyCode;"rtl"==b.p.direction&&(37==g?g=39:39==g&&(g=37));switch(g){case 38:0<b.p.iRow-1&&(e(b.p.iRow-1,b.p.iCol,"vu"),a(b).jqGrid("editCell",b.p.iRow-1,b.p.iCol,
!1));break;case 40:b.p.iRow+1<=b.rows.length-1&&(e(b.p.iRow+1,b.p.iCol,"vd"),a(b).jqGrid("editCell",b.p.iRow+1,b.p.iCol,!1));break;case 37:0<=b.p.iCol-1&&(l=d(b.p.iCol-1,"lft"),e(b.p.iRow,l,"h"),a(b).jqGrid("editCell",b.p.iRow,l,!1));break;case 39:b.p.iCol+1<=b.p.colModel.length-1&&(l=d(b.p.iCol+1,"rgt"),e(b.p.iRow,l,"h"),a(b).jqGrid("editCell",b.p.iRow,l,!1));break;case 13:0<=parseInt(b.p.iCol,10)&&0<=parseInt(b.p.iRow,10)&&a(b).jqGrid("editCell",b.p.iRow,b.p.iCol,!0)}return!1})}})},getChangedCells:function(e){var d=
[];e||(e="all");this.each(function(){var b=this,f;!b.grid||!0!==b.p.cellEdit||a(b.rows).each(function(l){var g={};a(this).hasClass("edited")&&(a("td",this).each(function(d){f=b.p.colModel[d].name;if("cb"!==f&&"subgrid"!==f)if("dirty"==e){if(a(this).hasClass("dirty-cell"))try{g[f]=a.unformat(this,{rowId:b.rows[l].id,colModel:b.p.colModel[d]},d)}catch(c){g[f]=a.jgrid.htmlDecode(a(this).html())}}else try{g[f]=a.unformat(this,{rowId:b.rows[l].id,colModel:b.p.colModel[d]},d)}catch(m){g[f]=a.jgrid.htmlDecode(a(this).html())}}),
g.id=this.id,d.push(g))})});return d}})})(m);(function(a){a.fn.jqm=function(b){var c={overlay:50,closeoverlay:!0,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:l,ajaxText:"",target:l,modal:l,toTop:l,onShow:l,onHide:l,onLoad:l};return this.each(function(){if(this._jqm)return d[this._jqm].c=a.extend({},d[this._jqm].c,b);e++;this._jqm=e;d[e]={c:a.extend(c,a.jqm.params,b),a:l,w:a(this).addClass("jqmID"+e),s:e};c.trigger&&a(this).jqmAddTrigger(c.trigger)})};a.fn.jqmAddClose=function(a){return n(this,
a,"jqmHide")};a.fn.jqmAddTrigger=function(a){return n(this,a,"jqmShow")};a.fn.jqmShow=function(b){return this.each(function(){a.jqm.open(this._jqm,b)})};a.fn.jqmHide=function(b){return this.each(function(){a.jqm.close(this._jqm,b)})};a.jqm={hash:{},open:function(e,j){var k=d[e],m=k.c,n="."+m.closeClass,q=parseInt(k.w.css("z-index")),q=0<q?q:3E3,u=a("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":q-1,opacity:m.overlay/100});if(k.a)return l;k.t=j;k.a=!0;k.w.css("z-index",
q);m.modal?(b[0]||setTimeout(function(){c("bind")},1),b.push(e)):0<m.overlay?m.closeoverlay&&k.w.jqmAddClose(u):u=l;k.o=u?u.addClass(m.overlayClass).prependTo("body"):l;if(f&&(a("html,body").css({height:"100%",width:"100%"}),u)){var u=u.css({position:"absolute"})[0],z;for(z in{Top:1,Left:1})u.style.setExpression(z.toLowerCase(),"(_=(document.documentElement.scroll"+z+" || document.body.scroll"+z+"))+'px'")}m.ajax?(q=m.target||k.w,u=m.ajax,q="string"==typeof q?a(q,k.w):a(q),u="@"==u.substr(0,1)?a(j).attr(u.substring(1)):
u,q.html(m.ajaxText).load(u,function(){m.onLoad&&m.onLoad.call(this,k);n&&k.w.jqmAddClose(a(n,k.w));g(k)})):n&&k.w.jqmAddClose(a(n,k.w));m.toTop&&k.o&&k.w.before('<span id="jqmP'+k.w[0]._jqm+'"></span>').insertAfter(k.o);m.onShow?m.onShow(k):k.w.show();g(k);return l},close:function(e){e=d[e];if(!e.a)return l;e.a=l;b[0]&&(b.pop(),b[0]||c("unbind"));e.c.toTop&&e.o&&a("#jqmP"+e.w[0]._jqm).after(e.w).remove();if(e.c.onHide)e.c.onHide(e);else e.w.hide(),e.o&&e.o.remove();return l},params:{}};var e=0,d=
a.jqm.hash,b=[],f=a.browser.msie&&"6.0"==a.browser.version,l=!1,g=function(b){var c=a('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});f&&(b.o?b.o.html('<p style="width:100%;height:100%"/>').prepend(c):a("iframe.jqm",b.w)[0]||b.w.prepend(c));k(b)},k=function(b){try{a(":input:visible",b.w)[0].focus()}catch(c){}},c=function(b){a(document)[b]("keypress",m)[b]("keydown",m)[b]("mousedown",m)},m=function(c){var e=d[b[b.length-1]];(c=!a(c.target).parents(".jqmID"+
e.s)[0])&&k(e);return!c},n=function(b,c,e){return b.each(function(){var b=this._jqm;a(c).each(function(){this[e]||(this[e]=[],a(this).click(function(){for(var a in{jqmShow:1,jqmHide:1})for(var b in this[a])if(d[this[a][b]])d[this[a][b]].w[a](this);return l}));this[e].push(b)})})}})(m);(function(a){a.fn.jqDrag=function(a){return l(this,a,"d")};a.fn.jqResize=function(a,b){return l(this,a,"r",b)};a.jqDnR={dnr:{},e:0,drag:function(a){"d"==d.k?b.css({left:d.X+a.pageX-d.pX,top:d.Y+a.pageY-d.pY}):(b.css({width:Math.max(a.pageX-
d.pX+d.W,0),height:Math.max(a.pageY-d.pY+d.H,0)}),M1&&f.css({width:Math.max(a.pageX-M1.pX+M1.W,0),height:Math.max(a.pageY-M1.pY+M1.H,0)}));return!1},stop:function(){a(document).unbind("mousemove",e.drag).unbind("mouseup",e.stop)}};var e=a.jqDnR,d=e.dnr,b=e.e,f,l=function(e,c,j,l){return e.each(function(){c=c?a(c,e):e;c.bind("mousedown",{e:e,k:j},function(c){var e=c.data,j={};b=e.e;f=l?a(l):!1;if("relative"!=b.css("position"))try{b.position(j)}catch(k){}d={X:j.left||g("left")||0,Y:j.top||g("top")||
0,W:g("width")||b[0].scrollWidth||0,H:g("height")||b[0].scrollHeight||0,pX:c.pageX,pY:c.pageY,k:e.k};M1=f&&"d"!=e.k?{X:j.left||f1("left")||0,Y:j.top||f1("top")||0,W:f[0].offsetWidth||f1("width")||0,H:f[0].offsetHeight||f1("height")||0,pX:c.pageX,pY:c.pageY,k:e.k}:!1;if(a("input.hasDatepicker",b[0])[0])try{a("input.hasDatepicker",b[0]).datepicker("hide")}catch(m){}a(document).mousemove(a.jqDnR.drag).mouseup(a.jqDnR.stop);return!1})})},g=function(a){return parseInt(b.css(a))||!1};f1=function(a){return parseInt(f.css(a))||
!1}})(m);(function(a){a.jgrid.extend({setSubGrid:function(){return this.each(function(){var e;this.p.subGridOptions=a.extend({plusicon:"ui-icon-plus",minusicon:"ui-icon-minus",openicon:"ui-icon-carat-1-sw",expandOnLoad:!1,delayOnLoad:50,selectOnExpand:!1,reloadOnExpand:!0},this.p.subGridOptions||{});this.p.colNames.unshift("");this.p.colModel.unshift({name:"subgrid",width:a.browser.safari?this.p.subGridWidth+this.p.cellLayout:this.p.subGridWidth,sortable:!1,resizable:!1,hidedlg:!0,search:!1,fixed:!0});
e=this.p.subGridModel;if(e[0]){e[0].align=a.extend([],e[0].align||[]);for(var d=0;d<e[0].name.length;d++)e[0].align[d]=e[0].align[d]||"left"}})},addSubGridCell:function(a,d){var b="",e,l;this.each(function(){b=this.formatCol(a,d);l=this.p.id;e=this.p.subGridOptions.plusicon});return'<td role="grid" aria-describedby="'+l+'_subgrid" class="ui-sgcollapsed sgcollapsed" '+b+"><a href='javascript:void(0);'><span class='ui-icon "+e+"'></span></a></td>"},addSubGrid:function(e){return this.each(function(){var d=
this;if(d.grid){var b=function(b,c,e){c=a("<td align='"+d.p.subGridModel[0].align[e]+"'></td>").html(c);a(b).append(c)},f=function(c,e){var f,g,j,k=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),l=a("<tr></tr>");for(g=0;g<d.p.subGridModel[0].name.length;g++)f=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+d.p.direction+"'></th>"),a(f).html(d.p.subGridModel[0].name[g]),a(f).width(d.p.subGridModel[0].width[g]),a(l).append(f);a(k).append(l);c&&(j=d.p.xmlReader.subgrid,
a(j.root+" "+j.row,c).each(function(){l=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(!0===j.repeatitems)a(j.cell,this).each(function(c){b(l,a(this).text()||"&#160;",c)});else{var c=d.p.subGridModel[0].mapping||d.p.subGridModel[0].name;if(c)for(g=0;g<c.length;g++)b(l,a(c[g],this).text()||"&#160;",g)}a(k).append(l)}));f=a("table:first",d.grid.bDiv).attr("id")+"_";a("#"+f+e).append(k);d.grid.hDiv.loading=!1;a("#load_"+d.p.id).hide();return!1},l=function(c,e){var f,g,j,k,l,m=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),
n=a("<tr></tr>");for(g=0;g<d.p.subGridModel[0].name.length;g++)f=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+d.p.direction+"'></th>"),a(f).html(d.p.subGridModel[0].name[g]),a(f).width(d.p.subGridModel[0].width[g]),a(n).append(f);a(m).append(n);if(c&&(k=d.p.jsonReader.subgrid,f=c[k.root],"undefined"!==typeof f))for(g=0;g<f.length;g++){j=f[g];n=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(!0===k.repeatitems){k.cell&&(j=j[k.cell]);for(l=0;l<j.length;l++)b(n,j[l]||"&#160;",
l)}else{var o=d.p.subGridModel[0].mapping||d.p.subGridModel[0].name;if(o.length)for(l=0;l<o.length;l++)b(n,j[o[l]]||"&#160;",l)}a(m).append(n)}g=a("table:first",d.grid.bDiv).attr("id")+"_";a("#"+g+e).append(m);d.grid.hDiv.loading=!1;a("#load_"+d.p.id).hide();return!1},g=function(b){var c,e,g,j;c=a(b).attr("id");e={nd_:(new Date).getTime()};e[d.p.prmNames.subgridid]=c;if(!d.p.subGridModel[0])return!1;if(d.p.subGridModel[0].params)for(j=0;j<d.p.subGridModel[0].params.length;j++)for(g=0;g<d.p.colModel.length;g++)d.p.colModel[g].name==
d.p.subGridModel[0].params[j]&&(e[d.p.colModel[g].name]=a("td:eq("+g+")",b).text().replace(/\&#160\;/ig,""));if(!d.grid.hDiv.loading)switch(d.grid.hDiv.loading=!0,a("#load_"+d.p.id).show(),d.p.subgridtype||(d.p.subgridtype=d.p.datatype),a.isFunction(d.p.subgridtype)?d.p.subgridtype.call(d,e):d.p.subgridtype=d.p.subgridtype.toLowerCase(),d.p.subgridtype){case "xml":case "json":a.ajax(a.extend({type:d.p.mtype,url:d.p.subGridUrl,dataType:d.p.subgridtype,data:a.isFunction(d.p.serializeSubGridData)?d.p.serializeSubGridData.call(d,
e):e,complete:function(b){d.p.subgridtype=="xml"?f(b.responseXML,c):l(a.jgrid.parse(b.responseText),c)}},a.jgrid.ajaxOptions,d.p.ajaxSubgridOptions||{}))}return!1},k,c,m,n=0,o,p;a.each(d.p.colModel,function(){(!0===this.hidden||"rn"==this.name||"cb"==this.name)&&n++});a(d.rows).each(function(b){var f=this;a(f).hasClass("jqgrow")&&(a(this.cells[e]).bind("click",function(){p=f.nextSibling;if(a(this).hasClass("sgcollapsed")){c=d.p.id;k=f.id;if(!0===d.p.subGridOptions.reloadOnExpand||!1===d.p.subGridOptions.reloadOnExpand&&
!a(p).hasClass("ui-subgrid")){m=1<=e?"<td colspan='"+e+"'>&#160;</td>":"";o=!0;a.isFunction(d.p.subGridBeforeExpand)&&(o=d.p.subGridBeforeExpand.call(d,c+"_"+k,k));if(!1===o)return!1;a(f).after("<tr role='row' class='ui-subgrid'>"+m+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon "+d.p.subGridOptions.openicon+"'></span></td><td colspan='"+parseInt(d.p.colNames.length-1-n,10)+"' class='ui-widget-content subgrid-data'><div id="+c+"_"+k+" class='tablediv'></div></td></tr>");a.isFunction(d.p.subGridRowExpanded)?
d.p.subGridRowExpanded.call(d,c+"_"+k,k):g(f)}else a(p).show();a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+d.p.subGridOptions.minusicon+"'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");d.p.subGridOptions.selectOnExpand&&a(d).jqGrid("setSelection",k)}else if(a(this).hasClass("sgexpanded")){o=!0;a.isFunction(d.p.subGridRowColapsed)&&(k=f.id,o=d.p.subGridRowColapsed.call(d,c+"_"+k,k));if(!1===o)return!1;!0===d.p.subGridOptions.reloadOnExpand?a(p).remove(".ui-subgrid"):
a(p).hasClass("ui-subgrid")&&a(p).hide();a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+d.p.subGridOptions.plusicon+"'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed")}return!1}),!0===d.p.subGridOptions.expandOnLoad&&setTimeout(function(){a(f.cells[e]).trigger("click")},b*d.p.subGridOptions.delayOnLoad))});d.subGridXml=function(a,b){f(a,b)};d.subGridJson=function(a,b){l(a,b)}}})},expandSubGridRow:function(e){return this.each(function(){if((this.grid||e)&&!0===this.p.subGrid){var d=
a(this).jqGrid("getInd",e,!0);d&&(d=a("td.sgcollapsed",d)[0])&&a(d).trigger("click")}})},collapseSubGridRow:function(e){return this.each(function(){if((this.grid||e)&&!0===this.p.subGrid){var d=a(this).jqGrid("getInd",e,!0);d&&(d=a("td.sgexpanded",d)[0])&&a(d).trigger("click")}})},toggleSubGridRow:function(e){return this.each(function(){if((this.grid||e)&&!0===this.p.subGrid){var d=a(this).jqGrid("getInd",e,!0);if(d){var b=a("td.sgcollapsed",d)[0];b?a(b).trigger("click"):(b=a("td.sgexpanded",d)[0])&&
a(b).trigger("click")}}})}})})(m);(function(a){a.jgrid.extend({groupingSetup:function(){return this.each(function(){var e=this.p.groupingView;if(null!==e&&("object"===typeof e||a.isFunction(e)))if(e.groupField.length){"undefined"==typeof e.visibiltyOnNextGrouping&&(e.visibiltyOnNextGrouping=[]);for(var d=0;d<e.groupField.length;d++)if(e.groupOrder[d]||(e.groupOrder[d]="asc"),e.groupText[d]||(e.groupText[d]="{0}"),"boolean"!=typeof e.groupColumnShow[d]&&(e.groupColumnShow[d]=!0),"boolean"!=typeof e.groupSummary[d]&&
(e.groupSummary[d]=!1),!0===e.groupColumnShow[d]?(e.visibiltyOnNextGrouping[d]=!0,a(this).jqGrid("showCol",e.groupField[d])):(e.visibiltyOnNextGrouping[d]=a("#"+this.p.id+"_"+e.groupField[d]).is(":visible"),a(this).jqGrid("hideCol",e.groupField[d])),e.sortitems[d]=[],e.sortnames[d]=[],e.summaryval[d]=[],e.groupSummary[d]){e.summary[d]=[];for(var b=this.p.colModel,f=0,l=b.length;f<l;f++)b[f].summaryType&&e.summary[d].push({nm:b[f].name,st:b[f].summaryType,v:""})}this.p.scroll=!1;this.p.rownumbers=
!1;this.p.subGrid=!1;this.p.treeGrid=!1;this.p.gridview=!0}else this.p.grouping=!1;else this.p.grouping=!1})},groupingPrepare:function(e,d,b,f){this.each(function(){d[0]+="";var l=d[0].toString().split(" ").join(""),g=this.p.groupingView,k=this;b.hasOwnProperty(l)?b[l].push(e):(b[l]=[],b[l].push(e),g.sortitems[0].push(l),g.sortnames[0].push(a.trim(d[0].toString())),g.summaryval[0][l]=a.extend(!0,[],g.summary[0]));g.groupSummary[0]&&a.each(g.summaryval[0][l],function(){this.v=a.isFunction(this.st)?
this.st.call(k,this.v,this.nm,f):a(k).jqGrid("groupingCalculations."+this.st,this.v,this.nm,f)})});return b},groupingToggle:function(e){this.each(function(){var d=this.p.groupingView,b=e.lastIndexOf("_"),f=e.substring(0,b+1),b=parseInt(e.substring(b+1),10)+1,l=d.minusicon,g=d.plusicon,k=a("#"+e)[0].nextSibling,c=a("#"+e+" span.tree-wrap-"+this.p.direction),m=!1;if(c.hasClass(l)){if(d.showSummaryOnHide&&d.groupSummary[0]){if(k)for(;k&&!a(k).hasClass("jqfoot");)a(k).hide(),k=k.nextSibling}else if(k)for(;k&&
a(k).attr("id")!=f+(""+b);)a(k).hide(),k=k.nextSibling;c.removeClass(l).addClass(g);m=!0}else{if(k)for(;k&&a(k).attr("id")!=f+(""+b);)a(k).show(),k=k.nextSibling;c.removeClass(g).addClass(l);m=!1}a.isFunction(this.p.onClickGroup)&&this.p.onClickGroup.call(this,e,m)});return!1},groupingRender:function(e,d){return this.each(function(){var b=this,f=b.p.groupingView,l="",g="",k,c="",m,n,o;f.groupDataSorted||(f.sortitems[0].sort(),f.sortnames[0].sort(),"desc"==f.groupOrder[0].toLowerCase()&&(f.sortitems[0].reverse(),
f.sortnames[0].reverse()));c=f.groupCollapse?f.plusicon:f.minusicon;c+=" tree-wrap-"+b.p.direction;for(o=0;o<d;){if(b.p.colModel[o].name==f.groupField[0]){n=o;break}o++}a.each(f.sortitems[0],function(o,r){k=b.p.id+"ghead_"+o;g="<span style='cursor:pointer;' class='ui-icon "+c+"' onclick=\"jQuery('#"+b.p.id+"').jqGrid('groupingToggle','"+k+"');return false;\"></span>";try{m=b.formatter(k,f.sortnames[0][o],n,f.sortitems[0])}catch(t){m=f.sortnames[0][o]}l=l+('<tr id="'+k+'" role="row" class= "ui-widget-content jqgroup ui-row-'+
b.p.direction+'"><td colspan="'+d+'">'+g+a.jgrid.format(f.groupText[0],m,e[r].length)+"</td></tr>");for(var x=0;x<e[r].length;x++)l=l+e[r][x].join("");if(f.groupSummary[0]){x="";f.groupCollapse&&!f.showSummaryOnHide&&(x=' style="display:none;"');l=l+("<tr"+x+' role="row" class="ui-widget-content jqfoot ui-row-'+b.p.direction+'">');for(var x=f.summaryval[0][r],v=b.p.colModel,u,z=e[r].length,C=0;C<d;C++){var F="<td "+b.formatCol(C,1,"")+">&#160;</td>",A="{0}";a.each(x,function(){if(this.nm==v[C].name){if(v[C].summaryTpl)A=
v[C].summaryTpl;if(this.st=="avg"&&this.v&&z>0)this.v=this.v/z;try{u=b.formatter("",this.v,C,this)}catch(c){u=this.v}F="<td "+b.formatCol(C,1,"")+">"+a.jgrid.format(A,u)+"</td>";return false}});l=l+F}l=l+"</tr>"}});a("#"+b.p.id+" tbody:first").append(l);l=null})},groupingGroupBy:function(e,d){return this.each(function(){"string"==typeof e&&(e=[e]);var b=this.p.groupingView;this.p.grouping=!0;for(var f=0;f<b.groupField.length;f++)!b.groupColumnShow[f]&&b.visibiltyOnNextGrouping[f]&&a(this).jqGrid("showCol",
b.groupField[f]);for(f=0;f<e.length;f++)b.visibiltyOnNextGrouping[f]=a("#"+this.p.id+"_"+e[f]).is(":visible");this.p.groupingView=a.extend(this.p.groupingView,d||{});b.groupField=e;a(this).trigger("reloadGrid")})},groupingRemove:function(e){return this.each(function(){"undefined"==typeof e&&(e=!0);this.p.grouping=!1;if(!0===e){for(var d=this.p.groupingView,b=0;b<d.groupField.length;b++)!d.groupColumnShow[b]&&d.visibiltyOnNextGrouping[b]&&a(this).jqGrid("showCol",d.groupField);a("tr.jqgroup, tr.jqfoot",
"#"+this.p.id+" tbody:first").remove();a("tr.jqgrow:hidden","#"+this.p.id+" tbody:first").show()}else a(this).trigger("reloadGrid")})},groupingCalculations:{sum:function(a,d,b){return parseFloat(a||0)+parseFloat(b[d]||0)},min:function(a,d,b){return""===a?parseFloat(b[d]||0):Math.min(parseFloat(a),parseFloat(b[d]||0))},max:function(a,d,b){return""===a?parseFloat(b[d]||0):Math.max(parseFloat(a),parseFloat(b[d]||0))},count:function(a,d,b){""===a&&(a=0);return b.hasOwnProperty(d)?a+1:0},avg:function(a,
d,b){return parseFloat(a||0)+parseFloat(b[d]||0)}}})})(m);(function(a){a.jgrid.extend({setTreeNode:function(e,d){return this.each(function(){var b=this;if(b.grid&&b.p.treeGrid)for(var f=b.p.expColInd,l=b.p.treeReader.expanded_field,g=b.p.treeReader.leaf_field,k=b.p.treeReader.level_field,c=b.p.treeReader.icon_field,m=b.p.treeReader.loaded,n,o,p,r;e<d;)r=b.p.data[b.p._index[b.rows[e].id]],"nested"==b.p.treeGridModel&&!r[g]&&(n=parseInt(r[b.p.treeReader.left_field],10),o=parseInt(r[b.p.treeReader.right_field],
10),r[g]=o===n+1?"true":"false",b.rows[e].cells[b.p._treeleafpos].innerHTML=r[g]),n=parseInt(r[k],10),0===b.p.tree_root_level?(p=n+1,o=n):(p=n,o=n-1),p="<div class='tree-wrap tree-wrap-"+b.p.direction+"' style='width:"+18*p+"px;'>",p+="<div style='"+("rtl"==b.p.direction?"right:":"left:")+18*o+"px;' class='ui-icon ",void 0!==r[m]&&(r[m]="true"==r[m]||!0===r[m]?!0:!1),"true"==r[g]||!0===r[g]?(p+=(void 0!==r[c]&&""!==r[c]?r[c]:b.p.treeIcons.leaf)+" tree-leaf treeclick'",r[g]=!0,o="leaf"):(r[g]=!1,o=
""),r[l]=("true"==r[l]||!0===r[l]?!0:!1)&&r[m],p+=!0===r[l]?b.p.treeIcons.minus+" tree-minus treeclick'":b.p.treeIcons.plus+" tree-plus treeclick'",p+="</div></div>",a(b.rows[e].cells[f]).wrapInner("<span class='cell-wrapper"+o+"'></span>").prepend(p),n!==parseInt(b.p.tree_root_level,10)&&((r=(r=a(b).jqGrid("getNodeParent",r))&&r.hasOwnProperty(l)?r[l]:!0)||a(b.rows[e]).css("display","none")),a(b.rows[e].cells[f]).find("div.treeclick").bind("click",function(c){c=a(c.target||c.srcElement,b.rows).closest("tr.jqgrow")[0].id;
c=b.p._index[c];if(!b.p.data[c][g])if(b.p.data[c][l]){a(b).jqGrid("collapseRow",b.p.data[c]);a(b).jqGrid("collapseNode",b.p.data[c])}else{a(b).jqGrid("expandRow",b.p.data[c]);a(b).jqGrid("expandNode",b.p.data[c])}return false}),!0===b.p.ExpandColClick&&a(b.rows[e].cells[f]).find("span.cell-wrapper").css("cursor","pointer").bind("click",function(c){var c=a(c.target||c.srcElement,b.rows).closest("tr.jqgrow")[0].id,d=b.p._index[c];if(!b.p.data[d][g])if(b.p.data[d][l]){a(b).jqGrid("collapseRow",b.p.data[d]);
a(b).jqGrid("collapseNode",b.p.data[d])}else{a(b).jqGrid("expandRow",b.p.data[d]);a(b).jqGrid("expandNode",b.p.data[d])}a(b).jqGrid("setSelection",c);return false}),e++})},setTreeGrid:function(){return this.each(function(){var e=this,d=0,b=!1,f,l,g=[];if(e.p.treeGrid){e.p.treedatatype||a.extend(e.p,{treedatatype:e.p.datatype});e.p.subGrid=!1;e.p.altRows=!1;e.p.pgbuttons=!1;e.p.pginput=!1;e.p.gridview=!0;e.p.multiselect=!1;e.p.rowList=[];e.p.expColInd=0;e.p.treeIcons=a.extend({plus:"ui-icon-triangle-1-"+
("rtl"==e.p.direction?"w":"e"),minus:"ui-icon-triangle-1-s",leaf:"ui-icon-radio-off"},e.p.treeIcons||{});"nested"==e.p.treeGridModel?e.p.treeReader=a.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},e.p.treeReader):"adjacency"==e.p.treeGridModel&&(e.p.treeReader=a.extend({level_field:"level",parent_id_field:"parent",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},e.p.treeReader));
for(l in e.p.colModel)if(e.p.colModel.hasOwnProperty(l)){f=e.p.colModel[l].name;f==e.p.ExpandColumn&&!b&&(b=!0,e.p.expColInd=d);d++;for(var k in e.p.treeReader)e.p.treeReader[k]==f&&g.push(f)}a.each(e.p.treeReader,function(b,f){if(f&&a.inArray(f,g)===-1){if(b==="leaf_field")e.p._treeleafpos=d;d++;e.p.colNames.push(f);e.p.colModel.push({name:f,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false})}})}})},expandRow:function(e){this.each(function(){var d=this;if(d.grid&&
d.p.treeGrid){var b=a(d).jqGrid("getNodeChildren",e),f=d.p.treeReader.expanded_field;a(b).each(function(){var b=a.jgrid.getAccessor(this,d.p.localReader.id);a("#"+b,d.grid.bDiv).css("display","");this[f]&&a(d).jqGrid("expandRow",this)})}})},collapseRow:function(e){this.each(function(){var d=this;if(d.grid&&d.p.treeGrid){var b=a(d).jqGrid("getNodeChildren",e),f=d.p.treeReader.expanded_field;a(b).each(function(){var b=a.jgrid.getAccessor(this,d.p.localReader.id);a("#"+b,d.grid.bDiv).css("display","none");
this[f]&&a(d).jqGrid("collapseRow",this)})}})},getRootNodes:function(){var e=[];this.each(function(){var d=this;if(d.grid&&d.p.treeGrid)switch(d.p.treeGridModel){case "nested":var b=d.p.treeReader.level_field;a(d.p.data).each(function(){parseInt(this[b],10)===parseInt(d.p.tree_root_level,10)&&e.push(this)});break;case "adjacency":var f=d.p.treeReader.parent_id_field;a(d.p.data).each(function(){(null===this[f]||"null"==(""+this[f]).toLowerCase())&&e.push(this)})}});return e},getNodeDepth:function(e){var d=
null;this.each(function(){if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":d=parseInt(e[this.p.treeReader.level_field],10)-parseInt(this.p.tree_root_level,10);break;case "adjacency":d=a(this).jqGrid("getNodeAncestors",e).length}});return d},getNodeParent:function(e){var d=null;this.each(function(){if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":var b=this.p.treeReader.left_field,f=this.p.treeReader.right_field,l=this.p.treeReader.level_field,g=parseInt(e[b],
10),k=parseInt(e[f],10),c=parseInt(e[l],10);a(this.p.data).each(function(){if(parseInt(this[l],10)===c-1&&parseInt(this[b],10)<g&&parseInt(this[f],10)>k)return d=this,!1});break;case "adjacency":var m=this.p.treeReader.parent_id_field,n=this.p.localReader.id;a(this.p.data).each(function(){if(this[n]==e[m])return d=this,!1})}});return d},getNodeChildren:function(e){var d=[];this.each(function(){if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":var b=this.p.treeReader.left_field,
f=this.p.treeReader.right_field,l=this.p.treeReader.level_field,g=parseInt(e[b],10),k=parseInt(e[f],10),c=parseInt(e[l],10);a(this.p.data).each(function(){parseInt(this[l],10)===c+1&&parseInt(this[b],10)>g&&parseInt(this[f],10)<k&&d.push(this)});break;case "adjacency":var m=this.p.treeReader.parent_id_field,n=this.p.localReader.id;a(this.p.data).each(function(){this[m]==e[n]&&d.push(this)})}});return d},getFullTreeNode:function(e){var d=[];this.each(function(){var b;if(this.grid&&this.p.treeGrid)switch(this.p.treeGridModel){case "nested":var f=
this.p.treeReader.left_field,l=this.p.treeReader.right_field,g=this.p.treeReader.level_field,k=parseInt(e[f],10),c=parseInt(e[l],10),m=parseInt(e[g],10);a(this.p.data).each(function(){parseInt(this[g],10)>=m&&parseInt(this[f],10)>=k&&parseInt(this[f],10)<=c&&d.push(this)});break;case "adjacency":if(e){d.push(e);var n=this.p.treeReader.parent_id_field,o=this.p.localReader.id;a(this.p.data).each(function(a){b=d.length;for(a=0;a<b;a++)if(d[a][o]==this[n]){d.push(this);break}})}}});return d},getNodeAncestors:function(e){var d=
[];this.each(function(){if(this.grid&&this.p.treeGrid)for(var b=a(this).jqGrid("getNodeParent",e);b;)d.push(b),b=a(this).jqGrid("getNodeParent",b)});return d},isVisibleNode:function(e){var d=!0;this.each(function(){if(this.grid&&this.p.treeGrid){var b=a(this).jqGrid("getNodeAncestors",e),f=this.p.treeReader.expanded_field;a(b).each(function(){d=d&&this[f];if(!d)return!1})}});return d},isNodeLoaded:function(e){var d;this.each(function(){if(this.grid&&this.p.treeGrid){var b=this.p.treeReader.leaf_field;
d=void 0!==e?void 0!==e.loaded?e.loaded:e[b]||0<a(this).jqGrid("getNodeChildren",e).length?!0:!1:!1}});return d},expandNode:function(e){return this.each(function(){if(this.grid&&this.p.treeGrid){var d=this.p.treeReader.expanded_field,b=this.p.treeReader.parent_id_field,f=this.p.treeReader.loaded,l=this.p.treeReader.level_field,g=this.p.treeReader.left_field,k=this.p.treeReader.right_field;if(!e[d]){var c=a.jgrid.getAccessor(e,this.p.localReader.id),m=a("#"+c,this.grid.bDiv)[0],n=this.p._index[c];
a(this).jqGrid("isNodeLoaded",this.p.data[n])?(e[d]=!0,a("div.treeclick",m).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus")):(e[d]=!0,a("div.treeclick",m).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus"),this.p.treeANode=m.rowIndex,this.p.datatype=this.p.treedatatype,"nested"==this.p.treeGridModel?a(this).jqGrid("setGridParam",{postData:{nodeid:c,n_left:e[g],n_right:e[k],n_level:e[l]}}):a(this).jqGrid("setGridParam",
{postData:{nodeid:c,parentid:e[b],n_level:e[l]}}),a(this).trigger("reloadGrid"),e[f]=!0,"nested"==this.p.treeGridModel?a(this).jqGrid("setGridParam",{postData:{nodeid:"",n_left:"",n_right:"",n_level:""}}):a(this).jqGrid("setGridParam",{postData:{nodeid:"",parentid:"",n_level:""}}))}}})},collapseNode:function(e){return this.each(function(){if(this.grid&&this.p.treeGrid&&e.expanded){e.expanded=!1;var d=a.jgrid.getAccessor(e,this.p.localReader.id),d=a("#"+d,this.grid.bDiv)[0];a("div.treeclick",d).removeClass(this.p.treeIcons.minus+
" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus")}})},SortTree:function(e,d,b,f){return this.each(function(){if(this.grid&&this.p.treeGrid){var l,g,k,c=[],m=this,n;l=a(this).jqGrid("getRootNodes");l=a.jgrid.from(l);l.orderBy(e,d,b,f);n=l.select();l=0;for(g=n.length;l<g;l++)k=n[l],c.push(k),a(this).jqGrid("collectChildrenSortTree",c,k,e,d,b,f);a.each(c,function(b){var c=a.jgrid.getAccessor(this,m.p.localReader.id);a("#"+m.p.id+" tbody tr:eq("+b+")").after(a("tr#"+c,m.grid.bDiv))});c=n=l=
null}})},collectChildrenSortTree:function(e,d,b,f,l,g){return this.each(function(){if(this.grid&&this.p.treeGrid){var k,c,m,n;k=a(this).jqGrid("getNodeChildren",d);k=a.jgrid.from(k);k.orderBy(b,f,l,g);n=k.select();k=0;for(c=n.length;k<c;k++)m=n[k],e.push(m),a(this).jqGrid("collectChildrenSortTree",e,m,b,f,l,g)}})},setTreeRow:function(e,d){var b=!1;this.each(function(){this.grid&&this.p.treeGrid&&(b=a(this).jqGrid("setRowData",e,d))});return b},delTreeNode:function(e){return this.each(function(){var d=
this.p.localReader.id,b=this.p.treeReader.left_field,f=this.p.treeReader.right_field,l,g,k;if(this.grid&&this.p.treeGrid){var c=this.p._index[e];if(void 0!==c){l=parseInt(this.p.data[c][f],10);g=l-parseInt(this.p.data[c][b],10)+1;c=a(this).jqGrid("getFullTreeNode",this.p.data[c]);if(0<c.length)for(var m=0;m<c.length;m++)a(this).jqGrid("delRowData",c[m][d]);if("nested"===this.p.treeGridModel){d=a.jgrid.from(this.p.data).greater(b,l,{stype:"integer"}).select();if(d.length)for(k in d)d[k][b]=parseInt(d[k][b],
10)-g;d=a.jgrid.from(this.p.data).greater(f,l,{stype:"integer"}).select();if(d.length)for(k in d)d[k][f]=parseInt(d[k][f],10)-g}}}})},addChildNode:function(e,d,b){var f=this[0];if(b){var l=f.p.treeReader.expanded_field,g=f.p.treeReader.leaf_field,k=f.p.treeReader.level_field,c=f.p.treeReader.parent_id_field,m=f.p.treeReader.left_field,n=f.p.treeReader.right_field,o=f.p.treeReader.loaded,p,r,t,x,v;p=0;var u=d,z;if(!e){v=f.p.data.length-1;if(0<=v)for(;0<=v;)p=Math.max(p,parseInt(f.p.data[v][f.p.localReader.id],
10)),v--;e=p+1}var C=a(f).jqGrid("getInd",d);z=!1;if(void 0===d||null===d||""===d)u=d=null,p="last",x=f.p.tree_root_level,v=f.p.data.length+1;else if(p="after",r=f.p._index[d],t=f.p.data[r],d=t[f.p.localReader.id],x=parseInt(t[k],10)+1,v=a(f).jqGrid("getFullTreeNode",t),v.length?(u=v[v.length-1][f.p.localReader.id],v=a(f).jqGrid("getInd",u)+1):v=a(f).jqGrid("getInd",d)+1,t[g])z=!0,t[l]=!0,a(f.rows[C]).find("span.cell-wrapperleaf").removeClass("cell-wrapperleaf").addClass("cell-wrapper").end().find("div.tree-leaf").removeClass(f.p.treeIcons.leaf+
" tree-leaf").addClass(f.p.treeIcons.minus+" tree-minus"),f.p.data[r][g]=!1,t[o]=!0;r=v+1;b[l]=!1;b[o]=!0;b[k]=x;b[g]=!0;"adjacency"===f.p.treeGridModel&&(b[c]=d);if("nested"===f.p.treeGridModel){var F;if(null!==d){g=parseInt(t[n],10);k=a.jgrid.from(f.p.data);k=k.greaterOrEquals(n,g,{stype:"integer"});k=k.select();if(k.length)for(F in k)k[F][m]=k[F][m]>g?parseInt(k[F][m],10)+2:k[F][m],k[F][n]=k[F][n]>=g?parseInt(k[F][n],10)+2:k[F][n];b[m]=g;b[n]=g+1}else{g=parseInt(a(f).jqGrid("getCol",n,!1,"max"),
10);k=a.jgrid.from(f.p.data).greater(m,g,{stype:"integer"}).select();if(k.length)for(F in k)k[F][m]=parseInt(k[F][m],10)+2;k=a.jgrid.from(f.p.data).greater(n,g,{stype:"integer"}).select();if(k.length)for(F in k)k[F][n]=parseInt(k[F][n],10)+2;b[m]=g+1;b[n]=g+2}}if(null===d||a(f).jqGrid("isNodeLoaded",t)||z)a(f).jqGrid("addRowData",e,b,p,u),a(f).jqGrid("setTreeNode",v,r);t&&!t[l]&&a(f.rows[C]).find("div.treeclick").click()}}})})(m);(function(a){a.jgrid.extend({jqGridImport:function(j){j=a.extend({imptype:"xml",
impstring:"",impurl:"",mtype:"GET",impData:{},xmlGrid:{config:"roots>grid",data:"roots>rows"},jsonGrid:{config:"grid",data:"data"},ajaxOptions:{}},j||{});return this.each(function(){var d=this,b=function(b,f){var c=a(f.xmlGrid.config,b)[0],j=a(f.xmlGrid.data,b)[0],l;if(e.xml2json&&a.jgrid.parse){var c=e.xml2json(c," "),c=a.jgrid.parse(c),m;for(m in c)c.hasOwnProperty(m)&&(l=c[m]);j?(j=c.grid.datatype,c.grid.datatype="xmlstring",c.grid.datastr=b,a(d).jqGrid(l).jqGrid("setGridParam",{datatype:j})):
a(d).jqGrid(l)}else alert("xml2json or parse are not present")},f=function(b,e){if(b&&"string"==typeof b){var c=a.jgrid.parse(b),f=c[e.jsonGrid.config];if(c=c[e.jsonGrid.data]){var j=f.datatype;f.datatype="jsonstring";f.datastr=c;a(d).jqGrid(f).jqGrid("setGridParam",{datatype:j})}else a(d).jqGrid(f)}};switch(j.imptype){case "xml":a.ajax(a.extend({url:j.impurl,type:j.mtype,data:j.impData,dataType:"xml",complete:function(d,e){"success"==e&&(b(d.responseXML,j),a.isFunction(j.importComplete)&&j.importComplete(d))}},
j.ajaxOptions));break;case "xmlstring":if(j.impstring&&"string"==typeof j.impstring){var l=a.jgrid.stringToDoc(j.impstring);l&&(b(l,j),a.isFunction(j.importComplete)&&j.importComplete(l),j.impstring=null);l=null}break;case "json":a.ajax(a.extend({url:j.impurl,type:j.mtype,data:j.impData,dataType:"json",complete:function(b,d){"success"==d&&(f(b.responseText,j),a.isFunction(j.importComplete)&&j.importComplete(b))}},j.ajaxOptions));break;case "jsonstring":j.impstring&&"string"==typeof j.impstring&&(f(j.impstring,
j),a.isFunction(j.importComplete)&&j.importComplete(j.impstring),j.impstring=null)}})},jqGridExport:function(j){var j=a.extend({exptype:"xmlstring",root:"grid",ident:"\t"},j||{}),d=null;this.each(function(){if(this.grid){var b=a.extend({},a(this).jqGrid("getGridParam"));b.rownumbers&&(b.colNames.splice(0,1),b.colModel.splice(0,1));b.multiselect&&(b.colNames.splice(0,1),b.colModel.splice(0,1));b.subGrid&&(b.colNames.splice(0,1),b.colModel.splice(0,1));b.knv=null;if(b.treeGrid)for(var f in b.treeReader)b.treeReader.hasOwnProperty(f)&&
(b.colNames.splice(b.colNames.length-1),b.colModel.splice(b.colModel.length-1));switch(j.exptype){case "xmlstring":d="<"+j.root+">"+e.json2xml(b,j.ident)+"</"+j.root+">";break;case "jsonstring":d="{"+e.toJson(b,j.root,j.ident)+"}",void 0!==b.postData.filters&&(d=d.replace(/filters":"/,'filters":'),d=d.replace(/}]}"/,"}]}"))}}});return d},excelExport:function(e){e=a.extend({exptype:"remote",url:null,oper:"oper",tag:"excel",exportOptions:{}},e||{});return this.each(function(){if(this.grid){var d;"remote"==
e.exptype&&(d=a.extend({},this.p.postData),d[e.oper]=e.tag,d=m.param(d),d=-1!=e.url.indexOf("?")?e.url+"&"+d:e.url+"?"+d,window.location=d)}})}})})(m);var e={xml2json:function(a,e){9===a.nodeType&&(a=a.documentElement);var d=this.toJson(this.toObj(this.removeWhite(a)),a.nodeName,"\t");return"{\n"+e+(e?d.replace(/\t/g,e):d.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,e){var d=function(a,b,e){var c="",f,j;if(a instanceof Array)if(0===a.length)c+=e+"<"+b+">__EMPTY_ARRAY_</"+b+">\n";else{f=0;for(j=
a.length;f<j;f+=1)var m=e+d(a[f],b,e+"\t")+"\n",c=c+m}else if("object"===typeof a){f=!1;c+=e+"<"+b;for(j in a)a.hasOwnProperty(j)&&("@"===j.charAt(0)?c+=" "+j.substr(1)+'="'+a[j].toString()+'"':f=!0);c+=f?">":"/>";if(f){for(j in a)a.hasOwnProperty(j)&&("#text"===j?c+=a[j]:"#cdata"===j?c+="<![CDATA["+a[j]+"]]\>":"@"!==j.charAt(0)&&(c+=d(a[j],j,e+"\t")));c+=("\n"===c.charAt(c.length-1)?e:"")+"</"+b+">"}}else c+="function"===typeof a?e+"<"+b+"><![CDATA["+a+"]]\></"+b+">":'""'===a.toString()||0===a.toString().length?
e+"<"+b+">__EMPTY_STRING_</"+b+">":e+"<"+b+">"+a.toString()+"</"+b+">";return c},b="",f;for(f in a)a.hasOwnProperty(f)&&(b+=d(a[f],f,""));return e?b.replace(/\t/g,e):b.replace(/\t|\n/g,"")},toObj:function(a){var e={},d=/function/i;if(1===a.nodeType){if(a.attributes.length){var b;for(b=0;b<a.attributes.length;b+=1)e["@"+a.attributes[b].nodeName]=(a.attributes[b].nodeValue||"").toString()}if(a.firstChild){var f=b=0,l=!1,g;for(g=a.firstChild;g;g=g.nextSibling)1===g.nodeType?l=!0:3===g.nodeType&&g.nodeValue.match(/[^ \f\n\r\t\v]/)?
b+=1:4===g.nodeType&&(f+=1);if(l)if(2>b&&2>f){this.removeWhite(a);for(g=a.firstChild;g;g=g.nextSibling)3===g.nodeType?e["#text"]=this.escape(g.nodeValue):4===g.nodeType?d.test(g.nodeValue)?e[g.nodeName]=[e[g.nodeName],g.nodeValue]:e["#cdata"]=this.escape(g.nodeValue):e[g.nodeName]?e[g.nodeName]instanceof Array?e[g.nodeName][e[g.nodeName].length]=this.toObj(g):e[g.nodeName]=[e[g.nodeName],this.toObj(g)]:e[g.nodeName]=this.toObj(g)}else a.attributes.length?e["#text"]=this.escape(this.innerXml(a)):e=
this.escape(this.innerXml(a));else if(b)a.attributes.length?e["#text"]=this.escape(this.innerXml(a)):(e=this.escape(this.innerXml(a)),"__EMPTY_ARRAY_"===e?e="[]":"__EMPTY_STRING_"===e&&(e=""));else if(f)if(1<f)e=this.escape(this.innerXml(a));else for(g=a.firstChild;g;g=g.nextSibling)if(d.test(a.firstChild.nodeValue)){e=a.firstChild.nodeValue;break}else e["#cdata"]=this.escape(g.nodeValue)}!a.attributes.length&&!a.firstChild&&(e=null)}else 9===a.nodeType?e=this.toObj(a.documentElement):alert("unhandled node type: "+
a.nodeType);return e},toJson:function(a,e,d,b){void 0===b&&(b=!0);var f=e?'"'+e+'"':"",l="\t",g="\n";b||(g=l="");if("[]"===a)f+=e?":[]":"[]";else if(a instanceof Array){var k,c,m=[];c=0;for(k=a.length;c<k;c+=1)m[c]=this.toJson(a[c],"",d+l,b);f+=(e?":[":"[")+(1<m.length?g+d+l+m.join(","+g+d+l)+g+d:m.join(""))+"]"}else if(null===a)f+=(e&&":")+"null";else if("object"===typeof a){k=[];for(c in a)a.hasOwnProperty(c)&&(k[k.length]=this.toJson(a[c],c,d+l,b));f+=(e?":{":"{")+(1<k.length?g+d+l+k.join(","+
g+d+l)+g+d:k.join(""))+"}"}else f+="string"===typeof a?(e&&":")+'"'+a.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"':(e&&":")+'"'+a.toString()+'"';return f},innerXml:function(a){var e="";if("innerHTML"in a)e=a.innerHTML;else for(var d=function(a){var e="",j;if(1===a.nodeType){e+="<"+a.nodeName;for(j=0;j<a.attributes.length;j+=1)e+=" "+a.attributes[j].nodeName+'="'+(a.attributes[j].nodeValue||"").toString()+'"';if(a.firstChild){e+=">";for(j=a.firstChild;j;j=j.nextSibling)e+=d(j);e+="</"+a.nodeName+
">"}else e+="/>"}else 3===a.nodeType?e+=a.nodeValue:4===a.nodeType&&(e+="<![CDATA["+a.nodeValue+"]]\>");return e},a=a.firstChild;a;a=a.nextSibling)e+=d(a);return e},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();var e;for(e=a.firstChild;e;)if(3===e.nodeType)if(e.nodeValue.match(/[^ \f\n\r\t\v]/))e=e.nextSibling;else{var d=e.nextSibling;a.removeChild(e);e=d}else 1===e.nodeType&&this.removeWhite(e),
e=e.nextSibling;return a}};(function(a){a.browser.msie&&8==a.browser.version&&(a.expr[":"].hidden=function(a){return 0===a.offsetWidth||0===a.offsetHeight||"none"==a.style.display});a.jgrid._multiselect=!1;if(a.ui&&a.ui.multiselect){if(a.ui.multiselect.prototype._setSelected){var e=a.ui.multiselect.prototype._setSelected;a.ui.multiselect.prototype._setSelected=function(d,b){var f=e.call(this,d,b);if(b&&this.selectedList){var l=this.element;this.selectedList.find("li").each(function(){a(this).data("optionLink")&&
a(this).data("optionLink").remove().appendTo(l)})}return f}}a.ui.multiselect.prototype.destroy&&(a.ui.multiselect.prototype.destroy=function(){this.element.show();this.container.remove();a.Widget===void 0?a.widget.prototype.destroy.apply(this,arguments):a.Widget.prototype.destroy.apply(this,arguments)});a.jgrid._multiselect=!0}a.jgrid.extend({sortableColumns:function(d){return this.each(function(){function b(){e.p.disableClick=true}var e=this,j={tolerance:"pointer",axis:"x",scrollSensitivity:"1",
items:">th:not(:has(#jqgh_cb,#jqgh_rn,#jqgh_subgrid),:hidden)",placeholder:{element:function(b){return a(document.createElement(b[0].nodeName)).addClass(b[0].className+" ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(a,b){b.height(a.currentItem.innerHeight()-parseInt(a.currentItem.css("paddingTop")||0,10)-parseInt(a.currentItem.css("paddingBottom")||0,10));b.width(a.currentItem.innerWidth()-parseInt(a.currentItem.css("paddingLeft")||0,10)-parseInt(a.currentItem.css("paddingRight")||
0,10))}},update:function(b,c){var d=a(c.item).parent(),d=a(">th",d),g={};a.each(e.p.colModel,function(a){g[this.name]=a});var j=[];d.each(function(){var b=a(">div",this).get(0).id.replace(/^jqgh_/,"");b in g&&j.push(g[b])});a(e).jqGrid("remapColumns",j,true,true);a.isFunction(e.p.sortable.update)&&e.p.sortable.update(j);setTimeout(function(){e.p.disableClick=false},50)}};if(e.p.sortable.options)a.extend(j,e.p.sortable.options);else if(a.isFunction(e.p.sortable))e.p.sortable={update:e.p.sortable};
if(j.start){var g=j.start;j.start=function(a,c){b();g.call(this,a,c)}}else j.start=b;if(e.p.sortable.exclude)j.items=j.items+(":not("+e.p.sortable.exclude+")");d.sortable(j).data("sortable").floating=true})},columnChooser:function(d){function b(b,c){b&&(typeof b=="string"?a.fn[b]&&a.fn[b].apply(c,a.makeArray(arguments).slice(2)):a.isFunction(b)&&b.apply(c,a.makeArray(arguments).slice(2)))}var e=this;if(!a("#colchooser_"+e[0].p.id).length){var j=a('<div id="colchooser_'+e[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>'),
g=a("select",j),d=a.extend({width:420,height:240,classname:null,done:function(a){a&&e.jqGrid("remapColumns",a,true)},msel:"multiselect",dlog:"dialog",dlog_opts:function(a){var b={};b[a.bSubmit]=function(){a.apply_perm();a.cleanup(false)};b[a.bCancel]=function(){a.cleanup(true)};return{buttons:b,close:function(){a.cleanup(true)},modal:a.modal?a.modal:false,resizable:a.resizable?a.resizable:true,width:a.width+20}},apply_perm:function(){a("option",g).each(function(){this.selected?e.jqGrid("showCol",
k[this.value].name):e.jqGrid("hideCol",k[this.value].name)});var b=[];a("option[selected]",g).each(function(){b.push(parseInt(this.value,10))});a.each(b,function(){delete m[k[parseInt(this,10)].name]});a.each(m,function(){var a=parseInt(this,10),c=b,d=a;if(d>=0){var e=c.slice(),f=e.splice(d,Math.max(c.length-d,d));if(d>c.length)d=c.length;e[d]=a;b=e.concat(f)}else b=void 0});d.done&&d.done.call(e,b)},cleanup:function(a){b(d.dlog,j,"destroy");b(d.msel,g,"destroy");j.remove();a&&d.done&&d.done.call(e)},
msel_opts:{}},a.jgrid.col,d||{});if(a.ui&&a.ui.multiselect&&d.msel=="multiselect"){if(!a.jgrid._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");return}d.msel_opts=a.extend(a.ui.multiselect.defaults,d.msel_opts)}d.caption&&j.attr("title",d.caption);if(d.classname){j.addClass(d.classname);g.addClass(d.classname)}if(d.width){a(">div",j).css({width:d.width,margin:"0 auto"});g.css("width",d.width)}if(d.height){a(">div",j).css("height",d.height);g.css("height",
d.height-10)}var k=e.jqGrid("getGridParam","colModel"),c=e.jqGrid("getGridParam","colNames"),m={},n=[];g.empty();a.each(k,function(a){m[this.name]=a;this.hidedlg?this.hidden||n.push(a):g.append("<option value='"+a+"' "+(this.hidden?"":"selected='selected'")+">"+c[a]+"</option>")});var o=a.isFunction(d.dlog_opts)?d.dlog_opts.call(e,d):d.dlog_opts;b(d.dlog,j,o);o=a.isFunction(d.msel_opts)?d.msel_opts.call(e,d):d.msel_opts;b(d.msel,g,o)}},sortableRows:function(d){return this.each(function(){var b=this;
if(b.grid&&!b.p.treeGrid&&a.fn.sortable){d=a.extend({cursor:"move",axis:"y",items:".jqgrow"},d||{});if(d.start&&a.isFunction(d.start)){d._start_=d.start;delete d.start}else d._start_=false;if(d.update&&a.isFunction(d.update)){d._update_=d.update;delete d.update}else d._update_=false;d.start=function(e,j){a(j.item).css("border-width","0px");a("td",j.item).each(function(a){this.style.width=b.grid.cols[a].style.width});if(b.p.subGrid){var g=a(j.item).attr("id");try{a(b).jqGrid("collapseSubGridRow",g)}catch(k){}}d._start_&&
d._start_.apply(this,[e,j])};d.update=function(e,j){a(j.item).css("border-width","");b.p.rownumbers===true&&a("td.jqgrid-rownum",b.rows).each(function(b){a(this).html(b+1)});d._update_&&d._update_.apply(this,[e,j])};a("tbody:first",b).sortable(d);a("tbody:first",b).disableSelection()}})},gridDnD:function(d){return this.each(function(){function b(){var b=a.data(e,"dnd");a("tr.jqgrow:not(.ui-draggable)",e).draggable(a.isFunction(b.drag)?b.drag.call(a(e),b):b.drag)}var e=this;if(e.grid&&!e.p.treeGrid&&
a.fn.draggable&&a.fn.droppable){a("#jqgrid_dnd").html()===null&&a("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");if(typeof d=="string"&&d=="updateDnD"&&e.p.jqgdnd===true)b();else{d=a.extend({drag:function(b){return a.extend({start:function(d,c){if(e.p.subGrid){var j=a(c.helper).attr("id");try{a(e).jqGrid("collapseSubGridRow",j)}catch(l){}}for(j=0;j<a.data(e,"dnd").connectWith.length;j++)a(a.data(e,"dnd").connectWith[j]).jqGrid("getGridParam","reccount")=="0"&&a(a.data(e,"dnd").connectWith[j]).jqGrid("addRowData",
"jqg_empty_row",{});c.helper.addClass("ui-state-highlight");a("td",c.helper).each(function(a){this.style.width=e.grid.headers[a].width+"px"});b.onstart&&a.isFunction(b.onstart)&&b.onstart.call(a(e),d,c)},stop:function(d,c){if(c.helper.dropped){var j=a(c.helper).attr("id");a(e).jqGrid("delRowData",j)}for(j=0;j<a.data(e,"dnd").connectWith.length;j++)a(a.data(e,"dnd").connectWith[j]).jqGrid("delRowData","jqg_empty_row");b.onstop&&a.isFunction(b.onstop)&&b.onstop.call(a(e),d,c)}},b.drag_opts||{})},drop:function(b){return a.extend({accept:function(b){if(!a(b).hasClass("jqgrow"))return b;
var c=a(b).closest("table.ui-jqgrid-btable");if(c.length>0&&a.data(c[0],"dnd")!==void 0){b=a.data(c[0],"dnd").connectWith;return a.inArray("#"+this.id,b)!=-1?true:false}return b},drop:function(d,c){if(a(c.draggable).hasClass("jqgrow")){var j=a(c.draggable).attr("id"),j=c.draggable.parent().parent().jqGrid("getRowData",j);if(!b.dropbyname){var l=0,m={},p,r=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(var t in j){if(j.hasOwnProperty(t)&&r[l]){p=r[l].name;m[p]=j[t]}l++}j=m}catch(x){}}c.helper.dropped=
true;if(b.beforedrop&&a.isFunction(b.beforedrop)){p=b.beforedrop.call(this,d,c,j,a("#"+e.id),a(this));typeof p!="undefined"&&(p!==null&&typeof p=="object")&&(j=p)}if(c.helper.dropped){var v;if(b.autoid)if(a.isFunction(b.autoid))v=b.autoid.call(this,j);else{v=Math.ceil(Math.random()*1E3);v=b.autoidprefix+v}a("#"+this.id).jqGrid("addRowData",v,j,b.droppos)}b.ondrop&&a.isFunction(b.ondrop)&&b.ondrop.call(this,d,c,j)}}},b.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active",
hoverClass:"ui-state-hover"},drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dropbyname:false,droppos:"first",autoid:true,autoidprefix:"dnd_"},d||{});if(d.connectWith){d.connectWith=d.connectWith.split(",");d.connectWith=a.map(d.connectWith,function(b){return a.trim(b)});a.data(e,"dnd",d);e.p.reccount!="0"&&!e.p.jqgdnd&&b();e.p.jqgdnd=true;for(var j=0;j<d.connectWith.length;j++)a(d.connectWith[j]).droppable(a.isFunction(d.drop)?d.drop.call(a(e),d):d.drop)}}}})},
gridResize:function(d){return this.each(function(){var b=this;if(b.grid&&a.fn.resizable){d=a.extend({},d||{});if(d.alsoResize){d._alsoResize_=d.alsoResize;delete d.alsoResize}else d._alsoResize_=false;if(d.stop&&a.isFunction(d.stop)){d._stop_=d.stop;delete d.stop}else d._stop_=false;d.stop=function(e,j){a(b).jqGrid("setGridParam",{height:a("#gview_"+b.p.id+" .ui-jqgrid-bdiv").height()});a(b).jqGrid("setGridWidth",j.size.width,d.shrinkToFit);d._stop_&&d._stop_.call(b,e,j)};d.alsoResize=d._alsoResize_?
eval("("+("{'#gview_"+b.p.id+" .ui-jqgrid-bdiv':true,'"+d._alsoResize_+"':true}")+")"):a(".ui-jqgrid-bdiv","#gview_"+b.p.id);delete d._alsoResize_;a("#gbox_"+b.p.id).resizable(d)}})}})})(m)});define("jquery-layout",["jquery"],function(m){(function(e){e.layout={browser:{mozilla:!!Aloha.browser.mozilla,webkit:!!Aloha.browser.webkit||!!Aloha.browser.safari,msie:!!Aloha.browser.msie,isIE6:Aloha.browser.msie&&6==Aloha.browser.version,boxModel:!1!==e.support.boxModel||!Aloha.browser.msie,version:Aloha.browser.version},
scrollbarWidth:function(){return window.scrollbarWidth||e.layout.getScrollbarSize("width")},scrollbarHeight:function(){return window.scrollbarHeight||e.layout.getScrollbarSize("height")},getScrollbarSize:function(a){var j=e('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; overflow: scroll;"></div>').appendTo("body"),d={width:j.width()-j[0].clientWidth,height:j.height()-j[0].clientHeight};j.remove();window.scrollbarWidth=d.width;window.scrollbarHeight=d.height;
return a.match(/^(width|height)$/i)?d[a]:d},showInvisibly:function(a,j){if(!a)return{};a.jquery||(a=e(a));var d={display:a.css("display"),visibility:a.css("visibility")};return j||"none"==d.display?(a.css({display:"block",visibility:"hidden"}),d):{}},getElemDims:function(a){var j={},d=j.css={},b={},f,l,g=a.offset();j.offsetLeft=g.left;j.offsetTop=g.top;e.each(["Left","Right","Top","Bottom"],function(g,c){f=d["border"+c]=e.layout.borderWidth(a,c);l=d["padding"+c]=e.layout.cssNum(a,"padding"+c);b[c]=
f+l;j["inset"+c]=l});j.offsetWidth=a.innerWidth();j.offsetHeight=a.innerHeight();j.outerWidth=a.outerWidth();j.outerHeight=a.outerHeight();j.innerWidth=j.outerWidth-b.Left-b.Right;j.innerHeight=j.outerHeight-b.Top-b.Bottom;d.width=a.width();d.height=a.height();return j},getElemCSS:function(a,e){var d={},b=a[0].style,f=e.split(","),l=["Top","Bottom","Left","Right"],g=["Color","Style","Width"],k,c,m,n,o,p;for(n=0;n<f.length;n++)if(k=f[n],k.match(/(border|padding|margin)$/))for(o=0;4>o;o++)if(c=l[o],
"border"==k)for(p=0;3>p;p++)m=g[p],d[k+c+m]=b[k+c+m];else d[k+c]=b[k+c];else d[k]=b[k];return d},cssWidth:function(a,j){var d=e.layout.borderWidth,b=e.layout.cssNum;if(0>=j)return 0;if(!e.layout.browser.boxModel)return j;d=j-d(a,"Left")-d(a,"Right")-b(a,"paddingLeft")-b(a,"paddingRight");return Math.max(0,d)},cssHeight:function(a,j){var d=e.layout.borderWidth,b=e.layout.cssNum;if(0>=j)return 0;if(!e.layout.browser.boxModel)return j;d=j-d(a,"Top")-d(a,"Bottom")-b(a,"paddingTop")-b(a,"paddingBottom");
return Math.max(0,d)},cssNum:function(a,j){a.jquery||(a=e(a));var d=e.layout.showInvisibly(a),b=parseInt(e.curCSS(a[0],j,!0),10)||0;a.css(d);return b},borderWidth:function(a,j){a.jquery&&(a=a[0]);var d="border"+j.substr(0,1).toUpperCase()+j.substr(1);return"none"==e.curCSS(a,d+"Style",!0)?0:parseInt(e.curCSS(a,d+"Width",!0),10)||0},isMouseOverElem:function(a,j){var d=e(j||this),b=d.offset(),f=b.top,b=b.left,l=b+d.outerWidth(),d=f+d.outerHeight(),g=a.pageX,k=a.pageY;return e.layout.browser.msie&&0>
g&&0>k||g>=b&&g<=l&&k>=f&&k<=d}};e.fn.layout=function(a){var j,d,b,f,l,g,k;function c(a){if(!a)return!0;var b=a.keyCode;if(33>b)return!0;var c={38:"north",40:"south",37:"west",39:"east"},d=a.shiftKey,f=a.ctrlKey,g,j,k,l;f&&(37<=b&&40>=b)&&y[c[b]].enableCursorHotkey?l=c[b]:(f||d)&&e.each(G.borderPanes.split(","),function(a,c){g=y[c];j=g.customHotkey;k=g.customHotkeyModifier;if(d&&"SHIFT"==k||f&&"CTRL"==k||f&&d)if(j&&b==(isNaN(j)||9>=j?j.toUpperCase().charCodeAt(0):j))return l=c,!1});if(!l||!T[l]||
!y[l].closable||D[l].isHidden)return!0;na(l);a.stopPropagation();return a.returnValue=!1}function m(a){this&&this.tagName&&(a=this);var b;B(a)?b=T[a]:e(a).data("layoutRole")?b=e(a):e(a).parents().each(function(){if(e(this).data("layoutRole"))return b=e(this),!1});if(b&&b.length){var c=b.data("layoutEdge"),a=D[c];a.cssSaved&&n(c);if(a.isSliding||a.isResizing||a.isClosed)a.cssSaved=!1;else{var d={zIndex:G.zIndex.pane_normal+2},f={},g=b.css("overflow"),j=b.css("overflowX"),k=b.css("overflowY");"visible"!=
g&&(f.overflow=g,d.overflow="visible");j&&!j.match(/visible|auto/)&&(f.overflowX=j,d.overflowX="visible");k&&!k.match(/visible|auto/)&&(f.overflowY=j,d.overflowY="visible");a.cssSaved=f;b.css(d);e.each(G.allPanes.split(","),function(a,b){b!=c&&n(b)})}}}function n(a){this&&this.tagName&&(a=this);var b;B(a)?b=T[a]:e(a).data("layoutRole")?b=e(a):e(a).parents().each(function(){if(e(this).data("layoutRole"))return b=e(this),!1});if(b&&b.length){var a=b.data("layoutEdge"),a=D[a],c=a.cssSaved||{};!a.isSliding&&
!a.isResizing&&b.css("zIndex",G.zIndex.pane_normal);b.css(c);a.cssSaved=!1}}function o(a,c,f){var g=e(a);if(g.length)if(-1==G.borderPanes.indexOf(c))alert(j+b.toLowerCase()+": "+c);else return a=y[c].buttonClass+"-"+f,g.addClass(a+" "+a+"-"+c).data("layoutName",y.name),g;else alert(j+d+": "+a);return null}function p(a,b,c){switch(b.toLowerCase()){case "toggle":r(a,c);break;case "open":t(a,c);break;case "close":x(a,c);break;case "pin":v(a,c);break;case "toggle-slide":r(a,c,!0);break;case "open-slide":t(a,
c,!0)}}function r(a,b,c){(a=o(a,b,"toggle"))&&a.click(function(a){na(b,!!c);a.stopPropagation()})}function t(a,b,c){(a=o(a,b,"open"))&&a.attr("title",f).click(function(a){sa(b,!!c);a.stopPropagation()})}function x(a,b){var c=o(a,b,"close");c&&c.attr("title",l).click(function(a){za(b);a.stopPropagation()})}function v(a,b){var c=o(a,b,"pin");if(c){var d=D[b];c.click(function(a){z(e(this),b,d.isSliding||d.isClosed);d.isSliding||d.isClosed?sa(b):za(b);a.stopPropagation()});z(c,b,!d.isClosed&&!d.isSliding);
G[b].pins.push(a)}}function u(a,b){e.each(G[a].pins,function(c,d){z(e(d),a,b)})}function z(a,b,c){var d=a.attr("pin");if(!(d&&c==("down"==d))){var d=y[b].buttonClass+"-pin",e=d+"-"+b,b=d+"-up "+e+"-up",d=d+"-down "+e+"-down";a.attr("pin",c?"down":"up").attr("title",c?g:k).removeClass(c?b:d).addClass(c?d:b)}}function C(a){for(var a=e.extend({},y.cookie,a||{}).name||y.name||"Layout",b=document.cookie,b=b?b.split(";"):[],c,d=0,f=b.length;d<f;d++)if(c=e.trim(b[d]).split("="),c[0]==a)return O(decodeURIComponent(c[1]));
return""}function F(a,b){var c=e.extend({},y.cookie,b||{}),d=c.name||y.name||"Layout",f="",g="",j=!1;c.expires.toUTCString?g=c.expires:"number"==typeof c.expires&&(g=new Date,0<c.expires?g.setDate(g.getDate()+c.expires):(g.setYear(1970),j=!0));g&&(f+=";expires="+g.toUTCString());c.path&&(f+=";path="+c.path);c.domain&&(f+=";domain="+c.domain);c.secure&&(f+=";secure");j?(D.cookie={},document.cookie=d+"="+f):(D.cookie=J(a||c.keys),document.cookie=d+"="+encodeURIComponent(K(D.cookie))+f);return e.extend({},
D.cookie)}function A(a){if(a=C(a))D.cookie=e.extend({},a),E(a);return a}function E(a,b){e.extend(!0,y,a);if(D.initialized){var c,d,f=!b;e.each(G.allPanes.split(","),function(b,e){c=a[e];"object"==typeof c&&(d=c.initHidden,!0===d&&oa(e,f),!1===d&&Wa(e,!1,f),d=c.size,0<d&&ma(e,d),d=c.initClosed,!0===d&&za(e,!1,f),!1===d&&sa(e,!1,f))})}}function J(a){var b={},c={isClosed:"initClosed",isHidden:"initHidden"},d,f,g;a||(a=y.cookie.keys);e.isArray(a)&&(a=a.join(","));for(var a=a.replace(/__/g,".").split(","),
j=0,k=a.length;j<k;j++)d=a[j].split("."),f=d[0],d=d[1],0>G.allPanes.indexOf(f)||(g=D[f][d],void 0!=g&&("isClosed"==d&&D[f].isSliding&&(g=!0),(b[f]||(b[f]={}))[c[d]?c[d]:d]=g));return b}function K(a){function b(a){var c=[],d=0,e,f,g;for(e in a)f=a[e],g=typeof f,"string"==g?f='"'+f+'"':"object"==g&&(f=b(f)),c[d++]='"'+e+'":'+f;return"{"+c.join(",")+"}"}return b(a)}function O(a){try{return window.eval("("+a+")")||{}}catch(b){return{}}}b="Pane";f="Open";l="Close";k="Pin";g="Un-Pin";d="selector";j="Error Adding Button \n\nInvalid ";
var y={name:"",containerClass:"ui-layout-container",scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,autoBindCustomButtons:!1,zIndex:null,defaults:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",
resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerTip_open:l,togglerTip_closed:f,togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskIframesOnResize:!0,resizeNestedLayout:!0,resizeWhileDragging:!1,resizeContentWhileDragging:!1,
noRoomToOpenTip:"Not enough room to show this pane.",resizerTip:"Resize",sliderTip:"Slide Open",sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:!(!e.browser.webkit&&!e.browser.safari),preventPrematureSlideClose:!1,showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,triggerEventsOnLoad:!1,triggerEventsWhileDragging:!0,
onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",
size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0},useStateCookie:!1,cookie:{name:"",autoSave:!0,autoLoad:!0,domain:"",path:"",expires:"",secure:!1,keys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden"}},Y={slide:{all:{duration:"fast"},north:{direction:"up"},
south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},scale:{all:{duration:"fast"}}},D={id:"layout"+(new Date).getTime(),initialized:!1,container:{},north:{},south:{},east:{},west:{},center:{},cookie:{}},G={allPanes:"north,south,west,east,center",borderPanes:"north,south,west,east",altSide:{north:"south",south:"north",east:"west",west:"east"},hidden:{visibility:"hidden"},
visible:{visibility:"visible"},zIndex:{pane_normal:1,resizer_normal:2,iframe_mask:2,pane_sliding:100,pane_animate:1E3,resizer_drag:1E4},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden"},cssDemo:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDemo:{background:"#AAA"}},content:{cssReq:{position:"relative"},
cssDemo:{overflow:"auto",padding:"10px"},cssDemoPane:{overflow:"hidden",padding:0}},panes:{cssReq:{position:"absolute",margin:0},cssDemo:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{side:"Top",sizeType:"Height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"},pins:[]},south:{side:"Bottom",sizeType:"Height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"},pins:[]},east:{side:"Right",sizeType:"Width",dir:"vert",cssReq:{left:"auto",
right:0,top:"auto",bottom:"auto",height:"auto"},pins:[]},west:{side:"Left",sizeType:"Width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"},pins:[]},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}},N={data:{},set:function(a,b,c){N.clear(a);N.data[a]=setTimeout(b,c)},clear:function(a){var b=N.data;b[a]&&(clearTimeout(b[a]),delete b[a])}},B=function(a){try{return"string"==typeof a||"object"==typeof a&&null!==
a.constructor.toString().match(/string/i)}catch(b){return!1}},H=function(a,b){return Math.max(a,b)},R=function(a){var b,c={cookie:{},defaults:{fxSettings:{}},north:{fxSettings:{}},south:{fxSettings:{}},east:{fxSettings:{}},west:{fxSettings:{}},center:{fxSettings:{}}},a=a||{};a.effects||a.cookie||a.defaults||a.north||a.south||a.west||a.east||a.center?c=e.extend(!0,c,a):e.each(a,function(a,d){b=a.split("__");if(!b[1]||c[b[0]])c[b[1]?b[0]:"defaults"][b[1]?b[1]:b[0]]=d});return c},L=function(a,b,c){function d(g){var j=
G[g];j.doCallback?(f.push(g),g=j.callback.split(",")[1],g!=b&&0<=!e.inArray(g,f)&&d(g)):(j.doCallback=!0,j.callback=a+","+b+","+(c?1:0))}var f=[];e.each(G.borderPanes.split(","),function(a,b){if(G[b].isMoving)return d(b),!1})},S=function(a){a=G[a];G.isLayoutBusy=!1;delete a.isMoving;if(a.doCallback&&a.callback){a.doCallback=!1;var b=a.callback.split(","),c=0<b[2]?!0:!1;"open"==b[0]?sa(b[1],c):"close"==b[0]&&za(b[1],c);a.doCallback||(a.callback=null)}},P=function(a,b){if(b){var c;try{if("function"==
typeof b)c=b;else if(B(b))if(b.match(/,/)){var d=b.split(",");c=eval(d[0]);if("function"==typeof c&&1<d.length)return c(d[1])}else c=eval(b);else return;if("function"==typeof c)return a&&T[a]?c(a,T[a],e.extend({},D[a]),y[a],y.name):c(Ra,e.extend({},D),y,y.name)}catch(f){}}},W=function(a,b){if(!a)return{};a.jquery||(a=e(a));var c={display:a.css("display"),visibility:a.css("visibility")};return b||"none"==c.display?(a.css({display:"block",visibility:"hidden"}),c):{}},la=function(a){if(!D.browser.mozilla){var b=
T[a];"IFRAME"==D[a].tagName?b.css(G.hidden).css(G.visible):b.find("IFRAME").css(G.hidden).css(G.visible)}},ka=function(a,b){a.jquery||(a=e(a));var c=W(a),d=parseInt(e.curCSS(a[0],b,!0),10)||0;a.css(c);return d},X=function(a,b){a.jquery&&(a=a[0]);var c="border"+b.substr(0,1).toUpperCase()+b.substr(1);return"none"==e.curCSS(a,c+"Style",!0)?0:parseInt(e.curCSS(a,c+"Width",!0),10)||0},U=function(a,b){var c=B(a),d=c?T[a]:e(a);isNaN(b)&&(b=c?I(a):d.outerWidth());if(0>=b)return 0;if(!D.browser.boxModel)return b;
c=b-X(d,"Left")-X(d,"Right")-ka(d,"paddingLeft")-ka(d,"paddingRight");return H(0,c)},V=function(a,b){var c=B(a),d=c?T[a]:e(a);isNaN(b)&&(b=c?I(a):d.outerHeight());if(0>=b)return 0;if(!D.browser.boxModel)return b;c=b-X(d,"Top")-X(d,"Bottom")-ka(d,"paddingTop")-ka(d,"paddingBottom");return H(0,c)},ga=function(a){var b=G[a].dir,a={minWidth:1001-U(a,1E3),minHeight:1001-V(a,1E3)};"horz"==b&&(a.minSize=a.minHeight);"vert"==b&&(a.minSize=a.minWidth);return a},Z=function(a,b,c){var d=a;B(a)?d=T[a]:a.jquery||
(d=e(a));a=V(d,b);d.css({height:a,visibility:"visible"});0<a&&0<d.innerWidth()?c&&d.data("autoHidden")&&(d.show().data("autoHidden",!1),D.browser.mozilla||d.css(G.hidden).css(G.visible)):c&&!d.data("autoHidden")&&d.hide().data("autoHidden",!0)},ea=function(a,b,c){c||(c=G[a].dir);B(b)&&b.match(/%/)&&(b=parseInt(b,10)/100);if(0===b)return 0;if(1<=b)return parseInt(b,10);if(0<b){var a=y,d;"horz"==c?d=aa.innerHeight-(T.north?a.north.spacing_open:0)-(T.south?a.south.spacing_open:0):"vert"==c&&(d=aa.innerWidth-
(T.west?a.west.spacing_open:0)-(T.east?a.east.spacing_open:0));return Math.floor(d*b)}if("center"==a)return 0;d=T[a];var c="horz"==c?"height":"width",a=W(d),e=d.css(c);d.css(c,"auto");b="height"==c?d.outerHeight():d.outerWidth();d.css(c,e).css(a);return b},I=function(a,b){var c=T[a],d=y[a],e=D[a],f=b?d.spacing_open:0,d=b?d.spacing_closed:0;return!c||e.isHidden?0:e.isClosed||e.isSliding&&b?d:"horz"==G[a].dir?c.outerHeight()+f:c.outerWidth()+f},ha=function(a,b){var c=y[a],d=D[a],e=G[a],f=e.dir;e.side.toLowerCase();
e.sizeType.toLowerCase();var e=void 0!=b?b:d.isSliding,g=c.spacing_open,j=G.altSide[a],k=D[j],l=T[j],m=!l||!1===k.isVisible||k.isSliding?0:"horz"==f?l.outerHeight():l.outerWidth(),j=(!l||k.isHidden?0:y[j][!1!==k.isClosed?"spacing_closed":"spacing_open"])||0,k="horz"==f?aa.innerHeight:aa.innerWidth,l=ga("center"),l="horz"==f?H(y.center.minHeight,l.minHeight):H(y.center.minWidth,l.minWidth),e=k-g-(e?0:ea("center",l,f)+m+j),f=d.minSize=H(ea(a,c.minSize),ga(a).minSize),g=c.maxSize?ea(a,c.maxSize):1E5,
e=Math.min(g,e),e=d.maxSize=e,d=d.resizerPosition={},g=aa.insetTop,m=aa.insetLeft,j=aa.innerWidth,k=aa.innerHeight,c=c.spacing_open;switch(a){case "north":d.min=g+f;d.max=g+e;break;case "west":d.min=m+f;d.max=m+e;break;case "south":d.min=g+k-e-c;d.max=g+k-f-c;break;case "east":d.min=m+j-e-c,d.max=m+j-f-c}},Da=function(a){var b={},c=b.css={},d={},f,g,j=a.offset();b.offsetLeft=j.left;b.offsetTop=j.top;e.each(["Left","Right","Top","Bottom"],function(e,j){f=c["border"+j]=X(a,j);g=c["padding"+j]=ka(a,
"padding"+j);d[j]=f+g;b["inset"+j]=g});b.offsetWidth=a.innerWidth();b.offsetHeight=a.innerHeight();b.outerWidth=a.outerWidth();b.outerHeight=a.outerHeight();b.innerWidth=b.outerWidth-d.Left-d.Right;b.innerHeight=b.outerHeight-d.Top-d.Bottom;c.width=a.width();c.height=a.height();return b},da=function(a,b){var c={},d=a[0].style,e=b.split(","),f=["Top","Bottom","Left","Right"],g=["Color","Style","Width"],j,k,l,m,n,o;for(m=0;m<e.length;m++)if(j=e[m],j.match(/(border|padding|margin)$/))for(n=0;4>n;n++)if(k=
f[n],"border"==j)for(o=0;3>o;o++)l=g[o],c[j+k+l]=d[j+k+l];else c[j+k]=d[j+k];else c[j]=d[j];return c},va=function(a,b){var c=e(a),d=c.data("layoutRole"),f=c.data("layoutEdge"),g=y[f][d+"Class"],f="-"+f,j=c.hasClass(g+"-closed")?"-closed":"-open",k="-closed"==j?"-open":"-closed",j=g+"-hover "+(g+f+"-hover ")+(g+j+"-hover ")+(g+f+j+"-hover ");b&&(j+=g+k+"-hover "+(g+f+k+"-hover "));"resizer"==d&&c.hasClass(g+"-sliding")&&(j+=g+"-sliding-hover "+(g+f+"-sliding-hover "));return e.trim(j)},pa=function(a,
b){var c=e(b||this);a&&"toggler"==c.data("layoutRole")&&a.stopPropagation();c.addClass(va(c))},qa=function(a,b){var c=e(b||this);c.removeClass(va(c,!0))},Ga=function(a){e("body").disableSelection();pa(a,this)},ja=function(a,b){var c=b||this,d=e(c).data("layoutEdge"),f=d+"ResizerLeave";N.clear(d+"_openSlider");N.clear(f);b?D[d].isResizing||e("body").enableSelection():(qa(a,this),N.set(f,function(){ja(a,c)},200))},Ea=function(){var a=Number(y.resizeWithWindowDelay)||100;0<a&&(N.clear("winResize"),N.set("winResize",
function(){N.clear("winResize");N.clear("winResizeRepeater");Oa()},a),N.data.winResizeRepeater||Va())},Va=function(){var a=Number(y.resizeWithWindowMaxDelay);0<a&&N.set("winResizeRepeater",function(){Va();Oa()},a)},kb=function(){var a=y;D.cookie=J();P(null,a.onunload_start);a.useStateCookie&&a.cookie.autoSave&&F();P(null,a.onunload_end||a.onunload)},gb=function(a){if(!a||"all"==a)a=G.borderPanes;e.each(a.split(","),function(a,b){var d=y[b];if(d.enableCursorHotkey||d.customHotkey)return e(document).bind("keydown."+
ba,c),!1})},lb=function(){function b(a){for(var d in c)void 0!=a[d]&&(a[c[d]]=a[d],delete a[d])}a=R(a);var c={applyDefaultStyles:"applyDemoStyles"};b(a.defaults);e.each(G.allPanes.split(","),function(c,d){b(a[d])});a.effects&&(e.extend(Y,a.effects),delete a.effects);e.extend(y.cookie,a.cookie);e.each("name containerClass zIndex scrollToBookmarkOnLoad resizeWithWindow resizeWithWindowDelay resizeWithWindowMaxDelay onresizeall onresizeall_start onresizeall_end onload onload_start onload_end onunload onunload_start onunload_end autoBindCustomButtons useStateCookie".split(" "),
function(b,c){if(a[c]!==void 0)y[c]=a[c];else if(a.defaults[c]!==void 0){y[c]=a.defaults[c];delete a.defaults[c]}});e.each(["paneSelector","resizerCursor","customHotkey"],function(b,c){delete a.defaults[c]});e.extend(!0,y.defaults,a.defaults);G.center=e.extend(!0,{},G.panes,G.center);var d=y.zIndex;if(0===d||0<d)G.zIndex.pane_normal=d,G.zIndex.resizer_normal=d+1,G.zIndex.iframe_mask=d+1;e.extend(y.center,a.center);var f=e.extend(!0,{},y.defaults,a.defaults,y.center);e.each("paneClass contentSelector applyDemoStyles triggerEventsOnLoad showOverflowOnHover onresize onresize_start onresize_end resizeNestedLayout resizeContentWhileDragging onsizecontent onsizecontent_start onsizecontent_end".split(" "),
function(a,b){y.center[b]=f[b]});var g,j=y.defaults;e.each(G.borderPanes.split(","),function(b,c){G[c]=e.extend(true,{},G.panes,G[c]);g=y[c]=e.extend(true,{},y.defaults,y[c],a.defaults,a[c]);if(!g.paneClass)g.paneClass="ui-layout-pane";if(!g.resizerClass)g.resizerClass="ui-layout-resizer";if(!g.togglerClass)g.togglerClass="ui-layout-toggler";e.each(["_open","_close",""],function(b,d){var f="fxName"+d,k="fxSpeed"+d,l="fxSettings"+d;g[f]=a[c][f]||a[c].fxName||a.defaults[f]||a.defaults.fxName||g[f]||
g.fxName||j[f]||j.fxName||"none";var m=g[f];if(m=="none"||!e.effects||!e.effects[m]||!Y[m]&&!g[l]&&!g.fxSettings)m=g[f]="none";m=Y[m]||{};f=m.all||{};m=m[c]||{};g[l]=e.extend({},f,m,j.fxSettings||{},j[l]||{},g.fxSettings,g[l],a.defaults.fxSettings,a.defaults[l]||{},a[c].fxSettings,a[c][l]||{});g[k]=a[c][k]||a[c].fxSpeed||a.defaults[k]||a.defaults.fxSpeed||g[k]||g[l].duration||g.fxSpeed||g.fxSettings.duration||j.fxSpeed||j.fxSettings.duration||m.duration||f.duration||"normal"})})},M=function(a){a=
y[a].paneSelector;if("#"===a.substr(0,1))return ua.find(a).eq(0);var b=ua.children(a).eq(0);return b.length?b:ua.children("form:first").children(a).eq(0)},ta=function(){e.each(G.allPanes.split(","),function(a,b){$a(b)});La();e.each(G.borderPanes.split(","),function(a,b){T[b]&&D[b].isVisible&&(ha(b),Ua(b))});Ja("center");e.each(G.allPanes.split(","),function(a,b){var c=y[b];T[b]&&D[b].isVisible&&(c.triggerEventsOnLoad&&P(b,c.onresize_end||c.onresize),Pa(b))});2>ua.innerHeight()&&alert("UI Layout Initialization Warning\n\nThe layout-container \"CONTAINER\" has no height.\n\nTherefore the layout is 0-height and hence 'invisible'!".replace(/CONTAINER/,
aa.ref))},$a=function(a){var b=y[a],c=D[a],d=G[a],e=d.dir,f="center"==a,g={},j=T[a],k;j?Fa(a):xa[a]=!1;j=T[a]=M(a);if(j.length){j.data("layoutCSS")||j.data("layoutCSS",da(j,"position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"));j.data("parentLayout",Ra).data("layoutRole","pane").data("layoutEdge",a).css(d.cssReq).css("zIndex",G.zIndex.pane_normal).css(b.applyDemoStyles?d.cssDemo:{}).addClass(b.paneClass+" "+b.paneClass+"-"+a).bind("mouseenter."+
ba,pa).bind("mouseleave."+ba,qa);ab(a,!1);f||(k=c.size=ea(a,b.size),d=ea(a,b.minSize)||1,f=ea(a,b.maxSize)||1E5,0<k&&(k=H(Math.min(k,f),d)),c.isClosed=!1,c.isSliding=!1,c.isResizing=!1,c.isHidden=!1);c.tagName=j.attr("tagName");c.edge=a;c.noRoom=!1;c.isVisible=!0;switch(a){case "north":g.top=aa.insetTop;g.left=aa.insetLeft;g.right=aa.insetRight;break;case "south":g.bottom=aa.insetBottom;g.left=aa.insetLeft;g.right=aa.insetRight;break;case "west":g.left=aa.insetLeft;break;case "east":g.right=aa.insetRight}"horz"==
e?g.height=H(1,V(a,k)):"vert"==e&&(g.width=H(1,U(a,k)));j.css(g);"horz"!=e&&Ja(a,!0);c.noRoom||j.css({visibility:"visible",display:"block"});b.initClosed&&b.closable?za(a,!0,!0):(b.initHidden||b.initClosed)&&oa(a);b.showOverflowOnHover&&j.hover(m,n);D.initialized&&(La(a),gb(a),Oa(),c.isVisible&&(b.triggerEventsOnLoad&&P(a,b.onresize_end||b.onresize),Pa(a)))}else T[a]=!1},La=function(a){if(!a||"all"==a)a=G.borderPanes;e.each(a.split(","),function(a,b){var c=T[b];fa[b]=!1;ra[b]=!1;if(c){var c=y[b],
d=D[b],f=c.resizerClass,g=c.togglerClass;G[b].side.toLowerCase();var j="-"+b,k=fa[b]=e("<div></div>"),l=c.closable?ra[b]=e("<div></div>"):!1;!d.isVisible&&c.slidable&&k.attr("title",c.sliderTip).css("cursor",c.sliderCursor);k.attr("id","#"==c.paneSelector.substr(0,1)?c.paneSelector.substr(1)+"-resizer":"").data("parentLayout",Ra).data("layoutRole","resizer").data("layoutEdge",b).css(G.resizers.cssReq).css("zIndex",G.zIndex.resizer_normal).css(c.applyDemoStyles?G.resizers.cssDemo:{}).addClass(f+" "+
f+j).appendTo(ua);l&&(l.attr("id","#"==c.paneSelector.substr(0,1)?c.paneSelector.substr(1)+"-toggler":"").data("parentLayout",Ra).data("layoutRole","toggler").data("layoutEdge",b).css(G.togglers.cssReq).css(c.applyDemoStyles?G.togglers.cssDemo:{}).addClass(g+" "+g+j).appendTo(k),c.togglerContent_open&&e("<span>"+c.togglerContent_open+"</span>").data("layoutRole","togglerContent").data("layoutEdge",b).addClass("content content-open").css("display","none").appendTo(l),c.togglerContent_closed&&e("<span>"+
c.togglerContent_closed+"</span>").data("layoutRole","togglerContent").data("layoutEdge",b).addClass("content content-closed").css("display","none").appendTo(l),jb(b));sb(b);d.isVisible?ia(b):(Ha(b),Sa(b,!0))}});Ba("all")},ab=function(a,b){var c=y[a],d=c.contentSelector,e=T[a],f;d&&(f=xa[a]=c.findNestedContent?e.find(d).eq(0):e.children(d).eq(0));f&&f.length?(f.data("layoutCSS")||f.data("layoutCSS",da(f,"height")),f.css(G.content.cssReq),c.applyDemoStyles&&(f.css(G.content.cssDemo),e.css(G.content.cssDemoPane)),
D[a].content={},!1!==b&&Qa(a)):xa[a]=!1},hb=function(){var a;e.each("toggle open close pin toggle-slide open-slide".split(" "),function(b,c){e.each(G.borderPanes.split(","),function(b,d){e(".ui-layout-button-"+c+"-"+d).each(function(){a=e(this).data("layoutName")||e(this).attr("layoutName");(a==void 0||a==y.name)&&p(this,c,d)})})})},sb=function(a){var b="function"==typeof e.fn.draggable,c;if(!a||"all"==a)a=G.borderPanes;e.each(a.split(","),function(a,d){var f=y[d],g=D[d],j=G[d],k="horz"==j.dir?"top":
"left",l,m;if(!b||!T[d]||!f.resizable)return f.resizable=!1,!0;var n=fa[d],o=f.resizerClass,p=o+"-drag",q=o+"-"+d+"-drag",r=o+"-dragging",t=o+"-"+d+"-dragging",u=o+"-dragging-limit",v=o+"-"+d+"-dragging-limit",C=!1;g.isClosed||n.attr("title",f.resizerTip).css("cursor",f.resizerCursor);n.bind("mouseenter."+ba,Ga).bind("mouseleave."+ba,ja);n.draggable({containment:ua[0],axis:"horz"==j.dir?"y":"x",delay:0,distance:1,helper:"clone",opacity:f.resizerDragOpacity,addClasses:!1,zIndex:G.zIndex.resizer_drag,
start:function(){f=y[d];g=D[d];m=f.resizeWhileDragging;if(!1===P(d,f.ondrag_start))return!1;G.isLayoutBusy=!0;g.isResizing=!0;N.clear(d+"_closeSlider");ha(d);l=g.resizerPosition;n.addClass(p+" "+q);C=!1;c=e(!0===f.maskIframesOnResize?"iframe":f.maskIframesOnResize).filter(":visible");var a,b=0;c.each(function(){a="ui-layout-mask-"+ ++b;e(this).data("layoutMaskID",a);e('<div id="'+a+'" class="ui-layout-mask ui-layout-mask-'+d+'"/>').css({background:"#fff",opacity:"0.001",zIndex:G.zIndex.iframe_mask,
position:"absolute",width:this.offsetWidth+"px",height:this.offsetHeight+"px"}).css(e(this).position()).appendTo(this.parentNode)});e("body").disableSelection()},drag:function(a,b){C||(b.helper.addClass(r+" "+t).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),C=!0,g.isSliding&&T[d].css("zIndex",G.zIndex.pane_sliding));var c=0;b.position[k]<l.min?(b.position[k]=l.min,c=-1):b.position[k]>l.max&&(b.position[k]=l.max,c=1);c?(b.helper.addClass(u+" "+v),window.defaultStatus="Panel has reached its "+
(0<c&&d.match(/north|west/)||0>c&&d.match(/south|east/)?"maximum":"minimum")+" size"):(b.helper.removeClass(u+" "+v),window.defaultStatus="");m&&x(a,b,d)},stop:function(a,b){e("body").enableSelection();window.defaultStatus="";n.removeClass(p+" "+q);g.isResizing=!1;G.isLayoutBusy=!1;x(a,b,d,!0)}});var x=function(a,b,d,g){var a=b.position,b=G[d],j;switch(d){case "north":j=a.top;break;case "west":j=a.left;break;case "south":j=aa.offsetHeight-a.top-f.spacing_open;break;case "east":j=aa.offsetWidth-a.left-
f.spacing_open}if(g){if(e("div.ui-layout-mask").each(function(){this.parentNode.removeChild(this)}),!1===P(d,f.ondrag_end||f.ondrag))return!1}else c.each(function(){e("#"+e(this).data("layoutMaskID")).css(e(this).position()).css({width:this.offsetWidth+"px",height:this.offsetHeight+"px"})});Ia(d,j-aa["inset"+b.side])}})},Fa=function(a,b,c){if(T[a]){var d=T[a],f=xa[a],g=fa[a],j=ra[a],k=y[a].paneClass,l=k+"-"+a,k=[k,k+"-open",k+"-closed",k+"-sliding",l,l+"-open",l+"-closed",l+"-sliding"];e.merge(k,
va(d,!0));d&&d.length&&(b&&!d.data("layoutContainer")&&(!f||!f.length||!f.data("layoutContainer"))?d.remove():(d.removeClass(k.join(" ")).removeData("layoutParent").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("."+ba),d.data("layoutContainer")||d.css(d.data("layoutCSS")).removeData("layoutCSS"),f&&(f.length&&!f.data("layoutContainer"))&&f.css(f.data("layoutCSS")).removeData("layoutCSS")));j&&j.length&&j.remove();g&&g.length&&g.remove();T[a]=xa[a]=fa[a]=ra[a]=!1;
c||(Oa(),D[a]={})}},oa=function(a,b){var c=y[a],d=D[a],e=T[a],f=fa[a];if(e&&!d.isHidden&&!(D.initialized&&!1===P(a,c.onhide_start)))if(d.isSliding=!1,f&&f.hide(),!D.initialized||d.isClosed){if(d.isClosed=!0,d.isHidden=!0,d.isVisible=!1,e.hide(),Ja("horz"==G[a].dir?"all":"center"),D.initialized||c.triggerEventsOnLoad)P(a,c.onhide_end||c.onhide)}else d.isHiding=!0,za(a,!1,b)},Wa=function(a,b,c,d){var e=y[a],f=D[a];T[a]&&f.isHidden&&!1!==P(a,e.onshow_start)&&(f.isSliding=!1,f.isShowing=!0,!1===b?za(a,
!0):sa(a,!1,c,d))},na=function(a,b){B(a)||(a.stopImmediatePropagation(),a=e(this).data("layoutEdge"));var c=D[B(a)?e.trim(a):void 0==a||null==a?"":a];c.isHidden?Wa(a):c.isClosed?sa(a,!!b):za(a)},Db=function(a){var b=D[a];T[a].hide();b.isClosed=!0;b.isVisible=!1},za=function(a,b,c,d){function e(){if(j.isClosed){Sa(a,!0);var b=G.altSide[a];D[b].noRoom&&(ha(b),Ua(b));if(!d&&(D.initialized||g.triggerEventsOnLoad))k||P(a,g.onclose_end||g.onclose),k&&P(a,g.onshow_end||g.onshow),l&&P(a,g.onhide_end||g.onhide)}S(a)}
if(D.initialized){var f=T[a],g=y[a],j=D[a],c=!c&&!j.isClosed&&"none"!=g.fxName_close,k=j.isShowing,l=j.isHiding;delete j.isShowing;delete j.isHiding;if(f&&(g.closable||k||l)&&(b||!j.isClosed||k))if(G.isLayoutBusy)L("close",a,b);else if(k||!1!==P(a,g.onclose_start))(G[a].isMoving=!0,G.isLayoutBusy=!0,j.isClosed=!0,j.isVisible=!1,l?j.isHidden=!0:k&&(j.isHidden=!1),j.isSliding?Ta(a,!1):Ja("horz"==G[a].dir?"all":"center",!1),Ha(a),c)?(Aa(a,!0),f.hide(g.fxName_close,g.fxSettings_close,g.fxSpeed_close,
function(){Aa(a,false);e()})):(f.hide(),e())}else Db(a)},Ha=function(a){var b=fa[a],c=ra[a],d=y[a],f=G[a].side.toLowerCase(),g=d.resizerClass,j=d.togglerClass,k="-"+a;b.css(f,aa["inset"+G[a].side]).removeClass(g+"-open "+g+k+"-open").removeClass(g+"-sliding "+g+k+"-sliding").addClass(g+"-closed "+g+k+"-closed").unbind("dblclick."+ba);d.resizable&&"function"==typeof e.fn.draggable&&b.draggable("disable").removeClass("ui-state-disabled").css("cursor","default").attr("title","");c&&(c.removeClass(j+
"-open "+j+k+"-open").addClass(j+"-closed "+j+k+"-closed").attr("title",d.togglerTip_closed),c.children(".content-open").hide(),c.children(".content-closed").css("display","block"));u(a,!1);D.initialized&&Ba("all")},sa=function(a,b,c,d){function e(){j.isVisible&&(la(a),j.isSliding||Ja("vert"==G[a].dir?"center":"all",!1),ia(a));S(a)}var f=T[a],g=y[a],j=D[a],c=!c&&j.isClosed&&"none"!=g.fxName_open,k=j.isShowing;delete j.isShowing;if(f&&(g.resizable||g.closable||k)&&(!j.isVisible||j.isSliding))if(j.isHidden&&
!k)Wa(a,!0);else if(G.isLayoutBusy)L("open",a,b);else if(ha(a,b),!1!==P(a,g.onopen_start))j.minSize>j.maxSize?(u(a,!1),!d&&g.noRoomToOpenTip&&alert(g.noRoomToOpenTip)):(G[a].isMoving=!0,G.isLayoutBusy=!0,b?Ta(a,!0):j.isSliding?Ta(a,!1):g.slidable&&Sa(a,!1),j.noRoom=!1,Ua(a),j.isVisible=!0,j.isClosed=!1,k&&(j.isHidden=!1),c)?(Aa(a,!0),f.show(g.fxName_open,g.fxSettings_open,g.fxSpeed_open,function(){Aa(a,false);e()})):(f.show(),e())},ia=function(a,b){var c=T[a],d=fa[a],f=ra[a],g=y[a],j=D[a],k=G[a].side.toLowerCase(),
l=g.resizerClass,m=g.togglerClass,n="-"+a;d.css(k,aa["inset"+G[a].side]+I(a)).removeClass(l+"-closed "+l+n+"-closed").addClass(l+"-open "+l+n+"-open");j.isSliding?d.addClass(l+"-sliding "+l+n+"-sliding"):d.removeClass(l+"-sliding "+l+n+"-sliding");g.resizerDblClickToggle&&d.bind("dblclick",na);qa(0,d);g.resizable&&"function"==typeof e.fn.draggable?d.draggable("enable").css("cursor",g.resizerCursor).attr("title",g.resizerTip):j.isSliding||d.css("cursor","default");f&&(f.removeClass(m+"-closed "+m+
n+"-closed").addClass(m+"-open "+m+n+"-open").attr("title",g.togglerTip_open),qa(0,f),f.children(".content-closed").hide(),f.children(".content-open").css("display","block"));u(a,!j.isSliding);e.extend(j,Da(c));D.initialized&&(Ba("all"),Qa(a,!0));if(!b&&(D.initialized||g.triggerEventsOnLoad)&&c.is(":visible"))P(a,g.onopen_end||g.onopen),j.isShowing&&P(a,g.onshow_end||g.onshow),D.initialized&&(P(a,g.onresize_end||g.onresize),Pa(a))},wa=function(a){function b(){f.isClosed?G[d].isMoving||sa(d,!0):Ta(d,
!0)}var c=B(a)?null:a,d=c?e(this).data("layoutEdge"):a,f=D[d],a=y[d].slideDelay_open;c&&c.stopImmediatePropagation();f.isClosed&&c&&"mouseenter"==c.type&&0<a?N.set(d+"_openSlider",b,a):b()},cb=function(a){function b(){f.isClosed?Ta(d,!1):G[d].isMoving||za(d)}var c=B(a)?null:a,d=c?e(this).data("layoutEdge"):a,a=y[d],f=D[d],g=G[d].isMoving?1E3:300;!f.isClosed&&!f.isResizing&&("click"==a.slideTrigger_close?b():a.preventQuickSlideClose&&G.isLayoutBusy||a.preventPrematureSlideClose&&c&&e.layout.isMouseOverElem(c,
T[d])||(c?N.set(d+"_closeSlider",b,H(a.slideDelay_close,g)):b()))},Aa=function(a,b){var c=T[a];if(b)c.css({zIndex:G.zIndex.pane_animate}),"south"==a?c.css({top:aa.insetTop+aa.innerHeight-c.outerHeight()}):"east"==a&&c.css({left:aa.insetLeft+aa.innerWidth-c.outerWidth()});else{c.css({zIndex:D[a].isSliding?G.zIndex.pane_sliding:G.zIndex.pane_normal});"south"==a?c.css({top:"auto"}):"east"==a&&c.css({left:"auto"});var d=y[a];D.browser.msie&&(d.fxOpacityFix&&"slide"!=d.fxName_open&&c.css("filter")&&1==
c.css("opacity"))&&c[0].style.removeAttribute("filter")}},Sa=function(a,b){var c=y[a],d=fa[a],e=c.slideTrigger_open.toLowerCase();if(d&&(!b||c.slidable))e.match(/mouseover/)?e=c.slideTrigger_open="mouseenter":e.match(/click|dblclick|mouseenter/)||(e=c.slideTrigger_open="click"),d[b?"bind":"unbind"](e+"."+ba,wa).css("cursor",b?c.sliderCursor:"default").attr("title",b?c.sliderTip:"")},Ta=function(a,b){function c(b){N.clear(a+"_closeSlider");b.stopPropagation()}var d=y[a],e=D[a],f=G.zIndex,g=d.slideTrigger_close.toLowerCase(),
j=b?"bind":"unbind",k=T[a],l=fa[a];e.isSliding=b;N.clear(a+"_closeSlider");b&&Sa(a,!1);k.css("zIndex",b?f.pane_sliding:f.pane_normal);l.css("zIndex",b?f.pane_sliding:f.resizer_normal);g.match(/click|mouseleave/)||(g=d.slideTrigger_close="mouseleave");l[j](g,cb);"mouseleave"==g&&(k[j]("mouseleave."+ba,cb),l[j]("mouseenter."+ba,c),k[j]("mouseenter."+ba,c));b?"click"==g&&!d.resizable&&(l.css("cursor",b?d.sliderCursor:"default"),l.attr("title",b?d.togglerTip_open:"")):N.clear(a+"_closeSlider")},Ua=function(a,
b,c,d){var b=y[a],e=D[a],f=G[a],g=T[a],j=fa[a],k="vert"==f.dir,l=!1;if("center"==a||k&&e.noVerticalRoom)(l=0<e.maxHeight)&&e.noRoom?(g.show(),j&&j.show(),e.isVisible=!0,e.noRoom=!1,k&&(e.noVerticalRoom=!1),la(a)):!l&&!e.noRoom&&(g.hide(),j&&j.hide(),e.isVisible=!1,e.noRoom=!0);if("center"!=a)if(e.minSize<=e.maxSize){if(e.size>e.maxSize?ma(a,e.maxSize,c,d):e.size<e.minSize?ma(a,e.minSize,c,d):j&&g.is(":visible")&&(c=f.side.toLowerCase(),d=e.size+aa["inset"+f.side],ka(j,c)!=d&&j.css(c,d)),e.noRoom)e.wasOpen&&
b.closable?b.autoReopen?sa(a,!1,!0,!0):e.noRoom=!1:Wa(a,e.wasOpen,!0,!0)}else e.noRoom||(e.noRoom=!0,e.wasOpen=!e.isClosed&&!e.isSliding,e.isClosed||(b.closable?za(a,!0,!0):oa(a,!0)))},Ia=function(a,b,c){var d=y[a],e=d.resizeWhileDragging&&!G.isLayoutBusy;d.autoResize=!1;ma(a,b,c,e)},ma=function(a,b,c,d){var f=y[a],g=D[a],j=T[a],k=fa[a],l=G[a].side.toLowerCase(),m="inset"+G[a].side,n=G.isLayoutBusy&&!f.triggerEventsWhileDragging,o;ha(a);o=g.size;b=ea(a,b);b=H(b,ea(a,f.minSize));b=Math.min(b,g.maxSize);
if(b<g.minSize)Ua(a,!1,c);else if(d||b!=o)if(!c&&(D.initialized&&g.isVisible)&&P(a,f.onresize_start),j.css(G[a].sizeType.toLowerCase(),H(1,"horz"==G[a].dir?V(a,b):U(a,b))),g.size=b,e.extend(g,Da(j)),k&&j.is(":visible")&&k.css(l,b+aa[m]),Qa(a),!c&&(!n&&D.initialized&&g.isVisible)&&(P(a,f.onresize_end||f.onresize),Pa(a)),c||(g.isSliding||Ja("horz"==G[a].dir?"all":"center",n,d),Ba("all")),a=G.altSide[a],b<o&&D[a].noRoom)ha(a),Ua(a,!1,c)},Ja=function(a,b,c){if(!a||"all"==a)a="east,west,center";e.each(a.split(","),
function(a,d){if(T[d]){var f=y[d],g=D[d],j=T[d],k=!0,l={},k={top:I("north",!0),bottom:I("south",!0),left:I("west",!0),right:I("east",!0),width:0,height:0};k.width=aa.innerWidth-k.left-k.right;k.height=aa.innerHeight-k.bottom-k.top;k.top+=aa.insetTop;k.bottom+=aa.insetBottom;k.left+=aa.insetLeft;k.right+=aa.insetRight;e.extend(g,Da(j));if("center"==d){if(!c&&g.isVisible&&k.width==g.outerWidth&&k.height==g.outerHeight)return!0;e.extend(g,ga(d),{maxWidth:k.width,maxHeight:k.height});l=k;l.width=U(d,
k.width);l.height=V(d,k.height);k=0<l.width&&0<l.height;if(!k&&!D.initialized&&0<f.minWidth){var m=f.minWidth-g.outerWidth,n=y.east.minSize||0,o=y.west.minSize||0,p=D.east.size,q=D.west.size,r=p,t=q;0<m&&(D.east.isVisible&&p>n)&&(r=H(p-n,p-m),m-=p-r);0<m&&(D.west.isVisible&&q>o)&&(t=H(q-o,q-m),m-=q-t);if(0==m){p!=n&&ma("east",r,!0);q!=o&&ma("west",t,!0);Ja("center",b,c);return}}}else{g.isVisible&&!g.noVerticalRoom&&e.extend(g,Da(j),ga(d));if(!c&&!g.noVerticalRoom&&k.height==g.outerHeight)return!0;
l.top=k.top;l.bottom=k.bottom;l.height=V(d,k.height);g.maxHeight=H(0,l.height);k=0<g.maxHeight;k||(g.noVerticalRoom=!0)}k?(!b&&D.initialized&&P(d,f.onresize_start),j.css(l),g.noRoom&&(!g.isClosed&&!g.isHidden)&&Ua(d),g.isVisible&&(e.extend(g,Da(j)),D.initialized&&Qa(d))):!g.noRoom&&g.isVisible&&Ua(d);if(!g.isVisible)return!0;"center"==d&&(g=D.browser,g=g.isIE6||g.msie&&!g.boxModel,T.north&&(g||"IFRAME"==D.north.tagName)&&T.north.css("width",U(T.north,aa.innerWidth)),T.south&&(g||"IFRAME"==D.south.tagName)&&
T.south.css("width",U(T.south,aa.innerWidth)));!b&&D.initialized&&(P(d,f.onresize_end||f.onresize),Pa(d))}})},Oa=function(){e.extend(D.container,Da(ua));if(aa.outerHeight){if(!1===P(null,y.onresizeall_start))return!1;var a,b,c;e.each(["south","north","east","west"],function(a,d){T[d]&&(c=D[d],b=y[d],b.autoResize&&c.size!=b.size?ma(d,b.size,!0,!0):(ha(d),Ua(d,!1,!0,!0)))});Ja("all",!0,!0);Ba("all");b=y;e.each(G.allPanes.split(","),function(c,d){if((a=T[d])&&D[d].isVisible)P(d,b[d].onresize_end||b[d].onresize),
Pa(d)});P(null,b.onresizeall_end||b.onresizeall)}},Pa=function(a){var b=T[a],c=xa[a];y[a].resizeNestedLayout&&(b.data("layoutContainer")?b.layout().resizeAll():c&&c.data("layoutContainer")&&c.layout().resizeAll())},Qa=function(a,b){if(!a||"all"==a)a=G.allPanes;e.each(a.split(","),function(a,c){function d(a){return H(k.css.paddingBottom,parseInt(a.css("marginBottom"),10)||0)}function e(){var a=y[c].contentIgnoreSelector,a=g.nextAll().not(a||":lt(0)"),b=a.filter(":visible"),f=b.filter(":last");l={top:g[0].offsetTop,
height:g.outerHeight(),numFooters:a.length,hiddenFooters:a.length-b.length,spaceBelow:0};l.spaceAbove=l.top;l.bottom=l.top+l.height;l.spaceBelow=f.length?f[0].offsetTop+f.outerHeight()-l.bottom+d(f):d(g)}var f=T[c],g=xa[c],j=y[c],k=D[c],l=k.content;if(!f||!g||!f.is(":visible"))return!0;if(!1!==P(null,j.onsizecontent_start)){if(!G.isLayoutBusy||void 0==l.top||b||j.resizeContentWhileDragging)e(),0<l.hiddenFooters&&"hidden"==f.css("overflow")&&(f.css("overflow","visible"),e(),f.css("overflow","hidden"));
f=k.innerHeight-(l.spaceAbove-k.css.paddingTop)-(l.spaceBelow-k.css.paddingBottom);if(!g.is(":visible")||l.height!=f)Z(g,f,!0),l.height=f;D.initialized&&(P(c,j.onsizecontent_end||j.onsizecontent),Pa(c))}})},Ba=function(a){if(!a||"all"==a)a=G.borderPanes;e.each(a.split(","),function(a,b){var c=y[b],d=D[b],f=T[b],g=fa[b],j=ra[b],k;if(f&&g){var l=G[b].dir,m=d.isClosed?"_closed":"_open",n=c["spacing"+m],o=c["togglerAlign"+m],m=c["togglerLength"+m],p;if(0==n)g.hide();else{!d.noRoom&&!d.isHidden&&g.show();
"horz"==l?(p=f.outerWidth(),d.resizerLength=p,g.css({width:H(1,U(g,p)),height:H(0,V(g,n)),left:ka(f,"left")})):(p=f.outerHeight(),d.resizerLength=p,g.css({height:H(1,V(g,p)),width:H(0,U(g,n)),top:aa.insetTop+I("north",!0)}));qa(c,g);if(j){if(0==m||d.isSliding&&c.hideTogglerOnSlide){j.hide();return}j.show();if(!(0<m)||"100%"==m||m>p)m=p,o=0;else if(B(o))switch(o){case "top":case "left":o=0;break;case "bottom":case "right":o=p-m;break;default:o=Math.floor((p-m)/2)}else f=parseInt(o,10),o=0<=o?f:p-m+
f;if("horz"==l){var q=U(j,m);j.css({width:H(0,q),height:H(1,V(j,n)),left:o,top:0});j.children(".content").each(function(){k=e(this);k.css("marginLeft",Math.floor((q-k.outerWidth())/2))})}else{var r=V(j,m);j.css({height:H(0,r),width:H(1,U(j,n)),top:o,left:0});j.children(".content").each(function(){k=e(this);k.css("marginTop",Math.floor((r-k.outerHeight())/2))})}qa(0,j)}if(!D.initialized&&(c.initHidden||d.noRoom))g.hide(),j&&j.hide()}}})},jb=function(a){var b=ra[a],c=y[a];b&&(c.closable=!0,b.bind("click."+
ba,function(b){b.stopPropagation();na(a)}).bind("mouseenter."+ba,pa).bind("mouseleave."+ba,qa).css("visibility","visible").css("cursor","pointer").attr("title",D[a].isClosed?c.togglerTip_closed:c.togglerTip_open).show())},ua=e(this).eq(0);if(!ua.length)return null;if(ua.data("layoutContainer")&&ua.data("layout"))return ua.data("layout");var T={},xa={},fa={},ra={},aa=D.container,ba=D.id,Ra={options:y,state:D,container:ua,panes:T,contents:xa,resizers:fa,togglers:ra,toggle:na,hide:oa,show:Wa,open:sa,
close:za,slideOpen:wa,slideClose:cb,slideToggle:function(a){na(a,!0)},initContent:ab,sizeContent:Qa,sizePane:Ia,swapPanes:function(a,b){function c(a){var b=T[a],d=xa[a];return!b?!1:{pane:a,P:b?b[0]:!1,C:d?d[0]:!1,state:e.extend({},D[a]),options:e.extend({},y[a])}}function d(a,b){if(a){var c=a.P,f=a.C,g=a.pane,k=G[b],l=k.side.toLowerCase(),m="inset"+k.side,n=e.extend({},D[b]),o=y[b],p={resizerCursor:o.resizerCursor};e.each(["fxName","fxSpeed","fxSettings"],function(a,b){p[b]=o[b];p[b+"_open"]=o[b+
"_open"];p[b+"_close"]=o[b+"_close"]});T[b]=e(c).data("layoutEdge",b).css(G.hidden).css(k.cssReq);xa[b]=f?e(f):!1;y[b]=e.extend({},a.options,p);D[b]=e.extend({},a.state);c.className=c.className.replace(RegExp(o.paneClass+"-"+g,"g"),o.paneClass+"-"+b);La(b);k.dir!=G[g].dir?(c=j[b]||0,ha(b),c=H(c,D[b].minSize),Ia(b,c,!0)):fa[b].css(l,aa[m]+(D[b].isVisible?I(b):0));a.state.isVisible&&!n.isVisible?ia(b,!0):(Ha(b),Sa(b,!0));a=null}}D[a].edge=b;D[b].edge=a;var f=!1;!1===P(a,y[a].onswap_start)&&(f=!0);!f&&
!1===P(b,y[b].onswap_start)&&(f=!0);if(f)D[a].edge=a,D[b].edge=b;else{var f=c(a),g=c(b),j={};j[a]=f?f.state.size:0;j[b]=g?g.state.size:0;T[a]=!1;T[b]=!1;D[a]={};D[b]={};ra[a]&&ra[a].remove();ra[b]&&ra[b].remove();fa[a]&&fa[a].remove();fa[b]&&fa[b].remove();fa[a]=fa[b]=ra[a]=ra[b]=!1;d(f,b);d(g,a);f=g=j=null;T[a]&&T[a].css(G.visible);T[b]&&T[b].css(G.visible);Oa();P(a,y[a].onswap_end||y[a].onswap);P(b,y[b].onswap_end||y[b].onswap)}},resizeAll:Oa,destroy:function(){e(window).unbind("."+ba);e(document).unbind("."+
ba);e.each(G.allPanes.split(","),function(a,b){Fa(b,!1,!0)});var a=ua.removeData("layout").removeData("layoutContainer").removeClass(y.containerClass);!a.data("layoutEdge")&&a.data("layoutCSS")&&a.css(a.data("layoutCSS")).removeData("layoutCSS");"BODY"==aa.tagName&&(a=e("html")).data("layoutCSS")&&a.css(a.data("layoutCSS")).removeData("layoutCSS");kb()},addPane:$a,removePane:Fa,setSizeLimits:ha,bindButton:p,addToggleBtn:r,addOpenBtn:t,addCloseBtn:x,addPinBtn:v,allowOverflow:m,resetOverflow:n,encodeJSON:K,
decodeJSON:O,getState:J,getCookie:C,saveCookie:F,deleteCookie:function(){F("",{expires:-1})},loadCookie:A,loadState:E,cssWidth:U,cssHeight:V,enableClosable:jb,disableClosable:function(a,b){var c=ra[a];c&&(y[a].closable=!1,D[a].isClosed&&sa(a,!1,!0),c.unbind("."+ba).css("visibility",b?"hidden":"visible").css("cursor","default").attr("title",""))},enableSlidable:function(a){var b=fa[a];b&&b.data("draggable")&&(y[a].slidable=!0,s.isClosed&&Sa(a,!0))},disableSlidable:function(a){var b=fa[a];b&&(y[a].slidable=
!1,D[a].isSliding?za(a,!1,!0):(Sa(a,!1),b.css("cursor","default").attr("title",""),qa(null,b[0])))},enableResizable:function(a){var b=fa[a],c=y[a];b&&b.data("draggable")&&(c.resizable=!0,b.draggable("enable").bind("mouseenter."+ba,Ga).bind("mouseleave."+ba,ja),D[a].isClosed||b.css("cursor",c.resizerCursor).attr("title",c.resizerTip))},disableResizable:function(a){var b=fa[a];b&&b.data("draggable")&&(y[a].resizable=!1,b.draggable("disable").unbind("."+ba).css("cursor","default").attr("title",""),qa(null,
b[0]))}};(function(){lb();var a=y;if(!1===P(null,a.onload_start))return!1;if(!M("center").length)return alert("UI Layout Initialization Error\n\nThe center-pane element does not exist.\n\nThe center-pane is a required element."),null;a.useStateCookie&&a.cookie.autoLoad&&A();D.browser={mozilla:e.browser.mozilla,webkit:e.browser.webkit||e.browser.safari,msie:e.browser.msie,isIE6:e.browser.msie&&6==e.browser.version,boxModel:e.support.boxModel};var b=ua,c=aa.tagName=b.attr("tagName"),d="BODY"==c,f={};
aa.selector=b.selector.split(".slice")[0];aa.ref=c+"/"+aa.selector;b.data("layout",Ra).data("layoutContainer",ba).addClass(y.containerClass);b.data("layoutCSS")||(d?(f=e.extend(da(b,"position,margin,padding,border"),{height:b.css("height"),overflow:b.css("overflow"),overflowX:b.css("overflowX"),overflowY:b.css("overflowY")}),c=e("html"),c.data("layoutCSS",{height:"auto",overflow:c.css("overflow"),overflowX:c.css("overflowX"),overflowY:c.css("overflowY")})):f=da(b,"position,margin,padding,border,top,bottom,left,right,width,height,overflow,overflowX,overflowY"),
b.data("layoutCSS",f));try{if(d)e("html").css({height:"100%",overflow:"hidden",overflowX:"hidden",overflowY:"hidden"}),e("body").css({position:"relative",height:"100%",overflow:"hidden",overflowX:"hidden",overflowY:"hidden",margin:0,padding:0,border:"none"});else{var f={overflow:"hidden"},g=b.css("position");b.css("height");if(!b.data("layoutRole")&&(!g||!g.match(/fixed|absolute|relative/)))f.position="relative";b.css(f);b.is(":visible")&&2>b.innerHeight()&&alert("UI Layout Initialization Warning\n\nThe layout-container \"CONTAINER\" has no height.\n\nTherefore the layout is 0-height and hence 'invisible'!".replace(/CONTAINER/,
aa.ref))}}catch(j){}e.extend(D.container,Da(b));ta();Qa();a.scrollToBookmarkOnLoad&&(b=self.location,b.hash&&b.replace(b.hash));gb();a.autoBindCustomButtons&&hb();a.resizeWithWindow&&!ua.data("layoutRole")&&e(window).bind("resize."+ba,Ea);e(window).bind("unload."+ba,kb);D.initialized=!0;P(null,a.onload_end||a.onload)})();return Ra}})(m)});(function(){function m(e,a,j,d){function b(a){a.attr("unselectable","on");a.css({"-webkit-user-select":"none","user-select":"none"});a.onselectstart=function(){return!1}}
function f(a){e.each(x,function(a){this.element.css("z-index",v+a)});a.element.css("z-index",v+1+x.length)}function l(){var a=e('<div class="repository-browser-modal-window" style="z-index: '+v+';"></div>');e("body").append(a);return a}function g(){var a=e("body");a.removeAttr("unselectable");a.css({"-webkit-user-select":"all","user-select":"all"});a.onselectstart=null;e(".repository-browser-modal-overlay").hide()}function k(a){e.each("arrow-000-medium.png arrow-180.png arrow-315-medium.png arrow-stop-180.png arrow-stop.png arrow.png control-stop-square-small.png folder-horizontal-open.png folder-open.png magnifier-left.png page.png picture.png sort-alphabet-descending.png sort-alphabet.png".split(" "),
function(){document.createElement("img").src=a+"img/"+this})}function c(a,b,c){var d=e('<div class="repository-browser-tree-header repository-browser-grab-handle">'+a._i18n("Repository Browser")+"</div>"),f=e('<div class="repository-browser-tree"></div>');b.append(d,f);f.height(c-d.outerHeight(!0));f.bind("loaded.jstree",function(){e(this).find(">ul>li:first").css("padding-top",5);e(this).find('li[rel="repository"]:first').each(function(a,b){f.jstree("open_node",b)})});f.bind("select_node.jstree",
function(b,c){c.args[0].context||a.treeNodeSelected(c.rslt.obj)});f.bind("open_node.jstree",function(b,c){a.folderOpened(c.rslt.obj)});f.bind("close_node.jstree",function(b,c){a.folderClosed(c.rslt.obj)});f.jstree({types:a.types,rootFolderId:a.rootFolderId,plugins:["themes","json_data","ui","types"],core:{animation:250},ui:{select_limit:1},themes:{theme:"browser",url:a.rootPath+"css/jstree.css",dots:!0,icons:!0},json_data:{correct_state:!0,data:function(b,c){a.manager?(a.jstree_callback=c,a._fetchSubnodes.call(a,
b,c)):c()}}});return f}function m(a,b){var c=e('<div class="repository-browser-grid repository-browser-shadow repository-browser-top"><div class="ui-layout-west"></div><div class="ui-layout-center"></div></div>');b.append(c);return c}function n(a,b){var c=b.find(".ui-jqgrid-titlebar"),d='<div class="repository-browser-btns"><input type="text" class="repository-browser-search-field" /><span class="repository-browser-btn repository-browser-search-btn"><span class="repository-browser-search-icon"></span></span><span class="repository-browser-btn repository-browser-close-btn">'+
a._i18n("Close")+'</span><div class="repository-browser-clear"></div></div>';c.addClass("repository-browser-grab-handle").append(d);c.find(".repository-browser-search-btn").click(function(){a._triggerSearch()});var f=c.find(".repository-browser-search-field").keypress(function(b){13===b.keyCode&&(b.preventDefault(),a._triggerSearch())});f.val(a._i18n("Input search text...")).addClass("repository-browser-search-field-empty");f.focus(function(){f.val()===a._i18n("Input search text...")&&f.val("").removeClass("repository-browser-search-field-empty")});
f.blur(function(){""===f.val()&&f.val(a._i18n("Input search text...")).addClass("repository-browser-search-field-empty")});c.find(".repository-browser-close-btn").click(function(){a.close()});c.find(".repository-browser-btn").mousedown(function(){e(this).addClass("repository-browser-pressed")}).mouseup(function(){e(this).removeClass("repository-browser-pressed")});return c}function o(a,b,c){var d=e('<table id="list-'+ ++z+'" class="repository-browser-list"></table>'),f=[""],g=[{name:"id",sorttype:"int",
firstsortorder:"asc",hidden:!0}],j=a.listShrinkToFit;"number"!==typeof j&&"boolean"!==typeof j&&(j=parseInt(j,10),isNaN(j)&&(j="false"!==a.listShrinkToFit));e.each(a.columns,function(a,b){f.push(b.title||"&nbsp;");g.push({name:a,width:b.width,sortable:b.sortable,sorttype:b.sorttype,resizable:b.resizable,fixed:b.fixed})});var k="repository-browser-list-page-"+ ++z;b.append(d,'<div id="'+k+'" class="repository-browser-grab-handle"></div>');d.jqGrid({datatype:"local",width:b.width(),shrinkToFit:j,colNames:f,
colModel:g,caption:"&nbsp;",altRows:!0,altclass:"repository-browser-list-altrow",resizeclass:"repository-browser-list-resizable",pager:k,viewrecords:!0,onPaging:function(){},loadError:function(){},ondblClickRow:function(){},gridComplete:function(){},loadComplete:function(){}});b.find(".ui-jqgrid-bdiv").height(c-(b.find(".ui-jqgrid-titlebar").height()+b.find(".ui-jqgrid-hdiv").height()+b.find(".ui-jqgrid-pager").height()));d.click(function(){a.rowClicked.apply(a,arguments)});b.find(".ui-pg-button").unbind().find(">span.ui-icon").each(function(){var b=
e(this).parent(),c=this.className.match(/ui\-icon\-seek\-([a-z]+)/)[1];a._pagingBtns[c]=b;b.addClass("ui-state-disabled").click(function(){e(this).hasClass("ui-state-disabled")||a._doPaging(c)})});b.find(".ui-pg-input").parent().hide();b.find(".ui-separator").parent().css("opacity",0).first().hide();var l=d[0].p;b.find(".ui-jqgrid-view tr:first th div").each(function(b){if(false!==l.colModel[b].sortable){e(this).css("cursor","pointer");e(this).unbind().click(function(c){c.stopPropagation();a._sortList(l.colModel[b],
this)})}});n(a,b);return d}function p(a,d){var e=a.element.attr("data-repository-browser",++z),j=m(a,e);j.resize();e.css("width",d.maxWidth);j.css("width",d.maxWidth);var k=c(a,j.find(".ui-layout-west"),j.height()),l=o(a,j.find(".ui-layout-center"),j.height()),n=j.layout({west__size:d.treeWidth-1,west__minSize:0,west__maxSize:d.maxWidth,west__enableCursorHotkey:!1,center__size:"auto",paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",onresize:function(a,b){"center"===
a&&l.setGridWidth(b.width())}});e.hide();g();n.sizePane("west",d.treeWidth);e.resizable({autoHide:!0,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,handles:"all",resize:function(b,c){a._resizeHorizontal(d.maxWidth-c.size.width);a._resizeVertical(d.maxHeight-c.size.height);a._resizeInnerComponents()}});b(j);e.mousedown(function(){f(a)});return{$elem:e,$grid:j,$tree:k,$list:l}}var r=e(window),t=0,x=[],v=99999,u={repositoryManager:null,repositoryFilter:[],objectTypeFilter:[],
renditionFilter:["cmis:none"],filter:["url"],element:null,isFloating:!1,padding:50,maxHeight:1E3,minHeight:400,minWidth:660,maxWidth:2E3,treeWidth:300,listWidth:"auto",listShrinkToFit:!0,pageSize:10,adaptPageSize:!1,rowHeight:24,rootPath:"",rootFolderId:"aloha",columns:{icon:{title:"",width:30,sortable:!1,resizable:!1},name:{title:"Name",width:200,sorttype:"text"},url:{title:"URL",width:220,sorttype:"text"},preview:{title:"Preview",width:150,sorttype:"text"}},i18n:{Browsing:"Browsing",Close:"Close",
"in":"in","Input search text...":"Input search text...",numerous:"numerous",of:"of","Repository Browser":"Repository Browser",Search:"Search","Searching for":"Searching for",Viewing:"Viewing"}},z=(new Date).getTime(),a=a.extend({opened:!1,grid:null,tree:null,list:null,_searchQuery:null,_orderBy:null,_currentFolder:null,_objs:{},_resizeInnerComponents:function(){var a=this.grid.find(".repository-browser-tree-header"),b=this.grid.find(".ui-layout-center");this.tree.height(this.grid.height()-a.outerHeight(!0));
b.find(".ui-jqgrid-bdiv").height(this.grid.height()-(b.find(".ui-jqgrid-titlebar").height()+b.find(".ui-jqgrid-hdiv").height()+b.find(".ui-jqgrid-pager").height()));this._adaptPageSize()&&this._currentFolder&&this._fetchItems(this._currentFolder)},_resizeVertical:function(a){a=0<a?Math.max(this.minHeight,this.maxHeight-a):this.maxHeight;this.element.height(a);this.grid.height(a)},_resizeHorizontal:function(a){a=0<a?Math.max(this.minWidth,this.maxWidth-a):this.maxWidth;this.element.width(a);this.grid.width(a)},
_isResizeAllowed:function(){this.callsThisSecond=this.callsThisSecond||0;var a=Math.floor((new Date).getTime()/1E3);if(a===this.lastCall){if(10<=this.callsThisSecond)return!1;this.callsThisSecond++;return!0}this.lastCall=a;this.callsThisSecond=1;return!0},_onWindowResized:function(){this._isResizeAllowed()&&(this._resizeHorizontal(this.maxWidth-r.width()+this.padding),this._resizeVertical(this.maxHeight-r.height()+this.padding),this._resizeInnerComponents())},_clearSearch:function(){this.grid.find(".repository-browser-search-field").val(this._i18n("Input search text...")).addClass("repository-browser-search-field-empty");
this._searchQuery=null},_i18n:function(a){return this.i18n[a]||a},_adaptPageSize:function(){if(!this.adaptPageSize||!this.list||!this.rowHeight)return!1;var a=this.grid.find(".ui-jqgrid-bdiv").innerHeight()-20;return a&&(a=Math.floor(a/this.rowHeight),0>=a&&(a=1),a!==this.pageSize)?(this.pageSize=a,!0):!1},_constructor:function(){this.init.apply(this,arguments)},init:function(a){a.repositoryManager||e("body").trigger("repository-browser-error","Repository Manager not configured");var b=this,a=e.extend({},
u,a,{i18n:d});if(!a.element||0===a.element.length)a.isFloating=!0,a.element=l();b.manager=a.repositoryManager;b._objs={};b._searchQuery=null;b._orderBy=null;b._pagingOffset=0;b._pagingCount=void 0;b._pagingBtns={first:null,end:null,next:null,prev:null};e.extend(b,a);k(a.rootPath);a=p(b,a);b.grid=a.$grid;b.list=a.$list;b.tree=a.$tree;b.element=a.$elem;b.$_grid=b.grid;b.$_list=b.list;b._cachedRepositoryObjects=b._objs;b._adaptPageSize();b.close();r.resize(function(){b._onWindowResized()});b.manager&&
(b._currentFolder=b.getSelectedFolder(),b._fetchRepoRoot(b.jstree_callback));x.push(this);j.pub("repository-browser.initialized",{data:this})},harvestRepoObject:function(a){var b=++z;return this.processRepoObject(this._objs[b]=e.extend(a,{uid:b,loaded:!1}))},processRepoObject:function(a){var b="",c,d,f,g=this;switch(a.baseType){case "folder":b="folder";break;case "document":b="document"}a.type&&(c={rel:a.type,"data-rep-oobj":a.uid});d=a.hasMoreItems||"folder"===a.baseType?"closed":null;!1===a.hasMoreItems&&
(d=null);a.children&&(f=[],e.each(a.children,function(){f.push(g.harvestRepoObject(this));d="open"}));this._currentFolder&&this._currentFolder.id===a.id&&window.setTimeout(function(){g.tree.jstree("select_node",'li[data-rep-oobj="'+a.uid+'"]')},0);return{data:{title:a.name,attr:{"data-rep-oobj":a.uid},icon:b},attr:c,state:d,resource:a,children:f}},_processRepoResponse:function(a,b,c){var d=this,f=d._currentFolder&&d._currentFolder.id,g=[],j=null;"function"===typeof b&&(c=b,b=void 0);e.each(a,function(){g.push(d.harvestRepoObject(this));
f===this.id&&(j=this)});"function"===typeof c&&c.call(d,g,b);j&&window.setTimeout(function(){d.tree.jstree("select_node",'li[data-repo-obj="'+j.uid+'"]')},0)},_getObjectFromCache:function(a){if("object"===typeof a)return this._objs[a.find("a:first").attr("data-rep-oobj")]},queryRepository:function(a,b){var c=this;c.manager.query(a,function(a){c._processRepoResponse(0<a.results?a.items:[],{timeout:a.timeout,numItems:a.numItems,hasMoreItems:a.hasMoreItems},b)})},_listItems:function(a){var b=this,c=
this.list.clearGridData();e.each(a,function(){var a=this.resource;c.addRowData(a.uid,e.extend({id:a.id},b.renderRowCols(a)))})},_processItems:function(a,b){var c=this._pagingBtns;this._pagingCount=b&&"number"===typeof b.numItems?b.numItems:void 0;this.grid.find(".loading").hide();this.list.show();this._listItems(a);0>=this._pagingOffset?c.first.add(c.prev).addClass("ui-state-disabled"):c.first.add(c.prev).removeClass("ui-state-disabled");isNaN(this._pagingCount)?(c.end.addClass("ui-state-disabled"),
a.length<=this.pageSize?c.next.addClass("ui-state-disabled"):c.next.removeClass("ui-state-disabled")):this._pagingOffset+this.pageSize>=this._pagingCount?c.end.add(c.next).addClass("ui-state-disabled"):c.end.add(c.next).removeClass("ui-state-disabled");var d;0===a.length&&0===this._pagingOffset?d=c=0:(c=this._pagingOffset+1,d=c+a.length-1);var e="number"===typeof this._pagingCount?this._pagingCount:this._i18n("numerous");this.grid.find(".ui-paging-info").html(this._i18n("Viewing")+" "+c+" - "+d+" "+
this._i18n("of")+" "+e);b&&b.timeout&&this.handleTimeout()},_fetchSubnodes:function(a,b){var c=this;-1===a?c._fetchRepoRoot(b):a.each(function(){var a=c._getObjectFromCache(e(this));"object"===typeof a&&c.fetchChildren(a,b)})},_fetchRepoRoot:function(a){this.getRepoChildren({inFolderId:this.rootFolderId,repositoryFilter:this.repositoryFilter},function(b){"function"===typeof a&&a(b)})},_fetchItems:function(a){if(a){var b=this,c="string"===typeof this._searchQuery;b.list.setCaption(c?b._i18n("Searching for")+
" "+b._searchQuery+" "+b._i18n("in")+" "+a.name:b._i18n("Browsing")+": "+a.name);b.list.hide();b.grid.find(".loading").show();b.queryRepository({repositoryId:a.repositoryId,inFolderId:a.id,queryString:b._searchQuery,orderBy:b._orderBy,skipCount:b._pagingOffset,maxItems:b.pageSize,objectTypeFilter:b.objectTypeFilter,renditionFilter:b.renditionFilter,filter:b.filter,recursive:c},function(a,c){b._processItems(a,c)})}},fetchChildren:function(a,b){var c=this;(!0===a.hasMoreItems||"folder"===a.baseType)&&
!1===a.loaded&&c.getRepoChildren({inFolderId:a.id,repositoryId:a.repositoryId},function(d){c._objs[a.uid].loaded=!0;"function"===typeof b&&b(d)})},getRepoChildren:function(a,b){var c=this;c.manager.getChildren(a,function(a){c._processRepoResponse(a,b)})},_doPaging:function(a){switch(a){case "first":this._pagingOffset=0;break;case "end":this._pagingOffset=0===this._pagingCount%this.pageSize?this._pagingCount-this.pageSize:this._pagingCount-this._pagingCount%this.pageSize;break;case "next":this._pagingOffset+=
this.pageSize;break;case "prev":this._pagingOffset-=this.pageSize,0>this._pagingOffset&&(this._pagingOffset=0)}this._fetchItems(this._currentFolder)},renderRowCols:function(a){var b={};e.each(this.columns,function(c){switch(c){case "icon":b.icon='<div class="repository-browser-icon repository-browser-icon-'+a.type+'"></div>';break;default:b[c]=a[c]||"--"}});return b},_sortList:function(a,b){this.grid.find("span.ui-grid-ico-sort").addClass("ui-state-disabled");a.sortorder="asc"===a.sortorder?"desc":
"asc";e(b).find("span.s-ico").show().find(".ui-icon-"+a.sortorder).removeClass("ui-state-disabled");this._setSortOrder(a.name,a.sortorder)._fetchItems(this._currentFolder)},_setSortOrder:function(a,b){var c=this._orderBy||[],d,e,f=!1,g,j,k={};k[a]=b||"asc";g=0;for(j=c.length;g<j;g++){e=c[g];for(d in e)if(e.hasOwnProperty(d)&&d===a){c.splice(g,1);c.unshift(k);f=!0;break}if(f)break}f||c.unshift(k);this._orderBy=c;return this},rowClicked:function(a){var a=e(a.target).parent("tr"),b=null;0<a.length&&
(b=this._objs[a.attr("id")],this.onSelect(b));return b},treeNodeSelected:function(a){if(a=this._getObjectFromCache(a))this._pagingOffset=0,this._clearSearch(),this._currentFolder=a,this._fetchItems(a),this.folderSelected(a)},_triggerSearch:function(){var a=this.grid.find("input.repository-browser-search-field"),b=a.val();""===b||a.hasClass("repository-browser-search-field-empty")?b=null:""===b&&(b=null);this._pagingOffset=0;this._searchQuery=b;this._fetchItems(this._currentFolder)},getFieldOfHeader:function(a){return a.find("div.ui-jqgrid-sortable").attr("id").replace("jqgh_",
"")},setObjectTypeFilter:function(a){this.objectTypeFilter="string"===typeof a?[a]:a},getObjectTypeFilter:function(){return this.objectTypeFilter},show:function(){if(!this.opened){this.opened=!0;var a=this.element;this.isFloating?(b(e("body")),e(".repository-browser-modal-overlay").stop().css({top:0,left:0}).show(),a.stop().show().css({left:r.scrollLeft()+this.padding/2,top:r.scrollTop()+this.padding/2}).draggable({handle:a.find(".repository-browser-grab-handle")}),this.grid.css({marginTop:0,opacity:0}).animate({marginTop:0,
opacity:1},1500,"easeOutExpo",function(){e.browser.msie&&e(this).add(a).css("filter","progid:DXImageTransform.Microsoft.gradient(enabled = false)")})):a.stop().show().css({opacity:1,filter:"progid:DXImageTransform.Microsoft.gradient(enabled = false)"});this._onWindowResized();this.element.resize();t++}},open:function(){this.show()},close:function(){this.opened&&(this.opened=!1,this.element.fadeOut(250,function(){e(this).css("top",0).hide();(0===t||0===--t)&&g()}))},refresh:function(){this._currentFolder&&
this._fetchItems(this._currentFolder)},folderOpened:function(a){(a=this._getObjectFromCache(a))&&this.manager.folderOpened(a)},folderClosed:function(a){(a=this._getObjectFromCache(a))&&this.manager.folderClosed(a)},folderSelected:function(a){this.manager.folderSelected(a)},getSelectedFolder:function(){if("function"===typeof this.manager.getSelectedFolder)return this.manager.getSelectedFolder()},destroy:function(){},onSelect:function(){},handleTimeout:function(){}});e(function(){var a=e('<div class="repository-browser-modal-overlay" style="z-index: '+
v+';"></div>');e("body").append(a);a.click(function(){e.each(x,function(a,b){b.close()})})});return a}"function"===typeof define?(define("repository-browser-i18n-de",[],function(){return{Browsing:"Durchsuchen",Close:"Schließen","in":"in","Input search text...":"Suchtext einfügen...",numerous:"zahlreiche",of:"von","Repository Browser":"Repository Browser",Search:"Suchen","Searching for":"Suche nach",Viewing:"Anzeige","button.switch-metaview.tooltip":"Zwischen Metaansicht und normaler Ansicht umschalten"}}),
define("repository-browser-i18n-en",[],function(){return{Browsing:"Browsing",Close:"Close","in":"in","Input search text...":"Input search text...",numerous:"numerous",of:"of","Repository Browser":"Repository Browser",Search:"Search","Searching for":"Searching for",Viewing:"Viewing","button.switch-metaview.tooltip":"Switch between meta and normal view"}}),define("RepositoryBrowser",["jquery","Class","PubSub","repository-browser-i18n-"+(window&&window.__DEPS__&&window.__DEPS__.lang||"en"),"jstree",
"jqgrid","jquery-layout"],m)):window.Browser=m(window.jQuery,window.Class,{pub:function(){}})})();define("linkbrowser/nls/i18n",{root:{"button.addlink.tooltip":"Insert Link","button.removelink.tooltip":"Remove Link","newlink.defaulttext":"New Link","floatingmenu.tab.link":"Link"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("linkbrowser/linkbrowser-plugin","aloha jquery aloha/plugin aloha/pluginmanager ui/ui ui/button link/link-plugin RepositoryBrowser i18n!linkbrowser/nls/i18n i18n!aloha/nls/i18n".split(" "),
function(m,e,a,j,d,b,f,l,g){var k=l.extend({init:function(a){this._super(a);f.settings.sidebar&&a.filter&&e.each(f.settings.sidebar,function(b,d){a.filter.push(d.attr)});this.element.addClass("aloha-dialog");var j=this;this._linkBrowserButton=d.adopt("linkBrowser",b,{tooltip:g.t("button.addlink.tooltip"),icon:"aloha-icon-tree",scope:"Aloha.continuoustext",click:function(){j.show()}});this._linkBrowserButton.hide();this.url=m.getAlohaUrl()+"/../plugins/extra/linkbrowser/";m.bind("aloha-link-selected",
function(){j._linkBrowserButton.show()});m.bind("aloha-link-unselected",function(){j._linkBrowserButton.hide()})},onSelect:function(a){f.hrefField.setItem(a);var b=m.Selection.getRangeObject(),d=b.startContainer=b.endContainer,e=b.startOffset=b.endOffset;b.select();b.startContainer=b.endContainer=d;b.startOffset=b.endOffset=e;b.select();m.trigger("aloha-link-selected-in-linkbrowser",a);this.close()},renderRowCols:function(a){var b={},d=this.url;a.id.match(/(\d+)\./);e.each(this.columns,function(e){switch(e){case "icon":b.icon=
'<div class="aloha-browser-icon\t\t\t\t\t\taloha-browser-icon-__page__"></div>';break;case "translations":if(!a.renditions)break;for(var e=a.renditions,f=e.length,g=[],j;f>0;--f){j=e[f];j.kind=="translation"&&g.push('<img src="'+d+"img/flags/"+j.language+'.png"\t\t\t\t\t\t\t\t\t  alt="'+j.language+'"\t\t\t\t\t\t\t\t\t  title="'+j.filename+'" />')}b.translations=g.join("");break;case "language":b.language=a.language;break;default:b[e]=a[e]||"--"}});return b}});return a.create("linkbrowser",{dependencies:["link"],
browser:null,init:function(){this.browser=new k({repositoryManager:m.RepositoryManager,repositoryFilter:[],objectTypeFilter:["website","file","image","language"],renditionFilter:["*"],filter:["language"],columns:{icon:{title:"",width:30,sortable:false,resizable:false},name:{title:"Name",width:320,sorttype:"text"},language:{title:"",width:30,sorttype:"text"},translations:{title:"",width:350,sorttype:"text"}},rootPath:m.settings.baseUrl+"/vendor/repository-browser/"})}})});define("imagebrowser/nls/i18n",
{root:{"button.addimage.tooltip":"Insert Image","button.removeimage.tooltip":"Remove Image","newimage.defaulttext":"New Image","floatingmenu.tab.img":"Image"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("imagebrowser/imagebrowser-plugin","aloha jquery aloha/plugin aloha/pluginmanager ui/ui ui/button image/image-plugin RepositoryBrowser i18n!imagebrowser/nls/i18n i18n!aloha/nls/i18n".split(" "),function(m,e,a,j,d,b,f,l,g){var k=l.extend({init:function(a){this._super(a);this.element.addClass("aloha-dialog");
var e=this;this._imageBrowserButton=d.adopt("imageBrowser",b,{tooltip:g.t("button.addimage.tooltip"),icon:"aloha-icon-tree",scope:"Aloha.continuoustext","class":"aloha-imagebrowser-button",click:function(){e.open()}});this._imageBrowserButton.show(false);this.url=m.getAlohaUrl()+"/../plugins/extra/imagebrowser/";m.bind("aloha-image-selected",function(){e._imageBrowserButton.show(true)});m.bind("aloha-image-unselected",function(){e._imageBrowserButton.show(false)})},onSelect:function(a){if(a.type.match("image")!==
null){f.ui.imgSrcField.setItem(a);f.resetSize();this.close()}},listItems:function(a){var b=this,d=this.list.clearGridData();e.each(a,function(){var a=this.resource;a.type.match("image")!==null&&d.addRowData(a.uid,e.extend({id:a.id},b.renderRowCols(a)))})},renderRowCols:function(a){var b={};a.id.match(/(\d+)\./);e.each(this.columns,function(d){switch(d){case "icon":if(!a.renditions)break;if(a.renditions.length===1&&a.renditions[0].kind==="thumbnail")b.icon='<img width="'+a.renditions[0].width+'" height="'+
a.renditions[0].height+' " src="'+a.renditions[0].url+'"/>';break;default:b[d]=a[d]||"--"}});return b}});return a.create("imagebrowser",{dependencies:["image"],browser:null,init:function(){this.browser=new k({repositoryManager:m.RepositoryManager,repositoryFilter:[],objectTypeFilter:["image"],renditionFilter:["*"],filter:["language"],columns:{icon:{title:"",width:75,sortable:false,resizable:false},name:{title:"Name",width:320,sorttype:"text"}},rootPath:m.settings.baseUrl+"/vendor/repository-browser/"})}})});
define("ribbon/ribbon-plugin",["jquery","aloha/plugin","ui/menuButton","ui/utils","jqueryui"],function(m,e,a,j){return e.create("ribbon",{init:function(){if(this.settings.enable||"undefined"===typeof this.settings.enable){var a=this;this._visible=!1;this._toolbar=m("<div>",{"class":"aloha-ribbon-toolbar ui-menubar ui-widget-header ui-helper-clearfix"});var b=j.makeButtonElement({"class":"aloha-ribbon-in"}).button().hide().click(function(){a._toolbar.animate({left:0});m("body").animate({paddingTop:30});
b.hide()}).appendTo(this._toolbar);j.makeButtonElement({"class":"aloha-ribbon-out"}).button().click(function(){a._toolbar.animate({left:-a._toolbar.outerWidth()+b.outerWidth()+10});m("body").animate({paddingTop:0});b.show()}).appendTo(this._toolbar);var e=m("<div>",{"class":"aloha aloha-ribbon"}).appendTo("body");this._icon=m("<div>").prependTo(this._toolbar);this.setIcon("");this._toolbar.appendTo(e);m("body").css({position:"relative",paddingTop:30})}},setIcon:function(a){this._icon&&this._icon.attr("class",
"aloha-ribbon-icon "+a)},addButton:function(d){this._toolbar&&(d=m.extend({},d,{siblingContainer:this._toolbar}),this._toolbar.append(a.makeMenuButton(d)))},hide:function(){this._toolbar&&(this._toolbar.hide(),this._visible=!1)},show:function(){this._toolbar&&(this._toolbar.show(),this._visible=!0)},isVisible:function(){return this._visible}})});define("wai-lang/nls/i18n",{root:{"floatingmenu.tab.wai-lang":"Language annotation","button.add-wai-lang-remove.tooltip":"Remove language annotation","button.add-wai-lang.tooltip":"Add language annotation"},
ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("wai-lang/../../../shared/languages/./iso639-1-de",[],function(){return{aa:{name:"Afar"},ab:{name:"Abchasen"},af:{name:"Afrikaans"},ak:{name:"Akan"},sq:{name:"Albanisch"},am:{name:"Amharisch"},ar:{name:"Arabisch",flag:"ae"},an:{name:"Aragonesisch"},hy:{name:"Armenisch"},as:{name:"Assamesisch"},av:{name:"Avarisch"},ae:{name:"Avestan"},ay:{name:"Aymara"},az:{name:"Aserbaidschanisch"},ba:{name:"Baschkirisch"},bm:{name:"Bambara"},eu:{name:"Baskisch"},
be:{name:"Weißrussisch",flag:"by"},bn:{name:"Bengalisch"},bh:{name:"Bihari Sprachen"},bi:{name:"Bislama"},bs:{name:"Bosnisch"},br:{name:"Bretonisch"},bg:{name:"Bulgarisch",flag:"bg"},my:{name:"Birmanisch"},ca:{name:"Katalanisch, Valencia",flag:"es"},ch:{name:"Chamorro"},ce:{name:"Tschetschenisch"},zh:{name:"Chinesisch"},cu:{name:"Kirchenslawisch; Altslawisch; Altbulgarisch; Altkirchenslawisch"},cv:{name:"Tschuwaschische Sprache"},kw:{name:"Cornish"},co:{name:"Korsisch"},cr:{name:"Cree"},cs:{name:"Tschechisch"},
da:{name:"Dänisch",flag:"dk"},dv:{name:"Divehi; Dhivehi; maledivische"},nl:{name:"Niederländisch, Flämisch"},dz:{name:"Dzongkha"},en:{name:"Englisch",flag:"gb"},eo:{name:"Esperanto"},et:{name:"Estnisch",flag:"ee"},ee:{name:"Ewe"},fo:{name:"Färöisch"},fj:{name:"Fidschi"},fi:{name:"Finnisch",flag:"fi"},fr:{name:"Französisch"},fy:{name:"Westfriesisch"},ff:{name:"Fulah"},ka:{name:"Georgisch"},de:{name:"Deutsch",flag:"de"},gd:{name:"Gälisch, Schottisch-Gälisch"},ga:{name:"Irisch",flag:"ie"},gl:{name:"Galizisch"},
gv:{name:"Manx"},el:{name:"Griechisch, Modern (1453 -)"},gn:{name:"Guarani"},gu:{name:"Gujarati"},ht:{name:"Haitianisch"},ha:{name:"Hausa"},he:{name:"Hebräisch",flag:"il"},hz:{name:"Herero"},hi:{name:"Hindi",flag:"in"},ho:{name:"Hiri Motu"},hr:{name:"Kroatisch",flag:"hr"},hu:{name:"Ungarisch",flag:"hu"},ig:{name:"Igbo"},is:{name:"Isländisch"},io:{name:"Ido"},ii:{name:"Sichuan Yi; Nuosu"},iu:{name:"Inuktitut"},ie:{name:"Interlingue; Okzidental"},ia:{name:"Interlingua (International Auxiliary Language Association)"},
id:{name:"Indonesisch",flag:"id"},ik:{name:"Inupiaq"},it:{name:"Italienisch",flag:"it"},jv:{name:"Javaner"},ja:{name:"Japanisch",flag:"jp"},kl:{name:"Kalaallisut; Grönländisch"},kn:{name:"Kannada"},ks:{name:"Kashmiri"},kr:{name:"Kanuri"},kk:{name:"Kasachisch"},km:{name:"Mittel-Khmer"},ki:{name:"Kikuyu; Gikuyu"},rw:{name:"Kinyarwanda"},ky:{name:"Kirgisisch"},kv:{name:"Komi"},kg:{name:"Kongo"},ko:{name:"Koreanisch",flag:"kr"},kj:{name:"Kuanyama; Kwanyama"},ku:{name:"Kurdisch"},lo:{name:"Lao"},la:{name:"Latein"},
lv:{name:"Lettisch",flag:"lv"},li:{name:"Limburgisch"},ln:{name:"Lingála"},lt:{name:"Litauisch",flag:"lt"},lb:{name:"Luxemburgisch, Lëtzebuergesch"},lu:{name:"Luba-Katanga"},lg:{name:"Ganda"},mk:{name:"Mazedonisch"},mh:{name:"Marshallese"},ml:{name:"Malayalam"},mi:{name:"Maori"},mr:{name:"Marathi"},ms:{name:"Malaiisch"},mg:{name:"Malagasy"},mt:{name:"Maltesisch",flag:"mt"},mn:{name:"Mongolisch"},na:{name:"Nauru"},nv:{name:"Navajo; Navaho"},nr:{name:"Ndebele, Süd, Süd-Ndebele"},nd:{name:"Ndebele, Nord, Nord-Ndebele"},
ng:{name:"Ndonga"},ne:{name:"Nepali"},nn:{name:"Norwegisch Nynorsk"},nb:{name:"Bokmål, Norwegisch, Norwegisch Bokmål"},no:{name:"Norwegisch",flag:"no"},ny:{name:"Chichewa; Chewa; Nyanja"},oc:{name:"Occitan (post 1500); provenzalischen"},oj:{name:"Ojibwa"},or:{name:"Oriya"},om:{name:"Oromo"},os:{name:"Ossetisch"},pa:{name:"Panjabi, Punjabi"},fa:{name:"Persisch"},pi:{name:"Pali"},pl:{name:"Polnisch",flag:"pl"},pt:{name:"Portugiesisch",flag:"pt"},ps:{name:"Paschtu, Paschtu"},qu:{name:"Quechua"},rm:{name:"Rätoromanisch"},
ro:{name:"Rumänisch; Moldawisch; Moldauisch"},rn:{name:"Rundi"},ru:{name:"Russisch",flag:"ru"},sg:{name:"Sango"},sa:{name:"Sanskrit"},si:{name:"Singhalesisch"},sk:{name:"Slowakisch"},sl:{name:"Slowenisch",flag:"si"},se:{name:"Nord Sami"},sm:{name:"Samoaner"},sn:{name:"Shona"},sd:{name:"Sindhi"},so:{name:"Somali"},st:{name:"Sotho, Südlich"},es:{name:"Spanisch, Kastilisch",flag:"es"},sc:{name:"Sardisch"},sr:{name:"Serbisch",flag:"rs"},ss:{name:"Swati"},su:{name:"Sundanesisch"},sw:{name:"Swahili"},sv:{name:"Schwedisch",
flag:"se"},ty:{name:"Tahitianisch"},ta:{name:"Tamilisch"},tt:{name:"Tatar"},te:{name:"Telugu"},tg:{name:"Tadschikisch"},tl:{name:"Tagalog"},th:{name:"Thailändisch",flag:"th"},bo:{name:"Tibetisch"},ti:{name:"Tigrinya"},to:{name:"Tonga (Tonga-Inseln)"},tn:{name:"Tswana"},ts:{name:"Tsonga"},tk:{name:"Turkmenisch"},tr:{name:"Türkisch",flag:"tr"},tw:{name:"Twi"},ug:{name:"Uigurisch"},uk:{name:"Ukrainisch",flag:"ua"},ur:{name:"Urdu"},uz:{name:"Usbekisch"},ve:{name:"Venda"},vi:{name:"Vietnamesisch",flag:"vn"},
vo:{name:"Volapük"},cy:{name:"Walisisch"},wa:{name:"Wallonisch"},wo:{name:"Wolof"},xh:{name:"Xhosa"},yi:{name:"Jiddisch"},yo:{name:"Yoruba"},za:{name:"Zhuang; Chuang"},zu:{name:"Zulu"}}});define("wai-lang/../../../shared/languages/./iso639-2-de",[],function(){return{aar:{name:"Afar"},abk:{name:"Abchasen"},ace:{name:"Achinese"},ach:{name:"Acholi"},ada:{name:"Adangme"},ady:{name:"Adyghe; Adygei"},afa:{name:"Afro-Asiatische Sprachen"},afh:{name:"Afrihili"},afr:{name:"Afrikaans"},ain:{name:"Ainu"},aka:{name:"Akan"},
akk:{name:"Akkadisch"},alb:{name:"Albanisch"},sqi:{name:"Albanisch",flag:"al"},ale:{name:"Aleutisch"},alg:{name:"Algonkin-Sprachen"},alt:{name:"Südaltai"},amh:{name:"Amharisch"},ang:{name:"Englisch, Alt (ca.450-1100)"},anp:{name:"Angika"},apa:{name:"Apache Sprachen"},ara:{name:"Arabisch",flag:"ae"},arc:{name:"Offizielles Aramäisch (700-300 v. Chr.); Reichsaramäisch (700-300 v. Chr.)"},arg:{name:"Aragonesisch"},arm:{name:"Armenisch"},hye:{name:"Armenisch"},arn:{name:"Mapudungun; Mapuche"},arp:{name:"Arapaho"},
art:{name:"Künstliche Sprachen"},arw:{name:"Arawak"},asm:{name:"Assamesisch"},ast:{name:"Asturisch"},ath:{name:"Athapascan Sprachen"},aus:{name:"Australische Sprachen"},ava:{name:"Avarisch"},ave:{name:"Avestan"},awa:{name:"Awadhi"},aym:{name:"Aymara"},aze:{name:"Aserbaidschanisch"},bad:{name:"Banda Sprachen"},bai:{name:"Bamileke Sprachen"},bak:{name:"Baschkirisch"},bal:{name:"Baluchi"},bam:{name:"Bambara"},ban:{name:"Balinesisch"},baq:{name:"Baskisch"},eus:{name:"Baskisch"},bas:{name:"Basa"},bat:{name:"Baltische Sprachen"},
bej:{name:"Beja; Bedawiyet"},bel:{name:"Weißrussisch",flag:"by"},bem:{name:"Bemba"},ben:{name:"Bengalisch"},ber:{name:"Berbersprachen"},bho:{name:"Bhojpuri"},bih:{name:"Bihari Sprachen"},bik:{name:"Bikol"},bin:{name:"Bini, Edo"},bis:{name:"Bislama"},bla:{name:"Siksika"},bnt:{name:"Bantusprachen"},bos:{name:"Bosnisch"},bra:{name:"Braj"},bre:{name:"Bretonisch"},btk:{name:"Batak Sprachen"},bua:{name:"Buriatisch"},bug:{name:"Buginesisch"},bul:{name:"Bulgarisch",flag:"bg"},bur:{name:"Birmanisch"},mya:{name:"Birmanisch"},
byn:{name:"Blin; Bilin"},cad:{name:"Caddo"},cai:{name:"Zentralamerikanische indische Sprachen"},car:{name:"Galibi Carib"},cat:{name:"Katalanisch, Valencia",flag:"es"},cau:{name:"Kaukasische Sprachen"},ceb:{name:"Cebuano"},cel:{name:"Keltische Sprachen"},cha:{name:"Chamorro"},chb:{name:"Chibcha"},che:{name:"Tschetschenisch"},chg:{name:"Dschag."},chi:{name:"Chinesisch"},zho:{name:"Chinesisch",flag:"cn"},chk:{name:"Chuukese"},chm:{name:"Mari"},chn:{name:"Chinook-Jargon"},cho:{name:"Choctaw"},chp:{name:"Chipewyan; Dene Suline"},
chr:{name:"Cherokee"},chu:{name:"Kirchenslawisch; Altslawisch; Altbulgarisch; Altkirchenslawisch"},chv:{name:"Tschuwaschische Sprache"},chy:{name:"Cheyenne"},cmc:{name:"Chamic Sprachen"},cop:{name:"Koptisch"},cor:{name:"Cornish"},cos:{name:"Korsisch"},cpe:{name:"Kreolsprachen, englisch-basiert"},cpf:{name:"Kreolsprachen, französisch-basiert"},cpp:{name:"Kreolsprachen, portugiesisch-basiert"},cre:{name:"Cree"},crh:{name:"Krimtatarisch; Krim-türkisch"},crp:{name:"Kreolsprachen"},csb:{name:"Kaschubisch"},
cus:{name:"Kuschitische Sprachen"},cze:{name:"Tschechisch"},ces:{name:"Tschechisch",flag:"cz"},dak:{name:"Dakota"},dan:{name:"Dänisch",flag:"dk"},dar:{name:"Dargwa"},day:{name:"Land Dayak Sprachen"},del:{name:"Delaware"},den:{name:"Slave (Athapascan)"},dgr:{name:"Dogrib"},din:{name:"Dinka"},div:{name:"Divehi; Dhivehi; maledivische"},doi:{name:"Dogri"},dra:{name:"Dravidische Sprachen"},dsb:{name:"Niedersorbisch"},dua:{name:"Duala"},dum:{name:"Niederländisch, Mittel (ca.1050-1350)"},dut:{name:"Niederländisch, Flämisch"},
nld:{name:"Niederländisch, Flämisch",flag:"nl"},dyu:{name:"Dyula"},dzo:{name:"Dzongkha"},efi:{name:"Efik"},egy:{name:"Ägyptisch (Altertümlich)"},eka:{name:"Ekajuk"},elx:{name:"Elamite"},eng:{name:"Englisch",flag:"gb"},enm:{name:"Englisch, Mittle (1100-1500)"},epo:{name:"Esperanto"},est:{name:"Estnisch",flag:"ee"},ewe:{name:"Ewe"},ewo:{name:"Ewondo"},fan:{name:"Fang"},fao:{name:"Färöisch"},fat:{name:"Fanti"},fij:{name:"Fidschi"},fil:{name:"Filipinisch"},fin:{name:"Finnisch",flag:"fi"},fiu:{name:"Finno-ugrischen Sprachen"},
fon:{name:"Fon"},fre:{name:"Französisch"},fra:{name:"Französisch",flag:"fr"},frm:{name:"Französisch, Mittel (ca.1400-1600)"},fro:{name:"Französisch, Alt (842-ca.1400)"},frr:{name:"Nordfriesisch"},frs:{name:"Ostfriesisch"},fry:{name:"Westfriesisch"},ful:{name:"Fulah"},fur:{name:"Friaulisch"},gaa:{name:"Ga"},gay:{name:"Gayo"},gba:{name:"Gbaya"},gem:{name:"Germanische Sprachen"},geo:{name:"Georgisch"},kat:{name:"Georgisch"},ger:{name:"Deutsch",flag:"de"},deu:{name:"Deutsch",flag:"de"},gez:{name:"Geez"},
gil:{name:"Gilbertesisch"},gla:{name:"Gälisch, Schottisch-Gälisch"},gle:{name:"Irisch",flag:"ie"},glg:{name:"Galizisch"},glv:{name:"Manx"},gmh:{name:"Deutsch, Mittlehoch (ca.1050-1500)"},goh:{name:"Deutsch, Althoch (ca.750-1050)"},gon:{name:"Gondi"},gor:{name:"Gorontalo"},got:{name:"Gotisch"},grb:{name:"Grebo"},grc:{name:"Altgriechisch (bis 1453)"},gre:{name:"Griechisch, Modern (1453 -)"},ell:{name:"Griechisch, Modern (1453 -)",flag:"gr"},grn:{name:"Guarani"},gsw:{name:"Schweizerdeutsch, Alemannisch, Elsässisch"},
guj:{name:"Gujarati"},gwi:{name:"Gwich'in"},hai:{name:"Haida"},hat:{name:"Haitianisch"},hau:{name:"Hausa"},haw:{name:"Hawaii"},heb:{name:"Hebräisch",flag:"il"},her:{name:"Herero"},hil:{name:"Hiligaynon"},him:{name:"Himachali Sprachen; Pahari westliche Sprachen"},hin:{name:"Hindi",flag:"in"},hit:{name:"Hethitisch"},hmn:{name:"Hmong, Mong"},hmo:{name:"Hiri Motu"},hrv:{name:"Kroatisch",flag:"hr"},hsb:{name:"Obersorbisch"},hun:{name:"Ungarisch",flag:"hu"},hup:{name:"Hupa"},iba:{name:"Iban"},ibo:{name:"Igbo"},
ice:{name:"Isländisch"},isl:{name:"Isländisch",flag:"is"},ido:{name:"Ido"},iii:{name:"Sichuan Yi; Nuosu"},ijo:{name:"Ijo Sprachen"},iku:{name:"Inuktitut"},ile:{name:"Interlingue; Okzidental"},ilo:{name:"Iloko"},ina:{name:"Interlingua (International Auxiliary Language Association)"},inc:{name:"Indische Sprachen"},ind:{name:"Indonesisch",flag:"id"},ine:{name:"Indoeuropäische Sprachen"},inh:{name:"Inguschisch"},ipk:{name:"Inupiaq"},ira:{name:"Iranische Sprachen"},iro:{name:"Irokesen Sprachen"},ita:{name:"Italienisch",
flag:"it"},jav:{name:"Javaner"},jbo:{name:"Lojban"},jpn:{name:"Japanisch",flag:"jp"},jpr:{name:"Jüdisch-persisch"},jrb:{name:"Jüdisch-arabisch"},kaa:{name:"Kara-Kalpak"},kab:{name:"Kabyle"},kac:{name:"Kachin; Jingpho"},kal:{name:"Kalaallisut; Grönländisch"},kam:{name:"Kamba"},kan:{name:"Kannada"},kar:{name:"Karen Sprachen"},kas:{name:"Kashmiri"},kau:{name:"Kanuri"},kaw:{name:"Kawi"},kaz:{name:"Kasachisch"},kbd:{name:"Kabardinisch"},kha:{name:"Khasi"},khi:{name:"Khoisan-Sprache"},khm:{name:"Mittel-Khmer"},
kho:{name:"Khotanesisch; Sakan"},kik:{name:"Kikuyu; Gikuyu"},kin:{name:"Kinyarwanda"},kir:{name:"Kirgisisch"},kmb:{name:"Kimbundu"},kok:{name:"Konkani"},kom:{name:"Komi"},kon:{name:"Kongo"},kor:{name:"Koreanisch",flag:"kr"},kos:{name:"Kosraeanisch"},kpe:{name:"Kpelle"},krc:{name:"Karatschai-Balkar"},krl:{name:"Karelisch"},kro:{name:"Kru Sprachen"},kru:{name:"Kurukh"},kua:{name:"Kuanyama; Kwanyama"},kum:{name:"Kumykisch"},kur:{name:"Kurdisch"},kut:{name:"Kutenai"},lad:{name:"Ladino"},lah:{name:"Lahnda"},
lam:{name:"Lamba"},lao:{name:"Lao"},lat:{name:"Latein"},lav:{name:"Lettisch",flag:"lv"},lez:{name:"Lesgisch"},lim:{name:"Limburgisch"},lin:{name:"Lingála"},lit:{name:"Litauisch",flag:"lt"},lol:{name:"Mongo"},loz:{name:"Lozi"},ltz:{name:"Luxemburgisch, Lëtzebuergesch"},lua:{name:"Luba-Lulua"},lub:{name:"Luba-Katanga"},lug:{name:"Ganda"},lui:{name:"Luiseno"},lun:{name:"Lunda"},luo:{name:"Luo (Kenia und Tansania)"},lus:{name:"Lushai"},mac:{name:"Mazedonisch"},mkd:{name:"Mazedonisch",flag:"mk"},mad:{name:"Maduresisch"},
mag:{name:"Magahi"},mah:{name:"Marshallese"},mai:{name:"Maithili"},mak:{name:"Makasar"},mal:{name:"Malayalam"},man:{name:"Mandingo"},mao:{name:"Maori"},mri:{name:"Maori"},map:{name:"Austronesische Sprachen"},mar:{name:"Marathi"},mas:{name:"Masai"},may:{name:"Malaiisch"},msa:{name:"Malaiisch",flag:"my"},mdf:{name:"Moksha"},mdr:{name:"Mandar"},men:{name:"Mende"},mga:{name:"Irisch, Mittel (900-1200)"},mic:{name:"Mi'kmaq; Micmac"},min:{name:"Minangkabau"},mis:{name:"Unkodierte Sprachen"},mkh:{name:"Mon-Khmer-Sprachen"},
mlg:{name:"Malagasy"},mlt:{name:"Maltesisch",flag:"mt"},mnc:{name:"Manchu"},mni:{name:"Manipuri"},mno:{name:"Manobo Sprachen"},moh:{name:"Mohawk"},mon:{name:"Mongolisch"},mos:{name:"Mossi"},mul:{name:"Mehrere Sprachen"},mun:{name:"Munda-Sprachen"},mus:{name:"Bach"},mwl:{name:"Mirandesisch"},mwr:{name:"Marwari"},myn:{name:"Maya-Sprachen"},myv:{name:"Erzya"},nah:{name:"Nahuatl Sprachen"},nai:{name:"Nordamerikanische Indianer Sprachen"},nap:{name:"Neapolitanisch"},nau:{name:"Nauru"},nav:{name:"Navajo; Navaho"},
nbl:{name:"Ndebele, Süd, Süd-Ndebele"},nde:{name:"Ndebele, Nord, Nord-Ndebele"},ndo:{name:"Ndonga"},nds:{name:"Plattdeutsch; Niedersächsisch, Deutsch"},nep:{name:"Nepali"},"new":{name:"Nepal Bhasa; Newari"},nia:{name:"Nias"},nic:{name:"Niger-Kordofanianische Sprachen"},niu:{name:"Niuean"},nno:{name:"Norwegisch Nynorsk"},nob:{name:"Bokmål, Norwegisch, Norwegisch Bokmål"},nog:{name:"Nogai"},non:{name:"Norwegisch, Alt"},nor:{name:"Norwegisch",flag:"no"},nqo:{name:"N'Ko"},nso:{name:"Pedi; Sepedi; Nord Sotho"},
nub:{name:"Nubische Sprachen"},nwc:{name:"Klassische Newari; Alt Newari; Klassische Nepal Bhasa"},nya:{name:"Chichewa; Chewa; Nyanja"},nym:{name:"Nyamwezi"},nyn:{name:"Nyankole"},nyo:{name:"Nyoro"},nzi:{name:"Nzima"},oci:{name:"Occitan (post 1500); provenzalischen"},oji:{name:"Ojibwa"},ori:{name:"Oriya"},orm:{name:"Oromo"},osa:{name:"Osage"},oss:{name:"Ossetisch"},ota:{name:"Türkisch, osmanische (1500-1928)"},oto:{name:"Otomian Sprachen"},paa:{name:"Papua-Sprachen"},pag:{name:"Pangasinan"},pal:{name:"Pahlavi"},
pam:{name:"Pampanga; Kapampangan"},pan:{name:"Panjabi, Punjabi"},pap:{name:"Papiamento"},pau:{name:"Palau"},peo:{name:"Persisch, Alt (ca.600-400 v. Chr.)"},per:{name:"Persisch"},fas:{name:"Persisch"},phi:{name:"Philippinische Sprachen"},phn:{name:"Phönizisch"},pli:{name:"Pali"},pol:{name:"Polnisch",flag:"pl"},pon:{name:"Pohnpeian"},por:{name:"Portugiesisch",flag:"pt"},pra:{name:"Prakrit Sprachen"},pro:{name:"Provençal, Alt (bis 1500)"},pus:{name:"Paschtu, Paschtu"},"qaa-qtz":{name:"Reserviert für den lokalen Gebrauch"},
que:{name:"Quechua"},raj:{name:"Rajasthani"},rap:{name:"Rapanui"},rar:{name:"Rarotongan; Cook Islands Maori"},roa:{name:"Romanische Sprachen"},roh:{name:"Rätoromanisch"},rom:{name:"Roma"},rum:{name:"Rumänisch; Moldawisch; Moldauisch"},ron:{name:"Rumänisch; Moldawisch; Moldauisch",flag:"ro"},run:{name:"Rundi"},rup:{name:"Aromunischen; Arumanian; Macedo-Rumänischen"},rus:{name:"Russisch",flag:"ru"},sad:{name:"Sandawe"},sag:{name:"Sango"},sah:{name:"Yakut"},sai:{name:"Südamerikanische Indianer (Andere)"},
sal:{name:"Salishan Sprachen"},sam:{name:"Samariter Aramäisch"},san:{name:"Sanskrit"},sas:{name:"Sasak"},sat:{name:"Santali"},scn:{name:"Sizilianisch"},sco:{name:"Schottisch"},sel:{name:"Selkupisch"},sem:{name:"Semitische Sprachen"},sga:{name:"Irisch, Alt (bis 900)"},sgn:{name:"Registrierte Sprachen"},shn:{name:"Shan"},sid:{name:"Sidamo"},sin:{name:"Singhalesisch"},sio:{name:"Sioux-Sprachen"},sit:{name:"Sino-tibetische Sprachen"},sla:{name:"Slawische Sprachen"},slo:{name:"Slowakisch"},slk:{name:"Slowakisch",
flag:"sk"},slv:{name:"Slowenisch",flag:"si"},sma:{name:"Süd Sami"},sme:{name:"Nord Sami"},smi:{name:"Sami Sprachen"},smj:{name:"Lulesamisch"},smn:{name:"Inari-Samen"},smo:{name:"Samoaner"},sms:{name:"Skolt Sami"},sna:{name:"Shona"},snd:{name:"Sindhi"},snk:{name:"Soninke"},sog:{name:"Sogdisch"},som:{name:"Somali"},son:{name:"Songhai Sprachen"},sot:{name:"Sotho, Südlich"},spa:{name:"Spanisch, Kastilisch",flag:"es"},srd:{name:"Sardisch"},srn:{name:"Sranan Tongo"},srp:{name:"Serbisch",flag:"rs"},srr:{name:"Serer"},
ssa:{name:"Nilosaharanische Sprachen"},ssw:{name:"Swati"},suk:{name:"Sukuma"},sun:{name:"Sundanesisch"},sus:{name:"Susu"},sux:{name:"Sumerisch"},swa:{name:"Swahili"},swe:{name:"Schwedisch",flag:"se"},syc:{name:"Klassisch Syrisch"},syr:{name:"Syrisch"},tah:{name:"Tahitianisch"},tai:{name:"Tai Sprachen"},tam:{name:"Tamilisch"},tat:{name:"Tatar"},tel:{name:"Telugu"},tem:{name:"Timne"},ter:{name:"Tereno"},tet:{name:"Tetum"},tgk:{name:"Tadschikisch"},tgl:{name:"Tagalog"},tha:{name:"Thailändisch",flag:"th"},
tib:{name:"Tibetisch"},bod:{name:"Tibetisch"},tig:{name:"Tigre"},tir:{name:"Tigrinya"},tiv:{name:"Tiv"},tkl:{name:"Tokelau"},tlh:{name:"Klingonisch; tlhIngan-Hol"},tli:{name:"Tlingit"},tmh:{name:"Tamashek"},tog:{name:"Tonga (Nyasa)"},ton:{name:"Tonga (Tonga-Inseln)"},tpi:{name:"Tok Pisin"},tsi:{name:"Tsimshian"},tsn:{name:"Tswana"},tso:{name:"Tsonga"},tuk:{name:"Turkmenisch"},tum:{name:"Tumbuka"},tup:{name:"Tupi-Sprachen"},tur:{name:"Türkisch",flag:"tr"},tut:{name:"Altaische Sprachen"},tvl:{name:"Tuvalu"},
twi:{name:"Twi"},tyv:{name:"Tuvinisch"},udm:{name:"Udmurtisch"},uga:{name:"Ugaritisch"},uig:{name:"Uigurisch"},ukr:{name:"Ukrainisch",flag:"ua"},umb:{name:"Umbundu"},und:{name:"Unbestimmt"},urd:{name:"Urdu"},uzb:{name:"Usbekisch"},vai:{name:"Vai"},ven:{name:"Venda"},vie:{name:"Vietnamesisch",flag:"vn"},vol:{name:"Volapük"},vot:{name:"Wotisch"},wak:{name:"Wakashan Sprachen"},wal:{name:"Walamo"},war:{name:"Waray"},was:{name:"Washo"},wel:{name:"Walisisch"},cym:{name:"Walisisch"},wen:{name:"Sorbische Sprachen"},
wln:{name:"Wallonisch"},wol:{name:"Wolof"},xal:{name:"Kalmücken; Oirat"},xho:{name:"Xhosa"},yao:{name:"Yao"},yap:{name:"Yap"},yid:{name:"Jiddisch"},yor:{name:"Yoruba"},ypk:{name:"Yupik Sprachen"},zap:{name:"Zapoteken"},zbl:{name:"Bliss-Symbole; Blissymbolics; Bliss"},zen:{name:"Zenaga"},zha:{name:"Zhuang; Chuang"},znd:{name:"Zande Sprachen"},zul:{name:"Zulu"},zun:{name:"Zuni"},zxx:{name:"Kein sprachlicher Inhalt; Entfällt"},zza:{name:"Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki"}}});define("wai-lang/../../../shared/languages/./iso639-1-en",
[],function(){return{aa:{name:"Afar"},ab:{name:"Abkhazian"},af:{name:"Afrikaans"},ak:{name:"Akan"},sq:{name:"Albanian"},am:{name:"Amharic"},ar:{name:"Arabic",flag:"ae"},an:{name:"Aragonese"},hy:{name:"Armenian"},as:{name:"Assamese"},av:{name:"Avaric"},ae:{name:"Avestan"},ay:{name:"Aymara"},az:{name:"Azerbaijani"},ba:{name:"Bashkir"},bm:{name:"Bambara"},eu:{name:"Basque"},be:{name:"Belarusian",flag:"by"},bn:{name:"Bengali"},bh:{name:"Bihari languages"},bi:{name:"Bislama"},bs:{name:"Bosnian"},br:{name:"Breton"},
bg:{name:"Bulgarian",flag:"bg"},my:{name:"Burmese"},ca:{name:"Catalan; Valencian",flag:"es"},ch:{name:"Chamorro"},ce:{name:"Chechen"},zh:{name:"Chinese"},cu:{name:"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"},cv:{name:"Chuvash"},kw:{name:"Cornish"},co:{name:"Corsican"},cr:{name:"Cree"},cs:{name:"Czech"},da:{name:"Danish",flag:"dk"},dv:{name:"Divehi; Dhivehi; Maldivian"},nl:{name:"Dutch; Flemish"},dz:{name:"Dzongkha"},en:{name:"English",flag:"gb"},eo:{name:"Esperanto"},
et:{name:"Estonian",flag:"ee"},ee:{name:"Ewe"},fo:{name:"Faroese"},fj:{name:"Fijian"},fi:{name:"Finnish",flag:"fi"},fr:{name:"French"},fy:{name:"Western Frisian"},ff:{name:"Fulah"},ka:{name:"Georgian"},de:{name:"German",flag:"de"},gd:{name:"Gaelic; Scottish Gaelic"},ga:{name:"Irish",flag:"ie"},gl:{name:"Galician"},gv:{name:"Manx"},el:{name:"Greek, Modern (1453-)"},gn:{name:"Guarani"},gu:{name:"Gujarati"},ht:{name:"Haitian; Haitian Creole"},ha:{name:"Hausa"},he:{name:"Hebrew",flag:"il"},hz:{name:"Herero"},
hi:{name:"Hindi",flag:"in"},ho:{name:"Hiri Motu"},hr:{name:"Croatian",flag:"hr"},hu:{name:"Hungarian",flag:"hu"},ig:{name:"Igbo"},is:{name:"Icelandic"},io:{name:"Ido"},ii:{name:"Sichuan Yi; Nuosu"},iu:{name:"Inuktitut"},ie:{name:"Interlingue; Occidental"},ia:{name:"Interlingua (International Auxiliary Language Association)"},id:{name:"Indonesian",flag:"id"},ik:{name:"Inupiaq"},it:{name:"Italian",flag:"it"},jv:{name:"Javanese"},ja:{name:"Japanese",flag:"jp"},kl:{name:"Kalaallisut; Greenlandic"},kn:{name:"Kannada"},
ks:{name:"Kashmiri"},kr:{name:"Kanuri"},kk:{name:"Kazakh"},km:{name:"Central Khmer"},ki:{name:"Kikuyu; Gikuyu"},rw:{name:"Kinyarwanda"},ky:{name:"Kirghiz; Kyrgyz"},kv:{name:"Komi"},kg:{name:"Kongo"},ko:{name:"Korean",flag:"kr"},kj:{name:"Kuanyama; Kwanyama"},ku:{name:"Kurdish"},lo:{name:"Lao"},la:{name:"Latin"},lv:{name:"Latvian",flag:"lv"},li:{name:"Limburgan; Limburger; Limburgish"},ln:{name:"Lingala"},lt:{name:"Lithuanian",flag:"lt"},lb:{name:"Luxembourgish; Letzeburgesch"},lu:{name:"Luba-Katanga"},
lg:{name:"Ganda"},mk:{name:"Macedonian"},mh:{name:"Marshallese"},ml:{name:"Malayalam"},mi:{name:"Maori"},mr:{name:"Marathi"},ms:{name:"Malay"},mg:{name:"Malagasy"},mt:{name:"Maltese",flag:"mt"},mn:{name:"Mongolian"},na:{name:"Nauru"},nv:{name:"Navajo; Navaho"},nr:{name:"Ndebele, South; South Ndebele"},nd:{name:"Ndebele, North; North Ndebele"},ng:{name:"Ndonga"},ne:{name:"Nepali"},nn:{name:"Norwegian Nynorsk; Nynorsk, Norwegian"},nb:{name:"Bokmål, Norwegian; Norwegian Bokmål"},no:{name:"Norwegian",
flag:"no"},ny:{name:"Chichewa; Chewa; Nyanja"},oc:{name:"Occitan (post 1500); Provençal"},oj:{name:"Ojibwa"},or:{name:"Oriya"},om:{name:"Oromo"},os:{name:"Ossetian; Ossetic"},pa:{name:"Panjabi; Punjabi"},fa:{name:"Persian"},pi:{name:"Pali"},pl:{name:"Polish",flag:"pl"},pt:{name:"Portuguese",flag:"pt"},ps:{name:"Pushto; Pashto"},qu:{name:"Quechua"},rm:{name:"Romansh"},ro:{name:"Romanian; Moldavian; Moldovan"},rn:{name:"Rundi"},ru:{name:"Russian",flag:"ru"},sg:{name:"Sango"},sa:{name:"Sanskrit"},si:{name:"Sinhala; Sinhalese"},
sk:{name:"Slovak"},sl:{name:"Slovenian",flag:"si"},se:{name:"Northern Sami"},sm:{name:"Samoan"},sn:{name:"Shona"},sd:{name:"Sindhi"},so:{name:"Somali"},st:{name:"Sotho, Southern"},es:{name:"Spanish; Castilian",flag:"es"},sc:{name:"Sardinian"},sr:{name:"Serbian",flag:"rs"},ss:{name:"Swati"},su:{name:"Sundanese"},sw:{name:"Swahili"},sv:{name:"Swedish",flag:"se"},ty:{name:"Tahitian"},ta:{name:"Tamil"},tt:{name:"Tatar"},te:{name:"Telugu"},tg:{name:"Tajik"},tl:{name:"Tagalog"},th:{name:"Thai",flag:"th"},
bo:{name:"Tibetan"},ti:{name:"Tigrinya"},to:{name:"Tonga (Tonga Islands)"},tn:{name:"Tswana"},ts:{name:"Tsonga"},tk:{name:"Turkmen"},tr:{name:"Turkish",flag:"tr"},tw:{name:"Twi"},ug:{name:"Uighur; Uyghur"},uk:{name:"Ukrainian",flag:"ua"},ur:{name:"Urdu"},uz:{name:"Uzbek"},ve:{name:"Venda"},vi:{name:"Vietnamese",flag:"vn"},vo:{name:"Volapük"},cy:{name:"Welsh"},wa:{name:"Walloon"},wo:{name:"Wolof"},xh:{name:"Xhosa"},yi:{name:"Yiddish"},yo:{name:"Yoruba"},za:{name:"Zhuang; Chuang"},zu:{name:"Zulu"}}});
define("wai-lang/../../../shared/languages/./iso639-2-en",[],function(){return{aar:{name:"Afar"},abk:{name:"Abkhazian"},ace:{name:"Achinese"},ach:{name:"Acoli"},ada:{name:"Adangme"},ady:{name:"Adyghe; Adygei"},afa:{name:"Afro-Asiatic languages"},afh:{name:"Afrihili"},afr:{name:"Afrikaans"},ain:{name:"Ainu"},aka:{name:"Akan"},akk:{name:"Akkadian"},alb:{name:"Albanian"},sqi:{name:"Albanian",flag:"al"},ale:{name:"Aleut"},alg:{name:"Algonquian languages"},alt:{name:"Southern Altai"},amh:{name:"Amharic"},
ang:{name:"English, Old (ca.450-1100)"},anp:{name:"Angika"},apa:{name:"Apache languages"},ara:{name:"Arabic",flag:"ae"},arc:{name:"Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)"},arg:{name:"Aragonese"},arm:{name:"Armenian"},hye:{name:"Armenian"},arn:{name:"Mapudungun; Mapuche"},arp:{name:"Arapaho"},art:{name:"Artificial languages"},arw:{name:"Arawak"},asm:{name:"Assamese"},ast:{name:"Asturian; Bable; Leonese; Asturleonese"},ath:{name:"Athapascan languages"},aus:{name:"Australian languages"},
ava:{name:"Avaric"},ave:{name:"Avestan"},awa:{name:"Awadhi"},aym:{name:"Aymara"},aze:{name:"Azerbaijani"},bad:{name:"Banda languages"},bai:{name:"Bamileke languages"},bak:{name:"Bashkir"},bal:{name:"Baluchi"},bam:{name:"Bambara"},ban:{name:"Balinese"},baq:{name:"Basque"},eus:{name:"Basque"},bas:{name:"Basa"},bat:{name:"Baltic languages"},bej:{name:"Beja; Bedawiyet"},bel:{name:"Belarusian",flag:"by"},bem:{name:"Bemba"},ben:{name:"Bengali"},ber:{name:"Berber languages"},bho:{name:"Bhojpuri"},bih:{name:"Bihari languages"},
bik:{name:"Bikol"},bin:{name:"Bini; Edo"},bis:{name:"Bislama"},bla:{name:"Siksika"},bnt:{name:"Bantu (Other)"},bos:{name:"Bosnian"},bra:{name:"Braj"},bre:{name:"Breton"},btk:{name:"Batak languages"},bua:{name:"Buriat"},bug:{name:"Buginese"},bul:{name:"Bulgarian",flag:"bg"},bur:{name:"Burmese"},mya:{name:"Burmese"},byn:{name:"Blin; Bilin"},cad:{name:"Caddo"},cai:{name:"Central American Indian languages"},car:{name:"Galibi Carib"},cat:{name:"Catalan; Valencian",flag:"es"},cau:{name:"Caucasian languages"},
ceb:{name:"Cebuano"},cel:{name:"Celtic languages"},cha:{name:"Chamorro"},chb:{name:"Chibcha"},che:{name:"Chechen"},chg:{name:"Chagatai"},chi:{name:"Chinese"},zho:{name:"Chinese",flag:"cn"},chk:{name:"Chuukese"},chm:{name:"Mari"},chn:{name:"Chinook jargon"},cho:{name:"Choctaw"},chp:{name:"Chipewyan; Dene Suline"},chr:{name:"Cherokee"},chu:{name:"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"},chv:{name:"Chuvash"},chy:{name:"Cheyenne"},cmc:{name:"Chamic languages"},
cop:{name:"Coptic"},cor:{name:"Cornish"},cos:{name:"Corsican"},cpe:{name:"Creoles and pidgins, English based"},cpf:{name:"Creoles and pidgins, French-based "},cpp:{name:"Creoles and pidgins, Portuguese-based "},cre:{name:"Cree"},crh:{name:"Crimean Tatar; Crimean Turkish"},crp:{name:"Creoles and pidgins "},csb:{name:"Kashubian"},cus:{name:"Cushitic languages"},cze:{name:"Czech"},ces:{name:"Czech",flag:"cz"},dak:{name:"Dakota"},dan:{name:"Danish",flag:"dk"},dar:{name:"Dargwa"},day:{name:"Land Dayak languages"},
del:{name:"Delaware"},den:{name:"Slave (Athapascan)"},dgr:{name:"Dogrib"},din:{name:"Dinka"},div:{name:"Divehi; Dhivehi; Maldivian"},doi:{name:"Dogri"},dra:{name:"Dravidian languages"},dsb:{name:"Lower Sorbian"},dua:{name:"Duala"},dum:{name:"Dutch, Middle (ca.1050-1350)"},dut:{name:"Dutch; Flemish"},nld:{name:"Dutch; Flemish",flag:"nl"},dyu:{name:"Dyula"},dzo:{name:"Dzongkha"},efi:{name:"Efik"},egy:{name:"Egyptian (Ancient)"},eka:{name:"Ekajuk"},elx:{name:"Elamite"},eng:{name:"English",flag:"gb"},
enm:{name:"English, Middle (1100-1500)"},epo:{name:"Esperanto"},est:{name:"Estonian",flag:"ee"},ewe:{name:"Ewe"},ewo:{name:"Ewondo"},fan:{name:"Fang"},fao:{name:"Faroese"},fat:{name:"Fanti"},fij:{name:"Fijian"},fil:{name:"Filipino; Pilipino"},fin:{name:"Finnish",flag:"fi"},fiu:{name:"Finno-Ugrian languages"},fon:{name:"Fon"},fre:{name:"French"},fra:{name:"French",flag:"fr"},frm:{name:"French, Middle (ca.1400-1600)"},fro:{name:"French, Old (842-ca.1400)"},frr:{name:"Northern Frisian"},frs:{name:"Eastern Frisian"},
fry:{name:"Western Frisian"},ful:{name:"Fulah"},fur:{name:"Friulian"},gaa:{name:"Ga"},gay:{name:"Gayo"},gba:{name:"Gbaya"},gem:{name:"Germanic languages"},geo:{name:"Georgian"},kat:{name:"Georgian"},ger:{name:"German",flag:"de"},deu:{name:"German",flag:"de"},gez:{name:"Geez"},gil:{name:"Gilbertese"},gla:{name:"Gaelic; Scottish Gaelic"},gle:{name:"Irish",flag:"ie"},glg:{name:"Galician"},glv:{name:"Manx"},gmh:{name:"German, Middle High (ca.1050-1500)"},goh:{name:"German, Old High (ca.750-1050)"},gon:{name:"Gondi"},
gor:{name:"Gorontalo"},got:{name:"Gothic"},grb:{name:"Grebo"},grc:{name:"Greek, Ancient (to 1453)"},gre:{name:"Greek, Modern (1453-)"},ell:{name:"Greek, Modern (1453-)",flag:"gr"},grn:{name:"Guarani"},gsw:{name:"Swiss German; Alemannic; Alsatian"},guj:{name:"Gujarati"},gwi:{name:"Gwich'in"},hai:{name:"Haida"},hat:{name:"Haitian; Haitian Creole"},hau:{name:"Hausa"},haw:{name:"Hawaiian"},heb:{name:"Hebrew",flag:"il"},her:{name:"Herero"},hil:{name:"Hiligaynon"},him:{name:"Himachali languages; Western Pahari languages"},
hin:{name:"Hindi",flag:"in"},hit:{name:"Hittite"},hmn:{name:"Hmong; Mong"},hmo:{name:"Hiri Motu"},hrv:{name:"Croatian",flag:"hr"},hsb:{name:"Upper Sorbian"},hun:{name:"Hungarian",flag:"hu"},hup:{name:"Hupa"},iba:{name:"Iban"},ibo:{name:"Igbo"},ice:{name:"Icelandic"},isl:{name:"Icelandic",flag:"is"},ido:{name:"Ido"},iii:{name:"Sichuan Yi; Nuosu"},ijo:{name:"Ijo languages"},iku:{name:"Inuktitut"},ile:{name:"Interlingue; Occidental"},ilo:{name:"Iloko"},ina:{name:"Interlingua (International Auxiliary Language Association)"},
inc:{name:"Indic languages"},ind:{name:"Indonesian",flag:"id"},ine:{name:"Indo-European languages"},inh:{name:"Ingush"},ipk:{name:"Inupiaq"},ira:{name:"Iranian languages"},iro:{name:"Iroquoian languages"},ita:{name:"Italian",flag:"it"},jav:{name:"Javanese"},jbo:{name:"Lojban"},jpn:{name:"Japanese",flag:"jp"},jpr:{name:"Judeo-Persian"},jrb:{name:"Judeo-Arabic"},kaa:{name:"Kara-Kalpak"},kab:{name:"Kabyle"},kac:{name:"Kachin; Jingpho"},kal:{name:"Kalaallisut; Greenlandic"},kam:{name:"Kamba"},kan:{name:"Kannada"},
kar:{name:"Karen languages"},kas:{name:"Kashmiri"},kau:{name:"Kanuri"},kaw:{name:"Kawi"},kaz:{name:"Kazakh"},kbd:{name:"Kabardian"},kha:{name:"Khasi"},khi:{name:"Khoisan languages"},khm:{name:"Central Khmer"},kho:{name:"Khotanese; Sakan"},kik:{name:"Kikuyu; Gikuyu"},kin:{name:"Kinyarwanda"},kir:{name:"Kirghiz; Kyrgyz"},kmb:{name:"Kimbundu"},kok:{name:"Konkani"},kom:{name:"Komi"},kon:{name:"Kongo"},kor:{name:"Korean",flag:"kr"},kos:{name:"Kosraean"},kpe:{name:"Kpelle"},krc:{name:"Karachay-Balkar"},
krl:{name:"Karelian"},kro:{name:"Kru languages"},kru:{name:"Kurukh"},kua:{name:"Kuanyama; Kwanyama"},kum:{name:"Kumyk"},kur:{name:"Kurdish"},kut:{name:"Kutenai"},lad:{name:"Ladino"},lah:{name:"Lahnda"},lam:{name:"Lamba"},lao:{name:"Lao"},lat:{name:"Latin"},lav:{name:"Latvian",flag:"lv"},lez:{name:"Lezghian"},lim:{name:"Limburgan; Limburger; Limburgish"},lin:{name:"Lingala"},lit:{name:"Lithuanian",flag:"lt"},lol:{name:"Mongo"},loz:{name:"Lozi"},ltz:{name:"Luxembourgish; Letzeburgesch"},lua:{name:"Luba-Lulua"},
lub:{name:"Luba-Katanga"},lug:{name:"Ganda"},lui:{name:"Luiseno"},lun:{name:"Lunda"},luo:{name:"Luo (Kenya and Tanzania)"},lus:{name:"Lushai"},mac:{name:"Macedonian"},mkd:{name:"Macedonian",flag:"mk"},mad:{name:"Madurese"},mag:{name:"Magahi"},mah:{name:"Marshallese"},mai:{name:"Maithili"},mak:{name:"Makasar"},mal:{name:"Malayalam"},man:{name:"Mandingo"},mao:{name:"Maori"},mri:{name:"Maori"},map:{name:"Austronesian languages"},mar:{name:"Marathi"},mas:{name:"Masai"},may:{name:"Malay"},msa:{name:"Malay",
flag:"my"},mdf:{name:"Moksha"},mdr:{name:"Mandar"},men:{name:"Mende"},mga:{name:"Irish, Middle (900-1200)"},mic:{name:"Mi'kmaq; Micmac"},min:{name:"Minangkabau"},mis:{name:"Uncoded languages"},mkh:{name:"Mon-Khmer languages"},mlg:{name:"Malagasy"},mlt:{name:"Maltese",flag:"mt"},mnc:{name:"Manchu"},mni:{name:"Manipuri"},mno:{name:"Manobo languages"},moh:{name:"Mohawk"},mon:{name:"Mongolian"},mos:{name:"Mossi"},mul:{name:"Multiple languages"},mun:{name:"Munda languages"},mus:{name:"Creek"},mwl:{name:"Mirandese"},
mwr:{name:"Marwari"},myn:{name:"Mayan languages"},myv:{name:"Erzya"},nah:{name:"Nahuatl languages"},nai:{name:"North American Indian languages"},nap:{name:"Neapolitan"},nau:{name:"Nauru"},nav:{name:"Navajo; Navaho"},nbl:{name:"Ndebele, South; South Ndebele"},nde:{name:"Ndebele, North; North Ndebele"},ndo:{name:"Ndonga"},nds:{name:"Low German; Low Saxon; German, Low; Saxon, Low"},nep:{name:"Nepali"},"new":{name:"Nepal Bhasa; Newari"},nia:{name:"Nias"},nic:{name:"Niger-Kordofanian languages"},niu:{name:"Niuean"},
nno:{name:"Norwegian Nynorsk; Nynorsk, Norwegian"},nob:{name:"Bokmål, Norwegian; Norwegian Bokmål"},nog:{name:"Nogai"},non:{name:"Norse, Old"},nor:{name:"Norwegian",flag:"no"},nqo:{name:"N'Ko"},nso:{name:"Pedi; Sepedi; Northern Sotho"},nub:{name:"Nubian languages"},nwc:{name:"Classical Newari; Old Newari; Classical Nepal Bhasa"},nya:{name:"Chichewa; Chewa; Nyanja"},nym:{name:"Nyamwezi"},nyn:{name:"Nyankole"},nyo:{name:"Nyoro"},nzi:{name:"Nzima"},oci:{name:"Occitan (post 1500); Provençal"},oji:{name:"Ojibwa"},
ori:{name:"Oriya"},orm:{name:"Oromo"},osa:{name:"Osage"},oss:{name:"Ossetian; Ossetic"},ota:{name:"Turkish, Ottoman (1500-1928)"},oto:{name:"Otomian languages"},paa:{name:"Papuan languages"},pag:{name:"Pangasinan"},pal:{name:"Pahlavi"},pam:{name:"Pampanga; Kapampangan"},pan:{name:"Panjabi; Punjabi"},pap:{name:"Papiamento"},pau:{name:"Palauan"},peo:{name:"Persian, Old (ca.600-400 B.C.)"},per:{name:"Persian"},fas:{name:"Persian"},phi:{name:"Philippine languages"},phn:{name:"Phoenician"},pli:{name:"Pali"},
pol:{name:"Polish",flag:"pl"},pon:{name:"Pohnpeian"},por:{name:"Portuguese",flag:"pt"},pra:{name:"Prakrit languages"},pro:{name:"Provençal, Old (to 1500)"},pus:{name:"Pushto; Pashto"},"qaa-qtz":{name:"Reserved for local use"},que:{name:"Quechua"},raj:{name:"Rajasthani"},rap:{name:"Rapanui"},rar:{name:"Rarotongan; Cook Islands Maori"},roa:{name:"Romance languages"},roh:{name:"Romansh"},rom:{name:"Romany"},rum:{name:"Romanian; Moldavian; Moldovan"},ron:{name:"Romanian; Moldavian; Moldovan",flag:"ro"},
run:{name:"Rundi"},rup:{name:"Aromanian; Arumanian; Macedo-Romanian"},rus:{name:"Russian",flag:"ru"},sad:{name:"Sandawe"},sag:{name:"Sango"},sah:{name:"Yakut"},sai:{name:"South American Indian (Other)"},sal:{name:"Salishan languages"},sam:{name:"Samaritan Aramaic"},san:{name:"Sanskrit"},sas:{name:"Sasak"},sat:{name:"Santali"},scn:{name:"Sicilian"},sco:{name:"Scots"},sel:{name:"Selkup"},sem:{name:"Semitic languages"},sga:{name:"Irish, Old (to 900)"},sgn:{name:"Sign Languages"},shn:{name:"Shan"},sid:{name:"Sidamo"},
sin:{name:"Sinhala; Sinhalese"},sio:{name:"Siouan languages"},sit:{name:"Sino-Tibetan languages"},sla:{name:"Slavic languages"},slo:{name:"Slovak"},slk:{name:"Slovak",flag:"sk"},slv:{name:"Slovenian",flag:"si"},sma:{name:"Southern Sami"},sme:{name:"Northern Sami"},smi:{name:"Sami languages"},smj:{name:"Lule Sami"},smn:{name:"Inari Sami"},smo:{name:"Samoan"},sms:{name:"Skolt Sami"},sna:{name:"Shona"},snd:{name:"Sindhi"},snk:{name:"Soninke"},sog:{name:"Sogdian"},som:{name:"Somali"},son:{name:"Songhai languages"},
sot:{name:"Sotho, Southern"},spa:{name:"Spanish; Castilian",flag:"es"},srd:{name:"Sardinian"},srn:{name:"Sranan Tongo"},srp:{name:"Serbian",flag:"rs"},srr:{name:"Serer"},ssa:{name:"Nilo-Saharan languages"},ssw:{name:"Swati"},suk:{name:"Sukuma"},sun:{name:"Sundanese"},sus:{name:"Susu"},sux:{name:"Sumerian"},swa:{name:"Swahili"},swe:{name:"Swedish",flag:"se"},syc:{name:"Classical Syriac"},syr:{name:"Syriac"},tah:{name:"Tahitian"},tai:{name:"Tai languages"},tam:{name:"Tamil"},tat:{name:"Tatar"},tel:{name:"Telugu"},
tem:{name:"Timne"},ter:{name:"Tereno"},tet:{name:"Tetum"},tgk:{name:"Tajik"},tgl:{name:"Tagalog"},tha:{name:"Thai",flag:"th"},tib:{name:"Tibetan"},bod:{name:"Tibetan"},tig:{name:"Tigre"},tir:{name:"Tigrinya"},tiv:{name:"Tiv"},tkl:{name:"Tokelau"},tlh:{name:"Klingon; tlhIngan-Hol"},tli:{name:"Tlingit"},tmh:{name:"Tamashek"},tog:{name:"Tonga (Nyasa)"},ton:{name:"Tonga (Tonga Islands)"},tpi:{name:"Tok Pisin"},tsi:{name:"Tsimshian"},tsn:{name:"Tswana"},tso:{name:"Tsonga"},tuk:{name:"Turkmen"},tum:{name:"Tumbuka"},
tup:{name:"Tupi languages"},tur:{name:"Turkish",flag:"tr"},tut:{name:"Altaic languages"},tvl:{name:"Tuvalu"},twi:{name:"Twi"},tyv:{name:"Tuvinian"},udm:{name:"Udmurt"},uga:{name:"Ugaritic"},uig:{name:"Uighur; Uyghur"},ukr:{name:"Ukrainian",flag:"ua"},umb:{name:"Umbundu"},und:{name:"Undetermined"},urd:{name:"Urdu"},uzb:{name:"Uzbek"},vai:{name:"Vai"},ven:{name:"Venda"},vie:{name:"Vietnamese",flag:"vn"},vol:{name:"Volapük"},vot:{name:"Votic"},wak:{name:"Wakashan languages"},wal:{name:"Walamo"},war:{name:"Waray"},
was:{name:"Washo"},wel:{name:"Welsh"},cym:{name:"Welsh"},wen:{name:"Sorbian languages"},wln:{name:"Walloon"},wol:{name:"Wolof"},xal:{name:"Kalmyk; Oirat"},xho:{name:"Xhosa"},yao:{name:"Yao"},yap:{name:"Yapese"},yid:{name:"Yiddish"},yor:{name:"Yoruba"},ypk:{name:"Yupik languages"},zap:{name:"Zapotec"},zbl:{name:"Blissymbols; Blissymbolics; Bliss"},zen:{name:"Zenaga"},zha:{name:"Zhuang; Chuang"},znd:{name:"Zande languages"},zul:{name:"Zulu"},zun:{name:"Zuni"},zxx:{name:"No linguistic content; Not applicable"},
zza:{name:"Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki"}}});define("wai-lang/../../../shared/languages/languages","aloha jquery ./iso639-1-de ./iso639-2-de ./iso639-1-en ./iso639-2-en".split(" "),function(m,e,a,j,d,b){var f={"iso639-1-de":a,"iso639-2-de":j,"iso639-1-en":d,"iso639-2-en":b},l=m.getAlohaUrl()+"/../plugins/shared/languages/";return m.AbstractRepository.extend({languageCodes:[],locale:"de",iso:"iso639-1",objectType:"language",flags:false,_constructor:function(a,b,c,d,e){this._super(a);
if(typeof b!=="undefined")this.flags=b;if(typeof c!=="undefined")this.iso="iso639-1"===c?"iso639-1":"iso639-2";if(typeof d!=="undefined")this.locale=d;if(typeof e!=="undefined")this.objectType=e;a=f[this.iso+"-"+this.locale];this.storeLanguageCodes(a);this.languageData=a},init:function(){},markObject:function(){},errorHandler:function(a){console.log("error",this,"Error while loading languages. "+a)},storeLanguageCodes:function(a){var b=this,c=l+"img/";e.each(a,function(a,d){d.id=a;d.repositoryId=
b.repositoryId;d.type=b.objectType;if(b.flags)d.url=d.flag?c+d.flag+".png":c+"default.png";b.languageCodes.push(new m.RepositoryDocument(d))})},_searchInLanguageCodes:function(a,b){var c=RegExp("^"+a.queryString,"i"),d,f=[],j,l,m;for(d=0;d<this.languageCodes.length;++d){m=this.languageCodes[d];j=!a.queryString||m.name.match(c);l=!a.objectTypeFilter||!a.objectTypeFilter.length||e.inArray(m.type,a.objectTypeFilter)>-1;j&&l&&f.push(m)}b.call(this,f)},query:function(a,b){this._searchInLanguageCodes(a,
b)},getObjectById:function(a,b){var c,d;for(c=0;c<this.languageCodes.length;++c){d=this.languageCodes[c];if(d.id===a){b.call(this,[d]);break}}}})});define("wai-lang/wai-lang-plugin","jquery aloha PubSub aloha/plugin aloha/selection aloha/content-rules util/dom ui/ui ui/scopes ui/button ui/toggleButton ui/port-helper-attribute-field i18n!wai-lang/nls/i18n ../../../shared/languages/languages".split(" "),function(m,e,a,j,d,b,f,l,g,k,c,q,n,o){function p(a){if(a){a.foreground();a.focus()}A.show();E.show()}
function r(){var a=m(this);return a.hasClass(F)||a.is("[lang]")}function t(a){return e.activeEditable?a.findMarkup(r,e.activeEditable.obj):null}function x(a){a.isCollapsed()&&f.extendToWord(a);f.addMarkup(a,m('<span class="'+F+'"></span>'),false);a.select()}function v(a){var b=t(a);if(b){f.removeFromDOM(b,a,true);a.select()}}function u(){if(e.activeEditable){var a=d.getRangeObject();if(t(a))v(a);else{x(a);p(A)}}}function z(a){A=q({name:"wailangfield",width:320,valueField:"id",minChars:1,scope:"Aloha.continuoustext"});
a._wailangButton=l.adopt("wailang",c,{tooltip:n.t("button.add-wai-lang.tooltip"),icon:"aloha-icon aloha-icon-wai-lang",scope:"Aloha.continuoustext",click:u});E=l.adopt("removewailang",k,{tooltip:n.t("button.add-wai-lang-remove.tooltip"),icon:"aloha-icon aloha-icon-wai-lang-remove",scope:"Aloha.continuoustext",click:function(){v(d.getRangeObject())}});A.setTemplate(a.flags?'<div class="aloha-wai-lang-img-item"><img class="aloha-wai-lang-img" src="{url}" /><div class="aloha-wai-lang-label-item">{name} ({id})</div></div>':
'<div class="aloha-wai-lang-img-item"><div class="aloha-wai-lang-label-item">{name} ({id})</div></div>');A.setObjectTypeFilter(a.objectTypeFilter)}function C(c){a.sub("aloha.editable.created",function(a){var e=a.editable.obj,f=c.getEditableConfig(e),f=f&&m.inArray("span",f)>-1&&b.isAllowed(e[0],"span");if(K[a.editable.getId()]=f){e.bind("keydown",c.hotKey.insertAnnotation,function(){var a=d.getRangeObject();t(a)||x(a);p(A);return false});e.find("span[lang]").each(function(){var a=m(this);a.addClass(F).attr("data-gentics-aloha-repository",
"wai-languages").attr("data-gentics-aloha-object-id",a.attr(J?"xml:lang":"lang"))})}});a.sub("aloha.editable.activated",function(a){c._wailangButton.show(!!K[a.editable.getId()])});a.sub("aloha.editable.deleted",function(a){delete K[a.editable.getId()]});e.bind("aloha-selection-changed",function(a,b){var d=t(b);if(d){c._wailangButton.setState(true);A.setTargetObject(d,J?"xml:lang":"lang");A.show();E.show();g.enterScope(c.name,"wai-lang")}else{c._wailangButton.setState(false);A.setTargetObject(null);
A.hide();E.hide();g.leaveScope(c.name,"wai-lang",true)}});A.addListener("blur",function(){this.getValue()||v(d.getRangeObject())})}var F="aloha-wai-lang",A=null,E=null,J=e.browser.msie&&parseInt(e.browser.version,10)===9,K={};return j.create("wai-lang",{config:["span"],iso639:"iso639-1",flags:false,objectTypeFilter:["language/wai"],hotKey:{insertAnnotation:n.t("insertAnnotation","ctrl+shift+l")},init:function(){if(this.settings.objectTypeFilter)this.objectTypeFilter=this.settings.objectTypeFilter;
this.settings.hotKey&&m.extend(true,this.hotKey,this.settings.hotKey);if(this.settings.iso639)this.iso639=this.settings.iso639;this.flags=true===this.settings.flags||"true"===this.settings.flags||1===this.settings.flags||"1"===this.settings.flags;z(this);C(this);new o("wai-languages",this.flags,this.iso639=="iso639-1"?"iso639-1":"iso639-2",e.settings.locale,"language/wai")},formatLanguageSpan:u,makeClean:function(a){a.find(J?"span[xml\\:lang]":"span[lang]").each(function(){var a=m(this);a.removeClass(F).removeAttr("data-gentics-aloha-repository").removeAttr("data-gentics-aloha-object-id");
if(J){a.attr("lang",a.attr("xml:lang"));a.lang=a.attr("xml:lang")}else a.attr("xml:lang",a.attr("lang"))})}})});define("headerids/nls/i18n",{root:{"headerids.label.target":"Target","headerids.button.reset":"Reset","headerids.button.set":"Set",internal_hyperlink:"Internal Hyperlink"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("headerids/headerids-plugin","aloha jquery PubSub aloha/plugin util/html i18n!headerids/nls/i18n".split(" "),function(m,e,a,j,d,b){function f(){var a=[],b=
k;g.each(arguments,function(){a.push("."+(this==""?b:b+"-"+this))});return e.trim(a.join(" "))}function l(){var a=[],b=k;g.each(arguments,function(){a.push(this==""?b:b+"-"+this)});return e.trim(a.join(" "))}var g=e,k="aloha-headerids";return j.create("headerids",{_constructor:function(){this._super("headerids")},config:["true"],init:function(){function b(a){d.check(a.editable.obj)}var d=this;a.sub("aloha.editable.created",b);a.sub("aloha.editable.activated",b);a.sub("aloha.editable.deactivated",
b);m.bind("aloha-plugins-loaded",function(){d.initSidebar(m.Sidebar.right)})},check:function(a){var b=this;g.inArray("true",b.getEditableConfig(a))>-1&&a.find("h1,h2,h3,h4,h5,h6").not(".aloha-customized,.aloha-editable,.aloha-block").each(function(a,c){b.processH(c)})},processH:function(a){var b=a.id;if(!b){for(var a=g(a),d=b="heading_"+this.sanitize(a.text()),e=1;g("#"+b).length>0;)b=d+"_"+(++e).toString();a.attr("id",b)}return b},sanitize:function(a){var b=m.settings.sanitizeCharacters||{},e;for(e in b)b.hasOwnProperty(e)&&
(a=a.replace(e,b[e]));return d.trimWhitespaceCharacters(a).replace(/[^a-z0-9]/gi,"_")},initSidebar:function(a){var d=this;d.sidebar=a;a.addPanel({id:l("sidebar-panel"),title:b.t("internal_hyperlink"),content:"",expanded:true,activeOn:"h1, h2, h3, h4, h5, h6",onInit:function(){var a=this,c=this.setContent('<label class="'+l("label")+'" for="'+l("input")+'">'+b.t("headerids.label.target")+'</label><input id="'+l("input")+'" class="'+l("input")+'" type="text" name="value"/> <button class="'+l("reset-button")+
'">'+b.t("headerids.button.reset")+'</button><button class="'+l("set-button")+'">'+b.t("headerids.button.set")+"</button>").content;c.find(f("set-button")).click(function(){var b=e(f("input")),c=d.sanitize(b.val());b.val(c);e(a.effective).attr("id",c).addClass("aloha-customized")});c.find(f("reset-button")).click(function(){d.processH(a.effective);e(a.effective).removeClass("aloha-customized");a.content.find(f("input")).val(a.effective.attr("id"))})},onActivate:function(a){this.effective=a;this.content.find(f("input")).val(d.processH(a[0]))}});
a.show()},makeClean:function(a){this.check(a)}})});define("metaview/nls/i18n",{root:{"button.switch-metaview.tooltip":"Switch between meta and normal view"},ca:!0,de:!0,mk:!0,"pt-br":!0,ru:!0,uk:!0,"zh-hans":!0});define("metaview/metaview-plugin","jquery aloha/core aloha/plugin ui/ui ui/toggleButton i18n!metaview/nls/i18n i18n!aloha/nls/i18n".split(" "),function(m,e,a,j,d,b){function f(a,b){a.addClass("aloha-metaview");b.setState(true);g[a[0].id]=true}function l(a,b){a.removeClass("aloha-metaview");
b.setState(false);g[a[0].id]=false}var g={},k=j.adopt("toggleMetaView",d,{tooltip:b.t("button.switch-metaview.tooltip"),icon:"aloha-icon aloha-icon-metaview",scope:"Aloha.continuoustext",click:function(){var a=e.activeEditable.obj;g[a[0].id]?l(a,this):f(a,this)}});return a.create("metaview",{config:["metaview"],init:function(){var a=this;e.bind("aloha-editable-activated",function(){var b=a.getEditableConfig(e.activeEditable.obj);if(m.type(b)==="array"&&m.inArray("enabled",b)!==-1){k.show(true);f(e.activeEditable.obj,
k)}else if(m.type(b)==="array"&&m.inArray("metaview",b)!==-1){k.show(true);g[e.activeEditable.obj[0].id]?f(e.activeEditable.obj,k):l(e.activeEditable.obj,k)}else k.show(false)});e.bind("aloha-editable-deactivated",function(){e.activeEditable.obj.removeClass("aloha-metaview")})}})});define("listenforcer/listenforcer-plugin",["aloha","jquery","aloha/plugin","aloha/console"],function(m,e,a,j){function d(a,d){if(-1!==e.inArray(a[0],b)){a.find(".aloha-end-br").remove();var g=!1;a.find("li").each(function(){if(""!==
e.trim(e(this).text()))return g=!0,!1});g||a.html(d);var j=a.find(">ul,>ol"),c=j.length,m;if(1<c){var n=e(j[0]);for(m=1;m<c;++m)n.append(e(j[m]).find(">li")),e(j[m]).remove()}a.find(">*:not(ul,ol)").remove()}}var b=[];return a.create("listenforcer",{_constructor:function(){this._super("listenforcer")},init:function(){var a=this,b=this.settings.editables||[],g,k,c=b.length;for(k=0;k<c;k++)g=b[k],"string"===typeof g||g.nodeName||g instanceof e?e(g).each(function(){a.addEditableToEnforcementList(this)}):
j.warn("Aloha List Enforcer Plugin",'Object "'+g.toString()+'" can not be used as a jQuery selector with which to register an editable to be list enforced.');m.bind("aloha-editable-activated",function(a,b){d(b.editable.obj,"<ul><li><br /></li></ul>")});m.bind("aloha-editable-deactivated",function(a,b){d(b.editable.obj,"")});m.bind("aloha-smart-content-changed",function(a,b){m.activeEditable&&!0===m.activeEditable.isActive&&d(b.editable.obj,"<ul><li><br /></li></ul>")})},addEditableToEnforcementList:function(a){a&&
b.push(a)}})});Aloha._load&&Aloha._load()})();