/*
Copyright DHTMLX LTD. http://www.dhtmlx.com
To use this library please contact sales@dhtmlx.com to obtain license
*/
dhtmlx=function(a){for(var b in a)dhtmlx[b]=a[b];return dhtmlx};dhtmlx.extend_api=function(a,b,c){var d=window[a];if(d)window[a]=function(a){if(a&&typeof a=="object"&&!a.tagName){var c=d.apply(this,b._init?b._init(a):arguments),g;for(g in dhtmlx)if(b[g])this[b[g]](dhtmlx[g]);for(g in a)if(b[g])this[b[g]](a[g]);else g.indexOf("on")==0&&this.attachEvent(g,a[g])}else c=d.apply(this,arguments);b._patch&&b._patch(this);return c||this},window[a].prototype=d.prototype,c&&dhtmlXHeir(window[a].prototype,c)};
dhtmlxAjax={get:function(a,b){var c=new dtmlXMLLoaderObject(!0);c.async=arguments.length<3;c.waitCall=b;c.loadXML(a);return c},post:function(a,b,c){var d=new dtmlXMLLoaderObject(!0);d.async=arguments.length<4;d.waitCall=c;d.loadXML(a,!0,b);return d},getSync:function(a){return this.get(a,null,!0)},postSync:function(a,b){return this.post(a,b,null,!0)}};
function dtmlXMLLoaderObject(a,b,c,d){this.xmlDoc="";this.async=typeof c!="undefined"?c:!0;this.onloadAction=a||null;this.mainObject=b||null;this.waitCall=null;this.rSeed=d||!1;return this}dtmlXMLLoaderObject.count=0;
dtmlXMLLoaderObject.prototype.waitLoadFunction=function(a){var b=!0;return this.check=function(){if(a&&a.onloadAction!=null&&(!a.xmlDoc.readyState||a.xmlDoc.readyState==4)&&b){b=!1;dtmlXMLLoaderObject.count++;if(typeof a.onloadAction=="function")a.onloadAction(a.mainObject,null,null,null,a);if(a.waitCall)a.waitCall.call(this,a),a.waitCall=null}}};
dtmlXMLLoaderObject.prototype.getXMLTopNode=function(a,b){if(this.xmlDoc.responseXML){var c=this.xmlDoc.responseXML.getElementsByTagName(a);c.length==0&&a.indexOf(":")!=-1&&(c=this.xmlDoc.responseXML.getElementsByTagName(a.split(":")[1]));var d=c[0]}else d=this.xmlDoc.documentElement;if(d)return this._retry=!1,d;if(!this._retry)return this._retry=!0,b=this.xmlDoc,this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/,""),!0),this.getXMLTopNode(a,b);dhtmlxError.throwError("LoadXML","Incorrect XML",
[b||this.xmlDoc,this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(a,b){if(_isIE)this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDoc.async=this.async,this.xmlDoc.onreadystatechange=function(){},this.xmlDoc.loadXML(a);else{var c=new DOMParser;this.xmlDoc=c.parseFromString(a,"text/xml")}if(!b){if(this.onloadAction)this.onloadAction(this.mainObject,null,null,null,this);if(this.waitCall)this.waitCall(),this.waitCall=null}};
dtmlXMLLoaderObject.prototype.loadXML=function(a,b,c,d){this.rSeed&&(a+=(a.indexOf("?")!=-1?"&":"?")+"a_dhx_rSeed="+(new Date).valueOf());this.filePath=a;this.xmlDoc=!_isIE&&window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if(this.async)this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);this.xmlDoc.open(b?"POST":"GET",a,this.async);d?(this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")"),this.xmlDoc.setRequestHeader("Content-type",
"text/xml")):b&&this.xmlDoc.setRequestHeader("Content-type","application/x-www-form-urlencoded");this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(c);this.async||(new this.waitLoadFunction(this))()};
dtmlXMLLoaderObject.prototype.destructor=function(){return this.setXSLParamValue=this.getXMLTopNode=this.xmlNodeToJSON=this.doSerialization=this.loadXMLString=this.loadXML=this.doXSLTransToString=this.doXSLTransToObject=this.doXPathOpera=this.doXPath=this.xmlDoc=this.mainObject=this.onloadAction=this.filePath=this.rSeed=this.async=this._retry=this._getAllNamedChilds=this._filterXPath=null};
dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;b._tagvalue=a.firstChild?a.firstChild.nodeValue:"";for(c=0;c<a.childNodes.length;c++){var d=a.childNodes[c].tagName;d&&(b[d]||(b[d]=[]),b[d].push(this.xmlNodeToJSON(a.childNodes[c])))}return b};function callerFunction(a,b){return this.handler=function(c){if(!c)c=window.event;a(c,b);return!0}}function getAbsoluteLeft(a){return getOffset(a).left}
function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){for(var b=0,c=0;a;)b+=parseInt(a.offsetTop),c+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:b,left:c}}
function getOffsetRect(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{top:Math.round(i),left:Math.round(j)}}function getOffset(a){return a.getBoundingClientRect?getOffsetRect(a):getOffsetSum(a)}
function convertStringToBoolean(a){typeof a=="string"&&(a=a.toLowerCase());switch(a){case "1":case "true":case "yes":case "y":case 1:case !0:return!0;default:return!1}}function getUrlSymbol(a){return a.indexOf("?")!=-1?"&":"?"}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop)return window.dhtmlDragAndDrop;this.dragStartObject=this.dragStartNode=this.dragNode=this.lastLanding=0;this.tempDOMM=this.tempDOMU=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this}
dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,b){a.onmousedown=this.preCreateDragCopy;a.dragStarter=b;this.addDragLanding(a,b)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,b){a.dragLanding=b};
dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if(!((a||window.event)&&(a||event).button==2)){if(window.dhtmlDragAndDrop.waitDrag)return window.dhtmlDragAndDrop.waitDrag=0,document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU,document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM,!1;window.dhtmlDragAndDrop.dragNode&&window.dhtmlDragAndDrop.stopDrag(a);window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=
document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=(new Date).valueOf();a&&a.preventDefault&&a.preventDefault();return!1}};
dhtmlDragAndDropObject.prototype.callDrag=function(a){if(!a)a=window.event;dragger=window.dhtmlDragAndDrop;if(!((new Date).valueOf()-dragger.downtime<100)){if(!dragger.dragNode)if(dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,a);if(!dragger.dragNode)return dragger.stopDrag();dragger.dragNode.onselectstart=function(){return!1};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=
0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}else return dragger.stopDrag(a,!0);if(dragger.dragNode.parentNode!=window.document.body&&dragger.gldragNode){var b=dragger.gldragNode;if(dragger.gldragNode.old)b=dragger.gldragNode.old;b.parentNode.removeChild(b);var c=dragger.dragNode.pWindow;b.pWindow&&b.pWindow.dhtmlDragAndDrop.lastLanding&&b.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(b.pWindow.dhtmlDragAndDrop.lastLanding);if(_isIE){var d=document.createElement("Div");d.innerHTML=
dragger.dragNode.outerHTML;dragger.dragNode=d.childNodes[0]}else dragger.dragNode=dragger.dragNode.cloneNode(!0);dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=a.clientX+15+(dragger.fx?dragger.fx*-1:0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=a.clientY+3+(dragger.fy?dragger.fy*-1:0)+(document.body.scrollTop||
document.documentElement.scrollTop)+"px";var e=a.srcElement?a.srcElement:a.target;dragger.checkLanding(e,a)}};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(a){if(window.name){for(var b=parent.frames[window.name].frameElement.offsetParent,c=0,d=0;b;)c+=b.offsetLeft,d+=b.offsetTop,b=b.offsetParent;if(parent.dhtmlDragAndDrop){var e=parent.dhtmlDragAndDrop.calculateFramePosition(1);c+=e.split("_")[0]*1;d+=e.split("_")[1]*1}if(a)return c+"_"+d;else this.fx=c;this.fy=d}return"0_0"};
dhtmlDragAndDropObject.prototype.checkLanding=function(a,b){a&&a.dragLanding?(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding),this.lastLanding=a,this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,b.clientX,b.clientY,b),this.lastLanding_scr=_isIE?b.srcElement:b.target):a&&a.tagName!="BODY"?this.checkLanding(a.parentNode,b):(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding,b.clientX,b.clientY,b),this.lastLanding=
0,this._onNotFound&&this._onNotFound())};
dhtmlDragAndDropObject.prototype.stopDrag=function(a,b){dragger=window.dhtmlDragAndDrop;if(!b){dragger.stopFrameRoute();var c=dragger.lastLanding;dragger.lastLanding=null;c&&c.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,c,_isIE?event.srcElement:a.target)}dragger.lastLanding=null;dragger.dragNode&&dragger.dragNode.parentNode==document.body&&dragger.dragNode.parentNode.removeChild(dragger.dragNode);dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode=
0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(a){a&&window.dhtmlDragAndDrop.stopDrag(1,1);for(var b=0;b<window.frames.length;b++)try{window.frames[b]!=a&&window.frames[b].dhtmlDragAndDrop&&window.frames[b].dhtmlDragAndDrop.stopFrameRoute(window)}catch(c){}try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.stopFrameRoute(window)}catch(d){}};
dhtmlDragAndDropObject.prototype.initFrameRoute=function(a,b){if(a)window.dhtmlDragAndDrop.preCreateDragCopy(),window.dhtmlDragAndDrop.dragStartNode=a.dhtmlDragAndDrop.dragStartNode,window.dhtmlDragAndDrop.dragStartObject=a.dhtmlDragAndDrop.dragStartObject,window.dhtmlDragAndDrop.dragNode=a.dhtmlDragAndDrop.dragNode,window.dhtmlDragAndDrop.gldragNode=a.dhtmlDragAndDrop.dragNode,window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag,window.waitDrag=0,!_isIE&&b&&(!_isFF||_FFrv<1.8)&&window.dhtmlDragAndDrop.calculateFramePosition();
try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.initFrameRoute(window)}catch(c){}for(var d=0;d<window.frames.length;d++)try{window.frames[d]!=a&&window.frames[d].dhtmlDragAndDrop&&window.frames[d].dhtmlDragAndDrop.initFrameRoute(window,!a||b?1:0)}catch(e){}};_OperaRv=_KHTMLrv=_FFrv=_isChrome=_isMacOS=_isKHTML=_isOpera=_isIE=_isFF=!1;navigator.userAgent.indexOf("Macintosh")!=-1&&(_isMacOS=!0);navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(_isChrome=!0);
if(navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("Konqueror")!=-1)_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5)),_KHTMLrv>525?(_isFF=!0,_FFrv=1.9):_isKHTML=!0;else if(navigator.userAgent.indexOf("Opera")!=-1)_isOpera=!0,_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3));else if(navigator.appName.indexOf("Microsoft")!=-1){if(_isIE=!0,(navigator.appVersion.indexOf("MSIE 8.0")!=-1||navigator.appVersion.indexOf("MSIE 9.0")!=
-1||navigator.appVersion.indexOf("MSIE 10.0")!=-1)&&document.compatMode!="BackCompat")_isIE=8}else _isFF=!0,_FFrv=parseFloat(navigator.userAgent.split("rv:")[1]);
dtmlXMLLoaderObject.prototype.doXPath=function(a,b,c,d){if(_isKHTML||!_isIE&&!window.XPathResult)return this.doXPathOpera(a,b);if(_isIE)return b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML),b||dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]),c!=null&&b.setProperty("SelectionNamespaces","xmlns:xsl='"+c+"'"),d=="single"?b.selectSingleNode(a):b.selectNodes(a)||[];else{var e=b;b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML);b||dhtmlxError.throwError("LoadXML",
"Incorrect XML",[b||this.xmlDoc,this.mainObject]);b.nodeName.indexOf("document")!=-1?e=b:(e=b,b=b.ownerDocument);var f=XPathResult.ANY_TYPE;if(d=="single")f=XPathResult.FIRST_ORDERED_NODE_TYPE;var g=[],h=b.evaluate(a,e,function(){return c},f,null);if(f==XPathResult.FIRST_ORDERED_NODE_TYPE)return h.singleNodeValue;for(var i=h.iterateNext();i;)g[g.length]=i,i=h.iterateNext();return g}};function L(){if(!this.catches)this.catches=[];return this}L.prototype.catchError=function(a,b){this.catches[a]=b};
L.prototype.throwError=function(a,b,c){if(this.catches[a])return this.catches[a](a,b,c);if(this.catches.ALL)return this.catches.ALL(a,b,c);alert("Error type: "+a+"\nDescription: "+b);return null};window.dhtmlxError=new L;
dtmlXMLLoaderObject.prototype.doXPathOpera=function(a,b){var c=a.replace(/[\/]+/gi,"/").split("/"),d=null,e=1;if(!c.length)return[];if(c[0]==".")d=[b];else if(c[0]=="")d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(c[e].replace(/\[[^\]]*\]/g,"")),e++;else return[];for(;e<c.length;e++)d=this._getAllNamedChilds(d,c[e]);c[e-1].indexOf("[")!=-1&&(d=this._filterXPath(d,c[e-1]));return d};
dtmlXMLLoaderObject.prototype._filterXPath=function(a,b){for(var c=[],b=b.replace(/[^\[]*\[\@/g,"").replace(/[\[\]\@]*/g,""),d=0;d<a.length;d++)a[d].getAttribute(b)&&(c[c.length]=a[d]);return c};
dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a,b){var c=[];_isKHTML&&(b=b.toUpperCase());for(var d=0;d<a.length;d++)for(var e=0;e<a[d].childNodes.length;e++)_isKHTML?a[d].childNodes[e].tagName&&a[d].childNodes[e].tagName.toUpperCase()==b&&(c[c.length]=a[d].childNodes[e]):a[d].childNodes[e].tagName==b&&(c[c.length]=a[d].childNodes[e]);return c};function dhtmlXHeir(a,b){for(var c in b)typeof b[c]=="function"&&(a[c]=b[c]);return a}
function dhtmlxEvent(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(a,b,c){if(!c)c=this.xslDoc;if(c.responseXML)c=c.responseXML;var d=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+a+"']",c,"http://www.w3.org/1999/XSL/Transform","single");if(d!=null)d.firstChild.nodeValue=b};
dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(a,b){if(!a)a=this.xslDoc;if(a.responseXML)a=a.responseXML;if(!b)b=this.xmlDoc;if(b.responseXML)b=b.responseXML;if(_isIE){d=new ActiveXObject("Msxml2.DOMDocument.3.0");try{b.transformNodeToObject(a,d)}catch(c){d=b.transformNode(a)}}else{if(!this.XSLProcessor)this.XSLProcessor=new XSLTProcessor,this.XSLProcessor.importStylesheet(a);var d=this.XSLProcessor.transformToDocument(b)}return d};
dtmlXMLLoaderObject.prototype.doXSLTransToString=function(a,b){var c=this.doXSLTransToObject(a,b);return typeof c=="string"?c:this.doSerialization(c)};dtmlXMLLoaderObject.prototype.doSerialization=function(a){if(!a)a=this.xmlDoc;if(a.responseXML)a=a.responseXML;if(_isIE)return a.xml;else{var b=new XMLSerializer;return b.serializeToString(a)}};
dhtmlxEventable=function(a){a.attachEvent=function(a,c,d){a="ev_"+a.toLowerCase();this[a]||(this[a]=new this.eventCatcher(d||this));return a+":"+this[a].addEvent(c)};a.callEvent=function(a,c){a="ev_"+a.toLowerCase();return this[a]?this[a].apply(this,c):!0};a.checkEvent=function(a){return!!this["ev_"+a.toLowerCase()]};a.eventCatcher=function(a){var c=[],d=function(){for(var d=!0,f=0;f<c.length;f++)if(c[f]!=null)var g=c[f].apply(a,arguments),d=d&&g;return d};d.addEvent=function(a){typeof a!="function"&&
(a=eval(a));return a?c.push(a)-1:!1};d.removeEvent=function(a){c[a]=null};return d};a.detachEvent=function(a){if(a!=!1){var c=a.split(":");this[c[0]].removeEvent(c[1])}};a.detachAllEvents=function(){for(var a in this)a.indexOf("ev_")==0&&delete this[a]};a=null};if(!window.dhtmlx)window.dhtmlx={};
(function(){function a(a,b){var d=a.callback;c(!1);a.box.parentNode.removeChild(a.box);l=a.box=null;d&&d(b)}function b(b){if(l){var b=b||event,c=b.which||event.keyCode;dhtmlx.message.keyboard&&((c==13||c==32)&&a(l,!0),c==27&&a(l,!1));b.preventDefault&&b.preventDefault();return!(b.cancelBubble=!0)}}function c(a){if(!c.cover)c.cover=document.createElement("DIV"),c.cover.onkeydown=b,c.cover.className="dhx_modal_cover",document.body.appendChild(c.cover);var d=document.body.scrollHeight;c.cover.style.display=
a?"inline-block":"none"}function d(a,b){return"<div class='dhtmlx_popup_button' result='"+b+"' ><div>"+a+"</div></div>"}function e(a){if(!n.area)n.area=document.createElement("DIV"),n.area.className="dhtmlx_message_area",n.area.style[n.position]="5px",document.body.appendChild(n.area);n.hide(a.id);var b=document.createElement("DIV");b.innerHTML="<div>"+a.text+"</div>";b.className="dhtmlx-info dhtmlx-"+a.type;b.onclick=function(){n.hide(a.id);a=null};n.position=="bottom"&&n.area.firstChild?n.area.insertBefore(b,
n.area.firstChild):n.area.appendChild(b);a.expire>0&&(n.timers[a.id]=window.setTimeout(function(){n.hide(a.id)},a.expire));n.pull[a.id]=b;b=null;return a.id}function f(b,c,e){var f=document.createElement("DIV");f.className=" dhtmlx_modal_box dhtmlx-"+b.type;f.setAttribute("dhxbox",1);var g="";if(b.width)f.style.width=b.width;if(b.height)f.style.height=b.height;b.title&&(g+='<div class="dhtmlx_popup_title">'+b.title+"</div>");g+='<div class="dhtmlx_popup_text"><span>'+(b.content?"":b.text)+'</span></div><div  class="dhtmlx_popup_controls">';
c&&(g+=d(b.ok||"OK",!0));e&&(g+=d(b.cancel||"Cancel",!1));if(b.buttons)for(var h=0;h<b.buttons.length;h++)g+=d(b.buttons[h],h);g+="</div>";f.innerHTML=g;if(b.content){var k=b.content;typeof k=="string"&&(k=document.getElementById(k));if(k.style.display=="none")k.style.display="";f.childNodes[b.title?1:0].appendChild(k)}f.onclick=function(c){var c=c||event,d=c.target||c.srcElement;if(!d.className)d=d.parentNode;d.className=="dhtmlx_popup_button"&&(result=d.getAttribute("result"),result=result=="true"||
(result=="false"?!1:result),a(b,result))};b.box=f;if(c||e)l=b;return f}function g(a,d,e){var g=a.tagName?a:f(a,d,e);a.hidden||c(!0);document.body.appendChild(g);var h=Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-g.offsetWidth)/2)),k=Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-g.offsetHeight)/2));g.style.top=a.position=="top"?"-3px":k+"px";g.style.left=h+"px";g.onkeydown=b;g.focus();a.hidden&&dhtmlx.modalbox.hide(g);return g}function h(a){return g(a,
!0,!1)}function i(a){return g(a,!0,!0)}function j(a){return g(a)}function k(a,b,c){typeof a!="object"&&(typeof b=="function"&&(c=b,b=""),a={text:a,type:b,callback:c});return a}function m(a,b,c,d){typeof a!="object"&&(a={text:a,type:b,expire:c,id:d});a.id=a.id||n.uid();a.expire=a.expire||n.expire;return a}var l=null;document.attachEvent?document.attachEvent("onkeydown",b):document.addEventListener("keydown",b,!0);dhtmlx.alert=function(){text=k.apply(this,arguments);text.type=text.type||"confirm";return h(text)};
dhtmlx.confirm=function(){text=k.apply(this,arguments);text.type=text.type||"alert";return i(text)};dhtmlx.modalbox=function(){text=k.apply(this,arguments);text.type=text.type||"alert";return j(text)};dhtmlx.modalbox.hide=function(a){for(;a&&a.getAttribute&&!a.getAttribute("dhxbox");)a=a.parentNode;a&&(a.parentNode.removeChild(a),c(!1))};var n=dhtmlx.message=function(a,b,c,d){a=m.apply(this,arguments);a.type=a.type||"info";var f=a.type.split("-")[0];switch(f){case "alert":return h(a);case "confirm":return i(a);
case "modalbox":return j(a);default:return e(a)}};n.seed=(new Date).valueOf();n.uid=function(){return n.seed++};n.expire=4E3;n.keyboard=!0;n.position="top";n.pull={};n.timers={};n.hideAll=function(){for(var a in n.pull)n.hide(a)};n.hide=function(a){var b=n.pull[a];b&&b.parentNode&&(window.setTimeout(function(){b.parentNode.removeChild(b);b=null},2E3),b.className+=" hidden",n.timers[a]&&window.clearTimeout(n.timers[a]),delete n.pull[a])}})();var globalActiveDHTMLGridObject;
String.prototype._dhx_trim=function(){return this.replace(/&nbsp;/g," ").replace(/(^[ \t]*)|([ \t]*$)/g,"")};function dhtmlxArray(a){return dhtmlXHeir(a||[],dhtmlxArray._master)}
dhtmlxArray._master={_dhx_find:function(a){for(var b=0;b<this.length;b++)if(a==this[b])return b;return-1},_dhx_insertAt:function(a,b){this[this.length]=null;for(var c=this.length-1;c>=a;c--)this[c]=this[c-1];this[a]=b},_dhx_removeAt:function(a){this.splice(a,1)},_dhx_swapItems:function(a,b){var c=this[a];this[a]=this[b];this[b]=c}};
function dhtmlXGridObject(a){if(_isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(b){}if(a)if(typeof a=="object"){if(this.entBox=a,!this.entBox.id)this.entBox.id="cgrid2_"+this.uid()}else this.entBox=document.getElementById(a);else this.entBox=document.createElement("DIV"),this.entBox.id="cgrid2_"+this.uid();this.entBox.innerHTML="";dhtmlxEventable(this);var c=this;this._wcorr=0;this.fontWidth=7;this.row=this.cell=null;this.iconURL="";this.editor=null;this._dclE=this._f2kE=!0;this.combos=
[];this.defVal=[];this.rowsAr={};this.rowsBuffer=dhtmlxArray();this.rowsCol=dhtmlxArray();this._data_cache={};this._ecache={};this._ud_enabled=!0;this.xmlLoader=new dtmlXMLLoaderObject(this.doLoadDetails,this,!0,this.no_cashe);this._maskArr=[];this.selectedRows=dhtmlxArray();this.UserData={};this._sizeFix=this._borderFix=0;this.entBox.className+=" gridbox";this.entBox.style.width=this.entBox.getAttribute("width")||(window.getComputedStyle?this.entBox.style.width||window.getComputedStyle(this.entBox,
null).width:this.entBox.currentStyle?this.entBox.currentStyle.width:this.entBox.style.width||0)||"100%";this.entBox.style.height=this.entBox.getAttribute("height")||(window.getComputedStyle?this.entBox.style.height||window.getComputedStyle(this.entBox,null).height:this.entBox.currentStyle?this.entBox.currentStyle.height:this.entBox.style.height||0)||"100%";this.entBox.style.cursor="default";this.entBox.onselectstart=function(){return!1};var d=function(a){var b=document.createElement("TABLE");b.cellSpacing=
b.cellPadding=0;b.style.cssText="width:100%;table-layout:fixed;";b.className=a.substr(2);return b};this.obj=d("c_obj");this.hdr=d("c_hdr");this.hdr.style.marginRight="20px";this.hdr.style.paddingRight="20px";this.objBox=document.createElement("DIV");this.objBox.style.width="100%";this.objBox.style.overflow="auto";this.objBox.appendChild(this.obj);this.objBox.className="objbox";this.hdrBox=document.createElement("DIV");this.hdrBox.style.width="100%";this.hdrBox.style.height="25px";this.hdrBox.style.overflow=
"hidden";this.hdrBox.className="xhdr";this.preloadImagesAr=[];this.sortImg=document.createElement("IMG");this.sortImg.style.display="none";this.hdrBox.appendChild(this.sortImg);this.hdrBox.appendChild(this.hdr);this.hdrBox.style.position="relative";this.entBox.appendChild(this.hdrBox);this.entBox.appendChild(this.objBox);this.entBox.grid=this;this.objBox.grid=this;this.hdrBox.grid=this;this.obj.grid=this;this.hdr.grid=this;this.cellWidthPX=[];this.cellWidthPC=[];this.cellWidthType=this.entBox.cellwidthtype||
"px";this.delim=this.entBox.delimiter||",";this._csvDelim=",";this.hdrLabels=[];this.columnIds=[];this.columnColor=[];this._hrrar=[];this.cellType=dhtmlxArray();this.cellAlign=[];this.initCellWidth=[];this.fldSort=[];this._srdh=_isIE&&document.compatMode!="BackCompat"?22:20;this.imgURL=window.dhx_globalImgPath||"";this.isActive=!1;this.isEditable=!0;this.pagingOn=this.useImagesInHeader=!1;this.rowsBufferOutSize=0;dhtmlxEvent(window,"unload",function(){try{c.destructor&&c.destructor()}catch(a){}});
this.setSkin=function(a){this.skin_name=a;var b=this.entBox.className.split(" gridbox")[0];this.entBox.className=b+" gridbox gridbox_"+a;this.skin_h_correction=0;this.enableAlterCss("ev_"+a,"odd_"+a,this.isTreeGrid());this._fixAlterCss();switch(a){case "clear":this._topMb=document.createElement("DIV");this._topMb.className="topMumba";this._topMb.innerHTML="<img style='left:0px'   src='"+this.imgURL+"skinC_top_left.gif'><img style='right:20px' src='"+this.imgURL+"skinC_top_right.gif'>";this.entBox.appendChild(this._topMb);
this._botMb=document.createElement("DIV");this._botMb.className="bottomMumba";this._botMb.innerHTML="<img style='left:0px'   src='"+this.imgURL+"skinD_bottom_left.gif'><img style='right:20px' src='"+this.imgURL+"skinD_bottom_right.gif'>";this.entBox.appendChild(this._botMb);if(this.entBox.style.position!="absolute")this.entBox.style.position="relative";this.skin_h_correction=20;break;case "white":this._srdh=40;this.forceDivInHeader=!0;break;case "dhx_skyblue":case "dhx_web":case "glassy_blue":case "dhx_black":case "dhx_blue":case "modern":case "light":this._srdh=
20;this.forceDivInHeader=!0;break;case "xp":this.forceDivInHeader=!0;this._srdh=_isIE&&document.compatMode!="BackCompat"?26:22;break;case "mt":this._srdh=_isIE&&document.compatMode!="BackCompat"?26:22;break;case "gray":if(_isIE&&document.compatMode!="BackCompat")this._srdh=22}if(_isIE&&this.hdr){var c=this.hdr.parentNode;c.removeChild(this.hdr);c.appendChild(this.hdr)}this.setSizes()};_isIE&&this.preventIECaching(!0);if(window.dhtmlDragAndDropObject)this.dragger=new dhtmlDragAndDropObject;this._doOnScroll=
function(a,b){this.callEvent("onScroll",[this.objBox.scrollLeft,this.objBox.scrollTop]);this.doOnScroll(a,b)};this.doOnScroll=function(a,b){this.hdrBox.scrollLeft=this.objBox.scrollLeft;if(this.ftr)this.ftr.parentNode.scrollLeft=this.objBox.scrollLeft;if(!b&&this._srnd)this._dLoadTimer&&window.clearTimeout(this._dLoadTimer),this._dLoadTimer=window.setTimeout(function(){c._update_srnd_view&&c._update_srnd_view()},100)};this.attachToObject=function(a){a.appendChild(this.globalBox?this.globalBox:this.entBox);
this.setSizes()};this.init=function(a){if(this.isTreeGrid()&&!this._h2){this._h2=new dhtmlxHierarchy;if(this._fake&&!this._realfake)this._fake._h2=this._h2;this._tgc={imgURL:null}}if(this._hstyles){this.editStop();this.fldSorted=this.r_fldSorted=this.resized=this.lastClicked=null;this.cellWidthPX=[];this.cellWidthPC=[];this.hdr.rows.length>0&&this.clearAll(!0);for(var b=this.hdr.insertRow(0),d=0;d<this.hdrLabels.length;d++)b.appendChild(document.createElement("TH")),b.childNodes[d]._cellIndex=d,b.childNodes[d].style.height=
"0px";_isIE&&_isIE<8?b.style.position="absolute":b.style.height="auto";b=this.hdr.insertRow(_isKHTML?2:1);b._childIndexes=[];for(var h=0,d=0;d<this.hdrLabels.length;d++)b._childIndexes[d]=d-h,this.hdrLabels[d]==this.splitSign&&d!=0?(_isKHTML&&b.insertCell(d-h),b.cells[d-h-1].colSpan=(b.cells[d-h-1].colSpan||1)+1,b.childNodes[d-h-1]._cellIndex++,h++,b._childIndexes[d]=d-h):(b.insertCell(d-h),b.childNodes[d-h]._cellIndex=d,b.childNodes[d-h]._cellIndexS=d,this.setColumnLabel(d,this.hdrLabels[d]));if(h==
0)b._childIndexes=null;this._cCount=this.hdrLabels.length;_isIE&&window.setTimeout(function(){c.setSizes&&c.setSizes()},1);this.obj.firstChild||this.obj.appendChild(document.createElement("TBODY"));var i=this.obj.firstChild;if(!i.firstChild){i.appendChild(document.createElement("TR"));i=i.firstChild;_isIE&&_isIE<8?i.style.position="absolute":i.style.height="auto";for(d=0;d<this.hdrLabels.length;d++)i.appendChild(document.createElement("TH")),i.childNodes[d].style.height="0px"}this._c_order=null;this.multiLine!=
!0&&(this.obj.className+=" row20px");this.sortImg.style.position="absolute";this.sortImg.style.display="none";this.sortImg.src=this.imgURL+"sort_desc.gif";this.sortImg.defLeft=0;this.noHeader?this.hdrBox.style.display="none":this.noHeader=!1;this.attachHeader();this.attachHeader(0,0,"_aFoot");this.setSizes();a&&this.parseXML();this.obj.scrollTop=0;this.dragAndDropOff&&this.dragger.addDragLanding(this.entBox,this);this._initDrF&&this._initD();this._init_point&&this._init_point()}};this.setColumnSizes=
function(a){for(var b=0,c=[],d=0,i=0;i<this._cCount;i++)if(this.initCellWidth[i]=="*"&&!this._hrrar[i])this._awdth=!1,c.push(i);else{if(this.cellWidthType=="%"){typeof this.cellWidthPC[i]=="undefined"&&(this.cellWidthPC[i]=this.initCellWidth[i]);var j=a*this.cellWidthPC[i]/100||0;d>0.5&&(j++,d--);var k=this.cellWidthPX[i]=Math.floor(j),d=d+j-k}else typeof this.cellWidthPX[i]=="undefined"&&(this.cellWidthPX[i]=this.initCellWidth[i]);this._hrrar[i]||(b+=this.cellWidthPX[i]*1)}if(c.length){var m=Math.floor((a-
b)/c.length);m<0&&(m=1);for(i=0;i<c.length;i++){var l=Math.max(this._drsclmW?this._drsclmW[c[i]]||0:0,m);this.cellWidthPX[c[i]]=l;b+=l}if(a>b){var n=c[c.length-1];this.cellWidthPX[n]+=a-b;b=a}this._setAutoResize()}this.obj.style.width=b+"px";this.hdr.style.width=b+"px";if(this.ftr)this.ftr.style.width=b+"px";this.chngCellWidth();return b};this.setSizes=function(){if(this.hdr.rows[0]){var a=this.quirks=_isIE&&document.compatMode=="BackCompat",b=(this.entBox.offsetWidth-this.entBox.clientWidth)/2;if(!this.dontSetSizes)if(this.globalBox){var d=
(this.globalBox.offsetWidth-this.globalBox.clientWidth)/2;if(this._delta_x&&!this._realfake){var h=this.globalBox.clientWidth;this.globalBox.style.width=this._delta_x;this.entBox.style.width=Math.max(0,this.globalBox.clientWidth+(a?d*2:0)-this._fake.entBox.clientWidth)+"px";h!=this.globalBox.clientWidth&&this._fake._correctSplit(this._fake.entBox.clientWidth)}if(this._delta_y&&!this._realfake)this.globalBox.style.height=this._delta_y,this.entBox.style.overflow=this._fake.entBox.style.overflow="hidden",
this.entBox.style.height=this._fake.entBox.style.height=this.globalBox.clientHeight+(a?d*2:0)+"px"}else{if(this._delta_x)this.entBox.parentNode&&this.entBox.parentNode.tagName=="TD"?(this.entBox.style.width="1px",this.entBox.style.width=parseInt(this._delta_x)*this.entBox.parentNode.clientWidth/100-b*2+"px"):this.entBox.style.width=this._delta_x;if(this._delta_y)this.entBox.style.height=this._delta_y}window.clearTimeout(this._sizeTime);if(!this.entBox.offsetWidth&&(!this.globalBox||!this.globalBox.offsetWidth))this._sizeTime=
window.setTimeout(function(){c.setSizes&&c.setSizes()},250);else{var i=!this._wthB&&(this.entBox.cmp||this._delta_x)&&(this.skin_name||"").indexOf("dhx")==0&&!a?2:0,j=!this._wthB&&(this.entBox.cmp||this._delta_y)&&(this.skin_name||"").indexOf("dhx")==0&&!a?2:0,k=this.parentGrid?!1:this.objBox.scrollHeight>this.objBox.offsetHeight,m=_isFF?18:18,l=this.entBox.clientWidth-(this.skin_h_correction||0)*(a?0:1)-i,n=this.entBox.clientWidth-(this.skin_h_correction||0)-i,o=this.entBox.clientHeight-j,p=this.setColumnSizes(n-
(k?m:0)-(this._correction_x||0)),r=this.parentGrid?!1:this.objBox.scrollWidth>this.objBox.offsetWidth||this.objBox.style.overflowX=="scroll",q=this.hdr.clientHeight,s=this.ftr?this.ftr.clientHeight:0,w=l,t=o-q-s;this._awdth&&this._awdth[0]&&this._awdth[1]==99999&&(r=0);if(this._ahgr&&(t=this._ahgrMA?this.entBox.parentNode.clientHeight-q-s:this.obj.offsetHeight+(r?m:0)+(this._correction_y||0),this._ahgrM&&(t=this._ahgrF?Math.min(this._ahgrM,t+q+s)-q-s:Math.min(this._ahgrM,t)),k&&t>=this.obj.scrollHeight+
(r?m:0)))k=!1,this.setColumnSizes(n-(this._correction_x||0));if(this._awdth&&this._awdth[0]){if(this.cellWidthType=="%")this.cellWidthType="px";this._fake&&(p+=this._fake.entBox.clientWidth);w=Math.min(Math.max(p+(k?m:0),this._awdth[2]),this._awdth[1])+(this._correction_x||0);this._fake&&(w-=this._fake.entBox.clientWidth)}t=Math.max(0,t);this._ff_size_delta=this._ff_size_delta==0.1?0.2:0.1;if(!_isFF)this._ff_size_delta=0;if(!this.dontSetSizes)this.entBox.style.width=Math.max(0,w+(a?2:0)*b+this._ff_size_delta)+
"px",this.entBox.style.height=t+(a?2:0)*b+q+s+"px";this.objBox.style.height=t+(a&&!k?2:0)*b+"px";this.hdrBox.style.height=q+"px";t!=o&&this.doOnScroll(0,!this._srnd);var v=this["setSizes_"+this.skin_name];v&&v.call(this);this.setSortImgPos();q!=this.hdr.clientHeight&&this._ahgr&&this.setSizes();this.callEvent("onSetSizes",[])}}};this.setSizes_clear=function(){var a=this.hdr.offsetHeight,b=this.entBox.offsetWidth,c=a+this.objBox.offsetHeight;this._topMb.style.top=(a||0)+"px";this._topMb.style.width=
b+20+"px";this._botMb.style.top=c-3+"px";this._botMb.style.width=b+20+"px"};this.chngCellWidth=function(){if(_isOpera&&this.ftr)this.ftr.width=this.objBox.scrollWidth+"px";for(var a=this._cCount,b=0;b<a;b++)if(this.hdr.rows[0].cells[b].style.width=this.cellWidthPX[b]+"px",this.obj.rows[0].childNodes[b].style.width=this.cellWidthPX[b]+"px",this.ftr)this.ftr.rows[0].cells[b].style.width=this.cellWidthPX[b]+"px"};this.setDelimiter=function(a){this.delim=a};this.setInitWidthsP=function(a,b){this.cellWidthType=
"%";this.initCellWidth=a.split(this.delim.replace(/px/gi,""));b||this._setAutoResize()};this._setAutoResize=function(){if(!this._realfake){var a=window,b=this;dhtmlxEvent(window,"resize",function(){window.clearTimeout(b._resize_timer);if(b._setAutoResize)b._resize_timer=window.setTimeout(function(){b.setSizes&&b.setSizes();b._fake&&b._fake._correctSplit()},100)})}};this.setInitWidths=function(a){this.cellWidthType="px";this.initCellWidth=a.split(this.delim);if(_isFF)for(var b=0;b<this.initCellWidth.length;b++)this.initCellWidth[b]!=
"*"&&(this.initCellWidth[b]=parseInt(this.initCellWidth[b]))};this.enableMultiline=function(a){this.multiLine=convertStringToBoolean(a)};this.enableMultiselect=function(a){this.selMultiRows=convertStringToBoolean(a)};this.setImagesPath=this.setImagePath=function(a){this.imgURL=a};this.setIconsPath=this.setIconPath=function(a){this.iconURL=a};this.changeCursorState=function(a){var b=a.target||a.srcElement;b.tagName!="TD"&&(b=this.getFirstParentOfType(b,"TD"));if(b){if(b.tagName=="TD"&&this._drsclmn&&
!this._drsclmn[b._cellIndex])return b.style.cursor="default";var c=(a.layerX||0)+(!_isIE&&a.target.tagName=="DIV"?b.offsetLeft:0);b.style.cursor=b.offsetWidth-(a.offsetX||(parseInt(this.getPosition(b,this.hdrBox))-c)*-1)<(_isOpera?20:10)?"E-resize":"default";if(_isOpera)this.hdrBox.scrollLeft=this.objBox.scrollLeft}};this.startColResize=function(a){this.resized&&this.stopColResize();this.resized=null;var b=a.target||a.srcElement;b.tagName!="TD"&&(b=this.getFirstParentOfType(b,"TD"));var d=a.clientX,
h=this.hdr.offsetWidth,i=parseInt(b.offsetWidth);if(b.tagName=="TD"&&b.style.cursor!="default"&&(!this._drsclmn||this._drsclmn[b._cellIndex]))c._old_d_mm=document.body.onmousemove,c._old_d_mu=document.body.onmouseup,document.body.onmousemove=function(a){c&&c.doColResize(a||window.event,b,i,d,h)},document.body.onmouseup=function(){c&&c.stopColResize()}};this.stopColResize=function(){document.body.onmousemove=c._old_d_mm||"";document.body.onmouseup=c._old_d_mu||"";this.setSizes();this.doOnScroll(0,
1);this.callEvent("onResizeEnd",[this])};this.doColResize=function(a,b,c,d,i){b.style.cursor="E-resize";this.resized=b;var j=c+(a.clientX-d),k=i+(a.clientX-d);if(this.callEvent("onResize",[b._cellIndex,j,this])){if(_isIE)this.objBox.scrollLeft=this.hdrBox.scrollLeft;if(b.colSpan>1){for(var m=[],l=0;l<b.colSpan;l++)m[l]=Math.round(j*this.hdr.rows[0].childNodes[b._cellIndexS+l].offsetWidth/b.offsetWidth);for(l=0;l<b.colSpan;l++)this._setColumnSizeR(b._cellIndexS+l*1,m[l])}else this._setColumnSizeR(b._cellIndex,
j);this.doOnScroll(0,1);this.setSizes();this._fake&&this._awdth&&this._fake._correctSplit()}};this._setColumnSizeR=function(a,b){if(b>(this._drsclmW&&!this._notresize?this._drsclmW[a]||10:10)){this.obj.rows[0].childNodes[a].style.width=b+"px";this.hdr.rows[0].childNodes[a].style.width=b+"px";if(this.ftr)this.ftr.rows[0].childNodes[a].style.width=b+"px";if(this.cellWidthType=="px")this.cellWidthPX[a]=b;else{var c=parseInt(this.entBox.offsetWidth);this.objBox.scrollHeight>this.objBox.offsetHeight&&
(c-=17);var d=Math.round(b/c*100);this.cellWidthPC[a]=d}this.sortImg.style.display!="none"&&this.setSortImgPos()}};this.setSortImgState=function(a,b,c,d){c=(c||"asc").toLowerCase();if(convertStringToBoolean(a)){this.sortImg.src=c=="asc"?this.imgURL+"sort_asc.gif":this.imgURL+"sort_desc.gif";this.sortImg.style.display="";this.fldSorted=this.hdr.rows[0].childNodes[b];var i=this.hdr.rows[d||1];if(i){for(var j=0;j<i.childNodes.length;j++)if(i.childNodes[j]._cellIndexS==b)return this.r_fldSorted=i.childNodes[j],
this.setSortImgPos();return this.setSortImgState(a,b,c,(d||1)+1)}}else this.sortImg.style.display="none",this.fldSorted=this.r_fldSorted=null};this.setSortImgPos=function(a,b,c,d){if(!this._hrrar||!this._hrrar[this.r_fldSorted?this.r_fldSorted._cellIndex:a])if(d||(d=a?this.hdr.rows[c||0].cells[a]:this.r_fldSorted),d!=null){var i=this.getPosition(d,this.hdrBox),j=d.offsetWidth;this.sortImg.style.left=Number(i[0]+j-13)+"px";this.sortImg.defLeft=parseInt(this.sortImg.style.left);this.sortImg.style.top=
Number(i[1]+5)+"px";if(!this.useImagesInHeader&&!b)this.sortImg.style.display="inline";this.sortImg.style.left=this.sortImg.defLeft+"px"}};this.setActive=function(a){arguments.length==0&&(a=!0);a==!0?(globalActiveDHTMLGridObject&&globalActiveDHTMLGridObject!=this&&(globalActiveDHTMLGridObject.editStop(),globalActiveDHTMLGridObject.callEvent("onBlur",[globalActiveDHTMLGridObject])),globalActiveDHTMLGridObject=this,this.isActive=!0):(this.isActive=!1,this.callEvent("onBlur",[this]))};this._doClick=
function(a){var b=0,c=this.getFirstParentOfType(_isIE?a.srcElement:a.target,"TD");if(c){var d=!0;if(this.markedCells){var i=0;if(a.shiftKey||a.metaKey)i=1;a.ctrlKey&&(i=2);this.doMark(c,i);return!0}if(this.selMultiRows!=!1&&(a.shiftKey&&this.row!=null&&this.selectedRows.length&&(b=1),a.ctrlKey||a.metaKey))b=2;this.doClick(c,d,b)}};this._doContClick=function(a){var b=this.getFirstParentOfType(_isIE?a.srcElement:a.target,"TD");if(!b||typeof b.parentNode.idd=="undefined")return this.callEvent("onEmptyClick",
[a]),!0;if(a.button==2||_isMacOS&&a.ctrlKey){if(!this.callEvent("onRightClick",[b.parentNode.idd,b._cellIndex,a])){var c=function(a){(a||event).cancelBubble=!0;return!1};(a.srcElement||a.target).oncontextmenu=c;return c(a)}if(this._ctmndx){if(!this.callEvent("onBeforeContextMenu",[b.parentNode.idd,b._cellIndex,this]))return!0;if(_isIE)a.srcElement.oncontextmenu=function(){event.cancelBubble=!0;return!1};if(this._ctmndx.showContextMenu){var d=window.document.documentElement,i=window.document.body,
j=[d.scrollLeft||i.scrollLeft,d.scrollTop||i.scrollTop];if(_isIE)var k=a.clientX+j[0],m=a.clientY+j[1];else k=a.pageX,m=a.pageY;this._ctmndx.showContextMenu(k-1,m-1);this.contextID=this._ctmndx.contextMenuZoneId=b.parentNode.idd+"_"+b._cellIndex;this._ctmndx._skip_hide=!0}else b.contextMenuId=b.parentNode.idd+"_"+b._cellIndex,b.contextMenu=this._ctmndx,b.a=this._ctmndx._contextStart,b.a(b,a),b.a=null;a.cancelBubble=!0;return!1}}else this._ctmndx&&(this._ctmndx.hideContextMenu?this._ctmndx.hideContextMenu():
this._ctmndx._contextEnd());return!0};this.doClick=function(a,b,d,h){this.selMultiRows||(d=0);var i=this.row?this.row.idd:0;this.setActive(!0);d||(d=0);if(this.cell!=null)this.cell.className=this.cell.className.replace(/cellselected/g,"");if(a.tagName=="TD"){if(this.checkEvent("onSelectStateChanged"))var j=this.getSelectedId();var k=this.row;if(d==1){var m=this.rowsCol._dhx_find(a.parentNode),l=this.rowsCol._dhx_find(this.lastClicked);if(m>l)var n=l,o=m;else n=m,o=l;for(var p=0;p<this.rowsCol.length;p++)if(p>=
n&&p<=o)if(this.rowsCol[p]&&!this.rowsCol[p]._sRow)this.rowsCol[p].className.indexOf("rowselected")==-1&&this.callEvent("onBeforeSelect",[this.rowsCol[p].idd,i])&&(this.rowsCol[p].className+=" rowselected",this.selectedRows[this.selectedRows.length]=this.rowsCol[p]);else return this.clearSelection(),this.doClick(a,b,0,h)}else if(d==2&&a.parentNode.className.indexOf("rowselected")!=-1){a.parentNode.className=a.parentNode.className.replace(/rowselected/g,"");this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(a.parentNode));
var r=!0,h=!1}this.editStop();if(typeof a.parentNode.idd=="undefined")return!0;if(!r&&!a.parentNode._sRow)if(this.callEvent("onBeforeSelect",[a.parentNode.idd,i]))if(this.getSelectedRowId()!=a.parentNode.idd){d==0&&this.clearSelection();this.cell=a;k==a.parentNode&&this._chRRS&&(b=!1);this.row=a.parentNode;this.row.className+=" rowselected";if(this.cell&&_isIE&&_isIE==8){var q=this.cell.nextSibling,s=this.cell.parentNode;s.removeChild(this.cell);s.insertBefore(this.cell,q)}if(this.selectedRows._dhx_find(this.row)==
-1)this.selectedRows[this.selectedRows.length]=this.row}else this.cell=a,this.row=a.parentNode;else b=!1;if(this.cell&&this.cell.parentNode.className.indexOf("rowselected")!=-1)this.cell.className=this.cell.className.replace(/cellselected/g,"")+" cellselected";if(d!=1&&!this.row)return;this.lastClicked=a.parentNode;var w=this.row.idd,t=this.cell;b&&typeof w!="undefined"&&t&&!r?c.onRowSelectTime=setTimeout(function(){c.callEvent&&c.callEvent("onRowSelect",[w,t._cellIndex])},100):this.callEvent("onRowSelectRSOnly",
[w]);if(this.checkEvent("onSelectStateChanged")){var v=this.getSelectedId();j!=v&&this.callEvent("onSelectStateChanged",[v,j])}}this.isActive=!0;h!==!1&&this.cell&&this.cell.parentNode.idd&&this.moveToVisible(this.cell)};this.selectAll=function(){this.clearSelection();var a=this.rowsBuffer;if(this.pagingOn)a=this.rowsCol;for(var b=0;b<a.length;b++)this.render_row(b).className+=" rowselected";this.selectedRows=dhtmlxArray([].concat(a));if(this.selectedRows.length)this.row=this.selectedRows[0],this.cell=
this.row.cells[0];this._fake&&!this._realfake&&this._fake.selectAll()};this.selectCell=function(a,b,c,d,i,j){c||(c=!1);typeof a!="object"&&(a=this.render_row(a));if(!a||a==-1)return null;var k=a.childNodes[b];k||(k=a.childNodes[0]);this.markedCells?this.doMark(k,d?2:0):d?this.doClick(k,c,3,j):this.doClick(k,c,0,j);i&&this.editCell()};this.moveToVisible=function(a,b){if(this.pagingOn){var c=Math.floor(this.getRowIndex(a.parentNode.idd)/this.rowsBufferOutSize)+1;c!=this.currentPage&&this.changePage(c)}try{if(a.offsetHeight){var d=
a.offsetLeft+a.offsetWidth+20,i=0;d>this.objBox.offsetWidth+this.objBox.scrollLeft?a.offsetLeft>this.objBox.scrollLeft&&(i=a.offsetLeft-5):a.offsetLeft<this.objBox.scrollLeft&&(d-=a.offsetWidth*2/3,d<this.objBox.scrollLeft&&(i=a.offsetLeft-5));if(i&&!b)this.objBox.scrollLeft=i}if(a.offsetHeight)d=a.offsetTop;else var j=this._realfake?this._fake.rowsAr[a.parentNode.idd]:a.parentNode,d=this.rowsBuffer._dhx_find(j)*this._srdh;var k=d+a.offsetHeight+38;if(k>this.objBox.offsetHeight+this.objBox.scrollTop)var m=
k-this.objBox.offsetHeight;else d<this.objBox.scrollTop&&(m=d-5);if(m)this.objBox.scrollTop=m}catch(l){}};this.editCell=function(){if(!(this.editor&&this.cell==this.editor.cell)){this.editStop();if(this.isEditable!=!0||!this.cell)return!1;var a=this.cell;if(a.parentNode._locked)return!1;this.editor=this.cells4(a);if(this.editor!=null){if(this.editor.isDisabled())return this.editor=null,!1;this.callEvent("onEditCell",[0,this.row.idd,this.cell._cellIndex])!=!1&&this.editor.edit?(this._Opera_stop=(new Date).valueOf(),
a.className+=" editable",this.editor.edit(),this.callEvent("onEditCell",[1,this.row.idd,this.cell._cellIndex])):this.editor=null}}};this.editStop=function(a){if(_isOpera&&this._Opera_stop){if(this._Opera_stop*1+50>(new Date).valueOf())return;this._Opera_stop=null}if(this.editor&&this.editor!=null)if(this.editor.cell.className=this.editor.cell.className.replace("editable",""),a){var b=this.editor.val;this.editor.detach();this.editor.setValue(b);this.editor=null;this.callEvent("onEditCancel",[this.row.idd,
this.cell._cellIndex,b])}else{if(this.editor.detach())this.cell.wasChanged=!0;var c=this.editor;this.editor=null;var d=this.callEvent("onEditCell",[2,this.row.idd,this.cell._cellIndex,c.getValue(),c.val]);if(typeof d=="string"||typeof d=="number")c[c.setImage?"setLabel":"setValue"](d);else if(!d)c[c.setImage?"setLabel":"setValue"](c.val);this._ahgr&&this.multiLine&&this.setSizes()}};this._nextRowCell=function(a,b,c){a=this._nextRow((this._groups?this.rowsCol:this.rowsBuffer)._dhx_find(a),b);return!a?
null:a.childNodes[a._childIndexes?a._childIndexes[c]:c]};this._getNextCell=function(a,b,c){var a=a||this.cell,d=a.parentNode;this._tabOrder?(c=this._tabOrder[a._cellIndex],typeof c!="undefined"&&(a=c<0?this._nextRowCell(d,b,Math.abs(c)-1):d.childNodes[c])):(c=a._cellIndex+b,c>=0&&c<this._cCount?(d._childIndexes&&(c=d._childIndexes[a._cellIndex]+b),a=d.childNodes[c]):a=this._nextRowCell(d,b,b==1?0:this._cCount-1));return!a?(b==1&&this.tabEnd&&(this.tabEnd.focus(),this.tabEnd.focus(),this.setActive(!1)),
b==-1&&this.tabStart&&(this.tabStart.focus(),this.tabStart.focus(),this.setActive(!1)),null):a.style.display!="none"&&(!this.smartTabOrder||!this.cells(a.parentNode.idd,a._cellIndex).isDisabled())?a:this._getNextCell(a,b)};this._nextRow=function(a,b){var c=this.render_row(a+b);return!c||c==-1?null:c&&c.style.display=="none"?this._nextRow(a+b,b):c};this.scrollPage=function(a){if(this.rowsBuffer.length){var b=this._realfake?this._fake:this,c=Math.floor((b._r_select||this.getRowIndex(this.row.idd)||
0)+a*this.objBox.offsetHeight/(this._srdh||20));c<0&&(c=0);c>=this.rowsBuffer.length&&(c=this.rowsBuffer.length-1);if(this._srnd&&!this.rowsBuffer[c]){this.objBox.scrollTop+=Math.floor(a*this.objBox.offsetHeight/(this._srdh||20))*(this._srdh||20);if(this._fake)this._fake.objBox.scrollTop=this.objBox.scrollTop;b._r_select=c}else{this.selectCell(c,this.cell._cellIndex,!0,!1,!1,this.multiLine||this._srnd);if(!this.multiLine&&!this._srnd&&!this._realfake&&(this.objBox.scrollTop=this.getRowById(this.getRowId(c)).offsetTop,
this._fake))this._fake.objBox.scrollTop=this.objBox.scrollTop;b._r_select=null}}};this.doKey=function(a){if(!a)return!0;if((a.target||a.srcElement).value!==window.undefined){var b=a.target||a.srcElement;if(!b.parentNode||b.parentNode.className.indexOf("editable")==-1)return!0}if(globalActiveDHTMLGridObject&&this!=globalActiveDHTMLGridObject)return globalActiveDHTMLGridObject.doKey(a);if(this.isActive==!1)return!0;if(this._htkebl)return!0;if(!this.callEvent("onKeyPress",[a.keyCode,a.ctrlKey,a.shiftKey,
a]))return!1;var c="k"+a.keyCode+"_"+(a.ctrlKey?1:0)+"_"+(a.shiftKey?1:0);if(this.cell){if(this._key_events[c]){if(!1===this._key_events[c].call(this))return!0;a.preventDefault&&a.preventDefault();a.cancelBubble=!0;return!1}this._key_events.k_other&&this._key_events.k_other.call(this,a)}return!0};this.selectRow=function(a,b,c,d){typeof a!="object"&&(a=this.render_row(a));this.selectCell(a,0,b,c,!1,d)};this.wasDblClicked=function(a){var b=this.getFirstParentOfType(_isIE?a.srcElement:a.target,"TD");
if(b){var c=b.parentNode.idd;return this.callEvent("onRowDblClicked",[c,b._cellIndex])}};this._onHeaderClick=function(a,b){var c=this.grid,b=b||c.getFirstParentOfType(_isIE?event.srcElement:a.target,"TD");if(this.grid.resized==null){if(!this.grid.callEvent("onHeaderClick",[b._cellIndexS,a||window.event]))return!1;c.sortField(b._cellIndexS,!1,b)}this.grid.resized=null};this.deleteSelectedRows=function(){var a=this.selectedRows.length;if(a!=0){var b=this.selectedRows;this.selectedRows=dhtmlxArray();
for(var c=a-1;c>=0;c--){var d=b[c];if(this.deleteRow(d.idd,d)){if(d==this.row)var i=c}else this.selectedRows[this.selectedRows.length]=d}if(i)try{i+1>this.rowsCol.length&&i--,this.selectCell(i,0,!0)}catch(j){this.cell=this.row=null}}};this.getSelectedRowId=function(){for(var a=[],b={},c=0;c<this.selectedRows.length;c++){var d=this.selectedRows[c].idd;b[d]||(a[a.length]=d,b[d]=!0)}return a.length==0?null:a.join(this.delim)};this.getSelectedCellIndex=function(){return this.cell!=null?this.cell._cellIndex:
-1};this.getColWidth=function(a){return parseInt(this.cellWidthPX[a])};this.setColWidth=function(a,b){if(b=="*")this.initCellWidth[a]="*";else{if(this._hrrar[a])return;this.cellWidthType=="px"?this.cellWidthPX[a]=parseInt(b):this.cellWidthPC[a]=parseInt(b)}this.setSizes()};this.getRowIndex=function(a){for(var b=0;b<this.rowsBuffer.length;b++)if(this.rowsBuffer[b]&&this.rowsBuffer[b].idd==a)return b;return-1};this.getRowId=function(a){return this.rowsBuffer[a]?this.rowsBuffer[a].idd:this.undefined};
this.setRowId=function(a,b){this.changeRowId(this.getRowId(a),b)};this.changeRowId=function(a,b){if(a!=b){var c=this.rowsAr[a];c.idd=b;this.UserData[a]&&(this.UserData[b]=this.UserData[a],this.UserData[a]=null);if(this._h2&&this._h2.get[a])this._h2.get[b]=this._h2.get[a],this._h2.get[b].id=b,delete this._h2.get[a];this.rowsAr[a]=null;this.rowsAr[b]=c;for(var d=0;d<c.childNodes.length;d++)if(c.childNodes[d]._code)c.childNodes[d]._code=this._compileSCL(c.childNodes[d]._val,c.childNodes[d]);if(this._mat_links&&
this._mat_links[a]){var i=this._mat_links[a];delete this._mat_links[a];for(var j in i)for(d=0;d<i[j].length;d++)this._compileSCL(i[j][d].original,i[j][d])}this.callEvent("onRowIdChange",[a,b])}};this.setColumnIds=function(a){this.columnIds=a.split(this.delim)};this.setColumnId=function(a,b){this.columnIds[a]=b};this.getColIndexById=function(a){for(var b=0;b<this.columnIds.length;b++)if(this.columnIds[b]==a)return b};this.getColumnId=function(a){return this.columnIds[a]};this.getColLabel=this.getColumnLabel=
function(a,b,c){for(var d=(c||this.hdr).rows[(b||0)+1],i=0;i<d.cells.length;i++)if(d.cells[i]._cellIndexS==a)return _isIE?d.cells[i].innerText:d.cells[i].textContent;return""};this.getFooterLabel=function(a,b){return this.getColumnLabel(a,b,this.ftr)};this.setRowTextBold=function(a){var b=this.getRowById(a);if(b)b.style.fontWeight="bold"};this.setRowTextStyle=function(a,b){var c=this.getRowById(a);if(c)for(var d=0;d<c.childNodes.length;d++){var i=c.childNodes[d]._attrs.style||"";c.childNodes[d].style.cssText=
i+"width:"+c.childNodes[d].style.width+";"+b}};this.setRowColor=function(a,b){for(var c=this.getRowById(a),d=0;d<c.childNodes.length;d++)c.childNodes[d].bgColor=b};this.setCellTextStyle=function(a,b,c){var d=this.getRowById(a);if(d){var i=d.childNodes[d._childIndexes?d._childIndexes[b]:b];if(i){var j="";i.style.cssText=j+"width:"+i.style.width+";"+c}}};this.setRowTextNormal=function(a){var b=this.getRowById(a);if(b)b.style.fontWeight="normal"};this.doesRowExist=function(a){return this.getRowById(a)!=
null?!0:!1};this.getColumnsNum=function(){return this._cCount};this.moveRowUp=function(a){var b=this.getRowById(a);if(this.isTreeGrid())return this.moveRowUDTG(a,-1);var c=this.rowsCol._dhx_find(b);if(b.previousSibling&&c!=0){b.parentNode.insertBefore(b,b.previousSibling);this.rowsCol._dhx_swapItems(c,c-1);this.setSizes();var d=this.rowsBuffer._dhx_find(b);this.rowsBuffer._dhx_swapItems(d,d-1);this._cssEven&&this._fixAlterCss(c-1)}};this.moveRowDown=function(a){var b=this.getRowById(a);if(this.isTreeGrid())return this.moveRowUDTG(a,
1);var c=this.rowsCol._dhx_find(b);if(b.nextSibling){this.rowsCol._dhx_swapItems(c,c+1);b.nextSibling.nextSibling?b.parentNode.insertBefore(b,b.nextSibling.nextSibling):b.parentNode.appendChild(b);this.setSizes();var d=this.rowsBuffer._dhx_find(b);this.rowsBuffer._dhx_swapItems(d,d+1);this._cssEven&&this._fixAlterCss(c)}};this.getCombo=function(a){this.combos[a]||(this.combos[a]=new dhtmlXGridComboObject);return this.combos[a]};this.setUserData=function(a,b,c){a||(a="gridglobaluserdata");this.UserData[a]||
(this.UserData[a]=new Hashtable);this.UserData[a].put(b,c)};this.getUserData=function(a,b){a||(a="gridglobaluserdata");this.getRowById(a);var c=this.UserData[a];return c?c.get(b):""};this.setEditable=function(a){this.isEditable=convertStringToBoolean(a)};this.selectRowById=function(a,b,c,d){d||(d=!1);this.selectCell(this.getRowById(a),0,d,b,!1,c)};this.clearSelection=function(){this.editStop();for(var a=0;a<this.selectedRows.length;a++){var b=this.rowsAr[this.selectedRows[a].idd];if(b)b.className=
b.className.replace(/rowselected/g,"")}this.selectedRows=dhtmlxArray();this.row=null;if(this.cell!=null)this.cell.className=this.cell.className.replace(/cellselected/g,""),this.cell=null;this.callEvent("onSelectionCleared",[])};this.copyRowContent=function(a,b){var c=this.getRowById(a);if(this.isTreeGrid())this._copyTreeGridRowContent(c,a,b);else for(var d=0;d<c.cells.length;d++)this.cells(b,d).setValue(this.cells(a,d).getValue());if(!_isIE)this.getRowById(a).cells[0].height=c.cells[0].offsetHeight};
this.setFooterLabel=function(a,b,c){return this.setColumnLabel(a,b,c,this.ftr)};this.setColumnLabel=function(a,b,c,d){var i=(d||this.hdr).rows[c||1],j=i._childIndexes?i._childIndexes[a]:a;if(i.cells[j]){if(this.useImagesInHeader){i.cells[j].style.textAlign="left";i.cells[j].innerHTML="<img src='"+this.imgURL+""+b+"' onerror='this.src = \""+this.imgURL+"imageloaderror.gif\"'>";var k=new Image;k.src=this.imgURL+""+b.replace(/(\.[a-z]+)/,".des$1");this.preloadImagesAr[this.preloadImagesAr.length]=k;
var m=new Image;m.src=this.imgURL+""+b.replace(/(\.[a-z]+)/,".asc$1");this.preloadImagesAr[this.preloadImagesAr.length]=m}else{var l="<div class='hdrcell'>";if(b.indexOf("img:[")!=-1){var n=b.replace(/.*\[([^>]+)\].*/,"$1"),b=b.substr(b.indexOf("]")+1,b.length);l+="<img width='18px' height='18px' align='absmiddle' src='"+n+"' hspace='2'>"}l+=b;l+="</div>";i.cells[j].innerHTML=l;if(this._hstyles[j])i.cells[j].style.cssText=this._hstyles[j]}if((b||"").indexOf("#")!=-1){var o=b.match(/(^|{)#([^}]+)(}|$)/);
if(o){var p="_in_header_"+o[2];if(this[p])this[p](this.forceDivInHeader?i.cells[j].firstChild:i.cells[j],j,b.split(o[0]))}}}};this.setColLabel=function(a,b,c,d){return this.setColumnLabel(a,b,(c||0)+1,d)};this.clearAll=function(a){if(this.obj.rows[0]){if(this._h2&&(this._h2=new dhtmlxHierarchy,this._fake))this._realfake?this._h2=this._fake._h2:this._fake._h2=this._h2;this.limit=this._limitC=0;this.editStop(!0);this._dLoadTimer&&window.clearTimeout(this._dLoadTimer);if(this._dload)this.objBox.scrollTop=
0,this.limit=this._limitC||0,this._initDrF=!0;for(var b=this.rowsCol.length,b=this.obj.rows.length,c=b-1;c>0;c--){var d=this.obj.rows[c];d.parentNode.removeChild(d)}if(a){this._master_row=null;this.obj.rows[0].parentNode.removeChild(this.obj.rows[0]);for(c=this.hdr.rows.length-1;c>=0;c--)d=this.hdr.rows[c],d.parentNode.removeChild(d);if(this.ftr)this.ftr.parentNode.removeChild(this.ftr),this.ftr=null;this._aHead=this.ftr=this.cellWidth=this._aFoot=null;this.cellType=dhtmlxArray();this._hrrar=[];this.columnIds=
[];this.combos=[];this._strangeParams=[];this.defVal=[];this._ivizcol=null}this.cell=this.row=null;this.rowsCol=dhtmlxArray();this.rowsAr={};this._RaSeCol=[];this.rowsBuffer=dhtmlxArray();this.UserData=[];this.selectedRows=dhtmlxArray();if(this.pagingOn||this._srnd)this.xmlFileUrl="";this.pagingOn&&this.changePage(1);this._contextCallTimer&&window.clearTimeout(this._contextCallTimer);this._sst&&this.enableStableSorting(!0);this._fillers=this.undefined;this.setSortImgState(!1);this.setSizes();this.callEvent("onClearAll",
[])}};this.sortField=function(a,b,c){if(this.getRowsNum()==0)return!1;var d=this.hdr.rows[0].cells[a];if(d&&d.tagName=="TH"&&this.fldSort.length-1>=d._cellIndex&&this.fldSort[d._cellIndex]!="na"){var i=this.getSortingState(),j=i[0]==a&&i[1]=="asc"?"des":"asc";if(this.callEvent("onBeforeSorting",[a,this.fldSort[a],j])){this.sortImg.src=this.imgURL+"sort_"+(j=="asc"?"asc":"desc")+".gif";if(this.useImagesInHeader){var k=this.hdr.rows[1].cells[d._cellIndex].firstChild;if(this.fldSorted!=null){var m=this.hdr.rows[1].cells[this.fldSorted._cellIndex].firstChild;
m.src=m.src.replace(/(\.asc\.)|(\.des\.)/,".")}k.src=k.src.replace(/(\.[a-z]+)$/,"."+j+"$1")}this.sortRows(d._cellIndex,this.fldSort[d._cellIndex],j);this.fldSorted=d;this.r_fldSorted=c;var l=this.hdr.rows[1],l=c.parentNode,n=l._childIndexes?l._childIndexes[d._cellIndex]:d._cellIndex;this.setSortImgPos(!1,!1,!1,c)}}};this.enableHeaderImages=function(a){this.useImagesInHeader=a};this.setHeader=function(a,b,c){for(var d=typeof a!="object"?this._eSplit(a):[].concat(a),i=[],j=new dhtmlxArray(0),k=[],
m=[],l=[],n=0;n<d.length;n++)i[i.length]=Math.round(100/d.length),j[j.length]="ed",k[k.length]="left",m[m.length]="middle",l[l.length]="na";this.splitSign=b||"#cspan";this.hdrLabels=d;this.cellWidth=i;this.initCellWidth.length||this.setInitWidthsP(i.join(this.delim),!0);this.cellType=j;this.cellAlign=k;this.cellVAlign=m;this.fldSort=l;this._hstyles=c||[]};this._eSplit=function(a){if(![].push)return a.split(this.delim);var b="r"+(new Date).valueOf(),c=this.delim.replace(/([\|\+\*\^])/g,"\\$1");return(a||
"").replace(RegExp(c,"g"),b).replace(RegExp("\\\\"+b,"g"),this.delim).split(b)};this.getColType=function(a){return this.cellType[a]};this.getColTypeById=function(a){return this.cellType[this.getColIndexById(a)]};this.setColTypes=function(a){this.cellType=dhtmlxArray(a.split(this.delim));this._strangeParams=[];for(var b=0;b<this.cellType.length;b++){if(this.cellType[b].indexOf("[")!=-1){var c=this.cellType[b].split(/[\[\]]+/g);this.cellType[b]=c[0];this.defVal[b]=c[1];c[1].indexOf("=")==0&&(this.cellType[b]=
"math",this._strangeParams[b]=c[0])}window["eXcell_"+this.cellType[b]]||dhtmlxError.throwError("Configuration","Incorrect cell type: "+this.cellType[b],[this,this.cellType[b]])}};this.setColSorting=function(a){this.fldSort=a.split(this.delim)};this.setColAlign=function(a){this.cellAlign=a.split(this.delim);for(var b=0;b<this.cellAlign.length;b++)this.cellAlign[b]=this.cellAlign[b]._dhx_trim()};this.setColVAlign=function(a){this.cellVAlign=a.split(this.delim)};this.setNoHeader=function(a){this.noHeader=
convertStringToBoolean(a)};this.showRow=function(a){this.getRowById(a);this._h2&&this.openItem(this._h2.get[a].parent.id);for(var b=this.getRowById(a).childNodes[0];b&&b.style.display=="none";)b=b.nextSibling;b&&this.moveToVisible(b,!0)};this.setStyle=function(a,b,c,d){this.ssModifier=[a,b,c,c,d];for(var i=["#"+this.entBox.id+" table.hdr td","#"+this.entBox.id+" table.obj td","#"+this.entBox.id+" table.obj tr.rowselected td.cellselected","#"+this.entBox.id+" table.obj td.cellselected","#"+this.entBox.id+
" table.obj tr.rowselected td"],j=0;!_isIE;){try{var k=document.styleSheets[j].cssRules.length}catch(m){j++;continue}break}for(var l=0;l<i.length;l++)this.ssModifier[l]&&(_isIE?document.styleSheets[0].addRule(i[l],this.ssModifier[l]):document.styleSheets[j].insertRule(i[l]+(" { "+this.ssModifier[l]+" }"),document.styleSheets[j].cssRules.length))};this.setColumnColor=function(a){this.columnColor=a.split(this.delim)};this.enableAlterCss=function(a,b,c,d){(a||b)&&this.attachEvent("onGridReconstructed",
function(){this._fixAlterCss();this._fake&&this._fake._fixAlterCss()});this._cssSP=c;this._cssSU=d;this._cssEven=a;this._cssUnEven=b};this._fixAlterCss=function(a){if(this._h2&&(this._cssSP||this._cssSU))return this._fixAlterCssTGR(a);if(this._cssEven||this._cssUnEven)for(var b=a=a||0,c=a;c<this.rowsCol.length;c++)if(this.rowsCol[c]&&this.rowsCol[c].style.display!="none")this.rowsCol[c]._cntr?b=1:(this.rowsCol[c].className=this.rowsCol[c].className.indexOf("rowselected")!=-1?b%2==1?this._cssUnEven+
" rowselected "+(this.rowsCol[c]._css||""):this._cssEven+" rowselected "+(this.rowsCol[c]._css||""):b%2==1?this._cssUnEven+" "+(this.rowsCol[c]._css||""):this._cssEven+" "+(this.rowsCol[c]._css||""),b++)};this.getPosition=function(a,b){if(!b&&!_isChrome){var c=getOffset(a);return[c.left,c.top]}for(var b=b||document.body,d=a,i=0,j=0;d&&d!=b;)i+=d.offsetLeft-d.scrollLeft,j+=d.offsetTop-d.scrollTop,d=d.offsetParent;b==document.body&&(_isIE?(j+=document.body.offsetTop||document.documentElement.offsetTop,
i+=document.body.offsetLeft||document.documentElement.offsetLeft):_isFF||(i+=document.body.offsetLeft,j+=document.body.offsetTop));return[i,j]};this.getFirstParentOfType=function(a,b){for(;a&&a.tagName!=b&&a.tagName!="BODY";)a=a.parentNode;return a};this.objBox.onscroll=function(){this.grid._doOnScroll()};this.hdrBox.onscroll=function(){if(!this._try_header_sync){this._try_header_sync=!0;if(this.grid.objBox.scrollLeft!=this.scrollLeft)this.grid.objBox.scrollLeft=this.scrollLeft;this._try_header_sync=
!1}};if(!_isOpera||_OperaRv>8.5)this.hdr.onmousemove=function(a){this.grid.changeCursorState(a||window.event)},this.hdr.onmousedown=function(a){return this.grid.startColResize(a||window.event)};this.obj.onmousemove=this._drawTooltip;this.objBox.onclick=function(a){(a||event).cancelBubble=!0};this.obj.onclick=function(a){this.grid._doClick(a||window.event);this.grid._sclE?this.grid.editCell(a||window.event):this.grid.editStop();(a||event).cancelBubble=!0};_isMacOS?this.entBox.oncontextmenu=function(a){a.cancelBubble=
!0;a.returnValue=!1;return this.grid._doContClick(a||window.event)}:(this.entBox.onmousedown=function(a){return this.grid._doContClick(a||window.event)},this.entBox.oncontextmenu=function(a){if(this.grid._ctmndx)(a||event).cancelBubble=!0;return!this.grid._ctmndx});this.obj.ondblclick=function(a){if(!this.grid.wasDblClicked(a||window.event))return!1;if(this.grid._dclE){var b=this.grid.getFirstParentOfType(_isIE?event.srcElement:a.target,"TR");b==this.grid.row&&this.grid.editCell(a||window.event)}(a||
event).cancelBubble=!0;if(_isOpera)return!1};this.hdr.onclick=this._onHeaderClick;this.sortImg.onclick=function(){c._onHeaderClick.apply({grid:c},[null,c.r_fldSorted])};this.hdr.ondblclick=this._onHeaderDblClick;if(!document.body._dhtmlxgrid_onkeydown)dhtmlxEvent(document,"keydown",function(a){if(globalActiveDHTMLGridObject)return globalActiveDHTMLGridObject.doKey(a||window.event)}),document.body._dhtmlxgrid_onkeydown=!0;dhtmlxEvent(document.body,"click",function(){c.editStop&&c.editStop();c.isActive&&
c.setActive(!1)});this.entBox.onbeforeactivate=function(){this._still_active=null;this.grid.setActive();event.cancelBubble=!0};this.entBox.onbeforedeactivate=function(){this.grid._still_active?this.grid._still_active=null:this.grid.isActive=!1;event.cancelBubble=!0};if(this.entBox.style.height.toString().indexOf("%")!=-1)this._delta_y=this.entBox.style.height;if(this.entBox.style.width.toString().indexOf("%")!=-1)this._delta_x=this.entBox.style.width;(this._delta_x||this._delta_y)&&this._setAutoResize();
this.setColHidden=this.setColumnsVisibility;this.enableCollSpan=this.enableColSpan;this.setMultiselect=this.enableMultiselect;this.setMultiLine=this.enableMultiline;this.deleteSelectedItem=this.deleteSelectedRows;this.getSelectedId=this.getSelectedRowId;this.getHeaderCol=this.getColumnLabel;this.isItemExists=this.doesRowExist;this.getColumnCount=this.getColumnsNum;this.setSelectedRow=this.selectRowById;this.setHeaderCol=this.setColumnLabel;this.preventIECashing=this.preventIECaching;this.enableAutoHeigth=
this.enableAutoHeight;this.getUID=this.uid;dhtmlx.image_path&&this.setImagePath(dhtmlx.image_path);dhtmlx.skin&&this.setSkin(dhtmlx.skin);return this}
dhtmlXGridObject.prototype={getRowAttribute:function(a,b){return this.getRowById(a)._attrs[b]},setRowAttribute:function(a,b,c){this.getRowById(a)._attrs[b]=c},isTreeGrid:function(){return this.cellType._dhx_find("tree")!=-1},setRowHidden:function(a,b){var c=convertStringToBoolean(b),d=this.getRowById(a);if(d){d.expand===""&&this.collapseKids(d);if(b&&d.style.display!="none"){d.style.display="none";var e=this.selectedRows._dhx_find(d);if(e!=-1){d.className=d.className.replace("rowselected","");for(var f=
0;f<d.childNodes.length;f++)d.childNodes[f].className=d.childNodes[f].className.replace(/cellselected/g,"");this.selectedRows._dhx_removeAt(e)}this.callEvent("onGridReconstructed",[])}if(!b&&d.style.display=="none")d.style.display="",this.callEvent("onGridReconstructed",[]);this.callEvent("onRowHide",[a,b]);this.setSizes()}},enableRowsHover:function(a,b){this._unsetRowHover(!1,!0);this._hvrCss=b;if(convertStringToBoolean(a)){if(!this._elmnh)this.obj._honmousemove=this.obj.onmousemove,this.obj.onmousemove=
this._setRowHover,_isIE?this.obj.onmouseleave=this._unsetRowHover:this.obj.onmouseout=this._unsetRowHover,this._elmnh=!0}else if(this._elmnh)this.obj.onmousemove=this.obj._honmousemove,_isIE?this.obj.onmouseleave=null:this.obj.onmouseout=null,this._elmnh=!1},enableEditEvents:function(a,b,c){this._sclE=convertStringToBoolean(a);this._dclE=convertStringToBoolean(b);this._f2kE=convertStringToBoolean(c)},enableLightMouseNavigation:function(a){if(convertStringToBoolean(a)){if(!this._elmn)this.entBox._onclick=
this.entBox.onclick,this.entBox.onclick=function(){return!0},this.obj._onclick=this.obj.onclick,this.obj.onclick=function(a){var c=this.grid.getFirstParentOfType(a?a.target:event.srcElement,"TD");if(c)this.grid.editStop(),this.grid.doClick(c),this.grid.editCell(),(a||event).cancelBubble=!0},this.obj._onmousemove=this.obj.onmousemove,this.obj.onmousemove=this._autoMoveSelect,this._elmn=!0}else if(this._elmn)this.entBox.onclick=this.entBox._onclick,this.obj.onclick=this.obj._onclick,this.obj.onmousemove=
this.obj._onmousemove,this._elmn=!1},_unsetRowHover:function(a,b){that=b?this:this.grid;if(that._lahRw&&that._lahRw!=b){for(var c=0;c<that._lahRw.childNodes.length;c++)that._lahRw.childNodes[c].className=that._lahRw.childNodes[c].className.replace(that._hvrCss,"");that._lahRw=null}},_setRowHover:function(a){var b=this.grid.getFirstParentOfType(a?a.target:event.srcElement,"TD");if(b&&b.parentNode!=this.grid._lahRw){this.grid._unsetRowHover(0,b);b=b.parentNode;if(!b.idd||b.idd=="__filler__")return;
for(var c=0;c<b.childNodes.length;c++)b.childNodes[c].className+=" "+this.grid._hvrCss;this.grid._lahRw=b}this._honmousemove(a)},_autoMoveSelect:function(a){if(!this.grid.editor){var b=this.grid.getFirstParentOfType(a?a.target:event.srcElement,"TD");b.parentNode.idd&&this.grid.doClick(b,!0,0)}this._onmousemove(a)},destructor:function(){this.editStop(!0);if(this._sizeTime)this._sizeTime=window.clearTimeout(this._sizeTime);this.entBox.className=(this.entBox.className||"").replace(/gridbox.*/,"");if(this.formInputs)for(var a=
0;a<this.formInputs.length;a++)this.parentForm.removeChild(this.formInputs[a]);var b;this.xmlLoader=this.xmlLoader.destructor();for(a=0;a<this.rowsCol.length;a++)if(this.rowsCol[a])this.rowsCol[a].grid=null;for(a in this.rowsAr)this.rowsAr[a]&&(this.rowsAr[a]=null);this.rowsCol=new dhtmlxArray;this.rowsAr={};this.entBox.innerHTML="";var c=function(){};this.setSizes=this._update_srnd_view=this.callEvent=this.entBox.onclick=this.entBox.onmousedown=this.entBox.onbeforeactivate=this.entBox.onbeforedeactivate=
this.entBox.onbeforedeactivate=this.entBox.onselectstart=c;this.entBox.grid=this.objBox.grid=this.hdrBox.grid=this.obj.grid=this.hdr.grid=null;if(this._fake)this.globalBox.innerHTML="",this._fake.setSizes=this._fake._update_srnd_view=this._fake.callEvent=c,this.globalBox.onclick=this.globalBox.onmousedown=this.globalBox.onbeforeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onselectstart=c;for(b in this){if(this[b]&&this[b].m_obj)this[b].m_obj=null;this[b]=
null}this==globalActiveDHTMLGridObject&&(globalActiveDHTMLGridObject=null);return null},getSortingState:function(){var a=[];if(this.fldSorted)a[0]=this.fldSorted._cellIndex,a[1]=this.sortImg.src.indexOf("sort_desc.gif")!=-1?"des":"asc";return a},enableAutoHeight:function(a,b,c){this._ahgr=convertStringToBoolean(a);this._ahgrF=convertStringToBoolean(c);this._ahgrM=b||null;if(arguments.length==1)this.objBox.style.overflowY=a?"hidden":"auto";if(b=="auto")this._ahgrM=null,this._ahgrMA=!0,this._setAutoResize()},
enableStableSorting:function(a){this._sst=convertStringToBoolean(a);this.rowsCol.stablesort=function(a){for(var c=this.length-1,d=0;d<this.length-1;d++){for(var e=0;e<c;e++)if(a(this[e],this[e+1])>0){var f=this[e];this[e]=this[e+1];this[e+1]=f}c--}}},enableKeyboardSupport:function(a){this._htkebl=!convertStringToBoolean(a)},enableContextMenu:function(a){this._ctmndx=a},setScrollbarWidthCorrection:function(){},enableTooltips:function(a){this._enbTts=a.split(",");for(var b=0;b<this._enbTts.length;b++)this._enbTts[b]=
convertStringToBoolean(this._enbTts[b])},enableResizing:function(a){this._drsclmn=a.split(",");for(var b=0;b<this._drsclmn.length;b++)this._drsclmn[b]=convertStringToBoolean(this._drsclmn[b])},setColumnMinWidth:function(a,b){if(arguments.length==2){if(!this._drsclmW)this._drsclmW=[];this._drsclmW[b]=a}else this._drsclmW=a.split(",")},enableCellIds:function(a){this._enbCid=convertStringToBoolean(a)},lockRow:function(a,b){var c=this.getRowById(a);if(c)c._locked=convertStringToBoolean(b),this.cell&&
this.cell.parentNode.idd==a&&this.editStop()},_getRowArray:function(a){for(var b=[],c=0;c<a.childNodes.length;c++){var d=this.cells3(a,c);b[c]=d.getValue()}return b},_launchCommands:function(a){for(var b=0;b<a.length;b++){for(var c=[],d=0;d<a[b].childNodes.length;d++)if(a[b].childNodes[d].nodeType==1)c[c.length]=a[b].childNodes[d].firstChild.data;this[a[b].getAttribute("command")].apply(this,c)}},_parseHead:function(a){var b=this.xmlLoader.doXPath("./head",a);if(b.length){var c=this.xmlLoader.doXPath("./column",
b[0]),d=this.xmlLoader.doXPath("./settings",b[0]),e="setInitWidths",f=!1;if(d[0])for(var g=0;g<d[0].childNodes.length;g++)switch(d[0].childNodes[g].tagName){case "colwidth":d[0].childNodes[g].firstChild&&d[0].childNodes[g].firstChild.data=="%"&&(e="setInitWidthsP");break;case "splitat":f=d[0].childNodes[g].firstChild?d[0].childNodes[g].firstChild.data:!1}this._launchCommands(this.xmlLoader.doXPath("./beforeInit/call",b[0]));if(c.length>0){this.hdr.rows.length>0&&this.clearAll(!0);for(var h=[[],[],
[],[],[],[],[],[],[]],i=",width,type,align,sort,color,format,hidden,id".split(","),j=["",e,"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"],k=0;k<c.length;k++){for(var m=1;m<i.length;m++)h[m].push(c[k].getAttribute(i[m]));h[0].push((c[k].firstChild?c[k].firstChild.data:"").replace(/^\s*((\s\S)*.+)\s*$/gi,"$1"))}this.setHeader(h[0]);for(k=0;k<j.length;k++)if(j[k])this[j[k]](h[k].join(this.delim));for(k=0;k<c.length;k++)if(this.cellType[k].indexOf("co")==0||this.cellType[k]==
"clist"){var l=this.xmlLoader.doXPath("./option",c[k]);if(l.length){var n=[];if(this.cellType[k]=="clist"){for(m=0;m<l.length;m++)n[n.length]=l[m].firstChild?l[m].firstChild.data:"";this.registerCList(k,n)}else for(var o=this.getCombo(k),m=0;m<l.length;m++)o.put(l[m].getAttribute("value"),l[m].firstChild?l[m].firstChild.data:"")}}else h[6][k]&&(this.cellType[k].toLowerCase().indexOf("calendar")!=-1||this.fldSort[k]=="date"?this.setDateFormat(h[6][k]):this.setNumberFormat(h[6][k],k));this.init();var p=
h[7].join(this.delim);this.setColHidden&&p.replace(/,/g,"")!=""&&this.setColHidden(p);f&&this.splitAt&&this.splitAt(f)}this._launchCommands(this.xmlLoader.doXPath("./afterInit/call",b[0]))}var r=this.xmlLoader.doXPath("//rows/userdata",a);if(r.length>0){this.UserData.gridglobaluserdata||(this.UserData.gridglobaluserdata=new Hashtable);for(m=0;m<r.length;m++){for(var q="",s=0;s<r[m].childNodes.length;s++)q+=r[m].childNodes[s].nodeValue;this.UserData.gridglobaluserdata.put(r[m].getAttribute("name"),
q)}}},getCheckedRows:function(a){var b=[];this.forEachRowA(function(c){this.cells(c,a).getValue()!=0&&b.push(c)},!0);return b.join(",")},checkAll:function(){for(var a=arguments.length?arguments[0]:1,b=0;b<this.getColumnsNum();b++)this.getColType(b)=="ch"&&this.setCheckedRows(b,a)},uncheckAll:function(){this.checkAll(0)},setCheckedRows:function(a,b){this.forEachRowA(function(c){this.cells(c,a).isCheckbox()&&this.cells(c,a).setValue(b)})},_drawTooltip:function(a){var b=this.grid.getFirstParentOfType(a?
a.target:event.srcElement,"TD");if(!b||this.grid.editor&&this.grid.editor.cell==b)return!0;var c=b.parentNode;if(c.idd&&c.idd!="__filler__"){var d=a?a.target:event.srcElement;if(c.idd==window.unknown)return!0;if(!this.grid.callEvent("onMouseOver",[c.idd,b._cellIndex,a||window.event]))return!0;if(this.grid._enbTts&&!this.grid._enbTts[b._cellIndex]){if(d.title)d.title="";return!0}if(!(b._cellIndex>=this.grid._cCount)){var e=this.grid.cells3(c,b._cellIndex);if(e&&e.cell&&e.cell._attrs){if(d._title)e.cell.title=
"";if(!e.cell._attrs.title)d._title=!0;if(e)d.title=e.cell._attrs.title||(e.getTitle?e.getTitle():(e.getValue()||"").toString().replace(/<[^>]*>/gi,""));return!0}}}},enableCellWidthCorrection:function(a){if(_isFF)this._wcorr=parseInt(a)},getAllRowIds:function(a){for(var b=[],c=0;c<this.rowsBuffer.length;c++)this.rowsBuffer[c]&&b.push(this.rowsBuffer[c].idd);return b.join(a||this.delim)},getAllItemIds:function(){return this.getAllRowIds()},preventIECaching:function(a){this.no_cashe=convertStringToBoolean(a);
this.xmlLoader.rSeed=this.no_cashe},enableColumnAutoSize:function(a){this._eCAS=convertStringToBoolean(a)},_onHeaderDblClick:function(a){var b=this.grid,c=b.getFirstParentOfType(_isIE?event.srcElement:a.target,"TD");if(!b._eCAS)return!1;b.adjustColumnSize(c._cellIndexS)},adjustColumnSize:function(a,b){if(!this._hrrar||!this._hrrar[a]){this._notresize=!0;var c=0;this._setColumnSizeR(a,20);for(var d=1;d<this.hdr.rows.length;d++){var e=this.hdr.rows[d];if((e=e.childNodes[e._childIndexes?e._childIndexes[a]:
a])&&(!e.colSpan||e.colSpan<2)&&e._cellIndex==a)e.childNodes[0]&&e.childNodes[0].className=="hdrcell"&&(e=e.childNodes[0]),c=Math.max(c,_isFF||_isOpera?e.textContent.length*this.fontWidth:e.scrollWidth)}for(var f=this.obj.rows.length,g=1;g<f;g++){var h=this.obj.rows[g];this.rowsAr[h.idd]&&!(h._childIndexes&&h._childIndexes[a]!=a)&&h.childNodes[a]&&(h=_isFF||_isOpera||b?h.childNodes[a].textContent.length*this.fontWidth:h.childNodes[a].scrollWidth,h>c&&(c=h))}c+=20+(b||0);this._setColumnSizeR(a,c);
this._notresize=!1;this.setSizes()}},detachHeader:function(a,b){var b=b||this.hdr,c=b.rows[a+1];c&&c.parentNode.removeChild(c);this.setSizes()},detachFooter:function(a){this.detachHeader(a,this.ftr)},attachHeader:function(a,b,c){typeof a=="string"&&(a=this._eSplit(a));typeof b=="string"&&(b=b.split(this.delim));c=c||"_aHead";if(this.hdr.rows.length)if(a)this._createHRow([a,b],this[c=="_aHead"?"hdr":"ftr"]);else{if(this[c])for(var d=0;d<this[c].length;d++)this.attachHeader.apply(this,this[c][d])}else this[c]||
(this[c]=[]),this[c][this[c].length]=[a,b,c]},_createHRow:function(a,b){if(!b){if(this.entBox.style.position!="absolute")this.entBox.style.position="relative";var c=document.createElement("DIV");c.className="ftr";this.entBox.appendChild(c);var d=document.createElement("TABLE");d.cellPadding=d.cellSpacing=0;if(!_isIE||_isIE==8)d.width="100%",d.style.paddingRight="20px";d.style.marginRight="20px";d.style.tableLayout="fixed";c.appendChild(d);d.appendChild(document.createElement("TBODY"));this.ftr=b=
d;for(var e=d.insertRow(0),f=this.hdrLabels.length<=1?a[0].length:this.hdrLabels.length,g=0;g<f;g++)e.appendChild(document.createElement("TH")),e.childNodes[g]._cellIndex=g;_isIE&&_isIE<8?e.style.position="absolute":e.style.height="auto"}var h=a[1],c=document.createElement("TR");b.rows[0].parentNode.appendChild(c);for(g=0;g<a[0].length;g++)if(a[0][g]=="#cspan"){var i=c.cells[c.cells.length-1];i.colSpan=(i.colSpan||1)+1}else if(a[0][g]=="#rspan"&&b.rows.length>1){for(var j=b.rows.length-2,k=!1,i=null;!k;){for(var i=
b.rows[j],m=0;m<i.cells.length;m++)if(i.cells[m]._cellIndex==g){k=m+1;break}j--}i=i.cells[k-1];i.rowSpan=(i.rowSpan||1)+1}else{var l=document.createElement("TD");l._cellIndex=l._cellIndexS=g;if(this._hrrar&&this._hrrar[g]&&!_isIE)l.style.display="none";if(typeof a[0][g]=="object")l.appendChild(a[0][g]);else if(l.innerHTML=this.forceDivInHeader?"<div class='hdrcell'>"+(a[0][g]||"&nbsp;")+"</div>":a[0][g]||"&nbsp;",(a[0][g]||"").indexOf("#")!=-1)if(d=a[0][g].match(/(^|{)#([^}]+)(}|$)/)){var n="_in_header_"+
d[2];if(this[n])this[n](this.forceDivInHeader?l.firstChild:l,g,a[0][g].split(d[0]))}if(h)l.style.cssText=h[g];c.appendChild(l)}var o=b;if(_isKHTML)b._kTimer&&window.clearTimeout(b._kTimer),b._kTimer=window.setTimeout(function(){b.rows[1].style.display="none";window.setTimeout(function(){b.rows[1].style.display=""},1)},500)},forEachRow:function(a){for(var b in this.rowsAr)this.rowsAr[b]&&this.rowsAr[b].idd&&a.apply(this,[this.rowsAr[b].idd])},forEachRowA:function(a){for(var b=0;b<this.rowsBuffer.length;b++)this.rowsBuffer[b]&&
a.call(this,this.render_row(b).idd)},forEachCell:function(a,b){var c=this.getRowById(a);if(c)for(var d=0;d<this._cCount;d++)b(this.cells3(c,d),d)},enableAutoWidth:function(a,b,c){this._awdth=[convertStringToBoolean(a),parseInt(b||99999),parseInt(c||0)];if(arguments.length==1)this.objBox.style.overflowX=a?"hidden":"auto"},updateFromXML:function(a,b,c,d){typeof b=="undefined"&&(b=!0);this._refresh_mode=[!0,b,c];this.load(a,d)},_refreshFromXML:function(a){this._f_rowsBuffer&&this.filterBy(0,"");reset=
!1;if(window.eXcell_tree)eXcell_tree.prototype.setValueX=eXcell_tree.prototype.setValue,eXcell_tree.prototype.setValue=function(a){var b=this.grid._h2.get[this.cell.parentNode.idd];b&&this.cell.parentNode.valTag?this.setLabel(a):this.setValueX(a)};var b=this.cellType._dhx_find("tree");a.getXMLTopNode("rows");var c=a.doXPath("//rows")[0].getAttribute("parent")||0,d={};this._refresh_mode[2]&&(b!=-1?this._h2.forEachChild(c,function(a){d[a.id]=!0},this):this.forEachRow(function(a){d[a]=!0}));for(var e=
a.doXPath("//row"),f=0;f<e.length;f++){var g=e[f],h=g.getAttribute("id");d[h]=!1;c=g.parentNode.getAttribute("id")||c;if(this.rowsAr[h]&&this.rowsAr[h].tagName!="TR")this._h2?this._h2.get[h].buff.data=g:this.rowsBuffer[this.getRowIndex(h)].data=g,this.rowsAr[h]=g;else if(this.rowsAr[h])this._process_xml_row(this.rowsAr[h],g,-1),this._postRowProcessing(this.rowsAr[h],!0);else if(this._refresh_mode[1]){var i={idd:h,data:g,_parser:this._process_xml_row,_locator:this._get_xml_data},j=this.rowsBuffer.length;
this._refresh_mode[1]=="top"?(this.rowsBuffer.unshift(i),j=0):this.rowsBuffer.push(i);if(this._h2)reset=!0,this._h2.add(h,g.parentNode.getAttribute("id")||g.parentNode.getAttribute("parent")).buff=this.rowsBuffer[this.rowsBuffer.length-1];this.rowsAr[h]=g;g=this.render_row(j);this._insertRowAt(g,j?-1:0)}}if(this._refresh_mode[2])for(h in d)d[h]&&this.rowsAr[h]&&this.deleteRow(h);this._refresh_mode=null;if(window.eXcell_tree)eXcell_tree.prototype.setValue=eXcell_tree.prototype.setValueX;reset&&this._renderSort();
if(this._f_rowsBuffer)this._f_rowsBuffer=null,this.filterByAll()},getCustomCombo:function(a,b){var c=this.cells(a,b).cell;if(!c._combo)c._combo=new dhtmlXGridComboObject;return c._combo},setTabOrder:function(a){var b=a.split(this.delim);this._tabOrder=[];for(var c=this._cCount||a.length,d=0;d<c;d++)b[d]={c:parseInt(b[d]),ind:d};b.sort(function(a,b){return a.c>b.c?1:-1});for(d=0;d<c;d++)this._tabOrder[b[d].ind]=!b[d+1]||typeof b[d].c=="undefined"?(b[0].ind+1)*-1:b[d+1].ind},i18n:{loading:"Loading",
decimal_separator:".",group_separator:","},_key_events:{k13_1_0:function(){var a=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a+1],this.cell._cellIndex,!0)},k13_0_1:function(){var a=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a-1],this.cell._cellIndex,!0)},k13_0_0:function(){this.editStop();this.callEvent("onEnter",[this.row?this.row.idd:null,this.cell?this.cell._cellIndex:null]);this._still_active=!0},k9_0_0:function(){this.editStop();if(!this.callEvent("onTab",
[!0]))return!0;var a=this._getNextCell(null,1);if(a)this.selectCell(a.parentNode,a._cellIndex,this.row!=a.parentNode,!1,!0),this._still_active=!0},k9_0_1:function(){this.editStop();if(!this.callEvent("onTab",[!1]))return!1;var a=this._getNextCell(null,-1);if(a)this.selectCell(a.parentNode,a._cellIndex,this.row!=a.parentNode,!1,!0),this._still_active=!0},k113_0_0:function(){this._f2kE&&this.editCell()},k32_0_0:function(){var a=this.cells4(this.cell);if(!a.changeState||a.changeState()===!1)return!1},
k27_0_0:function(){this.editStop(!0)},k33_0_0:function(){this.pagingOn?this.changePage(this.currentPage-1):this.scrollPage(-1)},k34_0_0:function(){this.pagingOn?this.changePage(this.currentPage+1):this.scrollPage(1)},k37_0_0:function(){if(!this.editor&&this.isTreeGrid())this.collapseKids(this.row);else return!1},k39_0_0:function(){if(!this.editor&&this.isTreeGrid())this.expandKids(this.row);else return!1},k40_0_0:function(){var a=this._realfake?this._fake:this;if(this.editor&&this.editor.combo)this.editor.shiftNext();
else{if(!this.row.idd)return;var b=Math.max(a._r_select||0,this.getRowIndex(this.row.idd))+1;if(this.rowsBuffer[b])a._r_select=null,this.selectCell(b,this.cell._cellIndex,!0),a.pagingOn&&a.showRow(a.getRowId(b));else{if(!this.callEvent("onLastRow",[]))return!1;this._key_events.k34_0_0.apply(this,[]);this.pagingOn&&this.rowsCol[b]&&this.selectCell(b,0,!0)}}this._still_active=!0},k38_0_0:function(){var a=this._realfake?this._fake:this;if(this.editor&&this.editor.combo)this.editor.shiftPrev();else{if(!this.row.idd)return;
var b=this.getRowIndex(this.row.idd)+1;if(b!=-1&&(!this.pagingOn||b!=1)){var c=this._nextRow(b-1,-1);this.selectCell(c,this.cell._cellIndex,!0);a.pagingOn&&c&&a.showRow(c.idd)}else this._key_events.k33_0_0.apply(this,[])}this._still_active=!0}},_build_master_row:function(){for(var a=document.createElement("DIV"),b=["<table><tr>"],c=0;c<this._cCount;c++)b.push("<td></td>");b.push("</tr></table>");a.innerHTML=b.join("");this._master_row=a.firstChild.rows[0]},_prepareRow:function(a){this._master_row||
this._build_master_row();for(var b=this._master_row.cloneNode(!0),c=0;c<b.childNodes.length;c++){b.childNodes[c]._cellIndex=c;if(this._enbCid)b.childNodes[c].id="c_"+a+"_"+c;this.dragAndDropOff&&this.dragger.addDraggableItem(b.childNodes[c],this)}b.idd=a;b.grid=this;return b},_process_jsarray_row:function(a,b){a._attrs={};for(var c=0;c<a.childNodes.length;c++)a.childNodes[c]._attrs={};this._fillRow(a,this._c_order?this._swapColumns(b):b);return a},_get_jsarray_data:function(a,b){return a[b]},_process_json_row:function(a,
b){b=this._c_order?this._swapColumns(b.data):b.data;return this._process_some_row(a,b)},_process_some_row:function(a,b){a._attrs={};for(var c=0;c<a.childNodes.length;c++)a.childNodes[c]._attrs={};this._fillRow(a,b);return a},_get_json_data:function(a,b){return a.data[b]},_process_js_row:function(a,b){for(var c=[],d=0;d<this.columnIds.length;d++)c[d]=b[this.columnIds[d]],!c[d]&&c[d]!==0&&(c[d]="");this._process_some_row(a,c);a._attrs=b;return a},_get_js_data:function(a,b){return a[this.columnIds[b]]},
_process_csv_row:function(a,b){a._attrs={};for(var c=0;c<a.childNodes.length;c++)a.childNodes[c]._attrs={};this._fillRow(a,this._c_order?this._swapColumns(b.split(this.csv.cell)):b.split(this.csv.cell));return a},_get_csv_data:function(a,b){return a.split(this.csv.cell)[b]},_process_store_row:function(a,b){for(var c=[],d=0;d<this.columnIds.length;d++)c[d]=b[this.columnIds[d]];for(var e=0;e<a.childNodes.length;e++)a.childNodes[e]._attrs={};a._attrs=b;this._fillRow(a,c)},_process_xml_row:function(a,
b){var c=this.xmlLoader.doXPath(this.xml.cell,b),d=[];a._attrs=this._xml_attrs(b);if(this._ud_enabled)for(var e=this.xmlLoader.doXPath("./userdata",b),f=e.length-1;f>=0;f--){for(var g="",h=0;h<e[f].childNodes.length;h++)g+=e[f].childNodes[h].nodeValue;this.setUserData(a.idd,e[f].getAttribute("name"),g)}for(h=0;h<c.length;h++){var i=c[this._c_order?this._c_order[h]:h];if(i){var j=a._childIndexes?a._childIndexes[h]:h,k=i.getAttribute("type");if(a.childNodes[j]){if(k)a.childNodes[j]._cellType=k;a.childNodes[j]._attrs=
this._xml_attrs(i)}i.getAttribute("xmlcontent")||(i=i.firstChild?i.firstChild.data:"");d.push(i)}}for(;h<a.childNodes.length;h++)a.childNodes[h]._attrs={};a.parentNode&&a.parentNode.tagName=="row"&&(a._attrs.parent=a.parentNode.getAttribute("idd"));this._fillRow(a,d);return a},_get_xml_data:function(a,b){for(a=a.firstChild;;){if(!a)return"";a.tagName=="cell"&&b--;if(b<0)break;a=a.nextSibling}return a.firstChild?a.firstChild.data:""},_fillRow:function(a,b){this.editor&&this.editStop();for(var c=0;c<
a.childNodes.length;c++)if(c<b.length||this.defVal[c]){var d=a.childNodes[c]._cellIndex,e=b[d],f=this.cells4(a.childNodes[c]);if(this.defVal[d]&&(e==""||typeof e=="undefined"))e=this.defVal[d];f&&f.setValue(e)}else a.childNodes[c].innerHTML="&nbsp;",a.childNodes[c]._clearCell=!0;return a},_postRowProcessing:function(a,b){if(a._attrs["class"])a._css=a.className=a._attrs["class"];if(a._attrs.locked)a._locked=!0;if(a._attrs.bgColor)a.bgColor=a._attrs.bgColor;for(var c=0,d=0;d<a.childNodes.length;d++){var e=
a.childNodes[d],f=e._cellIndex,g=e._attrs.style||a._attrs.style;g&&(e.style.cssText+=";"+g);if(e._attrs["class"])e.className=e._attrs["class"];if(g=e._attrs.align||this.cellAlign[f])e.align=g;e.vAlign=e._attrs.valign||this.cellVAlign[f];var h=e._attrs.bgColor||this.columnColor[f];if(h)e.bgColor=h;e._attrs.colspan&&!b&&(this.setColspan(a.idd,d+c,e._attrs.colspan),c+=e._attrs.colspan-1);if(this._hrrar&&this._hrrar[f]&&!b)e.style.display="none"}this.callEvent("onRowCreated",[a.idd,a,null])},load:function(a,
b,c){this.callEvent("onXLS",[this]);arguments.length==2&&typeof b!="function"&&(c=b,b=null);c=c||"xml";if(!this.xmlFileUrl)this.xmlFileUrl=a;this._data_type=c;this.xmlLoader.onloadAction=function(a,e,f,g,h){a.callEvent&&(h=a["_process_"+c](h),a._contextCallTimer||a.callEvent("onXLE",[a,0,0,h]),b&&(b(),b=null))};this.xmlLoader.loadXML(a)},loadXML:function(a,b){this.load(a,b,"xml")},parse:function(a,b,c){arguments.length==2&&typeof b!="function"&&(c=b,b=null);this._data_type=c=c||"xml";a=this["_process_"+
c](a);this._contextCallTimer||this.callEvent("onXLE",[this,0,0,a]);b&&b()},xml:{top:"rows",row:"./row",cell:"./cell",s_row:"row",s_cell:"cell",row_attrs:[],cell_attrs:[]},csv:{row:"\n",cell:","},_xml_attrs:function(a){var b={};if(a.attributes.length)for(var c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;return b},_process_xml:function(a){if(!a.doXPath){var b=new dtmlXMLLoaderObject(function(){});typeof a=="string"?b.loadXMLString(a):(b.xmlDoc=a.responseXML?a:{},b.xmlDoc.responseXML=
a);a=b}if(this._refresh_mode)return this._refreshFromXML(a);this._parsing=!0;var c=a.getXMLTopNode(this.xml.top);if(c.tagName==this.xml.top){var d=c.getAttribute("dhx_security");if(d)dhtmlx.security_key=d;this._parseHead(c);var e=a.doXPath(this.xml.row,c),f=parseInt(a.doXPath("//"+this.xml.top)[0].getAttribute("pos")||0),g=parseInt(a.doXPath("//"+this.xml.top)[0].getAttribute("total_count")||0),h=!1;g&&g!=this.rowsBuffer.length&&(this.rowsBuffer[g-1]||(this.rowsBuffer.length&&(h=!0),this.rowsBuffer[g-
1]=null),g<this.rowsBuffer.length&&(this.rowsBuffer.splice(g,this.rowsBuffer.length-g),h=!0));if(this.isTreeGrid())return this._process_tree_xml(a);for(var i=0;i<e.length;i++)if(!this.rowsBuffer[i+f]){var j=e[i].getAttribute("id")||i+f+1;this.rowsBuffer[i+f]={idd:j,data:e[i],_parser:this._process_xml_row,_locator:this._get_xml_data};this.rowsAr[j]=e[i]}if(h&&this._srnd){var k=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=k}else this.render_dataset();this._parsing=!1;return a.xmlDoc.responseXML?
a.xmlDoc.responseXML:a.xmlDoc}},_process_jsarray:function(a){this._parsing=!0;if(a&&a.xmlDoc)eval("dhtmlx.temp="+a.xmlDoc.responseText+";"),a=dhtmlx.temp;for(var b=0;b<a.length;b++){var c=b+1;this.rowsBuffer.push({idd:c,data:a[b],_parser:this._process_jsarray_row,_locator:this._get_jsarray_data});this.rowsAr[c]=a[b]}this.render_dataset();this._parsing=!1},_process_csv:function(a){this._parsing=!0;if(a.xmlDoc)a=a.xmlDoc.responseText;a=a.replace(/\r/g,"");a=a.split(this.csv.row);if(this._csvHdr){this.clearAll();
var b=a.splice(0,1)[0].split(this.csv.cell);this._csvAID||b.splice(0,1);this.setHeader(b.join(this.delim));this.init()}for(var c=0;c<a.length;c++)if(a[c]||c!=a.length-1){if(this._csvAID){var d=c+1;this.rowsBuffer.push({idd:d,data:a[c],_parser:this._process_csv_row,_locator:this._get_csv_data})}else{var e=a[c].split(this.csv.cell),d=e.splice(0,1)[0];this.rowsBuffer.push({idd:d,data:e,_parser:this._process_jsarray_row,_locator:this._get_jsarray_data})}this.rowsAr[d]=a[c]}this.render_dataset();this._parsing=
!1},_process_js:function(a){return this._process_json(a,"js")},_process_json:function(a,b){this._parsing=!0;if(a&&a.xmlDoc)eval("dhtmlx.temp="+a.xmlDoc.responseText+";"),a=dhtmlx.temp;if(b=="js"){if(a.data)a=a.data;for(var c=0;c<a.length;c++){var d=a[c],e=d.id||c+1;this.rowsBuffer.push({idd:e,data:d,_parser:this._process_js_row,_locator:this._get_js_data});this.rowsAr[e]=a[c]}}else for(c=0;c<a.rows.length;c++)e=a.rows[c].id,this.rowsBuffer.push({idd:e,data:a.rows[c],_parser:this._process_json_row,
_locator:this._get_json_data}),this.rowsAr[e]=a[c];if(a.dhx_security)dhtmlx.security_key=a.dhx_security;this.render_dataset();this._parsing=!1},render_dataset:function(a,b){if(this._srnd){if(this._fillers)return this._update_srnd_view();b=Math.min(this._get_view_size()+(this._srnd_pr||0),this.rowsBuffer.length)}this.pagingOn?(a=Math.max(a||0,(this.currentPage-1)*this.rowsBufferOutSize),b=Math.min(this.currentPage*this.rowsBufferOutSize,this.rowsBuffer.length)):(a=a||0,b=b||this.rowsBuffer.length);
for(var c=a;c<b;c++){var d=this.render_row(c);if(d==-1){if(this.xmlFileUrl&&this.callEvent("onDynXLS",[c,this._dpref?this._dpref:b-c]))this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+c+"&count="+(this._dpref?this._dpref:b-c),this._data_type);b=c;break}if(!d.parentNode||!d.parentNode.tagName)if(this._insertRowAt(d,c),d._attrs.selected||d._attrs.select)this.selectRow(d,d._attrs.call?!0:!1,!0),d._attrs.selected=d._attrs.select=null;if(this._ads_count&&c-a==this._ads_count){var e=
this;this._context_parsing=this._context_parsing||this._parsing;return this._contextCallTimer=window.setTimeout(function(){e._contextCallTimer=null;e.render_dataset(c,b);if(!e._contextCallTimer)e._context_parsing?e.callEvent("onXLE",[]):e._fixAlterCss(),e.callEvent("onDistributedEnd",[]),e._context_parsing=!1},this._ads_time)}}if(this._srnd&&!this._fillers){var f=this.rowsBuffer.length-b;for(this._fillers=[];f>0;){var g=_isIE?Math.min(f,5E4):f,h=this._add_filler(b,g);h&&this._fillers.push(h);f-=g;
b+=g}}this.setSizes()},render_row:function(a){if(!this.rowsBuffer[a])return-1;if(this.rowsBuffer[a]._parser){var b=this.rowsBuffer[a];if(this.rowsAr[b.idd]&&this.rowsAr[b.idd].tagName=="TR")return this.rowsBuffer[a]=this.rowsAr[b.idd];var c=this._prepareRow(b.idd);this.rowsBuffer[a]=c;this.rowsAr[b.idd]=c;b._parser.call(this,c,b.data);this._postRowProcessing(c);return c}return this.rowsBuffer[a]},_get_cell_value:function(a,b,c){return a._locator?(this._c_order&&(b=this._c_order[b]),a._locator.call(this,
a.data,b)):this.cells3(a,b)[c?c:"getValue"]()},sortRows:function(a,b,c){c=(c||"asc").toLowerCase();b=b||this.fldSort[a];a=a||0;if(this.isTreeGrid())this.sortTreeRows(a,b,c);else{var d={},e=this.cellType[a],f="getValue";e=="link"&&(f="getContent");if(e=="dhxCalendar"||e=="dhxCalendarA")f="getDate";for(var g=0;g<this.rowsBuffer.length;g++)d[this.rowsBuffer[g].idd]=this._get_cell_value(this.rowsBuffer[g],a,f);this._sortRows(a,b,c,d)}this.callEvent("onAfterSorting",[a,b,c])},_sortCore:function(a,b,c,
d,e){var f="sort";if(this._sst)e.stablesort=this.rowsCol.stablesort,f="stablesort";if(b=="str")e[f](function(a,b){return c=="asc"?d[a.idd]>d[b.idd]?1:-1:d[a.idd]<d[b.idd]?1:-1});else if(b=="int")e[f](function(a,b){var e=parseFloat(d[a.idd]),e=isNaN(e)?-99999999999999:e,f=parseFloat(d[b.idd]),f=isNaN(f)?-99999999999999:f;return c=="asc"?e-f:f-e});else if(b=="date")e[f](function(a,b){var e=Date.parse(d[a.idd])||Date.parse("01/01/1900"),f=Date.parse(d[b.idd])||Date.parse("01/01/1900");return c=="asc"?
e-f:f-e})},_sortRows:function(a,b,c,d){this._sortCore(a,b,c,d,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(a){if(this.obj.rows[0]){this.callEvent("onResetView",[]);var b=this.obj.rows[0].parentNode,c=b.removeChild(b.childNodes[0],!0);if(_isKHTML)for(var d=b.parentNode.childNodes.length-1;d>=0;d--)b.parentNode.childNodes[d].tagName=="TR"&&b.parentNode.removeChild(b.parentNode.childNodes[d],!0);else if(_isIE)for(d=b.childNodes.length-1;d>=0;d--)b.childNodes[d].removeNode(!0);
else b.innerHTML="";b.appendChild(c);this.rowsCol=dhtmlxArray();this._sst&&this.enableStableSorting(!0);this._fillers=this.undefined;a||this.render_dataset()}},deleteRow:function(a,b){b||(b=this.getRowById(a));if(b){this.editStop();if(!this._realfake&&this.callEvent("onBeforeRowDeleted",[a])==!1)return!1;var c=0;if(this.cellType._dhx_find("tree")!=-1&&!this._realfake)c=this._h2.get[a].parent.id,this._removeTrGrRow(b);else{b.parentNode&&b.parentNode.removeChild(b);var d=this.rowsCol._dhx_find(b);d!=
-1&&this.rowsCol._dhx_removeAt(d);for(var e=0;e<this.rowsBuffer.length;e++)if(this.rowsBuffer[e]&&this.rowsBuffer[e].idd==a){this.rowsBuffer._dhx_removeAt(e);d=e;break}}this.rowsAr[a]=null;for(e=0;e<this.selectedRows.length;e++)this.selectedRows[e].idd==a&&this.selectedRows._dhx_removeAt(e);if(this._srnd){for(e=0;e<this._fillers.length;e++){var f=this._fillers[e];f&&(f[0]>=d?f[0]-=1:f[1]>=d&&(f[1]-=1))}this._update_srnd_view()}this.pagingOn&&this.changePage();this._realfake||this.callEvent("onAfterRowDeleted",
[a,c]);this.callEvent("onGridReconstructed",[]);this._ahgr&&this.setSizes();return!0}},_addRow:function(a,b,c){if(c==-1||typeof c=="undefined")c=this.rowsBuffer.length;typeof b=="string"&&(b=b.split(this.delim));var d=this._prepareRow(a);d._attrs={};for(var e=0;e<d.childNodes.length;e++)d.childNodes[e]._attrs={};this.rowsAr[d.idd]=d;if(this._h2)this._h2.get[d.idd].buff=d;this._fillRow(d,b);this._postRowProcessing(d);if(this._skipInsert)return this._skipInsert=!1,this.rowsAr[d.idd]=d;if(this.pagingOn)return this.rowsBuffer._dhx_insertAt(c,
d),this.rowsAr[d.idd]=d;if(this._fillers){this.rowsCol._dhx_insertAt(c,null);this.rowsBuffer._dhx_insertAt(c,d);this._fake&&this._fake.rowsCol._dhx_insertAt(c,null);this.rowsAr[d.idd]=d;for(var f=!1,g=0;g<this._fillers.length;g++){var h=this._fillers[g];if(h&&h[0]<=c&&h[0]+h[1]>=c)h[1]+=1,h[2].firstChild.style.height=parseInt(h[2].firstChild.style.height)+this._srdh+"px",f=!0,this._fake&&this._fake._fillers[g][1]++;h&&h[0]>c&&(h[0]+=1,this._fake&&this._fake._fillers[g][0]++)}f||this._fillers.push(this._add_filler(c,
1,c==0?{parentNode:this.obj.rows[0].parentNode,nextSibling:this.rowsCol[1]}:this.rowsCol[c-1]));return d}this.rowsBuffer._dhx_insertAt(c,d);return this._insertRowAt(d,c)},addRow:function(a,b,c){var d=this._addRow(a,b,c);this.dragContext||this.callEvent("onRowAdded",[a]);this.pagingOn&&this.changePage(this.currentPage);this._srnd&&this._update_srnd_view();d._added=!0;this._ahgr&&this.setSizes();this.callEvent("onGridReconstructed",[]);return d},_insertRowAt:function(a,b,c){this.rowsAr[a.idd]=a;if(this._skipInsert)return this._skipInsert=
!1,a;if(b<0||!b&&parseInt(b)!==0)b=this.rowsCol.length;else if(b>this.rowsCol.length)b=this.rowsCol.length;this._cssEven&&(a.className+=(this._cssSP?this.getLevel(a.idd):b)%2==1?" "+this._cssUnEven+(this._cssSU?" "+this._cssUnEven+"_"+this.getLevel(a.idd):""):" "+this._cssEven+(this._cssSU?" "+this._cssEven+"_"+this.getLevel(a.idd):""));c||(b==this.obj.rows.length-1||!this.rowsCol[b]?_isKHTML?this.obj.appendChild(a):this.obj.firstChild.appendChild(a):this.rowsCol[b].parentNode.insertBefore(a,this.rowsCol[b]));
this.rowsCol._dhx_insertAt(b,a);this.callEvent("onRowInserted",[a,b]);return a},getRowById:function(a){var b=this.rowsAr[a];if(b){if(b.tagName!="TR"){for(var c=0;c<this.rowsBuffer.length;c++)if(this.rowsBuffer[c]&&this.rowsBuffer[c].idd==a)return this.render_row(c);if(this._h2)return this.render_row(null,b.idd)}return b}return null},cellById:function(a,b){return this.cells(a,b)},cells:function(a,b){if(arguments.length==0)return this.cells4(this.cell);else var c=this.getRowById(a);var d=c._childIndexes?
c.childNodes[c._childIndexes[b]]:c.childNodes[b];return this.cells4(d)},cellByIndex:function(a,b){return this.cells2(a,b)},cells2:function(a,b){var c=this.render_row(a),d=c._childIndexes?c.childNodes[c._childIndexes[b]]:c.childNodes[b];return this.cells4(d)},cells3:function(a,b){var c=a._childIndexes?a.childNodes[a._childIndexes[b]]:a.childNodes[b];return this.cells4(c)},cells4:function(a){var b=window["eXcell_"+(a._cellType||this.cellType[a._cellIndex])];if(b)return new b(a)},cells5:function(a,b){b=
b||a._cellType||this.cellType[a._cellIndex];if(!this._ecache[b]){var c=window["eXcell_"+b]?window["eXcell_"+b]:eXcell_ro;this._ecache[b]=new c(a)}this._ecache[b].cell=a;return this._ecache[b]},dma:function(a){if(!this._ecache)this._ecache={};if(a&&!this._dma)this._dma=this.cells4,this.cells4=this.cells5;else if(!a&&this._dma)this.cells4=this._dma,this._dma=null},getRowsNum:function(){return this.rowsBuffer.length},enableEditTabOnly:function(a){this.smartTabOrder=arguments.length>0?convertStringToBoolean(a):
!0},setExternalTabOrder:function(a,b){var c=this;this.tabStart=typeof a=="object"?a:document.getElementById(a);this.tabStart.onkeydown=function(a){var b=a||window.event;if(b.keyCode==9&&!b.shiftKey)return b.cancelBubble=!0,c.selectCell(0,0,0,0,1),c.smartTabOrder&&c.cells2(0,0).isDisabled()&&c._key_events.k9_0_0.call(c),this.blur(),!1};if(_isOpera)this.tabStart.onkeypress=this.tabStart.onkeydown;this.tabEnd=typeof b=="object"?b:document.getElementById(b);this.tabEnd.onkeydown=this.tabEnd.onkeypress=
function(a){var b=a||window.event;if(b.keyCode==9&&b.shiftKey)return b.cancelBubble=!0,c.selectCell(c.getRowsNum()-1,c.getColumnCount()-1,0,0,1),c.smartTabOrder&&c.cells2(c.getRowsNum()-1,c.getColumnCount()-1).isDisabled()&&c._key_events.k9_0_1.call(c),this.blur(),!1};if(_isOpera)this.tabEnd.onkeypress=this.tabEnd.onkeydown},uid:function(){if(!this._ui_seed)this._ui_seed=(new Date).valueOf();return this._ui_seed++},clearAndLoad:function(){var a=this._pgn_skin;this._pgn_skin=null;this.clearAll();this._pgn_skin=
a;this.load.apply(this,arguments)},getStateOfView:function(){if(this.pagingOn){var a=(this.currentPage-1)*this.rowsBufferOutSize;return[this.currentPage,a,Math.min(a+this.rowsBufferOutSize,this.rowsBuffer.length),this.rowsBuffer.length]}return[Math.floor(this.objBox.scrollTop/this._srdh),Math.ceil(parseInt(this.objBox.offsetHeight)/this._srdh),this.rowsBuffer.length]}};
(function(){function a(a,b){this[a]=b}function b(a,b){this[a].call(this,b)}function c(a,b){this[a].call(this,b.join(this.delim))}function d(a,b){for(var c=0;c<b.length;c++)if(typeof b[c]=="object"){var d=this.getCombo(c),e;for(e in b[c])d.put(e,b[c][e])}}function e(a,b){function c(a,b,d){e[b]||(e[b]=[]);if(typeof d=="object")d.toString=function(){return this.text};e[b][a]=d}for(var d=1,e=[],f=0;f<b.length;f++)if(typeof b[f]=="object"&&b[f].length)for(var l=0;l<b[f].length;l++)c(f,l,b[f][l]);else c(f,
0,b[f]);for(f=0;f<e.length;f++)for(l=0;l<e[0].length;l++){var n=e[f][l];e[f][l]=(n||"").toString()||"&nbsp;";if(n&&n.colspan)for(var o=1;o<n.colspan;o++)c(l+o,f,"#cspan");if(n&&n.rowspan)for(o=1;o<n.rowspan;o++)c(l,f+o,"#rspan")}this.setHeader(e[0]);for(f=1;f<e.length;f++)this.attachHeader(e[f])}var f=[{name:"label",def:"&nbsp;",operation:"setHeader",type:e},{name:"id",def:"",operation:"columnIds",type:a},{name:"width",def:"*",operation:"setInitWidths",type:c},{name:"align",def:"left",operation:"cellAlign",
type:a},{name:"valign",def:"middle",operation:"cellVAlign",type:a},{name:"sort",def:"na",operation:"fldSort",type:a},{name:"type",def:"ro",operation:"setColTypes",type:c},{name:"options",def:"",operation:"",type:d}];dhtmlx.extend_api("dhtmlXGridObject",{_init:function(a){return[a.parent]},image_path:"setImagePath",columns:"columns",rows:"rows",headers:"headers",skin:"setSkin",smart_rendering:"enableSmartRendering",css:"enableAlterCss",auto_height:"enableAutoHeight",save_hidden:"enableAutoHiddenColumnsSaving",
save_cookie:"enableAutoSaving",save_size:"enableAutoSizeSaving",auto_width:"enableAutoWidth",block_selection:"enableBlockSelection",csv_id:"enableCSVAutoID",csv_header:"enableCSVHeader",cell_ids:"enableCellIds",colspan:"enableColSpan",column_move:"enableColumnMove",context_menu:"enableContextMenu",distributed:"enableDistributedParsing",drag:"enableDragAndDrop",drag_order:"enableDragOrder",tabulation:"enableEditTabOnly",header_images:"enableHeaderImages",header_menu:"enableHeaderMenu",keymap:"enableKeyboardSupport",
mouse_navigation:"enableLightMouseNavigation",markers:"enableMarkedCells",math_editing:"enableMathEditing",math_serialization:"enableMathSerialization",drag_copy:"enableMercyDrag",multiline:"enableMultiline",multiselect:"enableMultiselect",save_column_order:"enableOrderSaving",hover:"enableRowsHover",rowspan:"enableRowspan",smart:"enableSmartRendering",save_sorting:"enableSortingSaving",stable_sorting:"enableStableSorting",undo:"enableUndoRedo",csv_cell:"setCSVDelimiter",date_format:"setDateFormat",
drag_behavior:"setDragBehavior",editable:"setEditable",without_header:"setNoHeader",submit_changed:"submitOnlyChanged",submit_serialization:"submitSerialization",submit_selected:"submitOnlySelected",submit_id:"submitOnlyRowID",xml:"load"},{columns:function(a){for(var c=0;c<f.length;c++){for(var d=[],e=0;e<a.length;e++)d[e]=a[e][f[c].name]||f[c].def;var k=f[c].type||b;k.call(this,f[c].operation,d,a)}this.init()},rows:function(){},headers:function(a){for(var b=0;b<a.length;b++)this.attachHeader(a[b])}})})();
dhtmlXGridObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(a,c){this.obj._h2?this.obj.addRow(c,d,null,parent):this.obj.addRow(c,[],0);var d=this.obj.getRowById(c);d&&(this.obj._process_xml_row(d,a.firstChild),this.obj._postRowProcessing(d))});a.attachEvent("updateCallback",function(a,c){var d=this.obj.getRowById(c);d&&(this.obj._process_xml_row(d,a.firstChild),this.obj._postRowProcessing(d))});a.attachEvent("deleteCallback",function(a,c){this.obj.setUserData(c,this.action_param,
"true_deleted");this.obj.deleteRow(c)});a._methods=["setRowTextStyle","setCellTextStyle","changeRowId","deleteRow"];this.attachEvent("onEditCell",function(b,c,d){if(a._columns&&!a._columns[d])return!0;var e=this.cells(c,d);b==1?e.isCheckbox()&&a.setUpdated(c,!0):b==2&&e.wasChanged()&&a.setUpdated(c,!0);return!0});this.attachEvent("onRowPaste",function(b){a.setUpdated(b,!0)});this.attachEvent("onRowIdChange",function(b,c){var d=a.findRow(b);d<a.updatedRows.length&&(a.updatedRows[d]=c)});this.attachEvent("onSelectStateChanged",
function(){a.updateMode=="row"&&a.sendData();return!0});this.attachEvent("onEnter",function(){a.updateMode=="row"&&a.sendData();return!0});this.attachEvent("onBeforeRowDeleted",function(b){if(!this.rowsAr[b])return!0;if(this.dragContext&&a.dnd)return window.setTimeout(function(){a.setUpdated(b,!0)},1),!0;var c=a.getState(b);this._h2&&this._h2.forEachChild(b,function(b){a.setUpdated(b.id,!1);a.markRow(b.id,!0,"deleted")},this);if(c=="inserted")return a.set_invalid(b,!1),a.setUpdated(b,!1),!0;if(c==
"deleted")return!1;if(c=="true_deleted")return a.setUpdated(b,!1),!0;a.setUpdated(b,!0,"deleted");return!1});this.attachEvent("onBindUpdate",function(b){a.setUpdated(b,!0)});this.attachEvent("onRowAdded",function(b){if(this.dragContext&&a.dnd)return!0;a.setUpdated(b,!0,"inserted");return!0});a._getRowData=function(a){var c=[];c.gr_id=a;this.obj.isTreeGrid()&&(c.gr_pid=this.obj.getParentId(a));for(var d=this.obj.getRowById(a),e=0;e<this.obj._cCount;e++){var f=this.obj._c_order?this.obj._c_order[e]:
e,g=this.obj.cells(d.idd,e);if(!this._changed||g.wasChanged())this._endnm?c[this.obj.getColumnId(e)]=g.getValue():c["c"+f]=g.getValue()}var h=this.obj.UserData[a];if(h)for(var i=0;i<h.keys.length;i++)h.keys[i]&&h.keys[i].indexOf("__")!=0&&(c[h.keys[i]]=h.values[i]);if(h=this.obj.UserData.gridglobaluserdata)for(i=0;i<h.keys.length;i++)c[h.keys[i]]=h.values[i];return c};a._clearUpdateFlag=function(a){var c=this.obj.getRowById(a);if(c)for(var d=0;d<this.obj._cCount;d++)this.obj.cells(a,d).cell.wasChanged=
!1};a.checkBeforeUpdate=function(a){for(var c=!0,d=[],e=0;e<this.obj._cCount;e++)if(this.mandatoryFields[e]){var f=this.mandatoryFields[e].call(this.obj,this.obj.cells(a,e).getValue(),a,e);typeof f=="string"?(this.messages.push(f),c=!1):(c&=f,d[e]=!f)}c||(this.set_invalid(a,"invalid",d),this.setUpdated(a,!1));return c}};
function dhtmlXGridCellObject(a){this.destructor=function(){return this.base=this.grid=this.cell=this.cell.obj=null};this.cell=a;this.getValue=function(){return this.cell.firstChild&&this.cell.firstChild.tagName=="TEXTAREA"?this.cell.firstChild.value:this.cell.innerHTML._dhx_trim()};this.getMathValue=function(){return this.cell.original?this.cell.original:this.getValue()};this.getFont=function(){arOut=Array(3);if(this.cell.style.fontFamily)arOut[0]=this.cell.style.fontFamily;if(this.cell.style.fontWeight==
"bold"||this.cell.parentNode.style.fontWeight=="bold")arOut[1]="bold";if(this.cell.style.fontStyle=="italic"||this.cell.parentNode.style.fontWeight=="italic")arOut[1]+="italic";arOut[2]=this.cell.style.fontSize?this.cell.style.fontSize:"";return arOut.join("-")};this.getTextColor=function(){return this.cell.style.color?this.cell.style.color:"#000000"};this.getBgColor=function(){return this.cell.bgColor?this.cell.bgColor:"#FFFFFF"};this.getHorAlign=function(){return this.cell.style.textAlign?this.cell.style.textAlign:
this.cell.style.textAlign?this.cell.style.textAlign:"left"};this.getWidth=function(){return this.cell.scrollWidth};this.setFont=function(a){fntAr=a.split("-");this.cell.style.fontFamily=fntAr[0];this.cell.style.fontSize=fntAr[fntAr.length-1];if(fntAr.length==3){if(/bold/.test(fntAr[1]))this.cell.style.fontWeight="bold";if(/italic/.test(fntAr[1]))this.cell.style.fontStyle="italic";if(/underline/.test(fntAr[1]))this.cell.style.textDecoration="underline"}};this.setTextColor=function(a){this.cell.style.color=
a};this.setBgColor=function(a){a==""&&(a=null);this.cell.bgColor=a};this.setHorAlign=function(a){this.cell.style.textAlign=a.length==1?a=="c"?"center":a=="l"?"left":"right":a};this.wasChanged=function(){return this.cell.wasChanged?!0:!1};this.isCheckbox=function(){var a=this.cell.firstChild;return a&&a.tagName=="INPUT"?(type=a.type,type=="radio"||type=="checkbox"?!0:!1):!1};this.isChecked=function(){if(this.isCheckbox())return this.cell.firstChild.checked};this.isDisabled=function(){return this.cell._disabled};
this.setChecked=function(a){if(this.isCheckbox())a!="true"&&a!=1&&(a=!1),this.cell.firstChild.checked=a};this.setDisabled=function(a){a!="true"&&a!=1&&(a=!1);if(this.isCheckbox())this.cell.firstChild.disabled=a,this.disabledF&&this.disabledF(a);this.cell._disabled=a}}
dhtmlXGridCellObject.prototype={getAttribute:function(a){return this.cell._attrs[a]},setAttribute:function(a,b){this.cell._attrs[a]=b},getInput:function(){if(this.obj&&(this.obj.tagName=="INPUT"||this.obj.tagName=="TEXTAREA"))return this.obj;var a=(this.obj||this.cell).getElementsByTagName("TEXTAREA");a.length||(a=(this.obj||this.cell).getElementsByTagName("INPUT"));return a[0]}};
dhtmlXGridCellObject.prototype.setValue=function(a){typeof a!="number"&&(!a||a.toString()._dhx_trim()=="")?(a="&nbsp;",this.cell._clearCell=!0):this.cell._clearCell=!1;this.setCValue(a)};dhtmlXGridCellObject.prototype.getTitle=function(){return _isIE?this.cell.innerText:this.cell.textContent};dhtmlXGridCellObject.prototype.setCValue=function(a){this.cell.innerHTML=a};dhtmlXGridCellObject.prototype.setCTxtValue=function(a){this.cell.innerHTML="";this.cell.appendChild(document.createTextNode(a))};
dhtmlXGridCellObject.prototype.setLabel=function(a){this.cell.innerHTML=a};dhtmlXGridCellObject.prototype.getMath=function(){return this._val?this.val:this.getValue()};function eXcell(){this.val=this.obj=null;this.changeState=function(){return!1};this.edit=function(){this.val=this.getValue()};this.detach=function(){return!1};this.getPosition=function(a){for(var b=a,c=0,d=0;b.tagName!="BODY";)c+=b.offsetLeft,d+=b.offsetTop,b=b.offsetParent;return[c,d]}}eXcell.prototype=new dhtmlXGridCellObject;
function eXcell_ed(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.edit=function(){this.cell.atag=!this.grid.multiLine&&(_isKHTML||_isMacOS||_isFF)?"INPUT":"TEXTAREA";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.setAttribute("autocomplete","off");this.obj.style.height=this.cell.offsetHeight-(_isIE?4:4)+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(a){(a||event).cancelBubble=
!0};this.obj.onmousedown=function(a){(a||event).cancelBubble=!0};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);this.obj.onselectstart=function(a){a||(a=event);return a.cancelBubble=!0};_isIE&&this.obj.focus();this.obj.focus()};this.getValue=function(){return this.cell.firstChild&&this.cell.atag&&this.cell.firstChild.tagName==this.cell.atag?this.cell.firstChild.value:this.cell._clearCell?"":this.cell.innerHTML.toString()._dhx_trim()};this.detach=function(){this.setValue(this.obj.value);
return this.val!=this.getValue()}}eXcell_ed.prototype=new eXcell;function eXcell_edtxt(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.getValue=function(){return this.cell.firstChild&&this.cell.atag&&this.cell.firstChild.tagName==this.cell.atag?this.cell.firstChild.value:this.cell._clearCell?"":_isIE?this.cell.innerText:this.cell.textContent};this.setValue=function(a){!a||a.toString()._dhx_trim()==""?(a=" ",this.cell._clearCell=!0):this.cell._clearCell=!1;this.setCTxtValue(a)}}
eXcell_edtxt.prototype=new eXcell_ed;
function eXcell_ch(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.disabledF=function(a){this.cell.innerHTML=a==!0||a==1?this.cell.innerHTML.replace("item_chk0.","item_chk0_dis.").replace("item_chk1.","item_chk1_dis."):this.cell.innerHTML.replace("item_chk0_dis.","item_chk0.").replace("item_chk1_dis.","item_chk1.")};this.changeState=function(a){a===!0&&!this.grid.isActive&&(window.globalActiveDHTMLGridObject!=null&&window.globalActiveDHTMLGridObject!=this.grid&&window.globalActiveDHTMLGridObject.isActive&&
window.globalActiveDHTMLGridObject.setActive(!1),this.grid.setActive(!0));if(this.grid.isEditable&&!this.cell.parentNode._locked&&!this.isDisabled())this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])?(this.val=this.getValue(),this.val=="1"?this.setValue("0"):this.setValue("1"),this.cell.wasChanged=!0,this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]),this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,this.val!=
"1"]),this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,this.val!="1"])):this.editor=null};this.getValue=function(){return this.cell.chstate?this.cell.chstate.toString():"0"};this.isCheckbox=function(){return!0};this.isChecked=function(){return this.getValue()=="1"?!0:!1};this.setChecked=function(a){this.setValue(a.toString())};this.detach=function(){return this.val!=this.getValue()};this.edit=null}eXcell_ch.prototype=new eXcell;
eXcell_ch.prototype.setValue=function(a){this.cell.style.verticalAlign="middle";if(a&&(a=a.toString()._dhx_trim(),a=="false"||a=="0"))a="";a?(a="1",this.cell.chstate="1"):(a="0",this.cell.chstate="0");var b=this;this.setCValue("<img src='"+this.grid.imgURL+"item_chk"+a+".gif' onclick='new eXcell_ch(this.parentNode).changeState(true); (arguments[0]||event).cancelBubble=true; '>",this.cell.chstate)};
function eXcell_ra(a){this.base=eXcell_ch;this.base(a);this.grid=a.parentNode.grid;this.disabledF=function(a){this.cell.innerHTML=a==!0||a==1?this.cell.innerHTML.replace("radio_chk0.","radio_chk0_dis.").replace("radio_chk1.","radio_chk1_dis."):this.cell.innerHTML.replace("radio_chk0_dis.","radio_chk0.").replace("radio_chk1_dis.","radio_chk1.")};this.changeState=function(a){if(!(a===!1&&this.getValue()==1)&&this.grid.isEditable&&!this.cell.parentNode._locked)this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,
this.cell._cellIndex])!=!1?(this.val=this.getValue(),this.val=="1"?this.setValue("0"):this.setValue("1"),this.cell.wasChanged=!0,this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]),this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,this.val!="1"]),this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,this.val!="1"])):this.editor=null};this.edit=null}eXcell_ra.prototype=new eXcell_ch;
eXcell_ra.prototype.setValue=function(a){this.cell.style.verticalAlign="middle";if(a&&(a=a.toString()._dhx_trim(),a=="false"||a=="0"))a="";if(a){if(!this.grid._RaSeCol)this.grid._RaSeCol=[];if(this.grid._RaSeCol[this.cell._cellIndex]){var b=this.grid.cells4(this.grid._RaSeCol[this.cell._cellIndex]);b.setValue("0");this.grid.rowsAr[b.cell.parentNode.idd]&&this.grid.callEvent("onEditCell",[1,b.cell.parentNode.idd,b.cell._cellIndex])}this.grid._RaSeCol[this.cell._cellIndex]=this.cell;a="1";this.cell.chstate=
"1"}else a="0",this.cell.chstate="0";this.setCValue("<img src='"+this.grid.imgURL+"radio_chk"+a+".gif' onclick='new eXcell_ra(this.parentNode).changeState(false);'>",this.cell.chstate)};
function eXcell_txt(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.edit=function(){this.val=this.getValue();this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_textarea";this.obj.onclick=function(a){(a||event).cancelBubble=!0};var a=this.grid.getPosition(this.cell);this.obj.value=this.val;this.obj.style.display="";this.obj.style.textAlign=this.cell.style.textAlign;if(_isFF){var c=document.createElement("DIV");c.appendChild(this.obj);c.style.overflow="auto";c.className=
"dhx_textarea";this.obj.style.margin="0px 0px 0px 0px";this.obj.style.border="0px";this.obj=c}document.body.appendChild(this.obj);if(_isOpera)this.obj.onkeypress=function(a){if(a.keyCode==9)return!1};this.obj.onkeydown=function(a){var b=a||event;if(b.keyCode==9)return globalActiveDHTMLGridObject.entBox.focus(),globalActiveDHTMLGridObject.doKey({keyCode:b.keyCode,shiftKey:b.shiftKey,srcElement:"0"}),!1};this.obj.style.left=a[0]+"px";this.obj.style.top=a[1]+this.cell.offsetHeight+"px";var d=this.cell.offsetWidth<
200?200:this.cell.offsetWidth;this.obj.style.width=d+(_isFF?18:16)+"px";if(_isFF)this.obj.firstChild.style.width=parseInt(this.obj.style.width)+"px",this.obj.firstChild.style.height=this.obj.offsetHeight-3+"px";if(_isIE)this.obj.select(),this.obj.value=this.obj.value;_isFF?this.obj.firstChild.focus():this.obj.focus()};this.detach=function(){var a="",a=_isFF?this.obj.firstChild.value:this.obj.value;this.cell._clearCell=a==""?!0:!1;this.setValue(a);document.body.removeChild(this.obj);this.obj=null;
return this.val!=this.getValue()};this.getValue=function(){return this.obj?_isFF?this.obj.firstChild.value:this.obj.value:this.cell._clearCell?"":this.grid.multiLine?this.cell.innerHTML.replace(/<br[^>]*>/gi,"\n")._dhx_trim():this.cell._brval||this.cell.innerHTML}}eXcell_txt.prototype=new eXcell;
function eXcell_txttxt(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.getValue=function(){return this.cell.firstChild&&this.cell.firstChild.tagName=="TEXTAREA"?this.cell.firstChild.value:this.cell._clearCell?"":!this.grid.multiLine&&this.cell._brval?this.cell._brval:_isIE?this.cell.innerText:this.cell.textContent};this.setValue=function(a){this.cell._brval=a;!a||a.toString()._dhx_trim()==""?(a=" ",this.cell._clearCell=!0):this.cell._clearCell=!1;this.setCTxtValue(a)}}
eXcell_txttxt.prototype=new eXcell_txt;eXcell_txt.prototype.setValue=function(a){!a||a.toString()._dhx_trim()==""?(a="&nbsp;",this.cell._clearCell=!0):this.cell._clearCell=!1;this.cell._brval=a;this.grid.multiLine?this.setCValue(a.replace(/\n/g,"<br/>"),a):this.setCValue(a,a)};
function eXcell_co(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid,this.combo=this.cell._combo||this.grid.getCombo(this.cell._cellIndex),this.editable=!0;this.shiftNext=function(){var a=this.list.options[this.list.selectedIndex+1];if(a)a.selected=!0;this.obj.value=this.list.options[this.list.selectedIndex].text;return!0};this.shiftPrev=function(){if(this.list.selectedIndex!=0){var a=this.list.options[this.list.selectedIndex-1];if(a)a.selected=!0;this.obj.value=this.list.options[this.list.selectedIndex].text}return!0};
this.edit=function(){this.val=this.getValue();this.text=this.getText()._dhx_trim();var a=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=this.cell.offsetHeight-4+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(a){(a||event).cancelBubble=!0};this.obj.onmousedown=function(a){(a||event).cancelBubble=!0};this.obj.value=this.text;this.obj.onselectstart=function(a){a||
(a=event);return a.cancelBubble=!0};var c=this;this.obj.onkeyup=function(a){var b=(a||event).keyCode;if(!(b==38||b==40||b==9))for(var d=this.readonly?String.fromCharCode(b):this.value,e=c.list.options,f=0;f<e.length;f++)if(e[f].text.indexOf(d)==0)return e[f].selected=!0};this.list=document.createElement("SELECT");this.list.className="dhx_combo_select";this.list.style.width=this.cell.offsetWidth+"px";this.list.style.left=a[0]+"px";this.list.style.top=a[1]+this.cell.offsetHeight+"px";this.list.onclick=
function(a){var b=a||window.event,d=b.target||b.srcElement;if(d.tagName=="OPTION")d=d.parentNode;c.editable=!1;c.grid.editStop();b.cancelBubble=!0};for(var d=this.combo.getKeys(),e=!1,f=0,g=0;g<d.length;g++){var h=this.combo.get(d[g]);this.list.options[this.list.options.length]=new Option(h,d[g]);d[g]==this.val&&(f=this.list.options.length-1,e=!0)}e==!1&&(this.list.options[this.list.options.length]=new Option(this.text,this.val===null?"":this.val),f=this.list.options.length-1);document.body.appendChild(this.list);
this.list.size="6";this.cstate=1;this.editable?this.cell.innerHTML="":(this.obj.style.width="1px",this.obj.style.height="1px");this.cell.appendChild(this.obj);this.list.options[f].selected=!0;if(!_isFF||this.editable)this.obj.focus(),this.obj.focus();if(!this.editable)this.obj.style.visibility="hidden",this.list.focus(),this.list.onkeydown=function(a){a=a||window.event;c.grid.setActive(!0);if(a.keyCode<30)return c.grid.doKey({target:c.cell,keyCode:a.keyCode,shiftKey:a.shiftKey,ctrlKey:a.ctrlKey})}};
this.getValue=function(){return this.cell.combo_value==window.undefined?"":this.cell.combo_value};this.detach=function(){if(this.val!=this.getValue())this.cell.wasChanged=!0;if(this.list.parentNode!=null)if(this.editable){var a=this.list.options[this.list.selectedIndex];if(a&&a.text==this.obj.value)this.setValue(this.list.value);else{var c=this.cell._combo||this.grid.getCombo(this.cell._cellIndex),d=c.values._dhx_find(this.obj.value);d!=-1?this.setValue(c.keys[d]):this.setCValue(this.cell.combo_value=
this.obj.value)}}else this.setValue(this.list.value);this.list.parentNode&&this.list.parentNode.removeChild(this.list);this.obj.parentNode&&this.obj.parentNode.removeChild(this.obj);return this.val!=this.getValue()}}eXcell_co.prototype=new eXcell;eXcell_co.prototype.getText=function(){return this.cell.innerHTML};
eXcell_co.prototype.setValue=function(a){if(typeof a=="object"){var b=this.grid.xmlLoader.doXPath("./option",a);if(b.length)this.cell._combo=new dhtmlXGridComboObject;for(var c=0;c<b.length;c++)this.cell._combo.put(b[c].getAttribute("value"),b[c].firstChild?b[c].firstChild.data:"");a=a.firstChild.data}if((a||"").toString()._dhx_trim()=="")a=null;this.cell.combo_value=a;if(a!==null){var d=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(a);this.setCValue(d===null?a:d,a)}else this.setCValue("&nbsp;",
a)};function eXcell_coro(a){this.base=eXcell_co;this.base(a);this.editable=!1}eXcell_coro.prototype=new eXcell_co;function eXcell_cotxt(a){this.base=eXcell_co;this.base(a)}eXcell_cotxt.prototype=new eXcell_co;eXcell_cotxt.prototype.getText=function(){return _isIE?this.cell.innerText:this.cell.textContent};
eXcell_cotxt.prototype.setValue=function(a){if(typeof a=="object"){var b=this.grid.xmlLoader.doXPath("./option",a);if(b.length)this.cell._combo=new dhtmlXGridComboObject;for(var c=0;c<b.length;c++)this.cell._combo.put(b[c].getAttribute("value"),b[c].firstChild?b[c].firstChild.data:"");a=a.firstChild.data}if((a||"").toString()._dhx_trim()=="")a=null;a!==null?this.setCTxtValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(a)||a,a):this.setCTxtValue(" ",a);this.cell.combo_value=a};
function eXcell_corotxt(a){this.base=eXcell_co;this.base(a);this.editable=!1}eXcell_corotxt.prototype=new eXcell_cotxt;
function eXcell_cp(a){try{this.cell=a,this.grid=this.cell.parentNode.grid}catch(b){}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("SPAN");this.obj.style.border="1px solid black";this.obj.style.position="absolute";var a=this.grid.getPosition(this.cell);this.colorPanel(4,this.obj);document.body.appendChild(this.obj);this.obj.style.left=a[0]+"px";this.obj.style.zIndex=1E3;this.obj.style.top=a[1]+this.cell.offsetHeight+"px"};this.toolDNum=function(a){a.length==1&&(a="0"+
a);return a};this.colorPanel=function(a,b){var e=document.createElement("TABLE");b.appendChild(e);e.cellSpacing=0;e.editor_obj=this;e.style.cursor="default";e.onclick=function(a){var b=a||window.event,c=b.target||b.srcElement,d=c.parentNode.parentNode.parentNode.editor_obj;d.setValue(c._bg);d.grid.editStop()};for(var f=256/a,g=0;g<=256/f;g++)for(var h=e.insertRow(g),i=0;i<=256/f;i++)for(var j=0;j<=256/f;j++){R=new Number(f*g)-(g==0?0:1);G=new Number(f*i)-(i==0?0:1);B=new Number(f*j)-(j==0?0:1);var k=
this.toolDNum(R.toString(16))+""+this.toolDNum(G.toString(16))+""+this.toolDNum(B.toString(16)),m=h.insertCell(i);m.width="10px";m.innerHTML="&nbsp;";m.title=k.toUpperCase();m.style.backgroundColor="#"+k;m._bg="#"+k;if(this.val!=null&&"#"+k.toUpperCase()==this.val.toUpperCase())m.style.border="2px solid white"}};this.getValue=function(){return this.cell.firstChild._bg||""};this.getRed=function(){return Number(parseInt(this.getValue().substr(1,2),16))};this.getGreen=function(){return Number(parseInt(this.getValue().substr(3,
2),16))};this.getBlue=function(){return Number(parseInt(this.getValue().substr(5,2),16))};this.detach=function(){this.obj.offsetParent!=null&&document.body.removeChild(this.obj);return this.val!=this.getValue()}}eXcell_cp.prototype=new eXcell;eXcell_cp.prototype.setValue=function(a){this.setCValue("<div style='width:100%;height:"+(this.grid.multiLine?this.cell.offsetHeight-2:16)+";background-color:"+(a||"")+";border:0px;'>&nbsp;</div>",a);this.cell.firstChild._bg=a};
function eXcell_img(a){try{this.cell=a,this.grid=this.cell.parentNode.grid}catch(b){}this.getValue=function(){if(this.cell.firstChild.tagName=="IMG")return this.cell.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");else if(this.cell.firstChild.tagName=="A"){var a=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");a+="^"+this.cell.lnk;this.cell.trg&&(a+="^"+this.cell.trg);return a}};this.isDisabled=function(){return!0}}eXcell_img.prototype=new eXcell;
eXcell_img.prototype.getTitle=function(){return this.cell._brval};eXcell_img.prototype.setValue=function(a){var b=a;if(a.indexOf("^")!=-1){var c=a.split("^"),a=c[0],b=this.cell._attrs.title||c[1];if(c.length>2&&(this.cell.lnk=c[2],c[3]))this.cell.trg=c[3];this.cell.titFl="1"}this.setCValue("<img src='"+this.grid.iconURL+(a||"")._dhx_trim()+"' border='0'>",a);if(this.cell.lnk)this.cell.innerHTML="<a href='"+this.cell.lnk+"' target='"+this.cell.trg+"'>"+this.cell.innerHTML+"</a>";this.cell._brval=b};
function eXcell_price(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){return this.cell.childNodes.length>1?this.cell.childNodes[1].innerHTML.toString()._dhx_trim():"0"}}eXcell_price.prototype=new eXcell_ed;eXcell_price.prototype.setValue=function(a){isNaN(parseFloat(a))&&(a=this.val||0);var b="green";a<0&&(b="red");this.setCValue("<span>$</span><span style='padding-right:2px;color:"+b+";'>"+a+"</span>",a)};
function eXcell_dyn(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){return this.cell.firstChild.childNodes[1].innerHTML.toString()._dhx_trim()}}eXcell_dyn.prototype=new eXcell_ed;
eXcell_dyn.prototype.setValue=function(a){if(!a||isNaN(Number(a)))a!==""&&(a=0);if(a>0)var b="green",c="dyn_up.gif";else a==0?(b="black",c="dyn_.gif"):(b="red",c="dyn_down.gif");this.setCValue("<div style='position:relative;padding-right:2px; width:100%;overflow:hidden; white-space:nowrap;'><img src='"+this.grid.imgURL+""+c+"' height='15' style='position:absolute;top:0px;left:0px;'><span style=' padding-left:20px; width:100%;color:"+b+";'>"+a+"</span></div>",a)};
function eXcell_ro(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return!0};this.getValue=function(){return this.cell._clearCell?"":this.cell.innerHTML.toString()._dhx_trim()}}eXcell_ro.prototype=new eXcell;
function eXcell_ron(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return!0};this.getValue=function(){return this.cell._clearCell?"":this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)}}eXcell_ron.prototype=new eXcell;
eXcell_ron.prototype.setValue=function(a){if(a!==0&&(!a||a.toString()._dhx_trim()==""))return this.setCValue("&nbsp;"),this.cell._clearCell=!0;this.cell._clearCell=!1;this.setCValue(a?this.grid._aplNF(a,this.cell._cellIndex):"0")};
function eXcell_rotxt(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return!0};this.setValue=function(a){a?this.cell._clearCell=!1:(a=" ",this.cell._clearCell=!0);this.setCTxtValue(a)};this.getValue=function(){return this.cell._clearCell?"":_isIE?this.cell.innerText:this.cell.textContent}}eXcell_rotxt.prototype=new eXcell;
function dhtmlXGridComboObject(){this.keys=new dhtmlxArray;this.values=new dhtmlxArray;this.put=function(a,b){for(var c=0;c<this.keys.length;c++)if(this.keys[c]==a)return this.values[c]=b,!0;this.values[this.values.length]=b;this.keys[this.keys.length]=a};this.get=function(a){for(var b=0;b<this.keys.length;b++)if(this.keys[b]==a)return this.values[b];return null};this.clear=function(){this.keys=new dhtmlxArray;this.values=new dhtmlxArray};this.remove=function(a){for(var b=0;b<this.keys.length;b++)if(this.keys[b]==
a)return this.keys._dhx_removeAt(b),this.values._dhx_removeAt(b),!0};this.size=function(){for(var a=0,b=0;b<this.keys.length;b++)this.keys[b]!=null&&a++;return a};this.getKeys=function(){for(var a=[],b=0;b<this.keys.length;b++)this.keys[b]!=null&&(a[a.length]=this.keys[b]);return a};this.save=function(){this._save=[];for(var a=0;a<this.keys.length;a++)this._save[a]=[this.keys[a],this.values[a]]};this.restore=function(){if(this._save){this.keys[a]=[];this.values[a]=[];for(var a=0;a<this._save.length;a++)this.keys[a]=
this._save[a][0],this.values[a]=this._save[a][1]}};return this}function Hashtable(){this.keys=new dhtmlxArray;this.values=new dhtmlxArray;return this}Hashtable.prototype=new dhtmlXGridComboObject;
dhtmlXGridObject.prototype.filterBy=function(a,b,c){if(this.isTreeGrid())return this.filterTreeBy(a,b,c);if(this._f_rowsBuffer){if(!c&&(this.rowsBuffer=dhtmlxArray([].concat(this._f_rowsBuffer)),this._fake))this._fake.rowsBuffer=this.rowsBuffer}else this._f_rowsBuffer=[].concat(this.rowsBuffer);if(this.rowsBuffer.length){var d=!0;this.dma(!0);if(typeof a=="object")for(var e=0;e<b.length;e++)this._filterA(a[e],b[e]);else this._filterA(a,b);this.dma(!1);this.pagingOn&&this.rowsBuffer.length/this.rowsBufferOutSize<
this.currentPage-1&&this.changePage(0);this._reset_view();this.callEvent("onGridReconstructed",[])}};dhtmlXGridObject.prototype._filterA=function(a,b){if(b!=""){var c=!0;typeof b=="function"?c=!1:b=(b||"").toString().toLowerCase();if(this.rowsBuffer.length)for(var d=this.rowsBuffer.length-1;d>=0;d--)(c?this._get_cell_value(this.rowsBuffer[d],a).toString().toLowerCase().indexOf(b)==-1:!b.call(this,this._get_cell_value(this.rowsBuffer[d],a),this.rowsBuffer[d].idd))&&this.rowsBuffer.splice(d,1)}};
dhtmlXGridObject.prototype.getFilterElement=function(a){if(this.filters){for(var b=0;b<this.filters.length;b++)if(this.filters[b][1]==a)return this.filters[b][0].combo||this.filters[b][0];return null}};
dhtmlXGridObject.prototype.collectValues=function(a){var b=this.callEvent("onCollectValues",[a]);if(b!==!0)return b;if(this.isTreeGrid())return this.collectTreeValues(a);this.dma(!0);this._build_m_order();for(var a=this._m_order?this._m_order[a]:a,c={},d=[],e=this._f_rowsBuffer||this.rowsBuffer,f=0;f<e.length;f++){var g=this._get_cell_value(e[f],a);if(g&&(!e[f]._childIndexes||e[f]._childIndexes[a]!=e[f]._childIndexes[a-1]))c[g]=!0}this.dma(!1);var h=this.combos[a]||(this._col_combos?this._col_combos[a]:
!1),i;for(i in c)if(c[i]===!0){if(h)if(h.get&&h.get(i))i=h.get(i);else if(h.getOption&&h.getOption(i))i=h.getOption(i).text;d.push(i)}return d.sort()};dhtmlXGridObject.prototype._build_m_order=function(){if(this._c_order){this._m_order=[];for(var a=0;a<this._c_order.length;a++)this._m_order[this._c_order[a]]=a}};
dhtmlXGridObject.prototype.filterByAll=function(){var a=[],b=[];this._build_m_order();for(var c=0;c<this.filters.length;c++)if(!(d>=this._cCount)){var d=this._m_order?this._m_order[this.filters[c][1]]:this.filters[c][1];b.push(d);var e=this.filters[c][0]._filter?this.filters[c][0]._filter():this.filters[c][0].value,f;if(typeof e!="function"&&(f=this.combos[d]||(this._col_combos?this._col_combos[d]:!1)))f.values?(d=f.values._dhx_find(e),e=d==-1?e:f.keys[d]):f.getOptionByLabel&&(e=f.getOptionByLabel(e)?
f.getOptionByLabel(e).value:e);a.push(e)}if(this.callEvent("onFilterStart",[b,a])&&(this.filterBy(b,a),this._cssEven&&this._fixAlterCss(),this.callEvent("onFilterEnd",[this.filters]),this._f_rowsBuffer&&this.rowsBuffer.length==this._f_rowsBuffer.length))this._f_rowsBuffer=null};
dhtmlXGridObject.prototype.makeFilter=function(a,b){if(!this.filters)this.filters=[];typeof a!="object"&&(a=document.getElementById(a));if(a){var c=this;if(!a.style.width)a.style.width="90%";if(a.tagName=="SELECT"){this.filters.push([a,b]);this._loadSelectOptins(a,b);a.onchange=function(){c.filterByAll()};if(_isIE)a.style.marginTop="1px";this.attachEvent("onEditCell",function(c,d,g){this._build_m_order();c==2&&this.filters&&(this._m_order?g==this._m_order[b]:g==b)&&this._loadSelectOptins(a,b);return!0})}else if(a.tagName==
"INPUT")this.filters.push([a,b]),a.old_value=a.value="",a.onkeydown=function(){this._timer&&window.clearTimeout(this._timer);this._timer=window.setTimeout(function(){if(a.value!=a.old_value)c.filterByAll(),a.old_value=a.value},500)};else if(a.tagName=="DIV"&&a.className=="combo"){this.filters.push([a,b]);a.style.padding="0px";a.style.margin="0px";if(!window.dhx_globalImgPath)window.dhx_globalImgPath=this.imgURL;var d=new dhtmlXCombo(a,"_filter","90%");d.filterSelfA=d.filterSelf;d.filterSelf=function(){this.getSelectedIndex()==
0&&this.setComboText("");this.filterSelfA.apply(this,arguments);this.optionsArr[0].hide(!1)};d.enableFilteringMode(!0);a.combo=d;a.value="";this._loadComboOptins(a,b);d.attachEvent("onChange",function(){a.value=d.getSelectedValue();if(a.value===null)a.value="";c.filterByAll()})}a.parentNode&&(a.parentNode.className+=" filter");this._filters_ready()}};
dhtmlXGridObject.prototype.findCell=function(a,b,c,d){d=d||function(a,b){return b.toString().toLowerCase().indexOf(a)!=-1};d===!0&&(d=function(a,b){return b.toString().toLowerCase()==a});var e=[],a=a.toString().toLowerCase();typeof c!="number"&&(c=c?1:0);if(!this.rowsBuffer.length)return e;for(var f=b||0;f<this._cCount;f++){if(this._h2)this._h2.forEachChild(0,function(b){if(c&&e.length==c)return e;d(a,this._get_cell_value(b.buff,f))&&e.push([b.id,f])},this);else for(var g=0;g<this.rowsBuffer.length;g++)if(d(a,
this._get_cell_value(this.rowsBuffer[g],f))&&(e.push([this.rowsBuffer[g].idd,f]),c&&e.length==c))return e;if(typeof b!="undefined")break}return e};
dhtmlXGridObject.prototype.makeSearch=function(a,b,c){typeof a!="object"&&(a=document.getElementById(a));if(a){var d=this;if(a.tagName=="INPUT")a.onkeypress=function(){this._timer&&window.clearTimeout(this._timer);this._timer=window.setTimeout(function(){if(a.value!=""){var e=d.findCell(a.value,b,!0,c);e.length&&(d._h2&&d.openItem(e[0][0]),d.selectCell(d.getRowIndex(e[0][0]),b||0))}},500)};a.parentNode&&(a.parentNode.className+=" filter")}};
dhtmlXGridObject.prototype._loadSelectOptins=function(a,b){var c=this.collectValues(b),d=a.value;a.innerHTML="";a.options[0]=new Option("","");for(var e=this._filter_tr?this._filter_tr[b]:null,f=0;f<c.length;f++)a.options[a.options.length]=new Option(e?e(c[f]):c[f],c[f]);a.value=d};dhtmlXGridObject.prototype.setSelectFilterLabel=function(a,b){if(!this._filter_tr)this._filter_tr=[];this._filter_tr[a]=b};
dhtmlXGridObject.prototype._loadComboOptins=function(a,b){if(a.combo){var c=this.collectValues(b);a.combo.clearAll();a.combo.render(!1);for(var d=[["","&nbsp;"]],e=0;e<c.length;e++)d.push([c[e],c[e]]);a.combo.addOption(d);a.combo.render(!0)}};
dhtmlXGridObject.prototype.refreshFilters=function(){if(this.filters)for(var a=0;a<this.filters.length;a++)switch(this.filters[a][0].tagName.toLowerCase()){case "select":this._loadSelectOptins.apply(this,this.filters[a]);break;case "div":this._loadComboOptins.apply(this,this.filters[a])}};
dhtmlXGridObject.prototype._filters_ready=function(){this.attachEvent("onXLE",this.refreshFilters);this.attachEvent("onRowCreated",function(a,b){if(this._f_rowsBuffer)for(var c=0;c<this._f_rowsBuffer.length;c++)if(this._f_rowsBuffer[c].idd==a)return this._f_rowsBuffer[c]=b});this.attachEvent("onClearAll",function(){this._f_rowsBuffer=null;if(!this.hdr.rows.length)this.filters=[]});window.dhtmlXCombo&&this.attachEvent("onScroll",dhtmlXCombo.prototype.closeAll);this._filters_ready=function(){}};
dhtmlXGridObject.prototype._in_header_text_filter=function(a,b){a.innerHTML="<input type='text'>";a.onclick=a.onmousedown=function(a){return(a||event).cancelBubble=!0};a.onselectstart=function(){return event.cancelBubble=!0};this.makeFilter(a.firstChild,b)};
dhtmlXGridObject.prototype._in_header_text_filter_inc=function(a,b){a.innerHTML="<input type='text'>";a.onclick=a.onmousedown=function(a){return(a||event).cancelBubble=!0};a.onselectstart=function(){return event.cancelBubble=!0};this.makeFilter(a.firstChild,b);a.firstChild._filter=function(){return a.firstChild.value==""?"":function(b){return b.toString().toLowerCase().indexOf(a.firstChild.value.toLowerCase())==0}};this._filters_ready()};
dhtmlXGridObject.prototype._in_header_select_filter=function(a,b){a.innerHTML="<select></select>";a.onclick=function(a){(a||event).cancelBubble=!0;return!1};this.makeFilter(a.firstChild,b)};
dhtmlXGridObject.prototype._in_header_select_filter_strict=function(a,b){a.innerHTML="<select style='width:90%; font-size:8pt; font-family:Tahoma;'></select>";a.onclick=function(a){(a||event).cancelBubble=!0;return!1};this.makeFilter(a.firstChild,b);var c=this.combos;a.firstChild._filter=function(){var d=a.firstChild.value;if(!d)return"";c[b]&&(d=c[b].keys[c[b].values._dhx_find(d)]);d=d.toLowerCase();return function(a){return a.toString().toLowerCase()==d}};this._filters_ready()};
dhtmlXGridObject.prototype._in_header_combo_filter=function(a,b){a.innerHTML="<div style='width:100%; padding-left:2px; overflow:hidden; ' class='combo'></div>";a.onselectstart=function(){return event.cancelBubble=!0};a.onclick=a.onmousedown=function(a){return(a||event).cancelBubble=!0};this.makeFilter(a.firstChild,b)};
dhtmlXGridObject.prototype._search_common=function(a){a.innerHTML="<input type='text' style='width:90%; '>";a.onclick=a.onmousedown=function(a){return(a||event).cancelBubble=!0};a.onselectstart=function(){return event.cancelBubble=!0}};dhtmlXGridObject.prototype._in_header_text_search=function(a,b){this._search_common(a,b);this.makeSearch(a.firstChild,b)};dhtmlXGridObject.prototype._in_header_text_search_strict=function(a,b){this._search_common(a,b);this.makeSearch(a.firstChild,b,!0)};
dhtmlXGridObject.prototype._in_header_numeric_filter=function(a,b){this._in_header_text_filter.call(this,a,b);a.firstChild._filter=function(){var a=this.value,b,e="==",f=parseFloat(a.replace("=","")),g=null;if(a){if(a.indexOf("..")!=-1)return a=a.split(".."),f=parseFloat(a[0]),g=parseFloat(a[1]),function(a){return a>=f&&a<=g?!0:!1};if(b=a.match(/>=|<=|>|</))e=b[0],f=parseFloat(a.replace(e,""));return Function("v"," if (v "+e+" "+f+" ) return true; return false;")}return""}};
dhtmlXGridObject.prototype._in_header_master_checkbox=function(a,b,c){a.innerHTML=c[0]+"<input type='checkbox' />"+c[1];var d=this;a.getElementsByTagName("input")[0].onclick=function(a){d._build_m_order();var c=d._m_order?d._m_order[b]:b,g=this.checked?1:0;d.forEachRowA(function(a){var b=this.cells(a,c);if(b.isCheckbox())b.setValue(g),b.cell.wasChanged=!0;this.callEvent("onEditCell",[1,a,c,g]);this.callEvent("onCheckbox",[a,c,g])});(a||event).cancelBubble=!0}};
dhtmlXGridObject.prototype._in_header_stat_total=function(a,b,c){var d=function(){var a=0;this._build_m_order();for(var c=this._m_order?this._m_order[b]:b,d=0;d<this.rowsBuffer.length;d++){var h=parseFloat(this._get_cell_value(this.rowsBuffer[d],c));a+=isNaN(h)?0:h}return this._maskArr[c]?this._aplNF(a,c):Math.round(a*100)/100};this._stat_in_header(a,d,b,c,c)};
dhtmlXGridObject.prototype._in_header_stat_multi_total=function(a,b,c){var d=c[1].split(":");c[1]="";for(var e=0;e<d.length;e++)d[e]=parseInt(d[e]);for(var f=function(){for(var a=0,c=0;c<this.rowsBuffer.length;c++){for(var e=1,f=0;f<d.length;f++)e*=parseFloat(this._get_cell_value(this.rowsBuffer[c],d[f]));a+=isNaN(e)?0:e}return this._maskArr[b]?this._aplNF(a,b):Math.round(a*100)/100},g=[],b=0;b<d.length;b++)g[d[b]]=!0;this._stat_in_header(a,f,g,c,c)};
dhtmlXGridObject.prototype._in_header_stat_max=function(a,b,c){var d=function(){var a=-999999999;if(this.getRowsNum()==0)return"&nbsp;";for(var c=0;c<this.rowsBuffer.length;c++)a=Math.max(a,parseFloat(this._get_cell_value(this.rowsBuffer[c],b)));return this._maskArr[b]?this._aplNF(a,b):a};this._stat_in_header(a,d,b,c)};
dhtmlXGridObject.prototype._in_header_stat_min=function(a,b,c){var d=function(){var a=999999999;if(this.getRowsNum()==0)return"&nbsp;";for(var c=0;c<this.rowsBuffer.length;c++)a=Math.min(a,parseFloat(this._get_cell_value(this.rowsBuffer[c],b)));return this._maskArr[b]?this._aplNF(a,b):a};this._stat_in_header(a,d,b,c)};
dhtmlXGridObject.prototype._in_header_stat_average=function(a,b,c){var d=function(){var a=0,c=0;if(this.getRowsNum()==0)return"&nbsp;";for(var d=0;d<this.rowsBuffer.length;d++){var h=parseFloat(this._get_cell_value(this.rowsBuffer[d],b));a+=isNaN(h)?0:h;c++}return this._maskArr[b]?this._aplNF(a/c,b):Math.round(a/c*100)/100};this._stat_in_header(a,d,b,c)};dhtmlXGridObject.prototype._in_header_stat_count=function(a,b,c){var d=function(){return this.getRowsNum()};this._stat_in_header(a,d,b,c)};
dhtmlXGridObject.prototype._stat_in_header=function(a,b,c,d){var e=this,f=function(){this.dma(!0);a.innerHTML=(d[0]?d[0]:"")+b.call(this)+(d[1]?d[1]:"");this.dma(!1);this.callEvent("onStatReady",[])};if(!this._stat_events)this._stat_events=[],this.attachEvent("onClearAll",function(){if(!this.hdr.rows[1]){for(var a=0;a<this._stat_events.length;a++)for(var b=0;b<4;b++)this.detachEvent(this._stat_events[a][b]);this._stat_events=[]}});this._stat_events.push([this.attachEvent("onGridReconstructed",f),
this.attachEvent("onXLE",f),this.attachEvent("onFilterEnd",f),this.attachEvent("onEditCell",function(a,b,d){a==2&&(d==c||c&&c[d])&&f.call(this);return!0})]);a.innerHTML=""};dhtmlXGridObject.prototype.enableDragAndDrop=function(a){a=="temporary_disabled"?(this.dADTempOff=!1,a=!0):this.dADTempOff=!0;this.dragAndDropOff=convertStringToBoolean(a);this._drag_validate=!0;if(a)this.objBox.ondragstart=function(a){(a||event).cancelBubble=!0;return!1}};
dhtmlXGridObject.prototype.setDragBehavior=function(a){this.dadmodec=this.dadmodefix=0;switch(a){case "child":this.dadmode=0;this._sbmod=!1;break;case "sibling":this.dadmode=1;this._sbmod=!1;break;case "sibling-next":this.dadmode=1;this._sbmod=!0;break;case "complex":this.dadmode=2;this._sbmod=!1;break;case "complex-next":this.dadmode=2,this._sbmod=!0}};dhtmlXGridObject.prototype.enableDragOrder=function(a){this._dndorder=convertStringToBoolean(a)};
dhtmlXGridObject.prototype._checkParent=function(a,b){var c=this._h2.get[a.idd].parent;if(c.parent){for(var d=0;d<b.length;d++)if(b[d]==c.id)return!0;return this._checkParent(this.rowsAr[c.id],b)}};
dhtmlXGridObject.prototype._createDragNode=function(a,b){this.editStop();if(window.dhtmlDragAndDrop.dragNode)return null;if(!this.dADTempOff)return null;a.parentObject={};a.parentObject.treeNod=this;var c=this.callEvent("onBeforeDrag",[a.parentNode.idd,a._cellIndex]);if(!c)return null;var d=[];d[this.selMultiRows?d.length:0]=a.parentNode.idd;if(this.isTreeGrid())for(var e=d.length-1;e>=0;e--)this._checkParent(this.rowsAr[d[e]],d)&&d.splice(e,1);var f=this;d.length&&this._dndorder&&d.sort(function(a,
b){return f.rowsAr[a].rowIndex>f.rowsAr[b].rowIndex?1:-1});var g=this.getFirstParentOfType(_isIE?b.srcElement:b.target,"TD");if(g)this._dndExtra=g._cellIndex;this._dragged=[];for(e=0;e<d.length;e++)if(this.rowsAr[d[e]])this._dragged[this._dragged.length]=this.rowsAr[d[e]],this.rowsAr[d[e]].treeNod=this;a.parentObject.parentNode=a.parentNode;var h=document.createElement("div");h.innerHTML=c!==!0?c:this.rowToDragElement(a.parentNode.idd);h.style.position="absolute";h.className="dragSpanDiv";return h};
dhtmlXGridObject.prototype._createSdrgc=function(){this._sdrgc=document.createElement("DIV");this._sdrgc.innerHTML="&nbsp;";this._sdrgc.className="gridDragLine";this.objBox.appendChild(this._sdrgc)};function dragContext(a,b,c,d,e,f,g,h,i,j){this.source=a||"grid";this.target=b||"grid";this.mode=c||"move";this.dropmode=d||"child";this.sid=e||0;this.tid=f;this.sobj=g||null;this.tobj=h||null;this.sExtra=i||null;this.tExtra=j||null;return this}
dragContext.prototype.valid=function(){if(this.sobj!=this.tobj)return!0;if(this.sid==this.tid)return!1;if(this.target=="treeGrid")for(var a=this.tid;a=this.tobj.getParentId(a);)if(this.sid==a)return!1;return!0};dragContext.prototype.close=function(){this.tobj=this.sobj=null};dragContext.prototype.copy=function(){return new dragContext(this.source,this.target,this.mode,this.dropmode,this.sid,this.tid,this.sobj,this.tobj,this.sExtra,this.tExtra)};dragContext.prototype.set=function(a,b){this[a]=b;return this};
dragContext.prototype.uid=function(){for(this.nid=this.sid;this.tobj.rowsAr[this.nid];)this.nid+=(new Date).valueOf();return this};dragContext.prototype.data=function(){return this.sobj==this.tobj?this.sobj._getRowArray(this.sobj.rowsAr[this.sid]):this.source=="tree"?this.tobj.treeToGridElement(this.sobj,this.sid,this.tid):this.tobj.gridToGrid(this.sid,this.sobj,this.tobj)};dragContext.prototype.attrs=function(){return this.source=="tree"?{}:this.sobj.rowsAr[this.sid]._attrs};
dragContext.prototype.childs=function(){return this.source=="treeGrid"?this.sobj._h2.get[this.sid]._xml_await?this.sobj._h2.get[this.sid].has_kids:null:null};
dragContext.prototype.pid=function(){if(!this.tid)return 0;if(!this.tobj._h2)return 0;if(this.target=="treeGrid")if(this.dropmode=="child")return this.tid;else{var a=this.tobj.rowsAr[this.tid],b=this.tobj._h2.get[a.idd].parent.id;if(this.alfa&&this.tobj._sbmod&&a.nextSibling){var c=this.tobj._h2.get[a.nextSibling.idd].parent.id;if(c==this.tid)return this.tid;if(c!=b)return c}return b}};
dragContext.prototype.ind=function(){if(this.tid==window.unknown)return this.tobj.rowsBuffer.length;this.target=="treeGrid"&&(this.dropmode=="child"?this.tobj.openItem(this.tid):this.tobj.openItem(this.tobj.getParentId(this.tid)));var a=this.tobj.rowsBuffer._dhx_find(this.tobj.rowsAr[this.tid]);if(this.alfa&&this.tobj._sbmod&&this.dropmode=="sibling"){var b=this.tobj.rowsAr[this.tid];if(b.nextSibling&&this._h2.get[b.nextSibling.idd].parent.id==this.tid)return a+1}return a+1+(this.target=="treeGrid"&&
a>=0&&this.tobj._h2.get[this.tobj.rowsBuffer[a].idd].state=="minus"?this.tobj._getOpenLenght(this.tobj.rowsBuffer[a].idd,0):0)};dragContext.prototype.img=function(){return this.target!="grid"&&this.sobj._h2?this.sobj.getItemImage(this.sid):null};dragContext.prototype.slist=function(){for(var a=[],b=0;b<this.sid.length;b++)a[a.length]=this.sid[b][this.source=="tree"?"id":"idd"];return a.join(",")};
dhtmlXGridObject.prototype._drag=function(a,b,c,d){if(this._realfake)return this._fake._drag();var e=this.lastLanding;this._autoOpenTimer&&window.clearTimeout(this._autoOpenTimer);var f=c.parentNode,g=a.parentObject;if(!f.idd)f.grid=this,this.dadmodefix=0;var h=new dragContext(0,0,0,f.grid.dadmode==1||f.grid.dadmodec?"sibling":"child");if(g&&g.childNodes)h.set("source","tree").set("sobj",g.treeNod).set("sid",h.sobj._dragged);else{if(!g)return!0;g.treeNod.isTreeGrid&&g.treeNod.isTreeGrid()&&h.set("source",
"treeGrid");h.set("sobj",g.treeNod).set("sid",h.sobj._dragged)}f.grid.isTreeGrid()?h.set("target","treeGrid"):h.set("dropmode","sibling");h.set("tobj",f.grid).set("tid",f.idd);var i=this.getFirstParentOfType(d,"TD");i&&h.set("tExtra",i._cellIndex);i&&h.set("sExtra",h.sobj._dndExtra);h.sobj.dpcpy&&h.set("mode","copy");if(h.tobj._realfake)h.tobj=h.tobj._fake;if(h.sobj._realfake)h.sobj=h.sobj._fake;h.tobj._clearMove();if(g&&g.treeNod&&g.treeNod._nonTrivialRow)g.treeNod._nonTrivialRow(this,h.tid,h.dropmode,
g);else{h.tobj.dragContext=h;if(!h.tobj.callEvent("onDrag",[h.slist(),h.tid,h.sobj,h.tobj,h.sExtra,h.tExtra]))return h.tobj.dragContext=null;var j=[];if(typeof h.sid=="object"){for(var k=h.copy(),m=0;m<h.sid.length;m++)if(k.set("alfa",!m).set("sid",h.sid[m][h.source=="tree"?"id":"idd"]).valid())k.tobj._dragRoutine(k),k.target=="treeGrid"&&k.dropmode=="child"&&k.tobj.openItem(k.tid),j[j.length]=k.nid,k.set("dropmode","sibling").set("tid",k.nid);k.close()}else h.tobj._dragRoutine(h);h.tobj.laterLink&&
h.tobj.laterLink();h.tobj.callEvent("onDrop",[h.slist(),h.tid,j.join(","),h.sobj,h.tobj,h.sExtra,h.tExtra])}h.tobj.dragContext=null;h.close()};
dhtmlXGridObject.prototype._dragRoutine=function(a){if(a.sobj==a.tobj&&a.source=="grid"&&a.mode=="move"&&!this._fake){if(!a.sobj._dndProblematic){var b=a.sobj.rowsAr[a.sid],c=a.sobj.rowsCol._dhx_find(b);a.sobj.rowsCol._dhx_removeAt(a.sobj.rowsCol._dhx_find(b));a.sobj.rowsBuffer._dhx_removeAt(a.sobj.rowsBuffer._dhx_find(b));a.sobj.rowsBuffer._dhx_insertAt(a.ind(),b);if(a.tobj._fake){a.tobj._fake.rowsCol._dhx_removeAt(c);var d=a.tobj._fake.rowsAr[a.sid];d.parentNode.removeChild(d)}a.sobj._insertRowAt(b,
a.ind());a.nid=a.sid;a.sobj.callEvent("onGridReconstructed",[])}}else{var e;this._h2&&typeof a.tid!="undefined"&&a.dropmode=="sibling"&&(this._sbmod||a.tid)?a.alfa&&this._sbmod&&this._h2.get[a.tid].childs.length?(this.openItem(a.tid),e=a.uid().tobj.addRowBefore(a.nid,a.data(),this._h2.get[a.tid].childs[0].id,a.img(),a.childs())):e=a.uid().tobj.addRowAfter(a.nid,a.data(),a.tid,a.img(),a.childs()):e=a.uid().tobj.addRow(a.nid,a.data(),a.ind(),a.pid(),a.img(),a.childs());e._attrs=a.attrs();if(a.source==
"tree"){this.callEvent("onRowAdded",[a.nid]);var f=a.sobj._globalIdStorageFind(a.sid);if(f.childsCount){for(var g=a.copy().set("tid",a.nid).set("dropmode",a.target=="grid"?"sibling":"child"),h=0;h<f.childsCount;h++)a.tobj._dragRoutine(g.set("sid",f.childNodes[h].id)),a.mode=="move"&&h--;g.close()}}else if(a.tobj._copyUserData(a),this.callEvent("onRowAdded",[a.nid]),a.source=="treeGrid"){if(a.sobj==a.tobj)e._xml=a.sobj.rowsAr[a.sid]._xml;var i=a.sobj._h2.get[a.sid];if(i&&i.childs.length){g=a.copy().set("tid",
a.nid);a.target=="grid"?g.set("dropmode","sibling"):(g.tobj.openItem(a.tid),g.set("dropmode","child"));for(var j=i.childs.length,h=0;h<j;h++)if(a.sobj.render_row_tree(null,i.childs[h].id),a.tobj._dragRoutine(g.set("sid",i.childs[h].id)),j!=i.childs.length)h--,j=i.childs.length;g.close()}}if(a.mode=="move"&&(a.sobj[a.source=="tree"?"deleteItem":"deleteRow"](a.sid),a.sobj==a.tobj&&!a.tobj.rowsAr[a.sid]))a.tobj.changeRowId(a.nid,a.sid),a.nid=a.sid}};
dhtmlXGridObject.prototype.gridToGrid=function(a,b){for(var c=[],d=0;d<b.hdr.rows[0].cells.length;d++)c[d]=b.cells(a,d).getValue();return c};dhtmlXGridObject.prototype.checkParentLine=function(a,b){return!this._h2||!b||!a?!1:a.id==b?!0:this.checkParentLine(a.parent,b)};
dhtmlXGridObject.prototype._dragIn=function(a,b,c,d){if(!this.dADTempOff)return 0;var e=this.isTreeGrid(),f=b.parentNode.idd?b.parentNode:b.parentObject;if(this._drag_validate){if(a.parentNode==b.parentNode)return 0;if(e&&this==f.grid&&this.checkParentLine(this._h2.get[a.parentNode.idd],b.parentNode.idd))return 0}if(!this.callEvent("onDragIn",[f.idd||f.id,a.parentNode.idd,f.grid||f.treeNod,a.grid||a.parentNode.grid]))return this._setMove(a,c,d,!0);this._setMove(a,c,d);e&&a.parentNode.expand!=""?(this._autoOpenTimer=
window.setTimeout(new callerFunction(this._autoOpenItem,this),1E3),this._autoOpenId=a.parentNode.idd):this._autoOpenTimer&&window.clearTimeout(this._autoOpenTimer);return a};dhtmlXGridObject.prototype._autoOpenItem=function(a,b){b.openItem(b._autoOpenId)};dhtmlXGridObject.prototype._dragOut=function(a){this._clearMove();var b=a.parentNode.parentObject?a.parentObject.id:a.parentNode.idd;this.callEvent("onDragOut",[b]);this._autoOpenTimer&&window.clearTimeout(this._autoOpenTimer)};
dhtmlXGridObject.prototype._setMove=function(a,b,c,d){if(a.parentNode.idd){var e=getAbsoluteTop(a),f=getAbsoluteTop(this.objBox);if(e-f>parseInt(this.objBox.offsetHeight)-50)this.objBox.scrollTop=parseInt(this.objBox.scrollTop)+20;if(e-f+parseInt(this.objBox.scrollTop)<parseInt(this.objBox.scrollTop)+30)this.objBox.scrollTop=parseInt(this.objBox.scrollTop)-20;if(d)return 0;if(this.dadmode==2){var g=c-e+(document.body.scrollTop||document.documentElement.scrollTop)-2-a.offsetHeight/2;Math.abs(g)-a.offsetHeight/
6>0?(this.dadmodec=1,this.dadmodefix=g<0?-1:1):this.dadmodec=0}else this.dadmodec=this.dadmode;if(this.dadmodec)this._sdrgc||this._createSdrgc(),this._sdrgc.style.display="block",this._sdrgc.style.top=e-f+parseInt(this.objBox.scrollTop)+(this.dadmodefix>=0?a.offsetHeight:0)+"px";else if(this._llSelD=a,a.parentNode.tagName=="TR")for(var h=0;h<a.parentNode.childNodes.length;h++)g=a.parentNode.childNodes[h],g._bgCol=g.style.backgroundColor,g.style.backgroundColor="#FFCCCC"}};
dhtmlXGridObject.prototype._clearMove=function(){if(this._sdrgc)this._sdrgc.style.display="none";if(this._llSelD&&this._llSelD.parentNode.tagName=="TR")for(var a=this._llSelD.parentNode.childNodes,b=0;b<a.length;b++)a[b].style.backgroundColor=a[b]._bgCol;this._llSelD=null};dhtmlXGridObject.prototype.rowToDragElement=function(a){var b=this.cells(a,0).getValue();return b};
dhtmlXGridObject.prototype._copyUserData=function(a){if(!a.tobj.UserData[a.nid]||a.tobj!=a.sobj){a.tobj.UserData[a.nid]=new Hashtable;var b=a.sobj.UserData[a.sid],c=a.tobj.UserData[a.nid];if(b)c.keys=c.keys.concat(b.keys),c.values=c.values.concat(b.values)}};dhtmlXGridObject.prototype.moveRow=function(a,b,c,d){switch(b){case "row_sibling":this.moveRowTo(a,c,"move","sibling",this,d);break;case "up":this.moveRowUp(a);break;case "down":this.moveRowDown(a)}};
dhtmlXGridObject.prototype.loadCSVFile=function(a,b){this.load(a,b,"csv")};dhtmlXGridObject.prototype.enableCSVAutoID=function(a){this._csvAID=convertStringToBoolean(a)};dhtmlXGridObject.prototype.enableCSVHeader=function(a){this._csvHdr=convertStringToBoolean(a)};dhtmlXGridObject.prototype.setCSVDelimiter=function(a){this.csv.cell=a};dhtmlXGridObject.prototype._csvAID=!0;dhtmlXGridObject.prototype.loadCSVString=function(a){this.parse(a,"csv")};
dhtmlXGridObject.prototype.serializeToCSV=function(a){this.editStop();this._agetm=this._mathSerialization?"getMathValue":this._strictText||a?"getTitle":"getValue";var b=[];if(this._csvHdr)for(var c=1;c<this.hdr.rows.length;c++){for(var d=[],e=0;e<this._cCount;e++)(!this._srClmn||this._srClmn[e])&&d.push(this.getColumnLabel(e,c-1));b.push(this.csvParser.str(d,this.csv.cell,this.csv.row))}for(var e=0,f=this.rowsBuffer.length;e<f;e++){var g=this._serializeRowToCVS(null,e);g!=""&&b.push(g)}return this.csvParser.block(b,
this.csv.row)};
dhtmlXGridObject.prototype._serializeRowToCVS=function(a,b,c,d){var e=[];a||(a=this.render_row(b),this._fake&&!this._fake.rowsAr[a.idd]&&this._fake.render_row(b));if(!this._csvAID)e[e.length]=a.idd;for(var c=c||0,d=d||this._cCount,f=!1,g=c;a.childNodes[c]._cellIndex>g&&c;)c--;for(var h=c;g<d;h++){if(!a.childNodes[h])break;var i=a.childNodes[h]._cellIndex;if(!this._srClmn||this._srClmn[i]){for(var j=a.childNodes[h],k=this.cells(a.idd,i);g!=i;)if(g++,e.push(""),g>=d)break;if(g>=d)break;g++;zxVal=k.cell?
k[this._agetm]():"";this._chAttr&&k.wasChanged()&&(f=!0);e[e.length]=zxVal===null?"":zxVal;if(this._ecspn&&j.colSpan&&j.colSpan>1)for(var j=j.colSpan-1,m=0;m<j;m++)e[e.length]="",g++}else g++}return this._onlChAttr&&!f?"":this.csvParser.str(e,this.csv.cell,this.csv.row)};dhtmlXGridObject.prototype.toClipBoard=function(a){window.clipboardData?window.clipboardData.setData("Text",a):(new Clipboard).copy(a)};
dhtmlXGridObject.prototype.fromClipBoard=function(){return window.clipboardData?window.clipboardData.getData("Text"):(new Clipboard).paste()};dhtmlXGridObject.prototype.cellToClipboard=function(a,b){if(!a||!b){if(!this.selectedRows[0])return;a=this.selectedRows[0].idd;b=this.cell._cellIndex}var c=this.cells(a,b);this.toClipBoard(((c.getLabel?c.getLabel():c.getValue())||"").toString())};
dhtmlXGridObject.prototype.updateCellFromClipboard=function(a,b){if(!a||!b){if(!this.selectedRows[0])return;a=this.selectedRows[0].idd;b=this.cell._cellIndex}var c=this.cells(a,b);c[c.setImage?"setLabel":"setValue"](this.fromClipBoard())};
dhtmlXGridObject.prototype.rowToClipboard=function(a){var b="";this._agetm=this._mathSerialization?"getMathValue":this._strictText?"getTitle":"getValue";if(a)b=this._serializeRowToCVS(this.getRowById(a));else for(var c=[],d=0;d<this.selectedRows.length;d++)c[c.length]=this._serializeRowToCVS(this.selectedRows[d]),b=this.csvParser.block(c,this.csv.row);this.toClipBoard(b)};
dhtmlXGridObject.prototype.updateRowFromClipboard=function(a){var b=this.fromClipBoard();if(b){var c=a?this.getRowById(a):this.selectedRows[0];if(c){var d=this.csvParser,b=d.unblock(b,this.csv.cell,this.csv.row)[0];this._csvAID||b.splice(0,1);for(var e=0;e<b.length;e++){var f=this.cells3(c,e);f[f.setImage?"setLabel":"setValue"](b[e])}}}};
dhtmlXGridObject.prototype.csvParser={block:function(a,b){return a.join(b)},unblock:function(a,b,c){for(var d=(a||"").split(c),e=0;e<d.length;e++)d[e]=(d[e]||"").split(b);var f=d.length-1;d[f].length==1&&d[f][0]==""&&d.splice(f,1);return d},str:function(a,b){return a.join(b)}};
dhtmlXGridObject.prototype.csvExtParser={_quote:RegExp('"',"g"),_quote_esc:RegExp('\\\\"',"g"),block:function(a,b){return a.join(b)},unblock:function(a,b,c){var d=[[]],e=0;if(!a)return d;for(var f=/^[ ]*"/,g=/"[ ]*$/,h=RegExp(".*"+c+".*$"),i=a.split(b),j=0;j<i.length;j++)if(i[j].match(f)){for(var k=i[j].replace(f,"");!i[j].match(g);)j++,k+=i[j];d[e].push(k.replace(g,"").replace(this._quote_esc,'"'))}else if(i[j].match(h)){var m=i[j].indexOf(c);d[e].push(i[j].substr(0,m));e++;d[e]=[];i[j]=i[j].substr(m+
1);j--}else(i[j]||j!=i.length-1)&&d[e].push(i[j]);var l=d.length-1;l>0&&!d[l].length&&d.splice(l,1);return d},str:function(a,b){for(var c=0;c<a.length;c++)a[c]='"'+a[c].replace(this._quote,'\\"')+'"';return a.join(b)}};
dhtmlXGridObject.prototype.addRowFromClipboard=function(){var a=this.fromClipBoard();if(a)for(var b=this.csvParser.unblock(a,this.csv.cell,this.csv.row),c=0;c<b.length;c++)b[c]&&(a=b[c],a.length&&(this._csvAID?this.addRow(this.getRowsNum()+2,a):(this.rowsAr[a[0]]&&(a[0]=this.uid()),this.addRow(a[0],a.slice(1)))))};dhtmlXGridObject.prototype.gridToClipboard=function(){this.toClipBoard(this.serializeToCSV())};dhtmlXGridObject.prototype.gridFromClipboard=function(){var a=this.fromClipBoard();a&&this.loadCSVString(a)};
dhtmlXGridObject.prototype.getXLS=function(a){if(!this.xslform){this.xslform=document.createElement("FORM");this.xslform.action=(a||"")+"xls.php";this.xslform.method="post";this.xslform.target=_isIE?"_blank":"";document.body.appendChild(this.xslform);var b=document.createElement("INPUT");b.type="hidden";b.name="csv";this.xslform.appendChild(b);var c=document.createElement("INPUT");c.type="hidden";c.name="csv_header";this.xslform.appendChild(c)}var d=this.serializeToCSV();this.xslform.childNodes[0].value=
d;for(var e=[],f=this._cCount,g=0;g<f;g++)e.push(this.getHeaderCol(g));e=e.join(",");this.xslform.childNodes[1].value=e;this.xslform.submit()};
dhtmlXGridObject.prototype.printView=function(a,b){var c="<style>TD { font-family:Arial; text-align:center; padding-left:2px;padding-right:2px; } \n td.filter input, td.filter select { display:none; }\t\n  </style>",d=null;if(this._fake)for(var d=[].concat(this._hrrar),e=0;e<this._fake._cCount;e++)this._hrrar[e]=null;c+="<base  href='"+document.location.href+"'></base>";this.parentGrid||(c+=a||"");c+='<table width="100%" border="2px" cellpadding="0" cellspacing="0">';var f=Math.max(this.rowsBuffer.length,
this.rowsCol.length),g=this._cCount,h=this._printWidth();c+='<tr class="header_row_1">';for(e=0;e<g;e++)if(!this._hrrar||!this._hrrar[e]){for(var i=this.hdr.rows[1].cells[this.hdr.rows[1]._childIndexes?this.hdr.rows[1]._childIndexes[parseInt(e)]:e],j=i.colSpan||1,k=i.rowSpan||1,m=1;m<j;m++)h[e]+=h[m];c+='<td rowspan="'+k+'" width="'+h[e]+'%" style="background-color:lightgrey;" colspan="'+j+'">'+this.getHeaderCol(e)+"</td>";e+=j-1}c+="</tr>";for(e=2;e<this.hdr.rows.length;e++)if(_isIE){c+="<tr style='background-color:lightgrey' class='header_row_"+
e+"'>";for(var l=this.hdr.rows[e].childNodes,m=0;m<l.length;m++)if(!this._hrrar||!this._hrrar[l[m]._cellIndex])c+=l[m].outerHTML;c+="</tr>"}else c+="<tr class='header_row_"+e+"' style='background-color:lightgrey'>"+(this._fake?this._fake.hdr.rows[e].innerHTML:"")+this.hdr.rows[e].innerHTML+"</tr>";for(e=0;e<f;e++)if(c+="<tr>",this.rowsCol[e]&&this.rowsCol[e]._cntr)c+=this.rowsCol[e].innerHTML.replace(/<img[^>]*>/gi,"")+"</tr>";else if(!(this.rowsCol[e]&&this.rowsCol[e].style.display=="none")){var n;
if(this.rowsCol[e])n=this.rowsCol[e].idd;else if(this.rowsBuffer[e])n=this.rowsBuffer[e].idd;else continue;for(m=0;m<g;m++)if(!this._hrrar||!this._hrrar[m]){if(this.rowsAr[n]&&this.rowsAr[n].tagName=="TR")var o=this.cells(n,m),p=o._setState?"":o.getContent?o.getContent():o.getImage||o.combo?o.cell.innerHTML:o.getValue();else p=this._get_cell_value(this.rowsBuffer[e],m);var r=this.columnColor[m]?"background-color:"+this.columnColor[m]+";":"",q=this.cellAlign[m]?"text-align:"+this.cellAlign[m]+";":
"",s=o.getAttribute("colspan");c+='<td style="'+r+q+'" '+(s?'colSpan="'+s+'"':"")+">"+(p===""?"&nbsp;":p)+"</td>";s&&(m+=s-1)}c+="</tr>";if(this.rowsCol[e]&&this.rowsCol[e]._expanded){var w=this.cells4(this.rowsCol[e]._expanded.ctrl);c+=w.getSubGrid?'<tr><td colspan="'+g+'">'+w.getSubGrid().printView()+"</td></tr>":'<tr><td colspan="'+g+'">'+this.rowsCol[e]._expanded.innerHTML+"</td></tr>"}}if(this.ftr)for(e=1;e<this.ftr.childNodes[0].rows.length;e++)c+="<tr style='background-color:lightgrey'>"+(this._fake?
this._fake.ftr.childNodes[0].rows[e].innerHTML:"")+this.ftr.childNodes[0].rows[e].innerHTML+"</tr>";c+="</table>";if(this.parentGrid)return c;c+=b||"";var t=window.open("","_blank");t.document.write(c);t.document.write("<script>window.onerror=function(){return true;}<\/script>");t.document.close();if(this._fake)this._hrrar=d};
dhtmlXGridObject.prototype._printWidth=function(){for(var a=[],b=0,c=0;c<this._cCount;c++){var d=this.getColWidth(c);a.push(d);b+=d}for(var e=[],f=0,c=0;c<a.length;c++){var g=Math.floor(a[c]/b*100);f+=g;e.push(g)}e[e.length-1]+=100-f;return e};dhtmlXGridObject.prototype.loadObject=function(){};dhtmlXGridObject.prototype.loadJSONFile=function(){};dhtmlXGridObject.prototype.serializeToObject=function(){};dhtmlXGridObject.prototype.serializeToJSON=function(){};
if(!window.clipboardData)window.clipboardData={_make:function(){var a=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(!a)return null;var b=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!b)return null;b.addDataFlavor("text/unicode");var c=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);this._p=[a,b,c];return!0},
setData:function(a,b){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(c){return dhtmlxError.throwError("Clipboard","Access to clipboard denied",[a,b]),""}if(!this._make())return!1;this._p[2].data=b;this._p[1].setTransferData("text/unicode",this._p[2],b.length*2);var d=Components.interfaces.nsIClipboard;this._p[0].setData(this._p[1],null,d.kGlobalClipboard)},getData:function(a){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(b){return dhtmlxError.throwError("Clipboard",
"Access to clipboard denied",[a]),""}if(!this._make())return!1;this._p[0].getData(this._p[1],this._p[0].kGlobalClipboard);var c={},d={};try{this._p[1].getTransferData("text/unicode",d,c)}catch(e){return""}d&&(d=d.value.QueryInterface(Components.interfaces.nsISupportsString));return d?d.data.substring(0,c.value/2):""}};
dhtmlXGridObject.prototype.enableBlockSelection=function(a){if(typeof this._bs_mode=="undefined"){var b=this;this.obj.onmousedown=function(a){b._bs_mode&&b._OnSelectionStart(a||event,this);return!0};this._CSVRowDelimiter=this.csv.row;this.attachEvent("onResize",function(){b._HideSelection();return!0});this.attachEvent("onGridReconstructed",function(){b._HideSelection();return!0});this.attachEvent("onFilterEnd",this._HideSelection)}if(a===!1)return this._bs_mode=!1,this._HideSelection();else this._bs_mode=
!0};dhtmlXGridObject.prototype.forceLabelSelection=function(a){this._strictText=convertStringToBoolean(a)};dhtmlXGridObject.prototype.disableBlockSelection=function(){this.obj.onmousedown=null};
dhtmlXGridObject.prototype._OnSelectionStart=function(a){var b=this;if(a.button!=2){var c=a.srcElement||a.target;if(this.editor){if(c.tagName&&(c.tagName=="INPUT"||c.tagName=="TEXTAREA"))return;this.editStop()}b.isActive||b.setActive(!0);var d=this.getPosition(this.obj),e=a.clientX-d[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0)),f=a.clientY-d[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));this._CreateSelection(e-
4,f-4);if(c==this._selectionObj)this._HideSelection(),this._startSelectionCell=null;else{for(;c.tagName.toLowerCase()!="td";)c=c.parentNode;this._startSelectionCell=c}if(this._startSelectionCell&&!this.callEvent("onBeforeBlockSelected",[this._startSelectionCell.parentNode.idd,this._startSelectionCell._cellIndex]))return this._startSelectionCell=null;this.obj.onmousedown=null;this.obj[_isIE?"onmouseleave":"onmouseout"]=function(){b._blsTimer&&window.clearTimeout(b._blsTimer)};this.obj.onmmold=this.obj.onmousemove;
this._init_pos=[e,f];this._selectionObj.onmousemove=this.obj.onmousemove=function(c){c=c||a;c.returnValue=!1;b._OnSelectionMove(c)};this._oldDMP=document.body.onmouseup;document.body.onmouseup=function(c){c=c||a;b._OnSelectionStop(c,this);return!0};this.callEvent("onBeforeBlockSelection",[]);document.body.onselectstart=function(){return!1}}};
dhtmlXGridObject.prototype._getCellByPos=function(a,b){this._fake&&(a+=this._fake.entBox.offsetWidth);for(var c=0,d=0;d<this.obj.rows.length;d++)if(b-=this.obj.rows[d].offsetHeight,b<=0){c=this.obj.rows[d];break}if(!c||!c.idd)return null;for(d=0;d<this._cCount;d++)if(a-=this.getColWidth(d),a<=0)for(;;)if(c._childIndexes&&c._childIndexes[d+1]==c._childIndexes[d])c=c.previousSibling;else return this.cells(c.idd,d).cell;return null};
dhtmlXGridObject.prototype._OnSelectionMove=function(a){var b=this;this._ShowSelection();var c=this.getPosition(this.obj),d=a.clientX-c[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0)),e=a.clientY-c[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));if(Math.abs(this._init_pos[0]-d)<5&&Math.abs(this._init_pos[1]-e)<5)return this._HideSelection();var f=this._endSelectionCell;if(this._startSelectionCell==null)this._endSelectionCell=
this._startSelectionCell=this.getFirstParentOfType(a.srcElement||a.target,"TD");else if(a.srcElement||a.target)if((a.srcElement||a.target).className=="dhtmlxGrid_selection")this._endSelectionCell=this._getCellByPos(d,e)||this._endSelectionCell;else{var g=this.getFirstParentOfType(a.srcElement||a.target,"TD");if(g.parentNode.idd)this._endSelectionCell=g}if(this._endSelectionCell&&!this.callEvent("onBeforeBlockSelected",[this._endSelectionCell.parentNode.idd,this._endSelectionCell._cellIndex]))this._endSelectionCell=
f;var h=this.objBox.scrollLeft+this.objBox.clientWidth,i=this.objBox.scrollTop+this.objBox.clientHeight,j=this.objBox.scrollLeft,k=this.objBox.scrollTop,m=!1;this._blsTimer&&window.clearTimeout(this._blsTimer);d+20>=h?(this.objBox.scrollLeft+=20,m=!0):d-20<j&&(this.objBox.scrollLeft-=20,m=!0);e+20>=i&&!this._realfake?(this.objBox.scrollTop+=20,m=!0):e-20<k&&!this._realfake&&(this.objBox.scrollTop-=20,m=!0);this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._endSelectionCell);
if(m){var l=a.clientX,n=a.clientY;this._blsTimer=window.setTimeout(function(){b._OnSelectionMove({clientX:l,clientY:n})},100)}};
dhtmlXGridObject.prototype._OnSelectionStop=function(a){var b=this;this._blsTimer&&window.clearTimeout(this._blsTimer);this.obj.onmousedown=function(c){b._bs_mode&&b._OnSelectionStart(c||a,this);return!0};this.obj.onmousemove=this.obj.onmmold||null;this._selectionObj.onmousemove=null;document.body.onmouseup=this._oldDMP||null;if(parseInt(this._selectionObj.style.width)<2&&parseInt(this._selectionObj.style.height)<2)this._HideSelection();else{var c=this.getFirstParentOfType(a.srcElement||a.target,
"TD");if(!c||!c.parentNode.idd)c=this._endSelectionCell;if(!c)return this._HideSelection();for(;c.tagName.toLowerCase()!="td";)c=c.parentNode;this._stopSelectionCell=c;this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._stopSelectionCell);this.callEvent("onBlockSelected",[])}document.body.onselectstart=function(){}};
dhtmlXGridObject.prototype._RedrawSelectionPos=function(a,b){var c={};c.LeftTopCol=a._cellIndex;c.LeftTopRow=this.getRowIndex(a.parentNode.idd);c.RightBottomCol=b._cellIndex;c.RightBottomRow=this.getRowIndex(b.parentNode.idd);var d=a.offsetWidth,e=a.offsetHeight,a=this.getPosition(a,this.obj),f=b.offsetWidth,g=b.offsetHeight,b=this.getPosition(b,this.obj);if(a[0]<b[0])var h=a[0],i=b[0]+f;else{var j=c.RightBottomCol;c.RightBottomCol=c.LeftTopCol;c.LeftTopCol=j;h=b[0];i=a[0]+d}if(a[1]<b[1])var k=a[1],
m=b[1]+g;else j=c.RightBottomRow,c.RightBottomRow=c.LeftTopRow,c.LeftTopRow=j,k=b[1],m=a[1]+e;var l=i-h,n=m-k;this._selectionObj.style.left=h+"px";this._selectionObj.style.top=k+"px";this._selectionObj.style.width=l+"px";this._selectionObj.style.height=n+"px";return c};
dhtmlXGridObject.prototype._CreateSelection=function(a,b){if(this._selectionObj==null){var c=document.createElement("div");c.style.position="absolute";c.style.display="none";c.className="dhtmlxGrid_selection";this._selectionObj=c;this._selectionObj.onmousedown=function(a){a=a||event;if(a.button==2||_isMacOS&&a.ctrlKey)return this.parentNode.grid.callEvent("onBlockRightClick",["BLOCK",a])};this._selectionObj.oncontextmenu=function(a){(a||event).cancelBubble=!0;return!1};this.objBox.appendChild(this._selectionObj)}this._selectionObj.style.width=
"0px";this._selectionObj.style.height="0px";this._selectionObj.style.left=a+"px";this._selectionObj.style.top=b+"px";this._selectionObj.startX=a;this._selectionObj.startY=b};dhtmlXGridObject.prototype._ShowSelection=function(){if(this._selectionObj)this._selectionObj.style.display=""};dhtmlXGridObject.prototype._HideSelection=function(){if(this._selectionObj)this._selectionObj.style.display="none";this._selectionArea=null};
dhtmlXGridObject.prototype.copyBlockToClipboard=function(){if(this._selectionArea!=null){var a=[];this._agetm=this._mathSerialization?"getMathValue":this._strictText?"getTitle":"getValue";for(var b=this._selectionArea.LeftTopRow;b<=this._selectionArea.RightBottomRow;b++){var c=this._serializeRowToCVS(this.rowsBuffer[b],null,this._selectionArea.LeftTopCol,this._selectionArea.RightBottomCol+1);a[a.length]=this._csvAID?c:c.substr(c.indexOf(this.csv.cell)+1)}a=a.join(this._CSVRowDelimiter);this.toClipBoard(a)}};
dhtmlXGridObject.prototype.pasteBlockFromClipboard=function(){var a=this.fromClipBoard();if(this._selectionArea!=null)var b=this._selectionArea.LeftTopRow,c=this._selectionArea.LeftTopCol;else if(this.cell!=null&&!this.editor)b=this.getRowIndex(this.cell.parentNode.idd),c=this.cell._cellIndex;else return!1;var a=this.csvParser.unblock(a,this.csv.cell,this.csv.row),d=b+a.length,e=c+a[0].length;if(e>this._cCount)e=this._cCount;for(var f=0,g=b;g<d;g++){var h=this.render_row(g);if(h!=-1){for(var i=0,
j=c;j<e;j++){var k=this.cells3(h,j);if(k.isDisabled())i++;else{this._onEditUndoRedo&&this._onEditUndoRedo(2,h.idd,j,a[f][i],k.getValue());if(k.combo){for(var m=k.combo.values,l=0;l<m.length;l++)if(a[f][i]==m[l]){k.setValue(k.combo.keys[l]);m=null;break}m!=null&&k.editable?k.setValue(a[f][i++]):i++}else k[k.setImage?"setLabel":"setValue"](a[f][i++]);k.cell.wasChanged=!0}}this.callEvent("onRowPaste",[h.idd]);f++}}};
dhtmlXGridObject.prototype.getSelectedBlock=function(){return this._selectionArea?this._selectionArea:this.getSelectedRowId()!==null?{LeftTopRow:this.getSelectedRowId(),LeftTopCol:this.getSelectedCellIndex(),RightBottomRow:this.getSelectedRowId(),RightBottomCol:this.getSelectedCellIndex()}:null};
dhtmlXGridObject.prototype.enableSmartRendering=function(a,b,c){arguments.length>2&&(b&&!this.rowsBuffer[b-1]&&(this.rowsBuffer[b-1]=0),b=c);this._srnd=convertStringToBoolean(a);this._srdh=this._srdh||20;this._dpref=b||0};dhtmlXGridObject.prototype.enablePreRendering=function(a){this._srnd_pr=parseInt(a||50)};
dhtmlXGridObject.prototype.forceFullLoading=function(a,b){for(var c=0;c<this.rowsBuffer.length;c++)if(!this.rowsBuffer[c]){var d=a||this.rowsBuffer.length-c;if(this.callEvent("onDynXLS",[c,d])){var e=this;this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+c+"&count="+d,function(){window.setTimeout(function(){e.forceFullLoading(a,b)},100)},this._data_type)}return}b&&b.call(this)};dhtmlXGridObject.prototype.setAwaitedRowHeight=function(a){this._srdh=parseInt(a)};
dhtmlXGridObject.prototype._get_view_size=function(){return Math.floor(parseInt(this.entBox.offsetHeight)/this._srdh)+2};
dhtmlXGridObject.prototype._add_filler=function(a,b,c,d){if(!b)return null;var e="__filler__",f=this._prepareRow(e);f.firstChild.style.width="1px";for(var g=1;g<f.childNodes.length;g++)f.childNodes[g].style.display="none";f.firstChild.style.height=b*this._srdh+"px";(c=c||this.rowsCol[a])&&c.nextSibling?c.parentNode.insertBefore(f,c.nextSibling):_isKHTML?this.obj.appendChild(f):this.obj.rows[0].parentNode.appendChild(f);this.callEvent("onAddFiller",[a,b,f,c,d]);return[a,b,f]};
dhtmlXGridObject.prototype._update_srnd_view=function(){var a=Math.floor(this.objBox.scrollTop/this._srdh),b=a+this._get_view_size();if(this.multiLine){for(var c=this.objBox.scrollTop,a=0;c>0;)c-=this.rowsCol[a]?this.rowsCol[a].offsetHeight:this._srdh,a++;b=a+this._get_view_size();a>0&&a--}b+=this._srnd_pr||0;if(b>this.rowsBuffer.length)b=this.rowsBuffer.length;for(var d=a;d<b;d++)if(!this.rowsCol[d]){var e=this._add_from_buffer(d);if(e==-1){if(this.xmlFileUrl){if(this._dpref&&this.rowsBuffer[b-1]){var f=
this._dpref?this._dpref:b-d,g=Math.max(0,b-this._dpref);this._current_load=[g,b-g]}else this._current_load=[d,this._dpref?this._dpref:b-d];this.callEvent("onDynXLS",this._current_load)&&this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+this._current_load[0]+"&count="+this._current_load[1],this._data_type)}return}else if(this._tgle&&(this._updateLine(this._h2.get[this.rowsBuffer[d].idd],this.rowsBuffer[d]),this._updateParentLine(this._h2.get[this.rowsBuffer[d].idd],this.rowsBuffer[d])),
d&&d==(this._realfake?this._fake:this)._r_select)this.selectCell(d,this.cell?this.cell._cellIndex:0,!0)}if(this._fake&&!this._realfake&&this.multiLine)this._fake.objBox.scrollTop=this.objBox.scrollTop};
dhtmlXGridObject.prototype._add_from_buffer=function(a){var b=this.render_row(a);if(b==-1)return-1;if(b._attrs.selected||b._attrs.select)this.selectRow(b,!1,!0),b._attrs.selected=b._attrs.select=null;if(this._cssSP){if(this._h2){var c=this._h2.get[b.idd];b.className+=" "+(c.level%2?this._cssUnEven+" "+this._cssUnEven:this._cssEven+" "+this._cssEven)+"_"+c.level+(this.rowsAr[c.id]._css||"")}}else if(this._cssEven&&a%2==0)b.className=this._cssEven+(b.className.indexOf("rowselected")!=-1?" rowselected ":
" ")+(b._css||"");else if(this._cssUnEven&&a%2==1)b.className=this._cssUnEven+(b.className.indexOf("rowselected")!=-1?" rowselected ":" ")+(b._css||"");for(var d=0;d<this._fillers.length;d++){var e=this._fillers[d];if(e&&e[0]<=a&&e[0]+e[1]>a){var f=a-e[0];f==0?(this._insert_before(a,b,e[2]),this._update_fillers(d,-1,1)):f==e[1]-1?(this._insert_after(a,b,e[2]),this._update_fillers(d,-1,0)):(this._fillers.push(this._add_filler(a+1,e[1]-f-1,e[2],1)),this._insert_after(a,b,e[2]),this._update_fillers(d,
-e[1]+f,0));break}}};dhtmlXGridObject.prototype._update_fillers=function(a,b,c){var d=this._fillers[a];d[1]+=b;d[0]+=c;d[1]?(d[2].firstChild.style.height=parseFloat(d[2].firstChild.style.height)+b*this._srdh+"px",this.callEvent("onUpdateFiller",[d[2]])):(this.callEvent("onRemoveFiller",[d[2]]),d[2].parentNode.removeChild(d[2]),this._fillers.splice(a,1))};
dhtmlXGridObject.prototype._insert_before=function(a,b,c){c.parentNode.insertBefore(b,c);this.rowsCol[a]=b;this.callEvent("onRowInserted",[b,null,c,"before"])};dhtmlXGridObject.prototype._insert_after=function(a,b,c){c.nextSibling?c.parentNode.insertBefore(b,c.nextSibling):c.parentNode.appendChild(b);this.rowsCol[a]=b;this.callEvent("onRowInserted",[b,null,c,"after"])};
function dhtmlXGridFromTable(a,b){typeof a!="object"&&(a=document.getElementById(a));var c=document.createElement("DIV");c.setAttribute("width",a.getAttribute("gridWidth")||(a.offsetWidth?a.offsetWidth+"px":0)||(window.getComputedStyle?window.getComputedStyle(a,null).width:a.currentStyle?a.currentStyle.width:0));c.setAttribute("height",a.getAttribute("gridHeight")||(a.offsetHeight?a.offsetHeight+"px":0)||(window.getComputedStyle?window.getComputedStyle(a,null).height:a.currentStyle?a.currentStyle.height:
0));c.className=a.className;a.className="";if(a.id)c.id=a.id;var d=a,e=a.getAttribute("dragAndDrop");d.parentNode.insertBefore(c,d);var f=d.getAttribute("name")||"name_"+(new Date).valueOf(),g=new dhtmlXGridObject(c);window[f]=g;var h=d.getAttribute("onbeforeinit"),i=d.getAttribute("oninit");h&&eval(h);g.setImagePath(g.imgURL||d.getAttribute("imgpath")||d.getAttribute("image_path")||"");var j=d.getAttribute("skin");j&&g.setSkin(j);b&&b(g);for(var k=d.rows[0],m="",l="",n="",o="",p="",r=0;r<k.cells.length;r++){m+=
(m?",":"")+k.cells[r].innerHTML;var q=k.cells[r].getAttribute("width")||k.cells[r].offsetWidth||(window.getComputedStyle?window.getComputedStyle(k.cells[r],null).width:k.cells[r].currentStyle?k.cells[r].currentStyle.width:0);l+=(l?",":"")+(q=="*"?q:parseInt(q));n+=(n?",":"")+(k.cells[r].getAttribute("align")||"left");o+=(o?",":"")+(k.cells[r].getAttribute("type")||"ed");p+=(p?",":"")+(k.cells[r].getAttribute("sort")||"str");var s=k.cells[r].getAttribute("format");if(s)k.cells[r].getAttribute("type").toLowerCase().indexOf("calendar")!=
-1?g._dtmask=s:g.setNumberFormat(s,r)}g.setHeader(m);g.setInitWidths(l);g.setColAlign(n);g.setColTypes(o);g.setColSorting(p);a.getAttribute("gridHeight")=="auto"&&g.enableAutoHeigth(!0);a.getAttribute("multiline")&&g.enableMultiline(!0);var w=d.getAttribute("lightnavigation");w&&g.enableLightMouseNavigation(w);var t=d.getAttribute("evenrow"),v=d.getAttribute("unevenrow");(t||v)&&g.enableAlterCss(t,v);e&&g.enableDragAndDrop(!0);g.init();a.getAttribute("split")&&g.splitAt(a.getAttribute("split"));g._process_inner_html(d,
1);i&&eval(i);a.parentNode&&a.parentNode.removeChild&&a.parentNode.removeChild(a);return g}dhtmlXGridObject.prototype._process_html=function(a){if(a.tagName&&a.tagName=="TABLE")return this._process_inner_html(a,0);var b=document.createElement("DIV");b.innerHTML=a.xmlDoc.responseText;var c=b.getElementsByTagName("TABLE")[0];this._process_inner_html(c,0)};
dhtmlXGridObject.prototype._process_inner_html=function(a,b){for(var c=a.rows.length,d=b;d<c;d++){var e=a.rows[d].getAttribute("id")||d;this.rowsBuffer.push({idd:e,data:a.rows[d],_parser:this._process_html_row,_locator:this._get_html_data})}this.render_dataset();this.setSizes()};
dhtmlXGridObject.prototype._process_html_row=function(a,b){var c=b.getElementsByTagName("TD"),d=[];a._attrs=this._xml_attrs(b);for(var e=0;e<c.length;e++){var f=c[e],g=f.getAttribute("type");if(a.childNodes[e]){if(g)a.childNodes[e]._cellType=g;a.childNodes[e]._attrs=this._xml_attrs(c[e])}f.firstChild?d.push(f.innerHTML):d.push("");if(f.colSpan>1){a.childNodes[e]._attrs.colspan=f.colSpan;for(var h=1;h<f.colSpan;h++)d.push("")}}for(;e<a.childNodes.length;e++)a.childNodes[e]._attrs={};this._fillRow(a,
this._c_order?this._swapColumns(d):d);return a};dhtmlXGridObject.prototype._get_html_data=function(a,b){for(a=a.firstChild;;){if(!a)return"";a.tagName=="TD"&&b--;if(b<0)break;a=a.nextSibling}return a.firstChild?a.firstChild.data:""};dhtmlxEvent(window,"load",function(){for(var a=document.getElementsByTagName("table"),b=0;b<a.length;b++)a[b].className=="dhtmlxGrid"&&dhtmlXGridFromTable(a[b])});
function eXcell_sub_row(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.getValue=function(){return this.grid.getUserData(this.cell.parentNode.idd,"sub_row")};this._setState=function(a,c){(c||this.cell).innerHTML="<img src='"+this.grid.imgURL+a+"' width='18' height='18' />";(c||this.cell).firstChild.onclick=this.grid._expandMonolite};this.open=function(){this.cell.firstChild.onclick(null,!0)};this.close=function(){this.cell.firstChild.onclick(null,!1,!0)};this.setValue=function(a){a&&
this.grid.setUserData(this.cell.parentNode.idd,"sub_row",a);this._setState(a?"plus.gif":"blanc.gif")};this.setContent=function(a){this.cell.parentNode._expanded?(this.cell.parentNode._expanded.innerHTML=a,this.grid._detectHeight(this.cell.parentNode._expanded,this.cell,this.cell.parentNode._expanded.scrollHeight)):(this.cell._previous_content=null,this.setValue(a),this.cell._sub_row_type=null)};this.isDisabled=function(){return!0};this.getTitle=function(){return this.grid.getUserData(this.cell.parentNode.idd,
"sub_row")?"click to expand|collapse":""}}eXcell_sub_row.prototype=new eXcell;function eXcell_sub_row_ajax(a){this.base=eXcell_sub_row;this.base(a);this.setValue=function(a){a&&this.grid.setUserData(this.cell.parentNode.idd,"sub_row",a);this.cell._sub_row_type="ajax";this._setState(a?"plus.gif":"blanc.gif")}}eXcell_sub_row_ajax.prototype=new eXcell_sub_row;
function eXcell_sub_row_grid(a){this.base=eXcell_sub_row;this.base(a);this.setValue=function(a){a&&this.grid.setUserData(this.cell.parentNode.idd,"sub_row",a);this.cell._sub_row_type="grid";this._setState(a?"plus.gif":"blanc.gif")};this.getSubGrid=function(){return!a._sub_grid?null:a._sub_grid}}eXcell_sub_row_grid.prototype=new eXcell_sub_row;
dhtmlXGridObject.prototype._expandMonolite=function(a,b,c){var d=this.parentNode,e=d.parentNode,f=e.grid,g=f.getUserData(e.idd,"sub_row");if(!f._sub_row_editor)f._sub_row_editor=new eXcell_sub_row(d);if(g){if(e._expanded&&!b){f._sub_row_editor._setState("plus.gif",d);d._previous_content=e._expanded;f.objBox.removeChild(e._expanded);e._expanded=!1;e.style.height=(e.oldHeight||20)+"px";d.style.height=(e.oldHeight||20)+"px";if(f._fake)f._fake.rowsAr[e.idd].style.height=(e.oldHeight||20)+"px";for(var h=
0;h<e.cells.length;h++)e.cells[h].style.verticalAlign="middle",e.cells[h].style.paddingTop="0px";delete f._flow[e.idd];f._correctMonolite();e._expanded.ctrl=null}else if(!e._expanded&&!c){f._sub_row_editor._setState("minus.gif",d);if(d._previous_content){var i=d._previous_content;i.ctrl=d;f.objBox.appendChild(i);f._detectHeight(i,d,parseInt(i.style.height))}else{i=document.createElement("DIV");e.oldHeight=d.offsetHeight;i.ctrl=d;if(d._sub_row_type)f._sub_row_render[d._sub_row_type](f,i,d,g);else i.innerHTML=
g;i.style.cssText="position:absolute; left:0px; top:0px; overflow:auto; font-family:Tahoma; font-size:8pt; margin-top:2px; margin-left:4px;";i.className="dhx_sub_row";f.objBox.appendChild(i);f._detectHeight(i,d)}if(!f._flow)f.attachEvent("onGridReconstructed",function(){this._correctMonolite()}),f.attachEvent("onResizeEnd",function(){this._correctMonolite(!0)}),f.attachEvent("onAfterCMove",function(){this._correctMonolite(!0)}),f.attachEvent("onDrop",function(){this._correctMonolite(!0)}),f.attachEvent("onBeforePageChanged",
function(){this._collapsMonolite();return!0}),f.attachEvent("onGroupStateChanged",function(){this._correctMonolite();return!0}),f.attachEvent("onFilterEnd",function(){this._collapsMonolite()}),f.attachEvent("onUnGroup",function(){this._collapsMonolite()}),f.attachEvent("onPageChanged",function(){this._collapsMonolite()}),f.attachEvent("onXLE",function(){this._collapsMonolite()}),f.attachEvent("onClearAll",function(){for(var a in this._flow)this._flow[a]&&this._flow[a].parentNode&&this._flow[a].parentNode.removeChild(this._flow[a]);
this._flow=[]}),f.attachEvent("onEditCell",function(a,b,c){a!==2&&this._flow[b]&&this.cellType[c]!="ch"&&this.cellType[c]!="ra"&&this._expandMonolite.apply(this._flow[b].ctrl.firstChild,[0,!1,!0]);return!0}),f.attachEvent("onCellChanged",function(a,b){if(this._flow[a]){var c=this.cells(a,b).cell;c.style.verticalAlign="top";c.style.paddingTop="3px"}}),f._flow=[];f._flow[e.idd]=i;f._correctMonolite();for(h=0;h<e.cells.length;h++)e.cells[h].style.verticalAlign="top",e.cells[h].style.paddingTop="3px";
if(f._fake)for(var j=f._fake.rowsAr[e.idd],h=0;h<j.cells.length;h++)j.cells[h].style.verticalAlign="top",j.cells[h].style.paddingTop="3px";d.style.paddingTop="1px";e._expanded=i}f._ahgr&&f.setSizes();f.parentGrid&&f.callEvent("onGridReconstructed",[]);f.callEvent("onSubRowOpen",[e.idd,!!e._expanded])}};
dhtmlXGridObject.prototype._sub_row_render={ajax:function(a,b,c,d){b.innerHTML="Loading...";var e=new dtmlXMLLoaderObject(function(){b.innerHTML=e.xmlDoc.responseText;var d=e.xmlDoc.responseText.match(/<script[^>]*>([^<]+)<\/script>/g);if(d)for(var g=0;g<d.length;g++)eval(d[g].replace(/<([\/]{0,1})s[^>]*>/g,""));a._detectHeight(b,c);a._correctMonolite();a.setUserData(c.parentNode.idd,"sub_row",e.xmlDoc.responseText);c._sub_row_type=null;a._ahgr&&a.setSizes();a.callEvent("onSubAjaxLoad",[c.parentNode.idd,
e.xmlDoc.responseText])},this,!0,!0);e.loadXML(d)},grid:function(a,b,c,d){c._sub_grid=new dhtmlXGridObject(b);c._sub_grid.parentGrid=a;c._sub_grid.setImagePath(a.imgURL);c._sub_grid.enableAutoHeight(!0);c._sub_grid.attachEvent("onGridReconstructed",function(){a._detectHeight(b,c,c._sub_grid.objBox.scrollHeight+c._sub_grid.hdr.offsetHeight);a._correctMonolite();this.setSizes();a.parentGrid&&a.callEvent("onGridReconstructed",[])});a.callEvent("onSubGridCreated",[c._sub_grid,c.parentNode.idd,c._cellIndex,
d])&&c._sub_grid.loadXML(d,function(){a._detectHeight(b,c,c._sub_grid.objBox.scrollHeight+c._sub_grid.hdr.offsetHeight);c._sub_grid.objBox.style.overflow="hidden";a._correctMonolite();c._sub_row_type=null;a.callEvent("onSubGridLoaded",[c._sub_grid,c.parentNode.idd,c._cellIndex,d])})}};
dhtmlXGridObject.prototype._detectHeight=function(a,b,c){var d=b.offsetLeft+b.offsetWidth;a.style.left=d-25+"px";a.style.width=b.parentNode.offsetWidth-d-4+"px";c=c||a.scrollHeight;a.style.overflow="hidden";a.style.height=c+"px";var e=b.parentNode;b.parentNode.style.height=(e.oldHeight||20)+3+c*1+"px";b.style.height=(e.oldHeight||20)+3+c*1+"px";if(this._fake){var f=this._fake.rowsAr[b.parentNode.idd];f.style.height=(e.oldHeight||20)+3+c*1+"px"}};
dhtmlXGridObject.prototype._correctMonolite=function(a){for(var b in this._flow)if(this._flow[b]&&this._flow[b].tagName=="DIV")if(this.rowsAr[b])if(this.rowsAr[b].style.display=="none")this.cells4(this._flow[b].ctrl).close();else{if(this._flow[b].style.top=this.rowsAr[b].offsetTop+(this.rowsAr[b].oldHeight||20)+25+"px",a){var c=this._flow[b].ctrl.offsetLeft+this._flow[b].ctrl.offsetWidth;this._flow[b].style.left=c+"px";this._flow[b].style.width=this.rowsAr[b].offsetWidth-c-4+"px"}}else this._flow[b].ctrl=
null,this.objBox.removeChild(this._flow[b]),delete this._flow[b]};dhtmlXGridObject.prototype._collapsMonolite=function(){for(var a in this._flow)this._flow[a]&&this._flow[a].tagName=="DIV"&&this.rowsAr[a]&&this.cells4(this._flow[a].ctrl).close()};dhtmlxValidation=function(){};
dhtmlxValidation.prototype={trackInput:function(a,b,c,d){dhtmlxEvent(a,"keyup",function(){if(dhtmlxValidation._timer)window.clearTimeout(dhtmlxValidation._timer),dhtmlxValidation._timer=null;dhtmlxValidation._timer=window.setTimeout(function(){if(dhtmlxValidation.checkInput(a,b))a.className=a.className.replace(/[ ]*dhtmlx_live_validation_error/g,""),d&&d(a,a.value,b);else if(!c||c(a,a.value,b))a.className+=" dhtmlx_live_validation_error"},250)})},checkInput:function(a,b){return this.checkValue(a.value,
b)},checkValue:function(a,b){typeof b=="string"&&(b=b.split(","));for(var c=!0,d=0;d<b.length;d++)this["is"+b[d]]?c=c&&this["is"+b[d]](a):alert("Incorrect validation rule: "+b[d]);return c},isEmpty:function(a){return a==""},isNotEmpty:function(a){return!a==""},isValidBoolean:function(a){return!!a.toString().match(/^(0|1|true|false)$/)},isValidEmail:function(a){return!!a.toString().match(/(^[a-z0-9]([0-9a-z\-_\.]*)@([0-9a-z_\-\.]*)([.][a-z]{3})$)|(^[a-z]([0-9a-z_\.\-]*)@([0-9a-z_\-\.]*)(\.[a-z]{2,4})$)/i)},
isValidInteger:function(a){return!!a.toString().match(/(^-?\d+$)/)},isValidNumeric:function(a){return!!a.toString().match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/)},isValidAplhaNumeric:function(a){return!!a.toString().match(/^[_\-a-z0-9]+$/gi)},isValidDatetime:function(a){var b=a.toString().match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);return b&&!!(b[1]<=9999&&b[2]<=12&&b[3]<=31&&b[4]<=59&&b[5]<=59&&b[6]<=59)||!1},isValidDate:function(a){var b=a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/);
return b&&!!(b[1]<=9999&&b[2]<=12&&b[3]<=31)||!1},isValidTime:function(a){var b=a.toString().match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return b&&!!(b[1]<=24&&b[2]<=59&&b[3]<=59)||!1},isValidIPv4:function(a){var b=a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return b&&!!(b[1]<=255&&b[2]<=255&&b[3]<=255&&b[4]<=255)||!1},isValidCurrency:function(a){return a.toString().match(/^\$?\s?\d+?[\.,\,]?\d+?\s?\$?$/)&&!0||!1},isValidSSN:function(a){return a.toString().match(/^\d{3}\-?\d{2}\-?\d{4}$/)&&
!0||!1},isValidSIN:function(a){return a.toString().match(/^\d{9}$/)&&!0||!1}};dhtmlxValidation=new dhtmlxValidation;dhtmlXGridObject.prototype.enableValidation=function(a,b){this._validators=(a=convertStringToBoolean(a))?{data:[]}:!1;if(arguments.length>1)this._validators._live=b;if(!this._validators._event)this._validators._event=this.attachEvent("onEditCell",this.validationEvent)};
dhtmlXGridObject.prototype.setColValidators=function(a){this._validators||this.enableValidation(!0);typeof a=="string"&&(a=a.split(this.delim));this._validators.data=a};
dhtmlXGridObject.prototype.validationEvent=function(a,b,c,d){var e=this._validators;if(!e)return!0;var f=e.data[c]||this.cells(b,c).getAttribute("validate")||"";if(a==1&&f){var g=this.editor||(this._fake||{}).editor;if(!g)return!0;g.cell.className=g.cell.className.replace(/[ ]*dhtmlx_validation_error/g,"");if(e._live){var h=this;dhtmlxValidation.trackInput(g.getInput(),f,function(a,d,e){return h.callEvent("onLiveValidationError",[b,c,d,a,e])},function(a,d,e){return h.callEvent("onLiveValidationCorrect",
[b,c,d,a,e])})}}a==2&&this.validateCell(b,c,f,d);return!0};
dhtmlXGridObject.prototype.validateCell=function(a,b,c,d){c=c||this._validators.data[b]||this.cells(a,b).getAttribute("validate");d=d||this.cells(a,b).getValue();if(c){var e=this.cells(a,b).cell,f=!0;typeof c=="string"&&(c=c.split(this.delim));for(var g=0;g<c.length;g++)dhtmlxValidation.checkValue(d,c[g])||(this.callEvent("onValidationError",[a,b,d,c[g]])&&(e.className+=" dhtmlx_validation_error"),f=!1);if(f)this.callEvent("onValidationCorrect",[a,b,d,c]),e.className=e.className.replace(/[ ]*dhtmlx_validation_error/g,
"");return f}};function eXcell_dhxCalendar(a){if(a&&(this.cell=a,this.grid=this.cell.parentNode.grid,!this.grid._grid_calendarA)){var b=this.grid._grid_calendarA=new dhtmlxCalendarObject;this.grid.callEvent("onDhxCalendarCreated",[b]);var c=this.grid;b.attachEvent("onClick",function(){this._last_operation_calendar=!0;window.setTimeout(function(){c.editStop()},1);return!0});var d=function(a){(a||event).cancelBubble=!0};dhtmlxEvent(b.base,"click",d);b=null}}eXcell_dhxCalendar.prototype=new eXcell;
eXcell_dhxCalendar.prototype.edit=function(){var a=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(!1,!1);this.grid._grid_calendarA.setPosition(a[0],a[1]+this.cell.offsetHeight);this.grid._grid_calendarA._last_operation_calendar=!1;this.grid.callEvent("onCalendarShow",[this.grid._grid_calendarA,this.cell.parentNode.idd,this.cell._cellIndex]);this.cell._cediton=!0;this.val=this.cell.val;this._val=this.cell.innerHTML;var b=this.grid._grid_calendarA.draw;this.grid._grid_calendarA.draw=
function(){};this.grid._grid_calendarA.setDateFormat(this.grid._dtmask||"%d/%m/%Y");this.grid._grid_calendarA.setDate(this.val||new Date);this.grid._grid_calendarA.draw=b};eXcell_dhxCalendar.prototype.getDate=function(){return this.cell.val?this.cell.val:null};eXcell_dhxCalendar.prototype.getValue=function(){return this.cell._clearCell?"":this.grid._dtmask_inc&&this.cell.val?this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc,this.cell.val).toString():this.cell.innerHTML.toString()._dhx_trim()};
eXcell_dhxCalendar.prototype.detach=function(){if(this.grid._grid_calendarA&&(this.grid._grid_calendarA.hide(),this.cell._cediton)){this.cell._cediton=!1;if(this.grid._grid_calendarA._last_operation_calendar){var a=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y"),b=this.grid._grid_calendarA.getDate();this.cell.val=new Date(b);this.setCValue(a,b);this.cell._clearCell=!a;var c=this.val;this.val=this._val;return this.cell.val.valueOf()!=c}return!1}};
eXcell_dhxCalendar.prototype.setValue=function(a){a&&typeof a=="object"?(this.cell.val=a,this.cell._clearCell=!1,this.setCValue(this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y",a).toString(),this.cell.val)):(!a||a.toString()._dhx_trim()==""?(a="&nbsp",this.cell._clearCell=!0,this.cell.val=""):(this.cell._clearCell=!1,this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate(this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y",a.toString(),null,!0)),this.grid._dtmask_inc&&
(a=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y",this.cell.val))),this.cell.val=="NaN"||this.cell.val=="Invalid Date"?(this.cell._clearCell=!0,this.cell.val=new Date,this.setCValue("&nbsp;",0)):this.setCValue((a||"").toString(),this.cell.val))};
function eXcell_dhxCalendarA(a){if(a&&(this.cell=a,this.grid=this.cell.parentNode.grid,!this.grid._grid_calendarA)){var b=this.grid._grid_calendarA=new dhtmlxCalendarObject;this.grid.callEvent("onDhxCalendarCreated",[b]);var c=this.grid;b.attachEvent("onClick",function(){this._last_operation_calendar=!0;window.setTimeout(function(){c.editStop()},1);return!0});var d=function(a){(a||event).cancelBubble=!0};dhtmlxEvent(b.base,"click",d)}}eXcell_dhxCalendarA.prototype=new eXcell;
eXcell_dhxCalendarA.prototype.edit=function(){var a=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(!1,!1);this.grid._grid_calendarA.setPosition(a[0]*1+this.cell.offsetWidth,a[1]*1);this.grid.callEvent("onCalendarShow",[this.grid._grid_calendarA,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid._grid_calendarA._last_operation_calendar=!1;this.cell._cediton=!0;this.val=this.cell.val;this._val=this.cell.innerHTML;var b=this.grid._grid_calendarA.draw;this.grid._grid_calendarA.draw=
function(){};this.grid._grid_calendarA.setDateFormat(this.grid._dtmask||"%d/%m/%Y");this.grid._grid_calendarA.setDate(this.val);this.grid._grid_calendarA.draw=b;this.grid._grid_calendarA.draw();this.cell.atag=!this.grid.multiLine&&(_isKHTML||_isMacOS||_isFF)?"INPUT":"TEXTAREA";this.obj=document.createElement(this.cell.atag);this.obj.style.height=this.cell.offsetHeight-(_isIE?4:2)+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=
function(a){(a||event).cancelBubble=!0};this.obj.onmousedown=function(a){(a||event).cancelBubble=!0};this.obj.value=this.getValue();this.cell.innerHTML="";this.cell.appendChild(this.obj);if(_isFF&&(this.obj.style.overflow="visible",this.grid.multiLine&&this.obj.offsetHeight>=18&&this.obj.offsetHeight<40))this.obj.style.height="36px",this.obj.style.overflow="scroll";this.obj.onselectstart=function(a){a||(a=event);return a.cancelBubble=!0};this.obj.focus();this.obj.focus()};
eXcell_dhxCalendarA.prototype.getDate=function(){return this.cell.val?this.cell.val:null};eXcell_dhxCalendarA.prototype.getValue=function(){return this.cell._clearCell?"":this.grid._dtmask_inc&&this.cell.val?this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc,this.cell.val).toString():this.cell.innerHTML.toString()._dhx_trim()};
eXcell_dhxCalendarA.prototype.detach=function(){if(this.grid._grid_calendarA&&(this.grid._grid_calendarA.hide(),this.cell._cediton)){this.cell._cediton=!1;if(this.grid._grid_calendarA._last_operation_calendar){this.grid._grid_calendarA._last_operation_calendar=!1;var a=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y"),b=this.grid._grid_calendarA.getDate();this.cell.val=new Date(b);this.setCValue(a,b);this.cell._clearCell=!a;var c=this.val;this.val=this._val;return this.cell.val.valueOf()!=
(c|0).valueOf()}this.setValue(this.obj.value);c=this.val;this.val=this._val;return this.cell.val.valueOf()!=(c||"").valueOf()}};
eXcell_dhxCalendarA.prototype.setValue=function(a){a&&typeof a=="object"?(this.cell.val=a,this.cell._clearCell=!1,this.setCValue(this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y",a).toString(),this.cell.val)):(!a||a.toString()._dhx_trim()==""?(a="&nbsp",this.cell._clearCell=!0,this.cell.val=""):(this.cell._clearCell=!1,this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate(this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y",a.toString(),null,!0)),this.grid._dtmask_inc&&
(a=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y",this.cell.val))),this.cell.val=="NaN"||this.cell.val=="Invalid Date"?(this.cell.val=new Date,this.cell._clearCell=!0,this.setCValue("&nbsp;",0)):this.setCValue((a||"").toString(),this.cell.val))};
function eXcell_cntr(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._ex_cntr_ready&&!this._realfake)this.grid._ex_cntr_ready=!0,this.grid._h2&&this.grid.attachEvent("onOpenEn",function(){this.resetCounter(a._cellIndex)}),this.grid.attachEvent("onBeforeSorting",function(){var b=this;window.setTimeout(function(){b.resetCounter&&(b._fake&&!b._realfake&&a._cellIndex<b._fake._cCount?b._fake.resetCounter(a._cellIndex):b.resetCounter(a._cellIndex))},1);return!0});this.edit=function(){};
this.getValue=function(){return this.cell.innerHTML};this.setValue=function(){this.cell.style.paddingRight="2px";var a=this.cell;window.setTimeout(function(){if(a.parentNode){var c=a.parentNode.rowIndex;if(a.parentNode.grid.currentPage||c<0||a.parentNode.grid._srnd)c=a.parentNode.grid.rowsBuffer._dhx_find(a.parentNode)+1;if(!(c<=0))a.innerHTML=c,a.parentNode.grid._fake&&a._cellIndex<a.parentNode.grid._fake._cCount&&a.parentNode.grid._fake.rowsAr[a.parentNode.idd]&&a.parentNode.grid._fake.cells(a.parentNode.idd,
a._cellIndex).setCValue(c),a=null}},100)}}dhtmlXGridObject.prototype.resetCounter=function(a){this._fake&&!this._realfake&&a<this._fake._cCount&&this._fake.resetCounter(a,this.currentPage);var b=a||0;this.currentPage&&(b=(this.currentPage-1)*this.rowsBufferOutSize);for(b=0;b<this.rowsBuffer.length;b++)if(this.rowsBuffer[b]&&this.rowsBuffer[b].tagName=="TR"&&this.rowsAr[this.rowsBuffer[b].idd])this.rowsAr[this.rowsBuffer[b].idd].childNodes[a].innerHTML=b+1};eXcell_cntr.prototype=new eXcell;
function eXcell_link(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.isDisabled=function(){return!0};this.edit=function(){};this.getValue=function(){if(this.cell.firstChild.getAttribute){var a=this.cell.firstChild.getAttribute("target");return this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href")+(a?"^"+a:"")}else return""};this.setValue=function(a){if(typeof a!="number"&&(!a||a.toString()._dhx_trim()==""))return this.setCValue("&nbsp;",c),this.cell._clearCell=!0;var c=
a.split("^");c.length==1?c[1]="":c.length>1&&(c[1]="href='"+c[1]+"'",c[1]+=c.length==3?" target='"+c[2]+"'":" target='_blank'");this.setCValue("<a "+c[1]+" onclick='(_isIE?event:arguments[0]).cancelBubble = true;'>"+c[0]+"</a>",c)}}eXcell_link.prototype=new eXcell;eXcell_link.prototype.getTitle=function(){var a=this.cell.firstChild;return a&&a.tagName?a.getAttribute("href"):""};eXcell_link.prototype.getContent=function(){var a=this.cell.firstChild;return a&&a.tagName?a.innerHTML:""};
function xmlPointer(a){this.d=a}
xmlPointer.prototype={text:function(){if(!_isFF)return this.d.xml;var a=new XMLSerializer;return a.serializeToString(this.d)},get:function(a){return this.d.getAttribute(a)},exists:function(){return!!this.d},content:function(){return this.d.firstChild?this.d.firstChild.data:""},each:function(a,b,c,d){var e=this.d.childNodes,f=new xmlPointer;if(e.length)for(d=d||0;d<e.length;d++)if(e[d].tagName==a&&(f.d=e[d],b.apply(c,[f,d])==-1))break},get_all:function(){for(var a={},b=this.d.attributes,c=0;c<b.length;c++)a[b[c].name]=
b[c].value;return a},sub:function(a){var b=this.d.childNodes,c=new xmlPointer;if(b.length)for(var d=0;d<b.length;d++)if(b[d].tagName==a)return c.d=b[d],c},up:function(){return new xmlPointer(this.d.parentNode)},set:function(a,b){this.d.setAttribute(a,b)},clone:function(){return new xmlPointer(this.d)},sub_exists:function(a){var b=this.d.childNodes;if(b.length)for(var c=0;c<b.length;c++)if(b[c].tagName==a)return!0;return!1},through:function(a,b,c,d,e){var f=this.d.childNodes;if(f.length)for(var g=
0;g<f.length;g++){if(f[g].tagName==a&&f[g].getAttribute(b)!=null&&f[g].getAttribute(b)!=""&&(!c||f[g].getAttribute(b)==c)){var h=new xmlPointer(f[g]);d.apply(e,[h,g])}var i=this.d;this.d=f[g];this.through(a,b,c,d,e);this.d=i}}};
function dhtmlXTreeObject(a,b,c,d){if(_isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e){}this.parentObject=typeof a!="object"?document.getElementById(a):a;this.parentObject.style.overflow="hidden";this._itim_dg=!0;this.dlmtr=",";this.dropLower=!1;this.enableIEImageFix();this.xmlstate=0;this.mytype="tree";this.smcheck=!0;this.width=b;this.height=c;this.rootId=d;this.childCalc=null;this.def_line_img_y=this.def_line_img_x=this.def_img_y=this.def_img_x="18px";this._dragged=[];this._selected=
[];this.style_pointer="pointer";this._aimgs=!0;this.htmlcA=" [";this.htmlcB="]";this.lWin=window;this.mlitems=this.cMenu=0;this.iconURL="";this.dadmode=0;this.slowParse=!1;this.autoScroll=!0;this.hfMode=0;this.nodeCut=[];this.XMLloadingWarning=this.XMLsource=0;this._idpull={};this._pullSize=0;this.treeLinesOn=!0;this.tscheck=!1;this.timgen=!0;this.dpcpy=!1;this._ld_id=null;this._oie_onXLE=[];this.imPath=window.dhx_globalImgPath||"";this.checkArray="iconUncheckAll.gif,iconCheckAll.gif,iconCheckGray.gif,iconUncheckDis.gif,iconCheckDis.gif,iconCheckDis.gif".split(",");
this.radioArray="radio_off.gif,radio_on.gif,radio_on.gif,radio_off.gif,radio_on.gif,radio_on.gif".split(",");this.lineArray="line2.gif,line3.gif,line4.gif,blank.gif,blank.gif,line1.gif".split(",");this.minusArray=["minus2.gif","minus3.gif","minus4.gif","minus.gif","minus5.gif"];this.plusArray=["plus2.gif","plus3.gif","plus4.gif","plus.gif","plus5.gif"];this.imageArray=["leaf.gif","folderOpen.gif","folderClosed.gif"];this.cutImg=[0,0,0];this.cutImage="but_cut.gif";dhtmlxEventable(this);this.dragger=
new dhtmlDragAndDropObject;this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this);this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none";this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow";this.allTree=this._createSelf();this.allTree.appendChild(this.htmlNode.htmlNode);if(_isFF)this.allTree.childNodes[0].width="100%",this.allTree.childNodes[0].style.overflow="hidden";var f=this;this.allTree.onselectstart=new Function("return false;");if(_isMacOS)this.allTree.oncontextmenu=
function(a){return f._doContClick(a||window.event,!0)};this.allTree.onmousedown=function(a){return f._doContClick(a||window.event)};this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,!0,this.no_cashe);_isIE&&this.preventIECashing(!0);window.addEventListener&&window.addEventListener("unload",function(){try{f.destructor()}catch(a){}},!1);window.attachEvent&&window.attachEvent("onunload",function(){try{f.destructor()}catch(a){}});this.setImagesPath=this.setImagePath;this.setIconsPath=this.setIconPath;
dhtmlx.image_path&&this.setImagePath(dhtmlx.image_path);dhtmlx.skin&&this.setSkin(dhtmlx.skin);return this}dhtmlXTreeObject.prototype.setDataMode=function(a){this._datamode=a};
dhtmlXTreeObject.prototype._doContClick=function(a,b){if(!b&&a.button!=2)return this._acMenu&&(this._acMenu.hideContextMenu?this._acMenu.hideContextMenu():this.cMenu._contextEnd()),!0;for(var c=_isIE?a.srcElement:a.target;c&&c.tagName!="BODY";){if(c.parentObject)break;c=c.parentNode}if(!c||!c.parentObject)return!0;var d=c.parentObject;if(!this.callEvent("onRightClick",[d.id,a]))(a.srcElement||a.target).oncontextmenu=function(a){(a||event).cancelBubble=!0;return!1};if(this._acMenu=d.cMenu||this.cMenu){if(!this.callEvent("onBeforeContextMenu",
[d.id]))return!0;(a.srcElement||a.target).oncontextmenu=function(a){(a||event).cancelBubble=!0;return!1};if(this._acMenu.showContextMenu){var e=window.document.documentElement,f=window.document.body,g=[e.scrollLeft||f.scrollLeft,e.scrollTop||f.scrollTop];if(_isIE)var h=a.clientX+g[0],i=a.clientY+g[1];else h=a.pageX,i=a.pageY;this._acMenu.showContextMenu(h-1,i-1);this.contextID=d.id;a.cancelBubble=!0;this._acMenu._skip_hide=!0}else c.contextMenuId=d.id,c.contextMenu=this._acMenu,c.a=this._acMenu._contextStart,
c.a(c,a),c.a=null;return!1}return!0};
dhtmlXTreeObject.prototype.enableIEImageFix=function(a){a?(this._getImg=function(){var a=document.createElement("DIV");a.innerHTML="&nbsp;";a.className="dhx_bg_img_fix";return a},this._setSrc=function(a,c){a.style.backgroundImage="url("+c+")"},this._getSrc=function(a){var c=a.style.backgroundImage;return c.substr(4,c.length-5).replace(/(^")|("$)/g,"")}):(this._getImg=function(a){return document.createElement(a==this.rootId?"div":"img")},this._setSrc=function(a,c){a.src=c},this._getSrc=function(a){return a.src})};
dhtmlXTreeObject.prototype.destructor=function(){for(var a in this._idpull){var b=this._idpull[a];if(b)b.parentObject=null,b.treeNod=null,b.childNodes=null,b.span=null,b.tr.nodem=null,b.tr=null,b.htmlNode.objBelong=null,b.htmlNode=null,this._idpull[a]=null}this.parentObject.innerHTML="";this.XMLLoader&&this.XMLLoader.destructor();this.allTree.onselectstart=null;this.allTree.oncontextmenu=null;this.allTree.onmousedown=null;for(a in this)this[a]=null};function cObject(){return this}
cObject.prototype={};cObject.prototype.clone=function(){function a(){}a.prototype=this;return new a};
function dhtmlXTreeItemObject(a,b,c,d,e,f){this.scolor=this.acolor=this.htmlNode="";this.span=this.dragMove=this.dragSpan=this.tempDOMU=this.tempDOMM=this.childsCount=this.tr=0;this.closeble=1;this.childNodes=[];this.userData=new cObject;this.checkstate=0;this.treeNod=d;this.label=b;this.parentObject=c;this.actionHandler=e;this.images=[d.imageArray[0],d.imageArray[1],d.imageArray[2]];this.id=d._globalIdStorageAdd(a,this);this.htmlNode=this.treeNod.checkBoxOff?this.treeNod._createItem(1,this,f):this.treeNod._createItem(0,
this,f);this.htmlNode.objBelong=this;return this}dhtmlXTreeObject.prototype._globalIdStorageAdd=function(a,b){if(this._globalIdStorageFind(a,1,1))return a=a+"_"+(new Date).valueOf(),this._globalIdStorageAdd(a,b);this._idpull[a]=b;this._pullSize++;return a};dhtmlXTreeObject.prototype._globalIdStorageSub=function(a){this._idpull[a]&&(this._unselectItem(this._idpull[a]),this._idpull[a]=null,this._pullSize--);this._locker&&this._locker[a]&&(this._locker[a]=!1)};
dhtmlXTreeObject.prototype._globalIdStorageFind=function(a){var b=this._idpull[a];return b?b:null};dhtmlXTreeObject.prototype._escape=function(a){switch(this.utfesc){case "none":return a;case "utf8":return encodeURIComponent(a);default:return escape(a)}};
dhtmlXTreeObject.prototype._drawNewTr=function(a){var b=document.createElement("tr"),c=document.createElement("td"),d=document.createElement("td");c.appendChild(document.createTextNode(" "));d.colSpan=3;d.appendChild(a);b.appendChild(c);b.appendChild(d);return b};dhtmlXTreeObject.prototype.loadXMLString=function(a,b){var c=this;this.parsCount||this.callEvent("onXLS",[c,null]);this.xmlstate=1;if(b)this.XMLLoader.waitCall=b;this.XMLLoader.loadXMLString(a)};
dhtmlXTreeObject.prototype.loadXML=function(a,b){if(this._datamode&&this._datamode!="xml")return this["load"+this._datamode.toUpperCase()](a,b);var c=this;this.parsCount||this.callEvent("onXLS",[c,this._ld_id]);this._ld_id=null;this.xmlstate=1;this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,!0,this.no_cashe);if(b)this.XMLLoader.waitCall=b;this.XMLLoader.loadXML(a)};
dhtmlXTreeObject.prototype._attachChildNode=function(a,b,c,d,e,f,g,h,i,j,k){if(j&&j.parentObject)a=j.parentObject;if(a.XMLload==0&&this.XMLsource&&!this.XMLloadingWarning)a.XMLload=1,this._loadDynXML(a.id);var m=a.childsCount,l=a.childNodes;if(k&&k.tr.previousSibling)k.tr.previousSibling.previousSibling?j=k.tr.previousSibling.nodem:h=h.replace("TOP","")+",TOP";if(j){var n,o;for(n=0;n<m;n++)if(l[n]==j){for(o=m;o!=n;o--)l[1+o]=l[o];break}n++;m=n}if(h)for(var p=h.split(","),r=0;r<p.length;r++)switch(p[r]){case "TOP":if(a.childsCount>
0)j={},j.tr=a.childNodes[0].tr.previousSibling;a._has_top=!0;for(n=m;n>0;n--)l[n]=l[n-1];m=0}var q;if(!(q=this._idpull[b])||q.span!=-1)q=l[m]=new dhtmlXTreeItemObject(b,c,a,this,d,1),b=l[m].id,a.childsCount++;if(!q.htmlNode)q.label=c,q.htmlNode=this._createItem(this.checkBoxOff?1:0,q),q.htmlNode.objBelong=q;e&&(q.images[0]=e);f&&(q.images[1]=f);g&&(q.images[2]=g);var s=this._drawNewTr(q.htmlNode);if(this.XMLloadingWarning||this._hAdI)q.htmlNode.parentNode.parentNode.style.display="none";j&&j.tr&&
j.tr.nextSibling?a.htmlNode.childNodes[0].insertBefore(s,j.tr.nextSibling):this.parsingOn==a.id?this.parsedArray[this.parsedArray.length]=s:a.htmlNode.childNodes[0].appendChild(s);j&&!j.span&&(j=null);if(this.XMLsource)q.XMLload=i&&i!=0?0:1;q.tr=s;s.nodem=q;if(a.itemId==0)s.childNodes[0].className="hiddenRow";(a._r_logic||this._frbtr)&&this._setSrc(q.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0]);if(h){p=h.split(",");for(r=0;r<p.length;r++)switch(p[r]){case "SELECT":this.selectItem(b,
!1);break;case "CALL":this.selectItem(b,!0);break;case "CHILD":q.XMLload=0;break;case "CHECKED":this.XMLloadingWarning?this.setCheckList+=this.dlmtr+b:this.setCheck(b,1);break;case "HCHECKED":this._setCheck(q,"unsure");break;case "OPEN":q.openMe=1}}if(!this.XMLloadingWarning&&(this._getOpenState(a)<0&&!this._hAdI&&this.openItem(a.id),j&&(this._correctPlus(j),this._correctLine(j)),this._correctPlus(a),this._correctLine(a),this._correctPlus(q),a.childsCount>=2&&(this._correctPlus(l[a.childsCount-2]),
this._correctLine(l[a.childsCount-2])),a.childsCount!=2&&this._correctPlus(l[0]),this.tscheck&&this._correctCheckStates(a),this._onradh))if(this.xmlstate==1){var w=this.onXLE;this.onXLE=function(a){this._onradh(b);w&&w(a)}}else this._onradh(b);return q};dhtmlXTreeObject.prototype.insertNewItem=function(a,b,c,d,e,f,g,h,i){var j=this._globalIdStorageFind(a);if(!j)return-1;var k=this._attachChildNode(j,b,c,d,e,f,g,h,i);if(!this._idpull[this.rootId].XMLload)this._idpull[this.rootId].XMLload=1;return k};
dhtmlXTreeObject.prototype.insertNewChild=function(a,b,c,d,e,f,g,h,i){return this.insertNewItem(a,b,c,d,e,f,g,h,i)};dhtmlXTreeObject.prototype._parseXMLTree=function(a,b,c,d,e){var f=new xmlPointer(e.getXMLTopNode("tree"));a._parse(f);a._p=f};
dhtmlXTreeObject.prototype._parseItem=function(a,b,c,d){var e;if(this._srnd&&(!this._idpull[e=a.get("id")]||!this._idpull[e].span))this._addItemSRND(b.id,e,a);else{var f=a.get_all();if(typeof this.waitUpdateXML=="object"&&!this.waitUpdateXML[f.id])this._parse(a,f.id,1);else{var g=[];f.select&&g.push("SELECT");f.top&&g.push("TOP");if(f.call)this.nodeAskingCall=f.id;f.checked==-1?g.push("HCHECKED"):f.checked&&g.push("CHECKED");f.open&&g.push("OPEN");if(this.waitUpdateXML)if(this._globalIdStorageFind(f.id))var h=
this.updateItem(f.id,f.text,f.im0,f.im1,f.im2,f.checked,f.child);else this.npl==0?g.push("TOP"):c=b.childNodes[this.npl],h=this._attachChildNode(b,f.id,f.text,0,f.im0,f.im1,f.im2,g.join(","),f.child,0,c),f.id=h.id,c=null;else h=this._attachChildNode(b,f.id,f.text,0,f.im0,f.im1,f.im2,g.join(","),f.child,d||0,c);if(f.tooltip)h.span.parentNode.parentNode.title=f.tooltip;f.style&&(h.span.style.cssText?h.span.style.cssText+=";"+f.style:h.span.setAttribute("style",h.span.getAttribute("style")+"; "+f.style));
if(f.radio)h._r_logic=!0;if(f.nocheckbox){var i=h.span.parentNode.previousSibling.previousSibling;i.childNodes[0].style.display="none";if(window._KHTMLrv)i.style.display="none";h.nocheckbox=!0}f.disabled&&(f.checked!=null&&this._setCheck(h,f.checked),this.disableCheckbox(h,1));h._acc=f.child||0;this.parserExtension&&this.parserExtension._parseExtension.call(this,a,f,b?b.id:0);this.setItemColor(h,f.aCol,f.sCol);f.locked=="1"&&this.lockItem(h.id,!0,!0);(f.imwidth||f.imheight)&&this.setIconSize(f.imwidth,
f.imheight,h);(f.closeable=="0"||f.closeable=="1")&&this.setItemCloseable(h,f.closeable);var j="";f.topoffset&&this.setItemTopOffset(h,f.topoffset);if(!this.slowParse||typeof this.waitUpdateXML=="object")a.sub_exists("item")&&(j=this._parse(a,f.id,1));if(j!="")this.nodeAskingCall=j;a.each("userdata",function(b){this.setUserData(a.get("id"),b.get("name"),b.content())},this)}}};
dhtmlXTreeObject.prototype._parse=function(a,b,c,d){if(this._srnd&&!this.parentObject.offsetHeight){var e=this;return window.setTimeout(function(){e._parse(a,b,c,d)},100)}if(a.exists()){this.skipLock=!0;if(!b){var b=a.get("id"),f=a.get("dhx_security");if(f)dhtmlx.security_key=f;if(a.get("radio"))this.htmlNode._r_logic=!0;this.parsingOn=b;this.parsedArray=[];this.nodeAskingCall=this.setCheckList=""}var g=this._globalIdStorageFind(b);if(!g)return dhtmlxError.throwError("DataStructure","XML refers to not existing parent");
this.parsCount=this.parsCount?this.parsCount+1:1;this.XMLloadingWarning=1;var h=g.childsCount&&!d&&!this._edsbps&&!g._has_top?0:0;this.npl=0;a.each("item",function(a){g.XMLload=1;this._parseItem(a,g,0,h);this.npl++},this,d);if(!c){a.each("userdata",function(b){this.setUserData(a.get("id"),b.get("name"),b.content())},this);g.XMLload=1;if(this.waitUpdateXML){this.waitUpdateXML=!1;for(var i=g.childsCount-1;i>=0;i--)g.childNodes[i]._dmark&&this.deleteItem(g.childNodes[i].id)}for(var j=this._globalIdStorageFind(this.parsingOn),
i=0;i<this.parsedArray.length;i++)g.htmlNode.childNodes[0].appendChild(this.parsedArray[i]);this.parsedArray=[];this.lastLoadedXMLId=b;this.XMLloadingWarning=0;for(var k=this.setCheckList.split(this.dlmtr),m=0;m<k.length;m++)k[m]&&this.setCheck(k[m],1);this.XMLsource&&this.tscheck&&this.smcheck&&g.id!=this.rootId&&(g.checkstate===0?this._setSubChecked(0,g):g.checkstate===1&&this._setSubChecked(1,g));this._redrawFrom(this,null,d);a.get("order")&&a.get("order")!="none"&&this._reorderBranch(g,a.get("order"),
!0);this.nodeAskingCall!=""&&this.callEvent("onClick",[this.nodeAskingCall,this.getSelectedItemId()]);this._branchUpdate&&this._branchUpdateNext(a)}if(this.parsCount==1){this.parsingOn=null;if(!this._edsbps||!this._edsbpsA.length){var l=this;window.setTimeout(function(){l.callEvent("onXLE",[l,b])},1);this.xmlstate=0}this.skipLock=!1}this.parsCount--;if(!c&&this.onXLE)this.onXLE(this,b);return this.nodeAskingCall}};
dhtmlXTreeObject.prototype._branchUpdateNext=function(a){a.each("item",function(a){var c=a.get("id");if(!this._idpull[c]||this._idpull[c].XMLload)this._branchUpdate++,this.smartRefreshItem(a.get("id"),a)},this);this._branchUpdate--};dhtmlXTreeObject.prototype.checkUserData=function(a,b){if(a.nodeType==1&&a.tagName=="userdata"){var c=a.getAttribute("name");c&&a.childNodes[0]&&this.setUserData(b,c,a.childNodes[0].data)}};
dhtmlXTreeObject.prototype._redrawFrom=function(a,b,c,d){if(b)e=b;else{var e=a._globalIdStorageFind(a.lastLoadedXMLId);a.lastLoadedXMLId=-1;if(!e)return 0}for(var f=0,g=c?c-1:0;g<e.childsCount;g++){if(!this._branchUpdate||this._getOpenState(e)==1)if(!b||d==1)e.childNodes[g].htmlNode.parentNode.parentNode.style.display="";if(e.childNodes[g].openMe==1)this._openItem(e.childNodes[g]),e.childNodes[g].openMe=0;a._redrawFrom(a,e.childNodes[g])}if(!e.unParsed&&(e.XMLload||!this.XMLsource))e._acc=f;a._correctLine(e);
a._correctPlus(e)};dhtmlXTreeObject.prototype._createSelf=function(){var a=document.createElement("div");a.className="containerTableStyle";a.style.width=this.width;a.style.height=this.height;this.parentObject.appendChild(a);return a};
dhtmlXTreeObject.prototype._xcloseAll=function(a){if(!a.unParsed){if(this.rootId!=a.id){if(!a.htmlNode)return;for(var b=a.htmlNode.childNodes[0].childNodes,c=b.length,d=1;d<c;d++)b[d].style.display="none";this._correctPlus(a)}for(d=0;d<a.childsCount;d++)a.childNodes[d].childsCount&&this._xcloseAll(a.childNodes[d])}};dhtmlXTreeObject.prototype._xopenAll=function(a){this._HideShow(a,2);for(var b=0;b<a.childsCount;b++)this._xopenAll(a.childNodes[b])};
dhtmlXTreeObject.prototype._correctPlus=function(a){if(a.htmlNode){var b=a.htmlNode.childNodes[0].childNodes[0].childNodes[0].lastChild,c=a.htmlNode.childNodes[0].childNodes[0].childNodes[2].childNodes[0],d=this.lineArray;if(this.XMLsource&&!a.XMLload){if(d=this.plusArray,this._setSrc(c,this.iconURL+a.images[2]),this._txtimg)return b.innerHTML="[+]"}else if(a.childsCount||a.unParsed)if(a.htmlNode.childNodes[0].childNodes[1]&&a.htmlNode.childNodes[0].childNodes[1].style.display!="none"){if(!a.wsign)d=
this.minusArray;this._setSrc(c,this.iconURL+a.images[1]);if(this._txtimg)return b.innerHTML="[-]"}else{if(!a.wsign)d=this.plusArray;this._setSrc(c,this.iconURL+a.images[2]);if(this._txtimg)return b.innerHTML="[+]"}else this._setSrc(c,this.iconURL+a.images[0]);var e=2;a.treeNod.treeLinesOn?(a.parentObject&&(e=this._getCountStatus(a.id,a.parentObject)),this._setSrc(b,this.imPath+d[e])):this._setSrc(b,this.imPath+d[3])}};
dhtmlXTreeObject.prototype._correctLine=function(a){if(a.htmlNode){var b=a.parentObject;if(b)if(this._getLineStatus(a.id,b)==0||!this.treeLinesOn)for(var c=1;c<=a.childsCount;c++){if(!a.htmlNode.childNodes[0].childNodes[c])break;a.htmlNode.childNodes[0].childNodes[c].childNodes[0].style.backgroundImage="";a.htmlNode.childNodes[0].childNodes[c].childNodes[0].style.backgroundRepeat=""}else for(c=1;c<=a.childsCount;c++){if(!a.htmlNode.childNodes[0].childNodes[c])break;a.htmlNode.childNodes[0].childNodes[c].childNodes[0].style.backgroundImage=
"url("+this.imPath+this.lineArray[5]+")";a.htmlNode.childNodes[0].childNodes[c].childNodes[0].style.backgroundRepeat="repeat-y"}}};dhtmlXTreeObject.prototype._getCountStatus=function(a,b){return b.childsCount<=1?b.id==this.rootId?4:0:b.childNodes[0].id==a?b.id==this.rootId?2:1:b.childNodes[b.childsCount-1].id==a?0:1};dhtmlXTreeObject.prototype._getLineStatus=function(a,b){return b.childNodes[b.childsCount-1].id==a?0:1};
dhtmlXTreeObject.prototype._HideShow=function(a,b){if(this.XMLsource&&!a.XMLload){if(b!=1)a.XMLload=1,this._loadDynXML(a.id)}else{var c=a.htmlNode.childNodes[0].childNodes,d=c.length;if(d>1){(c[1].style.display!="none"||b==1)&&b!=2?(this.allTree.childNodes[0].border="1",this.allTree.childNodes[0].border="0",nodestyle="none"):nodestyle="";for(var e=1;e<d;e++)c[e].style.display=nodestyle}this._correctPlus(a)}};
dhtmlXTreeObject.prototype._getOpenState=function(a){if(!a.htmlNode)return 0;var b=a.htmlNode.childNodes[0].childNodes;return b.length<=1?0:b[1].style.display!="none"?1:-1};
dhtmlXTreeObject.prototype.onRowClick2=function(){var a=this.parentObject.treeNod;if(!a.callEvent("onDblClick",[this.parentObject.id,a]))return!1;this.parentObject.closeble&&this.parentObject.closeble!="0"?a._HideShow(this.parentObject):a._HideShow(this.parentObject,2);if(a.checkEvent("onOpenEnd"))a.xmlstate?(a._oie_onXLE.push(a.onXLE),a.onXLE=a._epnFHe):a.callEvent("onOpenEnd",[this.parentObject.id,a._getOpenState(this.parentObject)]);return!1};
dhtmlXTreeObject.prototype.onRowClick=function(){var a=this.parentObject.treeNod;if(!a.callEvent("onOpenStart",[this.parentObject.id,a._getOpenState(this.parentObject)]))return 0;this.parentObject.closeble&&this.parentObject.closeble!="0"?a._HideShow(this.parentObject):a._HideShow(this.parentObject,2);if(a.checkEvent("onOpenEnd"))a.xmlstate?(a._oie_onXLE.push(a.onXLE),a.onXLE=a._epnFHe):a.callEvent("onOpenEnd",[this.parentObject.id,a._getOpenState(this.parentObject)])};
dhtmlXTreeObject.prototype._epnFHe=function(a,b,c){b!=this.rootId&&this.callEvent("onOpenEnd",[b,a.getOpenState(b)]);a.onXLE=a._oie_onXLE.pop();if(!c&&!a._oie_onXLE.length&&a.onXLE)a.onXLE(a,b)};dhtmlXTreeObject.prototype.onRowClickDown=function(a){var a=a||window.event,b=this.parentObject.treeNod;b._selectItem(this.parentObject,a)};dhtmlXTreeObject.prototype.getSelectedItemId=function(){for(var a=[],b=0;b<this._selected.length;b++)a[b]=this._selected[b].id;return a.join(this.dlmtr)};
dhtmlXTreeObject.prototype._selectItem=function(a){if(this.checkEvent("onSelect"))this._onSSCFold=this.getSelectedItemId();this._unselectItems();this._markItem(a);if(this.checkEvent("onSelect")){var b=this.getSelectedItemId();b!=this._onSSCFold&&this.callEvent("onSelect",[b])}};dhtmlXTreeObject.prototype._markItem=function(a){if(a.scolor)a.span.style.color=a.scolor;a.span.className="selectedTreeRow";a.i_sel=!0;this._selected[this._selected.length]=a};
dhtmlXTreeObject.prototype.getIndexById=function(a){var b=this._globalIdStorageFind(a);return!b?null:this._getIndex(b)};dhtmlXTreeObject.prototype._getIndex=function(a){for(var b=a.parentObject,c=0;c<b.childsCount;c++)if(b.childNodes[c]==a)return c};dhtmlXTreeObject.prototype._unselectItem=function(a){if(a&&a.i_sel){a.span.className="standartTreeRow";if(a.acolor)a.span.style.color=a.acolor;a.i_sel=!1;for(var b=0;b<this._selected.length;b++)if(!this._selected[b].i_sel){this._selected.splice(b,1);break}}};
dhtmlXTreeObject.prototype._unselectItems=function(){for(var a=0;a<this._selected.length;a++){var b=this._selected[a];b.span.className="standartTreeRow";if(b.acolor)b.span.style.color=b.acolor;b.i_sel=!1}this._selected=[]};dhtmlXTreeObject.prototype.onRowSelect=function(a,b,c){var a=a||window.event,d=this.parentObject;if(b)d=b.parentObject;var e=d.treeNod,f=e.getSelectedItemId();(!a||!a.skipUnSel)&&e._selectItem(d,a);c||(d.actionHandler?d.actionHandler(d.id,f):e.callEvent("onClick",[d.id,f]))};
dhtmlXTreeObject.prototype._correctCheckStates=function(a){if(this.tscheck&&a&&a.id!=this.rootId){var b=a.childNodes,c=0,d=0;if(a.childsCount!=0){for(var e=0;e<a.childsCount;e++)if(!b[e].dscheck)if(b[e].checkstate==0)c=1;else if(b[e].checkstate==1)d=1;else{d=c=1;break}c&&d?this._setCheck(a,"unsure"):c?this._setCheck(a,!1):this._setCheck(a,!0);this._correctCheckStates(a.parentObject)}}};
dhtmlXTreeObject.prototype.onCheckBoxClick=function(){if(this.treeNod.callEvent("onBeforeCheck",[this.parentObject.id,this.parentObject.checkstate])){if(this.parentObject.dscheck)return!0;this.treeNod.tscheck?this.parentObject.checkstate==1?this.treeNod._setSubChecked(!1,this.parentObject):this.treeNod._setSubChecked(!0,this.parentObject):this.parentObject.checkstate==1?this.treeNod._setCheck(this.parentObject,!1):this.treeNod._setCheck(this.parentObject,!0);this.treeNod._correctCheckStates(this.parentObject.parentObject);
return this.treeNod.callEvent("onCheck",[this.parentObject.id,this.parentObject.checkstate])}};
dhtmlXTreeObject.prototype._createItem=function(a,b,c){var d=document.createElement("table");d.cellSpacing=0;d.cellPadding=0;d.border=0;if(this.hfMode)d.style.tableLayout="fixed";d.style.margin=0;d.style.padding=0;var e=document.createElement("tbody"),f=document.createElement("tr"),g=document.createElement("td");g.className="standartTreeImage";if(this._txtimg){var h=document.createElement("div");g.appendChild(h);h.className="dhx_tree_textSign"}else{h=this._getImg(b.id);h.border="0";if(h.tagName==
"IMG")h.align="absmiddle";g.appendChild(h);h.style.padding=0;h.style.margin=0;h.style.width=this.def_line_img_x;h.style.height=this.def_line_img_y}var i=document.createElement("td"),j=this._getImg(this.cBROf?this.rootId:b.id);j.checked=0;this._setSrc(j,this.imPath+this.checkArray[0]);j.style.width="16px";j.style.height="16px";if(!a)(!_isIE?i:j).style.display="none";i.appendChild(j);if(!this.cBROf&&j.tagName=="IMG")j.align="absmiddle";j.onclick=this.onCheckBoxClick;j.treeNod=this;j.parentObject=b;
i.width=window._KHTMLrv?"16px":"20px";var k=document.createElement("td");k.className="standartTreeImage";var m=this._getImg(this.timgen?b.id:this.rootId);m.onmousedown=this._preventNsDrag;m.ondragstart=this._preventNsDrag;m.border="0";if(this._aimgs){m.parentObject=b;if(m.tagName=="IMG")m.align="absmiddle";m.onclick=this.onRowSelect}c||this._setSrc(m,this.iconURL+this.imageArray[0]);k.appendChild(m);m.style.padding=0;m.style.margin=0;if(this.timgen)k.style.width=m.style.width=this.def_img_x,m.style.height=
this.def_img_y;else if(m.style.width="0px",m.style.height="0px",_isOpera||window._KHTMLrv)k.style.display="none";var l=document.createElement("td");l.className="standartTreeRow";b.span=document.createElement("span");b.span.className="standartTreeRow";this.mlitems?(b.span.style.width=this.mlitems,b.span.style.display="block"):l.noWrap=!0;if(_isIE&&_isIE>7)l.style.width="999999px";else if(!window._KHTMLrv)l.style.width="100%";b.span.innerHTML=b.label;l.appendChild(b.span);l.parentObject=b;g.parentObject=
b;l.onclick=this.onRowSelect;g.onclick=this.onRowClick;l.ondblclick=this.onRowClick2;if(this.ettip)f.title=b.label;if(this.dragAndDropOff){if(this._aimgs)this.dragger.addDraggableItem(k,this),k.parentObject=b;this.dragger.addDraggableItem(l,this)}b.span.style.paddingLeft="5px";b.span.style.paddingRight="5px";l.style.verticalAlign="";l.style.fontSize="10pt";l.style.cursor=this.style_pointer;f.appendChild(g);f.appendChild(i);f.appendChild(k);f.appendChild(l);e.appendChild(f);d.appendChild(e);if(this.ehlt||
this.checkEvent("onMouseIn")||this.checkEvent("onMouseOut"))f.onmousemove=this._itemMouseIn,f[_isIE?"onmouseleave":"onmouseout"]=this._itemMouseOut;return d};dhtmlXTreeObject.prototype.setImagePath=function(a){this.iconURL=this.imPath=a};dhtmlXTreeObject.prototype.setIconPath=function(a){this.iconURL=a};dhtmlXTreeObject.prototype.setOnRightClickHandler=function(a){this.attachEvent("onRightClick",a)};dhtmlXTreeObject.prototype.setOnClickHandler=function(a){this.attachEvent("onClick",a)};
dhtmlXTreeObject.prototype.setOnSelectStateChange=function(a){this.attachEvent("onSelect",a)};dhtmlXTreeObject.prototype.setXMLAutoLoading=function(a){this.XMLsource=a};dhtmlXTreeObject.prototype.setOnCheckHandler=function(a){this.attachEvent("onCheck",a)};dhtmlXTreeObject.prototype.setOnOpenHandler=function(a){this.attachEvent("onOpenStart",a)};dhtmlXTreeObject.prototype.setOnOpenStartHandler=function(a){this.attachEvent("onOpenStart",a)};
dhtmlXTreeObject.prototype.setOnOpenEndHandler=function(a){this.attachEvent("onOpenEnd",a)};dhtmlXTreeObject.prototype.setOnDblClickHandler=function(a){this.attachEvent("onDblClick",a)};dhtmlXTreeObject.prototype.openAllItems=function(a){var b=this._globalIdStorageFind(a);if(!b)return 0;this._xopenAll(b)};dhtmlXTreeObject.prototype.getOpenState=function(a){var b=this._globalIdStorageFind(a);return!b?"":this._getOpenState(b)};
dhtmlXTreeObject.prototype.closeAllItems=function(a){if(a===window.undefined)a=this.rootId;var b=this._globalIdStorageFind(a);if(!b)return 0;this._xcloseAll(b);this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"};
dhtmlXTreeObject.prototype.setUserData=function(a,b,c){var d=this._globalIdStorageFind(a,0,!0);if(d){if(b=="hint")d.htmlNode.childNodes[0].childNodes[0].title=c;if(typeof d.userData["t_"+b]=="undefined")d._userdatalist?d._userdatalist+=","+b:d._userdatalist=b;d.userData["t_"+b]=c}};dhtmlXTreeObject.prototype.getUserData=function(a,b){var c=this._globalIdStorageFind(a,0,!0);return!c?void 0:c.userData["t_"+b]};
dhtmlXTreeObject.prototype.getItemColor=function(a){var b=this._globalIdStorageFind(a);if(!b)return 0;var c={};if(b.acolor)c.acolor=b.acolor;if(b.scolor)c.scolor=b.scolor;return c};dhtmlXTreeObject.prototype.setItemColor=function(a,b,c){var d=a&&a.span?a:this._globalIdStorageFind(a);if(d){if(d.i_sel){if(c)d.span.style.color=c}else if(b)d.span.style.color=b;if(c)d.scolor=c;if(b)d.acolor=b}else return 0};
dhtmlXTreeObject.prototype.getItemText=function(a){var b=this._globalIdStorageFind(a);return!b?0:b.htmlNode.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML};dhtmlXTreeObject.prototype.getParentId=function(a){var b=this._globalIdStorageFind(a);return!b||!b.parentObject?"":b.parentObject.id};dhtmlXTreeObject.prototype.changeItemId=function(a,b){if(a!=b){var c=this._globalIdStorageFind(a);if(!c)return 0;c.id=b;c.span.contextMenuId=b;this._idpull[b]=this._idpull[a];delete this._idpull[a]}};
dhtmlXTreeObject.prototype.doCut=function(){this.nodeCut&&this.clearCut();this.nodeCut=[].concat(this._selected);for(var a=0;a<this.nodeCut.length;a++){var b=this.nodeCut[a];b._cimgs=[];b._cimgs[0]=b.images[0];b._cimgs[1]=b.images[1];b._cimgs[2]=b.images[2];b.images[0]=b.images[1]=b.images[2]=this.cutImage;this._correctPlus(b)}};
dhtmlXTreeObject.prototype.doPaste=function(a){var b=this._globalIdStorageFind(a);if(!b)return 0;for(var c=0;c<this.nodeCut.length;c++)this._checkPNodes(b,this.nodeCut[c])||this._moveNode(this.nodeCut[c],b);this.clearCut()};dhtmlXTreeObject.prototype.clearCut=function(){for(var a=0;a<this.nodeCut.length;a++){var b=this.nodeCut[a];b.images[0]=b._cimgs[0];b.images[1]=b._cimgs[1];b.images[2]=b._cimgs[2];this._correctPlus(b)}this.nodeCut=[]};
dhtmlXTreeObject.prototype._moveNode=function(a,b){return this._moveNodeTo(a,b)};dhtmlXTreeObject.prototype._fixNodesCollection=function(a,b){var c=0,d=0,e=a.childNodes,f=a.childsCount-1;if(b!=e[f]){for(var g=0;g<f;g++)e[g]==e[f]&&(e[g]=e[g+1],e[g+1]=e[f]);for(g=0;g<f+1;g++)if(c){var h=e[g];e[g]=c;c=h}else e[g]==b&&(c=e[g],e[g]=e[f])}};
dhtmlXTreeObject.prototype._recreateBranch=function(a,b,c){var d,e="";if(c){for(d=0;d<b.childsCount;d++)if(b.childNodes[d]==c)break;d!=0?c=b.childNodes[d-1]:(e="TOP",c="")}var f=this._onradh;this._onradh=null;var g=this._attachChildNode(b,a.id,a.label,0,a.images[0],a.images[1],a.images[2],e,0,c);g._userdatalist=a._userdatalist;g.userData=a.userData.clone();if(a._attrs){g._attrs={};for(var h in a._attrs)g._attrs[h]=a._attrs[h]}g.XMLload=a.XMLload;if(f)this._onradh=f,this._onradh(g.id);for(d=0;d<a.childsCount;d++)this._recreateBranch(a.childNodes[d],
g,0,1);return g};
dhtmlXTreeObject.prototype._moveNodeTo=function(a,b,c){if(a.treeNod._nonTrivialNode)return a.treeNod._nonTrivialNode(this,b,c,a);if(this._checkPNodes(b,a))return!1;var d=b.mytype?a.treeNod.lWin!=b.lWin:a.treeNod.lWin!=b.treeNod.lWin;if(!this.callEvent("onDrag",[a.id,b.id,c?c.id:null,a.treeNod,b.treeNod]))return!1;if(b.XMLload==0&&this.XMLsource)b.XMLload=1,this._loadDynXML(b.id);this.openItem(b.id);var e=a.treeNod,f=a.parentObject.childsCount,g=a.parentObject;if(d||e.dpcpy){var h=a.id,a=this._recreateBranch(a,
b,c);e.dpcpy||e.deleteItem(h)}else{var i=b.childsCount,j=b.childNodes;if(i==0)b._open=!0;e._unselectItem(a);j[i]=a;a.treeNod=b.treeNod;b.childsCount++;var k=this._drawNewTr(j[i].htmlNode);c?(b.htmlNode.childNodes[0].insertBefore(k,c.tr),this._fixNodesCollection(b,c),j=b.childNodes):(b.htmlNode.childNodes[0].appendChild(k),this.dadmode==1&&this._fixNodesCollection(b,c))}if(!e.dpcpy&&!d){var m=a.tr;document.all&&navigator.appVersion.search(/MSIE\ 5\.0/gi)!=-1?window.setTimeout(function(){m.parentNode.removeChild(m)},
250):a.parentObject.htmlNode.childNodes[0].removeChild(a.tr);if(!c||b!=a.parentObject)for(var l=0;l<g.childsCount;l++){if(g.childNodes[l].id==a.id){g.childNodes[l]=0;break}}else g.childNodes[g.childsCount-1]=0;e._compressChildList(g.childsCount,g.childNodes);g.childsCount--}if(!d&&!e.dpcpy){a.tr=k;k.nodem=a;a.parentObject=b;if(e!=b.treeNod){if(a.treeNod._registerBranch(a,e))return;this._clearStyles(a);this._redrawFrom(this,a.parentObject);this._onradh&&this._onradh(a.id)}this._correctPlus(b);this._correctLine(b);
this._correctLine(a);this._correctPlus(a);c?this._correctPlus(c):b.childsCount>=2&&(this._correctPlus(j[b.childsCount-2]),this._correctLine(j[b.childsCount-2]));this._correctPlus(j[b.childsCount-1]);this.tscheck&&this._correctCheckStates(b);e.tscheck&&e._correctCheckStates(g)}f>1&&(e._correctPlus(g.childNodes[f-2]),e._correctLine(g.childNodes[f-2]));e._correctPlus(g);e._correctLine(g);this.callEvent("onDrop",[a.id,b.id,c?c.id:null,e,b.treeNod]);return a.id};
dhtmlXTreeObject.prototype._clearStyles=function(a){if(a.htmlNode){var b=a.htmlNode.childNodes[0].childNodes[0].childNodes[1],c=b.nextSibling.nextSibling;a.span.innerHTML=a.label;a.i_sel=!1;a._aimgs&&this.dragger.removeDraggableItem(b.nextSibling);this.checkBoxOff?(b.childNodes[0].style.display="",b.childNodes[0].onclick=this.onCheckBoxClick,this._setSrc(b.childNodes[0],this.imPath+this.checkArray[a.checkstate])):b.childNodes[0].style.display="none";b.childNodes[0].treeNod=this;this.dragger.removeDraggableItem(c);
this.dragAndDropOff&&this.dragger.addDraggableItem(c,this);this._aimgs&&this.dragger.addDraggableItem(b.nextSibling,this);c.childNodes[0].className="standartTreeRow";c.onclick=this.onRowSelect;c.ondblclick=this.onRowClick2;b.previousSibling.onclick=this.onRowClick;this._correctLine(a);this._correctPlus(a);for(var d=0;d<a.childsCount;d++)this._clearStyles(a.childNodes[d])}};
dhtmlXTreeObject.prototype._registerBranch=function(a,b){b&&b._globalIdStorageSub(a.id);a.id=this._globalIdStorageAdd(a.id,a);a.treeNod=this;for(var c=0;c<a.childsCount;c++)this._registerBranch(a.childNodes[c],b);return 0};dhtmlXTreeObject.prototype.enableThreeStateCheckboxes=function(a){this.tscheck=convertStringToBoolean(a)};dhtmlXTreeObject.prototype.setOnMouseInHandler=function(a){this.ehlt=!0;this.attachEvent("onMouseIn",a)};
dhtmlXTreeObject.prototype.setOnMouseOutHandler=function(a){this.ehlt=!0;this.attachEvent("onMouseOut",a)};dhtmlXTreeObject.prototype.enableTreeImages=function(a){this.timgen=convertStringToBoolean(a)};dhtmlXTreeObject.prototype.enableFixedMode=function(a){this.hfMode=convertStringToBoolean(a)};dhtmlXTreeObject.prototype.enableCheckBoxes=function(a,b){this.checkBoxOff=convertStringToBoolean(a);this.cBROf=!(this.checkBoxOff||convertStringToBoolean(b))};
dhtmlXTreeObject.prototype.setStdImages=function(a,b,c){this.imageArray[0]=a;this.imageArray[1]=b;this.imageArray[2]=c};dhtmlXTreeObject.prototype.enableTreeLines=function(a){this.treeLinesOn=convertStringToBoolean(a)};
dhtmlXTreeObject.prototype.setImageArrays=function(a,b,c,d,e,f){switch(a){case "plus":this.plusArray[0]=b;this.plusArray[1]=c;this.plusArray[2]=d;this.plusArray[3]=e;this.plusArray[4]=f;break;case "minus":this.minusArray[0]=b,this.minusArray[1]=c,this.minusArray[2]=d,this.minusArray[3]=e,this.minusArray[4]=f}};dhtmlXTreeObject.prototype.openItem=function(a){var b=this._globalIdStorageFind(a);return b?this._openItem(b):0};
dhtmlXTreeObject.prototype._openItem=function(a){var b=this._getOpenState(a);if(b<0||this.XMLsource&&!a.XMLload){if(!this.callEvent("onOpenStart",[a.id,b]))return 0;this._HideShow(a,2);if(this.checkEvent("onOpenEnd"))this.onXLE==this._epnFHe&&this._epnFHe(this,a.id,!0),!this.xmlstate||!this.XMLsource?this.callEvent("onOpenEnd",[a.id,this._getOpenState(a)]):(this._oie_onXLE.push(this.onXLE),this.onXLE=this._epnFHe)}else this._srnd&&this._HideShow(a,2);a.parentObject&&!this._skip_open_parent&&this._openItem(a.parentObject)};
dhtmlXTreeObject.prototype.closeItem=function(a){if(this.rootId==a)return 0;var b=this._globalIdStorageFind(a);if(!b)return 0;b.closeble&&this._HideShow(b,1)};dhtmlXTreeObject.prototype.getLevel=function(a){var b=this._globalIdStorageFind(a);return!b?0:this._getNodeLevel(b,0)};dhtmlXTreeObject.prototype.setItemCloseable=function(a,b){var b=convertStringToBoolean(b),c=a&&a.span?a:this._globalIdStorageFind(a);if(!c)return 0;c.closeble=b};
dhtmlXTreeObject.prototype._getNodeLevel=function(a,b){return a.parentObject?this._getNodeLevel(a.parentObject,b+1):b};dhtmlXTreeObject.prototype.hasChildren=function(a){var b=this._globalIdStorageFind(a);return b?this.XMLsource&&!b.XMLload?!0:b.childsCount:0};dhtmlXTreeObject.prototype._getLeafCount=function(a){for(var b=0,c=0;c<a.childsCount;c++)a.childNodes[c].childsCount==0&&b++;return b};
dhtmlXTreeObject.prototype.setItemText=function(a,b,c){var d=this._globalIdStorageFind(a);if(!d)return 0;d.label=b;d.span.innerHTML=b;d.span.parentNode.parentNode.title=c||""};dhtmlXTreeObject.prototype.getItemTooltip=function(a){var b=this._globalIdStorageFind(a);return!b?"":b.span.parentNode.parentNode._dhx_title||b.span.parentNode.parentNode.title||""};dhtmlXTreeObject.prototype.refreshItem=function(a){if(!a)a=this.rootId;var b=this._globalIdStorageFind(a);this.deleteChildItems(a);this._loadDynXML(a)};
dhtmlXTreeObject.prototype.setItemImage2=function(a,b,c,d){var e=this._globalIdStorageFind(a);if(!e)return 0;e.images[1]=c;e.images[2]=d;e.images[0]=b;this._correctPlus(e)};dhtmlXTreeObject.prototype.setItemImage=function(a,b,c){var d=this._globalIdStorageFind(a);if(!d)return 0;c?(d.images[1]=b,d.images[2]=c):d.images[0]=b;this._correctPlus(d)};
dhtmlXTreeObject.prototype.getSubItems=function(a){var b=this._globalIdStorageFind(a,0,1);if(!b)return 0;var c="";for(i=0;i<b.childsCount;i++)c?c+=this.dlmtr+b.childNodes[i].id:c=b.childNodes[i].id;return c};
dhtmlXTreeObject.prototype._getAllScraggyItems=function(a){for(var b="",c=0;c<a.childsCount;c++)if(a.childNodes[c].unParsed||a.childNodes[c].childsCount>0){var d=a.childNodes[c].unParsed?this._getAllScraggyItemsXML(a.childNodes[c].unParsed,1):this._getAllScraggyItems(a.childNodes[c]);d&&(b?b+=this.dlmtr+d:b=d)}else b?b+=this.dlmtr+a.childNodes[c].id:b=a.childNodes[c].id;return b};
dhtmlXTreeObject.prototype._getAllFatItems=function(a){for(var b="",c=0;c<a.childsCount;c++)if(a.childNodes[c].unParsed||a.childNodes[c].childsCount>0){b?b+=this.dlmtr+a.childNodes[c].id:b=a.childNodes[c].id;var d=a.childNodes[c].unParsed?this._getAllFatItemsXML(a.childNodes[c].unParsed,1):this._getAllFatItems(a.childNodes[c]);d&&(b+=this.dlmtr+d)}return b};
dhtmlXTreeObject.prototype._getAllSubItems=function(a,b,c){var d=c?c:this._globalIdStorageFind(a);if(!d)return 0;for(var b="",e=0;e<d.childsCount;e++){b?b+=this.dlmtr+d.childNodes[e].id:b=d.childNodes[e].id;var f=this._getAllSubItems(0,b,d.childNodes[e]);f&&(b+=this.dlmtr+f)}return b};
dhtmlXTreeObject.prototype.selectItem=function(a,b,c){var b=convertStringToBoolean(b),d=this._globalIdStorageFind(a);if(!d||!d.parentObject)return 0;this.XMLloadingWarning?d.parentObject.openMe=1:this._openItem(d.parentObject);var e=null;if(c&&(e={ctrlKey:!0},d.i_sel))e.skipUnSel=!0;if(b)this.onRowSelect(e,d.htmlNode.childNodes[0].childNodes[0].childNodes[3],!1);else this.onRowSelect(e,d.htmlNode.childNodes[0].childNodes[0].childNodes[3],!0)};
dhtmlXTreeObject.prototype.getSelectedItemText=function(){for(var a=[],b=0;b<this._selected.length;b++)a[b]=this._selected[b].span.innerHTML;return a.join(this.dlmtr)};dhtmlXTreeObject.prototype._compressChildList=function(a,b){a--;for(var c=0;c<a;c++)b[c]==0&&(b[c]=b[c+1],b[c+1]=0)};
dhtmlXTreeObject.prototype._deleteNode=function(a,b,c){if(!b||!b.parentObject)return 0;var d=0,e=0;if(b.tr.nextSibling)d=b.tr.nextSibling.nodem;if(b.tr.previousSibling)e=b.tr.previousSibling.nodem;for(var f=b.parentObject,g=f.childsCount,h=f.childNodes,i=0;i<g;i++)if(h[i].id==a){c||f.htmlNode.childNodes[0].removeChild(h[i].tr);h[i]=0;break}this._compressChildList(g,h);c||f.childsCount--;d&&(this._correctPlus(d),this._correctLine(d));e&&(this._correctPlus(e),this._correctLine(e));this.tscheck&&this._correctCheckStates(f);
c||this._globalIdStorageRecSub(b)};dhtmlXTreeObject.prototype.setCheck=function(a,b){var c=this._globalIdStorageFind(a,0,1);c&&(b==="unsure"?this._setCheck(c,b):(b=convertStringToBoolean(b),this.tscheck&&this.smcheck?this._setSubChecked(b,c):this._setCheck(c,b)),this.smcheck&&this._correctCheckStates(c.parentObject))};
dhtmlXTreeObject.prototype._setCheck=function(a,b){if(a){if((a.parentObject._r_logic||this._frbtr)&&b)if(this._frbtrs)this._frbtrL&&this.setCheck(this._frbtrL.id,0),this._frbtrL=a;else for(var c=0;c<a.parentObject.childsCount;c++)this._setCheck(a.parentObject.childNodes[c],0);var d=a.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];a.checkstate=b=="unsure"?2:b?1:0;if(a.dscheck)a.checkstate=a.dscheck;this._setSrc(d,this.imPath+(a.parentObject._r_logic||this._frbtr?this.radioArray:this.checkArray)[a.checkstate])}};
dhtmlXTreeObject.prototype.setSubChecked=function(a,b){var c=this._globalIdStorageFind(a);this._setSubChecked(b,c);this._correctCheckStates(c.parentObject)};
dhtmlXTreeObject.prototype._setSubChecked=function(a,b){a=convertStringToBoolean(a);if(b){if((b.parentObject._r_logic||this._frbtr)&&a)for(var c=0;c<b.parentObject.childsCount;c++)this._setSubChecked(0,b.parentObject.childNodes[c]);if(b._r_logic||this._frbtr)this._setSubChecked(a,b.childNodes[0]);else for(c=0;c<b.childsCount;c++)this._setSubChecked(a,b.childNodes[c]);var d=b.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];b.checkstate=a?1:0;if(b.dscheck)b.checkstate=b.dscheck;this._setSrc(d,
this.imPath+(b.parentObject._r_logic||this._frbtr?this.radioArray:this.checkArray)[b.checkstate])}};dhtmlXTreeObject.prototype.isItemChecked=function(a){var b=this._globalIdStorageFind(a);return!b?void 0:b.checkstate};dhtmlXTreeObject.prototype.deleteChildItems=function(a){var b=this._globalIdStorageFind(a);if(b)for(var c=b.childsCount,d=0;d<c;d++)this._deleteNode(b.childNodes[0].id,b.childNodes[0])};
dhtmlXTreeObject.prototype.deleteItem=function(a,b){if(!this._onrdlh||this._onrdlh(a))var c=this._deleteItem(a,b);this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"};
dhtmlXTreeObject.prototype._deleteItem=function(a,b,c){var b=convertStringToBoolean(b),d=this._globalIdStorageFind(a);if(d){var e=this.getParentId(a),f=d.parentObject;this._deleteNode(a,d,c);if(this._editCell&&this._editCell.id==a)this._editCell=null;this._correctPlus(f);this._correctLine(f);b&&e!=this.rootId&&this.selectItem(e,1);return f}};
dhtmlXTreeObject.prototype._globalIdStorageRecSub=function(a){for(var b=0;b<a.childsCount;b++)this._globalIdStorageRecSub(a.childNodes[b]),this._globalIdStorageSub(a.childNodes[b].id);this._globalIdStorageSub(a.id);var c=a;c.span=null;c.tr.nodem=null;c.tr=null;c.htmlNode=null};dhtmlXTreeObject.prototype.insertNewNext=function(a,b,c,d,e,f,g,h,i){var j=this._globalIdStorageFind(a);if(!j||!j.parentObject)return 0;var k=this._attachChildNode(0,b,c,d,e,f,g,h,i,j);return k};
dhtmlXTreeObject.prototype.getItemIdByIndex=function(a,b){var c=this._globalIdStorageFind(a);return!c||b>=c.childsCount?null:c.childNodes[b].id};dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(a,b){var c=this._globalIdStorageFind(a);return!c||b>=c.childsCount?null:c.childNodes[b].id};dhtmlXTreeObject.prototype.setDragHandler=function(a){this.attachEvent("onDrag",a)};
dhtmlXTreeObject.prototype._clearMove=function(){if(this._lastMark)this._lastMark.className=this._lastMark.className.replace(/dragAndDropRow/g,""),this._lastMark=null;this.allTree.className=this.allTree.className.replace(" selectionBox","")};
dhtmlXTreeObject.prototype.enableDragAndDrop=function(a,b){a=="temporary_disabled"?(this.dADTempOff=!1,a=!0):this.dADTempOff=!0;(this.dragAndDropOff=convertStringToBoolean(a))&&this.dragger.addDragLanding(this.allTree,this);if(arguments.length>1)this._ddronr=!convertStringToBoolean(b)};
dhtmlXTreeObject.prototype._setMove=function(a){if(a.parentObject.span){var b=getAbsoluteTop(a),c=getAbsoluteTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode;this.dadmodefix=0;var d=a.parentObject.span;d.className+=" dragAndDropRow";this._lastMark=d;this._autoScroll(null,b,c)}};
dhtmlXTreeObject.prototype._autoScroll=function(a,b,c){if(this.autoScroll){a&&(b=getAbsoluteTop(a),c=getAbsoluteTop(this.allTree)-this.allTree.scrollTop);if(b-c-parseInt(this.allTree.scrollTop)>parseInt(this.allTree.offsetHeight)-50)this.allTree.scrollTop=parseInt(this.allTree.scrollTop)+20;if(b-c<parseInt(this.allTree.scrollTop)+30)this.allTree.scrollTop=parseInt(this.allTree.scrollTop)-20}};
dhtmlXTreeObject.prototype._createDragNode=function(a,b){if(!this.dADTempOff)return null;var c=a.parentObject;if(!this.callEvent("onBeforeDrag",[c.id,b]))return null;c.i_sel||this._selectItem(c,b);var d=document.createElement("div"),e=[];if(this._itim_dg)for(var f=0;f<this._selected.length;f++)e[f]="<table cellspacing='0' cellpadding='0'><tr><td><img width='18px' height='18px' src='"+this._getSrc(this._selected[f].span.parentNode.previousSibling.childNodes[0])+"'></td><td>"+this._selected[f].span.innerHTML+
"</td></tr></table>";else e=this.getSelectedItemText().split(this.dlmtr);d.innerHTML=e.join("");d.style.position="absolute";d.className="dragSpanDiv";this._dragged=[].concat(this._selected);return d};dhtmlXTreeObject.prototype._focusNode=function(a){var b=getAbsoluteTop(a.htmlNode)-getAbsoluteTop(this.allTree);if(b>this.allTree.offsetHeight-30||b<0)this.allTree.scrollTop=b+this.allTree.scrollTop};dhtmlXTreeObject.prototype._preventNsDrag=function(a){a&&a.preventDefault&&a.preventDefault();return!1};
dhtmlXTreeObject.prototype._drag=function(a,b,c){this._autoOpenTimer&&clearTimeout(this._autoOpenTimer);if(!c.parentObject)c=this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.dadmodec=0;this._clearMove();var d=a.parentObject.treeNod;d&&d._clearMove&&d._clearMove("");if(!this.dragMove||this.dragMove())for(var e=!d||!d._clearMove||!d._dragged?Array(a.parentObject):d._dragged,f=c.parentObject,g=0;g<e.length;g++){var h=this._moveNode(e[g],f);this.dadmodec&&h!==!1&&(f=
this._globalIdStorageFind(h,!0,!0));h&&!this._sADnD&&this.selectItem(h,0,1)}if(d)d._dragged=[]};
dhtmlXTreeObject.prototype._dragIn=function(a,b,c,d){if(!this.dADTempOff)return 0;var e=b.parentObject,f=a.parentObject;if(f||!this._ddronr){if(!this.callEvent("onDragIn",[e.id,f?f.id:null,e.treeNod,this]))return f&&this._autoScroll(a),0;if(f){if(e.childNodes==null)return this._setMove(a,c,d),a;for(var g=e.treeNod,h=0;h<g._dragged.length;h++)if(this._checkPNodes(f,g._dragged[h]))return this._autoScroll(a),0;this._setMove(a,c,d);if(this._getOpenState(f)<=0)this._autoOpenId=f.id,this._autoOpenTimer=
window.setTimeout(new callerFunction(this._autoOpenItem,this),1E3)}else this.allTree.className+=" selectionBox";return a}};dhtmlXTreeObject.prototype._autoOpenItem=function(a,b){b.openItem(b._autoOpenId)};dhtmlXTreeObject.prototype._dragOut=function(){this._clearMove();this._autoOpenTimer&&clearTimeout(this._autoOpenTimer)};
dhtmlXTreeObject.prototype.moveItem=function(a,b,c,d){var e=this._globalIdStorageFind(a);if(!e)return 0;switch(b){case "right":alert("Not supported yet");break;case "item_child":var f=(d||this)._globalIdStorageFind(c);if(!f)return 0;(d||this)._moveNodeTo(e,f,0);break;case "item_sibling":f=(d||this)._globalIdStorageFind(c);if(!f)return 0;(d||this)._moveNodeTo(e,f.parentObject,f);break;case "item_sibling_next":f=(d||this)._globalIdStorageFind(c);if(!f)return 0;f.tr&&f.tr.nextSibling&&f.tr.nextSibling.nodem?
(d||this)._moveNodeTo(e,f.parentObject,f.tr.nextSibling.nodem):(d||this)._moveNodeTo(e,f.parentObject);break;case "left":e.parentObject.parentObject&&this._moveNodeTo(e,e.parentObject.parentObject,e.parentObject);break;case "up":var g=this._getPrevNode(e);if(g==-1||!g.parentObject)return;this._moveNodeTo(e,g.parentObject,g);break;case "up_strict":g=this._getIndex(e);g!=0&&this._moveNodeTo(e,e.parentObject,e.parentObject.childNodes[g-1]);break;case "down_strict":var g=this._getIndex(e),h=e.parentObject.childsCount-
2;g==h?this._moveNodeTo(e,e.parentObject):g<h&&this._moveNodeTo(e,e.parentObject,e.parentObject.childNodes[g+2]);break;case "down":g=this._getNextNode(this._lastChild(e));if(g==-1||!g.parentObject)return;g.parentObject==e.parentObject&&(g=this._getNextNode(g));if(g==-1)this._moveNodeTo(e,e.parentObject);else{if(g==-1||!g.parentObject)return;this._moveNodeTo(e,g.parentObject,g)}}if(_isIE&&_isIE<8)this.allTree.childNodes[0].border="1",this.allTree.childNodes[0].border="0"};
dhtmlXTreeObject.prototype._loadDynXML=function(a,b){var b=b||this.XMLsource,c=(new Date).valueOf();this._ld_id=a;this.loadXML(b+getUrlSymbol(b)+"uid="+c+"&id="+this._escape(a))};dhtmlXTreeObject.prototype._checkPNodes=function(a,b){return this._dcheckf?!1:b==a?1:a.parentObject?this._checkPNodes(a.parentObject,b):0};dhtmlXTreeObject.prototype.disableDropCheck=function(a){this._dcheckf=convertStringToBoolean(a)};
dhtmlXTreeObject.prototype.preventIECaching=function(a){this.no_cashe=convertStringToBoolean(a);this.XMLLoader.rSeed=this.no_cashe};dhtmlXTreeObject.prototype.preventIECashing=dhtmlXTreeObject.prototype.preventIECaching;dhtmlXTreeObject.prototype.disableCheckbox=function(a,b){var c=typeof a!="object"?this._globalIdStorageFind(a,0,1):a;if(c&&(c.dscheck=convertStringToBoolean(b)?(c.checkstate||0)%3+3:c.checkstate>2?c.checkstate-3:c.checkstate,this._setCheck(c),c.dscheck<3))c.dscheck=!1};
dhtmlXTreeObject.prototype.setEscapingMode=function(a){this.utfesc=a};dhtmlXTreeObject.prototype.enableHighlighting=function(a){this.ehlt=!0;this.ehlta=convertStringToBoolean(a)};dhtmlXTreeObject.prototype._itemMouseOut=function(){var a=this.childNodes[3].parentObject,b=a.treeNod;b.callEvent("onMouseOut",[a.id]);if(a.id==b._l_onMSI)b._l_onMSI=null;if(b.ehlta)a.span.className=a.span.className.replace("_lor","")};
dhtmlXTreeObject.prototype._itemMouseIn=function(){var a=this.childNodes[3].parentObject,b=a.treeNod;b._l_onMSI!=a.id&&b.callEvent("onMouseIn",[a.id]);b._l_onMSI=a.id;if(b.ehlta)a.span.className=a.span.className.replace("_lor",""),a.span.className=a.span.className.replace(/((standart|selected)TreeRow)/,"$1_lor")};dhtmlXTreeObject.prototype.enableActiveImages=function(a){this._aimgs=convertStringToBoolean(a)};
dhtmlXTreeObject.prototype.focusItem=function(a){var b=this._globalIdStorageFind(a);if(!b)return 0;this._focusNode(b)};dhtmlXTreeObject.prototype.getAllSubItems=function(a){return this._getAllSubItems(a)};dhtmlXTreeObject.prototype.getAllChildless=function(){return this._getAllScraggyItems(this.htmlNode)};dhtmlXTreeObject.prototype.getAllLeafs=dhtmlXTreeObject.prototype.getAllChildless;
dhtmlXTreeObject.prototype._getAllScraggyItems=function(a){for(var b="",c=0;c<a.childsCount;c++)if(a.childNodes[c].unParsed||a.childNodes[c].childsCount>0){var d=a.childNodes[c].unParsed?this._getAllScraggyItemsXML(a.childNodes[c].unParsed,1):this._getAllScraggyItems(a.childNodes[c]);d&&(b?b+=this.dlmtr+d:b=d)}else b?b+=this.dlmtr+a.childNodes[c].id:b=a.childNodes[c].id;return b};
dhtmlXTreeObject.prototype._getAllFatItems=function(a){for(var b="",c=0;c<a.childsCount;c++)if(a.childNodes[c].unParsed||a.childNodes[c].childsCount>0){b?b+=this.dlmtr+a.childNodes[c].id:b=a.childNodes[c].id;var d=a.childNodes[c].unParsed?this._getAllFatItemsXML(a.childNodes[c].unParsed,1):this._getAllFatItems(a.childNodes[c]);d&&(b+=this.dlmtr+d)}return b};dhtmlXTreeObject.prototype.getAllItemsWithKids=function(){return this._getAllFatItems(this.htmlNode)};
dhtmlXTreeObject.prototype.getAllFatItems=dhtmlXTreeObject.prototype.getAllItemsWithKids;dhtmlXTreeObject.prototype.getAllChecked=function(){return this._getAllChecked("","",1)};dhtmlXTreeObject.prototype.getAllUnchecked=function(a){a&&(a=this._globalIdStorageFind(a));return this._getAllChecked(a,"",0)};dhtmlXTreeObject.prototype.getAllPartiallyChecked=function(){return this._getAllChecked("","",2)};
dhtmlXTreeObject.prototype.getAllCheckedBranches=function(){var a=[this._getAllChecked("","",1)],b=this._getAllChecked("","",2);b&&a.push(b);return a.join(this.dlmtr)};dhtmlXTreeObject.prototype._getAllChecked=function(a,b,c){if(!a)a=this.htmlNode;if(a.checkstate==c&&!a.nocheckbox)b?b+=this.dlmtr+a.id:b=a.id;for(var d=a.childsCount,e=0;e<d;e++)b=this._getAllChecked(a.childNodes[e],b,c);return b?b:""};
dhtmlXTreeObject.prototype.setItemStyle=function(a,b,c){var c=c||!1,d=this._globalIdStorageFind(a);if(!d)return 0;d.span.style.cssText?d.span.style.cssText=c?b:d.span.style.cssText+";"+b:d.span.setAttribute("style",d.span.getAttribute("style")+"; "+b)};dhtmlXTreeObject.prototype.enableImageDrag=function(a){this._itim_dg=convertStringToBoolean(a)};dhtmlXTreeObject.prototype.setOnDragIn=function(a){this.attachEvent("onDragIn",a)};
dhtmlXTreeObject.prototype.enableDragAndDropScrolling=function(a){this.autoScroll=convertStringToBoolean(a)};dhtmlXTreeObject.prototype.setSkin=function(a){var b=this.parentObject.className.replace(/dhxtree_[^ ]*/gi,"");this.parentObject.className=b+" dhxtree_"+a;a=="dhx_terrace"&&this.enableTreeLines(!1)};
(function(){dhtmlx.extend_api("dhtmlXTreeObject",{_init:function(a){return[a.parent,a.width||"100%",a.height||"100%",a.root_id||0]},auto_save_selection:"enableAutoSavingSelected",auto_tooltip:"enableAutoTooltips",checkbox:"enableCheckBoxes",checkbox_3_state:"enableThreeStateCheckboxes",checkbox_smart:"enableSmartCheckboxes",context_menu:"enableContextMenu",distributed_parsing:"enableDistributedParsing",drag:"enableDragAndDrop",drag_copy:"enableMercyDrag",drag_image:"enableImageDrag",drag_scroll:"enableDragAndDropScrolling",
editor:"enableItemEditor",hover:"enableHighlighting",images:"enableTreeImages",image_fix:"enableIEImageFix",image_path:"setImagePath",lines:"enableTreeLines",loading_item:"enableLoadingItem",multiline:"enableMultiLineItems",multiselect:"enableMultiselection",navigation:"enableKeyboardNavigation",radio:"enableRadioButtons",radio_single:"enableSingleRadioMode",rtl:"enableRTL",search:"enableKeySearch",smart_parsing:"enableSmartXMLParsing",smart_rendering:"enableSmartRendering",text_icons:"enableTextSigns",
xml:"loadXML",skin:"setSkin"},{})})();
dhtmlXTreeObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(a,c,d){var e=this._loader.doXPath(".//item",a),f=e[0].getAttribute("text");this.obj.insertNewItem(d,c,f,0,0,0,0,"CHILD")});a.attachEvent("updateCallback",function(a,c,d){var e=this._loader.doXPath(".//item",a),f=e[0].getAttribute("text");this.obj.setItemText(c,f);this.obj.getParentId(c)!=d&&this.obj.moveItem(c,"item_child",d);this.setUpdated(c,!0,"updated")});a.attachEvent("deleteCallback",function(a,c){this.obj.setUserData(c,
this.action_param,"true_deleted");this.obj.deleteItem(c,!1)});a._methods=["setItemStyle","","changeItemId","deleteItem"];this.attachEvent("onEdit",function(b,c){b==3&&a.setUpdated(c,!0);return!0});this.attachEvent("onDrop",function(b,c,d,e,f){e==f&&a.setUpdated(b,!0)});this._onrdlh=function(b){var c=a.getState(b);if(c=="inserted")return a.set_invalid(b,!1),a.setUpdated(b,!1),!0;if(c=="true_deleted")return a.setUpdated(b,!1),!0;a.setUpdated(b,!0,"deleted");return!1};this._onradh=function(b){a.setUpdated(b,
!0,"inserted")};a._getRowData=function(a){for(var c={},d=this.obj._globalIdStorageFind(a),e=d.parentObject,f=0,f=0;f<e.childsCount;f++)if(e.childNodes[f]==d)break;c.tr_id=d.id;c.tr_pid=e.id;c.tr_order=f;c.tr_text=d.span.innerHTML;e=(d._userdatalist||"").split(",");for(f=0;f<e.length;f++)c[e[f]]=d.userData["t_"+e[f]];return c}};
dhtmlXTreeObject.prototype.makeDraggable=function(a,b){typeof a!="object"&&(a=document.getElementById(a));dragger=new dhtmlDragAndDropObject;dropper=new dhx_dragSomethingInTree;dragger.addDraggableItem(a,dropper);a.dragLanding=null;a.ondragstart=dropper._preventNsDrag;a.onselectstart=new Function("return false;");a.parentObject={};a.parentObject.img=a;a.parentObject.treeNod=dropper;dropper._customDrop=b};dhtmlXTreeObject.prototype.makeDragable=dhtmlXTreeObject.prototype.makeDraggable;
dhtmlXTreeObject.prototype.makeAllDraggable=function(a){for(var b=document.getElementsByTagName("div"),c=0;c<b.length;c++)b[c].getAttribute("dragInDhtmlXTree")&&this.makeDragable(b[c],a)};
function dhx_dragSomethingInTree(){this.lWin=window;this._createDragNode=function(a){var b=document.createElement("div");b.style.position="absolute";b.innerHTML=a.innerHTML||a.value;b.className="dragSpanDiv";return b};this._preventNsDrag=function(a){(a||window.event).cancelBubble=!0;a&&a.preventDefault&&a.preventDefault();return!1};this._nonTrivialNode=function(a,b,c,d){if(this._customDrop)return this._customDrop(a,d.img.id,b.id,c?c.id:null);var e=d.img.getAttribute("image")||"",f=d.img.id||"new",
g=d.img.getAttribute("text")||(_isIE?d.img.innerText:d.img.textContent);a[c?"insertNewNext":"insertNewItem"](c?c.id:b.id,f,g,"",e,e,e)}}
dhtmlXTreeObject.prototype.enableItemEditor=function(a){this._eItEd=convertStringToBoolean(a);if(!this._eItEdFlag)this._edn_dblclick=this._edn_click_IE=!0,this._ie_aFunc=this.aFunc,this._ie_dblclickFuncHandler=this.dblclickFuncHandler,this.setOnDblClickHandler(function(a,c){this._edn_dblclick&&this._editItem(a,c);return!0}),this.setOnClickHandler(function(a,c){this._stopEditItem(a,c);this.ed_hist_clcik==a&&this._edn_click_IE&&this._editItem(a,c);this.ed_hist_clcik=a;return!0}),this._eItEdFlag=!0};
dhtmlXTreeObject.prototype.setOnEditHandler=function(a){this.attachEvent("onEdit",a)};dhtmlXTreeObject.prototype.setEditStartAction=function(a,b){this._edn_click_IE=convertStringToBoolean(a);this._edn_dblclick=convertStringToBoolean(b)};
dhtmlXTreeObject.prototype._stopEdit=function(a,b){if(this._editCell&&(this.dADTempOff=this.dADTempOffEd,this._editCell.id!=a)){var c=!0;b?(c=!1,this.callEvent("onEditCancel",[this._editCell.id,this._editCell._oldValue])):c=this.callEvent("onEdit",[2,this._editCell.id,this,this._editCell.span.childNodes[0].value]);if(c===!0)c=this._editCell.span.childNodes[0].value;else if(c===!1)c=this._editCell._oldValue;var d=c!=this._editCell._oldValue;this._editCell.span.innerHTML=c;this._editCell.label=this._editCell.span.innerHTML;
var e=this._editCell.i_sel?"selectedTreeRow":"standartTreeRow";this._editCell.span.className=e;this._editCell.span.parentNode.className="standartTreeRow";this._editCell.span.style.paddingRight=this._editCell.span.style.paddingLeft="5px";this._editCell.span.onclick=this._editCell.span.ondblclick=function(){};var f=this._editCell.id;this.childCalc&&this._fixChildCountLabel(this._editCell);this._editCell=null;b||this.callEvent("onEdit",[3,f,this,d]);this._enblkbrd&&(this.parentObject.lastChild.focus(),
this.parentObject.lastChild.focus())}};dhtmlXTreeObject.prototype._stopEditItem=function(a){this._stopEdit(a)};dhtmlXTreeObject.prototype.stopEdit=function(a){this._editCell&&this._stopEdit(this._editCell.id+"_non",a)};dhtmlXTreeObject.prototype.editItem=function(a){this._editItem(a,this)};
dhtmlXTreeObject.prototype._editItem=function(a){if(this._eItEd){this._stopEdit();var b=this._globalIdStorageFind(a);if(b){editText=this.callEvent("onEdit",[0,a,this,b.span.innerHTML]);if(editText===!0)editText=b.span.innerText||b.span.textContent;else if(editText===!1)return;this.dADTempOffEd=this.dADTempOff;this.dADTempOff=!1;this._editCell=b;b._oldValue=editText;b.span.innerHTML="<input type='text' class='intreeeditRow' />";b.span.style.paddingRight=b.span.style.paddingLeft="0px";b.span.onclick=
b.span.ondblclick=function(a){(a||event).cancelBubble=!0};b.span.childNodes[0].value=editText;b.span.childNodes[0].onselectstart=function(a){return(a||event).cancelBubble=!0};b.span.childNodes[0].onmousedown=function(a){return(a||event).cancelBubble=!0};b.span.childNodes[0].focus();b.span.childNodes[0].focus();b.span.onclick=function(a){(a||event).cancelBubble=!0;return!1};b.span.className="";b.span.parentNode.className="";var c=this;b.span.childNodes[0].onkeydown=function(a){if(!a)a=window.event;
if(a.keyCode==13)a.cancelBubble=!0,c._stopEdit(window.undefined);else if(a.keyCode==27)c._editCell.span.childNodes[0].value=c._editCell._oldValue,c._stopEdit(window.undefined);(a||event).cancelBubble=!0};this.callEvent("onEdit",[1,a,this])}}};function jsonPointer(a,b){this.d=a;this.dp=b}
jsonPointer.prototype={text:function(){var a=function(a){for(var d=[],e=0;e<a.length;e++)d.push("{"+b(a[e])+"}");return d.join(",")},b=function(c){var d=[],e;for(e in c)typeof c[e]=="object"?e.length?d.push('"'+e+'":['+a(c[e])+"]"):d.push('"'+e+'":{'+b(c[e])+"}"):d.push('"'+e+'":"'+c[e]+'"');return d.join(",")};return"{"+b(this.d)+"}"},get:function(a){return this.d[a]},exists:function(){return!!this.d},content:function(){return this.d.content},each:function(a,b,c){var d=this.d[a],e=new jsonPointer;
if(d)for(var f=0;f<d.length;f++)e.d=d[f],b.apply(c,[e,f])},get_all:function(){return this.d},sub:function(a){return new jsonPointer(this.d[a],this.d)},sub_exists:function(a){return!!this.d[a]},each_x:function(a,b,c,d,e){var f=this.d[a],g=new jsonPointer(0,this.d);if(f)for(e=e||0;e<f.length;e++)if(f[e][b]&&(g.d=f[e],c.apply(d,[g,e])==-1))break},up:function(){return new jsonPointer(this.dp,this.d)},set:function(a,b){this.d[a]=b},clone:function(){return new jsonPointer(this.d,this.dp)},through:function(a,
b,c,d,e){var f=this.d[a];if(f.length)for(var g=0;g<f.length;g++){if(f[g][b]!=null&&f[g][b]!=""&&(!c||f[g][b]==c)){var h=new jsonPointer(f[g],this.d);d.apply(e,[h,g])}var i=this.d;this.d=f[g];this.sub_exists(a)&&this.through(a,b,c,d,e);this.d=i}}};
dhtmlXTreeObject.prototype.loadJSArrayFile=function(a,b){this.parsCount||this.callEvent("onXLS",[this,this._ld_id]);this._ld_id=null;this.xmlstate=1;var c=this;this.XMLLoader=new dtmlXMLLoaderObject(function(a,b,f,g,h){eval("var z="+h.xmlDoc.responseText);c.loadJSArray(z)},this,!0,this.no_cashe);if(b)this.XMLLoader.waitCall=b;this.XMLLoader.loadXML(a)};
dhtmlXTreeObject.prototype.loadCSV=function(a,b){this.parsCount||this.callEvent("onXLS",[this,this._ld_id]);this._ld_id=null;this.xmlstate=1;var c=this;this.XMLLoader=new dtmlXMLLoaderObject(function(a,b,f,g,h){c.loadCSVString(h.xmlDoc.responseText)},this,!0,this.no_cashe);if(b)this.XMLLoader.waitCall=b;this.XMLLoader.loadXML(a)};
dhtmlXTreeObject.prototype.loadJSArray=function(a,b){for(var c=[],d=0;d<a.length;d++)c[a[d][1]]||(c[a[d][1]]=[]),c[a[d][1]].push({id:a[d][0],text:a[d][2]});var e={id:this.rootId},f=function(a,b){if(c[a.id]){a.item=c[a.id];for(var d=0;d<a.item.length;d++)b(a.item[d],b)}};f(e,f);this.loadJSONObject(e,b)};
dhtmlXTreeObject.prototype.loadCSVString=function(a,b){for(var c=[],d=a.split("\n"),e=0;e<d.length;e++){var f=d[e].split(",");c[f[1]]||(c[f[1]]=[]);c[f[1]].push({id:f[0],text:f[2]})}var g={id:this.rootId},h=function(a,b){if(c[a.id]){a.item=c[a.id];for(var d=0;d<a.item.length;d++)b(a.item[d],b)}};h(g,h);this.loadJSONObject(g,b)};
dhtmlXTreeObject.prototype.loadJSONObject=function(a,b){this.parsCount||this.callEvent("onXLS",[this,null]);this.xmlstate=1;var c=new jsonPointer(a);this._parse(c);this._p=c;b&&b()};
dhtmlXTreeObject.prototype.loadJSON=function(a,b){this.parsCount||this.callEvent("onXLS",[this,this._ld_id]);this._ld_id=null;this.xmlstate=1;var c=this;this.XMLLoader=new dtmlXMLLoaderObject(function(a,b,f,g,h){try{eval("var t="+h.xmlDoc.responseText)}catch(i){dhtmlxError.throwError("LoadXML","Incorrect JSON",[h.xmlDoc,this]);return}var j=new jsonPointer(t);c._parse(j);c._p=j},this,!0,this.no_cashe);if(b)this.XMLLoader.waitCall=b;this.XMLLoader.loadXML(a)};
dhtmlXTreeObject.prototype.serializeTreeToJSON=function(){for(var a=['{"id":"'+this.rootId+'", "item":['],b=[],c=0;c<this.htmlNode.childsCount;c++)b.push(this._serializeItemJSON(this.htmlNode.childNodes[c]));a.push(b.join(","));a.push("]}");return a.join("")};
dhtmlXTreeObject.prototype._serializeItemJSON=function(a){var b=[];if(a.unParsed)return a.unParsed.text();var c=this._selected.length?this._selected[0].id:"",d=a.span.innerHTML,d=d.replace(/\"/g,'\\"',d);this._xfullXML?b.push('{ "id":"'+a.id+'", '+(this._getOpenState(a)==1?' "open":"1", ':"")+(c==a.id?' "select":"1",':"")+' "text":"'+d+'", "im0":"'+a.images[0]+'", "im1":"'+a.images[1]+'", "im2":"'+a.images[2]+'" '+(a.acolor?', "aCol":"'+a.acolor+'" ':"")+(a.scolor?', "sCol":"'+a.scolor+'" ':"")+(a.checkstate==
1?', "checked":"1" ':a.checkstate==2?', "checked":"-1"':"")+(a.closeable?', "closeable":"1" ':"")+(this.XMLsource&&a.XMLload==0?', "child":"1" ':"")):b.push('{ "id":"'+a.id+'", '+(this._getOpenState(a)==1?' "open":"1", ':"")+(c==a.id?' "select":"1",':"")+' "text":"'+d+'"'+(this.XMLsource&&a.XMLload==0?', "child":"1" ':""));if(this._xuserData&&a._userdatalist){b.push(', "userdata":[');for(var e=a._userdatalist.split(","),f=[],g=0;g<e.length;g++)f.push('{ "name":"'+e[g]+'" , "content":"'+a.userData["t_"+
e[g]]+'" }');b.push(f.join(","));b.push("]")}if(a.childsCount){b.push(', "item":[');f=[];for(g=0;g<a.childsCount;g++)f.push(this._serializeItemJSON(a.childNodes[g]));b.push(f.join(","));b.push("]\n")}b.push("}\n");return b.join("")};
function dhtmlXTreeFromHTML(a){typeof a!="object"&&(a=document.getElementById(a));for(var b=a,c=b.id,d="",e=0;e<a.childNodes.length;e++)if(a.childNodes[e].nodeType=="1"){if(a.childNodes[e].tagName=="XMP")for(var f=a.childNodes[e],g=0;g<f.childNodes.length;g++)d+=f.childNodes[g].data;else a.childNodes[e].tagName.toLowerCase()=="ul"&&(d=dhx_li2trees(a.childNodes[e],[],0));break}a.innerHTML="";var h=new dhtmlXTreeObject(a,"100%","100%",0),i=[];for(b in h)i[b.toLowerCase()]=b;for(var j=a.attributes,k=
0;k<j.length;k++)if(j[k].name.indexOf("set")==0||j[k].name.indexOf("enable")==0){var m=j[k].name;h[m]||(m=i[j[k].name]);h[m].apply(h,j[k].value.split(","))}if(typeof d=="object"){h.XMLloadingWarning=1;for(var l=0;l<d.length;l++)b=h.insertNewItem(d[l][0],d[l][3],d[l][1]),d[l][2]&&h._setCheck(b,d[l][2]);h.XMLloadingWarning=0;h.lastLoadedXMLId=0;h._redrawFrom(h)}else h.loadXMLString("<tree id='0'>"+d+"</tree>");window[c]=h;var n=a.getAttribute("oninit");n&&eval(n);return h}
function dhx_init_trees(){for(var a=document.getElementsByTagName("div"),b=0;b<a.length;b++)a[b].className=="dhtmlxTree"&&dhtmlXTreeFromHTML(a[b])}
function dhx_li2trees(a,b,c){for(var d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(e.nodeType==1&&e.tagName.toLowerCase()=="li"){for(var f="",g=null,h=e.getAttribute("checked"),i=0;i<e.childNodes.length;i++){var j=e.childNodes[i];j.nodeType==3?f+=j.data:j.tagName.toLowerCase()!="ul"?f+=dhx_outer_html(j):g=j}b[b.length]=[c,f,h,e.id||b.length+1];g&&(b=dhx_li2trees(g,b,e.id||b.length))}}return b}
function dhx_outer_html(a){if(a.outerHTML)return a.outerHTML;var b=document.createElement("DIV");b.appendChild(a.cloneNode(!0));return b=b.innerHTML}window.addEventListener?window.addEventListener("load",dhx_init_trees,!1):window.attachEvent&&window.attachEvent("onload",dhx_init_trees);function dhtmlXLayoutPanel(){}
function dhtmlXLayoutObject(a,b,c){if(window.dhtmlXContainer){var d=this;this._autodetectSkin=function(){var a=document.createElement("DIV");a.className="dhxlayout_skin_detect";document.body.childNodes.length>0?document.body.insertBefore(a,document.body.childNodes[0]):document.body.appendChild(a);var b=a.offsetWidth;document.body.removeChild(a);a=null;return b==199?"dhx_skyblue":b==299?"dhx_blue":b==399?"dhx_black":b==499?"dhx_web":b==599?"dhx_terrace":"dhx_skyblue"};this.skin=c!=null?c:typeof dhtmlx!=
"undefined"&&typeof dhtmlx.skin=="string"?dhtmlx.skin:this._autodetectSkin();this.setSkin=function(a){if(this.skinParams[a]){this.skin=a;this._CPanelHeight=this.skinParams[this.skin].cpanel_height;this._collapsedW=this.skinParams[this.skin].cpanel_collapsed_width;this._collapsedH=this.skinParams[this.skin].cpanel_collapsed_height;this.tpl.className="dhtmlxLayoutPolyContainer_"+this.skin+(this._r?" dhxlayout_rtl":"");this.sizer.className="dhxLayout_Sizer_"+this.skin;this.dhxWins&&this.dhxWins.setSkin(this.skin);
for(var b in this.polyObj)this.polyObj[b].skin=this.skin;this.base.skin=this.skin;this._fixIcons();this.setSizes()}};this._isIPad=navigator.userAgent.search(/iPad/gi)>=0;this._dblClickTM=600;this._mBottom=this._mTop=0;typeof a=="string"&&(a=document.getElementById(a));if((a._isWindow==!0||a._isCell)&&!this.base){if(a._isCell&&a.attachLayout)return a.attachLayout(b,c);if(a.isWindow)return a.attachLayout(b,c);this.base=a}if(a==document.body&&!this.base)document.body.style.overflow="hidden";if((typeof a==
"object"||a==document.body)&&!this.base){var e=document.createElement("DIV");e.className="dhxcont_global_layout_area";a.appendChild(e);a._isLayout=!0;this.cont=new dhtmlXContainer(a);this.cont.setContent(e);if(a==document.body){if(this.skin=="dhx_skyblue"||this.skin=="dhx_blue")this.cont.obj._offsetTop=2,this.cont.obj._offsetLeft=2,this.cont.obj._offsetHeight=-4,this.cont.obj._offsetWidth=-4;if(this.skin=="dhx_web")this.cont.obj._offsetTop=9,this.cont.obj._offsetLeft=9,this.cont.obj._offsetHeight=
-18,this.cont.obj._offsetWidth=-18;if(this.skin=="dhx_terrace")this.cont.obj._offsetTop=14,this.cont.obj._offsetLeft=14,this.cont.obj._offsetHeight=-28,this.cont.obj._offsetWidth=-28;document.body.className+=" dhxlayout_fullscreened"}a.adjustContent(a,this._mTop,null,null,this._mBottom);this.base=document.createElement("DIV");this.base.style.overflow="hidden";this.base.style.position="absolute";this.base.style.left="0px";this.base.style.top="0px";this.base.style.width=e.childNodes[0].style.width;
this.base.style.height=e.childNodes[0].style.height;e.childNodes[0].appendChild(this.base);if(a==document.body)this._lw=this._tmTime=null,this._doOnResizeStart=function(){window.clearTimeout(this._tmTime);this._tmTime=window.setTimeout(function(){d._doOnResizeEnd()},200)},this._doOnResizeEnd=function(){this.setSizes(!1)},_isIE?window.attachEvent("onresize",d._doOnResizeStart):window.addEventListener("resize",d._doOnResizeStart,!1);a._doOnAttachToolbar=function(){d!=null&&typeof d.setSizes=="function"&&
d.setSizes()}}this.items=[];this.cells=function(a){return this.polyObj[a]!=null?this.polyObj[a]:null};this.getIdByIndex=function(a){return a<0?null:a>=this.items.length?null:this.items[a]._idd};this.getIndexById=function(a){return this.cells(a)!=null?this.cells(a).getIndex():null};this.imagePath=dhtmlx.image_path||"codebase/imgs/";this.setImagePath=function(a){this.imagePath=a};this.polyObj={};this.sepHor=[];this.sepVer=[];this._layoutView=b!=null?String(b).toUpperCase():"3E";this._minHeight=this._minWidth=
40;this._CPanelBtnsWidth=32;this.skinParams={dhx_black:{hor_sep_height:5,ver_sep_width:5,cpanel_height:34,cpanel_collapsed_width:18,cpanel_collapsed_height:18},dhx_blue:{hor_sep_height:5,ver_sep_width:5,cpanel_height:34,cpanel_collapsed_width:18,cpanel_collapsed_height:18},dhx_skyblue:{hor_sep_height:5,ver_sep_width:5,cpanel_height:26,cpanel_collapsed_width:18,cpanel_collapsed_height:18},dhx_web:{hor_sep_height:9,ver_sep_width:9,cpanel_height:27,cpanel_collapsed_width:18,cpanel_collapsed_height:18,
cell_pading_max:1,cell_pading_min:0},dhx_terrace:{hor_sep_height:14,ver_sep_width:14,cpanel_height:37,cpanel_collapsed_width:18,cpanel_collapsed_height:18,cell_pading_max:1,cell_pading_min:0}};this._CPanelHeight=this.skinParams[this.skin].cpanel_height;this._collapsedW=this.skinParams[this.skin].cpanel_collapsed_width;this._collapsedH=this.skinParams[this.skin].cpanel_collapsed_height;this.tpl=document.createElement("TABLE");this.tpl.dir="ltr";this.tpl.className="dhtmlxLayoutPolyContainer_"+this.skin;
this.tpl.cellSpacing=0;this.tpl.cellPadding=0;var f=document.createElement("TBODY");this.tpl.appendChild(f);this.tpl.border=0;this.tplSizes={};this._effects={collapse:!1,resize:!1,highlight:!0};this.sizer=document.createElement("DIV");this.sizer.className="dhxLayout_Sizer_"+this.skin;this.sizer.style.display="none";document.body.appendChild(this.sizer);this._attachSizer=function(a){d.sizer.style.left=getAbsoluteLeft(a)+"px";d.sizer.style.top=getAbsoluteTop(a)+"px";d.sizer.style.width=a.offsetWidth+
"px";d.sizer.style.height=a.offsetHeight+"px";if(d._sizerML!=null)d.sizer.style.marginLeft=d._sizerML+"px";if(d._sizerMT!=null)d.sizer.style.marginTop=d._sizerMT+"px";d.sizer.style.display="";d.sizer.className="dhxLayout_Sizer_"+d.skin;a._dir!=null&&(d.sizer.className+=" "+(a._dir=="hor"?"dhxCursorNResize":"dhxCursorWResize"))};this.listViews=function(){var a=[],b;for(b in this.tplData)a[a.length]=b;return a};this._init=function(){this.obj=document.createElement("DIV");this.obj.className="dhtmlxLayoutObject";
this.base.appendChild(this.obj);this.obj.appendChild(this.tpl);this.w=this.obj.offsetWidth;this.h=this.obj.offsetHeight;this._xmlLoader.loadXMLString(this.tplData[this._layoutView]!=null?this.tplData[this._layoutView]:this.tplData["3E"]);this._initWindows()};this._autoHor=[];this._autoVer=[];this._dimension=[320,200];this._colsRatio=this._rowsRatio=100;this._xmlParser=function(){for(var a=[],b=[],c={},e=this.getXMLTopNode("layout"),f=0;f<e.childNodes.length;f++){if(e.childNodes[f].tagName=="row"){var m=
e.childNodes[f],l=document.createElement("TR");d.tpl.childNodes[0].appendChild(l);for(var n=0;n<m.childNodes.length;n++)if(m.childNodes[n].tagName=="cell"){var o=m.childNodes[n],p=document.createElement("TD");p._dir="null";if(o.getAttribute("obj")!=null){for(var r=o.getAttribute("obj"),q=String(o.getAttribute("wh")).split(","),s=isNaN(q[0]),w=isNaN(q[0])?parseInt(d.polyObj[q[0]].style.width):0,t=0;t<a.length;t++)for(var v=0;v<a[t].length;v++)if(a[t][v]==r){if(!s){for(var s=!0,u=d.base.offsetWidth-
c[r][0]*d.skinParams[d.skin].ver_sep_width,x=0;x<a[t].length;x++)isNaN(a[t][x])||(u-=a[t][x],q[0]-=1);w=Math.ceil(u/q[0])}a[t][v]=w}p.style.width=w+"px";for(var s=isNaN(q[1]),A=isNaN(q[1])?parseInt(d.polyObj[q[1]].style.height):0,t=0;t<b.length;t++)for(v=0;v<b[t].length;v++)if(b[t][v]==r){if(!s){for(var s=!0,y=d.base.offsetHeight-c[r][1]*d.skinParams[d.skin].hor_sep_height,x=0;x<b.length;x++)isNaN(b[x][v])||(y-=b[x][v],q[1]-=1);A=Math.ceil(y/q[1])}b[t][v]=A}p.style.height=A+"px";p.className="dhtmlxLayoutSinglePoly";
p.innerHTML="";p._minW=o.getAttribute("minWidth")!=null?Number(o.getAttribute("minWidth")):d._minWidth;p._minH=o.getAttribute("minHeight")!=null?Number(o.getAttribute("minHeight")):d._minHeight;p._initCPanel=o.getAttribute("cpanel")!=null?o.getAttribute("cpanel")=="false"?!1:!0:!0;p._resize=o.getAttribute("resize");for(var B=String(o.getAttribute("neighbors")).split(";"),z=0;z<B.length;z++){var C=String(B[z]).split(",");C.length>1&&(B[z]=C)}p._rowData=B;d.polyObj[r]=p}if(o.getAttribute("sep")!=null){var D=
o.getAttribute("sep");if(D=="hor"){p.className="dhtmlxLayoutPolySplitterHor";p._dir="hor";for(var H=o.getAttribute("top").split(";"),z=0;z<H.length;z++)C=String(H[z]).split(","),C.length>1&&(H[z]=C);p._top=H;for(var I=o.getAttribute("bottom").split(";"),z=0;z<I.length;z++)C=String(I[z]).split(","),C.length>1&&(I[z]=C);p._bottom=I;d.sepHor[d.sepHor.length]=p}else{p.className="dhtmlxLayoutPolySplitterVer";p._dir="ver";for(var J=o.getAttribute("left").split(";"),z=0;z<J.length;z++)C=String(J[z]).split(","),
C.length>1&&(J[z]=C);p._left=J;for(var K=o.getAttribute("right").split(";"),z=0;z<K.length;z++)C=String(K[z]).split(","),C.length>1&&(K[z]=C);p._right=K;d.sepVer[d.sepVer.length]=p}p._dblClick=o.getAttribute("dblclick");p._isSep=!0;p.innerHTML='<div style="height:2px;overflow:hidden;">&nbsp;</div>'}if(o.getAttribute("colspan")!=null)p.colSpan=o.getAttribute("colspan");if(o.getAttribute("rowspan")!=null)p.rowSpan=o.getAttribute("rowspan");l.appendChild(p)}}if(e.childNodes[f].tagName=="autosize")d._autoHor=
e.childNodes[f].getAttribute("hor").split(";"),d._autoVer=e.childNodes[f].getAttribute("ver").split(";"),d._totalCols=e.childNodes[f].getAttribute("cols"),d._totalRows=e.childNodes[f].getAttribute("rows"),d._dimension[0]=d._totalCols*d._colsRatio,d._dimension[1]=d._totalRows*d._rowsRatio;if(e.childNodes[f].tagName=="table"){for(var M=e.childNodes[f].getAttribute("data"),x=String(M).split(";"),t=0;t<x.length;t++){a[t]=[];b[t]=[];for(var F=String(x[t]).split(","),v=0;v<F.length;v++)a[t][v]=F[v],b[t][v]=
F[v],c[F[v]]==null&&(c[F[v]]=[0,0])}for(var G in c){s=!1;for(t=0;t<a.length;t++)for(v=0;v<a[t].length;v++)if(a[t][v]==G&&!s){for(var s=!0,E=0;E<a[t].length;E++)a[t][E]!=G&&c[G][0]++;for(E=0;E<a.length;E++)a[E][v]!=G&&c[G][1]++}}}}b=a=null;d._buildSurface();this.destructor()};this._xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window);this.listAutoSizes=function(){var a=this._availAutoSize[this._layoutView+"_hor"],b=this._availAutoSize[this._layoutView+"_ver"],c=this._autoHor.join(";"),d=this._autoVer.join(";");
return[c,d,a,b]};this.setAutoSize=function(a,b){if(a!=null){for(var c=!1,d=this._availAutoSize[this._layoutView+"_hor"],e=0;e<d.length;e++)c=c||d[e]==a;if(c==!0)this._autoHor=a.split(";")}if(b!=null){c=!1;d=this._availAutoSize[this._layoutView+"_ver"];for(e=0;e<d.length;e++)c=c||d[e]==b;if(c==!0)this._autoVer=b.split(";")}};this._buildSurface=function(){for(var a=0;a<this.tpl.childNodes[0].childNodes.length;a++)for(var b=this.tpl.childNodes[0].childNodes[a],c=0;c<b.childNodes.length;c++){var d=b.childNodes[c],
e=this;if(!d._isSep)d._isCell=!0,d.skin=this.skin,d.getId=function(){return this._idd},d.getIndex=function(){return this._ind},d.showHeader=function(){e.showPanel(this._idd)},d.hideHeader=function(){e.hidePanel(this._idd)},d.isHeaderVisible=function(){return e.isPanelVisible(this._idd)},d.setText=function(a){e.setText(this._idd,a)},d.getText=function(){return e.getText(this._idd)},d.expand=function(){e._isCollapsed(this._idd)&&e._expand(this._idd,"hide")},d.collapse=function(){e._isCollapsed(this._idd)||
e._collapse(this._idd,"hide")},d.isCollapsed=function(){return e._isCollapsed(this._idd)},d.dock=function(){e._isCollapsed(this._idd)&&(e._expand(this._idd,"dock"),e.dockWindow(this._idd))},d.undock=function(){e._isCollapsed(this._idd)||(e.unDockWindow(this._idd),e._collapse(this._idd,"dock"))},d.setWidth=function(a){if(Number(a)){var b=this._isBlockedWidth||!1;this._isBlockedWidth=!1;e._setWidth(this._idd,a);this._isBlockedWidth=b}},d.getWidth=function(){return parseInt(this.style.width)},d.setHeight=
function(a){if(Number(a)){var b=this._isBlockedHeight||!1;this._isBlockedHeight=!1;e._setHeight(this._idd,a);this._isBlockedHeight=b}},d.getHeight=function(){return parseInt(this.style.height)},d.fixSize=function(a,b){e._fixSize(this._idd,a,b)},d.progressOn=function(){e._progressControl(this._idd,!0)},d.progressOff=function(){e._progressControl(this._idd,!1)},d._doOnAttachMenu=function(){this.adjustContent(this.childNodes[0],this._noHeader?0:e.skinParams[e.skin].cpanel_height);this.updateNestedObjects()},
d._doOnAttachToolbar=function(){this.adjustContent(this.childNodes[0],this._noHeader?0:e.skinParams[e.skin].cpanel_height);this.updateNestedObjects()},d._doOnAttachStatusBar=function(){this.adjustContent(this.childNodes[0],this._noHeader?0:e.skinParams[e.skin].cpanel_height);this.updateNestedObjects()},d._doOnFrameContentLoaded=function(){e.callEvent("onContentLoaded",[this._idd])},d._doOnResize=function(){this.adjustContent(this.childNodes[0],this._noHeader?0:e.skinParams[e.skin].cpanel_height);
this.updateNestedObjects()},d._redraw=function(){},d.showArrow=function(){this.childNodes[0].childNodes[0].childNodes[4].style.display=""},d.hideArrow=function(){this.childNodes[0].childNodes[0].childNodes[4].style.display="none"},d.isArrowVisible=function(){return this.childNodes[0].childNodes[0].childNodes[4].style.display!="none"};if(d._dir=="ver")d.onselectstart=function(a){a=a||event;a.returnValue=!1},_isIE&&(d.ondblclick=function(){e._doOnDoubleClick(this)}),d[this._isIPad?"ontouchstart":"onmousedown"]=
function(a){a=a||event;if(!_isIE)if(this._lastClick){var b=this._lastClick;this._lastClick=(new Date).getTime();if(b+e._dblClickTM>=this._lastClick&&e._doOnDoubleClick(this)===!0)return}else this._lastClick=(new Date).getTime();var c=e._findDockCellsVer(this);e._resAreaData=[];if(c[0]!=null&&c[1]!=null){String(document.body.className).search("dhxCursorWResize")==-1&&(document.body.className+=" dhxCursorWResize");e._resObj=this;e._anyExpL=c[0];e._anyExpR=c[1];e._collectResAreaData(c);e._resX=e._isIPad?
a.touches[0].clientX:a.clientX;if(e._effects.resize==!1){e._attachSizer(this);e.sizer._leftXStart=parseInt(e.sizer.style.left);var d=e.polyObj[e._anyExpL[0]];e._resXMaxWidthLeft=parseInt(d.style.width)-e._minWidth;var f=e.polyObj[e._anyExpR[0]];e._resXMaxWidthRight=parseInt(f.style.width)-e._minWidth;if(e._alterSizes.length>0)for(var g=0;g<e._alterSizes.length;g++){for(var h=0;h<e._anyExpL.length;h++)if(e._alterSizes[g][0]==e._anyExpL[h]){var i=e._resXMaxWidthLeft=parseInt(d.style.width)-e._alterSizes[g][1];
if(i<e._resXMaxWidthLeft)e._resXMaxWidthLeft=i}for(h=0;h<e._anyExpR.length;h++)if(e._alterSizes[g][0]==e._anyExpR[h]&&(i=parseInt(f.style.width)-e._alterSizes[g][1],i<e._resXMaxWidthRight))e._resXMaxWidthRight=i}e._resXStart=e._resX}e._resFunc=e._resizeVer;e._showCovers();e._isIPad&&a.preventDefault()}},d.onmouseup=function(){if(e._effects.resize==!0)e._resizeStop(),e._anyExpL=null,e._anyExpR=null};if(d._dir=="hor")d.onselectstart=function(a){a=a||event;a.returnValue=!1},d[this._isIPad?"ontouchstart":
"onmousedown"]=function(a){a=a||event;if(this._lastClick){var b=this._lastClick;this._lastClick=(new Date).getTime();if(b+e._dblClickTM>=this._lastClick&&e._doOnDoubleClick(this)===!0)return}else this._lastClick=(new Date).getTime();var c=e._findDockCellsHor(this);e._resAreaData=[];if(c[0]!=null&&c[1]!=null){String(document.body.className).search("dhxCursorNResize")==-1&&(document.body.className+=" dhxCursorNResize");e._resObj=this;e._anyExpT=c[0];e._anyExpB=c[1];e._collectResAreaData(c);e._resY=
e._isIPad?a.touches[0].clientY:a.clientY;if(e._effects.resize==!1){e._attachSizer(this);e.sizer._topYStart=parseInt(e.sizer.style.top);var d=e.polyObj[e._anyExpT[0]];e._resYMaxHeightTop=parseInt(d.style.height)-e._minHeight;var f=e.polyObj[e._anyExpB[0]];e._resYMaxHeightBottom=parseInt(f.style.height)-e._minHeight;if(e._alterSizes.length>0)for(var g=0;g<e._alterSizes.length;g++){for(var h=0;h<e._anyExpT.length;h++)if(e._alterSizes[g][0]==e._anyExpT[h]){var i=parseInt(d.style.height)-e._alterSizes[g][2]-
(d.childNodes[0].style.display!="none"?e.skinParams[e.skin].cpanel_height:0);if(i<e._resYMaxHeightTop)e._resYMaxHeightTop=i}for(h=0;h<e._anyExpB.length;h++)if(e._alterSizes[g][0]==e._anyExpB[h]&&(i=parseInt(f.style.height)-e._alterSizes[g][2]-(f.childNodes[0].style.display!="none"?e.skinParams[e.skin].cpanel_height:0),i<e._resYMaxHeightBottom))e._resYMaxHeightBottom=i}e._resYStart=e._resY}e._resFunc=e._resizeHor;e._showCovers();e._isIPad&&a.preventDefault()}},d.onmouseup=function(){if(e._effects.resize==
!0)e._resizeStop(),e._anyExpT=null,e._anyExpB=null}}for(var f in this.polyObj){this.polyObj[f]._collapsed=!1;this.polyObj[f]._idd=f;this.polyObj[f]._ind=this.items.length;this.items[this.items.length]=this.polyObj[f];var l=document.createElement("DIV");l.style.position="relative";l.style.left="0px";l.style.top="0px";l.style.width=this.polyObj[f].style.width;l.style.height=this.polyObj[f].style.height;l.style.overflow="hidden";this.polyObj[f].appendChild(l);var n=document.createElement("DIV");n._dockCell=
f;n._resize=this.polyObj[f]._resize;n.className="dhtmlxPolyInfoBar";n.innerHTML="<div class='dhtmlxInfoBarLabel'>"+f+"</div><div class='dhtmlxInfoBarButtonsFake'><div class='dhtmlxInfoBarButtonsFake2'></div></div><div class='dhtmlxInfoButtonDock' title='"+this.i18n.dock+"'></div><div class='dhtmlxInfoButtonUnDock' style='display: none;' title='"+this.i18n.undock+"'></div><div class='dhtmlxInfoButtonShowHide_"+n._resize+"' title='"+this.i18n.collapse+"'></div><div class='dhtmlxLineL'></div><div class='dhtmlxLineR'></div>";
this.polyObj[f]._initCPanel==!0?(n._h=this._CPanelHeight,n.style.display=""):(n._h=0,n.style.display="none");this.polyObj[f].childNodes[0].appendChild(n);n.ondblclick=function(){e.callEvent("onDblClick",[this._dockCell])};n.childNodes[4].onclick=function(){var a=this.parentNode._dockCell;e._isCollapsed(a)?e._expand(a,"hide"):e._collapse(a,"hide")};for(a=0;a<n.childNodes.length;a++)n.childNodes[a].onselectstart=function(a){a=a||event;a.returnValue=!1};var o=document.createElement("DIV");o.className=
"dhxcont_global_content_area";this.polyObj[f].childNodes[0].appendChild(o);var p=new dhtmlXContainer(this.polyObj[f]);p.setContent(o);this.skin=="dhx_web"&&this.polyObj[f]._setPadding(this.skinParams[this.skin].cell_pading_max,"dhxcont_layout_dhx_web");this.skin=="dhx_terrace"&&this.polyObj[f]._setPadding(this.skinParams[this.skin].cell_pading_max,"dhxcont_layout_dhx_terrace");this.polyObj[f].adjustContent(this.polyObj[f].childNodes[0],this.skinParams[this.skin].cpanel_height)}this._fixIcons()};this._anyExpB=
this._anyExpT=this._anyExpR=this._anyExpL=this._resFunc=this._resObj=this._resY=this._resX=null;this._expand=function(a,b){this._doExpand(this.polyObj[a]._resize,a,this.polyObj[a]._rowData,b)};this._collapse=function(a,b){if(!this._isCollapsed(a))this.polyObj[a]._savedW=parseInt(this.polyObj[a].style.width),this.polyObj[a]._savedH=parseInt(this.polyObj[a].style.height),this._doCollapse(this.polyObj[a]._resize,a,this.polyObj[a]._rowData,b)};this._isCollapsed=function(a){return this.polyObj[a]._collapsed};
this._checkAlterMinSize=function(a){this._alterSizes=[];for(var b=0;b<a.length;b++)for(var c=0;c<a[b].length;c++)if(this.polyObj[a[b][c]].vs[this.polyObj[a[b][c]].av].layout!=null){var d=this.polyObj[a[b][c]].vs[this.polyObj[a[b][c]].av].layout._defineWindowMinDimension(this.polyObj[a[b][c]],!0);d[0]=a[b][c];this._alterSizes[this._alterSizes.length]=d}};this._findDockCellsVer=function(a){var b=[null,null];if(a==null)return b;for(var c=null,d=a._left.length-1;d>=0;d--)if(c==null)if(typeof a._left[d]==
"object"){for(var e=!1,f=0;f<a._left[d].length;f++)e=e||this.polyObj[a._left[d][f]]._isBlockedWidth||!1;e||(c=a._left[d])}else this.polyObj[a._left[d]]._collapsed==!1&&(this.polyObj[a._left[d]]._isBlockedWidth||(c=a._left[d]));for(var l=null,d=0;d<a._right.length;d++)if(l==null)if(typeof a._right[d]=="object"){e=!1;for(f=0;f<a._right[d].length;f++)e=e||this.polyObj[a._right[d][f]]._isBlockedWidth||!1;e||(l=a._right[d])}else this.polyObj[a._right[d]]._collapsed==!1&&(this.polyObj[a._right[d]]._isBlockedWidth||
(l=a._right[d]));if(c==null||l==null)return b;typeof c=="string"&&(c=Array(c));typeof l=="string"&&(l=Array(l));b[0]=c;b[1]=l;this._checkAlterMinSize(b);this._minWRAlter=this._minWLAlter=0;if(this._alterSizes.length>0&&this._effects.resize==!0){for(var n=[],o=[],d=0;d<c.length;d++)n[d]=this.polyObj[c[d]];for(d=0;d<l.length;d++)o[d]=this.polyObj[l[d]];for(d=0;d<n.length;d++)for(f=0;f<this._alterSizes.length;f++)if(this._alterSizes[f][0]==n[d]._idd&&this._minWLAlter<this._alterSizes[f][1])this._minWLAlter=
this._alterSizes[f][1];for(d=0;d<o.length;d++)for(f=0;f<this._alterSizes.length;f++)if(this._alterSizes[f][0]==o[d]._idd&&this._maxWRAlter<this._alterSizes[f][1])this._minWRAlter=this._alterSizes[f][1]}return b};this._findDockCellsHor=function(a){var b=[null,null];if(a==null)return b;for(var c=null,d=a._top.length-1;d>=0;d--)if(c==null)if(typeof a._top[d]=="object"){for(var e=!1,f=0;f<a._top[d].length;f++)e=e||this.polyObj[a._top[d][f]]._isBlockedHeight||!1;e||(c=a._top[d])}else this.polyObj[a._top[d]]._collapsed==
!1&&(this.polyObj[a._top[d]]._isBlockedHeight||(c=a._top[d]));for(var l=null,d=0;d<a._bottom.length;d++)if(l==null)if(typeof a._bottom[d]=="object"){e=!1;for(f=0;f<a._bottom[d].length;f++)e=e||this.polyObj[a._bottom[d][f]]._isBlockedHeight||!1;e||(l=a._bottom[d])}else this.polyObj[a._bottom[d]]._collapsed==!1&&(this.polyObj[a._bottom[d]]._isBlockedHeight||(l=a._bottom[d]));if(c==null||l==null)return b;typeof c=="string"&&(c=Array(c));typeof l=="string"&&(l=Array(l));b[0]=c;b[1]=l;this._checkAlterMinSize(b);
this._minHBAlter=this._minHTAlter=0;if(this._alterSizes.length>0&&this._effects.resize==!0){for(var n=[],o=[],d=0;d<c.length;d++)n[d]=this.polyObj[c[d]];for(d=0;d<l.length;d++)o[d]=this.polyObj[l[d]];for(d=0;d<n.length;d++)for(f=0;f<this._alterSizes.length;f++)if(this._alterSizes[f][0]==n[d]._idd&&this._minHTAlter<this._alterSizes[f][2])this._minHTAlter=this._alterSizes[f][2];for(d=0;d<o.length;d++)for(f=0;f<this._alterSizes.length;f++)if(this._alterSizes[f][0]==o[d]._idd&&this._minHBAlter<this._alterSizes[f][2])this._minHBAlter=
this._alterSizes[f][2]}return b};this._resizeVer=function(a){this._isIPad&&a.preventDefault();if(!(this._resObj==null||this._anyExpL==null||this._anyExpR==null)){var b=this._isIPad?a.touches[0].clientX:a.clientX;if(this._effects.resize==!1){this._resX=b;var c=b-this._resXStart;if(-c>this._resXMaxWidthLeft&&c<0)c=-this._resXMaxWidthLeft,this._resX=c+this._resXStart;if(c>this._resXMaxWidthRight&&c>0)c=this._resXMaxWidthRight,this._resX=c+this._resXStart;this.sizer.style.left=this.sizer._leftXStart+
c+"px"}else{for(var e=this._anyExpL,f=this._anyExpR,m=b,c=b-d._resX,l=[],n=[],o=0;o<e.length;o++)l[o]=this.polyObj[e[o]];for(o=0;o<f.length;o++)n[o]=this.polyObj[f[o]];var p=parseInt(l[0].style.width),r=parseInt(n[0].style.width);if(c<0){var q=p+c;if(q>l[0]._minW&&q>this._minWLAlter){for(var s=r+p-q,o=0;o<l.length;o++)this._setW(l[o],q);for(o=0;o<n.length;o++)this._setW(n[o],s);this._resX=m}}else if(c>0&&(s=r-c,s>n[0]._minW&&s>this._minWRAlter)){q=p+r-s;for(o=0;o<l.length;o++)this._setW(l[o],q);for(o=
0;o<n.length;o++)this._setW(n[o],s);this._resX=m}}}};this._resizeHor=function(a){if(!(this._resObj==null||this._anyExpT==null||this._anyExpB==null)){var b=this._isIPad?a.touches[0].clientY:a.clientY;if(this._effects.resize==!1){this._resY=b;var c=b-this._resYStart;if(-c>this._resYMaxHeightTop&&c<0)c=-this._resYMaxHeightTop,this._resY=c+this._resYStart;if(c>this._resYMaxHeightBottom&&c>0)c=this._resYMaxHeightBottom,this._resY=c+this._resYStart;this.sizer.style.top=this.sizer._topYStart+c+"px"}else{for(var e=
this._anyExpT,f=this._anyExpB,m=b,c=b-d._resY,l=[],n=[],o=0;o<e.length;o++)l[o]=this.polyObj[e[o]];for(o=0;o<f.length;o++)n[o]=this.polyObj[f[o]];var p=parseInt(l[0].style.height),r=parseInt(n[0].style.height);if(c<0){var q=p+c;if(q>l[0]._minH+this._minHTAlter){for(var s=r+p-q,o=0;o<l.length;o++)this._setH(l[o],q);for(o=0;o<n.length;o++)this._setH(n[o],s);this._resY=m}}else if(c>0&&(s=r-c,s>n[0]._minH+this._minHBAlter)){q=p+r-s;for(o=0;o<l.length;o++)this._setH(l[o],q);for(o=0;o<n.length;o++)this._setH(n[o],
s);this._resY=m}}}};this._resizeStop=function(){var a=document.body.className;if(a.search("dhxCursorWResize")!==-1||a.search("dhxCursorNResize")!==-1)document.body.className=String(document.body.className).replace(/dhxCursorWResize/g,"").replace(/dhxCursorNResize/g,"");if(this._resObj!=null)if(this._effects.resize==!1){this.sizer.style.display="none";if(this._resObj._dir=="hor"){var b=typeof this._anyExpT[0]=="object"?this._anyExpT[0][0]:this._anyExpT[0],c=this._resY-this._resYStart,d=parseInt(this.polyObj[b].style.height)+
c;this._setHeight(b,d)}else{var e=typeof this._anyExpL[0]=="object"?this._anyExpL[0][0]:this._anyExpL[0],f=this._resX-this._resXStart,l=parseInt(this.polyObj[e].style.width)+f;this._setWidth(e,l)}var n={},o=function(a){if(a!=null)for(var b=0;b<a.length;b++)typeof a[b]=="object"&&o(a[b]),n[a[b]]=!0};o(this._anyExpT);o(this._anyExpB);o(this._anyExpL);o(this._anyExpR);var p=[],r;for(r in n)p[p.length]=r;if(typeof this._anyExpT=="object"&&this._anyExpT!=null)this.updateNestedObjectsArray(this._anyExpT),
this._anyExpT=null;if(typeof this._anyExpB=="object"&&this._anyExpB!=null)this.updateNestedObjectsArray(this._anyExpB),this._anyExpB=null;if(typeof this._anyExpL=="object"&&this._anyExpL!=null)this.updateNestedObjectsArray(this._anyExpL),this._anyExpL=null;if(typeof this._anyExpR=="object"&&this._anyExpR!=null)this.updateNestedObjectsArray(this._anyExpR),this._anyExpR=null;this._resFunc=this._resObj=null;this._hideCovers();this._fixToolbars();this._fixCollapsedText();this.callEvent("onPanelResizeFinish",
[p])}else{var q=[];if(this._resObj._left!=null)for(var s=0;s<this._resObj._left.length;s++)q[q.length]=this._resObj._left[s];if(this._resObj._right!=null)for(s=0;s<this._resObj._right.length;s++)q[q.length]=this._resObj._right[s];if(this._resObj._top!=null)for(s=0;s<this._resObj._top.length;s++)q[q.length]=this._resObj._top[s];if(this._resObj._bottom!=null)for(s=0;s<this._resObj._bottom.length;s++)q[q.length]=this._resObj._bottom[s];this._resObj=this._resFunc=null;this._hideCovers();for(var w=[],
s=0;s<q.length;s++)if(typeof q[s]=="object")for(var t=0;t<q[s].length;t++)w[w.length]=this.polyObj[q[s][t]];else w[w.length]=this.polyObj[q[s]];for(s=0;s<w.length;s++)w[s].updateNestedObjects();this._fixCollapsedText();this.callEvent("onPanelResizeFinish",[])}};this._showCovers=function(){for(var a in this.polyObj)this._effects.highlight&&this._isResizable(a)&&this.polyObj[a].showCoverBlocker();this._fixToolbars()};this._hideCovers=function(){for(var a in this.polyObj)this.polyObj[a].hideCoverBlocker();
this._fixToolbars()};this._isResizable=function(a){for(var b=!1,c=0;c<this._resAreaData.length;c++)b=b||this._resAreaData[c]==a;return b};this._collectResAreaData=function(a){for(var b=0;b<a.length;b++)typeof a[b]=="string"?this._resAreaData[this._resAreaData.length]=a[b]:typeof a[b]=="object"&&this._collectResAreaData(a[b])};this._doOnDoubleClick=function(a){if(a._dblClick!=null&&this.polyObj[a._dblClick]!=null&&!this.polyObj[a._dblClick]._noHeader){var b=this.polyObj[a._dblClick];if(b.childNodes[0].style.display!=
"none")return b._collapsed==!0?this._doExpand(b._resize,a._dblClick,b._rowData,"hide"):(b._savedW=parseInt(b.style.width),b._savedH=parseInt(b.style.height),this._doCollapse(b._resize,a._dblClick,b._rowData,"hide")),!0}};this._doOnSelectStart=function(a){a=a||event;if(d._resObj!=null)a.returnValue=!1};this._doOnMouseMove=function(a){a=a||event;d._resObj!=null&&d._resFunc!=null&&d._resFunc(a)};this._doOnMouseUp=function(){d._resizeStop()};this._isIPad?(document.addEventListener("touchmove",d._doOnMouseMove,
!1),document.addEventListener("touchend",d._doOnMouseUp,!1)):_isIE?(document.body.attachEvent("onselectstart",d._doOnSelectStart),document.body.attachEvent("onmousemove",d._doOnMouseMove),document.body.attachEvent("onmouseup",d._doOnMouseUp)):(document.body.addEventListener("mousemove",d._doOnMouseMove,!1),document.body.addEventListener("mouseup",d._doOnMouseUp,!1));this._doExpand=function(a,b,c,d){if(!(c.length<=1)){for(var e=-1,f=0;f<c.length;f++)c[f]==b&&(e=f);if(e!=-1){for(var l=null,f=e+1;f<
c.length;f++)l==null&&(typeof c[f]=="string"?this.polyObj[c[f]]._collapsed==!1&&(l=c[f]):l=c[f]);if(l==null)for(f=e-1;f>=0;f--)l==null&&(typeof c[f]=="string"?this.polyObj[c[f]]._collapsed==!1&&(l=c[f]):l=c[f]);if(l!=null){typeof l!="object"&&(l=Array(l));if(a=="hor"){for(var n=65536,f=0;f<l.length;f++){var o=this.polyObj[l[f]].vs[this.polyObj[l[f]].av].layout!=null?this.polyObj[l[f]].vs[this.polyObj[l[f]].av].layout._defineWindowMinDimension(this.polyObj[l[f]],!0):[0,0],p=parseInt(this.polyObj[l[f]].style.width)-
this._minWidth-o[1];p<n&&(n=p)}var r=this.polyObj[b]._savedW;r>n&&(r=n);if(r<this._minWidth)return;var q=Math.round(r/3)}else{n=65536;for(f=0;f<l.length;f++)o=this.polyObj[l[f]].vs[this.polyObj[l[f]].av].layout!=null?this.polyObj[l[f]].vs[this.polyObj[l[f]].av].layout._defineWindowMinDimension(this.polyObj[l[f]],!0):[0,0,0],p=parseInt(this.polyObj[l[f]].style.height)-this._minHeight-o[2],p<n&&(n=p);r=this.polyObj[b]._savedH;r>n&&(r=n);if(r<this._minHeight)return;q=Math.round(r/3)}this.polyObj[b].childNodes[0].childNodes[1].style.display=
"";this.polyObj[b].childNodes[0].childNodes[0].className="dhtmlxPolyInfoBar";this.polyObj[b].childNodes[0].childNodes[0].childNodes[1].style.display="";this.polyObj[b].childNodes[0].childNodes[0].childNodes[2].style.display="";this.polyObj[b].childNodes[0].childNodes[0].childNodes[4].style.display="";for(var s=[],f=0;f<l.length;f++)s[f]=this.polyObj[l[f]];if(this.polyObj[b].className=="dhtmlxLayoutSinglePolyTabbarCollapsed")this.polyObj[b].className="dhtmlxLayoutSinglePolyTabbar";this._expandEffect(this.polyObj[b],
s,r,d,this._effects.collapse==!0?q:1E6,a)}}}};this._doCollapse=function(a,b,c,d){if(!(c.length<=1)){for(var e=-1,f=0;f<c.length;f++)c[f]==b&&(e=f);if(e!=-1){for(var l=null,f=e+1;f<c.length;f++)l==null&&(typeof c[f]=="string"?this.polyObj[c[f]]._collapsed==!1&&(l=c[f]):l=c[f]);if(l==null)for(f=e-1;f>=0;f--)l==null&&(typeof c[f]=="string"?this.polyObj[c[f]]._collapsed==!1&&(l=c[f]):l=c[f]);l==null&&c[e+1]!=null&&(l=c[e+1]);l==null&&e-1>=0&&c[e-1]!=null&&(l=c[e-1]);if(l!=null){if(typeof l!="object"){if(this.polyObj[l]._collapsed==
!0){this.polyObj[l].childNodes[0].childNodes[1].style.display="";this.polyObj[l]._collapsed=!1;this.polyObj[l].childNodes[0].childNodes[0].className="dhtmlxPolyInfoBar";this.polyObj[l].childNodes[0].childNodes[0].childNodes[1].style.display="";this.polyObj[l].childNodes[0].childNodes[0].childNodes[4].title=this.i18n.collapse;this.polyObj[l].childNodes[0].childNodes[0].childNodes[2].style.display="";this.polyObj[l].childNodes[0].childNodes[0].childNodes[3].style.display="none";this.polyObj[l].childNodes[0].childNodes[0].childNodes[4].style.display=
"";this.polyObj[l]._isUnDocked===!0&&this.dockWindow(l);if(this.polyObj[l].className=="dhtmlxLayoutSinglePolyTabbarCollapsed")this.polyObj[l].className="dhtmlxLayoutSinglePolyTabbar";this._fixSplitters();this._fixIcons();this.polyObj[l].removeAttribute("title");this._fixToolbars();this.callEvent("onExpand",[l])}l=Array(l)}for(var n=[],f=0;f<l.length;f++)n[f]=this.polyObj[l[f]];var o=a=="hor"?Math.round(Math.max(this.polyObj[b].offsetWidth,this.polyObj[l[0]].offsetWidth)/3):Math.round(Math.max(this.polyObj[b].offsetHeight,
this.polyObj[l[0]].offsetHeight)/3);this.polyObj[b].childNodes[0].childNodes[1].style.display="none";this._collapseEffect(this.polyObj[b],n,d,this._effects.collapse==!0?o:1E6,a)}}}};this.setEffect=function(a,b){this._effects[a]!=null&&typeof b=="boolean"&&(this._effects[a]=b)};this.getEffect=function(a){return this._effects[a]!=null?this._effects[a]:null};this._expandEffect=function(a,b,c,e,f,m){if(m=="hor")var l=parseInt(a.style.width),n=parseInt(b[0].style.width);else l=parseInt(a.style.height),
n=parseInt(b[0].style.height);var o=l+f;o>c&&(o=c);m=="hor"?(a.style.width=o+"px",a.childNodes[0].style.width=a.style.width):(a.style.height=o+"px",a.childNodes[0].style.height=a.style.height);a.adjustContent(a.childNodes[0],a._noHeader?0:this.skinParams[this.skin].cpanel_height);for(var p=0;p<b.length;p++)m=="hor"?(b[p].style.width=n+l-o+"px",b[p].childNodes[0].style.width=b[p].style.width):(b[p].style.height=n+l-o+"px",b[p].childNodes[0].style.height=b[p].style.height),b[p].adjustContent(b[p].childNodes[0],
b[p]._noHeader?0:this.skinParams[this.skin].cpanel_height);if(o!=c)window.setTimeout(function(){d._expandEffect(a,b,c,e,f,m)},4);else{a._collapsed=!1;for(p=0;p<b.length;p++)b[p].updateNestedObjects();this.polyObj[a._idd].updateNestedObjects();this.polyObj[a._idd].childNodes[0].childNodes[0].childNodes[4].title=this.i18n.collapse;this._fixSplitters();this._fixIcons();a.removeAttribute("title");this._fixToolbars();this.callEvent("onExpand",[a._idd])}};this._collapseEffect=function(a,b,c,e,f){if(f==
"hor")var m=parseInt(a.style.width),l=parseInt(b[0].style.width);else m=parseInt(a.style.height),l=parseInt(b[0].style.height);var n=m-e;if(f=="hor"){if(n<this._collapsedW)n=this._collapsedW;a.style.width=n+"px";a.childNodes[0].style.width=a.style.width}else{if(n<this._collapsedH)n=this._collapsedH;a.style.height=n+"px";a.childNodes[0].style.height=a.style.height}for(var o=0;o<b.length;o++)f=="hor"?(b[o].style.width=l+(m-n)+"px",b[o].childNodes[0].style.width=b[o].style.width):(b[o].style.height=
l+(m-n)+"px",b[o].childNodes[0].style.height=b[o].style.height),b[o].adjustContent(b[o].childNodes[0],b[o]._noHeader?0:this.skinParams[this.skin].cpanel_height);if(n>this._collapsedW&&f=="hor"||n>this._collapsedH&&f=="ver")window.setTimeout(function(){d._collapseEffect(a,b,c,e,f)},4);else{for(o=0;o<b.length;o++)f=="hor"?(b[o].style.width=l+(m-n)+"px",b[o].childNodes[0].style.width=b[o].style.width):(b[o].style.height=l+(m-n)+"px",b[o].childNodes[0].style.height=b[o].style.height),b[o].adjustContent(b[o].childNodes[0],
b[o]._noHeader?0:this.skinParams[this.skin].cpanel_height);a._collapsed=!0;a.childNodes[0].childNodes[0].className=f=="hor"?"dhtmlxPolyInfoBarCollapsedVer":"dhtmlxPolyInfoBarCollapsedHor";for(o=0;o<b.length;o++)b[o].updateNestedObjects();c=="hide"?(a.childNodes[0].childNodes[0].childNodes[1].style.display="",a.childNodes[0].childNodes[0].childNodes[2].style.display="none",a.childNodes[0].childNodes[0].childNodes[3].style.display="none",a.childNodes[0].childNodes[0].childNodes[4].style.display=""):
(a.childNodes[0].childNodes[0].childNodes[1].style.display="",a.childNodes[0].childNodes[0].childNodes[2].style.display="",a.childNodes[0].childNodes[0].childNodes[3].style.display="none",a.childNodes[0].childNodes[0].childNodes[4].style.display="none");if(a.className=="dhtmlxLayoutSinglePolyTabbar")a.className="dhtmlxLayoutSinglePolyTabbarCollapsed";this.polyObj[a._idd].childNodes[0].childNodes[0].childNodes[4].title=this.i18n.expand;this._fixSplitters();this._fixIcons();a.title=this.getTextTooltip(a._idd);
this._fixToolbars();this._fixCollapsedText();this.callEvent("onCollapse",[a._idd])}};this._setW=function(a,b){a.style.width=b+"px";a.childNodes[0].style.width=a.style.width;a.adjustContent(a.childNodes[0],a._noHeader?0:this.skinParams[this.skin].cpanel_height)};this._setH=function(a,b){a.style.height=b+"px";a.childNodes[0].style.height=a.style.height;a.adjustContent(a.childNodes[0],a._noHeader?0:this.skinParams[this.skin].cpanel_height)};this._setWidth=function(a,b){if(this.polyObj[a]!=null&&Number(b)){for(var c=
null,d=0;d<this.sepVer.length;d++){var e=this.sepVer[d]._left;if(e[e.length-1]==a)c=[this.sepVer[d],"left"];else if(typeof e[e.length-1]=="object")for(var f=e[e.length-1],l=0;l<f.length;l++)f[l]==a&&(c=[this.sepVer[d],"left"]);e=this.sepVer[d]._right;if(e[0]==a)c=[this.sepVer[d],"right"];else if(typeof e[0]=="object"){f=e[0];for(l=0;l<f.length;l++)f[l]==a&&(c=[this.sepVer[d],"right"])}}if(c!=null){var n=this._findDockCellsVer(c[0]),o=n[0],p=n[1];if(!(o==null||p==null)){var r=parseInt(this.polyObj[o[0]].style.width)+
parseInt(this.polyObj[p[0]].style.width);b<this._minWidth?b=this._minWidth:b>r-this._minWidth&&(b=r-this._minWidth);for(var q=r-b,d=0;d<o.length;d++)this._setW(this.polyObj[o[d]],c[1]=="left"?b:q),this.polyObj[o[d]].updateNestedObjects();for(d=0;d<p.length;d++)this._setW(this.polyObj[p[d]],c[1]=="right"?b:q),this.polyObj[p[d]].updateNestedObjects()}}}};this._setHeight=function(a,b){if(this.polyObj[a]!=null&&Number(b)){for(var c=null,d=0;d<this.sepHor.length;d++){var e=this.sepHor[d]._top;if(e[e.length-
1]==a)c=[this.sepHor[d],"top"];else if(typeof e[e.length-1]=="object")for(var f=e[e.length-1],l=0;l<f.length;l++)f[l]==a&&(c=[this.sepHor[d],"top"]);e=this.sepHor[d]._bottom;if(e[0]==a)c=[this.sepHor[d],"bottom"];else if(typeof e[0]=="object"){f=e[0];for(l=0;l<f.length;l++)f[l]==a&&(c=[this.sepHor[d],"bottom"])}}if(c!=null){var n=this._findDockCellsHor(c[0]),o=n[0],p=n[1];if(!(o==null||p==null)){var r=parseInt(this.polyObj[o[0]].style.height)+parseInt(this.polyObj[p[0]].style.height);b<this._minHeight?
b=this._minHeight:b>r-this._minHeight&&(b=r-this._minHeight);for(var q=r-b,d=0;d<o.length;d++)this._setH(this.polyObj[o[d]],c[1]=="top"?b:q),this.polyObj[o[d]].updateNestedObjects();for(d=0;d<p.length;d++)this._setH(this.polyObj[p[d]],c[1]=="bottom"?b:q),this.polyObj[p[d]].updateNestedObjects()}}}};this.updateNestedObjectsArray=function(a){for(var b=0;b<a.length;b++)typeof a[b]=="object"?this.updateNestedObjectsArray(a[b]):this.polyObj[a[b]].updateNestedObjects()};this.dockWindow=function(a){if(this.dhxWins&&
this.dhxWins.window(this.dhxWinsIdPrefix+a))this.dhxWins.window(this.dhxWinsIdPrefix+a).close(),this.dhxWins.window(this.dhxWinsIdPrefix+a).moveContentTo(this.polyObj[a]),this.polyObj[a]._isUnDocked=!1,this.callEvent("onDock",[a])};this.unDockWindow=function(a){this._initWindows(a);this.polyObj[a].moveContentTo(this.dhxWins.window(this.dhxWinsIdPrefix+a));this.polyObj[a]._isUnDocked=!0;this.callEvent("onUnDock",[a])};this._initWindows=function(a){if(window.dhtmlXWindows){if(!this.dhxWins&&(this.dhxWins=
new dhtmlXWindows,this.dhxWins.setSkin(this.skin),this.dhxWins.setImagePath(this.imagePath),this.dhxWinsIdPrefix="",!a))return;var b=this.dhxWinsIdPrefix+a;if(this.dhxWins.window(b))this.dhxWins.window(b).show();else{var c=this,d=this.dhxWins.createWindow(b,20,20,320,200);d.setText(this.polyObj[a].getText());d.button("close").hide();d.attachEvent("onClose",function(a){a.hide()});d.button("dock").show();d.button("dock").attachEvent("onClick",function(){c.polyObj[a].dock()});d.dockedCell=this.polyObj[a]}}};
this.isPanelVisible=function(a){return!this.polyObj[a]._noHeader};this.showPanel=function(a){if(this.polyObj[a]!=null&&this.polyObj[a]._collapsed!=!0){var b=this.polyObj[a].childNodes[0].childNodes[0];b.style.display="";this.polyObj[a]._noHeader=!1;this.skin=="dhx_web"&&this.polyObj[a]._setPadding(this.skinParams[this.skin].cell_pading_max,"dhxcont_layout_dhx_web");this.skin=="dhx_terrace"&&this.polyObj[a]._setPadding(this.skinParams[this.skin].cell_pading_max,"dhxcont_layout_dhx_terrace");this.polyObj[a].adjustContent(this.polyObj[a].childNodes[0],
this.skinParams[this.skin].cpanel_height);this.polyObj[a].updateNestedObjects()}};this.hidePanel=function(a){if(this.polyObj[a]!=null&&this.polyObj[a]._collapsed!=!0){var b=this.polyObj[a].childNodes[0].childNodes[0];b.style.display="none";this.polyObj[a]._noHeader=!0;this.skin=="dhx_web"&&this.polyObj[a]._setPadding(this.skinParams[this.skin].cell_pading_min,"");this.skin=="dhx_terrace"&&this.polyObj[a]._setPadding(this.skinParams[this.skin].cell_pading_min,"");this.polyObj[a].adjustContent(this.polyObj[a].childNodes[0],
0);this.polyObj[a].updateNestedObjects()}};this.setText=function(a,b){this._changeCPanelText(a,b)};this.getText=function(a){return this.polyObj[a].childNodes[0].childNodes[0].childNodes[0].innerHTML};this.getTextTooltip=function(a){var b=this.polyObj[a].childNodes[0].childNodes[0].childNodes[0];return b.innerText||b.textContent};this._changeCPanelText=function(a,b){var c=d;if(c.polyObj[a]!=null)c.polyObj[a].childNodes[0].childNodes[0].childNodes[0].innerHTML=b,d.dhxWins!=null&&d.dhxWins.window(d.dhxWinsIdPrefix+
a)!=null&&d.dhxWins.window(d.dhxWinsIdPrefix+a).setText(b)};this.forEachItem=function(a){for(var b=0;b<this.items.length;b++)a(this.items[b])};this._fixPositionInWin=function(a,b){this.base.style.width=a+"px";this.base.style.height=b+"px"};this.attachMenu=function(){this.base._isWindow?this.menu=this.base._window.attachMenu():(this.cont.obj.skin=this.skin,this.menu=this.cont.obj.attachMenu(),this.cont.obj.adjustContent(this.cont.obj,0),this.setSizes());return this.menu};this.detachMenu=function(){if(this.menu)this.cont.obj.detachMenu(),
this.setSizes(),this.menu=null};this.showMenu=function(){this.menu&&(this.cont.obj.showMenu(),this.setSizes())};this.hideMenu=function(){this.menu&&(this.cont.obj.hideMenu(),this.setSizes())};this.attachToolbar=function(){this.base._isWindow?this.toolbar=this.base._window.attachToolbar():(this.cont.obj.skin=this.skin,this.toolbar=this.cont.obj.attachToolbar(),this.cont.obj.adjustContent(this.cont.obj,0),this.setSizes());return this.toolbar};this.detachToolbar=function(){if(this.toolbar)this.cont.obj.detachToolbar(),
this.setSizes(),this.toolbar=null};this.showToolbar=function(){this.toolbar&&(this.cont.obj.showToolbar(),this.setSizes())};this.hideToolbar=function(){this.toolbar&&(this.cont.obj.hideToolbar(),this.setSizes())};this.attachStatusBar=function(){this.base._isWindow?this.statusbar=this.base._window.attachStatusBar():(this.statusbar=this.cont.obj.attachStatusBar(),this.cont.obj.adjustContent(this.cont.obj,0),this.setSizes());return this.statusbar};this.detachStatusBar=function(){if(this.statusbar)this.cont.obj.detachStatusBar(),
this.setSizes(),this.statusbar=null};this.showStatusBar=function(){this.statusbar&&(this.cont.obj.showStatusBar(),this.setSizes())};this.hideStatusBar=function(){this.statusbar&&(this.cont.obj.hideStatusBar(),this.setSizes())};this.progressOn=function(){this._progressControlGlobal(!0)};this.progressOff=function(){this._progressControlGlobal(!1)};this._progressControl=function(a,b){if(this.polyObj[a]!=null){if(this.polyObj[a]._progressCover==null){var c=document.createElement("DIV");c.className="dhtmlxLayoutPolyProgress";
this.polyObj[a].childNodes[0].appendChild(c);var d=document.createElement("DIV");d.className="dhtmlxLayoutPolyProgressBGIMG";this.polyObj[a].childNodes[0].appendChild(d);this.polyObj[a]._progressCover=[c,d]}this.polyObj[a]._progressCover[0].style.display=b==!0?"":"none";this.polyObj[a]._progressCover[1].style.display=this.polyObj[a]._progressCover[0].style.display}};this._progressControlGlobal=function(a){if(this._progressCover==null){var b=document.createElement("DIV");b.className="dhtmlxLayoutPolyProgressGlobal_"+
this.skin;this.obj.appendChild(b);var c=document.createElement("DIV");c.className="dhtmlxLayoutPolyProgressBGIMGGlobal_"+this.skin;this.obj.appendChild(c);this._progressCover=[b,c]}this._progressCover[0].style.display=a==!0?"":"none";this._progressCover[1].style.display=this._progressCover[0].style.display};this._fixSize=function(a,b,c){if(this.polyObj[a]!=null)this.polyObj[a]._isBlockedWidth=b,this.polyObj[a]._isBlockedHeight=c,this._fixSplitters()};this._fixSplitters=function(){for(var a=0;a<this.sepVer.length;a++){var b=
this._findDockCellsVer(this.sepVer[a]);if(b[0]==null||b[1]==null){if(this.sepVer[a].className!="dhtmlxLayoutPolySplitterVerInactive")this.sepVer[a].className="dhtmlxLayoutPolySplitterVerInactive"}else if(this.sepVer[a].className!="dhtmlxLayoutPolySplitterVer")this.sepVer[a].className="dhtmlxLayoutPolySplitterVer"}for(a=0;a<this.sepHor.length;a++)if(b=this._findDockCellsHor(this.sepHor[a]),b[0]==null||b[1]==null){if(this.sepHor[a].className!="dhtmlxLayoutPolySplitterHorInactive")this.sepHor[a].className=
"dhtmlxLayoutPolySplitterHorInactive"}else if(this.sepHor[a].className!="dhtmlxLayoutPolySplitterHor")this.sepHor[a].className="dhtmlxLayoutPolySplitterHor"};this._fixIcons=function(){for(var a in this.polyObj){for(var b=this.polyObj[a]._rowData,c=this.polyObj[a]._collapsed,d=-1,e=0;e<b.length;e++)typeof b[e]!="object"&&b[e]==a&&(d=e);var f=null;if(d!=-1){for(e=d+1;e<b.length;e++)typeof b[e]=="object"?f=this.polyObj[a]._resize=="ver"?c?"b":"t":c?"r":"l":this.polyObj[b[e]]._collapsed==!1&&(f=this.polyObj[a]._resize==
"ver"?c?"b":"t":c?"r":"l");if(f==null&&d>=1)for(e=d-1;e>=0;e--)typeof b[e]=="object"?f=this.polyObj[a]._resize=="ver"?c?"t":"b":c?"l":"r":this.polyObj[b[e]]._collapsed==!1&&(f=this.polyObj[a]._resize=="ver"?c?"t":"b":c?"l":"r")}if(f!=null){var l=this.polyObj[a]._resize;this.polyObj[a].childNodes[0].childNodes[0].childNodes[4].className="dhtmlxInfoButtonShowHide_"+l+" dhxLayoutButton_"+this.skin+"_"+l+(this.polyObj[a]._collapsed?"2":"1")+f}}};this._defineWindowMinDimension=function(a,b){if(b==!0){var c=
[];c[0]=parseInt(a.style.width);c[1]=parseInt(a.style.height)}else{c=a.getDimension();if(c[0]=="100%")c[0]=a.offsetWidth;if(c[1]=="100%")c[1]=a.offsetHeight}var e=d._getNearestParents("hor"),f=d._getNearestParents("ver");if(!b){var m=[],l=[],n;for(n in e)m[m.length]=n;for(n in f)l[l.length]=n;d._checkAlterMinSize([m,l]);for(var o={},p={},r=0;r<d._alterSizes.length;r++){n=d._alterSizes[r][0];var q=d._alterSizes[r][1],s=d._alterSizes[r][2];o[n]==null?o[n]=q:q>o[n]&&(o[n]=q);p[n]==null?p[n]=s:s>p[n]&&
(p[n]=s)}for(n in e)o[n]!=null&&(e[n]=e[n]-o[n]+d._minWidth);for(n in f)p[n]!=null&&(f[n]=f[n]-p[n]+d._minHeight-(d.polyObj[n].childNodes[0].style.display!="none"?d.skinParams[d.skin].cpanel_height:0))}var w=65536;for(n in e)e[n]<w&&(w=e[n]);w-=d._minWidth;w=c[0]-w;w<d._dimension[0]&&!b&&(w=d._dimension[0]);var t=65536;for(n in f)f[n]<t&&(t=f[n]);t-=d._minHeight;t=c[1]-t;t<d._dimension[1]&&!b&&(t=d._dimension[1]);if(b==!0)return["",w,t];a.setMinDimension(w,t)};this._getNearestParents=function(a){for(var b=
a=="hor"?this._autoHor:this._autoVer,c={},d=0;d<b.length;d++){var e=b[d];if(this.polyObj[e]._collapsed==!0&&this.polyObj[e]._resize==a){for(var f=this.polyObj[e]._rowData,l=-1,n=0;n<f.length;n++)typeof f[n]=="object"?l=n:f[n]==e&&(l=n);var o=l,e=null;if(l>0)for(n=l-1;n>=0;n--)typeof f[n]=="object"?e=f[n]:this.polyObj[f[n]]._collapsed==!1&&e==null&&(e=f[n]);if(e==null)for(n=o;n<f.length;n++)typeof f[n]=="object"?e=f[n]:this.polyObj[f[n]]._collapsed==!1&&e==null&&(e=f[n])}if(e!=null){typeof e=="string"&&
(e=Array(e));for(n=0;n<e.length;n++)c[e[n]]=parseInt(a=="hor"?this.polyObj[e[n]].style.width:this.polyObj[e[n]].style.height)}}return c};this.setSizes=function(a){var b=this._defineWindowMinDimension(this.base,!0);this.cont.obj.setMinContentSize(b[1],b[2]);this.cont.obj.adjustContent(this.cont.obj,0);if(this.base.offsetParent){this.cont&&a!==!1&&this.cont.obj.adjustContent(this.cont.obj,this._mTop,null,null,this._mBottom);var c=this.base.offsetParent.offsetWidth-this.base.offsetWidth+(this._baseWFix!=
null?this._baseWFix:0),d=this.base.offsetParent.offsetHeight-this.base.offsetHeight+(this._baseHFix!=null?this._baseHFix:0);this.base.style.width=parseInt(this.base.style.width)+c+"px";this.base.style.height=parseInt(this.base.style.height)+d+"px";var e={},f;for(f in this._getNearestParents("hor"))this.polyObj[f].style.width=Math.max(0,parseInt(this.polyObj[f].style.width)+c)+"px",this.polyObj[f].childNodes[0].style.width=this.polyObj[f].style.width,e[f]=1;for(f in this._getNearestParents("ver"))this.polyObj[f].style.height=
Math.max(0,parseInt(this.polyObj[f].style.height)+d)+"px",this.polyObj[f].childNodes[0].style.height=this.polyObj[f].style.height,e[f]=1;for(f in e)this.polyObj[f].adjustContent(this.polyObj[f].childNodes[0],this.polyObj[f]._noHeader?0:this.skinParams[this.skin].cpanel_height),this.polyObj[f].updateNestedObjects();this.callEvent("onResizeFinish",[])}};dhtmlxEventable(this);this._init()}else alert(this.i18n.dhxcontalert)}
dhtmlXLayoutObject.prototype.unload=function(){this._isIPad?(document.removeEventListener("touchmove",this._doOnMouseMove,!1),document.removeEventListener("touchend",this._doOnMouseUp,!1)):_isIE?(document.body.detachEvent("onselectstart",this._doOnSelectStart),document.body.detachEvent("onmousemove",this._doOnMouseMove),document.body.detachEvent("onmouseup",this._doOnMouseUp)):(document.body.removeEventListener("mousemove",this._doOnMouseMove,!1),document.body.removeEventListener("mouseup",this._doOnMouseUp,
!1));this._doOnMouseUp=this._doOnMouseMove=this._doOnSelectStart=null;for(var a in this.polyObj){var b=this.polyObj[a];b._isCell=null;b.skin=null;b.getId=null;b.getIndex=null;b.showHeader=null;b.hideHeader=null;b.isHeaderVisible=null;b.setText=null;b.getText=null;b.expand=null;b.collapse=null;b.isCollapsed=null;b.dock=null;b.undock=null;b.setWidth=null;b.getWidth=null;b.setHeight=null;b.getHeight=null;b.fixSize=null;b.progressOn=null;b.progressOff=null;b._doOnAttachMenu=null;b._doOnAttachToolbar=
null;b._doOnAttachStatusBar=null;b._collapsed=null;b._idd=null;b._ind=null;b._rowData=null;b._dir=null;b._initCPanel=null;b._minW=null;b._minH=null;b._resize=null;b._savedH=null;b._savedW=null;b.ondblclick=null;var c=b.childNodes[0].childNodes[0];c.className="";c._dockCell=null;c._resize=null;c._h=null;c.ondblclick=null;c.childNodes[4].onclick=null;for(var d=0;d<c.childNodes.length;d++)c.childNodes[d].onselectstart=null;for(;c.childNodes.length>0;)c.removeChild(c.childNodes[0]);c.parentNode.removeChild(c);
c=null;b._dhxContDestruct();b._dhxContDestruct=null;b.removeChild(b.childNodes[0]);b.parentNode.removeChild(b);b=null}for(a in this.polyObj)this.polyObj[a]=null;for(var e=0;e<this.items.length;e++)this.items[e]=null;this.items=this.polyObj=null;for(var f=this.tpl.childNodes[0];f.childNodes.length>0;){for(;f.childNodes[0].childNodes.length>0;){d=f.childNodes[0].childNodes[0];d._top=null;d._bottom=null;d._left=null;d._right=null;d._dblClick=null;d._isSep=null;d._dir=null;d._lastClick=null;d.ondblclick=
null;d.onmousedown=null;d.onmouseup=null;for(d.onselectstart=null;d.childNodes.length>0;)d.removeChild(d.childNodes[0]);d.parentNode.removeChild(d);d=null}f.removeChild(f.childNodes[0])}f.parentNode.removeChild(f);f=null;this.tpl.parentNode.removeChild(this.tpl);this.tpl=null;for(a in this.sepHor)this.sepHor[a]=null;for(a in this.sepVer)this.sepVer[a]=null;this.sepVer=this.sepHor=null;if(this._ha){this.detachEvent(this._haEv);for(this._haEv=null;this._ha.childNodes.length>0;)this._ha.removeChild(this._ha.childNodes[0]);
this._ha.parentNode.removeChild(this._ha);this._ha=null}if(this._fa){this.detachEvent(this._faEv);for(this._faEv=null;this._fa.childNodes.length>0;)this._fa.removeChild(this._fa.childNodes[0]);this._fa.parentNode.removeChild(this._fa);this._fa=null}this._CPanelHeight=this._CPanelBtnsWidth=this.tplSizes=this.tplData=this.skinParams=this.skin=this.imagePath=this.h=this.w=this._xmlLoader=this._totalRows=this._totalCols=this._rowsRatio=this._colsRatio=this._resY=this._resX=this._resObj=this._resFunc=
this._minHeight=this._minWidth=this._mTop=this._mBottom=this._layoutView=this._effects=this._dimension=this._availAutoSize=this._autoVer=this._autoHor=this.attachFooter=this.attachHeader=null;this.sizer.parentNode&&this.sizer.parentNode.removeChild(this.sizer);this._resYMaxHeightBottom=this._resYMaxHeightTop=this._resXMaxWidthRight=this._resXMaxWidthLeft=this._resYStart=this._resXStart=this._minHTAlter=this._minHBAlter=this._minWRAlter=this._minWLAlter=this._collapsedW=this._collapsedH=this._dblClickTM=
this._doOnDoubleClick=this._autodetectSkin=this.dhx_SeverCatcherPath=this.i18n=this._isIPad=this._effect=this._autosize=this._cells=this.hideStatusBar=this.hideToolbar=this.hideMenu=this.showStatusBar=this.showToolbar=this.showMenu=this.detachStatusBar=this.detachToolbar=this.detachMenu=this.attachStatusBar=this.attachToolbar=this.attachMenu=this.setCollapsedText=this.updateNestedObjectsArray=this.unload=this.unDockWindow=this.showPanel=this.setText=this.setSkin=this.setSizes=this.setImagePath=this.setEffect=
this.setAutoSize=this.progressOn=this.progressOff=this.listViews=this.listAutoSizes=this.isPanelVisible=this.hidePanel=this.getTextTooltip=this.getText=this.getIndexById=this.getIdByIndex=this.getEffect=this.forEachItem=this.eventCatcher=this.dockWindow=this.detachEvent=this.checkEvent=this.cells=this.callEvent=this.attachToolbar=this.attachStatusBar=this.attachMenu=this.attachEvent=this._xmlParser=this._showCovers=this._setWidth=this._setW=this._setHeight=this._setH=this._resAreaData=this._resizeVer=
this._resizeStop=this._resizeHor=this._progressControlGlobal=this._progressControl=this._isResizable=this._isCollapsed=this._initWindows=this._init=this._hideCovers=this._getNearestParents=this._fixSplitters=this._fixSize=this._fixPositionInWin=this._fixIcons=this._findDockCellsVer=this._findDockCellsHor=this._expandEffect=this._expand=this._doExpand=this._doCollapse=this._defineWindowMinDimension=this._collectResAreaData=this._collapseEffect=this._collapse=this._checkAlterMinSize=this._changeCPanelText=
this._buildSurface=this._attachSizer=this._alterSizes=this.sizer=null;if(this.obj)this.obj.parentNode.removeChild(this.obj),this.obj=null;if(this.base&&this.base!=document.body)this.base.parentNode.removeChild(this.base),this.base=null;if(this.cont)this.cont.obj._dhxContDestruct(),this.cont=null;if(this.dhxWins)this.dhxWins.unload(),this.dhxWinsIdPrefix=this.dhxWins=null;if(this._doOnResizeStart)_isIE?window.detachEvent("onresize",this._doOnResizeStart):window.removeEventListener("resize",this._doOnResizeStart,
!1),this._tmTime=this._doOnResizeEnd=this._doOnResizeStart=null;this.detachAllEvents();that=this.detachAllEvents=null};
dhtmlXLayoutObject.prototype.tplData={"1C":'<layout><autosize hor="a" ver="a" rows="1" cols="1"/><table data="a"/><row><cell obj="a" wh="1,1" resize="ver" neighbors="a"/></row></layout>',"2E":'<layout><autosize hor="a;b" ver="b" rows="2" cols="1"/><table data="a;b"/><row><cell obj="a" wh="1,2" resize="ver" neighbors="a;b"/></row><row sep="true"><cell sep="hor" top="a" bottom="b" dblclick="a"/></row><row><cell obj="b" wh="1,2" resize="ver" neighbors="a;b"/></row></layout>',"2U":'<layout><autosize hor="b" ver="a;b" rows="1" cols="2"/><table data="a,b"/><row><cell obj="a" wh="2,1" resize="hor" neighbors="a;b"/><cell sep="ver" left="a" right="b"/><cell obj="b" wh="2,1" resize="hor" neighbors="a;b"/></row></layout>',
"3E":'<layout><autosize hor="a;b;c" ver="c" rows="3" cols="1"/><table data="a;b;c"/><row><cell obj="a" wh="1,3" resize="ver" neighbors="a;b;c"/></row><row sep="yes"><cell sep="hor" top="a" bottom="b;c" dblclick="a"/></row><row><cell obj="b" wh="1,3" resize="ver" neighbors="a;b;c"/></row><row sep="yes"><cell sep="hor" top="a;b" bottom="c" dblclick="b"/></row><row><cell obj="c" wh="1,3" resize="ver" neighbors="a;b;c"/></row></layout>',"3W":'<layout><autosize hor="c" ver="a;b;c" rows="1" cols="3"/><table data="a,b,c"/><row><cell obj="a" wh="3,1" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a" right="b;c" dblclick="a"/><cell obj="b" wh="3,1" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a;b" right="c" dblclick="b"/><cell obj="c" wh="3,1" resize="hor" neighbors="a;b;c"/></row></layout>',
"3J":'<layout><autosize hor="b" ver="b;c" rows="2" cols="2"/><table data="a,b;c,b"/><row><cell obj="a" wh="2,2" resize="ver" neighbors="a;c"/><cell sep="ver" left="a,c" right="b" dblclick="b" rowspan="3"/><cell obj="b" wh="2,1" resize="hor" neighbors="a,c;b" rowspan="3"/></row><row sep="yes"><cell sep="hor" top="a" bottom="c" dblclick="a"/></row><row><cell obj="c" wh="2,2" resize="ver" neighbors="a;c"/></row></layout>',"3T":'<layout><autosize hor="a;c" ver="b;c" rows="2" cols="2"/><table data="a,a;b,c"/><row><cell obj="a" wh="1,2" resize="ver" neighbors="a;b,c" colspan="3"/></row><row sep="true"><cell sep="hor" top="a" bottom="b,c" dblclick="a" colspan="3"/></row><row><cell obj="b" wh="2,2" resize="hor" neighbors="b;c"/><cell sep="ver" left="b" right="c" dblclick="b"/><cell obj="c" wh="2,2" resize="hor" neighbors="b;c"/></row></layout>',
"3L":'<layout><autosize hor="b;c" ver="a;c" rows="2" cols="2"/><table data="a,b;a,c"/><row><cell obj="a" wh="2,1" resize="hor" neighbors="a;b,c" rowspan="3"/><cell sep="ver" left="a" right="b,c" dblclick="a" rowspan="3"/><cell obj="b" wh="2,2" resize="ver" neighbors="b;c"/></row><row sep="true"><cell sep="hor" top="b" dblclick="b" bottom="c"/></row><row><cell obj="c" wh="b,2" resize="ver" neighbors="b;c"/></row></layout>',"3U":'<layout><autosize hor="b;c" ver="c" rows="2" cols="2"/><table data="a,b;c,c"/><row><cell obj="a" wh="2,2" resize="hor" neighbors="a;b"/><cell sep="ver" left="a" right="b" dblclick="a"/><cell obj="b" wh="2,2" resize="hor" neighbors="a;b"/></row><row sep="true"><cell sep="hor" top="a,b" bottom="c" dblclick="c" colspan="3"/></row><row><cell obj="c" wh="1,2" resize="ver" neighbors="a,b;c" colspan="3"/></row></layout>',
"4H":'<layout><autosize hor="d" ver="a;c;d" rows="2" cols="3"/><table data="a,b,d;a,c,d"/><row><cell obj="a" wh="3,1" resize="hor" neighbors="a;b,c;d" rowspan="3"/><cell sep="ver" left="a" right="b,c;d" dblclick="a" rowspan="3"/><cell obj="b" wh="3,2" resize="ver" neighbors="b;c"/><cell sep="ver" left="a;b,c" right="d" dblclick="d" rowspan="3"/><cell obj="d" wh="3,1" resize="hor" neighbors="a;b,c;d" rowspan="3"/></row><row sep="true"><cell sep="hor" top="b" dblclick="b" bottom="c"/></row><row><cell obj="c" wh="3,2" resize="ver" neighbors="b;c"/></row></layout>',
"4I":'<layout><autosize hor="a;c;d" ver="d" rows="3" cols="2"/><table data="a,a;b,c;d,d"/><row><cell obj="a" wh="1,3" resize="ver" neighbors="a;b,c;d" colspan="3"/></row><row sep="true"><cell sep="hor" top="a" bottom="b,c;d" dblclick="a" colspan="3"/></row><row><cell obj="b" wh="2,3" resize="hor" neighbors="b;c"/><cell sep="ver" left="b" dblclick="b" right="c"/><cell obj="c" wh="2,3" resize="hor" neighbors="b;c"/></row><row sep="true"><cell sep="hor" top="a;b,c" bottom="d" dblclick="d" colspan="3"/></row><row><cell obj="d" wh="1,3" resize="ver" neighbors="a;b,c;d" colspan="3"/></row></layout>',
"4T":'<layout><autosize hor="a;d" ver="b;c;d" rows="2" cols="3"/><table data="a,a,a;b,c,d"/><row><cell obj="a" wh="1,2" resize="ver" neighbors="a;b,c,d" colspan="5"/></row><row sep="true"><cell sep="hor" top="a" bottom="b,c,d" dblclick="a" colspan="5"/></row><row><cell obj="b" wh="3,2" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b" right="c;d" dblclick="b"/><cell obj="c" wh="3,2" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b;c" right="d" dblclick="c"/><cell obj="d" wh="3,2" resize="hor" neighbors="b;c;d"/></row></layout>',
"4U":'<layout><autosize hor="c;d" ver="d" rows="2" cols="3"/><table data="a,b,c;d,d,d"/><row><cell obj="a" wh="3,2" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a" right="b;c" dblclick="a"/><cell obj="b" wh="3,2" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a;b" right="c" dblclick="b"/><cell obj="c" wh="3,2" resize="hor" neighbors="a;b;c"/></row><row sep="true"><cell sep="hor" top="a,b,c" bottom="d" dblclick="d" colspan="5"/></row><row><cell obj="d" wh="1,2" resize="ver" neighbors="a,b,c;d" colspan="5"/></row></layout>',
"5H":'<layout><autosize hor="b;c;d" ver="a;c;e" rows="3" cols="3"/><table data="a,b,e;a,c,e;a,d,e"/><row><cell obj="a" wh="3,1" resize="hor" neighbors="a;b,c,d" rowspan="5"/><cell sep="ver" left="a" right="b,c,d;e" dblclick="a" rowspan="5"/><cell obj="b" wh="3,3" resize="ver" neighbors="b;c;d"/><cell sep="ver" left="a;b,c,d" right="e" dblclick="e" rowspan="5"/><cell obj="e" wh="3,1" resize="hor" neighbors="b,c,d;e" rowspan="5"/></row><row sep="true"><cell sep="hor" top="b" dblclick="b" bottom="c;d"/></row><row><cell obj="c" wh="3,3" resize="ver" neighbors="b;c;d"/></row><row sep="true"><cell sep="hor" top="b;c" dblclick="c" bottom="d"/></row><row><cell obj="d" wh="3,3" resize="ver" neighbors="b;c;d"/></row></layout>',
"5I":'<layout><autosize hor="a;d;e" ver="e" rows="3" cols="3"/><table data="a,a,a;b,c,d;e,e,e"/><row><cell obj="a" wh="1,3" resize="ver" neighbors="a;b,c,d;e" colspan="5"/></row><row sep="match"><cell sep="hor" top="a" bottom="b,c,d;e" dblclick="a" colspan="5"/></row><row><cell obj="b" wh="3,3" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b" right="c;d" dblclick="b"/><cell obj="c" wh="3,3" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b;c" right="d" dblclick="c"/><cell obj="d" wh="3,3" resize="hor" neighbors="b;c;d"/></row><row sep="match"><cell sep="hor" top="a;b,c,d" bottom="e" dblclick="e" colspan="5"/></row><row><cell obj="e" wh="1,3" resize="ver" neighbors="a;b,c,d;e" colspan="5"/></row></layout>',
"6I":'<layout><autosize hor="a;e;f" ver="f" rows="3" cols="4"/><table data="a,a,a,a;b,c,d,e;f,f,f,f"/><row><cell obj="a" wh="1,3" resize="ver" neighbors="a;b,c,d,e;f" colspan="7"/></row><row sep="true"><cell sep="hor" top="a" bottom="b,c,d,e;f" dblclick="a" colspan="7"/></row><row><cell obj="b" wh="4,3" resize="hor" neighbors="b;c;d;e"/><cell sep="ver" left="b" right="c;d;e" dblclick="b"/><cell obj="c" wh="4,3" resize="hor" neighbors="b;c;d;e"/><cell sep="ver" left="b;c" right="d;e" dblclick="c"/><cell obj="d" wh="4,3" resize="hor" neighbors="b;c;d;e"/><cell sep="ver" left="b;c;d" right="e" dblclick="d"/><cell obj="e" wh="4,3" resize="hor" neighbors="b;c;d;e"/></row><row sep="true"><cell sep="hor" top="a;b,c,d,e" bottom="f" dblclick="f" colspan="7"/></row><row><cell obj="f" wh="1,3" resize="ver" neighbors="a;b,c,d,e;f" colspan="7"/></row></layout>'};
dhtmlXLayoutObject.prototype._availAutoSize={"1C_hor":["a"],"1C_ver":["a"],"2E_hor":["a;b"],"2E_ver":["a","b"],"2U_hor":["a","b"],"2U_ver":["a;b"],"3E_hor":["a;b;c"],"3E_ver":["a","b","c"],"3W_hor":["a","b","c"],"3W_ver":["a;b;c"],"3J_hor":["a;c","b"],"3J_ver":["a;b","c;b"],"3T_hor":["a;b","a;c"],"3T_ver":["a","b;c"],"3L_hor":["a","b;c"],"3L_ver":["a;b","a;c"],"3U_hor":["a;c","b;c"],"3U_ver":["a;b","c"],"4H_hor":["a","b;c","d"],"4H_ver":["a;b;d","a;c;d"],"4I_hor":["a;b;d","a;c;d"],"4I_ver":["a","b;c",
"d"],"4T_hor":["a;b","a;c","a;d"],"4T_ver":["a","b;c;d"],"4U_hor":["a;d","b;d","c;d"],"4U_ver":["a;b;c","d"],"5H_hor":["a","b;c;d","e"],"5H_ver":["a;b;e","a;c;e","a;d;e"],"5I_hor":["a;b;e","a;c;e","a;d;e"],"5I_ver":["a","b;c;d","e"],"6I_hor":["a;b;f","a;c;f","a;d;f","a;e;f"],"6I_ver":["a","b;c;d;e","f"]};
dhtmlXLayoutObject.prototype.setCollapsedText=function(a,b){if(this.polyObj[a]){var c=this.polyObj[a].childNodes[0].childNodes[0];if(c.childNodes[c.childNodes.length-1]._ct===!0)var d=c.childNodes[c.childNodes.length-1];else d=document.createElement("DIV"),d._ct=!0,d.className="dhtmlxInfoBarLabel_collapsed_"+this.polyObj[a]._resize,c.appendChild(d);d.innerHTML=b;this._fixCollapsedText();c=null}};
dhtmlXLayoutObject.prototype._fixCollapsedText=function(){for(var a in this.polyObj)if(this.polyObj[a]._resize=="hor"){var b=this.polyObj[a].childNodes[0].childNodes[0];if(b.childNodes[b.childNodes.length-1]._ct===!0)b.childNodes[b.childNodes.length-1].style.width=Math.max(0,b.offsetHeight-b.childNodes[4].offsetTop-b.childNodes[4].offsetHeight-12)+"px"}};dhtmlXLayoutObject.prototype.i18n={dhxcontalert:"dhtmlxcontainer.js is missed on the page",collapse:"Collapse",expand:"Expand",dock:"Dock",undock:"UnDock"};
(function(){dhtmlx.extend_api("dhtmlXLayoutObject",{_init:function(a){return[a.parent,a.pattern,a.skin]},image_path:"setImagePath",effect:"_effect",cells:"_cells",autosize:"_autosize"},{_cells:function(a){for(var b=0;b<a.length;b++){var c=a[b],d=this.cells(c.id);d&&(c.height&&d.setHeight(c.height),c.width&&d.setWidth(c.width),c.text&&d.setText(c.text),c.collapse&&d.collapse(),c.fix_size&&d.fixSize(c.fix_size[0],c.fix_size[1]),c.header===!1&&d.hideHeader())}},_autosize:function(a){this.setAutoSize(a[0],
a[1])},_effect:function(a){a.collapse&&this.setEffect("collapse",a.collapse);a.resize&&this.setEffect("resize",a.resize);a.highlight&&this.setEffect("highlight",a.highlight)}})})();
dhtmlXLayoutObject.prototype.attachHeader=function(a){if(!this._ha){typeof a!="object"&&(a=document.getElementById(a));var b=a.offsetHeight+(this.skin=="dhx_web"?9:2)+2;this.cont.obj._offsetTop=b;this.cont.obj._offsetHeight=-b;this.setSizes();this._ha=document.createElement("DIV");this._ha.style.position="absolute";this._ha.style.top="2px";this._ha.style.left=this.cont.obj.vs[this.cont.obj.av].dhxcont.style.left;this._ha.style.width=this.cont.obj.vs[this.cont.obj.av].dhxcont.style.width;this._ha.style.height=
a.offsetHeight+"px";document.body.appendChild(this._ha);this._ha.appendChild(a);this._haEv=this.attachEvent("onResizeFinish",function(){this._ha.style.width=this.cont.obj.vs[this.cont.obj.av].dhxcont.style.width})}};
dhtmlXLayoutObject.prototype.attachFooter=function(a){if(!this._fa){typeof a!="object"&&(a=document.getElementById(a));var b=a.offsetHeight+(this.skin=="dhx_web"?9:2)-2;this.cont.obj._offsetHeight-=b;this.setSizes();this._fa=document.createElement("DIV");this._fa.style.position="absolute";this._fa.style.bottom="2px";this._fa.style.left=this.cont.obj.vs[this.cont.obj.av].dhxcont.style.left;this._fa.style.width=this.cont.obj.vs[this.cont.obj.av].dhxcont.style.width;this._fa.style.height=a.offsetHeight+
"px";document.body.appendChild(this._fa);this._fa.appendChild(a);this._faEv=this.attachEvent("onResizeFinish",function(){this._fa.style.width=this.cont.obj.vs[this.cont.obj.av].dhxcont.style.width})}};dhtmlXLayoutObject.prototype._fixToolbars=function(){if(_isIE)for(var a in this.polyObj)this.polyObj[a].vs[this.polyObj[a].av].toolbar!=null&&this.polyObj[a].vs[this.polyObj[a].av].toolbar._fixSpacer()};
dhtmlXLayoutObject.prototype._hideBorders=function(){if(this.skin=="dhx_terrace"){this._cpm_old=this.skinParams[this.skin].cell_pading_max;this.skinParams[this.skin].cell_pading_max=[1,0,0,0];for(var a in this.polyObj)this.polyObj[a]._setPadding(this.skinParams[this.skin].cell_pading_max,"dhxcont_layout_"+this.skin),this.polyObj[a].adjustContent(this.polyObj[a].childNodes[0],this.skinParams[this.skin].cpanel_height)}};
function dhtmlXMenuObject(a,b){var c=this;this.addBaseIdAsContextZone=null;this.isDhtmlxMenuObject=!0;this.skin=b!=null?b:typeof dhtmlx!="undefined"&&typeof dhtmlx.skin=="string"?dhtmlx.skin:"dhx_skyblue";this.imagePath="";this._isIE6=!1;if(_isIE)this._isIE6=window.XMLHttpRequest==null?!0:!1;if(a==null)this.base=document.body;else{var d=typeof a=="string"?document.getElementById(a):a;if(d!=null){this.base=d;if(!this.base.id)this.base.id=(new Date).valueOf();for(;this.base.childNodes.length>0;)this.base.removeChild(this.base.childNodes[0]);
this.base.className+=" dhtmlxMenu_"+this.skin+"_Middle dir_left";this.base._autoSkinUpdate=!0;if(this.base.oncontextmenu)this.base._oldContextMenuHandler=this.base.oncontextmenu;this.addBaseIdAsContextZone=this.base.id;this.base.onselectstart=function(a){a=a||event;return a.returnValue=!1};this.base.oncontextmenu=function(a){a=a||event;return a.returnValue=!1}}else this.base=document.body}this.topId="dhxWebMenuTopId";if(!this.extendedModule){for(var e=function(){alert(this.i18n.dhxmenuextalert)},
f="setItemEnabled,setItemDisabled,isItemEnabled,_changeItemState,getItemText,setItemText,loadFromHTML,hideItem,showItem,isItemHidden,_changeItemVisible,setUserData,getUserData,setOpenMode,setWebModeTimeout,enableDynamicLoading,_updateLoaderIcon,getItemImage,setItemImage,clearItemImage,setAutoShowMode,setAutoHideMode,setContextMenuHideAllMode,getContextMenuHideAllMode,setVisibleArea,setTooltip,getTooltip,setHotKey,getHotKey,setItemSelected,setTopText,setRTL,setAlign,setHref,clearHref,getCircuit,_clearAllSelectedSubItemsInPolygon,_checkArrowsState,_addUpArrow,_addDownArrow,_removeUpArrow,_removeDownArrow,_isArrowExists,_doScrollUp,_doScrollDown,_countPolygonItems,setOverflowHeight,_getRadioImgObj,_setRadioState,_radioOnClickHandler,getRadioChecked,setRadioChecked,addRadioButton,_getCheckboxState,_setCheckboxState,_readLevel,_updateCheckboxImage,_checkboxOnClickHandler,setCheckboxState,getCheckboxState,addCheckbox,serialize".split(","),
g=0;g<f.length;g++)this[f[g]]||(this[f[g]]=e);f=null}this.fixedPosition=!1;this.menuLastClicked=this.menuSelected=-1;this.idPrefix="";this.itemTagName="item";this.itemTextTagName="itemtext";this.userDataTagName="userdata";this.itemTipTagName="tooltip";this.itemHotKeyTagName="hotkey";this.itemHrefTagName="href";this.dirTopLevel="bottom";this.dirSubLevel="right";this.menuY2=this.menuY1=this.menuX2=this.menuX1=null;this.menuMode="web";this.menuTimeoutMsec=400;this.menuTimeoutHandler=null;this.autoOverflow=
!1;this.idPull={};this.itemPull={};this.userData={};this.radio={};this._rtl=!1;this._align="left";this.menuTouched=!1;this.zInd=this.zIndInit=1200;this.zIndStep=50;this.menuModeTopLevelTimeout=!0;this.menuModeTopLevelTimeoutTime=200;this._topLevelBottomMargin=1;this._topLevelRightMargin=0;this._topLevelOffsetLeft=1;this._arrowFFFix=_isIE?document.compatMode=="BackCompat"?0:-4:-4;this.setSkin=function(a){var b=this.skin;this.skin=a;switch(this.skin){case "dhx_black":case "dhx_blue":case "dhx_skyblue":case "dhx_web":this._topLevelBottomMargin=
2;this._topLevelOffsetLeft=this._topLevelRightMargin=1;this._arrowFFFix=_isIE?document.compatMode=="BackCompat"?0:-4:-4;break;case "dhx_web":this._arrowFFFix=0;break;case "dhx_terrace":this._topLevelOffsetLeft=this._topLevelRightMargin=this._topLevelBottomMargin=0,this._arrowFFFix=_isIE?document.compatMode=="BackCompat"?0:-4:-4}if(this.base._autoSkinUpdate)this.base.className=this.base.className.replace("dhtmlxMenu_"+b+"_Middle","")+" dhtmlxMenu_"+this.skin+"_Middle";for(var c in this.idPull)this.idPull[c].className=
String(this.idPull[c].className).replace(b,this.skin)};this.setSkin(this.skin);this.dLoad=!1;this.dLoadUrl="";this.dLoadSign="?";this.loaderIcon=!1;this.limit=0;this._scrollUpTM=null;this._scrollUpTMTime=20;this._scrollUpTMStep=3;this._scrollDownTM=null;this._scrollDownTMTime=20;this._scrollDownTMStep=3;this.context=!1;this.contextZones={};this.contextMenuZoneId=!1;this.contextHideAllMode=this.contextAutoHide=this.contextAutoShow=!0;this._selectedSubItems=[];this._openedPolygons=[];this._addSubItemToSelected=
function(a,b){for(var c=!0,d=0;d<this._selectedSubItems.length;d++)this._selectedSubItems[d][0]==a&&this._selectedSubItems[d][1]==b&&(c=!1);c==!0&&this._selectedSubItems.push([a,b]);return c};this._removeSubItemFromSelected=function(a,b){for(var c=[],d=!1,e=0;e<this._selectedSubItems.length;e++)this._selectedSubItems[e][0]==a&&this._selectedSubItems[e][1]==b?d=!0:c[c.length]=this._selectedSubItems[e];if(d==!0)this._selectedSubItems=c;return d};this._getSubItemToDeselectByPolygon=function(a){for(var b=
[],c=0;c<this._selectedSubItems.length;c++)if(this._selectedSubItems[c][1]==a){b[b.length]=this._selectedSubItems[c][0];for(var b=b.concat(this._getSubItemToDeselectByPolygon(this._selectedSubItems[c][0])),d=!0,e=0;e<this._openedPolygons.length;e++)this._openedPolygons[e]==this._selectedSubItems[c][0]&&(d=!1);d==!0&&(this._openedPolygons[this._openedPolygons.length]=this._selectedSubItems[c][0]);this._selectedSubItems[c][0]=-1;this._selectedSubItems[c][1]=-1}return b};this._hidePolygon=function(a){if(this.idPull["polygon_"+
a]!=null){if(typeof this._menuEffect!="undefined"&&this._menuEffect!==!1)this._hidePolygonEffect("polygon_"+a);else{if(this.idPull["polygon_"+a].style.display=="none")return;this.idPull["polygon_"+a].style.display="none";if(this.idPull["arrowup_"+a]!=null)this.idPull["arrowup_"+a].style.display="none";if(this.idPull["arrowdown_"+a]!=null)this.idPull["arrowdown_"+a].style.display="none";this._updateItemComplexState(a,!0,!1);if(this._isIE6&&this.idPull["polygon_"+a+"_ie6cover"]!=null)this.idPull["polygon_"+
a+"_ie6cover"].style.display="none"}a=String(a).replace(this.idPrefix,"");a==this.topId&&(a=null);this.callEvent("onHide",[a]);a!=null&&this.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+a].parent==this.idPrefix+this.topId&&this._improveTerraceButton(this.idPrefix+a,!0)}};this._showPolygon=function(a,b){var c=this._countVisiblePolygonItems(a);if(c!=0){var d="polygon_"+a;if(this.idPull[d]!=null&&this.idPull[a]!=null&&(!this.menuModeTopLevelTimeout||this.menuMode!="web"||this.context||this.idPull[a]._mouseOver||
b!=this.dirTopLevel)){this.fixedPosition||this._autoDetectVisibleArea();var e=0,f=0,g=null,o=null;this.idPull[d].style.visibility="hidden";this.idPull[d].style.left="0px";this.idPull[d].style.top="0px";this.idPull[d].style.display="";this.idPull[d].style.zIndex=this.zInd;if(this.autoOverflow)if(this.idPull[d].firstChild.offsetHeight>this.menuY1+this.menuY2){var p=Math.floor((this.menuY2-this.menuY1-35)/24);this.limit=p}else this.limit=0,this.idPull["arrowup_"+a]!=null&&this._removeUpArrow(String(a).replace(this.idPrefix,
"")),this.idPull["arrowdown_"+a]!=null&&this._removeDownArrow(String(a).replace(this.idPrefix,""));if(this.limit>0&&this.limit<c)this.idPull["arrowup_"+a]==null&&this._addUpArrow(String(a).replace(this.idPrefix,"")),this.idPull["arrowdown_"+a]==null&&this._addDownArrow(String(a).replace(this.idPrefix,"")),g=this.idPull["arrowup_"+a],g.style.visibility="hidden",g.style.display="",g.style.zIndex=this.zInd,e=g.offsetHeight,o=this.idPull["arrowdown_"+a],o.style.visibility="hidden",o.style.display="",
o.style.zIndex=this.zInd,f=o.offsetHeight;if(this.limit>0)this.limit<c?(this.idPull[d].style.height=24*this.limit+"px",this.idPull[d].scrollTop=0):this.idPull[d].style.height="";this.zInd+=this.zIndStep;if(this.itemPull[a]!=null)var r="polygon_"+this.itemPull[a].parent;else this.context&&(r=this.idPull[this.idPrefix+this.topId]);var q=this.idPull[a].tagName!=null?getAbsoluteLeft(this.idPull[a]):this.idPull[a][0],s=this.idPull[a].tagName!=null?getAbsoluteTop(this.idPull[a]):this.idPull[a][1],w=this.idPull[a].tagName!=
null?this.idPull[a].offsetWidth:0,t=this.idPull[a].tagName!=null?this.idPull[a].offsetHeight:0,v=0,u=0,x=this.idPull[d].offsetWidth,A=this.idPull[d].offsetHeight+e+f;b=="bottom"&&(v=this._rtl?q+(w!=null?w:0)-x:this._align=="right"?q+w-x:q-1+(b==this.dirTopLevel?this._topLevelRightMargin:0),u=s-1+t+this._topLevelBottomMargin);b=="right"&&(v=q+w-1,u=s+2);b=="left"&&(v=q-this.idPull[d].offsetWidth+2,u=s+2);b=="top"&&(v=q-1,u=s-A+2);if(this.fixedPosition)var y=65536,B=65536;else if(y=this.menuX2!=null?
this.menuX2:0,B=this.menuY2!=null?this.menuY2:0,y==0)window.innerWidth?(y=window.innerWidth,B=window.innerHeight):(y=document.body.offsetWidth,B=document.body.scrollHeight);v+x>y&&!this._rtl&&(v=q-x+2);v<this.menuX1&&this._rtl&&(v=q+w-2);v<0&&(v=0);u+A>B&&this.menuY2!=null&&(u=Math.max(s+t-A+2,this._isVisibleArea?this.menuY1+2:2),this.context&&this.idPrefix+this.topId==a&&o!=null&&(u-=2),this.itemPull[a]!=null&&!this.context&&this.itemPull[a].parent==this.idPrefix+this.topId&&(u-=this.base.offsetHeight));
this.idPull[d].style.left=v+"px";this.idPull[d].style.top=u+e+"px";if(typeof this._menuEffect!="undefined"&&this._menuEffect!==!1)this._showPolygonEffect(d);else{this.idPull[d].style.visibility="";if(this.limit>0&&this.limit<c)g.style.left=v+"px",g.style.top=u+"px",g.style.width=x+this._arrowFFFix+"px",g.style.visibility="",o.style.left=v+"px",o.style.top=u+A-f+"px",o.style.width=x+this._arrowFFFix+"px",o.style.visibility="",this._checkArrowsState(a);if(this._isIE6){var z=d+"_ie6cover";if(this.idPull[z]==
null){var C=document.createElement("IFRAME");C.className="dhtmlxMenu_IE6CoverFix_"+this.skin;C.frameBorder=0;C.setAttribute("src","javascript:false;");document.body.insertBefore(C,document.body.firstChild);this.idPull[z]=C}this.idPull[z].style.left=v+"px";this.idPull[z].style.top=u+"px";this.idPull[z].style.width=x+"px";this.idPull[z].style.height=A+"px";this.idPull[z].style.zIndex=this.idPull[d].style.zIndex-1;this.idPull[z].style.display=""}}a=String(a).replace(this.idPrefix,"");a==this.topId&&
(a=null);this.callEvent("onShow",[a]);a!=null&&this.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+a].parent==this.idPrefix+this.topId&&this._improveTerraceButton(this.idPrefix+a,!1)}}};this._redistribSubLevelSelection=function(a,b){for(;this._openedPolygons.length>0;)this._openedPolygons.pop();var c=this._getSubItemToDeselectByPolygon(b);this._removeSubItemFromSelected(-1,-1);for(var d=0;d<c.length;d++)if(this.idPull[c[d]]!=null&&c[d]!=a&&this.itemPull[c[d]].state=="enabled")this.idPull[c[d]].className=
"sub_item";for(d=0;d<this._openedPolygons.length;d++)this._openedPolygons[d]!=b&&this._hidePolygon(this._openedPolygons[d]);if(this.itemPull[a].state=="enabled"){this.idPull[a].className="sub_item_selected";if(this.itemPull[a].complex&&this.dLoad&&this.itemPull[a].loaded=="no"){this.loaderIcon==!0&&this._updateLoaderIcon(a,!0);var e=new dtmlXMLLoaderObject(this._xmlParser,window);this.itemPull[a].loaded="get";this.callEvent("onXLS",[]);e.loadXML(this.dLoadUrl+this.dLoadSign+"action=loadMenu&parentId="+
a.replace(this.idPrefix,"")+"&etc="+(new Date).getTime())}if((this.itemPull[a].complex||this.dLoad&&this.itemPull[a].loaded=="yes")&&this.itemPull[a].complex&&this.idPull["polygon_"+a]!=null)this._updateItemComplexState(a,!0,!0),this._showPolygon(a,this.dirSubLevel);this._addSubItemToSelected(a,b);this.menuSelected=a}};this._doOnClick=function(a,b,c){this.menuLastClicked=a;if(this.itemPull[this.idPrefix+a].href_link!=null&&this.itemPull[this.idPrefix+a].state=="enabled"){var d=document.createElement("FORM"),
e=String(this.itemPull[this.idPrefix+a].href_link).split("?");d.action=e[0];if(e[1]!=null)for(var f=String(e[1]).split("&"),g=0;g<f.length;g++){var o=String(f[g]).split("="),p=document.createElement("INPUT");p.type="hidden";p.name=o[0]||"";p.value=o[1]||"";d.appendChild(p)}if(this.itemPull[this.idPrefix+a].href_target!=null)d.target=this.itemPull[this.idPrefix+a].href_target;d.style.display="none";document.body.appendChild(d);d.submit();d!=null&&(document.body.removeChild(d),d=null)}else if(b.charAt(0)!=
"c"&&b.charAt(1)!="d"&&b.charAt(2)!="s"){if(this.checkEvent("onClick"))this.callEvent("onClick",[a,this.contextMenuZoneId,c]);else if(b.charAt(1)=="d"||this.menuMode=="win"&&b.charAt(2)=="t")return;this.context&&this._isContextMenuVisible()&&this.contextAutoHide?this._hideContextMenu():this._clearAndHide&&this._clearAndHide()}};this._doOnTouchMenu=function(a){if(this.menuTouched==!1)this.menuTouched=!0,this.checkEvent("onTouch")&&this.callEvent("onTouch",[a])};this._searchMenuNode=function(a,b){for(var c=
[],d=0;d<b.length;d++)if(typeof b[d]=="object"){b[d].length==5&&typeof b[d][0]!="object"&&b[d][0].replace(this.idPrefix,"")==a&&d==0&&(c=b);var e=this._searchMenuNode(a,b[d]);e.length>0&&(c=e)}return c};this._getMenuNodes=function(a){var b=[],c;for(c in this.itemPull)this.itemPull[c].parent==a&&(b[b.length]=c);return b};this._genStr=function(a){for(var b="",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",d=0;d<a;d++)b+=c.charAt(Math.round(Math.random()*(c.length-1)));return b};
this.getItemType=function(a){a=this.idPrefix+a;return this.itemPull[a]==null?null:this.itemPull[a].type};this.forEachItem=function(a){for(var b in this.itemPull)a(String(b).replace(this.idPrefix,""))};this._clearAndHide=function(){c.menuSelected=-1;for(c.menuLastClicked=-1;c._openedPolygons.length>0;)c._openedPolygons.pop();for(var a=0;a<c._selectedSubItems.length;a++){var b=c._selectedSubItems[a][0];if(c.idPull[b]!=null&&c.itemPull[b].state=="enabled"){if(c.idPull[b].className=="sub_item_selected")c.idPull[b].className=
"sub_item";if(c.idPull[b].className=="dhtmlxMenu_"+c.skin+"_TopLevel_Item_Selected")c.idPull[b].className=c.itemPull[b].cssNormal!=null?c.itemPull[b].cssNormal:"dhtmlxMenu_"+c.skin+"_TopLevel_Item_Normal"}c._hidePolygon(b)}c.menuTouched=!1;if(c.context)c.contextHideAllMode?(c._hidePolygon(c.idPrefix+c.topId),c.zInd=c.zIndInit):c.zInd=c.zIndInit+c.zIndStep};this._doOnLoad=function(){};this.loadXML=function(a,b){if(b)this._doOnLoad=function(){b()};this.callEvent("onXLS",[]);this._xmlLoader.loadXML(a)};
this.loadXMLString=function(a,b){if(b)this._doOnLoad=function(){b()};this._xmlLoader.loadXMLString(a)};this._buildMenu=function(a,b){for(var c=0,d=0;d<a.childNodes.length;d++)if(a.childNodes[d].tagName==this.itemTagName){var e=a.childNodes[d],f={};f.id=this.idPrefix+(e.getAttribute("id")||this._genStr(24));f.title=e.getAttribute("text")||"";f.imgen=e.getAttribute("img")||"";f.imgdis=e.getAttribute("imgdis")||"";f.tip="";f.hotkey="";e.getAttribute("cssNormal")!=null&&(f.cssNormal=e.getAttribute("cssNormal"));
f.type=e.getAttribute("type")||"item";if(f.type=="checkbox")f.checked=e.getAttribute("checked")!=null,f.imgen="chbx_"+(f.checked?"1":"0"),f.imgdis=f.imgen;if(f.type=="radio")f.checked=e.getAttribute("checked")!=null,f.imgen="rdbt_"+(f.checked?"1":"0"),f.imgdis=f.imgen,f.group=e.getAttribute("group")||this._genStr(24),this.radio[f.group]==null&&(this.radio[f.group]=[]),this.radio[f.group][this.radio[f.group].length]=f.id;f.state=e.getAttribute("enabled")!=null||e.getAttribute("disabled")!=null?e.getAttribute("enabled")==
"false"||e.getAttribute("disabled")=="true"?"disabled":"enabled":"enabled";f.parent=b!=null?b:this.idPrefix+this.topId;f.complex=this.dLoad?e.getAttribute("complex")!=null?!0:!1:this._buildMenu(e,f.id)>0;this.dLoad&&f.complex&&(f.loaded="no");this.itemPull[f.id]=f;for(var g=0;g<e.childNodes.length;g++){var o=e.childNodes[g].tagName;o!=null&&(o=o.toLowerCase());if(o==this.userDataTagName){var p=e.childNodes[g];p.getAttribute("name")!=null&&(this.userData[f.id+"_"+p.getAttribute("name")]=p.firstChild!=
null&&p.firstChild.nodeValue!=null?p.firstChild.nodeValue:"")}if(o==this.itemTextTagName)f.title=e.childNodes[g].firstChild.nodeValue;if(o==this.itemTipTagName)f.tip=e.childNodes[g].firstChild.nodeValue;if(o==this.itemHotKeyTagName)f.hotkey=e.childNodes[g].firstChild.nodeValue;if(o==this.itemHrefTagName&&f.type=="item")f.href_link=e.childNodes[g].firstChild.nodeValue,e.childNodes[g].getAttribute("target")!=null&&(f.href_target=e.childNodes[g].getAttribute("target"))}c++}return c};this._xmlParser=
function(){if(c.dLoad){var a=this.getXMLTopNode("menu");parentId=a.getAttribute("parentId")!=null?a.getAttribute("parentId"):null;if(parentId==null)c._buildMenu(a,null),c._initTopLevelMenu();else{c._buildMenu(a,c.idPrefix+parentId);c._addSubMenuPolygon(c.idPrefix+parentId,c.idPrefix+parentId);if(c.menuSelected==c.idPrefix+parentId){var b=c.idPrefix+parentId,d=c.itemPull[c.idPrefix+parentId].parent==c.idPrefix+c.topId,e=d&&!c.context?c.dirTopLevel:c.dirSubLevel,f=!1;if(d&&c.menuModeTopLevelTimeout&&
c.menuMode=="web"&&!c.context){var g=c.idPull[c.idPrefix+parentId];if(g._mouseOver==!0){var n=c.menuModeTopLevelTimeoutTime-((new Date).getTime()-g._dynLoadTM);if(n>1)g._menuOpenTM=window.setTimeout(function(){c._showPolygon(b,e)},n),f=!0}}f||c._showPolygon(b,e)}c.itemPull[c.idPrefix+parentId].loaded="yes";c.loaderIcon==!0&&c._updateLoaderIcon(c.idPrefix+parentId,!1)}this.destructor();c.callEvent("onXLE",[])}else a=this.getXMLTopNode("menu"),c._buildMenu(a,null),c.init(),c.callEvent("onXLE",[]),c._doOnLoad()};
this._xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window);this._showSubLevelItem=function(a,b){if(document.getElementById("arrow_"+this.idPrefix+a)!=null)document.getElementById("arrow_"+this.idPrefix+a).style.display=b?"none":"";if(document.getElementById("image_"+this.idPrefix+a)!=null)document.getElementById("image_"+this.idPrefix+a).style.display=b?"none":"";if(document.getElementById(this.idPrefix+a)!=null)document.getElementById(this.idPrefix+a).style.display=b?"":"none"};this._hideSubLevelItem=
function(a){this._showSubLevelItem(a,!0)};this.idPrefix=this._genStr(12);this._bodyClick=function(a){a=a||event;a.button==2||_isOpera&&a.ctrlKey==!0||(c.context?c.contextAutoHide&&(!_isOpera||c._isContextMenuVisible()&&_isOpera)&&c._hideContextMenu():c._clearAndHide&&c._clearAndHide())};this._bodyContext=function(a){var a=a||event,b=(a.srcElement||a.target).className;if(!(b.search("dhtmlxMenu")!=-1&&b.search("SubLevelArea")!=-1)){for(var d=!0,e=a.target||a.srcElement;e!=null;)e.id!=null&&c.isContextZone(e.id)&&
(d=!1),e==document.body&&(d=!1),e=e.parentNode;d&&c.hideContextMenu()}};_isIE?(document.body.attachEvent("onclick",this._bodyClick),document.body.attachEvent("oncontextmenu",this._bodyContext)):(window.addEventListener("click",this._bodyClick,!1),window.addEventListener("contextmenu",this._bodyContext,!1));this._UID=this._genStr(32);dhtmlxMenuObjectLiveInstances[this._UID]=this;dhtmlxEventable(this);return this}
dhtmlXMenuObject.prototype.init=function(){if(this._isInited!=!0)this.dLoad?(this.callEvent("onXLS",[]),this._xmlLoader.loadXML(this.dLoadUrl+this.dLoadSign+"action=loadMenu&etc="+(new Date).getTime())):(this._initTopLevelMenu(),this._isInited=!0)};
dhtmlXMenuObject.prototype._countVisiblePolygonItems=function(a){var b=0,c;for(c in this.itemPull){var d=this.itemPull[c].parent,e=this.itemPull[c].type;this.idPull[c]!=null&&d==a&&(e=="item"||e=="radio"||e=="checkbox")&&this.idPull[c].style.display!="none"&&b++}return b};
dhtmlXMenuObject.prototype._redefineComplexState=function(a){if(this.idPrefix+this.topId!=a&&this.idPull["polygon_"+a]!=null&&this.idPull[a]!=null){var b=this._countVisiblePolygonItems(a);b>0&&!this.itemPull[a].complex&&this._updateItemComplexState(a,!0,!1);b==0&&this.itemPull[a].complex&&this._updateItemComplexState(a,!1,!1)}};
dhtmlXMenuObject.prototype._updateItemComplexState=function(a,b){if(!this.context&&this._getItemLevelType(a.replace(this.idPrefix,""))=="TopLevel")this.itemPull[a].complex=b;else if(!(this.idPull[a]==null||this.itemPull[a]==null))if(this.itemPull[a].complex=b,a!=this.idPrefix+this.topId){var c=null,d=this.idPull[a].childNodes[this._rtl?0:2];d.childNodes[0]&&String(d.childNodes[0].className).search("complex_arrow")===0&&(c=d.childNodes[0]);if(this.itemPull[a].complex){if(c==null){c=document.createElement("DIV");
c.className="complex_arrow";for(c.id="arrow_"+a;d.childNodes.length>0;)d.removeChild(d.childNodes[0]);d.appendChild(c)}if(this.dLoad&&this.itemPull[a].loaded=="get"&&this.loaderIcon){if(c.className!="complex_arrow_loading")c.className="complex_arrow_loading"}else c.className="complex_arrow"}else!this.itemPull[a].complex&&c!=null&&(d.removeChild(c),this.itemPull[a].hotkey_backup!=null&&this.setHotKey&&this.setHotKey(a.replace(this.idPrefix,""),this.itemPull[a].hotkey_backup))}};
dhtmlXMenuObject.prototype._getItemLevelType=function(a){return this.itemPull[this.idPrefix+a].parent==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"};
dhtmlXMenuObject.prototype._redistribTopLevelSelection=function(a){var b=this._getSubItemToDeselectByPolygon("parent");this._removeSubItemFromSelected(-1,-1);for(var c=0;c<b.length;c++)if(b[c]!=a&&this._hidePolygon(b[c]),this.idPull[b[c]]!=null&&b[c]!=a)this.idPull[b[c]].className=this.idPull[b[c]].className.replace(/Selected/g,"Normal");if(this.itemPull[this.idPrefix+a].state=="enabled")this.idPull[this.idPrefix+a].className="dhtmlxMenu_"+this.skin+"_TopLevel_Item_Selected",this._addSubItemToSelected(this.idPrefix+
a,"parent"),this.menuSelected=this.menuMode=="win"?this.menuSelected!=-1?a:this.menuSelected:a,this.itemPull[this.idPrefix+a].complex&&this.menuSelected!=-1&&this._showPolygon(this.idPrefix+a,this.dirTopLevel)};
dhtmlXMenuObject.prototype._initTopLevelMenu=function(){this.dirTopLevel="bottom";this.dirSubLevel=this._rtl?"left":"right";if(this.context)this.idPull[this.idPrefix+this.topId]=[0,0],this._addSubMenuPolygon(this.idPrefix+this.topId,this.idPrefix+this.topId);else for(var a=this._getMenuNodes(this.idPrefix+this.topId),b=0;b<a.length;b++)this.itemPull[a[b]].type=="item"&&this._renderToplevelItem(a[b],null),this.itemPull[a[b]].type=="separator"&&this._renderSeparator(a[b],null)};
dhtmlXMenuObject.prototype._renderToplevelItem=function(a,b){var c=this,d=document.createElement("DIV");d.id=a;d.className=this.itemPull[a].state=="enabled"&&this.itemPull[a].cssNormal!=null?this.itemPull[a].cssNormal:"dhtmlxMenu_"+this.skin+"_TopLevel_Item_"+(this.itemPull[a].state=="enabled"?"Normal":"Disabled");if(this.itemPull[a].title!=""){var e=document.createElement("DIV");e.className="top_level_text";e.innerHTML=this.itemPull[a].title;d.appendChild(e)}if(this.itemPull[a].tip.length>0)d.title=
this.itemPull[a].tip;if(this.itemPull[a].imgen!=""||this.itemPull[a].imgdis!=""){var f=this.itemPull[a][this.itemPull[a].state=="enabled"?"imgen":"imgdis"];if(f){var g=document.createElement("IMG");g.border="0";g.id="image_"+a;g.src=this.imagePath+f;g.className="dhtmlxMenu_TopLevel_Item_Icon";d.childNodes.length>0&&!this._rtl?d.insertBefore(g,d.childNodes[0]):d.appendChild(g)}}d.onselectstart=function(a){a=a||event;return a.returnValue=!1};d.oncontextmenu=function(a){a=a||event;return a.returnValue=
!1};if(!this.cont)this.cont=document.createElement("DIV"),this.cont.dir="ltr",this.cont.className=this._align=="right"?"align_right":"align_left",this.base.appendChild(this.cont);b!=null&&(b++,b<0&&(b=0),b>this.cont.childNodes.length-1&&(b=null));b!=null?this.cont.insertBefore(d,this.cont.childNodes[b]):this.cont.appendChild(d);this.idPull[d.id]=d;this.itemPull[a].complex&&!this.dLoad&&this._addSubMenuPolygon(this.itemPull[a].id,this.itemPull[a].id);d.onmouseover=function(){c.menuMode=="web"&&window.clearTimeout(c.menuTimeoutHandler);
var a=c._getSubItemToDeselectByPolygon("parent");c._removeSubItemFromSelected(-1,-1);for(var b=0;b<a.length;b++)if(a[b]!=this.id&&c._hidePolygon(a[b]),c.idPull[a[b]]!=null&&a[b]!=this.id)if(c.itemPull[a[b]].cssNormal!=null)c.idPull[a[b]].className=c.itemPull[a[b]].cssNormal;else{if(c.idPull[a[b]].className=="sub_item_selected")c.idPull[a[b]].className="sub_item";c.idPull[a[b]].className=c.idPull[a[b]].className.replace(/Selected/g,"Normal")}if(c.itemPull[this.id].state=="enabled"){this.className=
"dhtmlxMenu_"+c.skin+"_TopLevel_Item_Selected";c._addSubItemToSelected(this.id,"parent");c.menuSelected=c.menuMode=="win"?c.menuSelected!=-1?this.id:c.menuSelected:this.id;if(c.dLoad&&c.itemPull[this.id].loaded=="no"){if(c.menuModeTopLevelTimeout&&c.menuMode=="web"&&!c.context)this._mouseOver=!0,this._dynLoadTM=(new Date).getTime();var d=new dtmlXMLLoaderObject(c._xmlParser,window);c.itemPull[this.id].loaded="get";c.callEvent("onXLS",[]);d.loadXML(c.dLoadUrl+c.dLoadSign+"action=loadMenu&parentId="+
this.id.replace(c.idPrefix,"")+"&etc="+(new Date).getTime())}if((!c.dLoad||c.dLoad&&(!c.itemPull[this.id].loaded||c.itemPull[this.id].loaded=="yes"))&&c.itemPull[this.id].complex&&c.menuSelected!=-1)if(c.menuModeTopLevelTimeout&&c.menuMode=="web"&&!c.context){this._mouseOver=!0;var e=this.id;this._menuOpenTM=window.setTimeout(function(){c._showPolygon(e,c.dirTopLevel)},c.menuModeTopLevelTimeoutTime)}else c._showPolygon(this.id,c.dirTopLevel)}c._doOnTouchMenu(this.id.replace(c.idPrefix,""))};d.onmouseout=
function(){if(!(c.itemPull[this.id].complex&&c.menuSelected!=-1)&&c.itemPull[this.id].state=="enabled")d.className=c.itemPull[this.id].cssNormal!=null?c.itemPull[this.id].cssNormal:"dhtmlxMenu_"+c.skin+"_TopLevel_Item_Normal";if(c.menuMode=="web")window.clearTimeout(c.menuTimeoutHandler),c.menuTimeoutHandler=window.setTimeout(function(){c._clearAndHide()},c.menuTimeoutMsec,"JavaScript");if(c.menuModeTopLevelTimeout&&c.menuMode=="web"&&!c.context)this._mouseOver=!1,window.clearTimeout(this._menuOpenTM)};
d.onclick=function(a){c.menuMode=="web"&&window.clearTimeout(c.menuTimeoutHandler);if(!(c.menuMode!="web"&&c.itemPull[this.id].state=="disabled")){a=a||event;a.cancelBubble=!0;a.returnValue=!1;if(c.menuMode=="win"&&c.itemPull[this.id].complex){if(c.menuSelected==this.id){c.menuSelected=-1;var b=!1}else c.menuSelected=this.id,b=!0;b?c._showPolygon(this.id,c.dirTopLevel):c._hidePolygon(this.id)}var d=c.itemPull[this.id].complex?"c":"-",e=c.itemPull[this.id].state!="enabled"?"d":"-",f={ctrl:a.ctrlKey,
alt:a.altKey,shift:a.shiftKey};c._doOnClick(this.id.replace(c.idPrefix,""),d+e+"t",f);return!1}};this.skin=="dhx_terrace"&&this._improveTerraceSkin()};dhtmlXMenuObject.prototype.setImagePath=function(){};dhtmlXMenuObject.prototype.setIconsPath=function(a){this.imagePath=a};dhtmlXMenuObject.prototype.setIconPath=dhtmlXMenuObject.prototype.setIconsPath;
dhtmlXMenuObject.prototype._updateItemImage=function(a){var a=this.idPrefix+a,b=this.itemPull[a].parent==this.idPrefix+this.topId&&!this.context,c=null;if(b)for(var d=0;d<this.idPull[a].childNodes.length;d++)try{this.idPull[a].childNodes[d].className=="dhtmlxMenu_TopLevel_Item_Icon"&&(c=this.idPull[a].childNodes[d])}catch(e){}else try{c=this.idPull[a].childNodes[this._rtl?2:0].childNodes[0]}catch(f){}var g=this.itemPull[a].type=="radio"?this.itemPull[a][this.itemPull[a].state=="enabled"?"imgen":"imgdis"]:
this.itemPull[a][this.itemPull[a].state=="enabled"?"imgen":"imgdis"];if(g.length>0)if(c!=null)c.src=this.imagePath+g;else if(b)c=document.createElement("IMG"),c.className="dhtmlxMenu_TopLevel_Item_Icon",c.src=this.imagePath+g,c.border="0",c.id="image_"+a,!this._rtl&&this.idPull[a].childNodes.length>0?this.idPull[a].insertBefore(c,this.idPull[a].childNodes[0]):this.idPull[a].appendChild(c);else{c=document.createElement("IMG");c.className="sub_icon";c.src=this.imagePath+g;c.border="0";c.id="image_"+
a;for(var h=this.idPull[a].childNodes[this._rtl?2:0];h.childNodes.length>0;)h.removeChild(h.childNodes[0]);h.appendChild(c)}else c!=null&&c.parentNode.removeChild(c)};
dhtmlXMenuObject.prototype.removeItem=function(a,b,c){b||(a=this.idPrefix+a);var d=null;if(a!=this.idPrefix+this.topId){if(this.itemPull[a]==null)return;this.idPull["polygon_"+a]&&this.idPull["polygon_"+a]._tmShow&&window.clearTimeout(this.idPull["polygon_"+a]._tmShow);var e=this.itemPull[a].type;if(e=="separator"){var f=this.idPull["separator_"+a];this.itemPull[a].parent==this.idPrefix+this.topId?(f.onclick=null,f.onselectstart=null,f.id=null):(f.childNodes[0].childNodes[0].onclick=null,f.childNodes[0].childNodes[0].onselectstart=
null,f.childNodes[0].childNodes[0].id=null,f.childNodes[0].removeChild(f.childNodes[0].childNodes[0]),f.removeChild(f.childNodes[0]));f.parentNode.removeChild(f);this.idPull["separator_"+a]=null;this.itemPull[a]=null;delete this.idPull["separator_"+a]}else{d=this.itemPull[a].parent;f=this.idPull[a];f.onclick=null;f.oncontextmenu=null;f.onmouseover=null;f.onmouseout=null;f.onselectstart=null;for(f.id=null;f.childNodes.length>0;)f.removeChild(f.childNodes[0]);f.parentNode.removeChild(f);this.idPull[a]=
null;this.itemPull[a]=null;delete this.idPull[a]}delete this.itemPull[a];e=f=null}for(var g in this.itemPull)this.itemPull[g].parent==a&&this.removeItem(g,!0,!0);var h=Array(a);d!=null&&!c&&this.idPull["polygon_"+d]!=null&&this.idPull["polygon_"+d].tbd.childNodes.length==0&&(h.push(d),this._updateItemComplexState(d,!1,!1));for(var i=0;i<h.length;i++)if(this.idPull["polygon_"+h[i]]){var j=this.idPull["polygon_"+h[i]];j.onclick=null;j.oncontextmenu=null;j.tbl.removeChild(j.tbd);j.tbd=null;j.removeChild(j.tbl);
j.tbl=null;j.id=null;j.parentNode.removeChild(j);j=null;if(this._isIE6){var k="polygon_"+h[i]+"_ie6cover";this.idPull[k]!=null&&(document.body.removeChild(this.idPull[k]),delete this.idPull[k])}this.idPull["arrowup_"+a]!=null&&this._removeArrow&&this._removeArrow("arrowup_"+a);this.idPull["arrowdown_"+a]!=null&&this._removeArrow&&this._removeArrow("arrowdown_"+a);this.idPull["polygon_"+h[i]]=null;delete this.idPull["polygon_"+h[i]]}h=null;this.skin=="dhx_terrace"&&arguments.length==1&&this._improveTerraceSkin()};
dhtmlXMenuObject.prototype._getAllParents=function(a){var b=[],c;for(c in this.itemPull)if(this.itemPull[c].parent==a&&(b[b.length]=this.itemPull[c].id,this.itemPull[c].complex))for(var d=this._getAllParents(this.itemPull[c].id),e=0;e<d.length;e++)b[b.length]=d[e];return b};
dhtmlXMenuObject.prototype.renderAsContextMenu=function(){this.context=!0;if(this.base._autoSkinUpdate==!0)this.base.className=this.base.className.replace("dhtmlxMenu_"+this.skin+"_Middle",""),this.base._autoSkinUpdate=!1;this.addBaseIdAsContextZone!=null&&this.addContextZone(this.addBaseIdAsContextZone)};
dhtmlXMenuObject.prototype.addContextZone=function(a){if(a==document.body)var a="document.body."+this.idPrefix,b=document.body;else b=document.getElementById(a);var c=!1,d;for(d in this.contextZones)c=c||d==a||this.contextZones[d]==b;if(c==!0)return!1;this.contextZones[a]=b;var e=this;if(_isOpera)this.operaContext=function(a){e._doOnContextMenuOpera(a,e)},b.addEventListener("mouseup",this.operaContext,!1);else{if(b.oncontextmenu!=null&&!b._oldContextMenuHandler)b._oldContextMenuHandler=b.oncontextmenu;
b.oncontextmenu=function(a){for(var b in dhtmlxMenuObjectLiveInstances)b!=e._UID&&dhtmlxMenuObjectLiveInstances[b].context&&dhtmlxMenuObjectLiveInstances[b]._hideContextMenu();a=a||event;a.cancelBubble=!0;a.returnValue=!1;e._doOnContextBeforeCall(a,this);return!1}}};
dhtmlXMenuObject.prototype._doOnContextMenuOpera=function(a,b){for(var c in dhtmlxMenuObjectLiveInstances)c!=b._UID&&dhtmlxMenuObjectLiveInstances[c].context&&dhtmlxMenuObjectLiveInstances[c]._hideContextMenu();a.cancelBubble=!0;a.returnValue=!1;a.button==0&&a.ctrlKey==!0&&b._doOnContextBeforeCall(a,this);return!1};
dhtmlXMenuObject.prototype.removeContextZone=function(a){if(!this.isContextZone(a))return!1;a==document.body&&(a="document.body."+this.idPrefix);var b=this.contextZones[a];_isOpera?b.removeEventListener("mouseup",this.operaContext,!1):(b.oncontextmenu=b._oldContextMenuHandler!=null?b._oldContextMenuHandler:null,b._oldContextMenuHandler=null);try{this.contextZones[a]=null,delete this.contextZones[a]}catch(c){}return!0};
dhtmlXMenuObject.prototype.isContextZone=function(a){if(a==document.body&&this.contextZones["document.body."+this.idPrefix]!=null)return!0;var b=!1;this.contextZones[a]!=null&&this.contextZones[a]==document.getElementById(a)&&(b=!0);return b};dhtmlXMenuObject.prototype._isContextMenuVisible=function(){return this.idPull["polygon_"+this.idPrefix+this.topId]==null?!1:this.idPull["polygon_"+this.idPrefix+this.topId].style.display==""};
dhtmlXMenuObject.prototype._showContextMenu=function(a,b,c){this._clearAndHide();if(this.idPull["polygon_"+this.idPrefix+this.topId]==null)return!1;window.clearTimeout(this.menuTimeoutHandler);this.idPull[this.idPrefix+this.topId]=[a,b];this._showPolygon(this.idPrefix+this.topId,"bottom");this.callEvent("onContextMenu",[c])};
dhtmlXMenuObject.prototype._hideContextMenu=function(){if(this.idPull["polygon_"+this.idPrefix+this.topId]==null)return!1;this._clearAndHide();this._hidePolygon(this.idPrefix+this.topId);this.zInd=this.zIndInit};
dhtmlXMenuObject.prototype._doOnContextBeforeCall=function(a,b){this.contextMenuZoneId=b.id;this._clearAndHide();this._hideContextMenu();var c=a.srcElement||a.target,d=_isIE||_isOpera||_KHTMLrv?a.offsetX:a.layerX,e=_isIE||_isOpera||_KHTMLrv?a.offsetY:a.layerY,f=getAbsoluteLeft(c)+d,g=getAbsoluteTop(c)+e;this.checkEvent("onBeforeContextMenu")?this.callEvent("onBeforeContextMenu",[b.id,a])&&this.contextAutoShow&&(this._showContextMenu(f,g),this.callEvent("onAfterContextMenu",[b.id,a])):this.contextAutoShow&&
(this._showContextMenu(f,g),this.callEvent("onAfterContextMenu",[b.id]))};dhtmlXMenuObject.prototype.showContextMenu=function(a,b){this._showContextMenu(a,b,!1)};dhtmlXMenuObject.prototype.hideContextMenu=function(){this._hideContextMenu()};
dhtmlXMenuObject.prototype._autoDetectVisibleArea=function(){if(!this._isVisibleArea)this.menuX1=document.body.scrollLeft,this.menuX2=this.menuX1+(window.innerWidth||document.body.clientWidth),this.menuY1=Math.max((_isIE?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop),this.menuY2=this.menuY1+(_isIE?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight)};
dhtmlXMenuObject.prototype.getItemPosition=function(a){var a=this.idPrefix+a,b=-1;if(this.itemPull[a]==null)return b;for(var c=this.itemPull[a].parent,d=this.idPull["polygon_"+c]!=null?this.idPull["polygon_"+c].tbd:this.cont,e=0;e<d.childNodes.length;e++)if(d.childNodes[e]==this.idPull["separator_"+a]||d.childNodes[e]==this.idPull[a])b=e;return b};
dhtmlXMenuObject.prototype.setItemPosition=function(a,b){a=this.idPrefix+a;if(this.idPull[a]!=null){var c=this.itemPull[a].parent==this.idPrefix+this.topId,d=this.idPull[a],e=this.getItemPosition(a.replace(this.idPrefix,"")),f=this.itemPull[a].parent,g=this.idPull["polygon_"+f]!=null?this.idPull["polygon_"+f].tbd:this.cont;g.removeChild(g.childNodes[e]);b<0&&(b=0);c&&b<1&&(b=1);b<g.childNodes.length?g.insertBefore(d,g.childNodes[b]):g.appendChild(d)}};
dhtmlXMenuObject.prototype.getParentId=function(a){a=this.idPrefix+a;return this.itemPull[a]==null?null:(this.itemPull[a].parent!=null?this.itemPull[a].parent:this.topId).replace(this.idPrefix,"")};
dhtmlXMenuObject.prototype.addNewSibling=function(a,b,c,d,e,f){var g=this.idPrefix+(b!=null?b:this._genStr(24)),h=this.idPrefix+(a!=null?this.getParentId(a):this.topId);this._addItemIntoGlobalStrorage(g,h,c,"item",d,e,f);h==this.idPrefix+this.topId&&!this.context?this._renderToplevelItem(g,this.getItemPosition(a)):this._renderSublevelItem(g,this.getItemPosition(a))};
dhtmlXMenuObject.prototype.addNewChild=function(a,b,c,d,e,f,g){if(a==null)if(this.context)a=this.topId;else{this.addNewSibling(a,c,d,e,f,g);b!=null&&this.setItemPosition(c,b);return}c=this.idPrefix+(c!=null?c:this._genStr(24));this.setHotKey&&this.setHotKey(a,"");a=this.idPrefix+a;this._addItemIntoGlobalStrorage(c,a,d,"item",e,f,g);this.idPull["polygon_"+a]==null&&this._renderSublevelPolygon(a,a);this._renderSublevelItem(c,b-1);this._redefineComplexState(a)};
dhtmlXMenuObject.prototype._addItemIntoGlobalStrorage=function(a,b,c,d,e,f,g){var h={id:a,title:c,imgen:f!=null?f:"",imgdis:g!=null?g:"",type:d,state:e==!0?"disabled":"enabled",parent:b,complex:!1,hotkey:"",tip:""};this.itemPull[h.id]=h};
dhtmlXMenuObject.prototype._addSubMenuPolygon=function(a,b){for(var c=this._renderSublevelPolygon(a,b),d=this._getMenuNodes(b),e=0;e<d.length;e++)this.itemPull[d[e]].type=="separator"?this._renderSeparator(d[e],null):this._renderSublevelItem(d[e],null);for(var f=a==b?"topLevel":"subLevel",e=0;e<d.length;e++)this.itemPull[d[e]].complex&&this._addSubMenuPolygon(a,this.itemPull[d[e]].id)};
dhtmlXMenuObject.prototype._renderSublevelPolygon=function(a,b){var c=document.createElement("DIV");c.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_Polygon "+(this._rtl?"dir_right":"");c.dir="ltr";c.oncontextmenu=function(a){a=a||event;a.returnValue=!1;a.cancelBubble=!0;return!1};c.id="polygon_"+b;c.onclick=function(a){a=a||event;a.cancelBubble=!0};c.style.display="none";document.body.insertBefore(c,document.body.firstChild);var d=document.createElement("TABLE");d.className="dhtmlxMebu_SubLevelArea_Tbl";
d.cellSpacing=0;d.cellPadding=0;d.border=0;var e=document.createElement("TBODY");d.appendChild(e);c.appendChild(d);c.tbl=d;c.tbd=e;this.idPull[c.id]=c;this.sxDacProc!=null&&(this.idPull["sxDac_"+b]=new this.sxDacProc(c,c.className),_isIE?(this.idPull["sxDac_"+b]._setSpeed(this.dacSpeedIE),this.idPull["sxDac_"+b]._setCustomCycle(this.dacCyclesIE)):(this.idPull["sxDac_"+b]._setSpeed(this.dacSpeed),this.idPull["sxDac_"+b]._setCustomCycle(this.dacCycles)));return c};
dhtmlXMenuObject.prototype._renderSublevelItem=function(a,b){var c=this,d=document.createElement("TR");d.className=this.itemPull[a].state=="enabled"?"sub_item":"sub_item_dis";var e=document.createElement("TD");e.className="sub_item_icon";var f=this.itemPull[a][this.itemPull[a].state=="enabled"?"imgen":"imgdis"];if(f!=""){var g=this.itemPull[a].type;if(g=="checkbox"||g=="radio"){var h=document.createElement("DIV");h.id="image_"+this.itemPull[a].id;h.className="sub_icon "+f;e.appendChild(h)}if(!(g==
"checkbox"||g=="radio"))h=document.createElement("IMG"),h.id="image_"+this.itemPull[a].id,h.className="sub_icon",h.src=this.imagePath+f,e.appendChild(h)}var i=document.createElement("TD");i.className="sub_item_text";if(this.itemPull[a].title!=""){var j=document.createElement("DIV");j.className="sub_item_text";j.innerHTML=this.itemPull[a].title;i.appendChild(j)}else i.innerHTML="&nbsp;";var k=document.createElement("TD");k.className="sub_item_hk";if(this.itemPull[a].complex){var m=document.createElement("DIV");
m.className="complex_arrow";m.id="arrow_"+this.itemPull[a].id;k.appendChild(m)}else if(this.itemPull[a].hotkey.length>0&&!this.itemPull[a].complex){var l=document.createElement("DIV");l.className="sub_item_hk";l.innerHTML=this.itemPull[a].hotkey;k.appendChild(l)}else k.innerHTML="&nbsp;";d.appendChild(this._rtl?k:e);d.appendChild(i);d.appendChild(this._rtl?e:k);d.id=this.itemPull[a].id;d.parent=this.itemPull[a].parent;if(this.itemPull[a].tip.length>0)d.title=this.itemPull[a].tip;if(!this._hideTMData)this._hideTMData=
{};d.onselectstart=function(a){a=a||event;return a.returnValue=!1};d.onmouseover=function(){c.menuMode=="web"&&(c._hideTMData[this.id]&&window.clearTimeout(c._hideTMData[this.id]),window.clearTimeout(c.menuTimeoutHandler));this._visible||c._redistribSubLevelSelection(this.id,this.parent);this._visible=!0};if(c.menuMode=="web")d.onmouseout=function(){c.menuTimeoutHandler&&window.clearTimeout(c.menuTimeoutHandler);c.menuTimeoutHandler=window.setTimeout(function(){c._clearAndHide()},c.menuTimeoutMsec,
"JavaScript");var a=this;c._hideTMData[this.id]&&window.clearTimeout(c._hideTMData[this.id]);c._hideTMData[this.id]=window.setTimeout(function(){a._visible=!1},50)};d.onclick=function(a){if(c.checkEvent("onClick")||!c.itemPull[this.id].complex){a=a||event;a.cancelBubble=!0;a.returnValue=!1;tc=c.itemPull[this.id].complex?"c":"-";td=c.itemPull[this.id].state=="enabled"?"-":"d";var b={ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey};switch(c.itemPull[this.id].type){case "checkbox":c._checkboxOnClickHandler(this.id.replace(c.idPrefix,
""),tc+td+"n",b);break;case "radio":c._radioOnClickHandler(this.id.replace(c.idPrefix,""),tc+td+"n",b);break;case "item":c._doOnClick(this.id.replace(c.idPrefix,""),tc+td+"n",b)}return!1}};var n=this.idPull["polygon_"+this.itemPull[a].parent];b!=null&&(b++,b<0&&(b=0),b>n.tbd.childNodes.length-1&&(b=null));b!=null&&n.tbd.childNodes[b]!=null?n.tbd.insertBefore(d,n.tbd.childNodes[b]):n.tbd.appendChild(d);this.idPull[d.id]=d};
dhtmlXMenuObject.prototype._renderSeparator=function(a,b){var c=this.context?"SubLevelArea":this.itemPull[a].parent==this.idPrefix+this.topId?"TopLevel":"SubLevelArea";if(!(c=="TopLevel"&&this.context)){var d=this;if(c!="TopLevel"){var e=document.createElement("TR");e.className="sub_sep";var f=document.createElement("TD");f.colSpan="3";e.appendChild(f)}var g=document.createElement("DIV");g.id="separator_"+a;g.className=c=="TopLevel"?"top_sep":"sub_sep";g.onselectstart=function(a){a=a||event;a.returnValue=
!1};g.onclick=function(a){a=a||event;a.cancelBubble=!0;var b={ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey};d._doOnClick(this.id.replace("separator_"+d.idPrefix,""),"--s",b)};if(c=="TopLevel"){if(b!=null)b++,b<0&&(b=0),this.cont.childNodes[b]!=null?this.cont.insertBefore(g,this.cont.childNodes[b]):this.cont.appendChild(g);else{var h=this.cont.childNodes[this.cont.childNodes.length-1];String(h).search("TopLevel_Text")==-1?this.cont.appendChild(g):this.cont.insertBefore(g,h)}this.idPull[g.id]=g}else{var i=
this.idPull["polygon_"+this.itemPull[a].parent];b!=null&&(b++,b<0&&(b=0),b>i.tbd.childNodes.length-1&&(b=null));b!=null&&i.tbd.childNodes[b]!=null?i.tbd.insertBefore(e,i.tbd.childNodes[b]):i.tbd.appendChild(e);f.appendChild(g);this.idPull[g.id]=e}}};dhtmlXMenuObject.prototype.addNewSeparator=function(a,b){var b=this.idPrefix+(b!=null?b:this._genStr(24)),c=this.idPrefix+this.getParentId(a);this._addItemIntoGlobalStrorage(b,c,"","separator",!1,"","");this._renderSeparator(b,this.getItemPosition(a))};
dhtmlXMenuObject.prototype.hide=function(){this._clearAndHide()};dhtmlXMenuObject.prototype.clearAll=function(){this.removeItem(this.idPrefix+this.topId,!0);this._isInited=!1;this.idPrefix=this._genStr(12)};
dhtmlXMenuObject.prototype.unload=function(){_isIE?(document.body.detachEvent("onclick",this._bodyClick),document.body.detachEvent("oncontextmenu",this._bodyContext)):(window.removeEventListener("click",this._bodyClick,!1),window.removeEventListener("contextmenu",this._bodyContext,!1));this._bodyContext=this._bodyClick=null;this.removeItem(this.idPrefix+this.topId,!0);this.idPull=this.itemPull=null;if(this.context)for(var a in this.contextZones)this.removeContextZone(a);if(this.cont!=null)this.cont.className=
"",this.cont.parentNode.removeChild(this.cont),this.cont=null;if(this.base!=null){this.base.className="";if(!this.context)this.base.oncontextmenu=this.base._oldContextMenuHandler||null;this.base=this.base.onselectstart=null}this.setSkin=null;this.detachAllEvents();if(this._xmlLoader)this._xmlLoader.destructor(),this._xmlLoader=null;this.extendedModule=this.serialize=this.addCheckbox=this.getCheckboxState=this.setCheckboxState=this.addRadioButton=this.setRadioChecked=this.getRadioChecked=this.userData=
this.setOverflowHeight=this.contextZones=this.getCircuit=this.clearHref=this.setHref=this.setAlign=this.setRTL=this.setTopText=this.setItemSelected=this.getHotKey=this.setHotKey=this.getTooltip=this.setTooltip=this.setVisibleArea=this.getContextMenuHideAllMode=this.setContextMenuHideAllMode=this.setAutoHideMode=this.setAutoShowMode=this.clearItemImage=this.setItemImage=this.getItemImage=this.enableDynamicLoading=this.setWebModeTimeout=this.setOpenMode=this.getUserData=this.setUserData=this.isItemHidden=
this.showItem=this.hideItem=this.loadFromHTML=this.setItemText=this.getItemText=this.isItemEnabled=this.setItemDisabled=this.setItemEnabled=this._removeArrow=this._checkboxOnClickHandler=this._updateCheckboxImage=this._readLevel=this._setCheckboxState=this._getCheckboxState=this._radioOnClickHandler=this._setRadioState=this._getRadioImgObj=this._countPolygonItems=this._doScrollDown=this._doScrollUp=this._isArrowExists=this._removeDownArrow=this._removeUpArrow=this._addDownArrow=this._addUpArrow=this._checkArrowsState=
this._clearAllSelectedSubItemsInPolygon=this._updateLoaderIcon=this._changeItemVisible=this._changeItemState=this.hideContextMenu=this.showContextMenu=this.hide=this.detachAllEvents=this.radio=this.items=this.unload=this.dhx_Event=this.detachEvent=this.eventCatcher=this.checkEvent=this.callEvent=this.attachEvent=this.addNewSeparator=this.addNewChild=this.addNewSibling=this.getParentId=this.setItemPosition=this.getItemPosition=this.clearAll=this._hideContextMenu=this._renderSeparator=this._renderSublevelItem=
this._renderSublevelPolygon=this._addSubMenuPolygon=this._addItemIntoGlobalStrorage=this._autoDetectVisibleArea=this._doOnContextBeforeCall=this._showContextMenu=this._isContextMenuVisible=this.isContextZone=this.removeContextZone=this.addContextZone=this.renderAsContextMenu=this._getAllParents=this.removeItem=this._updateItemImage=this.setIconPath=this.setIconsPath=this.setImagePath=this._renderToplevelItem=this._initTopLevelMenu=this._redistribTopLevelSelection=this._getItemLevelType=this._updateItemComplexState=
this._redefineComplexState=this._countVisiblePolygonItems=this._hideSubLevelItem=this._showSubLevelItem=this._xmlParser=this._buildMenu=this.loadXMLString=this.loadXML=this.init=this.forEachItem=this.getItemType=this._doOnLoad=this._clearAndHide=this._genStr=this._getMenuNodes=this._searchMenuNode=this._doOnTouchMenu=this._doOnClick=this._redistribSubLevelSelection=this._showPolygon=this._hidePolygon=this._getSubItemToDeselectByPolygon=this._removeSubItemFromSelected=this._addSubItemToSelected=this._openedPolygons=
this._selectedSubItems=this._enableDacSupport=this.zIndStep=this.zIndInit=this.zInd=this.dacSpeedIE=this.dacSpeed=this.dacCyclesIE=this.dacCycles=this.topId=this.skin=this.userDataTagName=this.itemTipTagName=this.itemTextTagName=this.itemTagName=this.itemHrefTagName=this.itemHotKeyTagName=this.isDhtmlxMenuObject=this.menuTouched=this.menuTimeoutMsec=this.menuTimeoutHandler=this.menuModeTopLevelTimeoutTime=this.menuModeTopLevelTimeout=this.menuMode=this.imagePath=this.idPrefix=this.menuLastClicked=
this.menuSelected=this.limit=this.dirTopLevel=this.dirSubLevel=this.fixedPosition=this.loaderIcon=this.dLoadUrl=this.dLoadSign=this.dLoad=this.contextMenuZoneId=this.contextHideAllMode=this.contextAutoShow=this.contextAutoHide=this.context=this.addBaseIdAsContextZone=this._topLevelRightMargin=this._topLevelBottomMargin=this._topLevelOffsetLeft=this._topLevelBottomMargin=this._scrollUpTMTime=this._scrollUpTMStep=this._scrollDownTMTime=this._scrollDownTMStep=this._rtl=this._isInited=this._isIE6=this._arrowFFFix=
this._align=null;dhtmlxMenuObjectLiveInstances[this._UID]=null;try{delete dhtmlxMenuObjectLiveInstances[this._UID]}catch(b){}this._UID=null};var dhtmlxMenuObjectLiveInstances={};dhtmlXMenuObject.prototype.i18n={dhxmenuextalert:"dhtmlxmenu_ext.js required"};
(function(){dhtmlx.extend_api("dhtmlXMenuObject",{_init:function(a){return[a.parent,a.skin]},align:"setAlign",top_text:"setTopText",context:"renderAsContextMenu",icon_path:"setIconsPath",open_mode:"setOpenMode",rtl:"setRTL",skin:"setSkin",dynamic:"enableDynamicLoading",xml:"loadXML",items:"items",overflow:"setOverflowHeight"},{items:function(a,b){for(var c=1E5,d=null,e=0;e<a.length;e++){var f=a[e];f.type=="separator"?(this.addNewSeparator(d,c,f.id),d=f.id):(this.addNewChild(b,c,f.id,f.text,f.disabled,
f.img,f.img_disabled),d=f.id,f.items&&this.items(f.items,f.id))}}})})();
dhtmlXMenuObject.prototype._improveTerraceSkin=function(){for(var a in this.itemPull)if(this.itemPull[a].parent==this.idPrefix+this.topId&&this.idPull[a]!=null){var b=!1,c=!1;this.idPull[a].parentNode.firstChild==this.idPull[a]&&(b=!0);this.idPull[a].parentNode.lastChild==this.idPull[a]&&(c=!0);for(var d in this.itemPull)this.itemPull[d].type=="separator"&&this.itemPull[d].parent==this.idPrefix+this.topId&&(this.idPull[a].nextSibling==this.idPull["separator_"+d]&&(c=!0),this.idPull[a].previousSibling==
this.idPull["separator_"+d]&&(b=!0));this.idPull[a].style.borderLeft=b?"1px solid #cecece":"0px solid white";this.idPull[a].style.borderTopLeftRadius=this.idPull[a].style.borderBottomLeftRadius=b?"5px":"0px";this.idPull[a].style.borderTopRightRadius=this.idPull[a].style.borderBottomRightRadius=c?"5px":"0px";this.idPull[a]._bl=b;this.idPull[a]._br=c}};
dhtmlXMenuObject.prototype._improveTerraceButton=function(a,b){b?(this.idPull[a].style.borderBottomLeftRadius=this.idPull[a]._bl?"5px":"0px",this.idPull[a].style.borderBottomRightRadius=this.idPull[a]._br?"5px":"0px"):(this.idPull[a].style.borderBottomLeftRadius="0px",this.idPull[a].style.borderBottomRightRadius="0px")};dhtmlXMenuObject.prototype.extendedModule="DHXMENUEXT";dhtmlXMenuObject.prototype.setItemEnabled=function(a){this._changeItemState(a,"enabled",this._getItemLevelType(a))};
dhtmlXMenuObject.prototype.setItemDisabled=function(a){this._changeItemState(a,"disabled",this._getItemLevelType(a))};dhtmlXMenuObject.prototype.isItemEnabled=function(a){return this.itemPull[this.idPrefix+a]!=null?this.itemPull[this.idPrefix+a].state=="enabled":!1};
dhtmlXMenuObject.prototype._changeItemState=function(a,b,c){var d=!1,e=this.idPrefix+a;if(this.itemPull[e]!=null&&this.idPull[e]!=null&&this.itemPull[e].state!=b)this.itemPull[e].state=b,this.idPull[e].className=this.itemPull[e].parent==this.idPrefix+this.topId&&!this.context?"dhtmlxMenu_"+this.skin+"_TopLevel_Item_"+(this.itemPull[e].state=="enabled"?"Normal":"Disabled"):"sub_item"+(this.itemPull[e].state=="enabled"?"":"_dis"),this._updateItemComplexState(this.idPrefix+a,this.itemPull[this.idPrefix+
a].complex,!1),this._updateItemImage(a,c),this.idPrefix+this.menuLastClicked==e&&c!="TopLevel"&&this._redistribSubLevelSelection(e,this.itemPull[e].parent);return d};dhtmlXMenuObject.prototype.getItemText=function(a){return this.itemPull[this.idPrefix+a]!=null?this.itemPull[this.idPrefix+a].title:""};
dhtmlXMenuObject.prototype.setItemText=function(a,b){a=this.idPrefix+a;if(this.itemPull[a]!=null&&this.idPull[a]!=null)if(this._clearAndHide(),this.itemPull[a].title=b,this.itemPull[a].parent==this.idPrefix+this.topId&&!this.context){for(var c=null,d=0;d<this.idPull[a].childNodes.length;d++)try{this.idPull[a].childNodes[d].className=="top_level_text"&&(c=this.idPull[a].childNodes[d])}catch(e){}if(String(this.itemPull[a].title).length==""||this.itemPull[a].title==null)c!=null&&c.parentNode.removeChild(c);
else{if(!c)c=document.createElement("DIV"),c.className="top_level_text",this._rtl&&this.idPull[a].childNodes.length>0?this.idPull[a].insertBefore(c,this.idPull[a].childNodes[0]):this.idPull[a].appendChild(c);c.innerHTML=this.itemPull[a].title}}else{c=null;for(d=0;d<this.idPull[a].childNodes[1].childNodes.length;d++)if(String(this.idPull[a].childNodes[1].childNodes[d].className||"")=="sub_item_text")c=this.idPull[a].childNodes[1].childNodes[d];if(String(this.itemPull[a].title).length==""||this.itemPull[a].title==
null){if(c)c.parentNode.removeChild(c),c=null,this.idPull[a].childNodes[1].innerHTML="&nbsp;"}else{if(!c)c=document.createElement("DIV"),c.className="sub_item_text",this.idPull[a].childNodes[1].innerHTML="",this.idPull[a].childNodes[1].appendChild(c);c.innerHTML=this.itemPull[a].title}}};dhtmlXMenuObject.prototype.loadFromHTML=function(a,b,c){this.itemTagName="DIV";typeof a=="string"&&(a=document.getElementById(a));this._buildMenu(a,null);this.init();b&&a.parentNode.removeChild(a);c!=null&&c()};
dhtmlXMenuObject.prototype.hideItem=function(a){this._changeItemVisible(a,!1)};dhtmlXMenuObject.prototype.showItem=function(a){this._changeItemVisible(a,!0)};dhtmlXMenuObject.prototype.isItemHidden=function(a){var b=null;this.idPull[this.idPrefix+a]!=null&&(b=this.idPull[this.idPrefix+a].style.display=="none");return b};
dhtmlXMenuObject.prototype._changeItemVisible=function(a,b){var c=this.idPrefix+a;if(this.itemPull[c]!=null&&(this.itemPull[c].type=="separator"&&(c="separator_"+c),this.idPull[c]!=null))this.idPull[c].style.display=b?"":"none",this._redefineComplexState(this.itemPull[this.idPrefix+a].parent)};dhtmlXMenuObject.prototype.setUserData=function(a,b,c){this.userData[this.idPrefix+a+"_"+b]=c};
dhtmlXMenuObject.prototype.getUserData=function(a,b){return this.userData[this.idPrefix+a+"_"+b]!=null?this.userData[this.idPrefix+a+"_"+b]:null};dhtmlXMenuObject.prototype.setOpenMode=function(a){if(a=="win"||a=="web")this.menuMode=a};dhtmlXMenuObject.prototype.setWebModeTimeout=function(a){this.menuTimeoutMsec=!isNaN(a)?a:400};
dhtmlXMenuObject.prototype.enableDynamicLoading=function(a,b){this.dLoad=!0;this.dLoadUrl=a;this.dLoadSign=String(this.dLoadUrl).search(/\?/)==-1?"?":"&";this.loaderIcon=b;this.init()};
dhtmlXMenuObject.prototype._updateLoaderIcon=function(a,b){if(this.idPull[a]!=null&&!(String(this.idPull[a].className).search("TopLevel_Item")>=0)){var c=this._rtl?0:2;if(this.idPull[a].childNodes[c]&&this.idPull[a].childNodes[c].childNodes[0]){var d=this.idPull[a].childNodes[c].childNodes[0];if(String(d.className).search("complex_arrow")===0)d.className="complex_arrow"+(b?"_loading":"")}}};
dhtmlXMenuObject.prototype.getItemImage=function(a){var b=[null,null],a=this.idPrefix+a;if(this.itemPull[a].type=="item")b[0]=this.itemPull[a].imgen,b[1]=this.itemPull[a].imgdis;return b};dhtmlXMenuObject.prototype.setItemImage=function(a,b,c){if(this.itemPull[this.idPrefix+a].type=="item")this.itemPull[this.idPrefix+a].imgen=b,this.itemPull[this.idPrefix+a].imgdis=c,this._updateItemImage(a,this._getItemLevelType(a))};dhtmlXMenuObject.prototype.clearItemImage=function(a){this.setItemImage(a,"","")};
dhtmlXMenuObject.prototype.setAutoShowMode=function(a){this.contextAutoShow=a==!0?!0:!1};dhtmlXMenuObject.prototype.setAutoHideMode=function(a){this.contextAutoHide=a==!0?!0:!1};dhtmlXMenuObject.prototype.setContextMenuHideAllMode=function(a){this.contextHideAllMode=a==!0?!0:!1};dhtmlXMenuObject.prototype.getContextMenuHideAllMode=function(){return this.contextHideAllMode};
dhtmlXMenuObject.prototype.setVisibleArea=function(a,b,c,d){this._isVisibleArea=!0;this.menuX1=a;this.menuX2=b;this.menuY1=c;this.menuY2=d};dhtmlXMenuObject.prototype.setTooltip=function(a,b){a=this.idPrefix+a;if(this.itemPull[a]!=null&&this.idPull[a]!=null)this.idPull[a].title=b.length>0?b:null,this.itemPull[a].tip=b};dhtmlXMenuObject.prototype.getTooltip=function(a){return this.itemPull[this.idPrefix+a]==null?null:this.itemPull[this.idPrefix+a].tip};
dhtmlXMenuObject.prototype.setHotKey=function(a,b){a=this.idPrefix+a;if(this.itemPull[a]!=null&&this.idPull[a]!=null&&(this.itemPull[a].parent!=this.idPrefix+this.topId||this.context)&&!this.itemPull[a].complex){var c=this.itemPull[a].type;if(c=="item"||c=="checkbox"||c=="radio"){var d=null;try{if(this.idPull[a].childNodes[this._rtl?0:2].childNodes[0].className=="sub_item_hk")d=this.idPull[a].childNodes[this._rtl?0:2].childNodes[0]}catch(e){}if(b.length==0)this.itemPull[a].hotkey_backup=this.itemPull[a].hotkey,
this.itemPull[a].hotkey="",d!=null&&d.parentNode.removeChild(d);else{this.itemPull[a].hotkey=b;this.itemPull[a].hotkey_backup=null;if(d==null){d=document.createElement("DIV");d.className="sub_item_hk";for(var f=this.idPull[a].childNodes[this._rtl?0:2];f.childNodes.length>0;)f.removeChild(f.childNodes[0]);f.appendChild(d)}d.innerHTML=b}}}};dhtmlXMenuObject.prototype.getHotKey=function(a){return this.itemPull[this.idPrefix+a]==null?null:this.itemPull[this.idPrefix+a].hotkey};
dhtmlXMenuObject.prototype.setItemSelected=function(a){if(this.itemPull[this.idPrefix+a]==null)return null};dhtmlXMenuObject.prototype.setTopText=function(a){if(!this.context){if(this._topText==null)this._topText=document.createElement("DIV"),this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this._rtl?"left":this._align=="left"?"right":"left"),this.base.appendChild(this._topText);this._topText.innerHTML=a}};
dhtmlXMenuObject.prototype.setAlign=function(a){if(this._align!=a&&(a=="left"||a=="right")){this._align=a;if(this.cont)this.cont.className=this._align=="right"?"align_right":"align_left";if(this._topText!=null)this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this._align=="left"?"right":"left")}};dhtmlXMenuObject.prototype.setHref=function(a,b,c){if(this.itemPull[this.idPrefix+a]!=null)this.itemPull[this.idPrefix+a].href_link=b,c!=null&&(this.itemPull[this.idPrefix+a].href_target=c)};
dhtmlXMenuObject.prototype.clearHref=function(a){this.itemPull[this.idPrefix+a]!=null&&(delete this.itemPull[this.idPrefix+a].href_link,delete this.itemPull[this.idPrefix+a].href_target)};dhtmlXMenuObject.prototype.getCircuit=function(a){for(var b=Array(a);this.getParentId(a)!=this.topId;)a=this.getParentId(a),b[b.length]=a;return b.reverse()};
dhtmlXMenuObject.prototype._clearAllSelectedSubItemsInPolygon=function(a){for(var b=this._getSubItemToDeselectByPolygon(a),c=0;c<this._openedPolygons.length;c++)this._openedPolygons[c]!=a&&this._hidePolygon(this._openedPolygons[c]);for(c=0;c<b.length;c++)if(this.idPull[b[c]]!=null&&this.itemPull[b[c]].state=="enabled")this.idPull[b[c]].className="dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Normal"};
dhtmlXMenuObject.prototype._checkArrowsState=function(a){var b=this.idPull["polygon_"+a],c=this.idPull["arrowup_"+a],d=this.idPull["arrowdown_"+a];c.className=b.scrollTop==0?"dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowUp_Disabled":"dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowUp"+(c.over?"_Over":"");d.className=b.scrollTop+b.offsetHeight<b.scrollHeight?"dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowDown"+(d.over?"_Over":""):"dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowDown_Disabled"};
dhtmlXMenuObject.prototype._addUpArrow=function(a){var b=this,c=document.createElement("DIV");c.pId=this.idPrefix+a;c.id="arrowup_"+this.idPrefix+a;c.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowUp";c.innerHTML="<div class='dhtmlxMenu_"+this.skin+"_SubLevelArea_Arrow'><div class='dhtmlxMenu_SubLevelArea_Arrow_Icon'></div></div>";c.style.display="none";c.over=!1;c.onselectstart=function(a){a=a||event;return a.returnValue=!1};c.oncontextmenu=function(a){a=a||event;return a.returnValue=!1};
c.onmouseover=function(){b.menuMode=="web"&&window.clearTimeout(b.menuTimeoutHandler);b._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className!="dhtmlxMenu_"+b.skin+"_SubLevelArea_ArrowUp_Disabled")this.className="dhtmlxMenu_"+b.skin+"_SubLevelArea_ArrowUp_Over",this.over=!0,b._canScrollUp=!0,b._doScrollUp(this.pId,!0)};c.onmouseout=function(){if(b.menuMode=="web")window.clearTimeout(b.menuTimeoutHandler),b.menuTimeoutHandler=window.setTimeout(function(){b._clearAndHide()},b.menuTimeoutMsec,
"JavaScript");this.over=!1;b._canScrollUp=!1;if(this.className!="dhtmlxMenu_"+b.skin+"_SubLevelArea_ArrowUp_Disabled")this.className="dhtmlxMenu_"+b.skin+"_SubLevelArea_ArrowUp",window.clearTimeout(b._scrollUpTM)};c.onclick=function(a){a=a||event;a.returnValue=!1;a.cancelBubble=!0;return!1};document.body.insertBefore(c,document.body.firstChild);this.idPull[c.id]=c};
dhtmlXMenuObject.prototype._addDownArrow=function(a){var b=this,c=document.createElement("DIV");c.pId=this.idPrefix+a;c.id="arrowdown_"+this.idPrefix+a;c.className="dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowDown";c.innerHTML="<div class='dhtmlxMenu_"+this.skin+"_SubLevelArea_Arrow'><div class='dhtmlxMenu_SubLevelArea_Arrow_Icon'></div></div>";c.style.display="none";c.over=!1;c.onselectstart=function(a){a=a||event;return a.returnValue=!1};c.oncontextmenu=function(a){a=a||event;return a.returnValue=
!1};c.onmouseover=function(){b.menuMode=="web"&&window.clearTimeout(b.menuTimeoutHandler);b._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className!="dhtmlxMenu_"+b.skin+"_SubLevelArea_ArrowDown_Disabled")this.className="dhtmlxMenu_"+b.skin+"_SubLevelArea_ArrowDown_Over",this.over=!0,b._canScrollDown=!0,b._doScrollDown(this.pId,!0)};c.onmouseout=function(){if(b.menuMode=="web")window.clearTimeout(b.menuTimeoutHandler),b.menuTimeoutHandler=window.setTimeout(function(){b._clearAndHide()},b.menuTimeoutMsec,
"JavaScript");this.over=!1;b._canScrollDown=!1;if(this.className!="dhtmlxMenu_"+b.skin+"_SubLevelArea_ArrowDown_Disabled")this.className="dhtmlxMenu_"+b.skin+"_SubLevelArea_ArrowDown",window.clearTimeout(b._scrollDownTM)};c.onclick=function(a){a=a||event;a.returnValue=!1;a.cancelBubble=!0;return!1};document.body.insertBefore(c,document.body.firstChild);this.idPull[c.id]=c};dhtmlXMenuObject.prototype._removeUpArrow=function(a){var b="arrowup_"+this.idPrefix+a;this._removeArrow(b)};
dhtmlXMenuObject.prototype._removeDownArrow=function(a){var b="arrowdown_"+this.idPrefix+a;this._removeArrow(b)};dhtmlXMenuObject.prototype._removeArrow=function(a){var b=this.idPull[a];b.onselectstart=null;b.oncontextmenu=null;b.onmouseover=null;b.onmouseout=null;b.onclick=null;b.parentNode&&b.parentNode.removeChild(b);b=null;this.idPull[a]=null;try{delete this.idPull[a]}catch(c){}};
dhtmlXMenuObject.prototype._isArrowExists=function(a){return this.idPull["arrowup_"+a]!=null&&this.idPull["arrowdown_"+a]!=null?!0:!1};dhtmlXMenuObject.prototype._doScrollUp=function(a,b){var c=this.idPull["polygon_"+a];if(this._canScrollUp&&c.scrollTop>0){var d=!1,e=c.scrollTop-this._scrollUpTMStep;e<0&&(d=!0,e=0);c.scrollTop=e;if(!d){var f=this;this._scrollUpTM=window.setTimeout(function(){f._doScrollUp(a,!1)},this._scrollUpTMTime)}}else this._canScrollUp=!1,this._checkArrowsState(a);b&&this._checkArrowsState(a)};
dhtmlXMenuObject.prototype._doScrollDown=function(a,b){var c=this.idPull["polygon_"+a];if(this._canScrollDown&&c.scrollTop+c.offsetHeight<=c.scrollHeight){var d=!1,e=c.scrollTop+this._scrollDownTMStep;e+c.offsetHeight>c.scollHeight&&(d=!0,e=c.scollHeight-c.offsetHeight);c.scrollTop=e;if(!d){var f=this;this._scrollDownTM=window.setTimeout(function(){f._doScrollDown(a,!1)},this._scrollDownTMTime)}}else this._checkArrowsState(a);b&&this._checkArrowsState(a)};
dhtmlXMenuObject.prototype._countPolygonItems=function(a){var b=0,c;for(c in this.itemPull){var d=this.itemPull[c].parent,e=this.itemPull[c].type;d==this.idPrefix+a&&(e=="item"||e=="radio"||e=="checkbox")&&b++}return b};
dhtmlXMenuObject.prototype.setOverflowHeight=function(a){if(a==="auto")this.limit=0,this.autoOverflow=!0;else if(!(this.limit==0&&a<=0))if(this._clearAndHide(),this.limit>=0&&a>0)this.limit=a;else if(this.limit>0&&a<=0){for(var b in this.itemPull)if(this._isArrowExists(b)){var c=String(b).replace(this.idPrefix,"");this._removeUpArrow(c);this._removeDownArrow(c);this.idPull["polygon_"+b].style.height=""}this.limit=0}};
dhtmlXMenuObject.prototype._getRadioImgObj=function(a){try{var b=this.idPull[this.idPrefix+a].childNodes[this._rtl?2:0].childNodes[0]}catch(c){b=null}return b};dhtmlXMenuObject.prototype._setRadioState=function(a,b){var c=this._getRadioImgObj(a);if(c!=null){var d=this.itemPull[this.idPrefix+a];d.checked=b;d.imgen="rdbt_"+(d.checked?"1":"0");d.imgdis=d.imgen;c.className="sub_icon "+d.imgen}};
dhtmlXMenuObject.prototype._radioOnClickHandler=function(a,b,c){if(!(b.charAt(1)=="d"||this.itemPull[this.idPrefix+a].group==null)){var d=this.itemPull[this.idPrefix+a].group;this.checkEvent("onRadioClick")?this.callEvent("onRadioClick",[d,this.getRadioChecked(d),a,this.contextMenuZoneId,c])&&this.setRadioChecked(d,a):this.setRadioChecked(d,a);this.checkEvent("onClick")&&this.callEvent("onClick",[a])}};
dhtmlXMenuObject.prototype.getRadioChecked=function(a){for(var b=null,c=0;c<this.radio[a].length;c++){var d=this.radio[a][c].replace(this.idPrefix,""),e=this._getRadioImgObj(d);if(e!=null){var f=e.className.match(/rdbt_1$/gi);f!=null&&(b=d)}}return b};dhtmlXMenuObject.prototype.setRadioChecked=function(a,b){if(this.radio[a]!=null)for(var c=0;c<this.radio[a].length;c++){var d=this.radio[a][c].replace(this.idPrefix,"");this._setRadioState(d,d==b)}};
dhtmlXMenuObject.prototype.addRadioButton=function(a,b,c,d,e,f,g,h){if(!(this.context&&b==this.topId)){if(this.itemPull[this.idPrefix+b]==null)return;if(a=="child"&&this.itemPull[this.idPrefix+b].type!="item")return}var i=this.idPrefix+(d!=null?d:this._genStr(24)),j="rdbt_"+(g?"1":"0"),k=j;if(a=="sibling"){var m=this.idPrefix+this.getParentId(b);this._addItemIntoGlobalStrorage(i,m,e,"radio",h,j,k);this._renderSublevelItem(i,this.getItemPosition(b))}else m=this.idPrefix+b,this._addItemIntoGlobalStrorage(i,
m,e,"radio",h,j,k),this.idPull["polygon_"+m]==null&&this._renderSublevelPolygon(m,m),this._renderSublevelItem(i,c-1),this._redefineComplexState(m);var l=f!=null?f:this._genStr(24);this.itemPull[i].group=l;this.radio[l]==null&&(this.radio[l]=[]);this.radio[l][this.radio[l].length]=i;g==!0&&this.setRadioChecked(l,String(i).replace(this.idPrefix,""))};dhtmlXMenuObject.prototype._getCheckboxState=function(a){return this.itemPull[this.idPrefix+a]==null?null:this.itemPull[this.idPrefix+a].checked};
dhtmlXMenuObject.prototype._setCheckboxState=function(a,b){this.itemPull[this.idPrefix+a]!=null&&(this.itemPull[this.idPrefix+a].checked=b)};
dhtmlXMenuObject.prototype._updateCheckboxImage=function(a){if(this.idPull[this.idPrefix+a]!=null){this.itemPull[this.idPrefix+a].imgen="chbx_"+(this._getCheckboxState(a)?"1":"0");this.itemPull[this.idPrefix+a].imgdis=this.itemPull[this.idPrefix+a].imgen;try{this.idPull[this.idPrefix+a].childNodes[this._rtl?2:0].childNodes[0].className="sub_icon "+this.itemPull[this.idPrefix+a].imgen}catch(b){}}};
dhtmlXMenuObject.prototype._checkboxOnClickHandler=function(a,b,c){if(b.charAt(1)!="d"&&this.itemPull[this.idPrefix+a]!=null){var d=this._getCheckboxState(a);this.checkEvent("onCheckboxClick")?this.callEvent("onCheckboxClick",[a,d,this.contextMenuZoneId,c])&&this.setCheckboxState(a,!d):this.setCheckboxState(a,!d);this.checkEvent("onClick")&&this.callEvent("onClick",[a])}};dhtmlXMenuObject.prototype.setCheckboxState=function(a,b){this._setCheckboxState(a,b);this._updateCheckboxImage(a)};
dhtmlXMenuObject.prototype.getCheckboxState=function(a){return this._getCheckboxState(a)};
dhtmlXMenuObject.prototype.addCheckbox=function(a,b,c,d,e,f,g){if(!(this.context&&b==this.topId)){if(this.itemPull[this.idPrefix+b]==null)return;if(a=="child"&&this.itemPull[this.idPrefix+b].type!="item")return}var h="chbx_"+(f?"1":"0"),i=h;if(a=="sibling"){var j=this.idPrefix+(d!=null?d:this._genStr(24)),k=this.idPrefix+this.getParentId(b);this._addItemIntoGlobalStrorage(j,k,e,"checkbox",g,h,i);this.itemPull[j].checked=f;this._renderSublevelItem(j,this.getItemPosition(b))}else j=this.idPrefix+(d!=
null?d:this._genStr(24)),k=this.idPrefix+b,this._addItemIntoGlobalStrorage(j,k,e,"checkbox",g,h,i),this.itemPull[j].checked=f,this.idPull["polygon_"+k]==null&&this._renderSublevelPolygon(k,k),this._renderSublevelItem(j,c-1),this._redefineComplexState(k)};
dhtmlXMenuObject.prototype._readLevel=function(a){var b="",c;for(c in this.itemPull)if(this.itemPull[c].parent==a){var d="",e="",f="",g=String(this.itemPull[c].id).replace(this.idPrefix,""),h="",i=this.itemPull[c].title!=""?' text="'+this.itemPull[c].title+'"':"",j="";this.itemPull[c].type=="item"&&(this.itemPull[c].imgen!=""&&(d=' img="'+this.itemPull[c].imgen+'"'),this.itemPull[c].imgdis!=""&&(e=' imgdis="'+this.itemPull[c].imgdis+'"'),this.itemPull[c].hotkey!=""&&(f="<hotkey>"+this.itemPull[c].hotkey+
"</hotkey>"));this.itemPull[c].type=="separator"?h=' type="separator"':this.itemPull[c].state=="disabled"&&(j=' enabled="false"');this.itemPull[c].type=="checkbox"&&(h=' type="checkbox"'+(this.itemPull[c].checked?' checked="true"':""));this.itemPull[c].type=="radio"&&(h=' type="radio" group="'+this.itemPull[c].group+'" '+(this.itemPull[c].checked?' checked="true"':""));b+="<item id='"+g+"'"+i+h+d+e+j+">";b+=f;this.itemPull[c].complex&&(b+=this._readLevel(c));b+="</item>"}return b};
dhtmlXMenuObject.prototype.serialize=function(){var a="<menu>"+this._readLevel(this.idPrefix+this.topId)+"</menu>";return a};
function dhtmlXToolbarObject(a,b){var c=this;for(this.cont=typeof a!="object"?document.getElementById(a):a;this.cont.childNodes.length>0;)this.cont.removeChild(this.cont.childNodes[0]);this.cont.dir="ltr";this.cont.innerHTML+="<div class='dhxtoolbar_hdrline_ll'></div><div class='dhxtoolbar_hdrline_rr'></div><div class='dhxtoolbar_hdrline_l'></div><div class='dhxtoolbar_hdrline_r'></div>";this.base=document.createElement("DIV");this.base.className="float_left";this.cont.appendChild(this.base);this.align=
"left";this.setAlign=function(a){this.align=a=="right"?"right":"left";this.base.className=a=="right"?"float_right":"float_left";if(this._spacer)this._spacer.className="dhxtoolbar_spacer "+(a=="right"?" float_left":" float_right")};this._isIE6=!1;if(_isIE)this._isIE6=window.XMLHttpRequest==null?!0:!1;if(this._isIPad=navigator.userAgent.search(/iPad/gi)>=0)this.cont.ontouchstart=function(a){a=a||event;a.returnValue=!1;a.cancelBubble=!0;return!1};this.iconSize=18;this.setIconSize=function(a){this.iconSize=
{18:!0,24:!0,32:!0,48:!0}[a]?a:18;this.setSkin(this.skin,!0);this.callEvent("_onIconSizeChange",[this.iconSize])};this.selectPolygonOffsetLeft=this.selectPolygonOffsetTop=0;this._improveTerraceSkin=function(a){var b=null;a!=null&&(b={},b[a]=a);var c={buttonInput:!0,separator:!0,text:!0},g;for(g in b||this.objPull)if(this.objPull[g]!=null&&this.objPull[g].obj!=null){if(this.objPull[g].type=="buttonInput")this.objPull[g].obj.className=this.objPull[g].obj.className.replace(/dhx_toolbar_btn/,"dhx_toolbar_inp");
var h=this.objPull[g][this.objPull[g].type=="buttonSelect"?"arw":"obj"],i=!1,j=!1;if(!c[this.objPull[g].type]){h==h.parentNode.lastChild&&(i=!0);if(h.nextSibling!=null){var k=null,m;for(m in this.objPull)if(this.objPull[m].obj==h.nextSibling)k=this.objPull[m].type;c[k]&&(i=!0)}this.objPull[g].obj==h.parentNode.firstChild&&(j=!0);if(this.objPull[g].obj.previousSibling!=null){k=null;for(m in this.objPull)if(this.objPull[m].obj==this.objPull[g].obj.previousSibling)k=this.objPull[m].type;c[k]&&(j=!0)}}h.style.borderRight=
i?"1px solid #cecece":"";h.style.borderTopRightRadius=h.style.borderBottomRightRadius=i?"5px":"0px";this.objPull[g].obj.style.borderTopLeftRadius=this.objPull[g].obj.style.borderBottomLeftRadius=j?"5px":"0px";this.objPull[g].obj._br=i;this.objPull[g].obj._bl=j;h=null}};this._improveTerraceButtonSelect=function(a,b){var c=this.objPull[a];b==!0?(c.obj.style.borderBottomLeftRadius=c.obj._bl?"5px":"0px",c.arw.style.borderBottomRightRadius=c.obj._br?"5px":"0px"):(c.obj.style.borderBottomLeftRadius="0px",
c.arw.style.borderBottomRightRadius="0px");c=null};this.setSkin=function(a,b){if(b===!0)this.cont.className=this.cont.className.replace(/dhx_toolbar_base_\d{1,}_/,"dhx_toolbar_base_"+this.iconSize+"_");else{this.skin=a;if(this.skin=="dhx_skyblue")this.selectPolygonOffsetTop=1;if(this.skin=="dhx_web")this.selectPolygonOffsetLeft=this.selectPolygonOffsetTop=1;if(this.skin=="dhx_terrace")this.selectPolygonOffsetTop=-1,this.selectPolygonOffsetLeft=0;this.cont.className="dhx_toolbar_base_"+this.iconSize+
"_"+this.skin+(this.rtl?" rtl":"")}for(var c in this.objPull){var g=this.objPull[c];if(g.type=="slider")g.pen._detectLimits(),g.pen._definePos(),g.label.className="dhx_toolbar_slider_label_"+this.skin+(this.rtl?" rtl":"");if(g.type=="buttonSelect")g.polygon.className="dhx_toolbar_poly_"+this.iconSize+"_"+this.skin+(this.rtl?" rtl":"")}a=="dhx_terrace"&&this._improveTerraceSkin()};this.setSkin(b!=null?b:typeof dhtmlx!="undefined"&&typeof dhtmlx.skin=="string"?dhtmlx.skin:"dhx_skyblue");this.objPull=
{};this.anyUsed="none";this.imagePath="";this.setIconPath=this.setIconsPath=function(a){this.imagePath=a};this._doOnLoad=function(){};this.loadXML=function(a,b){if(b!=null)this._doOnLoad=function(){b()};this.callEvent("onXLS",[]);this._xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window);this._xmlLoader.loadXML(a)};this.loadXMLString=function(a,b){if(b!=null)this._doOnLoad=function(){b()};this._xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window);this._xmlLoader.loadXMLString(a)};this._xmlParser=
function(){for(var a=this.getXMLTopNode("toolbar"),b="id,type,hidden,title,text,enabled,img,imgdis,action,openAll,renderSelect,mode,maxOpen,width,value,selected,length,textMin,textMax,toolTip,valueMin,valueMax,valueNow".split(","),f="id,type,enabled,disabled,action,selected,img,text".split(","),g=0;g<a.childNodes.length;g++)if(a.childNodes[g].tagName=="item"){for(var h={},i=0;i<b.length;i++)h[b[i]]=a.childNodes[g].getAttribute(b[i]);h.items=[];h.userdata=[];for(var j=0;j<a.childNodes[g].childNodes.length;j++){if(a.childNodes[g].childNodes[j].tagName==
"item"&&h.type=="buttonSelect"){for(var k={},i=0;i<f.length;i++)k[f[i]]=a.childNodes[g].childNodes[j].getAttribute(f[i]);try{k.itemText=a.childNodes[g].childNodes[j].getElementsByTagName("itemText")[0].firstChild.nodeValue}catch(m){}for(var l=a.childNodes[g].childNodes[j].getElementsByTagName("userdata"),i=0;i<l.length;i++){if(!k.userdata)k.userdata={};var n={};try{n.name=l[i].getAttribute("name")}catch(o){n.name=""}try{n.value=l[i].firstChild.nodeValue}catch(p){n.value=""}if(n.name!="")k.userdata[n.name]=
n.value}h.items[h.items.length]=k}if(a.childNodes[g].childNodes[j].tagName=="userdata"){k={};try{k.name=a.childNodes[g].childNodes[j].getAttribute("name")}catch(r){k.name=""}try{k.value=a.childNodes[g].childNodes[j].firstChild.nodeValue}catch(q){k.value=""}h.userdata[h.userdata.length]=k}}c._addItemToStorage(h)}c.skin=="dhx_terrace"&&c._improveTerraceSkin();c.callEvent("onXLE",[]);c._doOnLoad();this.destructor()};this._addItemToStorage=function(a,b){var c=a.id||this._genStr(24),g=a.type||"";if(g!=
""&&this["_"+g+"Object"]!=null){if((typeof a.openAll=="undefined"||a.openAll==null)&&this.skin=="dhx_terrace")a.openAll=!0;this.objPull[this.idPrefix+c]=new this["_"+g+"Object"](this,c,a);this.objPull[this.idPrefix+c].type=g;this.setPosition(c,b)}if(a.userdata)for(var h=0;h<a.userdata.length;h++)this.setUserData(c,a.userdata[h].name,a.userdata[h].value)};this._genStr=function(a){for(var b="",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",g=0;g<a;g++)b+=c.charAt(Math.round(Math.random()*
(c.length-1)));return b};this.rootTypes="button,buttonSelect,buttonTwoState,separator,label,slider,text,buttonInput".split(",");this.idPrefix=this._genStr(12);dhtmlxEventable(this);this._getObj=function(a,b){for(var c=null,g=0;g<a.childNodes.length;g++)a.childNodes[g].tagName!=null&&String(a.childNodes[g].tagName).toLowerCase()==String(b).toLowerCase()&&(c=a.childNodes[g]);return c};this._addImgObj=function(a){var b=document.createElement("IMG");a.childNodes.length>0?a.insertBefore(b,a.childNodes[0]):
a.appendChild(b);return b};this._setItemImage=function(a,b,c){c==!0?a.imgEn=b:a.imgDis=b;if(!(!a.state&&c==!0||a.state&&c==!1)){var g=this._getObj(a.obj,"img");g==null&&(g=this._addImgObj(a.obj));g.src=this.imagePath+b}};this._clearItemImage=function(a,b){b==!0?a.imgEn="":a.imgDis="";if(!(!a.state&&b==!0||a.state&&b==!1)){var c=this._getObj(a.obj,"img");c!=null&&c.parentNode.removeChild(c)}};this._setItemText=function(a,b){var c=this._getObj(a.obj,"div");b==null||b.length==0?c!=null&&c.parentNode.removeChild(c):
(c==null&&(c=document.createElement("DIV"),a.obj.appendChild(c)),c.innerHTML=b)};this._getItemText=function(a){var b=this._getObj(a.obj,"div");return b!=null?b.innerHTML:""};this._enableItem=function(a){if(!a.state){a.state=!0;this.objPull[a.id].type=="buttonTwoState"&&this.objPull[a.id].obj.pressed==!0?(a.obj.className="dhx_toolbar_btn pres",a.obj.renderAs="dhx_toolbar_btn over"):(a.obj.className="dhx_toolbar_btn def",a.obj.renderAs=a.obj.className);if(a.arw)a.arw.className=String(a.obj.className).replace("btn",
"arw");var b=this._getObj(a.obj,"img");a.imgEn!=""?(b==null&&(b=this._addImgObj(a.obj)),b.src=this.imagePath+a.imgEn):b!=null&&b.parentNode.removeChild(b)}};this._disableItem=function(a){if(a.state){a.state=!1;a.obj.className="dhx_toolbar_btn "+(this.objPull[a.id].type=="buttonTwoState"&&a.obj.pressed?"pres_":"")+"dis";a.obj.renderAs="dhx_toolbar_btn def";if(a.arw)a.arw.className=String(a.obj.className).replace("btn","arw");var b=this._getObj(a.obj,"img");a.imgDis!=""?(b==null&&(b=this._addImgObj(a.obj)),
b.src=this.imagePath+a.imgDis):b!=null&&b.parentNode.removeChild(b);if(a.polygon!=null&&a.polygon.style.display!="none"){a.polygon.style.display="none";if(a.polygon._ie6cover)a.polygon._ie6cover.style.display="none";this.skin=="dhx_terrace"&&this._improveTerraceButtonSelect(a.id,!0)}this.anyUsed="none"}};this.clearAll=function(){for(var a in this.objPull)this._removeItem(String(a).replace(this.idPrefix,""))};this._isWebToolbar=!0;this._doOnClick=function(){c.forEachItem(function(a){if(c.objPull[c.idPrefix+
a].type=="buttonSelect"){var b=c.objPull[c.idPrefix+a];if(b.polygon.style.display!="none"){b.obj.renderAs="dhx_toolbar_btn def";b.obj.className=b.obj.renderAs;b.arw.className=String(b.obj.renderAs).replace("btn","arw");c.anyUsed="none";b.polygon.style.display="none";if(b.polygon._ie6cover)b.polygon._ie6cover.style.display="none";c.skin=="dhx_terrace"&&c._improveTerraceButtonSelect(b.id,!0)}}})};this._isIPad?document.addEventListener("touchstart",this._doOnClick,!1):_isIE?document.body.attachEvent("onclick",
this._doOnClick):window.addEventListener("click",this._doOnClick,!1);return this}
dhtmlXToolbarObject.prototype.addSpacer=function(a){var b=this.idPrefix+a;if(this._spacer!=null){if(this._spacer.idd==a)return;if(this._spacer==this.objPull[b].obj.parentNode){for(var c=!0;c;){var d=this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if(d==a||this._spacer.childNodes.length==0)this.objPull[b].arw!=null&&this.base.appendChild(this.objPull[b].arw),c=!1}this._spacer.idd=a;this._fixSpacer();return}if(this.base==this.objPull[b].obj.parentNode){for(var c=!0,
e=this.objPull[b].arw!=null;c;){var f=this.base.childNodes.length-1;e==!0&&this.base.childNodes[f]==this.objPull[b].arw&&(c=!1);this.base.childNodes[f].idd==a&&(c=!1);c&&(this._spacer.childNodes.length>0?this._spacer.insertBefore(this.base.childNodes[f],this._spacer.childNodes[0]):this._spacer.appendChild(this.base.childNodes[f]))}this._spacer.idd=a;this._fixSpacer();return}}else{for(var g=null,f=0;f<this.base.childNodes.length;f++)this.base.childNodes[f]==this.objPull[this.idPrefix+a].obj&&(g=f,
this.objPull[this.idPrefix+a].arw!=null&&(g=f+1));if(g!=null){this._spacer=document.createElement("DIV");this._spacer.className="dhxtoolbar_spacer "+(this.align=="right"?" float_left":" float_right");this._spacer.dir="rtl";for(this._spacer.idd=a;this.base.childNodes.length>g+1;)this._spacer.appendChild(this.base.childNodes[g+1]);this.cont.appendChild(this._spacer);this._fixSpacer()}}this.skin=="dhx_terrace"&&this._improveTerraceSkin()};
dhtmlXToolbarObject.prototype.removeSpacer=function(){if(this._spacer){for(;this._spacer.childNodes.length>0;)this.base.appendChild(this._spacer.childNodes[0]);this._spacer.parentNode.removeChild(this._spacer);this._spacer=null;this.skin=="dhx_terrace"&&this._improveTerraceSkin()}};
dhtmlXToolbarObject.prototype._fixSpacer=function(){if(_isIE&&this._spacer!=null){this._spacer.style.borderLeft="1px solid #a4bed4";var a=this._spacer;window.setTimeout(function(){a.style.borderLeft="0px solid #a4bed4";a=null},1)}};
dhtmlXToolbarObject.prototype.getType=function(a){var b=this.getParentId(a);if(b!=null){var c=null,d=this.objPull[this.idPrefix+b]._listOptions[a];d!=null&&(c=d.sep!=null?"buttonSelectSeparator":"buttonSelectButton");return c}else return this.objPull[this.idPrefix+a]==null?null:this.objPull[this.idPrefix+a].type};dhtmlXToolbarObject.prototype.getTypeExt=function(a){var b=this.getType(a);return b=="buttonSelectButton"||b=="buttonSelectSeparator"?b=b=="buttonSelectButton"?"button":"separator":null};
dhtmlXToolbarObject.prototype.inArray=function(a,b){for(var c=0;c<a.length;c++)if(a[c]==b)return!0;return!1};dhtmlXToolbarObject.prototype.getParentId=function(a){var b=null,c;for(c in this.objPull)if(this.objPull[c]._listOptions)for(var d in this.objPull[c]._listOptions)d==a&&(b=String(c).replace(this.idPrefix,""));return b};dhtmlXToolbarObject.prototype._addItem=function(a,b){this._addItemToStorage(a,b);this.skin=="dhx_terrace"&&this._improveTerraceSkin()};
dhtmlXToolbarObject.prototype.addButton=function(a,b,c,d,e){this._addItem({id:a,type:"button",text:c,img:d,imgdis:e},b)};dhtmlXToolbarObject.prototype.addText=function(a,b,c){this._addItem({id:a,type:"text",text:c},b)};
dhtmlXToolbarObject.prototype.addButtonSelect=function(a,b,c,d,e,f,g,h,i){for(var j=[],k=0;k<d.length;k++){var m={};d[k].id&&d[k].type?(m.id=d[k].id,m.type=d[k].type=="obj"?"button":"separator",m.text=d[k].text,m.img=d[k].img):(m.id=d[k][0],m.type=d[k][1]=="obj"?"button":"separator",m.text=d[k][2]||null,m.img=d[k][3]||null);j[j.length]=m}this._addItem({id:a,type:"buttonSelect",text:c,img:e,imgdis:f,renderSelect:g,openAll:h,items:j,maxOpen:i},b)};
dhtmlXToolbarObject.prototype.addButtonTwoState=function(a,b,c,d,e){this._addItem({id:a,type:"buttonTwoState",img:d,imgdis:e,text:c},b)};dhtmlXToolbarObject.prototype.addSeparator=function(a,b){this._addItem({id:a,type:"separator"},b)};dhtmlXToolbarObject.prototype.addSlider=function(a,b,c,d,e,f,g,h,i){this._addItem({id:a,type:"slider",length:c,valueMin:d,valueMax:e,valueNow:f,textMin:g,textMax:h,toolTip:i},b)};
dhtmlXToolbarObject.prototype.addInput=function(a,b,c,d){this._addItem({id:a,type:"buttonInput",value:c,width:d},b)};dhtmlXToolbarObject.prototype.forEachItem=function(a){for(var b in this.objPull)this.inArray(this.rootTypes,this.objPull[b].type)&&a(this.objPull[b].id.replace(this.idPrefix,""))};
(function(){for(var a="showItem,hideItem,isVisible,enableItem,disableItem,isEnabled,setItemText,getItemText,setItemToolTip,getItemToolTip,getInput,setItemImage,setItemImageDis,clearItemImage,clearItemImageDis,setItemState,getItemState,setItemToolTipTemplate,getItemToolTipTemplate,setValue,getValue,setMinValue,getMinValue,setMaxValue,getMaxValue,setWidth,getWidth,setMaxOpen".split(","),b=["","",!1,"","",!1,"","","","","","","","","",!1,"","","",null,"",[null,null],"",[null,null],"",null],c=function(a,
b){return function(c,d,e){c=this.idPrefix+c;return this.objPull[c][a]!=null?this.objPull[c][a].call(this.objPull[c],d,e):b}},d=0;d<a.length;d++){var e=a[d],f=b[d];dhtmlXToolbarObject.prototype[e]=c(e,f)}})();dhtmlXToolbarObject.prototype.getPosition=function(a){return this._getPosition(a)};
dhtmlXToolbarObject.prototype._getPosition=function(a){if(this.objPull[this.idPrefix+a]==null)return null;for(var b=null,c=0,d=0;d<this.base.childNodes.length;d++)this.base.childNodes[d].idd!=null&&(this.base.childNodes[d].idd==a&&(b=c),c++);if(!b&&this._spacer!=null)for(d=0;d<this._spacer.childNodes.length;d++)this._spacer.childNodes[d].idd!=null&&(this._spacer.childNodes[d].idd==a&&(b=c),c++);return b};dhtmlXToolbarObject.prototype.setPosition=function(a,b){this._setPosition(a,b)};
dhtmlXToolbarObject.prototype._setPosition=function(a,b){if(this.objPull[this.idPrefix+a]!=null){if(isNaN(b))b=this.base.childNodes.length;b<0&&(b=0);var c=null;if(this._spacer)c=this._spacer.idd,this.removeSpacer();var d=this.objPull[this.idPrefix+a];this.base.removeChild(d.obj);d.arw&&this.base.removeChild(d.arw);var e=this._getIdByPosition(b,!0);e[0]==null?(this.base.appendChild(d.obj),d.arw&&this.base.appendChild(d.arw)):(this.base.insertBefore(d.obj,this.base.childNodes[e[1]]),d.arw&&this.base.insertBefore(d.arw,
this.base.childNodes[e[1]+1]));c!=null&&this.addSpacer(c)}};dhtmlXToolbarObject.prototype._getIdByPosition=function(a,b){for(var c=null,d=0,e=0,f=0;f<this.base.childNodes.length;f++)this.base.childNodes[f].idd!=null&&c==null&&d++==a&&(c=this.base.childNodes[f].idd),c==null&&e++;e=c==null?null:e;return b==!0?[c,e]:c};dhtmlXToolbarObject.prototype.removeItem=function(a){this._removeItem(a);this.skin=="dhx_terrace"&&this._improveTerraceSkin()};
dhtmlXToolbarObject.prototype._removeItem=function(a){var b=this.getType(a),a=this.idPrefix+a,c=this.objPull[a];if(b=="button")c.obj._doOnMouseOver=null,c.obj._doOnMouseOut=null,c.obj._doOnMouseUp=null,c.obj._doOnMouseUpOnceAnywhere=null,c.obj.onclick=null,c.obj.onmouseover=null,c.obj.onmouseout=null,c.obj.onmouseup=null,c.obj.onmousedown=null,c.obj.onselectstart=null,c.obj.renderAs=null,c.obj.idd=null,c.obj.parentNode.removeChild(c.obj),c.obj=null,c.id=null,c.state=null,c.img=null,c.imgEn=null,c.imgDis=
null,c.type=null,c.enableItem=null,c.disableItem=null,c.isEnabled=null,c.showItem=null,c.hideItem=null,c.isVisible=null,c.setItemText=null,c.getItemText=null,c.setItemImage=null,c.clearItemImage=null,c.setItemImageDis=null,c.clearItemImageDis=null,c.setItemToolTip=null,c.getItemToolTip=null;if(b=="buttonTwoState")c.obj._doOnMouseOver=null,c.obj._doOnMouseOut=null,c.obj.onmouseover=null,c.obj.onmouseout=null,c.obj.onmousedown=null,c.obj.onselectstart=null,c.obj.renderAs=null,c.obj.idd=null,c.obj.parentNode.removeChild(c.obj),
c.obj=null,c.id=null,c.state=null,c.img=null,c.imgEn=null,c.imgDis=null,c.type=null,c.enableItem=null,c.disableItem=null,c.isEnabled=null,c.showItem=null,c.hideItem=null,c.isVisible=null,c.setItemText=null,c.getItemText=null,c.setItemImage=null,c.clearItemImage=null,c.setItemImageDis=null,c.clearItemImageDis=null,c.setItemToolTip=null,c.getItemToolTip=null,c.setItemState=null,c.getItemState=null;if(b=="buttonSelect"){for(var d in c._listOptions)this.removeListOption(a,d);c._listOptions=null;if(c.polygon._ie6cover)document.body.removeChild(c.polygon._ie6cover),
c.polygon._ie6cover=null;c.p_tbl.removeChild(c.p_tbody);c.polygon.removeChild(c.p_tbl);c.polygon.onselectstart=null;document.body.removeChild(c.polygon);c.p_tbody=null;c.p_tbl=null;c.polygon=null;c.obj.onclick=null;c.obj.onmouseover=null;c.obj.onmouseout=null;c.obj.onmouseup=null;c.obj.onmousedown=null;c.obj.onselectstart=null;c.obj.idd=null;c.obj.iddPrefix=null;c.obj.parentNode.removeChild(c.obj);c.obj=null;c.arw.onclick=null;c.arw.onmouseover=null;c.arw.onmouseout=null;c.arw.onmouseup=null;c.arw.onmousedown=
null;c.arw.onselectstart=null;c.arw.parentNode.removeChild(c.arw);c.arw=null;c.renderSelect=null;c.state=null;c.type=null;c.id=null;c.img=null;c.imgEn=null;c.imgDis=null;c.openAll=null;c._isListButton=null;c._separatorButtonSelectObject=null;c._buttonButtonSelectObject=null;c.setWidth=null;c.enableItem=null;c.disableItem=null;c.isEnabled=null;c.showItem=null;c.hideItem=null;c.isVisible=null;c.setItemText=null;c.getItemText=null;c.setItemImage=null;c.clearItemImage=null;c.setItemImageDis=null;c.clearItemImageDis=
null;c.setItemToolTip=null;c.getItemToolTip=null;c.addListOption=null;c.removeListOption=null;c.showListOption=null;c.hideListOption=null;c.isListOptionVisible=null;c.enableListOption=null;c.disableListOption=null;c.isListOptionEnabled=null;c.setListOptionPosition=null;c.getListOptionPosition=null;c.setListOptionImage=null;c.getListOptionImage=null;c.clearListOptionImage=null;c.setListOptionText=null;c.getListOptionText=null;c.setListOptionToolTip=null;c.getListOptionToolTip=null;c.forEachListOption=
null;c.getAllListOptions=null;c.setListOptionSelected=null;c.getListOptionSelected=null}if(b=="buttonInput")c.obj.childNodes[0].onkeydown=null,c.obj.removeChild(c.obj.childNodes[0]),c.obj.w=null,c.obj.idd=null,c.obj.parentNode.removeChild(c.obj),c.obj=null,c.id=null,c.type=null,c.enableItem=null,c.disableItem=null,c.isEnabled=null,c.showItem=null,c.hideItem=null,c.isVisible=null,c.setItemToolTip=null,c.getItemToolTip=null,c.setWidth=null,c.getWidth=null,c.setValue=null,c.getValue=null,c.setItemText=
null,c.getItemText=null;if(b=="slider"){this._isIPad?(document.removeEventListener("touchmove",pen._doOnMouseMoveStart,!1),document.removeEventListener("touchend",pen._doOnMouseMoveEnd,!1)):_isIE?(document.body.detachEvent("onmousemove",c.pen._doOnMouseMoveStart),document.body.detachEvent("onmouseup",c.pen._doOnMouseMoveEnd)):(window.removeEventListener("mousemove",c.pen._doOnMouseMoveStart,!1),window.removeEventListener("mouseup",c.pen._doOnMouseMoveEnd,!1));c.pen.allowMove=null;c.pen.initXY=null;
c.pen.maxX=null;c.pen.minX=null;c.pen.nowX=null;c.pen.newNowX=null;c.pen.valueMax=null;c.pen.valueMin=null;c.pen.valueNow=null;c.pen._definePos=null;c.pen._detectLimits=null;c.pen._doOnMouseMoveStart=null;c.pen._doOnMouseMoveEnd=null;c.pen.onmousedown=null;c.obj.removeChild(c.pen);c.pen=null;c.label.tip=null;document.body.removeChild(c.label);c.label=null;c.obj.onselectstart=null;for(c.obj.idd=null;c.obj.childNodes.length>0;)c.obj.removeChild(c.obj.childNodes[0]);c.obj.parentNode.removeChild(c.obj);
c.obj=null;c.id=null;c.type=null;c.state=null;c.enableItem=null;c.disableItem=null;c.isEnabled=null;c.setItemToolTipTemplate=null;c.getItemToolTipTemplate=null;c.setMaxValue=null;c.setMinValue=null;c.getMaxValue=null;c.getMinValue=null;c.setValue=null;c.getValue=null;c.showItem=null;c.hideItem=null;c.isVisible=null}if(b=="separator")c.obj.onselectstart=null,c.obj.idd=null,c.obj.parentNode.removeChild(c.obj),c.obj=null,c.id=null,c.type=null,c.showItem=null,c.hideItem=null,c.isVisible=null;if(b=="text")c.obj.onselectstart=
null,c.obj.idd=null,c.obj.parentNode.removeChild(c.obj),c.obj=null,c.id=null,c.type=null,c.showItem=null,c.hideItem=null,c.isVisible=null,c.setWidth=null,c.setItemText=null,c.getItemText=null;c=b=null;this.objPull[this.idPrefix+a]=null;delete this.objPull[this.idPrefix+a]};
(function(){for(var a="addListOption,removeListOption,showListOption,hideListOption,isListOptionVisible,enableListOption,disableListOption,isListOptionEnabled,setListOptionPosition,getListOptionPosition,setListOptionText,getListOptionText,setListOptionToolTip,getListOptionToolTip,setListOptionImage,getListOptionImage,clearListOptionImage,forEachListOption,getAllListOptions,setListOptionSelected,getListOptionSelected".split(","),b=function(a){return function(b,c,d,i,j,k){b=this.idPrefix+b;if(this.objPull[b]!=
null)return this.objPull[b].type!="buttonSelect"?void 0:this.objPull[b][a].call(this.objPull[b],c,d,i,j,k)}},c=0;c<a.length;c++){var d=a[c];dhtmlXToolbarObject.prototype[d]=b(d)}})();dhtmlXToolbarObject.prototype._rtlParseBtn=function(a,b){return a+b};
dhtmlXToolbarObject.prototype._separatorObject=function(a,b,c){this.id=a.idPrefix+b;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_sep";this.obj.style.display=c.hidden!=null?"none":"";this.obj.idd=String(b);this.obj.title=c.title||"";this.obj.onselectstart=function(a){a=a||event;a.returnValue=!1};if(a._isIPad)this.obj.ontouchstart=function(a){a=a||event;a.returnValue=!1;a.cancelBubble=!0;return!1};a.base.appendChild(this.obj);this.showItem=function(){this.obj.style.display=
""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display==""};return this};
dhtmlXToolbarObject.prototype._textObject=function(a,b,c){this.id=a.idPrefix+b;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_text";this.obj.style.display=c.hidden!=null?"none":"";this.obj.idd=String(b);this.obj.title=c.title||"";this.obj.onselectstart=function(a){a=a||event;a.returnValue=!1};if(a._isIPad)this.obj.ontouchstart=function(a){a=a||event;a.returnValue=!1;a.cancelBubble=!0;return!1};this.obj.innerHTML=c.text||"";a.base.appendChild(this.obj);this.showItem=function(){this.obj.style.display=
""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display==""};this.setItemText=function(a){this.obj.innerHTML=a};this.getItemText=function(){return this.obj.innerHTML};this.setWidth=function(a){this.obj.style.width=a+"px"};this.setItemToolTip=function(a){this.obj.title=a};this.getItemToolTip=function(){return this.obj.title};return this};
dhtmlXToolbarObject.prototype._buttonObject=function(a,b,c){this.id=a.idPrefix+b;this.state=c.enabled!=null?!1:!0;this.imgEn=c.img||"";this.imgDis=c.imgdis||"";this.img=this.state?this.imgEn!=""?this.imgEn:"":this.imgDis!=""?this.imgDis:"";this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn "+(this.state?"def":"dis");this.obj.style.display=c.hidden!=null?"none":"";this.obj.allowClick=!1;this.obj.extAction=c.action||null;this.obj.renderAs=this.obj.className;this.obj.idd=String(b);
this.obj.title=c.title||"";this.obj.pressed=!1;this.obj.innerHTML=a._rtlParseBtn(this.img!=""?"<img src='"+a.imagePath+this.img+"'>":"",c.text!=null?"<div>"+c.text+"</div>":"");var d=this;this.obj.onselectstart=function(a){a=a||event;a.returnValue=!1};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){this.allowClick=!0;if(d.state!=!1&&a.anyUsed=="none")this.renderAs=this.className="dhx_toolbar_btn over"};
this.obj._doOnMouseOut=function(){this.allowClick=!1;if(d.state!=!1&&a.anyUsed=="none")this.className="dhx_toolbar_btn def",this.renderAs=this.renderAs};this.obj.onclick=function(b){if(d.state!=!1&&this.allowClick!=!1){var b=b||event,c=this.idd.replace(a.idPrefix,"");if(this.extAction)try{window[this.extAction](c)}catch(g){}a&&a.callEvent&&a.callEvent("onClick",[c])}};this.obj[a._isIPad?"ontouchstart":"onmousedown"]=function(b){if(d.state==!1)return b=b||event,b.returnValue=!1,b.cancelBubble=!0,!1;
if(a.anyUsed=="none")return a.anyUsed=this.idd,this.className="dhx_toolbar_btn pres",this.pressed=!0,this.onmouseover=function(){this._doOnMouseOver()},this.onmouseout=function(){a.anyUsed="none";this._doOnMouseOut()},!1};this.obj[a._isIPad?"ontouchend":"onmouseup"]=function(){if(d.state!=!1&&!(a.anyUsed!="none"&&a.anyUsed!=this.idd)){var b=a.anyUsed;this._doOnMouseUp();a._isIPad&&b!="none"&&a.callEvent("onClick",[this.idd.replace(a.idPrefix,"")])}};if(a._isIPad)this.obj.ontouchmove=function(){this._doOnMouseUp()};
this.obj._doOnMouseUp=function(){a.anyUsed="none";this.className=this.renderAs;this.pressed=!1};this.obj._doOnMouseUpOnceAnywhere=function(){this._doOnMouseUp();this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){this._doOnMouseOut()}};a.base.appendChild(this.obj);this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display=
"none"};this.isVisible=function(){return this.obj.style.display==""};this.setItemText=function(b){a._setItemText(this,b)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(b){a._setItemImage(this,b,!0)};this.clearItemImage=function(){a._clearItemImage(this,!0)};this.setItemImageDis=function(b){a._setItemImage(this,b,!1)};this.clearItemImageDis=function(){a._clearItemImage(this,!1)};this.setItemToolTip=function(a){this.obj.title=a};this.getItemToolTip=function(){return this.obj.title};
return this};
dhtmlXToolbarObject.prototype._buttonSelectObject=function(a,b,c){this.id=a.idPrefix+b;this.state=c.enabled!=null?c.enabled=="true"?!0:!1:!0;this.imgEn=c.img||"";this.imgDis=c.imgdis||"";this.img=this.state?this.imgEn!=""?this.imgEn:"":this.imgDis!=""?this.imgDis:"";this.mode=c.mode||"button";if(this.mode=="select"){if(this.openAll=!0,this.renderSelect=!1,!c.text||c.text.length==0)c.text="&nbsp;"}else this.openAll=c.openAll=="true"||c.openAll==!0||c.openAll==1||c.openAll=="1"||c.openAll=="yes"||c.openAll==
"on",this.renderSelect=c.renderSelect!=null?c.renderSelect=="false"||c.renderSelect=="disabled"?!1:!0:!0;this.maxOpen=!isNaN(c.maxOpen?c.maxOpen:"")?c.maxOpen:null;this._maxOpenTest=function(){if(!isNaN(this.maxOpen)&&!a._sbw){var b=document.createElement("DIV");b.className="dhxtoolbar_maxopen_test";document.body.appendChild(b);var c=document.createElement("DIV");c.className="dhxtoolbar_maxopen_test2";b.appendChild(c);a._sbw=b.offsetWidth-c.offsetWidth;b.removeChild(c);c=null;document.body.removeChild(b);
b=null}};this._maxOpenTest();this.obj=document.createElement("DIV");this.obj.allowClick=!1;this.obj.extAction=c.action||null;this.obj.className="dhx_toolbar_btn "+(this.state?"def":"dis");this.obj.style.display=c.hidden!=null?"none":"";this.obj.renderAs=this.obj.className;this.obj.onselectstart=function(a){a=a||event;a.returnValue=!1};this.obj.idd=String(b);this.obj.title=c.title||"";this.callEvent=this.obj.pressed=!1;this.obj.innerHTML=a._rtlParseBtn(this.img!=""?"<img src='"+a.imagePath+this.img+
"'>":"",c.text!=null?"<div>"+c.text+"</div>":"");a.base.appendChild(this.obj);this.arw=document.createElement("DIV");this.arw.className="dhx_toolbar_arw "+(this.state?"def":"dis");this.arw.style.display=this.obj.style.display;this.arw.innerHTML="<div class='arwimg'>&nbsp;</div>";this.arw.title=this.obj.title;this.arw.onselectstart=function(a){a=a||event;a.returnValue=!1};a.base.appendChild(this.arw);var d=this;this.obj.onmouseover=function(b){b=b||event;if(a.anyUsed=="none"&&d.state)d.obj.renderAs=
"dhx_toolbar_btn over",d.obj.className=d.obj.renderAs,d.arw.className=String(d.obj.renderAs).replace("btn","arw")};this.obj.onmouseout=function(){d.obj.allowClick=!1;if(a.anyUsed=="none"&&d.state)d.obj.renderAs="dhx_toolbar_btn def",d.obj.className=d.obj.renderAs,d.arw.className=String(d.obj.renderAs).replace("btn","arw"),d.callEvent=!1};this.arw.onmouseover=this.obj.onmouseover;this.arw.onmouseout=this.obj.onmouseout;if(this.openAll!=!0)this.obj.onclick=function(b){b=b||event;if(d.obj.allowClick&&
d.state&&a.anyUsed=="none"){var c=d.obj.idd.replace(a.idPrefix,"");if(d.obj.extAction)try{window[d.obj.extAction](c)}catch(e){}a.callEvent("onClick",[c])}},this.obj[a._isIPad?"ontouchstart":"onmousedown"]=function(b){b=b||event;if(a.anyUsed=="none"&&d.state)d.obj.allowClick=!0,d.obj.className="dhx_toolbar_btn pres",d.arw.className="dhx_toolbar_arw pres",d.callEvent=!0},this.obj[a._isIPad?"ontouchend":"onmouseup"]=function(b){b=b||event;b.cancelBubble=!0;if(a.anyUsed=="none"&&d.state&&(d.obj.className=
d.obj.renderAs,d.arw.className=String(d.obj.renderAs).replace("btn","arw"),a._isIPad&&d.callEvent)){var c=d.obj.idd.replace(a.idPrefix,"");a.callEvent("onClick",[c])}};if(a._isIPad)this.obj.ontouchmove=this.obj.onmouseout;this.arw[a._isIPad?"ontouchstart":"onmousedown"]=function(b){b=b||event;if(d.state){if(a.anyUsed==d.obj.idd){d.obj.className=d.obj.renderAs;d.arw.className=String(d.obj.renderAs).replace("btn","arw");a.anyUsed="none";d.polygon.style.display="none";if(d.polygon._ie6cover)d.polygon._ie6cover.style.display=
"none";a.skin=="dhx_terrace"&&a._improveTerraceButtonSelect(d.id,!0)}else{if(a.anyUsed!="none"&&a.objPull[a.idPrefix+a.anyUsed].type=="buttonSelect"){var c=a.objPull[a.idPrefix+a.anyUsed];if(c.polygon.style.display!="none"){c.obj.renderAs="dhx_toolbar_btn def";c.obj.className=c.obj.renderAs;c.arw.className=String(d.obj.renderAs).replace("btn","arw");c.polygon.style.display="none";if(c.polygon._ie6cover)c.polygon._ie6cover.style.display="none";a.skin=="dhx_terrace"&&a._improveTerraceButtonSelect(c.id,
!0)}}d.obj.className="dhx_toolbar_btn over";d.arw.className="dhx_toolbar_arw pres";a.anyUsed=d.obj.idd;d.polygon.style.top="0px";d.polygon.style.visibility="hidden";d.polygon.style.display="";a.skin=="dhx_terrace"&&a._improveTerraceButtonSelect(d.id,!1);d._fixMaxOpenHeight(d.maxOpen||null);a._autoDetectVisibleArea();var e=getAbsoluteTop(d.obj)+d.obj.offsetHeight+a.selectPolygonOffsetTop,f=d.polygon.offsetHeight;if(e+f>a.tY2){var k=d.maxOpen!=null?Math.floor((a.tY2-e)/22):0;k>=1?d._fixMaxOpenHeight(k):
(e=getAbsoluteTop(d.obj)-f-a.selectPolygonOffsetTop,e<0&&(e=0))}d.polygon.style.top=e+"px";d.polygon.style.left=a.rtl?getAbsoluteLeft(d.obj)+d.obj.offsetWidth-d.polygon.offsetWidth+a.selectPolygonOffsetLeft+"px":getAbsoluteLeft(d.obj)+a.selectPolygonOffsetLeft+"px";d.polygon.style.visibility="visible";if(d.polygon._ie6cover)d.polygon._ie6cover.style.left=d.polygon.style.left,d.polygon._ie6cover.style.top=d.polygon.style.top,d.polygon._ie6cover.style.width=d.polygon.offsetWidth+"px",d.polygon._ie6cover.style.height=
d.polygon.offsetHeight+"px",d.polygon._ie6cover.style.display=""}return!1}};this.arw.onclick=function(a){a=a||event;a.cancelBubble=!0};this.arw[a._isIPad?"ontouchend":"onmouseup"]=function(a){a=a||event;a.cancelBubble=!0};if(this.openAll===!0&&(this.obj.onclick=this.arw.onclick,this.obj.onmousedown=this.arw.onmousedown,this.obj.onmouseup=this.arw.onmouseup,a._isIPad))this.obj.ontouchstart=this.arw.ontouchstart,this.obj.ontouchend=this.arw.ontouchend;this.obj.iddPrefix=a.idPrefix;this._listOptions=
{};this._fixMaxOpenHeight=function(b){var c="auto",e=!1;if(b!==null){var f=0,k;for(k in this._listOptions)f++;f>b?(this._ph=22*b,c=this._ph+"px"):e=!0}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!e&&d.maxOpen!=null)this.polygon.style.width=this.p_tbl.offsetWidth+a._sbw+"px",this.polygon.style.height=c};this._separatorButtonSelectObject=function(a,b,c){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.className="tr_sep";this.obj.tr.onselectstart=function(a){a=
a||event;return a.returnValue=!1};this.obj.td=document.createElement("TD");this.obj.td.colSpan="2";this.obj.td.className="td_btn_sep";this.obj.td.onselectstart=function(a){a=a||event;return a.returnValue=!1};isNaN(c)?c=d.p_tbody.childNodes.length+1:c<1&&(c=1);c>d.p_tbody.childNodes.length?d.p_tbody.appendChild(this.obj.tr):d.p_tbody.insertBefore(this.obj.tr,d.p_tbody.childNodes[c-1]);this.obj.tr.appendChild(this.obj.td);this.obj.sep=document.createElement("DIV");this.obj.sep.className="btn_sep";this.obj.sep.onselectstart=
function(a){a=a||event;return a.returnValue=!1};this.obj.td.appendChild(this.obj.sep);d._listOptions[a]=this.obj;return this};this._buttonButtonSelectObject=function(b,c,e){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=c.enabled=="false"?!1:c.disabled=="true"?!1:!0;this.obj.tr.extAction=c.action||null;this.obj.tr._selected=c.selected!=null;this.obj.tr.className="tr_btn"+(this.obj.tr.en?this.obj.tr._selected&&d.renderSelect?" tr_btn_selected":"":" tr_btn_disabled");this.obj.tr.onselectstart=
function(a){a=a||event;return a.returnValue=!1};this.obj.tr.idd=String(b);if(c.userdata)this.obj.userData=c.userdata;isNaN(e)?e=d.p_tbody.childNodes.length+1:e<1&&(e=1);e>d.p_tbody.childNodes.length?d.p_tbody.appendChild(this.obj.tr):d.p_tbody.insertBefore(this.obj.tr,d.p_tbody.childNodes[e-1]);this.obj.td_a=document.createElement("TD");this.obj.td_a.className="td_btn_img";this.obj.td_a.onselectstart=function(a){a=a||event;return a.returnValue=!1};this.obj.td_b=document.createElement("TD");this.obj.td_b.className=
"td_btn_txt";this.obj.td_b.onselectstart=function(a){a=a||event;return a.returnValue=!1};a.rtl?(this.obj.tr.appendChild(this.obj.td_b),this.obj.tr.appendChild(this.obj.td_a)):(this.obj.tr.appendChild(this.obj.td_a),this.obj.tr.appendChild(this.obj.td_b));if(c.img!=null)this.obj.td_a.innerHTML="<img class='btn_sel_img' src='"+a.imagePath+c.img+"' border='0'>",this.obj.tr._img=c.img;var f=c.text!=null?c.text:c.itemText||"";this.obj.td_b.innerHTML="<div class='btn_sel_text'>"+f+"</div>";this.obj.tr[a._isIPad?
"ontouchstart":"onmouseover"]=function(){if(this.en&&(!this._selected||!d.renderSelect))this.className="tr_btn tr_btn_over"};this.obj.tr.onmouseout=function(){if(this.en)if(this._selected&&d.renderSelect){if(String(this.className).search("tr_btn_selected")==-1)this.className="tr_btn tr_btn_selected"}else this.className="tr_btn"};this.obj.tr[a._isIPad?"ontouchend":"onclick"]=function(b){b=b||event;b.cancelBubble=!0;if(this.en){d.setListOptionSelected(this.idd.replace(a.idPrefix,""));d.obj.renderAs=
"dhx_toolbar_btn def";d.obj.className=d.obj.renderAs;d.arw.className=String(d.obj.renderAs).replace("btn","arw");d.polygon.style.display="none";if(d.polygon._ie6cover)d.polygon._ie6cover.style.display="none";a.skin=="dhx_terrace"&&a._improveTerraceButtonSelect(d.id,!0);a.anyUsed="none";var c=this.idd.replace(a.idPrefix,"");if(this.extAction)try{window[this.extAction](c)}catch(e){}a.callEvent("onClick",[c])}};d._listOptions[b]=this.obj;return this};this.polygon=document.createElement("DIV");this.polygon.dir=
"ltr";this.polygon.style.display="none";this.polygon.style.zIndex=101;this.polygon.className="dhx_toolbar_poly_"+a.iconSize+"_"+a.skin+(a.rtl?" rtl":"");this.polygon.onselectstart=function(a){a=a||event;a.returnValue=!1};this.polygon.style.overflowY="auto";if(a._isIPad)this.polygon.ontouchstart=function(a){a=a||event;a.returnValue=!1;a.cancelBubble=!0;return!1};this.p_tbl=document.createElement("TABLE");this.p_tbl.className="buttons_cont";this.p_tbl.cellSpacing="0";this.p_tbl.cellPadding="0";this.p_tbl.border=
"0";this.polygon.appendChild(this.p_tbl);this.p_tbody=document.createElement("TBODY");this.p_tbl.appendChild(this.p_tbody);if(c.items)for(var e=0;e<c.items.length;e++){var f="_"+(c.items[e].type||"")+"ButtonSelectObject";typeof this[f]=="function"&&new this[f](c.items[e].id||a._genStr(24),c.items[e])}document.body.appendChild(this.polygon);if(a._isIE6)this.polygon._ie6cover=document.createElement("IFRAME"),this.polygon._ie6cover.frameBorder=0,this.polygon._ie6cover.style.position="absolute",this.polygon._ie6cover.style.border=
"none",this.polygon._ie6cover.style.backgroundColor="#000000",this.polygon._ie6cover.style.filter="alpha(opacity=100)",this.polygon._ie6cover.style.display="none",this.polygon._ie6cover.setAttribute("src","javascript:false;"),document.body.appendChild(this.polygon._ie6cover);this.setWidth=function(a){this.obj.style.width=a-this.arw.offsetWidth+"px";this.polygon.style.width=this.obj.offsetWidth+this.arw.offsetWidth-2+"px";this.p_tbl.style.width=this.polygon.style.width};this.enableItem=function(){a._enableItem(this)};
this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display="";this.arw.style.display=""};this.hideItem=function(){this.obj.style.display="none";this.arw.style.display="none"};this.isVisible=function(){return this.obj.style.display==""};this.setItemText=function(b){a._setItemText(this,b)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(b){a._setItemImage(this,b,!0)};this.clearItemImage=
function(){a._clearItemImage(this,!0)};this.setItemImageDis=function(b){a._setItemImage(this,b,!1)};this.clearItemImageDis=function(){a._clearItemImage(this,!1)};this.setItemToolTip=function(a){this.obj.title=a;this.arw.title=a};this.getItemToolTip=function(){return this.obj.title};this.addListOption=function(a,b,c,d,e){if(c=="button"||c=="separator"){var f={id:a,type:c,text:d,img:e};new this["_"+c+"ButtonSelectObject"](a,f,b)}};this.removeListOption=function(a){if(this._isListButton(a,!0)){var b=
this._listOptions[a];if(b.td_a!=null&&b.td_b!=null){b.td_a.onselectstart=null;for(b.td_b.onselectstart=null;b.td_a.childNodes.length>0;)b.td_a.removeChild(b.td_a.childNodes[0]);for(;b.td_b.childNodes.length>0;)b.td_b.removeChild(b.td_b.childNodes[0]);b.tr.onselectstart=null;b.tr.onmouseover=null;b.tr.onmouseout=null;for(b.tr.onclick=null;b.tr.childNodes.length>0;)b.tr.removeChild(b.tr.childNodes[0]);b.tr.parentNode.removeChild(b.tr);b.td_a=null;b.td_b=null}else{b.sep.onselectstart=null;b.td.onselectstart=
null;for(b.tr.onselectstart=null;b.td.childNodes.length>0;)b.td.removeChild(b.td.childNodes[0]);for(;b.tr.childNodes.length>0;)b.tr.removeChild(b.tr.childNodes[0]);b.tr.parentNode.removeChild(b.tr);b.sep=null;b.td=null}b=b.tr=null;this._listOptions[a]=null;try{delete this._listOptions[a]}catch(c){}}};this.showListOption=function(a){if(this._isListButton(a,!0))this._listOptions[a].tr.style.display=""};this.hideListOption=function(a){if(this._isListButton(a,!0))this._listOptions[a].tr.style.display=
"none"};this.isListOptionVisible=function(a){return!this._isListButton(a,!0)?void 0:this._listOptions[a].tr.style.display!="none"};this.enableListOption=function(b){if(this._isListButton(b))this._listOptions[b].tr.en=!0,this._listOptions[b].tr.className="tr_btn"+(this._listOptions[b].tr._selected&&a.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(a){if(this._isListButton(a))this._listOptions[a].tr.en=!1,this._listOptions[a].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=
function(a){return!this._isListButton(a)?void 0:this._listOptions[a].tr.en};this.setListOptionPosition=function(a,b){if(this._listOptions[a]&&!(this.getListOptionPosition(a)==b||isNaN(b))){b<1&&(b=1);var c=this._listOptions[a].tr;this.p_tbody.removeChild(c);b>this.p_tbody.childNodes.length?this.p_tbody.appendChild(c):this.p_tbody.insertBefore(c,this.p_tbody.childNodes[b-1]);c=null}};this.getListOptionPosition=function(a){var b=-1;if(!this._listOptions[a])return b;for(var c=0;c<this.p_tbody.childNodes.length;c++)this.p_tbody.childNodes[c]==
this._listOptions[a].tr&&(b=c+1);return b};this.setListOptionImage=function(b,c){if(this._isListButton(b)){var d=this._listOptions[b].tr.childNodes[a.rtl?1:0];if(d.childNodes.length>0)d.childNodes[0].src=a.imagePath+c;else{var e=document.createElement("IMG");e.className="btn_sel_img";e.src=a.imagePath+c;d.appendChild(e)}d=null}};this.getListOptionImage=function(b){if(this._isListButton(b)){var c=this._listOptions[b].tr.childNodes[a.rtl?1:0],d=null;if(c.childNodes.length>0)d=c.childNodes[0].src;c=
null;return d}};this.clearListOptionImage=function(b){if(this._isListButton(b)){for(var c=this._listOptions[b].tr.childNodes[a.rtl?1:0];c.childNodes.length>0;)c.removeChild(c.childNodes[0]);c=null}};this.setListOptionText=function(b,c){if(this._isListButton(b))this._listOptions[b].tr.childNodes[a.rtl?0:1].childNodes[0].innerHTML=c};this.getListOptionText=function(b){return!this._isListButton(b)?void 0:this._listOptions[b].tr.childNodes[a.rtl?0:1].childNodes[0].innerHTML};this.setListOptionToolTip=
function(a,b){if(this._isListButton(a))this._listOptions[a].tr.title=b};this.getListOptionToolTip=function(a){return!this._isListButton(a)?void 0:this._listOptions[a].tr.title};this.forEachListOption=function(a){for(var b in this._listOptions)a(b)};this.getAllListOptions=function(){var a=[],b;for(b in this._listOptions)a[a.length]=b;return a};this.setListOptionSelected=function(a){for(var b in this._listOptions){var c=this._listOptions[b];if(c.td_a!=null&&c.td_b!=null&&c.tr.en)b==a?(c.tr._selected=
!0,c.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":""),this.mode=="select"&&(c.tr._img?this.setItemImage(c.tr._img):this.clearItemImage(),this.setItemText(this.getListOptionText(a)))):(c.tr._selected=!1,c.tr.className="tr_btn");c=null}};this.getListOptionSelected=function(){var a=null,b;for(b in this._listOptions)this._listOptions[b].tr._selected==!0&&(a=b);return a};this._isListButton=function(a,b){return this._listOptions[a]==null?!1:!b&&this._listOptions[a].tr.className=="tr_sep"?
!1:!0};this.setMaxOpen=function(a){this._ph=null;typeof a=="number"?(this.maxOpen=a,this._maxOpenTest()):this.maxOpen=null};c.width&&this.setWidth(c.width);this.mode=="select"&&typeof c.selected!="undefined"&&this.setListOptionSelected(c.selected);return this};
dhtmlXToolbarObject.prototype._buttonInputObject=function(a,b,c){this.id=a.idPrefix+b;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn def";this.obj.style.display=c.hidden!=null?"none":"";this.obj.idd=String(b);this.obj.w=c.width!=null?c.width:100;this.obj.title=c.title!=null?c.title:"";this.obj.innerHTML="<input class='inp' type='text' style='-moz-user-select:text;width:"+this.obj.w+"px;'"+(c.value!=null?" value='"+c.value+"'":"")+">";var d=a,e=this;this.obj.childNodes[0].onkeydown=
function(a){a=a||event;a.keyCode==13&&d.callEvent("onEnter",[e.obj.idd,this.value])};a.base.appendChild(this.obj);this.enableItem=function(){this.obj.childNodes[0].disabled=!1};this.disableItem=function(){this.obj.childNodes[0].disabled=!0};this.isEnabled=function(){return!this.obj.childNodes[0].disabled};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display!="none"};this.setValue=function(a){this.obj.childNodes[0].value=
a};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(a){this.obj.w=a;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(a){this.obj.title=a};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};return this};
dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(a,b,c){this.id=a.idPrefix+b;this.state=c.enabled!=null?!1:!0;this.imgEn=c.img!=null?c.img:"";this.imgDis=c.imgdis!=null?c.imgdis:"";this.img=this.state?this.imgEn!=""?this.imgEn:"":this.imgDis!=""?this.imgDis:"";this.obj=document.createElement("DIV");this.obj.pressed=c.selected!=null;this.obj.extAction=c.action||null;this.obj.className="dhx_toolbar_btn "+(this.obj.pressed?"pres"+(this.state?"":"_dis"):this.state?"def":"dis");this.obj.style.display=
c.hidden!=null?"none":"";this.obj.renderAs=this.obj.className;this.obj.idd=String(b);this.obj.title=c.title||"";if(this.obj.pressed)this.obj.renderAs="dhx_toolbar_btn over";this.obj.innerHTML=a._rtlParseBtn(this.img!=""?"<img src='"+a.imagePath+this.img+"'>":"",c.text!=null?"<div>"+c.text+"</div>":"");a.base.appendChild(this.obj);var d=this;this.obj.onselectstart=function(a){a=a||event;a.returnValue=!1};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};
this.obj._doOnMouseOver=function(){if(d.state!=!1&&a.anyUsed=="none")this.renderAs=this.pressed?"dhx_toolbar_btn over":this.className="dhx_toolbar_btn over"};this.obj._doOnMouseOut=function(){if(d.state!=!1&&a.anyUsed=="none")this.renderAs=this.pressed?"dhx_toolbar_btn def":this.className="dhx_toolbar_btn def"};this.obj[a._isIPad?"ontouchstart":"onmousedown"]=function(){if((!a.checkEvent("onBeforeStateChange")||a.callEvent("onBeforeStateChange",[this.idd.replace(a.idPrefix,""),this.pressed]))&&d.state!=
!1&&a.anyUsed=="none"){this.className=(this.pressed=!this.pressed)?"dhx_toolbar_btn pres":this.renderAs;var b=this.idd.replace(a.idPrefix,"");if(this.extAction)try{window[this.extAction](b,this.pressed)}catch(c){}a.callEvent("onStateChange",[b,this.pressed]);return!1}};this.setItemState=function(b,c){if(this.obj.pressed!=b&&(b==!0?(this.obj.pressed=!0,this.obj.className="dhx_toolbar_btn pres"+(this.state?"":"_dis"),this.obj.renderAs="dhx_toolbar_btn over"):(this.obj.pressed=!1,this.obj.className=
"dhx_toolbar_btn "+(this.state?"def":"dis"),this.obj.renderAs=this.obj.className),c==!0)){var d=this.obj.idd.replace(a.idPrefix,"");if(this.obj.extAction)try{window[this.obj.extAction](d,this.obj.pressed)}catch(h){}a.callEvent("onStateChange",[d,this.obj.pressed])}};this.getItemState=function(){return this.obj.pressed};this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=
""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display==""};this.setItemText=function(b){a._setItemText(this,b)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(b){a._setItemImage(this,b,!0)};this.clearItemImage=function(){a._clearItemImage(this,!0)};this.setItemImageDis=function(b){a._setItemImage(this,b,!1)};this.clearItemImageDis=function(){a._clearItemImage(this,!1)};this.setItemToolTip=function(a){this.obj.title=
a};this.getItemToolTip=function(){return this.obj.title};return this};
dhtmlXToolbarObject.prototype._sliderObject=function(a,b,c){this.id=a.idPrefix+b;this.state=c.enabled!=null?c.enabled=="true"?!0:!1:!0;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn "+(this.state?"def":"dis");this.obj.style.display=c.hidden!=null?"none":"";this.obj.onselectstart=function(a){a=a||event;a.returnValue=!1};this.obj.idd=String(b);this.obj.len=c.length!=null?Number(c.length):50;this.obj.innerHTML="<div>"+(c.textMin||"")+"</div><div class='sl_bg_l'></div><div class='sl_bg_m' style='width:"+
this.obj.len+"px;'></div><div class='sl_bg_r'></div><div>"+(c.textMax||"")+"</div>";a.base.appendChild(this.obj);var d=this;this.pen=document.createElement("DIV");this.pen.className="sl_pen";this.obj.appendChild(this.pen);var e=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+a.skin+(a.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=c.toolTip||"%v";document.body.appendChild(this.label);var f=this.label;this.pen.valueMin=
c.valueMin!=null?Number(c.valueMin):0;this.pen.valueMax=c.valueMax!=null?Number(c.valueMax):100;if(this.pen.valueMin>this.pen.valueMax)this.pen.valueMin=this.pen.valueMax;this.pen.valueNow=c.valueNow!=null?Number(c.valueNow):this.pen.valueMax;if(this.pen.valueNow>this.pen.valueMax)this.pen.valueNow=this.pen.valueMax;if(this.pen.valueNow<this.pen.valueMin)this.pen.valueNow=this.pen.valueMin;this.pen._detectLimits=function(){this.minX=d.obj.childNodes[1].offsetLeft-4;this.maxX=d.obj.childNodes[3].offsetLeft-
this.offsetWidth+1};this.pen._detectLimits();this.pen._definePos=function(){this.nowX=Math.round((this.valueNow-this.valueMin)*(this.maxX-this.minX)/(this.valueMax-this.valueMin)+this.minX);this.style.left=this.nowX+"px";this.newNowX=this.nowX};this.pen._definePos();this.pen.initXY=0;this.pen.allowMove=!1;this.pen[a._isIPad?"ontouchstart":"onmousedown"]=function(b){if(d.state!=!1&&(b=b||event,this.initXY=a._isIPad?b.touches[0].clientX:b.clientX,this.newValueNow=this.valueNow,this.allowMove=!0,this.className=
"sl_pen over",f.tip!=""))f.style.visibility="hidden",f.style.display="",f.innerHTML=f.tip.replace("%v",this.valueNow),f.style.left=Math.round(getAbsoluteLeft(this)+this.offsetWidth/2-f.offsetWidth/2)+"px",f.style.top=getAbsoluteTop(this)-f.offsetHeight-3+"px",f.style.visibility=""};this.pen._doOnMouseMoveStart=function(b){b=b||event;if(e.allowMove){var c=a._isIPad?b.touches[0].clientX:b.clientX,d=c-e.initXY;if(!(c<getAbsoluteLeft(e)+Math.round(e.offsetWidth/2)&&e.nowX==e.minX)&&!(c>getAbsoluteLeft(e)+
Math.round(e.offsetWidth/2)&&e.nowX==e.maxX)){e.newNowX=e.nowX+d;if(e.newNowX<e.minX)e.newNowX=e.minX;if(e.newNowX>e.maxX)e.newNowX=e.maxX;e.nowX=e.newNowX;e.style.left=e.nowX+"px";e.initXY=c;e.newValueNow=Math.round((e.valueMax-e.valueMin)*(e.newNowX-e.minX)/(e.maxX-e.minX)+e.valueMin);if(f.tip!="")f.innerHTML=f.tip.replace(/%v/gi,e.newValueNow),f.style.left=Math.round(getAbsoluteLeft(e)+e.offsetWidth/2-f.offsetWidth/2)+"px",f.style.top=getAbsoluteTop(e)-f.offsetHeight-3+"px";b.cancelBubble=!0;return b.returnValue=
!1}}};this.pen._doOnMouseMoveEnd=function(){if(e.allowMove){e.className="sl_pen";e.allowMove=!1;e.nowX=e.newNowX;e.valueNow=e.newValueNow;if(f.tip!="")f.style.display="none";a.callEvent("onValueChange",[d.obj.idd.replace(a.idPrefix,""),e.valueNow])}};a._isIPad?(document.addEventListener("touchmove",e._doOnMouseMoveStart,!1),document.addEventListener("touchend",e._doOnMouseMoveEnd,!1)):_isIE?(document.body.attachEvent("onmousemove",e._doOnMouseMoveStart),document.body.attachEvent("onmouseup",e._doOnMouseMoveEnd)):
(window.addEventListener("mousemove",e._doOnMouseMoveStart,!1),window.addEventListener("mouseup",e._doOnMouseMoveEnd,!1));this.enableItem=function(){if(!this.state)this.state=!0,this.obj.className="dhx_toolbar_btn def"};this.disableItem=function(){if(this.state)this.state=!1,this.obj.className="dhx_toolbar_btn dis"};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display==
""};this.setValue=function(b,c){b=Number(b);if(b<this.pen.valueMin)b=this.pen.valueMin;if(b>this.pen.valueMax)b=this.pen.valueMax;this.pen.valueNow=b;this.pen._definePos();c==!0&&a.callEvent("onValueChange",[this.obj.idd.replace(a.idPrefix,""),this.pen.valueNow])};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(a,b){a=Number(a);if(!(a>this.pen.valueMax)){this.obj.childNodes[0].innerHTML=b;this.obj.childNodes[0].style.display=b.length>0?"":"none";this.pen.valueMin=a;if(this.pen.valueNow<
this.pen.valueMin)this.pen.valueNow=this.pen.valueMin;this.pen._detectLimits();this.pen._definePos()}};this.setMaxValue=function(a,b){a=Number(a);if(!(a<this.pen.valueMin)){this.obj.childNodes[4].innerHTML=b;this.obj.childNodes[4].style.display=b.length>0?"":"none";this.pen.valueMax=a;if(this.pen.valueNow>this.pen.valueMax)this.pen.valueNow=this.pen.valueMax;this.pen._detectLimits();this.pen._definePos()}};this.getMinValue=function(){var a=this.obj.childNodes[0].innerHTML,b=this.pen.valueMin;return[b,
a]};this.getMaxValue=function(){var a=this.obj.childNodes[4].innerHTML,b=this.pen.valueMax;return[b,a]};this.setItemToolTipTemplate=function(a){this.label.tip=a};this.getItemToolTipTemplate=function(){return this.label.tip};return this};
dhtmlXToolbarObject.prototype.unload=function(){this._isIPad?document.removeEventListener("touchstart",this._doOnClick,!1):_isIE?document.body.detachEvent("onclick",this._doOnClick):window.removeEventListener("click",this._doOnClick,!1);this._doOnClick=null;this.clearAll();this.objPull=null;if(this._xmlLoader)this._xmlLoader.destructor(),this._xmlLoader=null;for(;this.base.childNodes.length>0;)this.base.removeChild(this.base.childNodes[0]);this.cont.removeChild(this.base);for(this.base=null;this.cont.childNodes.length>
0;)this.cont.removeChild(this.cont.childNodes[0]);this.cont.className="";this.cont=null;this.detachAllEvents();this.items=this.setMaxOpen=this.getUserData=this.setUserData=this.unload=this.getListOptionSelected=this.setListOptionSelected=this.getAllListOptions=this.forEachListOption=this.clearListOptionImage=this.getListOptionImage=this.setListOptionImage=this.getListOptionToolTip=this.setListOptionToolTip=this.getListOptionText=this.setListOptionText=this.getListOptionPosition=this.setListOptionPosition=
this.isListOptionEnabled=this.disableListOption=this.enableListOption=this.isListOptionVisible=this.hideListOption=this.showListOption=this.removeListOption=this.addListOption=this.removeItem=this.setPosition=this.getPosition=this.getWidth=this.setWidth=this.getMaxValue=this.setMaxValue=this.getMinValue=this.setMinValue=this.getValue=this.setValue=this.getItemToolTipTemplate=this.setItemToolTipTemplate=this.getItemState=this.setItemState=this.clearItemImageDis=this.clearItemImage=this.setItemImageDis=
this.setItemImage=this.getItemToolTip=this.setItemToolTip=this.getItemText=this.setItemText=this.isEnabled=this.disableItem=this.enableItem=this.isVisible=this.hideItem=this.showItem=this.forEachItem=this.addInput=this.addSlider=this.addSeparator=this.addButtonTwoState=this.addButtonSelect=this.addText=this.addButton=this.getParentId=this.inArray=this.getTypeExt=this.getType=this.removeSpacer=this.addSpacer=this.clearAll=this.detachAllEvents=this.detachEvent=this.eventCatcher=this.checkEvent=this.callEvent=
this.attachEvent=this.loadXMLString=this.loadXML=this.setIconPath=this.setIconsPath=this.setSkin=this.setAlign=this._removeItem=this._autoDetectVisibleArea=this._sliderObject=this._buttonTwoStateObject=this._buttonInputObject=this._buttonSelectObject=this._buttonObject=this._textObject=this._separatorObject=this._getIdByPosition=this._setPosition=this._getPosition=this._addItem=this._genStr=this._addItemToStorage=this._doOnLoad=this._xmlParser=this._disableItem=this._enableItem=this._getItemText=
this._setItemText=this._clearItemImage=this._setItemImage=this._addImgObj=this._getObj=this._sbw=this.setRTL=this._rtlParseBtn=this._rtl=this.skin=this.selectPolygonOffsetTop=this.selectPolygonOffsetLeft=this.rootTypes=this.imagePath=this.idPrefix=this.anyUsed=this.align=this._isWebToolbar=this._isIE6=this.tY2=this.tY1=this.tX2=this.tX1=null};
dhtmlXToolbarObject.prototype._autoDetectVisibleArea=function(){this.tX1=document.body.scrollLeft;this.tX2=this.tX1+(window.innerWidth||document.body.clientWidth);this.tY1=Math.max((_isIE?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);this.tY2=this.tY1+(_isIE?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight)};
dhtmlXToolbarObject.prototype.setUserData=function(a,b,c){if(this.objPull[this.idPrefix+a]!=null){var d=this.objPull[this.idPrefix+a];if(d.userData==null)d.userData={};d.userData[b]=c}};dhtmlXToolbarObject.prototype.getUserData=function(a,b){return this.objPull[this.idPrefix+a]==null?null:this.objPull[this.idPrefix+a].userData==null?null:this.objPull[this.idPrefix+a].userData[b]==null?null:this.objPull[this.idPrefix+a].userData[b]};
dhtmlXToolbarObject.prototype._isListOptionExists=function(a,b){if(this.objPull[this.idPrefix+a]==null)return!1;var c=this.objPull[this.idPrefix+a];return c.type!="buttonSelect"?!1:c._listOptions[b]==null?!1:!0};dhtmlXToolbarObject.prototype.setListOptionUserData=function(a,b,c,d){if(this._isListOptionExists(a,b)){var e=this.objPull[this.idPrefix+a]._listOptions[b];if(e.userData==null)e.userData={};e.userData[c]=d}};
dhtmlXToolbarObject.prototype.getListOptionUserData=function(a,b,c){if(!this._isListOptionExists(a,b))return null;var d=this.objPull[this.idPrefix+a]._listOptions[b];return!d.userData?null:d.userData[c]?d.userData[c]:null};
(function(){dhtmlx.extend_api("dhtmlXToolbarObject",{_init:function(a){return[a.parent,a.skin]},icon_path:"setIconsPath",xml:"loadXML",items:"items",align:"setAlign",rtl:"setRTL",skin:"setSkin"},{items:function(a){for(var b=0;b<a.length;b++){var c=a[b];c.type=="button"&&this.addButton(c.id,null,c.text,c.img,c.img_disabled);c.type=="separator"&&this.addSeparator(c.id,null);c.type=="text"&&this.addText(c.id,null,c.text);c.type=="buttonSelect"&&this.addButtonSelect(c.id,null,c.text,c.options,c.img,c.img_disabled,
c.renderSelect,c.openAll,c.maxOpen);c.type=="buttonTwoState"&&this.addButtonTwoState(c.id,null,c.text,c.img,c.img_disabled);c.type=="buttonInput"&&this.addInput(c.id,null,c.text);c.type=="slider"&&this.addSlider(c.id,null,c.length,c.value_min,c.value_max,c.value_now,c.text_min,c.text_max,c.tip_template);c.width&&this.setWidth(c.id,c.width);c.disabled&&this.disableItem(c.id);c.tooltip&&this.setItemToolTip(c.id,c.tooltip);c.pressed===!0&&this.setItemState(c.id,!0)}}})})();
function dhtmlXWindowsSngl(){}function dhtmlXWindowsBtn(){}
function dhtmlXWindows(){if(window.dhtmlXContainer){this.engine="dhx";var a="_"+this.engine+"_Engine";if(this[a]){this[a]();this._isIPad=navigator.userAgent.search(/iPad/gi)>=0;var b=this;this.pathPrefix="dhxwins_";this.imagePath=dhtmlx.image_path||"codebase/imgs/";this.setImagePath=function(a){this.imagePath=a};this.skin=typeof dhtmlx!="undefined"&&typeof dhtmlx.skin=="string"?dhtmlx.skin:"dhx_skyblue";this.skinParams={dhx_black:{header_height:21,border_left_width:2,border_right_width:2,border_bottom_height:2},
dhx_blue:{header_height:21,border_left_width:2,border_right_width:2,border_bottom_height:2},dhx_skyblue:{header_height:21,border_left_width:2,border_right_width:2,border_bottom_height:2}};this.setSkin=function(a){this.skin=a;this._engineRedrawSkin()};this.isWindow=function(a){var b=this.wins[a]!=null;return b};this.findByText=function(a){var b=[],c;for(c in this.wins)this.wins[c].getText().search(a,"gi")>=0&&(b[b.length]=this.wins[c]);return b};this.window=function(a){var b=null;this.wins[a]!=null&&
(b=this.wins[a]);return b};this.forEachWindow=function(a){for(var b in this.wins)a(this.wins[b])};this.getBottommostWindow=function(){var a=this.getTopmostWindow(),b;for(b in this.wins)this.wins[b].zi<a.zi&&(a=this.wins[b]);return a.zi!=0?a:null};this.getTopmostWindow=function(a){var b={zi:0},c;for(c in this.wins)this.wins[c].zi>b.zi&&(a==!0&&!this._isWindowHidden(this.wins[c])&&(b=this.wins[c]),a!=!0&&(b=this.wins[c]));return b.zi!=0?b:null};this.wins={};for(var c in this.wins)delete this.wins[c];
this.autoViewport=!0;this._createViewport=function(){this.vp=document.body;this._clearVPCss();this.vp._css=String(this.vp.className).length>0?this.vp.className:"";this.vp.className+=" dhtmlx_skin_"+this.skin+(this._r?" dhx_wins_rtl":"");this.modalCoverI=document.createElement("IFRAME");this.modalCoverI.frameBorder="0";this.modalCoverI.className="dhx_modal_cover_ifr";this.modalCoverI.setAttribute("src","javascript:false;");this.modalCoverI.style.display="none";this.modalCoverI.style.zIndex=0;this.vp.appendChild(this.modalCoverI);
this.modalCoverD=document.createElement("DIV");this.modalCoverD.className="dhx_modal_cover_dv";this.modalCoverD.style.display="none";this.modalCoverD.style.zIndex=0;this.vp.appendChild(this.modalCoverD);this._vpcover=document.createElement("DIV");this._vpcover.className="dhx_content_vp_cover";this._vpcover.style.display="none";this.vp.appendChild(this._vpcover);this._carcass=document.createElement("DIV");this._carcass.className="dhx_carcass_resmove";this._carcass.style.display="none";if(_isIE)this._carcass.innerHTML=
"<iframe border=0 frameborder=0 style='filter: alpha(opacity=0); width: 100%; height:100%; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;'></iframe><div style='position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;'></div>",this._carcass.childNodes[0].setAttribute("src","javascript:false;");this._carcass.onselectstart=function(a){a=a||event;a.returnValue=!1};this.vp.appendChild(this._carcass)};this._clearVPCss=function(){this.vp.className=String(this.vp.className).replace(/[a-z_]{1,}/gi,
function(a){return{dhtmlx_skin_dhx_skyblue:1,dhtmlx_skin_dhx_blue:1,dhtmlx_skin_dhx_black:1,dhtmlx_skin_dhx_web:1,dhtmlx_skin_dhx_terrace:1}[a]==1?"":a})};this._autoResizeViewport=function(){for(var a in this.wins){if(this.wins[a]._isFullScreened)this.wins[a]._content.style.width=document.body.offsetWidth-(_isIE?4:0)+"px",this.wins[a]._content.style.height=document.body.offsetHeight==0?window.innerHeight?window.innerHeight+"px":document.body.scrollHeight+"px":document.body.offsetHeight-(_isIE?4:0)+
"px",this.wins[a].layout!=null&&_isOpera&&this.wins[a].layout._fixCellsContentOpera950(),this.wins[a].updateNestedObjects();this.wins[a]._isMaximized&&this.wins[a].style.display!="none"&&(this._restoreWindow(a),this._maximizeWindow(a))}if(this.vp!=document.body&&this.autoViewport!=!1)for(a in this.vp.style.width=(_isIE?document.body.offsetWidth-4:window.innerWidth)+"px",this.vp.style.height=(_isIE?document.body.offsetHeight-4:window.innerHeight)+"px",this.wins){var b=this.wins[a],c=!1,g=!1;if(b.x>
this.vp.offsetWidth-10)b.x=this.vp.offsetWidth-10,c=!0;var h=b._skinParams!=null?b._skinParams:this.skinParams[this.skin];if(b.y+h.header_height>this.vp.offsetHeight)b.y=this.vp.offsetHeight-h.header_height,g=!0;(c||g)&&this._engineRedrawWindowPos(b)}};this.enableAutoViewport=function(a){if(this.vp==document.body&&(this.autoViewport=a,a==!1)){if(this.vp==document.body)document.body.className=this.vp._css;this.vp.removeChild(this.modalCoverI);this.vp.removeChild(this.modalCoverD);this.vp.removeChild(this._vpcover);
this.vp.removeChild(this._carcass);this.vp=null;this.vp=document.createElement("DIV");this.vp.autocreated=!0;this.vp.className="dhtmlx_winviewport dhtmlx_skin_"+this.skin+(this._r?" dhx_wins_rtl":"");this.vp.style.left="0px";this.vp.style.top="0px";document.body.appendChild(this.vp);this.vp.ax=0;this.vp.ay=0;this._autoResizeViewport();this.vp.appendChild(this.modalCoverI);this.vp.appendChild(this.modalCoverD);this.vp.appendChild(this._vpcover);this.vp.appendChild(this._carcass)}};this.attachViewportTo=
function(a){if(this.autoViewport==!1)this.vp.removeChild(this.modalCoverI),this.vp.removeChild(this.modalCoverD),this.vp.removeChild(this._vpcover),this.vp.removeChild(this._carcass),this.vp!=document.body&&this.vp.parentNode.removeChild(this.vp),this.vp=null,this.vp=typeof a=="string"?document.getElementById(a):a,this.vp.autocreated=!1,this._clearVPCss(),this.vp.className+=" dhtmlx_skin_"+this.skin+(this._r?" dhx_wins_rtl":""),this.vp.style.position="relative",this.vp.style.overflow="hidden",this.vp.ax=
0,this.vp.ay=0,this.vp.appendChild(this.modalCoverI),this.vp.appendChild(this.modalCoverD),this.vp.appendChild(this._vpcover),this.vp.appendChild(this._carcass)};this.setViewport=function(a,b,c,g,h){if(this.autoViewport==!1)this.vp.style.left=a+"px",this.vp.style.top=b+"px",this.vp.style.width=c+"px",this.vp.style.height=g+"px",h!=null&&h.appendChild(this.vp),this.vp.ax=getAbsoluteLeft(this.vp),this.vp.ay=getAbsoluteTop(this.vp)};this._effects={move:!1,resize:!1};this.setEffect=function(a,b){this._effects[a]!=
null&&typeof b=="boolean"&&(this._effects[a]=b)};this.getEffect=function(a){return this._effects[a]};this.createWindow=function(a,c,f,g,h){var i=document.createElement("DIV");i.className="dhtmlx_window_inactive";i.dir="ltr";for(var j in this.wins)this.wins[j].zi+=this.zIndexStep,this.wins[j].style.zIndex=this.wins[j].zi;i.zi=this.zIndexStep;i.style.zIndex=i.zi;i.active=!1;i._isWindow=!0;i.isWindow=!0;i.w=Number(g);i.h=Number(h);i.x=c;i.y=f;this._engineFixWindowPosInViewport(i);i._isModal=!1;i._allowResize=
!0;i.maxW="auto";i.maxH="auto";i.minW=200;i.minH=140;i.iconsPresent=!0;i.icons=[this.imagePath+this.pathPrefix+this.skin+"/active/icon_normal.gif",this.imagePath+this.pathPrefix+this.skin+"/inactive/icon_normal.gif"];i._allowMove=!0;i._allowMoveGlobal=!0;i._allowResizeGlobal=!0;i._keepInViewport=!1;var k=this.skinParams[this.skin];i.idd=a;this.vp.appendChild(i);this._engineSetWindowBody(i);this._engineRedrawWindowPos(i);this._engineRedrawWindowSize(i);this._engineUpdateWindowIcon(i,i.icons[0]);this._engineDiableOnSelectInWindow(i,
!0);this.wins[a]=i;dhtmlxEventable(i);this._engineGetWindowHeader(i)[this._isIPad?"ontouchstart":"onmousedown"]=function(a){var a=a||event,c=b.wins[this.idd];c.isOnTop()||c.bringToTop();if(!b._engineGetWindowHeaderState(c)&&b._engineCheckHeaderMouseDown(c,a)&&c._allowMove&&c._allowMoveGlobal){b._wasMoved=!1;c.moveOffsetX=c.x-(b._isIPad?a.touches[0].clientX:a.clientX);c.moveOffsetY=c.y-(b._isIPad?a.touches[0].clientY:a.clientY);b.movingWin=c;if(b._effects.move==!1)b._carcass.x=b.movingWin.x,b._carcass.y=
b.movingWin.y,b._carcass.w=parseInt(b.movingWin.style.width)+(_isIE?0:-2),b._carcass.h=parseInt(b.movingWin.style.height)+(_isIE?0:-2),b._carcass.style.left=b._carcass.x+"px",b._carcass.style.top=b._carcass.y+"px",b._carcass.style.width=b._carcass.w+"px",b._carcass.style.height=b._carcass.h+"px",b._carcass.style.zIndex=b._getTopZIndex(!0)+1,b._carcass._keepInViewport=i._keepInViewport;b._blockSwitcher(!0);b._vpcover.style.zIndex=b.movingWin.style.zIndex-1;b._vpcover.style.display="";a.returnValue=
!1;a.cancelBubble=!0;return!1}};this._engineGetWindowHeader(i).ondblclick=function(a){var c=b.wins[this.idd];if(b._engineCheckHeaderMouseDown(c,a||event))c._allowResizeGlobal&&!c._isParked&&(c._isMaximized==!0?b._restoreWindow(c.idd):b._maximizeWindow(c.idd)),c=null};i.setText=function(a){b._engineGetWindowLabel(this).innerHTML=a};i.getText=function(){return b._engineGetWindowLabel(this).innerHTML};i.getId=function(){return this.idd};i.show=function(){b._showWindow(this)};i.hide=function(){b._hideWindow(this)};
i.minimize=function(){b._restoreWindow(this.idd)};i.maximize=function(){b._maximizeWindow(this.idd)};i.close=function(){b._closeWindow(this.idd)};i.park=function(){this._isParkedAllowed&&b._parkWindow(this.winId)};i.stick=function(){b._stickWindow(this.idd)};i.unstick=function(){b._unstickWindow(this.idd)};i.isSticked=function(){return this._isSticked};i.setIcon=function(a,c){b._setWindowIcon(i,a,c)};i.getIcon=function(){return b._getWindowIcon(this)};i.clearIcon=function(){b._clearWindowIcons(this)};
i.restoreIcon=function(){b._restoreWindowIcons(this)};i.keepInViewport=function(a){this._keepInViewport=a};i.setModal=function(a){a==!0?b.modalWin!=null||b.modalWin==this||b._setWindowModal(this,!0):b.modalWin==this&&b._setWindowModal(this,!1)};i.isModal=function(){return this._isModal};i.isHidden=function(){return b._isWindowHidden(this)};i.isMaximized=function(){return this._isMaximized};i.isParked=function(){return this._isParked};i.allowPark=function(){b._allowParking(this)};i.denyPark=function(){b._denyParking(this)};
i.isParkable=function(){return this._isParkedAllowed};i.allowResize=function(){b._allowReszieGlob(this)};i.denyResize=function(){b._denyResize(this)};i.isResizable=function(){return this._allowResizeGlobal};i.allowMove=function(){if(!this._isMaximized)this._allowMove=!0;this._allowMoveGlobal=!0};i.denyMove=function(){this._allowMoveGlobal=!1};i.isMovable=function(){return this._allowMoveGlobal};i.bringToTop=function(){b._bringOnTop(this);b._makeActive(this)};i.bringToBottom=function(){b._bringOnBottom(this)};
i.isOnTop=function(){return b._isWindowOnTop(this)};i.isOnBottom=function(){return b._isWindowOnBottom(this)};i.setPosition=function(a,c){this.x=a;this.y=c;b._engineFixWindowPosInViewport(this);b._engineRedrawWindowPos(this)};i.getPosition=function(){return[this.x,this.y]};i.setDimension=function(a,c){if(a!=null){if(this.maxW!="auto"&&a>this.maxW)a=this.maxW;if(a<this.minW)a=this.minW;this.w=a}if(c!=null){if(this.maxH!="auto"&&c>this.maxH)c=this.maxH;if(c<this.minH)c=this.minH;this.h=c}b._fixWindowDimensionInViewport(this);
b._engineFixWindowPosInViewport(this);b._engineRedrawWindowSize(this);this.updateNestedObjects()};i.getDimension=function(){return[this.w,this.h]};i.setMaxDimension=function(a,c){this.maxW=isNaN(a)?"auto":a;this.maxH=isNaN(c)?"auto":c;b._engineRedrawWindowSize(this)};i.getMaxDimension=function(){return[this.maxW,this.maxH]};i.setMinDimension=function(a,c){if(a!=null)this.minW=a;if(c!=null)this.minH=c;b._fixWindowDimensionInViewport(this);b._engineRedrawWindowPos(this)};i.getMinDimension=function(){return[this.minW,
this.minH]};i._adjustToContent=function(a,c){b._engineAdjustWindowToContent(this,a,c)};i._doOnAttachMenu=function(){b._engineRedrawWindowSize(this);this.updateNestedObjects()};i._doOnAttachToolbar=function(){b._engineRedrawWindowSize(this);this.updateNestedObjects()};i._doOnAttachStatusBar=function(){b._engineRedrawWindowSize(this);this.updateNestedObjects()};i._doOnFrameMouseDown=function(){this.bringToTop()};i._doOnFrameContentLoaded=function(){b.callEvent("onContentLoaded",[this])};i.addUserButton=
function(a,c,d,e){var f=b._addUserButton(this,a,c,d,e);return f};i.removeUserButton=function(a){a=String(a).toLowerCase();a=="minmax1"||a=="minmax2"||a=="park"||a=="close"||a=="stick"||a=="unstick"||a=="help"||btn!=null&&b._removeUserButton(this,a)};i.progressOn=function(){b._engineSwitchWindowProgress(this,!0)};i.progressOff=function(){b._engineSwitchWindowProgress(this,!1)};i.setToFullScreen=function(a){b._setWindowToFullScreen(this,a)};i.showHeader=function(){b._engineSwitchWindowHeader(this,!0)};
i.hideHeader=function(){b._engineSwitchWindowHeader(this,!1)};i.progressOff();i.canStartResize=!1;i.onmousemove=function(a){if(_isIE&&this._isMaximized)return!0;var a=a||event,c=a.target||a.srcElement;String(c.className).search("dhtmlx_wins_resizer")<0&&(c=null);if(!this._allowResize||this._allowResizeGlobal==!1||!c){if(c&&c.style.cursor!="default")c.style.cursor="default";if(this.style.cursor!="default")this.style.cursor="default";this.canStartResize=!1;return!0}if(b.resizingWin==null&&b.movingWin==
null&&!this._isParked){if(b._isIPad)var d=a.touches[0].clientX,e=a.touches[0].clientY;else d=_isIE||_isOpera?a.offsetX:a.layerX,e=_isIE||_isOpera?a.offsetY:a.layerY;var f=b._engineAllowWindowResize(i,c,d,e);if(f==null){this.canStartResize=!1;if(c.style.cursor!="default")c.style.cursor="default";if(this.style.cursor!="default")this.style.cursor="default"}else{b.resizingDirs=f;var g={x:a.clientX,y:a.clientY};switch(b.resizingDirs){case "border_left":c.style.cursor="w-resize";this.resizeOffsetX=this.x-
g.x;break;case "border_right":c.style.cursor="e-resize";this.resizeOffsetXW=this.x+this.w-g.x;break;case "border_top":c.style.cursor="n-resize";this.resizeOffsetY=this.y-g.y;break;case "border_bottom":c.style.cursor="n-resize";this.resizeOffsetYH=this.y+this.h-g.y;break;case "corner_left":c.style.cursor="sw-resize";this.resizeOffsetX=this.x-a.clientX;this.resizeOffsetYH=this.y+this.h-g.y;break;case "corner_up_left":c.style.cursor="nw-resize";this.resizeOffsetY=this.y-g.y;this.resizeOffsetX=this.x-
g.x;break;case "corner_right":c.style.cursor="nw-resize";this.resizeOffsetXW=this.x+this.w-g.x;this.resizeOffsetYH=this.y+this.h-g.y;break;case "corner_up_right":c.style.cursor="sw-resize",this.resizeOffsetY=this.y-g.y,this.resizeOffsetXW=this.x+this.w-g.x}this.canStartResize=!0;this.style.cursor=c.style.cursor;a.cancelBubble=!0;return a.returnValue=!1}}};i.onmousedown=function(a){b._getActive()!=this&&b._makeActive(this);b._bringOnTop(this);if(this.canStartResize){b._blockSwitcher(!0);b.resizingWin=
this;if(!b._effects.resize)b._carcass.x=b.resizingWin.x,b._carcass.y=b.resizingWin.y,b._carcass.w=Number(b.resizingWin.w)+(_isIE?0:-2),b._carcass.h=Number(b.resizingWin.h)+(_isIE?0:-2),b._carcass.style.left=b._carcass.x+"px",b._carcass.style.top=b._carcass.y+"px",b._carcass.style.width=b._carcass.w+"px",b._carcass.style.height=b._carcass.h+"px",b._carcass.style.zIndex=b._getTopZIndex(!0)+1,b._carcass.style.cursor=this.style.cursor,b._carcass._keepInViewport=this._keepInViewport,b._carcass.style.display=
"";b._vpcover.style.zIndex=b.resizingWin.style.zIndex-1;b._vpcover.style.display="";this.vs[this.av].layout&&this.callEvent("_onBeforeTryResize",[this]);a=a||event}};this._addDefaultButtons(i.idd);i.button=function(a){var a=String(a).toLowerCase(),b=null;this.btns[a]!=null&&(b=this.btns[a]);return b};i.center=function(){b._centerWindow(this,!1)};i.centerOnScreen=function(){b._centerWindow(this,!0)};i._attachContent("empty",null);i._redraw=function(){b._engineRedrawWindowSize(this)};i.bringToTop();
this._engineRedrawWindowSize(i);return this.wins[a]};this.zIndexStep=50;this._getTopZIndex=function(a){var b=0,c;for(c in this.wins)if(a==!0){if(this.wins[c].zi>b)b=this.wins[c].zi}else if(this.wins[c].zi>b&&!this.wins[c]._isSticked)b=this.wins[c].zi;return b};this.movingWin=null;this._moveWindow=function(a){if(this.movingWin!=null){if(!this.movingWin._allowMove||!this.movingWin._allowMoveGlobal)return;if(this._effects.move==!0){if(this._engineGetWindowHeader(this.movingWin).style.cursor!="move")this._engineGetWindowHeader(this.movingWin).style.cursor=
"move";this._wasMoved=!0;this.movingWin.x=(this._isIPad?a.touches[0].clientX:a.clientX)+this.movingWin.moveOffsetX;this.movingWin.y=(this._isIPad?a.touches[0].clientY:a.clientY)+this.movingWin.moveOffsetY;this._engineFixWindowPosInViewport(this.movingWin);this._engineRedrawWindowPos(this.movingWin)}else{if(this._carcass.style.display!="")this._carcass.style.display="";if(this._carcass.style.cursor!="move")this._carcass.style.cursor="move";if(this._engineGetWindowHeader(this.movingWin).style.cursor!=
"move")this._engineGetWindowHeader(this.movingWin).style.cursor="move";this._carcass.x=(this._isIPad?a.touches[0].clientX:a.clientX)+this.movingWin.moveOffsetX;this._carcass.y=(this._isIPad?a.touches[0].clientY:a.clientY)+this.movingWin.moveOffsetY;this._wasMoved=!0;this._engineFixWindowPosInViewport(this._carcass);this._carcass.style.left=this._carcass.x+"px";this._carcass.style.top=this._carcass.y+"px"}}if(this.resizingWin!=null&&this.resizingWin._allowResize){var b={x:a.clientX,y:a.clientY};if(this.resizingDirs==
"border_left"||this.resizingDirs=="corner_left"||this.resizingDirs=="corner_up_left")if(this._effects.resize){var c=b.x+this.resizingWin.resizeOffsetX,g=c>this.resizingWin.x?-1:1;newW=this.resizingWin.w+Math.abs(c-this.resizingWin.x)*g;newW<this.resizingWin.minW&&g<0?(this.resizingWin.x=this.resizingWin.x+this.resizingWin.w-this.resizingWin.minW,this.resizingWin.w=this.resizingWin.minW):(this.resizingWin.w=newW,this.resizingWin.x=c);this._engineRedrawWindowPos(this.resizingWin);this._engineRedrawWindowSize(this.resizingWin)}else{c=
b.x+this.resizingWin.resizeOffsetX;g=c>this._carcass.x?-1:1;newW=this._carcass.w+Math.abs(c-this._carcass.x)*g;if(newW>this.resizingWin.maxW)newW=this.resizingWin.maxW,c=this._carcass.x+this._carcass.w-this.resizingWin.maxW;newW<this.resizingWin.minW&&g<0?(this._carcass.x=this._carcass.x+this._carcass.w-this.resizingWin.minW,this._carcass.w=this.resizingWin.minW):(this._carcass.w=newW,this._carcass.x=c);this._carcass.style.left=this._carcass.x+"px";this._carcass.style.width=this._carcass.w+"px"}if(this.resizingDirs==
"border_right"||this.resizingDirs=="corner_right"||this.resizingDirs=="corner_up_right")if(this._effects.resize){c=b.x-(this.resizingWin.x+this.resizingWin.w)+this.resizingWin.resizeOffsetXW;newW=this.resizingWin.w+c;if(newW<this.resizingWin.minW)newW=this.resizingWin.minW;this.resizingWin.w=newW;this._engineRedrawWindowPos(this.resizingWin);this._engineRedrawWindowSize(this.resizingWin)}else{c=b.x-(this._carcass.x+this._carcass.w)+this.resizingWin.resizeOffsetXW;newW=this._carcass.w+c;if(newW<this.resizingWin.minW)newW=
this.resizingWin.minW;if(this.resizingWin.maxW!="auto"&&newW>this.resizingWin.maxW)newW=this.resizingWin.maxW;this._carcass.w=newW;this._carcass.style.width=this._carcass.w+"px"}if(this.resizingDirs=="border_bottom"||this.resizingDirs=="corner_left"||this.resizingDirs=="corner_right")if(this._effects.resize){c=b.y-(this.resizingWin.y+this.resizingWin.h)+this.resizingWin.resizeOffsetYH;newH=this.resizingWin.h+c;if(newH<this.resizingWin.minH)newH=this.resizingWin.minH;this.resizingWin.h=newH;this._engineRedrawWindowPos(this.resizingWin);
this._engineRedrawWindowSize(this.resizingWin)}else{c=b.y-(this._carcass.y+this._carcass.h)+this.resizingWin.resizeOffsetYH;newH=this._carcass.h+c;if(newH<this.resizingWin.minH)newH=this.resizingWin.minH;if(newH>this.resizingWin.maxH)newH=this.resizingWin.maxH;this._carcass.h=newH;this._carcass.style.height=this._carcass.h+"px"}if((this.resizingDirs=="border_top"||this.resizingDirs=="corner_up_right"||this.resizingDirs=="corner_up_left")&&!this._effects.resize){c=b.y+this.resizingWin.resizeOffsetY;
g=c>this.resizingWin.y?-1:1;newH=this.resizingWin.h+Math.abs(c-this.resizingWin.y)*g;if(newH>this.resizingWin.maxH)newH=this.resizingWin.maxH,c=this.resizingWin.y+this.resizingWin.h-this.resizingWin.maxH;newH<this.resizingWin.minH&&g<0?(this._carcass.y=this._carcass.y+this._carcass.h-this.resizingWin.minH,this._carcass.h=this.resizingWin.minH):(this._carcass.h=newH+(_isIE?0:-2),this._carcass.y=c);this._carcass.style.top=this._carcass.y+"px";this._carcass.style.height=this._carcass.h+"px"}}};this._stopMove=
function(){if(this.movingWin!=null){if(this._effects.move){var a=this.movingWin;this.movingWin=null;this._blockSwitcher(!1);this._engineGetWindowHeader(a).style.cursor="";_isFF&&(a.h++,b._engineRedrawWindowPos(a),a.h--,b._engineRedrawWindowPos(a))}else this._carcass.style.cursor="",this._carcass.style.display="none",a=this.movingWin,this._engineGetWindowHeader(a).style.cursor="",this.movingWin=null,this._blockSwitcher(!1),a.setPosition(parseInt(this._carcass.style.left),parseInt(this._carcass.style.top));
this._vpcover.style.display="none";this._wasMoved&&(a.checkEvent("onMoveFinish")?a.callEvent("onMoveFinish",[a]):this.callEvent("onMoveFinish",[a]));this._wasMoved=!1}if(this.resizingWin!=null)a=this.resizingWin,this.resizingWin=null,this._blockSwitcher(!1),this._effects.resize?a.updateNestedObjects():(this._carcass.style.display="none",a.setDimension(this._carcass.w+(_isIE?0:2),this._carcass.h+(_isIE?0:2)),a.setPosition(this._carcass.x,this._carcass.y)),a.vs[a.av].layout&&a.vs[a.av].layout.callEvent("onResize",
[]),this._vpcover.style.display="none",a.checkEvent("onResizeFinish")?a.callEvent("onResizeFinish",[a]):this.callEvent("onResizeFinish",[a])};this._fixWindowDimensionInViewport=function(a){if(a.w<a.minW)a.w=a.minW;if(!a._isParked&&a.h<a.minH)a.h=a.minH};this._bringOnTop=function(a){var b=a.zi,c=this._getTopZIndex(a._isSticked),g;for(g in this.wins)if(this.wins[g]!=a&&(a._isSticked||!a._isSticked&&!this.wins[g]._isSticked)&&this.wins[g].zi>b)this.wins[g].zi-=this.zIndexStep,this.wins[g].style.zIndex=
this.wins[g].zi;a.zi=c;a.style.zIndex=a.zi};this._makeActive=function(a,b){for(var c in this.wins)if(this.wins[c]==a){var g=!1;this.wins[c].className!="dhtmlx_window_active"&&!b&&(g=!0);this.wins[c].className="dhtmlx_window_active";this._engineUpdateWindowIcon(this.wins[c],this.wins[c].icons[0]);g==!0&&(a.checkEvent("onFocus")?a.callEvent("onFocus",[a]):this.callEvent("onFocus",[a]))}else this.wins[c].className="dhtmlx_window_inactive",this._engineUpdateWindowIcon(this.wins[c],this.wins[c].icons[1])};
this._getActive=function(){var a=null,b;for(b in this.wins)this.wins[b].className=="dhtmlx_window_active"&&(a=this.wins[b]);return a};this._centerWindow=function(a,b){if(a._isMaximized!=!0){if(b==!0)var c=_isIE?document.body.offsetWidth:window.innerWidth,g=_isIE?document.body.offsetHeight:window.innerHeight;else c=this.vp==document.body?document.body.offsetWidth:Number(parseInt(this.vp.style.width))&&String(this.vp.style.width).search("%")==-1?parseInt(this.vp.style.width):this.vp.offsetWidth,g=this.vp==
document.body?document.body.offsetHeight:Number(parseInt(this.vp.style.height))&&String(this.vp.style.height).search("%")==-1?parseInt(this.vp.style.height):this.vp.offsetHeight;var h=Math.round(c/2-a.w/2),i=Math.round(g/2-a.h/2);a.x=h;a.y=i;this._engineFixWindowPosInViewport(a);this._engineRedrawWindowPos(a)}};this._addDefaultButtons=function(a){var c=this.wins[a],f=this._engineGetWindowButton(c,"stick");f.title=this.i18n.stick;f.isVisible=!1;f.style.display="none";f._isEnabled=!0;f.isPressed=!1;
f.label="stick";f._doOnClick=function(){this.isPressed=!0;b._stickWindow(this.winId)};var g=this._engineGetWindowButton(c,"sticked");g.title=this.i18n.unstick;g.isVisible=!1;g.style.display="none";g._isEnabled=!0;g.isPressed=!1;g.label="sticked";g._doOnClick=function(){this.isPressed=!1;b._unstickWindow(this.winId)};var h=this._engineGetWindowButton(c,"help");h.title=this.i18n.help;h.isVisible=!1;h.style.display="none";h._isEnabled=!0;h.isPressed=!1;h.label="help";h._doOnClick=function(){b._needHelp(this.winId)};
var i=this._engineGetWindowButton(c,"park");i.titleIfParked=this.i18n.parkdown;i.titleIfNotParked=this.i18n.parkup;i.title=i.titleIfNotParked;i.isVisible=!0;i._isEnabled=!0;i.isPressed=!1;i.label="park";i._doOnClick=function(){b._parkWindow(this.winId)};var j=this._engineGetWindowButton(c,"minmax1");j.title=this.i18n.maximize;j.isVisible=!0;j._isEnabled=!0;j.isPressed=!1;j.label="minmax1";j._doOnClick=function(){b._maximizeWindow(this.winId)};var k=this._engineGetWindowButton(c,"minmax2");k.title=
this.i18n.restore;k.isVisible=!1;k.style.display="none";k._isEnabled=!0;k.isPressed=!1;k.label="minmax2";k._doOnClick=function(){b._restoreWindow(this.winId)};var m=this._engineGetWindowButton(c,"close");m.title=this.i18n.close;m.isVisible=!0;m._isEnabled=!0;m.isPressed=!1;m.label="close";m._doOnClick=function(){b._closeWindow(this.winId)};var l=this._engineGetWindowButton(c,"dock");l.title=this.i18n.dock;l.style.display="none";l.isVisible=!1;l._isEnabled=!0;l.isPressed=!1;l.label="dock";l._doOnClick=
function(){};c._isSticked=!1;c._isParked=!1;c._isParkedAllowed=!0;c._isMaximized=!1;c._isDocked=!1;c.btns={};c.btns.stick=f;c.btns.sticked=g;c.btns.help=h;c.btns.park=i;c.btns.minmax1=j;c.btns.minmax2=k;c.btns.close=m;c.btns.dock=l;for(var n in c.btns)c.btns[n].winId=c.idd,this._attachEventsOnButton(c.idd,n);c=f=g=h=i=j=k=m=l=null};this._attachEventsOnButton=function(a,c){var f=this.wins[a].btns[c];this._isIPad?(f.ontouchstart=function(a){a.cancelBubble=!0;return a.returnValue=!1},f.ontouchend=function(a){a.cancelBubble=
!0;a.returnValue=!1;if(!this._isEnabled)return!1;this.checkEvent("onClick")?this.callEvent("onClick",[b.wins[this.winId],this]):this._doOnClick();return!1}):(f.onmouseover=function(){this.className=this._isEnabled?"dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_over_"+(this.isPressed?"pressed":"default"):"dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_disabled"},f.onmouseout=function(){this._isEnabled?(this.isPressed=!1,this.className="dhtmlx_wins_btns_button dhtmlx_button_"+this.label+
"_default"):this.className="dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_disabled"},f.onmousedown=function(){this._isEnabled?(this.isPressed=!0,this.className="dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_over_pressed"):this.className="dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_disabled"},f.onmouseup=function(){if(this._isEnabled){var a=this.isPressed;this.isPressed=!1;this.className="dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_over_default";a&&(this.checkEvent("onClick")?
this.callEvent("onClick",[b.wins[this.winId],this]):this._doOnClick())}else this.className="dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_disabled"});f.show=function(){b._showButton(b.wins[this.winId],this.label,!0)};f.hide=function(){b._hideButton(b.wins[this.winId],this.label,!0)};f.enable=function(){b._enableButton(b.wins[this.winId],this.label)};f.disable=function(){b._disableButton(b.wins[this.winId],this.label)};f.isEnabled=function(){return this._isEnabled};f.isHidden=function(){return!this.isVisible};
dhtmlxEventable(f);f=null};this._parkWindow=function(a,b){var c=this.wins[a];if(c._isParkedAllowed||b)if(!this.enableParkEffect||!c.parkBusy){if(c._isParked)this.enableParkEffect&&!b?(c.parkBusy=!0,this._doParkDown(c)):(c.h=c.lastParkH,this._engineRedrawWindowSize(c),this._engineDoOnWindowParkDown(c),c.updateNestedObjects(),c.btns.park.title=c.btns.park.titleIfNotParked,c._allowResizeGlobal==!0&&(this._enableButton(c,"minmax1"),this._enableButton(c,"minmax2")),c._isParked=!1,b||(c.checkEvent("onParkDown")?
c.callEvent("onParkDown",[c]):this.callEvent("onParkDown",[c])));else if(this.enableParkEffect&&!b)if(c.lastParkH=String(c.h).search(/\%$/)==-1?c.h:c.offsetHeight,c._allowResizeGlobal==!0&&(this._disableButton(c,"minmax1"),this._disableButton(c,"minmax2")),this.enableParkEffect)c.parkBusy=!0,this._doParkUp(c);else{var g=c._skinParams!=null?c._skinParams:this.skinParams[this.skin];c.h=g.header_height+g.border_bottom_height;c.btns.park.title=c.btns.park.titleIfParked}else c.lastParkH=String(c.h).search(/\%$/)==
-1?c.h:c.offsetHeight,c.h=this._engineGetWindowParkedHeight(c),this._engineRedrawWindowSize(c),this._engineDoOnWindowParkUp(c),c.btns.park.title=c.btns.park.titleIfParked,c._isParked=!0,b||(c.checkEvent("onParkUp")?c.callEvent("onParkUp",[c]):this.callEvent("onParkUp",[c]));c=null}};this._allowParking=function(a){a._isParkedAllowed=!0;this._enableButton(a,"park")};this._denyParking=function(a){a._isParkedAllowed=!1;this._disableButton(a,"park")};this.enableParkEffect=!1;this.parkSpeed=this.parkStartSpeed=
80;this.parkTM=null;this.parkTMTime=5;this._doParkUp=function(a){if(String(a.h).search(/\%$/)!=-1)a.h=a.offsetHeight;a.h-=this.parkSpeed;var c=this._engineGetWindowParkedHeight(a);a.h<=c?(a.h=c,this._engineGetWindowButton(a,"park").title=this._engineGetWindowButton(a,"park").titleIfParked,a._isParked=!0,a.parkBusy=!1,this._engineRedrawWindowSize(a),this._engineDoOnWindowParkUp(a),a.checkEvent("onParkUp")?a.callEvent("onParkUp",[a]):this.callEvent("onParkUp",[a])):(this._engineRedrawWindowSize(a),
this.parkTM=window.setTimeout(function(){b._doParkUp(a)},this.parkTMTime))};this._doParkDown=function(a){a.h+=this.parkSpeed;a.h>=a.lastParkH?(a.h=a.lastParkH,this._engineGetWindowButton(a,"park").title=this._engineGetWindowButton(a,"park").titleIfNotParked,a._allowResizeGlobal==!0&&(this._enableButton(a,"minmax1"),this._enableButton(a,"minmax2")),a._isParked=!1,a.parkBusy=!1,this._engineRedrawWindowSize(a),a.updateNestedObjects(),this._engineDoOnWindowParkDown(a),a.checkEvent("onParkDown")?a.callEvent("onParkDown",
[a]):this.callEvent("onParkDown",[a])):(this._engineRedrawWindowSize(a),this.parkTM=window.setTimeout(function(){b._doParkDown(a)},this.parkTMTime))};this._enableButton=function(a,b){var c=this._engineGetWindowButton(a,b);if(c)c._isEnabled=!0,c.className="dhtmlx_wins_btns_button dhtmlx_button_"+c.label+"_default",c=null};this._disableButton=function(a,b){var c=this._engineGetWindowButton(a,b);if(c)c._isEnabled=!1,c.className="dhtmlx_wins_btns_button dhtmlx_button_"+a.btns[b].label+"_disabled",c=null};
this._allowReszieGlob=function(a){a._allowResizeGlobal=!0;this._enableButton(a,"minmax1");this._enableButton(a,"minmax2")};this._denyResize=function(a){a._allowResizeGlobal=!1;this._disableButton(a,"minmax1");this._disableButton(a,"minmax2")};this._maximizeWindow=function(a){var b=this.wins[a];if(b._allowResizeGlobal!=!1){var c=b._isParked;c&&this._parkWindow(b.idd,!0);b.lastMaximizeX=b.x;b.lastMaximizeY=b.y;b.lastMaximizeW=b.w;b.lastMaximizeH=b.h;b.maxW!="auto"&&b.maxW!="auto"?(b.x=Math.round(b.x+
(b.w-b.maxW)/2),b.y=Math.round(b.y+(b.h-b.maxH)/2),b._allowMove=!0):(b.x=0,b.y=0,b._allowMove=!1);b._isMaximized=!0;b._allowResize=!1;b.w=b.maxW=="auto"?this.vp==document.body?"100%":this.vp.style.width!=""&&String(this.vp.style.width).search("%")==-1?parseInt(this.vp.style.width):this.vp.offsetWidth:b.maxW;b.h=b.maxH=="auto"?this.vp==document.body?"100%":this.vp.style.height!=""&&String(this.vp.style.width).search("%")==-1?parseInt(this.vp.style.height):this.vp.offsetHeight:b.maxH;this._hideButton(b,
"minmax1");this._showButton(b,"minmax2");this._engineRedrawWindowPos(b);c?this._parkWindow(b.idd,!0):(this._engineRedrawWindowSize(b),b.updateNestedObjects());b.checkEvent("onMaximize")?b.callEvent("onMaximize",[b]):this.callEvent("onMaximize",[b]);b=null}};this._restoreWindow=function(a){var b=this.wins[a];if(b._allowResizeGlobal!=!1){b.layout&&b.layout._defineWindowMinDimension(b);var c=b._isParked;c&&this._parkWindow(b.idd,!0);b.maxW!="auto"&&b.maxW!="auto"?(b.x=Math.round(b.x+(b.w-b.lastMaximizeW)/
2),b.y=Math.round(b.y+(b.h-b.lastMaximizeH)/2)):(b.x=b.lastMaximizeX,b.y=b.lastMaximizeY);b.w=b.lastMaximizeW;b.h=b.lastMaximizeH;b._isMaximized=!1;b._allowMove=b._allowMoveGlobal;b._allowResize=!0;this._fixWindowDimensionInViewport(b);this._hideButton(b,"minmax2");this._showButton(b,"minmax1");this._engineRedrawWindowPos(b);c?this._parkWindow(b.idd,!0):(this._engineRedrawWindowSize(b),b.updateNestedObjects());b.checkEvent("onMinimize")?b.callEvent("onMinimize",[b]):this.callEvent("onMinimize",[b]);
b=null}};this._showButton=function(a,b,c){var g=this._engineGetWindowButton(a,b);if(g&&!(!c&&g._userHide||g.isVisible===!0))g.isVisible=!0,g.style.display="",g.style.visibility="visible",g._userHide=c!=!0,this._engineRedrawWindowTitle(a),g=null};this._hideButton=function(a,b,c){var g=this._engineGetWindowButton(a,b);if(g&&(c||g.isVisible!==!1))g.isVisible=!1,g.style.display="none",g.style.visibility="hidden",g._userHide=c==!0,this._engineRedrawWindowTitle(a),g=null};this._showWindow=function(a){a.style.display=
"";a.checkEvent("onShow")?a.callEvent("onShow",[a]):this.callEvent("onShow",[a]);var b=this._getActive();b==null?(this._bringOnTop(a),this._makeActive(a)):this._isWindowHidden(b)&&(this._bringOnTop(a),this._makeActive(a))};this._hideWindow=function(a){a.style.display="none";a.checkEvent("onHide")?a.callEvent("onHide",[a]):this.callEvent("onHide",[a]);var b=this.getTopmostWindow(!0);b!=null&&(this._bringOnTop(b),this._makeActive(b))};this._isWindowHidden=function(a){var b=a.style.display=="none";return b};
this._closeWindow=function(a){var b=this.wins[a];if(this._focusFixIE)this._focusFixIE.style.top=(this.vp==document.body?0:getAbsoluteTop(this.vp))+Number(b.y)+"px",this._focusFixIE.focus();if(b.checkEvent("onClose")){if(!b.callEvent("onClose",[b]))return}else if(!this.callEvent("onClose",[b]))return;b=null;this._removeWindowGlobal(a);var c={zi:0},g;for(g in this.wins)this.wins[g].zi>c.zi&&(c=this.wins[g]);c!=null&&this._makeActive(c)};this._needHelp=function(a){var b=this.wins[a];b.checkEvent("onHelp")?
b.callEvent("onHelp",[b]):this.callEvent("onHelp",[b]);b=null};this._setWindowIcon=function(a,b,c){a.iconsPresent=!0;a.icons[0]=this.imagePath+b;a.icons[1]=this.imagePath+c;this._engineUpdateWindowIcon(a,a.icons[a.isOnTop()?0:1])};this._getWindowIcon=function(a){return a.iconsPresent?[a.icons[0],a.icons[1]]:[null,null]};this._clearWindowIcons=function(a){a.iconsPresent=!1;a.icons[0]=this.imagePath+this.pathPrefix+this.skin+"/active/icon_blank.gif";a.icons[1]=this.imagePath+this.pathPrefix+this.skin+
"/inactive/icon_blank.gif";this._engineUpdateWindowIcon(a,a.icons[a.isOnTop()?0:1])};this._restoreWindowIcons=function(a){a.iconsPresent=!0;a.icons[0]=this.imagePath+this.pathPrefix+this.skin+"/active/icon_normal.gif";a.icons[1]=this.imagePath+this.pathPrefix+this.skin+"/inactive/icon_normal.gif";this._engineUpdateWindowIcon(a,a.icons[a.className=="dhtmlx_window_active"?0:1])};this._attachWindowContentTo=function(a,b,c,g){var h=this._engineGetWindowContent(a).parentNode;h.parentNode.removeChild(h);
a.hide();h.style.left="0px";h.style.top="0px";h.style.width=(c!=null?c:b.offsetWidth)+"px";h.style.height=(g!=null?g:b.offsetHeight)+"px";h.style.position="relative";b.appendChild(h);this._engineGetWindowContent(a).style.width=h.style.width;this._engineGetWindowContent(a).style.height=h.style.height};this._setWindowToFullScreen=function(a,b){if(b==!0){var c=a._content;c.parentNode.removeChild(c);a.hide();a._isFullScreened=!0;c.style.left="0px";c.style.top="0px";c.style.width=document.body.offsetWidth-
(_isIE?4:0)+"px";c.style.height=document.body.offsetHeight==0?window.innerHeight?window.innerHeight+"px":document.body.scrollHeight+"px":document.body.offsetHeight-(_isIE?4:0)+"px";c.style.position="absolute";document.body.appendChild(c)}else if(b==!1){var c=a.childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1],g=a._content;document.body.removeChild(g);c.appendChild(g);a._isFullScreened=!1;a.setDimension(a.w,a.h);a.show();a.bringToTop();
a.center()}a.updateNestedObjects()};this._isWindowOnTop=function(a){var b=this.getTopmostWindow()==a;return b};this._bringOnBottom=function(a){for(var b in this.wins)if(this.wins[b].zi<a.zi)this.wins[b].zi+=this.zIndexStep,this.wins[b].style.zIndex=this.wins[b].zi;a.zi=50;a.style.zIndex=a.zi;this._makeActive(this.getTopmostWindow())};this._isWindowOnBottom=function(a){var b=!0,c;for(c in this.wins)this.wins[c]!=a&&(b=b&&this.wins[c].zi>a.zi);return b};this._stickWindow=function(a){var b=this.wins[a];
b._isSticked=!0;this._hideButton(b,"stick");this._showButton(b,"sticked");this._bringOnTop(b);b=null};this._unstickWindow=function(a){var b=this.wins[a];b._isSticked=!1;this._hideButton(b,"sticked");this._showButton(b,"stick");this._bringOnTopAnyStickedWindows();b=null};this._addUserButton=function(a,b,c,g){var b=String(b).toLowerCase(),h=this._engineAddUserButton(a,b,c);h.title=g;h.isVisible=!0;h._isEnabled=!0;h.isPressed=!1;h.label=b;a.btns[b]=h;a.btns[b].winId=a.idd;a.btns[b]._doOnClick=function(){};
this._attachEventsOnButton(a.idd,b);h=null};this._removeUserButton=function(a,b){this._removeButtonGlobal(a,b)};this._blockSwitcher=function(a){for(var b in this.wins)a==!0?this.wins[b].showCoverBlocker():this.wins[b].hideCoverBlocker()};this.modalWin=this.resizingWin=null;this.resizingDirs="none";if(_isIE)this._focusFixIE=document.createElement("INPUT"),this._focusFixIE.className="dhx_windows_ieonclosefocusfix",this._focusFixIE.style.position="absolute",this._focusFixIE.style.width="1px",this._focusFixIE.style.height=
"1px",this._focusFixIE.style.border="none",this._focusFixIE.style.background="none",this._focusFixIE.style.left="-10px",this._focusFixIE.style.fontSize="1px",document.body.appendChild(this._focusFixIE);this._createViewport();this._doOnMouseUp=function(){b!=null&&b._stopMove()};this._doOnMoseMove=function(a){a=a||event;b!=null&&b._moveWindow(a)};this._resizeTM=null;this._resizeTMTime=200;this._lw=null;this._doOnResize=function(){if(b._lw!=document.documentElement.clientHeight)window.clearTimeout(b._resizeTM),
b._resizeTM=window.setTimeout(function(){b._autoResizeViewport()},b._resizeTMTime);b._lw=document.documentElement.clientHeight};this._doOnUnload=function(){b.unload()};this._doOnSelectStart=function(a){a=a||event;if(b.movingWin!=null||b.resizingWin!=null)a.returnValue=!1};_isIE&&document.body.attachEvent("onselectstart",this._doOnSelectStart);dhtmlxEvent(window,"resize",this._doOnResize);dhtmlxEvent(document.body,"unload",this._doOnUnload);this._isIPad?(document.addEventListener("touchmove",this._doOnMoseMove,
!1),document.addEventListener("touchend",this._doOnMouseUp,!1)):(dhtmlxEvent(document.body,"mouseup",this._doOnMouseUp),dhtmlxEvent(this.vp,"mousemove",this._doOnMoseMove),dhtmlxEvent(this.vp,"mouseup",this._doOnMouseUp));this._setWindowModal=function(a,b){b==!0?(this._makeActive(a),this._bringOnTop(a),this.modalWin=a,a._isModal=!0,this.modalCoverI.style.zIndex=a.zi-2,this.modalCoverI.style.display="",this.modalCoverD.style.zIndex=a.zi-2,this.modalCoverD.style.display=""):(this.modalWin=null,a._isModal=
!1,this.modalCoverI.style.zIndex=0,this.modalCoverI.style.display="none",this.modalCoverD.style.zIndex=0,this.modalCoverD.style.display="none")};this._bringOnTopAnyStickedWindows=function(){var a=[],b;for(b in this.wins)this.wins[b]._isSticked&&(a[a.length]=this.wins[b]);for(var c=0;c<a.length;c++)this._bringOnTop(a[c]);if(a.length==0)for(b in this.wins)this.wins[b].className=="dhtmlx_window_active"&&this._bringOnTop(this.wins[b])};this.unload=function(){this._clearAll()};this._removeButtonGlobal=
function(a,b){if(this.wins[a]&&this.wins[a].btns[b]){var c=this.wins[a].btns[b];c.title=null;c.isVisible=null;c._isEnabled=null;c.isPressed=null;c.label=null;c._doOnClick=null;c.detachAllEvents();c.attachEvent=null;c.callEvent=null;c.checkEvent=null;c.detachEvent=null;c.detachAllEvents=null;c.disable=null;c.enable=null;c.eventCatcher=null;c.hide=null;c.isEnabled=null;c.isHidden=null;c.show=null;c.onmousedown=null;c.onmouseout=null;c.onmouseover=null;c.onmouseup=null;c.ontouchstart=null;c.ontouchend=
null;c.parentNode&&c.parentNode.removeChild(c);c=null;this.wins[a].btns[b]=null;delete this.wins[a].btns[b]}};this._removeWindowGlobal=function(a){var b=this.wins[a];this.modalWin==b&&this._setWindowModal(b,!1);var c=b.coverBlocker(),c=c.onselectstart=null;this._engineDiableOnSelectInWindow(b,!1);b._dhxContDestruct();this._engineGetWindowHeader(b).onmousedown=null;this.resizingWin=this.movingWin=this._engineGetWindowHeader(b).ondblclick=null;for(var g in b.btns)this._removeButtonGlobal(b,g);b.btns=
null;b.detachAllEvents();b._adjustToContent=null;b._doOnAttachMenu=null;b._doOnAttachStatusBar=null;b._doOnAttachToolbar=null;b._doOnFrameMouseDown=null;b._doOnFrameContentLoaded=null;b._redraw=null;b.addUserButton=null;b.allowMove=null;b.allowPark=null;b.allowResize=null;b.attachEvent=null;b.bringToBottom=null;b.bringToTop=null;b.callEvent=null;b.center=null;b.centerOnScreen=null;b.checkEvent=null;b.clearIcon=null;b.close=null;b.denyMove=null;b.denyPark=null;b.denyResize=null;b.detachEvent=null;
b.detachAllEvents=null;b.eventCatcher=null;b.getDimension=null;b.getIcon=null;b.getId=null;b.getMaxDimension=null;b.getMinDimension=null;b.getPosition=null;b.getText=null;b.hide=null;b.hideHeader=null;b.isHidden=null;b.isMaximized=null;b.isModal=null;b.isMovable=null;b.isOnBottom=null;b.isOnTop=null;b.isParkable=null;b.isParked=null;b.isResizable=null;b.isSticked=null;b.keepInViewport=null;b.maximize=null;b.minimize=null;b.park=null;b.progressOff=null;b.progressOn=null;b.removeUserButton=null;b.restoreIcon=
null;b.setDimension=null;b.setIcon=null;b.setMaxDimension=null;b.setMinDimension=null;b.setModal=null;b.setPosition=null;b.setText=null;b.setToFullScreen=null;b.show=null;b.showHeader=null;b.stick=null;b.unstick=null;b.onmousemove=null;b.onmousedown=null;b.icons=null;b.button=null;b._dhxContDestruct=null;b.dhxContGlobal.obj=null;b.dhxContGlobal.setContent=null;b.dhxContGlobal.dhxcont=null;b.dhxContGlobal=null;if(b._frame){for(;b._frame.childNodes.length>0;)b._frame.removeChild(b._frame.childNodes[0]);
b._frame=null}this._parseNestedForEvents(b);b._content=null;b.innerHTML="";b.parentNode.removeChild(b);b=null;this.wins[a]=null;delete this.wins[a]};this._removeEvents=function(a){a.onmouseover=null;a.onmouseout=null;a.onmousemove=null;a.onclick=null;a.ondblclick=null;a.onmouseenter=null;a.onmouseleave=null;a.onmouseup=null;a.onmousewheel=null;a.onmousedown=null;a.onselectstart=null;a.onfocus=null;a.style.display="";a=null};this._parseNestedForEvents=function(a){this._removeEvents(a);for(var b=0;b<
a.childNodes.length;b++)a.childNodes[b].tagName!=null&&this._parseNestedForEvents(a.childNodes[b]);a=null};this._clearAll=function(){this._clearDocumentEvents();for(var a in this.wins)this._removeWindowGlobal(a);this.wins=null;for(this._parseNestedForEvents(this._carcass);this._carcass.childNodes.length>0;)this._carcass.removeChild(this._carcass.childNodes[0]);this._carcass.onselectstart=null;this._carcass.parentNode.removeChild(this._carcass);this._carcass=null;this._parseNestedForEvents(this._vpcover);
this._vpcover.parentNode.removeChild(this._vpcover);this._vpcover=null;this._parseNestedForEvents(this.modalCoverD);this.modalCoverD.parentNode.removeChild(this.modalCoverD);this.modalCoverD=null;this._parseNestedForEvents(this.modalCoverI);this.modalCoverI.parentNode.removeChild(this.modalCoverI);this.modalCoverI=null;this.vp.autocreated==!0&&this.vp.parentNode.removeChild(this.vp);this.vp=null;for(a in this.skinParams)delete this.skinParams[a];b=this.window=this.unload=this.setViewport=this.setSkin=
this.setImagePath=this.setEffect=this.isWindow=this.getTopmostWindow=this.getEffect=this.getBottommostWindow=this.forEachWindow=this.findByText=this.eventCatcher=this.enableAutoViewport=this.detachEvent=this.createWindow=this.checkEvent=this.callEvent=this.attachViewportTo=this.attachEvent=this._unstickWindow=this._stopMove=this._stickWindow=this._showWindow=this._showButton=this._setWindowToFullScreen=this._setWindowModal=this._setWindowIcon=this._restoreWindowIcons=this._restoreWindow=this._removeWindowGlobal=
this._removeUserButton=this._removeEvents=this._removeButtonGlobal=this._parseNestedForEvents=this._parkWindow=this._needHelp=this._moveWindow=this._maximizeWindow=this._makeActive=this._isWindowOnTop=this._isWindowOnBottom=this._isWindowHidden=this._hideWindow=this._hideButton=this._getWindowIcon=this._getTopZIndex=this._getActive=this._genStr=this._fixWindowDimensionInViewport=this._engineUpdateWindowIcon=this._engineSwitchWindowProgress=this._engineSwitchWindowHeader=this._engineSetWindowBody=
this._engineRedrawWindowTitle=this._engineRedrawWindowSize=this._engineRedrawWindowPos=this._engineRedrawSkin=this._engineGetWindowParkedHeight=this._engineGetWindowLabel=this._engineGetWindowHeaderState=this._engineGetWindowHeader=this._engineGetWindowContent=this._engineGetWindowButton=this._engineFixWindowPosInViewport=this._engineDoOnWindowParkUp=this._engineDoOnWindowParkDown=this._engineDiableOnSelectInWindow=this._engineCheckHeaderMouseDown=this._engineAllowWindowResize=this._engineAdjustWindowToContent=
this._engineAddUserButton=this._enableButton=this._doParkUp=this._doParkDown=this._doOnUnload=this._doOnSelectStart=this._doOnResize=this._doOnMouseUp=this._doOnMoseMove=this._disableButton=this._dhx_Engine=this._denyResize=this._denyParking=this._createViewport=this._closeWindow=this._clearWindowIcons=this._clearDocumentEvents=this._clearAll=this._centerWindow=this._bringOnTopAnyStickedWindows=this._bringOnTop=this._bringOnBottom=this._blockSwitcher=this._autoResizeViewport=this._attachWindowContentTo=
this._attachEventsOnButton=this._allowReszieGlob=this._allowParking=this._addUserButton=this._addDefaultButtons=this._engineSkinParams=this._effects=this.skinParams=null};this._clearDocumentEvents=function(){_isIE?(window.detachEvent("onresize",this._doOnResize),document.body.detachEvent("onselectstart",this._doOnSelectStart),document.body.detachEvent("onmouseup",this._doOnMouseUp),document.body.detachEvent("onunload",this._doOnUnload),this.vp.detachEvent("onmousemove",this._doOnMoseMove),this.vp.detachEvent("onmouseup",
this._doOnMouseUp)):(window.removeEventListener("resize",this._doOnResize,!1),document.body.removeEventListener("mouseup",this._doOnMouseUp,!1),document.body.removeEventListener("unload",this._doOnUnload,!1),this.vp.removeEventListener("mousemove",this._doOnMoseMove,!1),this.vp.removeEventListener("mouseup",this._doOnMouseUp,!1))};this._genStr=function(a){for(var b="",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",g=0;g<a;g++)b+=c.charAt(Math.round(Math.random()*(c.length-1)));
return b};dhtmlxEventable(this);return this}else alert(this.i18n.noenginealert)}else alert(this.i18n.dhx)}
dhtmlXWindows.prototype._dhx_Engine=function(){this._engineEnabled=!0;this._engineName="dhx";this._engineSkinParams={dhx_blue:{hh:21,lbw:2,rbw:2,lch:2,lcw:14,rch:14,rcw:14,bbh:2,mnh:23,tbh:25,sbh:20,noh_t:null,noh_h:null},dhx_black:{hh:21,lbw:2,rbw:2,lch:2,lcw:14,rch:14,rcw:14,bbh:2,mnh:23,tbh:25,sbh:20,noh_t:null,noh_h:null},dhx_skyblue:{hh:29,lbw:2,rbw:2,lch:2,lcw:14,rch:14,rcw:14,bbh:2,mnh:23,tbh:25,sbh:20,noh_t:5,noh_h:-10},dhx_web:{hh:27,lbw:5,rbw:5,lch:5,lcw:14,rch:14,rcw:14,bbh:5,mnh:23,tbh:25,
sbh:20,noh_t:5,noh_h:-10},dhx_terrace:{hh:37,lbw:5,rbw:5,lch:5,lcw:14,rch:14,rcw:14,bbh:5,mnh:23,tbh:25,sbh:20,noh_t:5,noh_h:-10}};this._isIE6=!1;if(_isIE)this._isIE6=window.XMLHttpRequest==null?!0:!1;this._engineSetWindowBody=function(a){a.innerHTML="<div iswin='1' class='dhtmlx_wins_body_outer' style='position: relative;'>"+(this._isIE6?"<iframe src='javascript:false;' frameborder='0' class='dhtmlx_wins_ie6_cover_fix' onload='this.contentWindow.document.body.style.overflow=\"hidden\";'></iframe>":
"")+"<div class='dhtmlx_wins_icon'></div><div class='dhtmlx_wins_progress'></div><div class='dhtmlx_wins_title'>dhtmlxWindow</div><div class='dhtmlx_wins_btns'><div class='dhtmlx_wins_btns_button dhtmlx_button_sticked_default'></div><div class='dhtmlx_wins_btns_button dhtmlx_button_stick_default'></div><div class='dhtmlx_wins_btns_button dhtmlx_button_help_default'></div><div class='dhtmlx_wins_btns_button dhtmlx_button_park_default'></div><div class='dhtmlx_wins_btns_button dhtmlx_button_minmax2_default'></div><div class='dhtmlx_wins_btns_button dhtmlx_button_minmax1_default'></div><div class='dhtmlx_wins_btns_button dhtmlx_button_close_default'></div><div class='dhtmlx_wins_btns_button dhtmlx_button_dock_default'></div></div><div class='dhtmlx_wins_body_inner'></div><div winResT='yes' class='dhtmlx_wins_resizer_t' style='display:none;'></div><div winResL='yes' class='dhtmlx_wins_resizer_l'></div><div winResR='yes' class='dhtmlx_wins_resizer_r'></div><div winResB='yes' class='dhtmlx_wins_resizer_b'></div><div class='white_line'></div><div class='white_line2'></div></div>";
a.dhxContGlobal=new dhtmlXContainer(a);if(this.skin=="dhx_skyblue")a.dhxContGlobal.obj._offsetWidth=-10,a.dhxContGlobal.obj._offsetHeight=-5,a.dhxContGlobal.obj._offsetLeft=5,a.dhxContGlobal.obj._offsetHeightSaved=a.dhxContGlobal.obj._offsetHeight;if(this.skin=="dhx_web")a.dhxContGlobal.obj._offsetWidth=-10,a.dhxContGlobal.obj._offsetHeight=-5,a.dhxContGlobal.obj._offsetLeft=5,a.dhxContGlobal.obj._offsetHeightSaved=a.dhxContGlobal.obj._offsetHeight;a.skin=this.skin;a.dhxContGlobal.setContent(a.childNodes[0].childNodes[this._isIE6?
5:4]);var b=a.coverBlocker();b.onselectstart=function(a){a=a||event;a.returnValue=!1;a.cancelBubble=!0};b=null};this._engineDiableOnSelectInWindow=function(a,b){var c=[];c[0]=a.childNodes[0].childNodes[this._isIE6?1:0];c[1]=a.childNodes[0].childNodes[this._isIE6?2:1];c[2]=a.childNodes[0].childNodes[this._isIE6?3:2];c[3]=a.childNodes[0].childNodes[this._isIE6?4:3];c[4]=a.childNodes[0].childNodes[this._isIE6?6:5];c[5]=a.childNodes[0].childNodes[this._isIE6?7:6];c[6]=a.childNodes[0].childNodes[this._isIE6?
8:7];c[7]=a.childNodes[0].childNodes[this._isIE6?9:8];for(var d=0;d<c.length;d++)c[d].onselectstart=b?function(a){a=a||event;return a.returnValue=!1}:null,c[d]=null;c=null};this._engineGetWindowHeader=function(a){a.childNodes[0].idd=a.idd;return a.childNodes[0]};this._engineRedrawWindowSize=function(a){a.style.width=String(a.w).search("%")==-1?a.w+"px":a.w;a.style.height=String(a.h).search("%")==-1?a.h+"px":a.h;var b=a.childNodes[0];b.style.width=a.clientWidth+"px";b.style.height=a.clientHeight+"px";
if(b.offsetWidth>a.clientWidth)b.style.width=a.clientWidth*2-b.offsetWidth+"px";if(b.offsetHeight>a.clientHeight){var c=a.clientHeight*2-b.offsetHeight;c<0&&(c=0);b.style.height=c+"px"}var d=a._noHeader==!0?a._hdrSize:this._engineSkinParams[this.skin].hh;this._engineRedrawWindowTitle(a);a.adjustContent(b,d)};this._engineRedrawWindowPos=function(a){if(!a._isFullScreened)a.style.left=a.x+"px",a.style.top=a.y+"px"};this._engineFixWindowPosInViewport=function(a){var b=a._noHeader==!0?a._hdrSize:this._engineSkinParams[this.skin].hh;
if(a._keepInViewport){if(a.x<0)a.x=0;if(a.x+a.w>this.vp.offsetWidth)a.x=this.vp.offsetWidth-a.w;if(a.y+a.h>this.vp.offsetHeight)a.y=this.vp.offsetHeight-a.h;if(a.y<0)a.y=0}else{if(a.y+b>this.vp.offsetHeight)a.y=this.vp.offsetHeight-b;if(a.y<0)a.y=0;if(a.x+a.w-10<0)a.x=10-a.w;if(a.x>this.vp.offsetWidth-10)a.x=this.vp.offsetWidth-10}};this._engineCheckHeaderMouseDown=function(a,b){if(this._isIPad){var c=b.touches[0].clientX,d=b.touches[0].clientY,e=b.target||b.srcElement;return e==a.childNodes[0]||
e==a.childNodes[0].childNodes[0]||e==a.childNodes[0].childNodes[2]||e==a.childNodes[0].childNodes[3]?!0:!1}else c=_isIE||_isOpera?b.offsetX:b.layerX,d=_isIE||_isOpera?b.offsetY:b.layerY,e=b.target||b.srcElement;var f=a._noHeader==!0?a._hdrSize:this._engineSkinParams[this.skin].hh;return d<=f&&(e==a.childNodes[0]||e==a.childNodes[0].childNodes[this._isIE6?1:0]||e==a.childNodes[0].childNodes[this._isIE6?3:2]||e==a.childNodes[0].childNodes[this._isIE6?4:3])?!0:!1};this._engineGetWindowContent=function(){alert("_engineGetWindowContent")};
this._engineGetWindowButton=function(a,b){for(var b=String(b).toLowerCase(),c=null,d="dhtmlx_button_"+b+"_",e=0;e<a.childNodes[0].childNodes[this._isIE6?4:3].childNodes.length;e++){var f=a.childNodes[0].childNodes[this._isIE6?4:3].childNodes[e];String(f.className).search(d)!=-1&&(c=f);f=null}return c};this._engineAddUserButton=function(a,b,c){isNaN(c)&&(c=0);var d=document.createElement("DIV");d.className="dhtmlx_wins_btns_button dhtmlx_button_"+b+"_default";var e=a.childNodes[0].childNodes[this._isIE6?
4:3],c=e.childNodes.length-c;c<0&&(c=0);c>=e.childNodes.length?e.appendChild(d):e.insertBefore(d,e.childNodes[c]);this._engineRedrawWindowTitle(a);return d};this._engineGetWindowParkedHeight=function(){return this._engineSkinParams[this.skin].hh+1};this._engineDoOnWindowParkDown=function(a){a.childNodes[0].childNodes[this._isIE6?6:5].style.display=a._noHeader==!0?"":"none";a.childNodes[0].childNodes[this._isIE6?7:6].style.display="";a.childNodes[0].childNodes[this._isIE6?8:7].style.display="";a.childNodes[0].childNodes[this._isIE6?
9:8].style.display=""};this._engineDoOnWindowParkUp=function(a){a.childNodes[0].childNodes[this._isIE6?6:5].style.display="none";a.childNodes[0].childNodes[this._isIE6?7:6].style.display="none";a.childNodes[0].childNodes[this._isIE6?8:7].style.display="none";a.childNodes[0].childNodes[this._isIE6?9:8].style.display="none"};this._engineUpdateWindowIcon=function(a,b){a.childNodes[0].childNodes[this._isIE6?1:0].style.backgroundImage="url('"+b+"')"};this._engineAllowWindowResize=function(a,b,c,d){if(b.getAttribute){var e=
this._engineSkinParams[this.skin],f=a._noHeader==!0?a._hdrSize:this._engineSkinParams[this.skin].hh;return b.getAttribute("winResL")!=null&&b.getAttribute("winResL")=="yes"&&d>=f?d>=a.h-e.lch?"corner_left":d<=e.lch&&a._noHeader==!0?"corner_up_left":"border_left":b.getAttribute("winResR")!=null&&b.getAttribute("winResR")=="yes"&&d>=f?d>=a.h-e.rch?"corner_right":d<=e.rch&&a._noHeader==!0?"corner_up_right":"border_right":b.getAttribute("winResT")!=null&&b.getAttribute("winResT")=="yes"&&a._noHeader==
!0?c<=e.lcw?"corner_up_left":c>=a.w-e.rcw?"corner_up_right":"border_top":b.getAttribute("winResB")!=null&&b.getAttribute("winResB")=="yes"?c<=e.lcw?"corner_left":c>=a.w-e.rcw?"corner_right":"border_bottom":null}};this._engineAdjustWindowToContent=function(a,b,c){var d=b+a.w-a.vs[a.av].dhxcont.clientWidth,e=c+a.h-a.vs[a.av].dhxcont.clientHeight;a.setDimension(d,e)};this._engineRedrawSkin=function(){this.vp.className=(this.vp==document.body&&this.vp._css?this.vp._css+" ":"")+"dhtmlx_winviewport dhtmlx_skin_"+
this.skin+(this._r?" dhx_wins_rtl":"");var a=this._engineSkinParams[this.skin],b;for(b in this.wins)this.skin=="dhx_skyblue"?(this.wins[b].dhxContGlobal.obj._offsetTop=this.wins[b]._noHeader?a.noh_t:null,this.wins[b].dhxContGlobal.obj._offsetWidth=-10,this.wins[b].dhxContGlobal.obj._offsetHeight=this.wins[b]._noHeader?a.noh_h:-5,this.wins[b].dhxContGlobal.obj._offsetLeft=5,this.wins[b].dhxContGlobal.obj._offsetHeightSaved=-5):(this.wins[b].dhxContGlobal.obj._offsetWidth=null,this.wins[b].dhxContGlobal.obj._offsetHeight=
null,this.wins[b].dhxContGlobal.obj._offsetLeft=null,this.wins[b].dhxContGlobal.obj._offsetTop=null,this.wins[b].dhxContGlobal.obj._offsetHeightSaved=null),this.wins[b].skin=this.skin,this._restoreWindowIcons(this.wins[b]),this._engineRedrawWindowSize(this.wins[b])};this._engineSwitchWindowProgress=function(a,b){b==!0?(a.childNodes[0].childNodes[this._isIE6?1:0].style.display="none",a.childNodes[0].childNodes[this._isIE6?2:1].style.display=""):(a.childNodes[0].childNodes[this._isIE6?2:1].style.display=
"none",a.childNodes[0].childNodes[this._isIE6?1:0].style.display="")};this._engineSwitchWindowHeader=function(a,b){if(!a._noHeader)a._noHeader=!1;if(b==a._noHeader){a._noHeader=b==!0?!1:!0;a._hdrSize=0;a.childNodes[0].childNodes[this._isIE6?5:4].className="dhtmlx_wins_body_inner"+(a._noHeader?" dhtmlx_wins_no_header":"");a.childNodes[0].childNodes[this._isIE6?6:5].style.display=a._noHeader?"":"none";a.childNodes[0].childNodes[this._isIE6?1:0].style.display=a._noHeader?"none":"";a.childNodes[0].childNodes[this._isIE6?
3:2].style.display=a._noHeader?"none":"";a.childNodes[0].childNodes[this._isIE6?4:3].style.display=a._noHeader?"none":"";var c=this._engineSkinParams[this.skin];a._noHeader?(a.dhxContGlobal.obj._offsetHeightSaved=a.dhxContGlobal.obj._offsetHeight,a.dhxContGlobal.obj._offsetHeight=c.noh_h,a.dhxContGlobal.obj._offsetTop=c.noh_t):(a.dhxContGlobal.obj._offsetHeight=a.dhxContGlobal.obj._offsetHeightSaved,a.dhxContGlobal.obj._offsetTop=null);this._engineRedrawWindowSize(a)}};this._engineGetWindowHeaderState=
function(a){return a._noHeader?!0:!1};this._engineGetWindowLabel=function(a){return a.childNodes[0].childNodes[this._isIE6?3:2]};this._engineRedrawWindowTitle=function(a){if(a._noHeader!==!0){var b=a.childNodes[0].childNodes[this._isIE6?1:0].offsetWidth,c=a.childNodes[0].childNodes[this._isIE6?4:3].offsetWidth,d=a.offsetWidth-b-c-24;d<0?d="100%":d+="px";a.childNodes[0].childNodes[this._isIE6?3:2].style.width=d}}};
dhtmlXWindows.prototype.i18n={dhxcontaler:"dhtmlxcontainer.js is missed on the page",noenginealert:"No dhtmlxWindows engine was found.",stick:"Stick",unstick:"Unstick",help:"Help",parkdown:"Park Down",parkup:"Park Up",maximize:"Maximize",restore:"Restore",close:"Close",dock:"Dock"};
(function(){dhtmlx.extend_api("dhtmlXWindows",{_init:function(){return[]},_patch:function(b){b.old_createWindow=b.createWindow;b.createWindow=function(b){if(arguments.length>1)return this.old_createWindow.apply(this,arguments);var d=this.old_createWindow(b.id,b.x||b.left,b.y||b.top,b.width,b.height);d.allowMoveA=function(a){a?this.allowMove():this.denyMove()};d.allowParkA=function(a){a?this.allowPark():this.denyPark()};d.allowResizeA=function(a){a?this.allowResize():this.denyResize()};for(var e in b)if(a[e])d[a[e]](b[e]);
else e.indexOf("on")==0&&d.attachEvent(e,b[e]);return d}},animation:"setEffect",image_path:"setImagePath",skin:"setSkin",viewport:"_viewport",wins:"_wins"},{_viewport:function(a){a.object?(this.enableAutoViewport(!1),this.attachViewportTo(a.object)):(this.enableAutoViewport(!1),this.setViewport(a.left,a.top,a.width,a.height,a.parent))},_wins:function(a){for(var c=0;c<a.length;c++){var d=a[c];this.createWindow(d.id,d.left,d.top,d.width,d.height);d.text&&this.window(d.id).setText(d.text);d.keep_in_viewport&&
this.window(d.id).keepInViewport(!0);d.deny_resize&&this.window(d.id).denyResize();d.deny_park&&this.window(d.id).denyPark();d.deny_move&&this.window(d.id).denyMove()}}});var a={move:"allowMoveA",park:"allowParkA",resize:"allowResizeA",center:"center",modal:"setModal",caption:"setText",header:"showHeader"}})();
function dhtmlXContainer(a){var b=this;this.obj=a;a=null;this.obj._padding=!0;this.dhxcont=null;this.st=document.createElement("DIV");this.st.style.position="absolute";this.st.style.left="-200px";this.st.style.top="0px";this.st.style.width="100px";this.st.style.height="1px";this.st.style.visibility="hidden";this.st.style.overflow="hidden";document.body.insertBefore(this.st,document.body.childNodes[0]);this.obj._getSt=function(){return b.st};this.obj.dv="def";this.obj.av=this.obj.dv;this.obj.cv=this.obj.av;
this.obj.vs={};this.obj.vs[this.obj.av]={};this.obj.view=function(a){if(!this.vs[a]){this.vs[a]={};this.vs[a].dhxcont=this.vs[this.dv].dhxcont;var c=document.createElement("DIV");c.style.position="relative";c.style.left="0px";c.style.width="200px";c.style.height="200px";c.style.overflow="hidden";c.style.visibility="";b.st.appendChild(c);this.vs[a].dhxcont.mainCont[a]=c;c=null}this.avt=this.av;this.av=a;return this};this.obj.setActive=function(){if(this.vs[this.av])this.cv=this.av,this.vs[this.avt].dhxcont==
this.vs[this.avt].dhxcont.mainCont[this.avt].parentNode&&(b.st.appendChild(this.vs[this.avt].dhxcont.mainCont[this.avt]),this.vs[this.avt].menu&&b.st.appendChild(document.getElementById(this.vs[this.avt].menuId)),this.vs[this.avt].toolbar&&b.st.appendChild(document.getElementById(this.vs[this.avt].toolbarId)),this.vs[this.avt].sb&&b.st.appendChild(document.getElementById(this.vs[this.avt].sbId))),this.vs[this.av].dhxcont!=this.vs[this.av].dhxcont.mainCont[this.av].parentNode&&(this.vs[this.av].dhxcont.insertBefore(this.vs[this.av].dhxcont.mainCont[this.av],
this.vs[this.av].dhxcont.childNodes[this.vs[this.av].dhxcont.childNodes.length-1]),this.vs[this.av].menu&&this.vs[this.av].dhxcont.insertBefore(document.getElementById(this.vs[this.av].menuId),this.vs[this.av].dhxcont.childNodes[0]),this.vs[this.av].toolbar&&this.vs[this.av].dhxcont.insertBefore(document.getElementById(this.vs[this.av].toolbarId),this.vs[this.av].dhxcont.childNodes[this.vs[this.av].menu?1:0]),this.vs[this.av].sb&&this.vs[this.av].dhxcont.insertBefore(document.getElementById(this.vs[this.av].sbId),
this.vs[this.av].dhxcont.childNodes[this.vs[this.av].dhxcont.childNodes.length-1])),this._doOnResize&&this._doOnResize(),this._isWindow&&this.updateNestedObjects(),this.avt=null};this.obj._viewRestore=function(){var a=this.av;if(this.avt)this.av=this.avt,this.avt=null;return a};this.setContent=function(a){this.obj.vs[this.obj.av].dhxcont=a;this.obj._init();a=null};this.obj._init=function(){this.vs[this.av].dhxcont.innerHTML="<div ida='dhxMainCont' style='position: relative; left: 0px; top: 0px; overflow: hidden;'></div><div class='dhxcont_content_blocker' style='display: none;'></div>";
this.vs[this.av].dhxcont.mainCont={};this.vs[this.av].dhxcont.mainCont[this.av]=this.vs[this.av].dhxcont.childNodes[0]};this.obj._genStr=function(a){for(var b="",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",g=0;g<a;g++)b+=c.charAt(Math.round(Math.random()*(c.length-1)));return b};this.obj.setMinContentSize=function(a,b){this.vs[this.av]._minDataSizeW=a;this.vs[this.av]._minDataSizeH=b};this.obj._setPadding=function(a,b){typeof a=="object"?(this._offsetTop=a[0],this._offsetLeft=
a[1],this._offsetWidth=a[2],this._offsetHeight=a[3],a=null):(this._offsetLeft=this._offsetTop=a,this._offsetWidth=-a*2,this._offsetHeight=-a*2);this.vs[this.av].dhxcont.className="dhxcont_global_content_area "+(b||"")};this.obj.moveContentTo=function(a){for(var b in this.vs){a.view(b).setActive();var c=null;this.vs[b].grid&&(c="grid");this.vs[b].tree&&(c="tree");this.vs[b].tabbar&&(c="tabbar");this.vs[b].folders&&(c="folders");this.vs[b].layout&&(c="layout");c!=null&&(a.view(b).attachObject(this.vs[b][c+
"Id"],!1,!0,!1),a.vs[b][c]=this.vs[b][c],a.vs[b][c+"Id"]=this.vs[b][c+"Id"],a.vs[b][c+"Obj"]=this.vs[b][c+"Obj"],this.vs[b][c]=null,this.vs[b][c+"Id"]=null,this.vs[b][c+"Obj"]=null);if(this.vs[b]._frame)a.vs[b]._frame=this.vs[b]._frame,this.vs[b]._frame=null;if(this.vs[b].menu!=null){if(a.cv==a.av)a.vs[a.av].dhxcont.insertBefore(document.getElementById(this.vs[b].menuId),a.vs[a.av].dhxcont.childNodes[0]);else{var g=a._getSt();g.appendChild(document.getElementById(this.vs[b].menuId));g=null}a.vs[b].menu=
this.vs[b].menu;a.vs[b].menuId=this.vs[b].menuId;a.vs[b].menuHeight=this.vs[b].menuHeight;this.vs[b].menu=null;this.vs[b].menuId=null;this.vs[b].menuHeight=null;this.cv==this.av&&this._doOnAttachMenu&&this._doOnAttachMenu("unload");a.cv==a.av&&a._doOnAttachMenu&&a._doOnAttachMenu("move")}if(this.vs[b].toolbar!=null)a.cv==a.av?a.vs[a.av].dhxcont.insertBefore(document.getElementById(this.vs[b].toolbarId),a.vs[a.av].dhxcont.childNodes[a.vs[a.av].menu!=null?1:0]):(g=a._getSt(),g.appendChild(document.getElementById(this.vs[b].toolbarId)),
g=null),a.vs[b].toolbar=this.vs[b].toolbar,a.vs[b].toolbarId=this.vs[b].toolbarId,a.vs[b].toolbarHeight=this.vs[b].toolbarHeight,this.vs[b].toolbar=null,this.vs[b].toolbarId=null,this.vs[b].toolbarHeight=null,this.cv==this.av&&this._doOnAttachToolbar&&this._doOnAttachToolbar("unload"),a.cv==a.av&&a._doOnAttachToolbar&&a._doOnAttachToolbar("move");if(this.vs[b].sb!=null){if(a.cv==a.av)a.vs[a.av].dhxcont.insertBefore(document.getElementById(this.vs[b].sbId),a.vs[a.av].dhxcont.childNodes[a.vs[a.av].dhxcont.childNodes.length-
1]);else return g=a._getSt(),g.appendChild(document.getElementById(this.vs[b].sbId)),g;a.vs[b].sb=this.vs[b].sb;a.vs[b].sbId=this.vs[b].sbId;a.vs[b].sbHeight=this.vs[b].sbHeight;this.vs[b].sb=null;this.vs[b].sbId=null;this.vs[b].sbHeight=null;this.cv==this.av&&this._doOnAttachStatusBar&&this._doOnAttachStatusBar("unload");a.cv==a.av&&a._doOnAttachStatusBar&&a._doOnAttachStatusBar("move")}for(var h=this.vs[b].dhxcont.mainCont[b],i=a.vs[b].dhxcont.mainCont[b];h.childNodes.length>0;)i.appendChild(h.childNodes[0])}a.view(this.av).setActive();
a=null};this.obj.adjustContent=function(a,b,c,g,h){var i=this.vs[this.av].dhxcont,j=i.mainCont[this.av];i.style.left=(this._offsetLeft||0)+"px";i.style.top=(this._offsetTop||0)+b+"px";var k=a.clientWidth+(this._offsetWidth||0);if(g!==!0)i.style.width=Math.max(0,k)+"px";if(g!==!0&&i.offsetWidth>k)i.style.width=Math.max(0,k*2-i.offsetWidth)+"px";var m=a.clientHeight+(this._offsetHeight||0);i.style.height=Math.max(0,m-b)+(c!=null?c:0)+"px";if(i.offsetHeight>m-b)i.style.height=Math.max(0,(m-b)*2-i.offsetHeight)+
"px";if(h&&!isNaN(h))i.style.height=Math.max(0,parseInt(i.style.height)-h)+"px";if(this.vs[this.av]._minDataSizeH!=null&&parseInt(i.style.height)<this.vs[this.av]._minDataSizeH)i.style.height=this.vs[this.av]._minDataSizeH+"px";if(this.vs[this.av]._minDataSizeW!=null&&parseInt(i.style.width)<this.vs[this.av]._minDataSizeW)i.style.width=this.vs[this.av]._minDataSizeW+"px";if(g!==!0&&(j.style.width=i.clientWidth+"px",j.offsetWidth>i.clientWidth))j.style.width=Math.max(0,i.clientWidth*2-j.offsetWidth)+
"px";var l=this.vs[this.av].menu!=null?!this.vs[this.av].menuHidden?this.vs[this.av].menuHeight:0:0,n=this.vs[this.av].toolbar!=null?!this.vs[this.av].toolbarHidden?this.vs[this.av].toolbarHeight:0:0,o=this.vs[this.av].sb!=null?!this.vs[this.av].sbHidden?this.vs[this.av].sbHeight:0:0;j.style.height=i.clientHeight+"px";if(j.offsetHeight>i.clientHeight)j.style.height=Math.max(0,i.clientHeight*2-j.offsetHeight)+"px";j.style.height=Math.max(0,parseInt(j.style.height)-l-n-o)+"px";a=i=j=null};this.obj.coverBlocker=
function(){return this.vs[this.av].dhxcont.childNodes[this.vs[this.av].dhxcont.childNodes.length-1]};this.obj.showCoverBlocker=function(){var a=this.coverBlocker();a.style.display="";a=null};this.obj.hideCoverBlocker=function(){var a=this.coverBlocker();a.style.display="none";a=null};this.obj.updateNestedObjects=function(a){if(this.skin=="dhx_terrace"){var b=this.vs[this.av].menu!=null||this.vs[this.av].toolbar!=null;if(this.vs[this.av].grid){var c=b||this._isWindow?14:0,g=this._isWindow?14:0,h=this._isWindow?
14:0;if(a){if(!this._isWindow)this.vs[this.av].grid.entBox.style.border="0px solid white",this.vs[this.av].grid.skin_h_correction=-2;this.vs[this.av].grid.dontSetSizes=!0;this.vs[this.av].gridObj.style.position="absolute"}this.vs[this.av].gridObj.style.top=c+"px";this.vs[this.av].gridObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)-c-g+"px";this.vs[this.av].gridObj.style.left=h+"px";this.vs[this.av].gridObj.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)-
h*2+"px";this.vs[this.av].grid.setSizes()}if(this.vs[this.av].tree){c=b||this._isWindow?14:0;g=this._isWindow?14:0;h=this._isWindow?14:0;if(a)this.vs[this.av].treeObj.style.position="absolute";this.vs[this.av].treeObj.style.top=c+"px";this.vs[this.av].treeObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)-c-g+"px";this.vs[this.av].treeObj.style.left=h+"px";this.vs[this.av].treeObj.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)-h*2+"px"}if(this.vs[this.av].form){c=
b||this._isWindow?14:0;g=this._isWindow?14:0;h=this._isWindow?14:0;if(a)this.vs[this.av].formObj.style.position="absolute";this.vs[this.av].formObj.style.top=c+"px";this.vs[this.av].formObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)-c-g+"px";this.vs[this.av].formObj.style.left=h+"px";this.vs[this.av].formObj.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)-h*2+"px";this.vs[this.av].form.setSizes()}if(this.vs[this.av].layout)a&&!this._isWindow&&
!this._isCell&&this.vs[this.av].layout._hideBorders(),c=this._isCell&&this._noHeader&&!b?0:14,g=this._isCell&&this._noHeader?0:14,h=this._isCell&&this._noHeader?0:14,this.vs[this.av].layoutObj.style.top=c+"px",this.vs[this.av].layoutObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)-c-g+"px",this.vs[this.av].layoutObj.style.left=h+"px",this.vs[this.av].layoutObj.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)-h*2+"px",this.vs[this.av].layout.setSizes();
if(this.vs[this.av].accordion){if(a)this.vs[this.av].accordion._hideBorders=!0;c=this._isCell&&this._noHeader&&!b?0:14;g=this._isCell&&this._noHeader?0:14;h=this._isCell&&this._noHeader?0:14;this.vs[this.av].accordionObj.style.top=c+"px";this.vs[this.av].accordionObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)-c-g+"px";this.vs[this.av].accordionObj.style.left=h+"px";this.vs[this.av].accordionObj.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)-
h*2+"px";this.vs[this.av].accordion.setSizes()}if(this.vs[this.av].tabbar!=null)c=!b&&this._isCell&&this._noHeader?0:14,g=this._isCell&&this._noHeader?c:28,h=this._isCell&&this._noHeader?0:14,this.vs[this.av].tabbarObj.style.top=c+"px",this.vs[this.av].tabbarObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)-g+"px",this.vs[this.av].tabbarObj.style.left=h+"px",this.vs[this.av].tabbarObj.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)-h*2+
"px",this.vs[this.av].tabbar.adjustOuterSize();if(this.vs[this.av].editor)h=c=14,this.vs[this.av].editorObj.style.top=c+"px",this.vs[this.av].editorObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)-c*2+"px",this.vs[this.av].editorObj.style.left=h+"px",this.vs[this.av].editorObj.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)-h*2+"px",_isIE||this.vs[this.av].editor._prepareContent(!0),this.vs[this.av].editor.setSizes();this.vs[this.av].dockedCell&&
this.vs[this.av].dockedCell.updateNestedObjects()}else{this.vs[this.av].grid&&this.vs[this.av].grid.setSizes();this.vs[this.av].sched&&this.vs[this.av].sched.setSizes();this.vs[this.av].tabbar&&this.vs[this.av].tabbar.adjustOuterSize();this.vs[this.av].folders&&this.vs[this.av].folders.setSizes();this.vs[this.av].editor&&(_isIE||this.vs[this.av].editor._prepareContent(!0),this.vs[this.av].editor.setSizes());if(this.vs[this.av].layout)(this._isAcc||this._isTabbarCell)&&this.skin=="dhx_skyblue"?(this.vs[this.av].layoutObj.style.width=
parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+2+"px",this.vs[this.av].layoutObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+2+"px"):(this.vs[this.av].layoutObj.style.width=this.vs[this.av].dhxcont.mainCont[this.av].style.width,this.vs[this.av].layoutObj.style.height=this.vs[this.av].dhxcont.mainCont[this.av].style.height),this.vs[this.av].layout.setSizes();if(this.vs[this.av].accordion!=null)this.skin=="dhx_web"?(this.vs[this.av].accordionObj.style.width=
parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+"px",this.vs[this.av].accordionObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+"px"):(this.vs[this.av].accordionObj.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+2+"px",this.vs[this.av].accordionObj.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+2+"px"),this.vs[this.av].accordion.setSizes();this.vs[this.av].dockedCell&&this.vs[this.av].dockedCell.updateNestedObjects();
this.vs[this.av].form&&this.vs[this.av].form.setSizes()}};this.obj.attachStatusBar=function(){if(!this.vs[this.av].sb){var a=document.createElement("DIV");a.className=this._isCell?"dhxcont_sb_container_layoutcell":"dhxcont_sb_container";a.id="sbobj_"+this._genStr(12);a.innerHTML="<div class='dhxcont_statusbar'></div>";this.cv==this.av?this.vs[this.av].dhxcont.insertBefore(a,this.vs[this.av].dhxcont.childNodes[this.vs[this.av].dhxcont.childNodes.length-1]):b.st.appendChild(a);a.setText=function(a){this.childNodes[0].innerHTML=
a};a.getText=function(){return this.childNodes[0].innerHTML};a.onselectstart=function(a){a=a||event;return a.returnValue=!1};this.vs[this.av].sb=a;this.vs[this.av].sbHeight=this.skin=="dhx_web"?41:this.skin=="dhx_skyblue"?23:a.offsetHeight;this.vs[this.av].sbId=a.id;this._doOnAttachStatusBar&&this._doOnAttachStatusBar("init");this.adjust();return this.vs[this._viewRestore()].sb}};this.obj.detachStatusBar=function(){if(this.vs[this.av].sb)this.vs[this.av].sb.setText=null,this.vs[this.av].sb.getText=
null,this.vs[this.av].sb.onselectstart=null,this.vs[this.av].sb.parentNode.removeChild(this.vs[this.av].sb),this.vs[this.av].sb=null,this.vs[this.av].sbHeight=null,this.vs[this.av].sbId=null,this._viewRestore(),this._doOnAttachStatusBar&&this._doOnAttachStatusBar("unload")};this.obj.getFrame=function(){return this.getView()._frame};this.obj.getView=function(a){return this.vs[a||this.av]};this.obj.attachMenu=function(a){if(!this.vs[this.av].menu){var c=document.createElement("DIV");c.style.position=
"relative";c.style.overflow="hidden";c.id="dhxmenu_"+this._genStr(12);this.cv==this.av?this.vs[this.av].dhxcont.insertBefore(c,this.vs[this.av].dhxcont.childNodes[0]):b.st.appendChild(c);typeof a!="object"?this.vs[this.av].menu=new dhtmlXMenuObject(c.id,a||this.skin):(a.parent=c.id,this.vs[this.av].menu=new dhtmlXMenuObject(a));this.vs[this.av].menuHeight=this.skin=="dhx_web"?29:c.offsetHeight;this.vs[this.av].menuId=c.id;this._doOnAttachMenu&&this._doOnAttachMenu("init");this.adjust();return this.vs[this._viewRestore()].menu}};
this.obj.detachMenu=function(){if(this.vs[this.av].menu){var a=document.getElementById(this.vs[this.av].menuId);this.vs[this.av].menu.unload();this.vs[this.av].menu=null;this.vs[this.av].menuId=null;this.vs[this.av].menuHeight=null;a&&a.parentNode.removeChild(a);a=null;this._viewRestore();this._doOnAttachMenu&&this._doOnAttachMenu("unload")}};this.obj.attachToolbar=function(a){if(!this.vs[this.av].toolbar){var c=document.createElement("DIV");c.style.position="relative";c.style.overflow="hidden";c.id=
"dhxtoolbar_"+this._genStr(12);this.cv==this.av?this.vs[this.av].dhxcont.insertBefore(c,this.vs[this.av].dhxcont.childNodes[this.vs[this.av].menu!=null?1:0]):b.st.appendChild(c);typeof a!="object"?this.vs[this.av].toolbar=new dhtmlXToolbarObject(c.id,a||this.skin):(a.parent=c.id,this.vs[this.av].toolbar=new dhtmlXToolbarObject(a));this.vs[this.av].toolbarHeight=c.offsetHeight;this.vs[this.av].toolbarId=c.id;this._doOnAttachToolbar&&this._doOnAttachToolbar("init");this.adjust();var f=this;this.vs[this.av].toolbar.attachEvent("_onIconSizeChange",
function(){f.vs[f.av].toolbarHeight=this.cont.offsetHeight;f.vs[f.av].toolbarId=this.cont.id;f._doOnAttachToolbar&&f._doOnAttachToolbar("iconSizeChange")});this.skin!="dhx_terrace"&&this.vs[this.av].toolbar.callEvent("_onIconSizeChange",[]);return this.vs[this._viewRestore()].toolbar}};this.obj.detachToolbar=function(){if(this.vs[this.av].toolbar){var a=document.getElementById(this.vs[this.av].toolbarId);this.vs[this.av].toolbar.unload();this.vs[this.av].toolbar=null;this.vs[this.av].toolbarId=null;
this.vs[this.av].toolbarHeight=null;a&&a.parentNode.removeChild(a);a=null;this._viewRestore();this._doOnAttachToolbar&&this._doOnAttachToolbar("unload")}};this.obj.attachGrid=function(){if(this._isWindow&&this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.mainCont[this.av].style.border="#a4bed4 1px solid",this._redraw();var a=document.createElement("DIV");a.id="dhxGridObj_"+this._genStr(12);a.style.width="100%";a.style.height="100%";a.cmp="grid";document.body.appendChild(a);this.attachObject(a.id,
!1,!0,!1);this.vs[this.av].grid=new dhtmlXGridObject(a.id);this.vs[this.av].grid.setSkin(this.skin);if(this.skin=="dhx_skyblue"||this.skin=="dhx_black"||this.skin=="dhx_blue")this.vs[this.av].grid.entBox.style.border="0px solid white",this.vs[this.av].grid._sizeFix=2;this.vs[this.av].gridId=a.id;this.vs[this.av].gridObj=a;this.skin=="dhx_terrace"&&(this.adjust(),this.updateNestedObjects(!0));return this.vs[this._viewRestore()].grid};this.obj.attachScheduler=function(a,b,c,g){var g=g||window.scheduler,
h=0;c&&(j=document.getElementById(c))&&(h=1);if(!h){var i=c||'<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div><div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div><div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>',j=document.createElement("DIV");j.id="dhxSchedObj_"+this._genStr(12);j.innerHTML='<div id="'+j.id+'" class="dhx_cal_container" style="width:100%; height:100%;"><div class="dhx_cal_navline"><div class="dhx_cal_prev_button">&nbsp;</div><div class="dhx_cal_next_button">&nbsp;</div><div class="dhx_cal_today_button"></div><div class="dhx_cal_date"></div>'+
i+'</div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div></div>';document.body.appendChild(j.firstChild)}this.attachObject(j.id,!1,!0,!1);this.vs[this.av].sched=g;this.vs[this.av].schedId=j.id;g.setSizes=g.update_view;g.destructor=function(){};g.init(j.id,a,b);return this.vs[this._viewRestore()].sched};this.obj.attachTree=function(a){if(this._isWindow&&this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.mainCont[this.av].style.border="#a4bed4 1px solid",this._redraw();var b=document.createElement("DIV");
b.id="dhxTreeObj_"+this._genStr(12);b.style.width="100%";b.style.height="100%";b.cmp="tree";document.body.appendChild(b);this.attachObject(b.id,!1,!0,!1);this.vs[this.av].tree=new dhtmlXTreeObject(b.id,"100%","100%",a||0);this.vs[this.av].tree.setSkin(this.skin);this.vs[this.av].tree.allTree.childNodes[0].style.marginTop="2px";this.vs[this.av].tree.allTree.childNodes[0].style.marginBottom="2px";this.vs[this.av].treeId=b.id;this.vs[this.av].treeObj=b;this.skin=="dhx_terrace"&&(this.adjust(),this.updateNestedObjects(!0));
return this.vs[this._viewRestore()].tree};this.obj.attachTabbar=function(a){if(this._isWindow&&this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.style.border="none",this.setDimension(this.w,this.h);var b=document.createElement("DIV");b.id="dhxTabbarObj_"+this._genStr(12);b.style.width="100%";b.style.height="100%";b.style.overflow="hidden";b.cmp="tabbar";if(!this._isWindow)b._hideBorders=!0;document.body.appendChild(b);this.attachObject(b.id,!1,!0,!1);if(this._isCell)this.hideHeader(),this._padding=
b._hideBorders=!1;this.vs[this.av].tabbar=new dhtmlXTabBar(b.id,a||"top",this.skin=="dhx_terrace"?null:20);if(!this._isWindow&&this.skin!="dhx_terrace")this.vs[this.av].tabbar._s.expand=!0;this.vs[this.av].tabbar.setSkin(this.skin);this.vs[this.av].tabbar.adjustOuterSize();this.vs[this.av].tabbarId=b.id;this.vs[this.av].tabbarObj=b;this.skin=="dhx_terrace"&&(this.adjust(),this.updateNestedObjects(!0));return this.vs[this._viewRestore()].tabbar};this.obj.attachFolders=function(){if(this._isWindow&&
this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.mainCont[this.av].style.border="#a4bed4 1px solid",this._redraw();var a=document.createElement("DIV");a.id="dhxFoldersObj_"+this._genStr(12);a.style.width="100%";a.style.height="100%";a.style.overflow="hidden";a.cmp="folders";document.body.appendChild(a);this.attachObject(a.id,!1,!0,!1);this.vs[this.av].folders=new dhtmlxFolders(a.id);this.vs[this.av].folders.setSizes();this.vs[this.av].foldersId=a.id;this.vs[this.av].foldersObj=a;return this.vs[this._viewRestore()].folders};
this.obj.attachAccordion=function(){if(this._isWindow&&this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.mainCont[this.av].style.border="#a4bed4 1px solid",this._redraw();var a=document.createElement("DIV");a.id="dhxAccordionObj_"+this._genStr(12);this._padding=!0;if(this.skin=="dhx_web")a.style.left="0px",a.style.top="0px",a.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+"px",a.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+"px";else if(this.skin!=
"dhx_terrace")a.style.left="-1px",a.style.top="-1px",a.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+2+"px",a.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+2+"px";a.style.position="relative";a.cmp="accordion";document.body.appendChild(a);this.attachObject(a.id,!1,!0,!1);this.vs[this.av].accordion=new dhtmlXAccordion(a.id,this.skin);this.vs[this.av].accordion.setSizes();this.vs[this.av].accordionId=a.id;this.vs[this.av].accordionObj=a;
this.skin=="dhx_terrace"&&(this.adjust(),this.updateNestedObjects(!0));return this.vs[this._viewRestore()].accordion};this.obj.attachLayout=function(a,b){if(this._isCell&&this.skin=="dhx_skyblue")this.hideHeader(),this.vs[this.av].dhxcont.style.border="0px solid white",this.adjustContent(this.childNodes[0],0);this._isCell&&this.skin=="dhx_web"&&this.hideHeader();this._padding=!0;var c=document.createElement("DIV");c.id="dhxLayoutObj_"+this._genStr(12);c.style.overflow="hidden";c.style.position="absolute";
c.style.left="0px";c.style.top="0px";c.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+"px";c.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+"px";if((this._isTabbarCell||this._isAcc)&&this.skin=="dhx_skyblue")c.style.left="-1px",c.style.top="-1px",c.style.width=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+2+"px",c.style.height=parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+2+"px";c.dhxContExists=!0;
c.cmp="layout";document.body.appendChild(c);this.attachObject(c.id,!1,!0,!1);this.vs[this.av].layout=new dhtmlXLayoutObject(c,a,b||this.skin);this._isWindow&&this.attachEvent("_onBeforeTryResize",this.vs[this.av].layout._defineWindowMinDimension);this.vs[this.av].layoutId=c.id;this.vs[this.av].layoutObj=c;if(this.skin=="dhx_terrace"){if(this._isCell)this.style.backgroundColor="transparent",this.vs[this.av].dhxcont.style.backgroundColor="transparent",this.hideHeader();this.adjust();this.updateNestedObjects(!0)}return this.vs[this._viewRestore()].layout};
this.obj.attachEditor=function(a){if(this._isWindow&&this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.mainCont[this.av].style.border="#a4bed4 1px solid",this._redraw();var b=document.createElement("DIV");b.id="dhxEditorObj_"+this._genStr(12);b.style.position="relative";b.style.display="none";b.style.overflow="hidden";b.style.width="100%";b.style.height="100%";b.cmp="editor";document.body.appendChild(b);if(this.skin=="dhx_terrace")b._attached=!0;this.attachObject(b.id,!1,!0,!1);this.vs[this.av].editor=
new dhtmlXEditor(b.id,a||this.skin);this.vs[this.av].editorId=b.id;this.vs[this.av].editorObj=b;this.skin=="dhx_terrace"&&(this.adjust(),this.updateNestedObjects(!0));return this.vs[this._viewRestore()].editor};this.obj.attachMap=function(a){var b=document.createElement("DIV");b.id="GMapsObj_"+this._genStr(12);b.style.position="relative";b.style.display="none";b.style.overflow="hidden";b.style.width="100%";b.style.height="100%";b.cmp="gmaps";document.body.appendChild(b);this.attachObject(b.id,!1,
!0,!0);a||(a={center:new google.maps.LatLng(40.719837,-73.992348),zoom:11,mapTypeId:google.maps.MapTypeId.ROADMAP});this.vs[this.av].gmaps=new google.maps.Map(b,a);return this.vs[this.av].gmaps};this.obj.attachObject=function(a,b,c,g){typeof a=="string"&&(a=document.getElementById(a));if(b){a.style.visibility="hidden";a.style.display="";var h=a.offsetWidth,i=a.offsetHeight}this._attachContent("obj",a);if(b&&this._isWindow)a.style.visibility="",this._adjustToContent(h,i);if(this.skin=="dhx_terrace"&&
(this.vs[this.av].menu!=null||this.vs[this.av].toolbar!=null))this.adjust(typeof g=="undefined"||g==!0),this.updateNestedObjects(!0);c||this._viewRestore()};this.obj.detachObject=function(a,b){for(var c=null,g=null,h="tree,grid,layout,tabbar,accordion,folders".split(","),i=0;i<h.length;i++)if(this.vs[this.av][h[i]]){c=this.vs[this.av][h[i]];g=this.vs[this.av][h[i]+"Obj"];if(a){c.unload&&c.unload();for(c.destructor&&c.destructor();g.childNodes.length>0;)g.removeChild(g.childNodes[0]);g.parentNode.removeChild(g);
c=g=null}else document.body.appendChild(g),g.style.display="none";this.vs[this.av][h[i]]=null;this.vs[this.av][h[i]+"Id"]=null;this.vs[this.av][h[i]+"Obj"]=null}if(c!=null&&g!=null)return[c,g];if(a&&this.vs[this.av]._frame)this._detachURLEvents(),this.vs[this.av]._frame=null;for(var j=this.vs[this.av].dhxcont.mainCont[this.av];j.childNodes.length>0;)if(a==!0)j.removeChild(j.childNodes[0]);else{var k=j.childNodes[0];b!=null?(typeof b!="object"&&(b=document.getElementById(b)),b.appendChild(k)):document.body.appendChild(k);
k.style.display="none"}j=b=null};this.obj.appendObject=function(a){typeof a=="string"&&(a=document.getElementById(a));this._attachContent("obj",a,!0)};this.obj.attachHTMLString=function(a){this._attachContent("str",a);for(var b=a.match(/<script[^>]*>[^\f]*?<\/script>/g)||[],c=0;c<b.length;c++){var g=b[c].replace(/<([\/]{0,1})script[^>]*>/g,"");g&&(window.execScript?window.execScript(g):window.eval(g))}};this.obj.attachURL=function(a,b){this._attachContent(b==!0?"urlajax":"url",a,!1);if(this.skin==
"dhx_terrace"&&(this.vs[this.av].menu!=null||this.vs[this.av].toolbar!=null))this.adjust(!0),this.updateNestedObjects(!0);this._viewRestore()};this.obj.adjust=function(a){if(this.skin=="dhx_skyblue"){if(this.vs[this.av].menu){if(this._isWindow||this._isLayout)this.vs[this.av].menu._topLevelOffsetLeft=0,document.getElementById(this.vs[this.av].menuId).style.height="26px",this.vs[this.av].menuHeight=document.getElementById(this.vs[this.av].menuId).offsetHeight,this._doOnAttachMenu&&this._doOnAttachMenu("show");
if(this._isCell)document.getElementById(this.vs[this.av].menuId).className+=" in_layoutcell",this.vs[this.av].menuHeight=25;if(this._isAcc)document.getElementById(this.vs[this.av].menuId).className+=" in_acccell",this.vs[this.av].menuHeight=25;this._doOnAttachMenu&&this._doOnAttachMenu("adjust")}this.vs[this.av].toolbar&&(this._isWindow&&(document.getElementById(this.vs[this.av].toolbarId).className+=" in_window"),this._isLayout&&(document.getElementById(this.vs[this.av].toolbarId).className+=" in_layout"),
this._isCell&&(document.getElementById(this.vs[this.av].toolbarId).className+=" in_layoutcell"),this._isAcc&&(document.getElementById(this.vs[this.av].toolbarId).className+=" in_acccell"),this._isTabbarCell&&(document.getElementById(this.vs[this.av].toolbarId).className+=" in_tabbarcell"))}this.skin=="dhx_web"&&this.vs[this.av].toolbar&&(this._isWindow&&(document.getElementById(this.vs[this.av].toolbarId).className+=" in_window"),this._isLayout&&(document.getElementById(this.vs[this.av].toolbarId).className+=
" in_layout"),this._isCell&&(document.getElementById(this.vs[this.av].toolbarId).className+=" in_layoutcell"),this._isAcc&&(document.getElementById(this.vs[this.av].toolbarId).className+=" in_acccell"),this._isTabbarCell&&(document.getElementById(this.vs[this.av].toolbarId).className+=" in_tabbarcell"));if(this.skin=="dhx_terrace"){var b=0;if(this._isWindow||this._isCell||this._isAcc||this._isTabbarCell)b=14;this._isCell&&this._noHeader&&(b=0);var c=0;if(this._isWindow||this._isCell||this._isAcc||
this._isTabbarCell)c=14;this._isCell&&this._noHeader&&(c=0);var g=a==!0&&!this.vs[this.av].toolbar||this._isLayout?14:0,h=a==!0||this._isLayout?14:0,i=!1;if(this.vs[this.av].menu)document.getElementById(this.vs[this.av].menuId).style.marginLeft=b+"px",document.getElementById(this.vs[this.av].menuId).style.marginRight=b+"px",document.getElementById(this.vs[this.av].menuId).style.marginTop=c+"px",document.getElementById(this.vs[this.av].menuId).style.marginBottom=g+"px",this.vs[this.av].menuHeight=
32+c+g,this._doOnAttachMenu&&this._doOnAttachMenu("show"),i=!0;if(this.vs[this.av].toolbar)c==0&&this.vs[this.av].menu!=null&this._isCell&&(c=14),document.getElementById(this.vs[this.av].toolbarId).style.marginLeft=b+"px",document.getElementById(this.vs[this.av].toolbarId).style.marginRight=b+"px",document.getElementById(this.vs[this.av].toolbarId).style.marginTop=c+"px",document.getElementById(this.vs[this.av].toolbarId).style.marginBottom=h+"px",this.vs[this.av].toolbarHeight=32+c+h,this._doOnAttachToolbar&&
this._doOnAttachToolbar("show"),i=!0}};this.obj._attachContent=function(a,b,c){if(c!==!0){if(this.vs[this.av]._frame)this._detachURLEvents(),this.vs[this.av]._frame=null;for(;this.vs[this.av].dhxcont.mainCont[this.av].childNodes.length>0;)this.vs[this.av].dhxcont.mainCont[this.av].removeChild(this.vs[this.av].dhxcont.mainCont[this.av].childNodes[0])}if(a=="url"){if(this._isWindow&&b.cmp==null&&this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.mainCont[this.av].style.border="#a4bed4 1px solid",this._redraw();
var g=document.createElement("IFRAME");g.frameBorder=0;g.border=0;g.style.width="100%";g.style.height="100%";g.setAttribute("src","javascript:false;");this.vs[this.av].dhxcont.mainCont[this.av].appendChild(g);g.src=b;this.vs[this.av]._frame=g;this._attachURLEvents()}else if(a=="urlajax"){if(this._isWindow&&b.cmp==null&&this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.mainCont[this.av].style.border="#a4bed4 1px solid",this.vs[this.av].dhxcont.mainCont[this.av].style.backgroundColor="#FFFFFF",this._redraw();
var h=this,i=String(this.av).valueOf(),j=function(){var a=h.av;h.av=i;h.attachHTMLString(this.xmlDoc.responseText,this);h.av=a;h._doOnFrameContentLoaded&&h._doOnFrameContentLoaded();this.destructor()},k=new dtmlXMLLoaderObject(j,window);k.dhxWindowObject=this;k.loadXML(b)}else if(a=="obj"){if(this._isWindow&&b.cmp==null&&this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.mainCont[this.av].style.border="#a4bed4 1px solid",this.vs[this.av].dhxcont.mainCont[this.av].style.backgroundColor="#FFFFFF",this._redraw();
this.vs[this.av].dhxcont._frame=null;this.vs[this.av].dhxcont.mainCont[this.av].appendChild(b);this.vs[this.av].dhxcont.mainCont[this.av].style.overflow=c===!0?"auto":"hidden";b.style.display=""}else if(a=="str"){if(this._isWindow&&b.cmp==null&&this.skin=="dhx_skyblue")this.vs[this.av].dhxcont.mainCont[this.av].style.border="#a4bed4 1px solid",this.vs[this.av].dhxcont.mainCont[this.av].style.backgroundColor="#FFFFFF",this._redraw();this.vs[this.av].dhxcont._frame=null;this.vs[this.av].dhxcont.mainCont[this.av].innerHTML=
b}};this.obj._attachURLEvents=function(){var a=this,b=this.vs[this.av]._frame;_isIE?b.onreadystatechange=function(){if(b.readyState=="complete"){try{b.contentWindow.document.body.onmousedown=function(){a._doOnFrameMouseDown&&a._doOnFrameMouseDown()}}catch(c){}try{a._doOnFrameContentLoaded&&a._doOnFrameContentLoaded()}catch(g){}}}:b.onload=function(){try{b.contentWindow.onmousedown=function(){a._doOnFrameMouseDown&&a._doOnFrameMouseDown()}}catch(c){}try{a._doOnFrameContentLoaded&&a._doOnFrameContentLoaded()}catch(g){}}};
this.obj._detachURLEvents=function(){if(_isIE)try{this.vs[this.av]._frame.onreadystatechange=null,this.vs[this.av]._frame.contentWindow.document.body.onmousedown=null,this.vs[this.av]._frame.onload=null}catch(a){}else try{this.vs[this.av]._frame.contentWindow.onmousedown=null,this.vs[this.av]._frame.onload=null}catch(b){}};this.obj.showMenu=function(){if(this.vs[this.av].menu&&this.vs[this.av].menuId&&document.getElementById(this.vs[this.av].menuId).style.display=="none")this.vs[this.av].menuHidden=
!1,this._doOnAttachMenu&&this._doOnAttachMenu("show"),document.getElementById(this.vs[this.av].menuId).style.display="",this._viewRestore()};this.obj.hideMenu=function(){if(this.vs[this.av].menu&&this.vs[this.av].menuId&&document.getElementById(this.vs[this.av].menuId).style.display!="none")document.getElementById(this.vs[this.av].menuId).style.display="none",this.vs[this.av].menuHidden=!0,this._doOnAttachMenu&&this._doOnAttachMenu("hide"),this._viewRestore()};this.obj.showToolbar=function(){if(this.vs[this.av].toolbar&&
this.vs[this.av].toolbarId&&document.getElementById(this.vs[this.av].toolbarId).style.display=="none")this.vs[this.av].toolbarHidden=!1,this._doOnAttachToolbar&&this._doOnAttachToolbar("show"),document.getElementById(this.vs[this.av].toolbarId).style.display="",this._viewRestore()};this.obj.hideToolbar=function(){if(this.vs[this.av].toolbar&&this.vs[this.av].toolbarId&&document.getElementById(this.vs[this.av].toolbarId).style.display!="none")this.vs[this.av].toolbarHidden=!0,document.getElementById(this.vs[this.av].toolbarId).style.display=
"none",this._doOnAttachToolbar&&this._doOnAttachToolbar("hide"),this._viewRestore()};this.obj.showStatusBar=function(){if(this.vs[this.av].sb&&this.vs[this.av].sbId&&document.getElementById(this.vs[this.av].sbId).style.display=="none")this.vs[this.av].sbHidden=!1,this._doOnAttachStatusBar&&this._doOnAttachStatusBar("show"),document.getElementById(this.vs[this.av].sbId).style.display="",this._viewRestore()};this.obj.hideStatusBar=function(){if(this.vs[this.av].sb&&this.vs[this.av].sbId&&document.getElementById(this.vs[this.av].sbId).style.display!=
"none")this.vs[this.av].sbHidden=!0,document.getElementById(this.vs[this.av].sbId).style.display="none",this._doOnAttachStatusBar&&this._doOnAttachStatusBar("hide"),this._viewRestore()};this.obj._dhxContDestruct=function(){var a=this.av,c;for(c in this.vs)this.av=c,this.detachMenu(),this.detachToolbar(),this.detachStatusBar(),this.detachObject(!0),this.vs[c].dhxcont.mainCont[c]=null;for(c in this.vs)this.vs[c].dhxcont.mainCont=null,this.vs[c].dhxcont.innerHTML="",this.vs[c].dhxcont=null,this.vs[c]=
null;this.setActive=this.getView=this.getFrame=this._getSt=this._dhxContDestruct=this._genStr=this._init=this._setPadding=this._viewRestore=this._detachURLEvents=this._attachURLEvents=this._attachContent=this.updateNestedObjects=this.hideCoverBlocker=this.showCoverBlocker=this.coverBlocker=this.adjustContent=this.moveContentTo=this.setMinContentSize=this.adjust=this.show=this.view=this.attachMap=this.attachURL=this.attachHTMLString=this.appendObject=this.detachObject=this.attachObject=this.attachEditor=
this.attachLayout=this.attachAccordion=this.attachFolders=this.attachTabbar=this.attachTree=this.attachScheduler=this.attachGrid=this.hideStatusBar=this.hideToolbar=this.hideMenu=this.showStatusBar=this.showToolbar=this.showMenu=this.detachStatusBar=this.detachToolbar=this.detachMenu=this.attachStatusBar=this.attachToolbar=this.attachMenu=this.vs=null;b.st.innerHTML="";b.st.parentNode.removeChild(b.st);b.st=null;b.setContent=null;b.dhxcont=null;b=b.obj=null;if(dhtmlx.detaches)for(c in dhtmlx.detaches)dhtmlx.detaches[c](this)};
if(dhtmlx.attaches)for(var c in dhtmlx.attaches)this.obj[c]=dhtmlx.attaches[c];return this}
function dhtmlXCalendarObject(a,b){this.i={};this.uid=function(){if(!this.uidd)this.uidd=(new Date).getTime();return this.uidd++};var c=null,d=typeof a=="string"?document.getElementById(a):a;d&&typeof d=="object"&&d.tagName&&String(d.tagName).toLowerCase()!="input"&&(c=d);d=null;if(typeof a!="object"||!a.length)a=[a];for(var e=0;e<a.length;e++)typeof a[e]=="string"&&(a[e]=document.getElementById(a[e])||null),a[e]!=null&&a[e].tagName&&String(a[e].tagName).toLowerCase()=="input"&&(this.i[this.uid()]=
a[e]),a[e]=null;this.skin=b!=null?b:typeof dhtmlx!="undefined"&&typeof dhtmlx.skin=="string"?dhtmlx.skin:"dhx_skyblue";this.setSkin=function(a){this.skin=a;this.base.className="dhtmlxcalendar_container dhtmlxcalendar_skin_"+this.skin;this._ifrSize()};this.base=document.createElement("DIV");this.base.className="dhtmlxcalendar_container";this.base.style.display="none";c!=null?(this._hasParent=!0,c.appendChild(this.base),c=null):document.body.appendChild(this.base);this.setParent=function(a){this._hasParent&&
(typeof a=="object"?a.appendChild(this.base):typeof a=="string"&&document.getElementById(a).appendChild(this.base))};this.setSkin(this.skin);this.base.onclick=function(a){a=a||event;a.cancelBubble=!0};this.loadUserLanguage=function(a){if(this.langData[a]&&(this.lang=a,this.setWeekStartDay(this.langData[this.lang].weekstart),this.msCont))for(var b=0,c=0;c<this.msCont.childNodes.length;c++)for(var d=0;d<this.msCont.childNodes[c].childNodes.length;d++)this.msCont.childNodes[c].childNodes[d].innerHTML=
this.langData[this.lang].monthesSNames[b++]};this.contMonth=document.createElement("DIV");this.contMonth.className="dhtmlxcalendar_month_cont";this.contMonth.onselectstart=function(a){a=a||event;a.cancelBubble=!0;return a.returnValue=!1};this.base.appendChild(this.contMonth);var f=document.createElement("UL");f.className="dhtmlxcalendar_line";this.contMonth.appendChild(f);var g=document.createElement("LI");g.className="dhtmlxcalendar_cell dhtmlxcalendar_month_hdr";g.innerHTML="<div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left\";'></div><span class='dhtmlxcalendar_month_label_month'>Month</span><span class='dhtmlxcalendar_month_label_year'>Year</span><div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right\";'></div>";
f.appendChild(g);var h=this;g.onclick=function(a){var a=a||event,b=a.target||a.srcElement;if(b.className&&b.className.indexOf("dhtmlxcalendar_month_arrow")===0){h._hideSelector();var c=b.parentNode.firstChild==b?-1:1,d=new Date(h._activeMonth);h._drawMonth(new Date(h._activeMonth.getFullYear(),h._activeMonth.getMonth()+c,1,0,0,0,0));h.callEvent("onArrowClick",[d,new Date(h._activeMonth)])}else b.className&&b.className=="dhtmlxcalendar_month_label_month"?(a.cancelBubble=!0,h._showSelector("month",
31,21,"selector_month",!0)):b.className&&b.className=="dhtmlxcalendar_month_label_year"?(a.cancelBubble=!0,h._showSelector("year",42,21,"selector_year",!0)):h._hideSelector()};this.contDays=document.createElement("DIV");this.contDays.className="dhtmlxcalendar_days_cont";this.base.appendChild(this.contDays);this.setWeekStartDay=function(a){a==0&&(a=7);this._wStart=Math.min(Math.max(isNaN(a)?1:a,1),7);this._drawDaysOfWeek()};this._drawDaysOfWeek=function(){if(this.contDays.childNodes.length==0){var a=
document.createElement("UL");a.className="dhtmlxcalendar_line";this.contDays.appendChild(a)}else a=this.contDays.firstChild;var b=this._wStart,c=this.langData[this.lang].daysSNames;c.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var d=0;d<7;d++){if(a.childNodes[d]==null){var e=document.createElement("LI");a.appendChild(e)}else e=a.childNodes[d];e.className="dhtmlxcalendar_cell"+(b>=6?" dhtmlxcalendar_day_weekday_cell":"")+(d==0?"_first":"");e.innerHTML=c[b];++b>7&&(b=1)}this._activeMonth!=
null&&this._drawMonth(this._activeMonth)};this._wStart=this.langData[this.lang].weekstart;this.setWeekStartDay(this._wStart);this.contDates=document.createElement("DIV");this.contDates.className="dhtmlxcalendar_dates_cont";this.base.appendChild(this.contDates);this.contDates.onclick=function(a){var a=a||event,b=a.target||a.srcElement;if(b._date!=null&&!b._css_dis){var c=h._activeDate.getHours(),d=h._activeDate.getMinutes(),e=b._date;if(!h.checkEvent("onBeforeChange")||h.callEvent("onBeforeChange",
[new Date(b._date.getFullYear(),b._date.getMonth(),b._date.getDate(),c,d)])){if(h._activeDateCell!=null)h._activeDateCell._css_date=!1,h._updateCellStyle(h._activeDateCell._q,h._activeDateCell._w);var f=h._hasParent&&h._activeDate.getFullYear()+"_"+h._activeDate.getMonth()!=e.getFullYear()+"_"+e.getMonth();h._nullDate=!1;h._activeDate=new Date(e.getFullYear(),e.getMonth(),e.getDate(),c,d);h._activeDateCell=b;h._activeDateCell._css_date=!0;h._activeDateCell._css_hover=!1;h._lastHover=null;h._updateCellStyle(h._activeDateCell._q,
h._activeDateCell._w);f&&h._drawMonth(h._activeDate);if(h._activeInp&&h.i[h._activeInp])h.i[h._activeInp].value=h._dateToStr(new Date(h._activeDate.getTime()));h._hasParent||h._hide();h.callEvent("onClick",[new Date(h._activeDate.getTime())])}}};this.contDates.onmouseover=function(a){var a=a||event,b=a.target||a.srcElement;if(b._date!=null)b._css_hover=!0,h._updateCellStyle(b._q,b._w),h._lastHover=b};this.contDates.onmouseout=function(){h._clearDayHover()};this._lastHover=null;this._clearDayHover=
function(){if(this._lastHover)this._lastHover._css_hover=!1,this._updateCellStyle(this._lastHover._q,this._lastHover._w),this._lastHover=null};for(e=0;e<6;e++){f=document.createElement("UL");f.className="dhtmlxcalendar_line";this.contDates.appendChild(f);for(var i=0;i<7;i++)g=document.createElement("LI"),g.className="dhtmlxcalendar_cell",f.appendChild(g)}this.contTime=document.createElement("DIV");this.contTime.className="dhtmlxcalendar_time_cont";this.base.appendChild(this.contTime);this.showTime=
function(){if(String(this.base.className).search("dhtmlxcalendar_time_hidden")>0)this.base.className=String(this.base.className).replace(/dhtmlxcalendar_time_hidden/gi,"");this._ifrSize()};this.hideTime=function(){String(this.base.className).search("dhtmlxcalendar_time_hidden")<0&&(this.base.className+=" dhtmlxcalendar_time_hidden");this._ifrSize()};f=document.createElement("UL");f.className="dhtmlxcalendar_line";this.contTime.appendChild(f);g=document.createElement("LI");g.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";
g.innerHTML="<div class='dhtmlxcalendar_time_label'></div><span class='dhtmlxcalendar_label_hours'></span><span class='dhtmlxcalendar_label_colon'>:</span><span class='dhtmlxcalendar_label_minutes'></span>";f.appendChild(g);g.onclick=function(a){var a=a||event,b=a.target||a.srcElement;b.className&&b.className=="dhtmlxcalendar_label_hours"?(a.cancelBubble=!0,h._showSelector("hours",3,115,"selector_hours",!0)):b.className&&b.className=="dhtmlxcalendar_label_minutes"?(a.cancelBubble=!0,h._showSelector("minutes",
59,115,"selector_minutes",!0)):h._hideSelector()};this._activeMonth=null;this._activeDate=new Date;this._activeDateCell=null;this.setDate=function(a){this._nullDate=typeof a=="undefined"||a===""||!a;a instanceof Date||(a=this._strToDate(String(a||"")),a=="Invalid Date"&&(a=new Date));var b=a.getTime();if(!this._isOutOfRange(b))this._activeDate=new Date(b),this._drawMonth(this._nullDate?new Date:this._activeDate),this._updateVisibleHours(),this._updateVisibleMinutes()};this.getDate=function(a){if(this._nullDate)return null;
var b=new Date(this._activeDate.getTime());return a?this._dateToStr(b):b};this._drawMonth=function(a){if(a instanceof Date){isNaN(a.getFullYear())&&(a=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0));this._activeMonth=new Date(a.getFullYear(),a.getMonth(),1,0,0,0,0);this._activeDateCell=null;var b=new Date(this._activeMonth.getTime()),c=b.getDay(),d=c-this._wStart;d<0&&(d+=7);b.setDate(b.getDate()-d);for(var e=a.getMonth(),f=(new Date(this._activeDate.getFullYear(),
this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0)).getTime(),g=0,h=0;h<6;h++)for(var i=this._wStart,j=0;j<7;j++){var t=new Date(b.getFullYear(),b.getMonth(),b.getDate()+g++,0,0,0,0);this.contDates.childNodes[h].childNodes[j].innerHTML=t.getDate();var v=t.getDay(),u=t.getTime();this.contDates.childNodes[h].childNodes[j]._date=new Date(u);this.contDates.childNodes[h].childNodes[j]._q=h;this.contDates.childNodes[h].childNodes[j]._w=j;this.contDates.childNodes[h].childNodes[j]._css_month=
t.getMonth()==e;this.contDates.childNodes[h].childNodes[j]._css_date=!this._nullDate&&u==f;this.contDates.childNodes[h].childNodes[j]._css_weekend=i>=6;this.contDates.childNodes[h].childNodes[j]._css_dis=this._isOutOfRange(u);this.contDates.childNodes[h].childNodes[j]._css_holiday=this._holidays[u]==!0;this._updateCellStyle(h,j);if(u==f)this._activeDateCell=this.contDates.childNodes[h].childNodes[j];++i>7&&(i=1)}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this.langData[this.lang].monthesFNames[a.getMonth()];
this.contMonth.firstChild.firstChild.childNodes[2].innerHTML=a.getFullYear()}};this._updateCellStyle=function(a,b){var c=this.contDates.childNodes[a].childNodes[b],d="dhtmlxcalendar_cell dhtmlxcalendar_cell";d+=c._css_month?"_month":"";d+=c._css_date?"_date":"";d+=c._css_weekend?"_weekend":"";d+=c._css_holiday?"_holiday":"";d+=c._css_dis?"_dis":"";d+=c._css_hover&&!c._css_dis?"_hover":"";c.className=d;c=null};this._initSelector=function(a,b){if(!this._selCover)this._selCover=document.createElement("DIV"),
this._selCover.className="dhtmlxcalendar_selector_cover",this.base.appendChild(this._selCover);if(!this._sel)this._sel=document.createElement("DIV"),this._sel.className="dhtmlxcalendar_selector_obj",this.base.appendChild(this._sel),this._sel.appendChild(document.createElement("TABLE")),this._sel.firstChild.className="dhtmlxcalendar_selector_table",this._sel.firstChild.cellSpacing=0,this._sel.firstChild.cellPadding=0,this._sel.firstChild.border=0,this._sel.firstChild.appendChild(document.createElement("TBODY")),
this._sel.firstChild.firstChild.appendChild(document.createElement("TR")),this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD")),this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD")),this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD")),this._sel.firstChild.firstChild.firstChild.childNodes[0].className="dhtmlxcalendar_selector_cell_left",this._sel.firstChild.firstChild.firstChild.childNodes[1].className="dhtmlxcalendar_selector_cell_middle",
this._sel.firstChild.firstChild.firstChild.childNodes[2].className="dhtmlxcalendar_selector_cell_right",this._sel.firstChild.firstChild.firstChild.childNodes[0].innerHTML="&nbsp;",this._sel.firstChild.firstChild.firstChild.childNodes[2].innerHTML="&nbsp;",this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_left dhtmlxcalendar_selector_cell_left_hover"},this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseout=function(){this.className=
"dhtmlxcalendar_selector_cell_left"},this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_right dhtmlxcalendar_selector_cell_right_hover"},this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_right"},this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick=function(a){a=a||event;a.cancelBubble=!0;h._scrollYears(-1)},this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick=
function(a){a=a||event;a.cancelBubble=!0;h._scrollYears(1)},this._sel._ta={},this._selHover=null,this._sel.onmouseover=function(a){var a=a||event,b=a.target||a.srcElement;if(b._cell===!0&&(h._selHover!=b&&h._clearSelHover(),String(b.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null))b.className+=" dhtmlxcalendar_selector_cell_hover",h._selHover=b},this._sel.onmouseout=function(){h._clearSelHover()},this._sel.appendChild(document.createElement("DIV")),this._sel.lastChild.className=
"dhtmlxcalendar_selector_obj_arrow";if(this._sel._ta[a]!=!0){if(a=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+b;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);for(var c=0,d=0;d<4;d++){var e=document.createElement("UL");e.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(e);for(var f=0;f<3;f++){var g=document.createElement("LI");g.innerHTML=this.langData[this.lang].monthesSNames[c];
g.className="dhtmlxcalendar_selector_cell";e.appendChild(g);g._month=c;g._cell=!0;this._msCells[c++]=g}}this.msCont.onclick=function(a){a=a||event;a.cancelBubble=!0;var b=a.target||a.srcElement;b._month!=null&&(h._hideSelector(),h._updateActiveMonth(),h._drawMonth(new Date(h._activeMonth.getFullYear(),b._month,1,0,0,0,0)),h._doOnSelectorChange())}}if(a=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+b;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);
for(d=0;d<4;d++){e=document.createElement("UL");e.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(e);for(f=0;f<3;f++)g=document.createElement("LI"),g.className="dhtmlxcalendar_selector_cell",g._cell=!0,e.appendChild(g)}this.ysCont.onclick=function(a){a=a||event;a.cancelBubble=!0;var b=a.target||a.srcElement;b._year!=null&&(h._hideSelector(),h._drawMonth(new Date(b._year,h._activeMonth.getMonth(),1,0,0,0,0)),h._doOnSelectorChange())}}if(a=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");
this.hsCont.className="dhtmlxcalendar_area_"+b;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);for(d=c=0;d<4;d++){e=document.createElement("UL");e.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(e);for(f=0;f<6;f++)g=document.createElement("LI"),g.innerHTML=this._fixLength(c,2),g.className="dhtmlxcalendar_selector_cell",e.appendChild(g),g._hours=c,g._cell=!0,this._hsCells[c++]=g}this.hsCont.onclick=function(a){a=a||event;a.cancelBubble=!0;var b=a.target||
a.srcElement;b._hours!=null&&(h._hideSelector(),h._activeDate.setHours(b._hours),h._updateActiveHours(),h._updateVisibleHours(),h._doOnSelectorChange())}}if(a=="minutes"){this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+b;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);for(d=c=0;d<4;d++){e=document.createElement("UL");e.className="dhtmlxcalendar_selector_line";this.rsCont.appendChild(e);for(f=0;f<3;f++)g=document.createElement("LI"),
g.innerHTML=this._fixLength(c,2),g.className="dhtmlxcalendar_selector_cell",e.appendChild(g),g._minutes=c,g._cell=!0,this._rsCells[c]=g,c+=5}this.rsCont.onclick=function(a){a=a||event;a.cancelBubble=!0;var b=a.target||a.srcElement;b._minutes!=null&&(h._hideSelector(),h._activeDate.setMinutes(b._minutes),h._updateActiveMinutes(),h._updateVisibleMinutes(),h._doOnSelectorChange())}}this._sel._ta[a]=!0}};this._showSelector=function(a,b,c,d,e){e===!0&&this._sel!=null&&this._isSelectorVisible()&&a==this._sel._t?
this._hideSelector():(this.skin=="dhx_terrace"&&(b+={month:14,year:27,hours:19,minutes:24}[a],c+={month:8,year:8,hours:14,minutes:14}[a]),(!this._sel||!this._sel._ta[a])&&this._initSelector(a,d),this._selCover.style.display="",this._sel._t=a,this._sel.style.left=b+"px",this._sel.style.top=c+"px",this._sel.style.display="",this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+d,this._doOnSelectorShow(a))};this._doOnSelectorShow=function(a){a=="month"&&this._updateActiveMonth();a=="year"&&
this._updateYearsList(this._activeMonth);a=="hours"&&this._updateActiveHours();a=="minutes"&&this._updateActiveMinutes()};this._hideSelector=function(){if(this._sel)this._sel.style.display="none",this._selCover.style.display="none"};this._isSelectorVisible=function(){return!this._sel?!1:this._sel.style.display!="none"};this._doOnSelectorChange=function(a){this.callEvent("onChange",[new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),this._activeDate.getDate(),this._activeDate.getHours(),
this._activeDate.getMinutes(),this._activeDate.getSeconds()),a])};this._clearSelHover=function(){if(this._selHover)this._selHover.className=String(this._selHover.className.replace(/dhtmlxcalendar_selector_cell_hover/gi,"")),this._selHover=null};this._updateActiveMonth=function(){if(typeof this._msActive!="undefined"&&typeof this._msCells[this._msActive]!="undefined")this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell";this._msActive=this._activeMonth.getMonth();this._msCells[this._msActive].className=
"dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateActiveYear=function(){var a=this._activeMonth.getFullYear();if(this._ysCells[a])this._ysCells[a].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateYearsList=function(a){for(var b in this._ysCells)this._ysCells[b]=null,delete this._ysCells[b];for(var c=12*Math.floor(a.getFullYear()/12),d=0;d<4;d++)for(var e=0;e<3;e++)this.ysCont.childNodes[d].childNodes[e].innerHTML=c,this.ysCont.childNodes[d].childNodes[e]._year=
c,this.ysCont.childNodes[d].childNodes[e].className="dhtmlxcalendar_selector_cell",this._ysCells[c++]=this.ysCont.childNodes[d].childNodes[e];this._updateActiveYear()};this._scrollYears=function(a){var b=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a,c=new Date(b,this._activeMonth.getMonth(),1,0,0,0,0);this._updateYearsList(c)};this._updateActiveHours=function(){if(typeof this._hsActive!="undefined"&&typeof this._hsCells[this._hsActive]!="undefined")this._hsCells[this._hsActive].className=
"dhtmlxcalendar_selector_cell";this._hsActive=this._activeDate.getHours();this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateVisibleHours=function(){this.contTime.firstChild.firstChild.childNodes[1].innerHTML=this._fixLength(this._activeDate.getHours(),2)};this._updateActiveMinutes=function(){if(typeof this._rsActive!="undefined"&&typeof this._rsCells[this._rsActive]!="undefined")this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell";
this._rsActive=this._activeDate.getMinutes();if(typeof this._rsCells[this._rsActive]!="undefined")this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateVisibleMinutes=function(){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this._fixLength(this._activeDate.getMinutes(),2)};this._fixLength=function(a,b){for(;String(a).length<b;)a="0"+String(a);return a};this._dateFormat="";this._dateFormatRE=null;this.setDateFormat=function(a){this._dateFormat=
a;this._dateFormatRE=RegExp(String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var b=a.replace(/%/,"");switch(b){case "n":case "j":case "g":case "G":return"\\d{1,2}";case "m":case "d":case "H":case "i":case "s":case "y":return"\\d{2}";case "Y":return"\\d{4}";case "M":return"("+h.langData[h.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case "F":return"("+h.langData[h.lang].monthesFNames.join("|").toLowerCase()+"){1,}"}return a}),"i")};this.setDateFormat("%Y-%m-%d");this._getInd=function(a,
b){for(var c=0;c<b.length;c++)if(b[c].toLowerCase()==a)return c;return-1};this._strToDate=function(a,b){var b=b||this._dateFormat,c=a.match(/[a-z0-9]{1,}/gi),d=b.match(/%[a-zA-Z]/g);if(!c||c.length!=d.length)return"Invalid Date";for(var e={"%y":1,"%Y":1,"%n":2,"%m":2,"%M":2,"%F":2,"%d":3,"%j":3,"%H":4,"%G":4,"%h":4,"%g":4,"%i":5,"%s":6},f={},g={},i=0;i<d.length;i++)if(typeof e[d[i]]!="undefined"){var j=e[d[i]];f[j]||(f[j]=[],g[j]=[]);f[j].push(c[i]);g[j].push(d[i])}c=[];d=[];for(i=1;i<=6;i++)if(f[i]!=
null)for(var w=0;w<f[i].length;w++)c.push(f[i][w]),d.push(g[i][w]);var t=new Date;t.setDate(1);for(i=0;i<c.length;i++)switch(d[i]){case "%d":case "%j":case "%d":case "%j":case "%n":case "%m":case "%Y":case "%H":case "%G":case "%i":case "%s":if(!isNaN(c[i]))t[{"%d":"setDate","%j":"setDate","%n":"setMonth","%m":"setMonth","%Y":"setFullYear","%H":"setHours","%G":"setHours","%i":"setMinutes","%s":"setSeconds"}[d[i]]](Number(c[i])+(d[i]=="%m"||d[i]=="%n"?-1:0));break;case "%M":case "%F":var v=this._getInd(c[i].toLowerCase(),
h.langData[h.lang][{"%M":"monthesSNames","%F":"monthesFNames"}[d[i]]]);v>=0&&t.setMonth(v);break;case "%y":if(!isNaN(c[i])){var u=Number(c[i]);t.setFullYear(u+(u>50?1900:2E3))}break;case "%g":case "%h":isNaN(c[i])||(u=Number(c[i]),u<=12&&u>=0&&t.setHours(u+(this._getInd("pm",c)>=0?12:0)))}return t};this._dateToStr=function(a,b){if(a instanceof Date)var c=function(a){return String(a).length==1?"0"+String(a):a},d=function(b){switch(b){case "%d":return c(a.getDate());case "%j":return a.getDate();case "%D":return h.langData[h.lang].daysSNames[a.getDay()];
case "%l":return h.langData[h.lang].daysFNames[a.getDay()];case "%m":return c(a.getMonth()+1);case "%n":return a.getMonth()+1;case "%M":return h.langData[h.lang].monthesSNames[a.getMonth()];case "%F":return h.langData[h.lang].monthesFNames[a.getMonth()];case "%y":return c(a.getYear()%100);case "%Y":return a.getFullYear();case "%g":return(a.getHours()+11)%12+1;case "%h":return c((a.getHours()+11)%12+1);case "%G":return a.getHours();case "%H":return c(a.getHours());case "%i":return c(a.getMinutes());
case "%s":return c(a.getSeconds());case "%a":return a.getHours()>11?"pm":"am";case "%A":return a.getHours()>11?"PM":"AM";default:return b}},e=String(b||this._dateFormat).replace(/%[a-zA-Z]/g,d);return e||String(a)};this._updateDateStr=function(a){if(a=="")this.setDate(new Date),this.callEvent("onChange",[null,!0]);else if(this._dateFormatRE&&a.match(this._dateFormatRE)){var b=this._strToDate(a);if(b instanceof Date)this._nullDate=!1,this._activeDate=b,this._drawMonth(this._nullDate?new Date:this._activeDate),
this._updateVisibleMinutes(),this._updateVisibleHours(),this._sel&&this._isSelectorVisible()&&this._doOnSelectorShow(this._sel._t),this._doOnSelectorChange(!0)}};this.setFormatedDate=function(a,b,c,d){var e=this._strToDate(b,a);if(d)return e;this.setDate(e)};this.getFormatedDate=function(a,b){if(this._nullDate)return"";b&&b instanceof Date||(b=new Date(this._activeDate));return this._dateToStr(b,a)};this.show=function(a){if(!a&&this._hasParent)this._show();else if(typeof a=="object"&&typeof a._dhtmlxcalendar_uid!=
"undefined"&&this.i[a._dhtmlxcalendar_uid]==a)this._show(a._dhtmlxcalendar_uid);else{if(typeof a=="undefined")for(var b in this.i)a||(a=b);a&&this._show(a)}};this.hide=function(){this._isVisible()&&this._hide()};this.isVisible=function(){return this._isVisible()};this.draw=function(){this.show()};this.close=function(){this.hide()};this._activeInp=null;this.pos="bottom";this.setPosition=function(a,b){this._py=this._px=null;if(a=="right"||a=="bottom")this.pos=a;else{this.pos="int";if(typeof a!="undefined"&&
!isNaN(a))this.base.style.left=a+"px",this._px=a;if(typeof b!="undefined"&&!isNaN(b))this.base.style.top=b+"px",this._py=b;this._ifrSize()}};this._show=function(a,b){if(b===!0&&this._activeInp==a&&this._isVisible())this._hide();else if(a?(this.pos=="right"?(this.base.style.left=this._getLeft(this.i[a])+this.i[a].offsetWidth-1+"px",this.base.style.top=this._getTop(this.i[a])+"px"):this.pos=="bottom"?(this.base.style.left=this._getLeft(this.i[a])+"px",this.base.style.top=this._getTop(this.i[a])+this.i[a].offsetHeight-
1+"px"):(this.base.style.left=(this._px||0)+"px",this.base.style.top=(this._py||0)+"px"),this._activeInp=a):this._px&&this._py?(this.base.style.left=this._px+"px",this.base.style.top=this._py+"px"):(this.base.style.left="0px",this.base.style.top="0px"),this._hideSelector(),this.base.style.display="",this._ifrSize(),this._ifr)this._ifr.style.display=""};this._hide=function(){this._hideSelector();this.base.style.display="none";this._activeInp=null;if(this._ifr)this._ifr.style.display="none"};this._isVisible=
function(){return this.base.style.display!="none"};this._getLeft=function(a){return this._posGetOffset(a).left};this._getTop=function(a){return this._posGetOffset(a).top};this._posGetOffsetSum=function(a){for(var b=0,c=0;a;)b+=parseInt(a.offsetTop),c+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:b,left:c}};this._posGetOffsetRect=function(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||
c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{top:Math.round(i),left:Math.round(j)}};this._posGetOffset=function(a){return this[a.getBoundingClientRect?"_posGetOffsetRect":"_posGetOffsetSum"](a)};this._rangeActive=!1;this._rangeTo=this._rangeFrom=null;this._rangeSet={};this.setInsensitiveDays=function(a){for(var b=this._extractDates(a),c=0;c<b.length;c++)this._rangeSet[(new Date(b[c].getFullYear(),b[c].getMonth(),b[c].getDate(),0,0,0,0)).getTime()]=
!0;this._drawMonth(this._activeMonth)};this.clearInsensitiveDays=function(){this._clearRangeSet();this._drawMonth(this._activeMonth)};this._holidays={};this.setHolidays=function(a){if(a==null)this._clearHolidays();else if(a!=null)for(var b=this._extractDates(a),c=0;c<b.length;c++)this._holidays[(new Date(b[c].getFullYear(),b[c].getMonth(),b[c].getDate(),0,0,0,0)).getTime()]=!0;this._drawMonth(this._activeMonth)};this._extractDates=function(a){if(typeof a=="string"||a instanceof Date)a=[a];for(var b=
[],c=0;c<a.length;c++)if(typeof a[c]=="string")for(var d=a[c].split(","),e=0;e<d.length;e++)b.push(this._strToDate(d[e]));else a[c]instanceof Date&&b.push(a[c]);return b};this._clearRange=function(){this._rangeActive=!1;this._rangeTo=this._rangeFrom=this._rangeType=null};this._clearRangeSet=function(){for(var a in this._rangeSet)this._rangeSet[a]=null,delete this._rangeSet[a]};this._clearHolidays=function(){for(var a in this._holidays)this._holidays[a]=null,delete this._holidays[a]};this._isOutOfRange=
function(a){if(this._rangeSet[a]==!0)return!0;if(this._rangeActive){if(this._rangeType=="in"&&(a<this._rangeFrom||a>this._rangeTo))return!0;if(this._rangeType=="out"&&a>=this._rangeFrom&&a<=this._rangeTo)return!0;if(this._rangeType=="from"&&a<this._rangeFrom)return!0;if(this._rangeType=="to"&&a>this._rangeTo)return!0}var b=new Date(a);return this._rangeWeek&&this._rangeWeekData[b.getDay()]===!0?!0:this._rangeMonth&&this._rangeMonthData[b.getDate()]===!0?!0:this._rangeYear&&this._rangeYearData[b.getMonth()+
"_"+b.getDate()]===!0?!0:!1};this.clearSensitiveRange=function(){this._clearRange();this._drawMonth(this._activeMonth)};this.setSensitiveRange=function(a,b,c){var d=!1;if(a!=null&&b!=null){a instanceof Date||(a=this._strToDate(a));b instanceof Date||(b=this._strToDate(b));if(a.getTime()>b.getTime())return;this._rangeFrom=(new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0)).getTime();this._rangeTo=(new Date(b.getFullYear(),b.getMonth(),b.getDate(),0,0,0,0)).getTime();this._rangeActive=!0;this._rangeType=
"in";d=!0}if(!d&&a!=null&&b==null)a instanceof Date||(a=this._strToDate(a)),this._rangeFrom=(new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0)).getTime(),this._rangeTo=null,c===!0&&this._rangeFrom++,this._rangeActive=!0,this._rangeType="from",d=!0;if(!d&&a==null&&b!=null)b instanceof Date||(b=this._strToDate(b)),this._rangeFrom=null,this._rangeTo=(new Date(b.getFullYear(),b.getMonth(),b.getDate(),0,0,0,0)).getTime(),c===!0&&this._rangeTo--,this._rangeActive=!0,this._rangeType="to",d=!0;d&&
this._drawMonth(this._activeMonth)};this.setInsensitiveRange=function(a,b){if(a!=null&&b!=null){if(a instanceof Date||(a=this._strToDate(a)),b instanceof Date||(b=this._strToDate(b)),!(a.getTime()>b.getTime()))this._rangeFrom=(new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0)).getTime(),this._rangeTo=(new Date(b.getFullYear(),b.getMonth(),b.getDate(),0,0,0,0)).getTime(),this._rangeActive=!0,this._rangeType="out",this._drawMonth(this._activeMonth)}else a!=null&&b==null?this.setSensitiveRange(null,
a,!0):a==null&&b!=null&&this.setSensitiveRange(b,null,!0)};this.disableDays=function(a,b){if(a=="week"){typeof b!="object"&&typeof b.length=="undefined"&&(b=[b]);if(!this._rangeWeekData)this._rangeWeekData={};for(var c in this._rangeWeekData)this._rangeWeekData[c]=!1,delete this._rangeWeekData[c];for(var d=0;d<b.length;d++)this._rangeWeekData[b[d]]=!0,b[d]==7&&(this._rangeWeekData[0]=!0);this._rangeWeek=!0}if(a=="month"){typeof b!="object"&&typeof b.length=="undefined"&&(b=[b]);if(!this._rangeMonthData)this._rangeMonthData=
{};for(c in this._rangeMonthData)this._rangeMonthData[c]=!1,delete this._rangeMonthData[c];for(d=0;d<b.length;d++)this._rangeMonthData[b[d]]=!0;this._rangeMonth=!0}if(a=="year"){var e=this._extractDates(b);if(!this._rangeYearData)this._rangeYearData={};for(c in this._rangeYearData)this._rangeYearData[c]=!1,delete this._rangeYearData[c];for(d=0;d<e.length;d++)this._rangeYearData[e[d].getMonth()+"_"+e[d].getDate()]=!0;this._rangeYear=!0}this._drawMonth(this._activeMonth)};this.enableDays=function(a){if(a==
"week")this._rangeWeek=!1;if(a=="month")this._rangeMonth=!1;if(a=="year")this._rangeYear=!1;this._drawMonth(this._activeMonth)};this._updateFromInput=function(a){this._nullInInput&&a.value.replace(/\s/g,"").length==0?this.setDate(null):this._updateDateStr(a.value);a=null};this._doOnClick=function(a){var a=a||event,b=a.target||a.srcElement;if(b._dhtmlxcalendar_uid&&b._dhtmlxcalendar_uid!=h._activeInp&&h._isVisible()&&h._activeInp)h._hide();else if(!b._dhtmlxcalendar_uid||!h.i[b._dhtmlxcalendar_uid])h._isSelectorVisible()?
h._hideSelector():!h._hasParent&&h._isVisible()&&h._hide()};this._doOnKeyDown=function(a){a=a||event;if(a.keyCode==27||a.keyCode==13)h._isSelectorVisible()?h._hideSelector():h._isVisible()&&!h._hasParent&&h._hide()};this._doOnInpClick=function(a){var a=a||event,b=a.target||a.srcElement;b._dhtmlxcalendar_uid&&(h._listenerEnabled||h._updateFromInput(b),h._show(b._dhtmlxcalendar_uid,!0))};this._doOnInpKeyUp=function(a){var a=a||event,b=a.target||a.srcElement;a.keyCode!=13&&b._dhtmlxcalendar_uid&&(h._listenerEnabled||
h._updateFromInput(b))};this._doOnUnload=function(){h&&h.unload&&h.unload()};window.addEventListener?(document.body.addEventListener("click",h._doOnClick,!1),window.addEventListener("keydown",h._doOnKeyDown,!1),window.addEventListener("unload",h._doOnUnload,!1)):(document.body.attachEvent("onclick",h._doOnClick),document.body.attachEvent("onkeydown",h._doOnKeyDown),window.attachEvent("onunload",h._doOnUnload));this.attachObj=function(a){typeof a=="string"&&(a=document.getElementById(a));var b=this.uid();
this.i[b]=a;this._attachEventsToObject(b)};this.detachObj=function(a){typeof a=="string"&&(a=document.getElementById(a));var b=a._dhtmlxcalendar_uid;if(this.i[b]!=null)this._detachEventsFromObject(b),this.i[b]._dhtmlxcalendar_uid=null,this.i[b]=null,delete this.i[b]};this._attachEventsToObject=function(a){this.i[a]._dhtmlxcalendar_uid=a;window.addEventListener?(this.i[a].addEventListener("click",h._doOnInpClick,!1),this.i[a].addEventListener("keyup",h._doOnInpKeyUp,!1)):(this.i[a].attachEvent("onclick",
h._doOnInpClick),this.i[a].attachEvent("onkeyup",h._doOnInpKeyUp))};this.enableListener=function(a){window.addEventListener?(a.addEventListener("focus",h._listenerEvFocus,!1),a.addEventListener("blur",h._listenerEvBlur,!1)):(a.attachEvent("onfocus",h._listenerEvFocus),a.attachEvent("onblur",h._listenerEvBlur));a=null};this.disableListener=function(a){a._f0=!1;this._tmListener&&window.clearTimeout(this._tmListener);window.addEventListener?(a.removeEventListener("focus",h._listenerEvFocus,!1),a.removeEventListener("blur",
h._listenerEvBlur,!1)):(a.detachEvent("onfocus",h._listenerEvFocus),a.detachEvent("onblur",h._listenerEvBlur));a=null};this._startListener=function(a){this._tmListener&&window.clearTimeout(this._tmListener);if(typeof a._v1=="undefined")a._v1=a.value;if(a._v1!=a.value)this._updateFromInput(a),a._v1=a.value;if(a._f0)this._tmListener=window.setTimeout(function(){h._startListener(a)},100)};this._listenerEvFocus=function(a){var a=a||event,b=a.target||a.srcElement;b._f0=!0;h._startListener(b);b=null};this._listenerEvBlur=
function(a){var a=a||event,b=a.target||a.srcElement;b._f0=!1;b=null};this._detachEventsFromObject=function(a){window.addEventListener?(this.i[a].removeEventListener("click",h._doOnInpClick,!1),this.i[a].removeEventListener("keyup",h._doOnInpKeyUp,!1)):(this.i[a].detachEvent("onclick",h._doOnInpClick),this.i[a].detachEvent("onkeyup",h._doOnInpKeyUp))};for(var j in this.i)this._attachEventsToObject(j);this.evs={};this.attachEvent=function(a,b){var c=this.uid();this.evs[c]={name:String(a).toLowerCase(),
func:b};return c};this.detachEvent=function(a){if(this.evs[a])this.evs[a].name=null,this.evs[a].func=null,this.evs[a]=null,delete this.evs[a]};this.callEvent=function(a,b){var c=!0,d=String(a).toLowerCase(),b=b||[],e;for(e in this.evs)if(this.evs[e].name==d)var f=this.evs[e].func.apply(this,b),c=c&&f;return c};this.checkEvent=function(a){var b=!1,c=String(a).toLowerCase(),d;for(d in this.evs)b=b||this.evs[d].name==c;return b};this.unload=function(){this.uidd=this.uid=this._lastHover=this._dateFormatRE=
this._dateFormat=this._activeMonth=this._activeInp=this._activeDateCell=this._activeDate=null;this._tmListener&&window.clearTimeout(this._tmListener);this._tmListener=null;window.addEventListener?(document.body.removeEventListener("click",h._doOnClick,!1),window.removeEventListener("keydown",h._doOnKeyDown,!1),window.removeEventListener("unload",h._doOnUnload,!1)):(document.body.detachEvent("onclick",h._doOnClick),document.body.detachEvent("onkeydown",h._doOnKeyDown),window.detachEvent("onunload",
h._doOnKeyDown));this._doOnUnload=this._doOnKeyDown=this._doOnClick=null;for(var a in this.i)this.i[a]._dhtmlxcalendar_uid=null,window.addEventListener?(this.i[a].removeEventListener("click",h._doOnInpClick,!1),this.i[a].removeEventListener("keyup",h._doOnInpKeyUp,!1)):(this.i[a].detachEvent("onclick",h._doOnInpClick),this.i[a].detachEvent("onkeyup",h._doOnInpKeyUp)),this.disableListener(this.i[a]),this.i[a]=null,delete this.i[a];this._doOnInpKeyUp=this._doOnInpClick=this.i=null;for(a in this.evs)this.detachEvent(a);
this.callEvent=this.checkEvent=this.detachEvent=this.attachEvent=this.evs=null;this.contMonth.onselectstart=null;this.contMonth.firstChild.firstChild.onclick=null;this.contMonth.firstChild.firstChild.firstChild.onmouseover=null;this.contMonth.firstChild.firstChild.firstChild.onmouseout=null;this.contMonth.firstChild.firstChild.lastChild.onmouseover=null;for(this.contMonth.firstChild.firstChild.lastChild.onmouseout=null;this.contMonth.firstChild.firstChild.childNodes.length>0;)this.contMonth.firstChild.firstChild.removeChild(this.contMonth.firstChild.firstChild.lastChild);
this.contMonth.firstChild.removeChild(this.contMonth.firstChild.firstChild);this.contMonth.removeChild(this.contMonth.firstChild);this.contMonth.parentNode.removeChild(this.contMonth);for(this.contMonth=null;this.contDays.firstChild.childNodes.length>0;)this.contDays.firstChild.removeChild(this.contDays.firstChild.lastChild);this.contDays.removeChild(this.contDays.firstChild);this.contDays.parentNode.removeChild(this.contDays);this.contDays=null;this.contDates.onclick=null;this.contDates.onmouseover=
null;for(this.contDates.onmouseout=null;this.contDates.childNodes.length>0;){for(;this.contDates.lastChild.childNodes.length>0;)this.contDates.lastChild.lastChild._css_date=null,this.contDates.lastChild.lastChild._css_month=null,this.contDates.lastChild.lastChild._css_weekend=null,this.contDates.lastChild.lastChild._css_hover=null,this.contDates.lastChild.lastChild._date=null,this.contDates.lastChild.lastChild._q=null,this.contDates.lastChild.lastChild._w=null,this.contDates.lastChild.removeChild(this.contDates.lastChild.lastChild);
this.contDates.removeChild(this.contDates.lastChild)}this.contDates.parentNode.removeChild(this.contDates);this.contDates=null;for(this.contTime.firstChild.firstChild.onclick=null;this.contTime.firstChild.firstChild.childNodes.length>0;)this.contTime.firstChild.firstChild.removeChild(this.contTime.firstChild.firstChild.lastChild);this.contTime.firstChild.removeChild(this.contTime.firstChild.firstChild);this.contTime.removeChild(this.contTime.firstChild);this.contTime.parentNode.removeChild(this.contTime);
this._lastHover=this.contTime=null;if(this.msCont){this._msActive=this.msCont.onclick=null;for(a in this._msCells)this._msCells[a]._cell=null,this._msCells[a]._month=null,this._msCells[a].parentNode.removeChild(this._msCells[a]),this._msCells[a]=null;for(this._msCells=null;this.msCont.childNodes.length>0;)this.msCont.removeChild(this.msCont.lastChild);this.msCont.parentNode.removeChild(this.msCont);this.msCont=null}if(this.ysCont){this.ysCont.onclick=null;for(a in this._ysCells)this._ysCells[a]._cell=
null,this._ysCells[a]._year=null,this._ysCells[a].parentNode.removeChild(this._ysCells[a]),this._ysCells[a]=null;for(this._ysCells=null;this.ysCont.childNodes.length>0;)this.ysCont.removeChild(this.ysCont.lastChild);this.ysCont.parentNode.removeChild(this.ysCont);this.ysCont=null}if(this.hsCont){this._hsActive=this.hsCont.onclick=null;for(a in this._hsCells)this._hsCells[a]._cell=null,this._hsCells[a]._hours=null,this._hsCells[a].parentNode.removeChild(this._hsCells[a]),this._hsCells[a]=null;for(this._hsCells=
null;this.hsCont.childNodes.length>0;)this.hsCont.removeChild(this.hsCont.lastChild);this.hsCont.parentNode.removeChild(this.hsCont);this.hsCont=null}if(this.rsCont){this._rsActive=this.rsCont.onclick=null;for(a in this._rsCells)this._rsCells[a]._cell=null,this._rsCells[a]._minutes=null,this._rsCells[a].parentNode.removeChild(this._rsCells[a]),this._rsCells[a]=null;for(this._rsCells=null;this.rsCont.childNodes.length>0;)this.rsCont.removeChild(this.rsCont.lastChild);this.rsCont.parentNode.removeChild(this.rsCont);
this.rsCont=null}if(this._selCover)this._selCover.parentNode.removeChild(this._selCover),this._selCover=null;if(this._sel){for(a in this._sel._ta)this._sel._ta[a]=null;this._sel._ta=null;this._sel._t=null;this._sel.onmouseover=null;for(this._sel.onmouseout=null;this._sel.firstChild.firstChild.firstChild.childNodes.length>0;)this._sel.firstChild.firstChild.firstChild.lastChild.onclick=null,this._sel.firstChild.firstChild.firstChild.lastChild.onmouseover=null,this._sel.firstChild.firstChild.firstChild.lastChild.onmouseout=
null,this._sel.firstChild.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild.lastChild);this._sel.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild);for(this._sel.firstChild.removeChild(this._sel.firstChild.firstChild);this._sel.childNodes.length>0;)this._sel.removeChild(this._sel.lastChild);this._sel.parentNode.removeChild(this._sel);this._sel=null}this.base.onclick=null;this.base.parentNode.removeChild(this.base);this.unload=this.showTime=this.show=
this.setYearsRange=this.setDateFormat=this.setDate=this.hideTime=this.hide=this.enableIframe=this._updateYearsList=this._updateVisibleMinutes=this._updateVisibleHours=this._updateDateStr=this._updateCellStyle=this._updateActiveYear=this._updateActiveMonth=this._updateActiveMinutes=this._updateActiveHours=this._strToDate=this._showSelector=this._show=this._scrollYears=this._posGetOffsetSum=this._posGetOffsetRect=this._posGetOffset=this._isVisible=this._isSelectorVisible=this._initSelector=this._hideSelector=
this._hide=this._ifrSize=this._getTop=this._getLeft=this._fixLength=this._drawMonth=this._doOnSelectorShow=this._doOnSelectorChange=this._clearSelHover=this._clearDayHover=this.base=null;for(a in this)delete this[a];a=h=null};this.setDate(this._activeDate);return this}dhtmlXCalendarObject.prototype.setYearsRange=function(){};dhtmlXCalendarObject.prototype.lang="en";
dhtmlXCalendarObject.prototype.langData={en:{dateformat:"%Y-%m-%d",monthesFNames:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthesSNames:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),daysFNames:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),daysSNames:"Su,Mo,Tu,We,Th,Fr,Sa".split(","),weekstart:1}};
dhtmlXCalendarObject.prototype.enableIframe=function(a){if(a==!0){if(!this._ifr)this._ifr=document.createElement("IFRAME"),this._ifr.frameBorder=0,this._ifr.border=0,this._ifr.setAttribute("src","javascript:false;"),this._ifr.className="dhtmlxcalendar_ifr",this._ifr.onload=function(){this.onload=null;this.contentWindow.document.open("text/html","replace");this.contentWindow.document.write("<html><head><style>html,body{width:100%;height:100%;overflow:hidden;margin:0px;}</style></head><body</body></html>")},
this.base.parentNode.insertBefore(this._ifr,this.base),this._ifrSize()}else if(this._ifr)this._ifr.parentNode.removeChild(this._ifr),this._ifr=null};dhtmlXCalendarObject.prototype._ifrSize=function(){if(this._ifr)this._ifr.style.left=this.base.style.left,this._ifr.style.top=this.base.style.top,this._ifr.style.width=this.base.offsetWidth+"px",this._ifr.style.height=this.base.offsetHeight+"px"};dhtmlxCalendarObject=dhtmlXCalendarObject;
function dhtmlXColorPickerInput(a){typeof a!="object"&&(a=document.getElementById(a));var b=a,c=b.getAttribute("colorbox"),d=b.getAttribute("customcolors"),e=b.getAttribute("selectonclick"),f=b.getAttribute("fullview"),g=b.getAttribute("selectedcolor"),h=b;if(c){var i=document.createElement("DIV");i.style.width=b.offsetWidth+"px";i.style.height=b.offsetHeight+"px";b.style.width=b.offsetWidth-b.offsetHeight-2;b.parentNode.insertBefore(i,b);i.style.position="relative";h=document.createElement("DIV");
i.appendChild(h);i.appendChild(b);h.className="cs_colorBox";b.className+=" cs_colorInput";h.style.width=h.style.height=b.offsetHeight-(document.all?0:2)+"px";b.style.left=b.offsetHeight+2+"px"}var j=new dhtmlXColorPicker(null,e,d,!0,f);g&&j.setColor(g);j.linkToObjects=[h,b,b];return j}
function dhtmlXColorPicker(a,b,c,d,e){if(document.all)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(f){}this._cc=c;if(!a)a=document.createElement("DIV"),a.style.position="absolute",document.body.appendChild(a),a._dhx_remove=!0;this.container=typeof a!="object"?document.getElementById(a):a;dhtmlxEventable(this);this.skinName=dhtmlx.skin||"";this.ready=!1;this.hideOnInit=d||!1;this.linkToObjects=[];this.imgURL=dhtmlx.image_path||window.dhx_globalImgPath||"";this.hideSelfOnSelect=!0;this.hex=
"000000";this.h=100;this.s=0.9;this.v=0.1;this.old_sat=this.old_hue=this.b=this.g=this.r=0;this.fullview=e||!1;this.customColorsCount=!this.fullview?10:8;this.language=null;this.elements=[];this.customColors=[];this.restoreFrom=null;this.fullview?this.colorSelectW=this.colorSelectH=255:(this.colorSelectH=119,this.colorSelectW=209);this.isClickOnly=b||!1;if(window.cs_dechex==null){var g=[0,1,2,3,4,5,6,7,8,9,"a","b","c","d","e","f"];window.cs_dechex=[];for(var h=0;h<256;h++){var i=g[h>>4].toString()+
g[h&15].toString();i.length<2&&(i="0"+i);window.cs_dechex[h]=i}}defLeng={langname:"en-us",labelHue:"Hue",labelSat:"Sat",labelLum:"Lum",labelRed:"Red",labelGreen:"Green",labelBlue:"Blue",btnAddColor:"Add to Custom Colors",btnSelect:"Select",btnCancel:"Cancel"};window.dhtmlxColorPickerObjects?window.dhtmlxColorPickerObjects[window.dhtmlxColorPickerObjects.length]=this:window.dhtmlxColorPickerObjects=[this];if(!window.dhtmlxColorPickerLangModules)window.dhtmlxColorPickerLangModules={};window.dhtmlxColorPickerLangModules["en-us"]=
defLeng;return this}
dhtmlXColorPicker.prototype.generate=function(){X=document.compatMode!="BackCompat"?"X":"";if(this.fullview)a="<div class='dhtmlxcolorpicker"+(this.skinName!=""?"_"+this.skinName:"")+"' csid='cs_Content' style='display:none;'>",document.all&&this.container.style.position=="absolute"&&(a+="<iframe src='"+(this.imgURL||"")+"blank.html' style='position:absolute; top:0px; left:0px; width:320px;  height:"+(this._cc?454:407)+"px; z-index:-1;'></iframe>"),a+="<table cellpadding='0' cellspacing='0'>",a+=
"<tr><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"left_top.gif);'></td><td style='height:2px;background:url("+(this.imgURL||"")+"top.gif);'></td><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"right_top.gif);'></td></tr>",a+="<tr><td style='width:2px;background:url("+(this.imgURL||"")+"left.gif);'></td><td style='width:316px;height:"+(this._cc?446:392)+"px;background:#E6E5E5;'>",a+="<table class='cs_ContentTable' csid='cs_ContentTable' cellpadding='0px' cellspacing='0px'>",
a+="<tr>",a+="<td><div class='cs_SelectorDiv' csid='cs_SelectorDiv'><div class='cs_SelectorVer' csid='cs_SelectorVer' style='left:100px;top:0px;'></div><div class='cs_SelectorHor' csid='cs_SelectorHor' style='left:0px;top:100px;'></div></div></td>",a+="<td><div class='cs_LumSelect' csid='cs_LumSelect'><div class='cs_LumSelectArrow' csid='cs_LumSelectArrow' style='left:16px;top:124px;'></div><div class='cs_LumSelectLine' csid='cs_LumSelectLine' style='left:0px;top:0px;'></div></div></td>",a+="</tr>",
a+="<tr><td style='padding-top:10px;' colspan='2'>",a+="<table class='cs_ColorArea' cellpadding='0px' cellspacing='0px'>",a+="<tr><td rowspan='3'><div class='cs_EndColor' csid='cs_EndColor'></div></td><td valign='top' style='text-align:center;width:80px;'># <input csid='cs_Hex' class='cs_Hex'></td><td>"+this.language.labelHue+":</td><td><input tabindex='1' class='cs_Input' csid='cs_InputHue' value='' /></td><td>"+this.language.labelRed+":</td><td><input tabindex='4' class='cs_Input' csid='cs_InputRed' value='' /></td></tr>",
a+="<tr><td></td><td>"+this.language.labelSat+":</td><td><input tabindex='2' class='cs_Input' csid='cs_InputSat' value='' /></td><td>"+this.language.labelGreen+":</td><td><input tabindex='4' class='cs_Input' csid='cs_InputGreen' value='' /></td></tr>",a+="<tr><td></td><td>"+this.language.labelLum+":</td><td><input tabindex='2' class='cs_Input' csid='cs_InputLum' value='' /></td><td>"+this.language.labelBlue+":</td><td><input tabindex='4' class='cs_Input' csid='cs_InputBlue' value='' /></td></tr>",
this._cc&&(a+="<tr><td>",a+="<div class='cs_CustomColors' csid='cs_CustomColors'></div>",a+="</td><td></td><td colspan='4' valign='top'><input tabindex='7' class='cs_CustomColorAdd' csid='cs_CustomColorAdd' type='button' value='"+this.language.btnAddColor+"'></td></tr>"),a+="</table>",a+="</td></tr>",a+="</table>",a+="<table cellpadding='0' cellspacing='0' style='width:100%;'><tr><td style='height:49px;background:url("+(this.imgURL||"")+"buttons_panel.gif);'><input tabindex='9' class='cs_ButtonCancel' csid='cs_ButtonCancel' type='button' value='"+
this.language.btnCancel+"' /><input tabindex='8' class='cs_ButtonOk' csid='cs_ButtonOk' type='button' value='"+this.language.btnSelect+"' /></td></tr></table>";else{var a="<div class='dhtmlxcolorpicker"+(this.skinName!=""?"_"+this.skinName:"")+"' csid='cs_Content' style='display:none;'>";document.all&&this.container.style.position=="absolute"&&(a+="<iframe src='"+(this.imgURL||"")+"blank.html' frameBorder='0' style='position:absolute; top:0px; left:0px; width:252px;  height:"+(this._cc?300:244)+"px; z-index:-1;'></iframe>");
a+="<table cellpadding='0' cellspacing='0'>";a+="<tr><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"left_top.gif);'></td><td style='height:2px;background:url("+(this.imgURL||"")+"top.gif);'></td><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"right_top.gif);'></td></tr>";a+="<tr><td style='width:2px;background:url("+(this.imgURL||"")+"left.gif);'></td><td style='width:"+(document.all?247:243)+"px;height:"+(this._cc?281:240)+"px;'>";a+="<table class='cs_ContentTable' csid='cs_ContentTable' cellpadding='0px' cellspacing='0px'>";
a+="<tr>";a+="<td><div class='cs_SelectorDiv_Mini' csid='cs_SelectorDiv'><div class='cs_SelectorVer' csid='cs_SelectorVer' style='left:100px;top:0px;'></div><div class='cs_SelectorHor' csid='cs_SelectorHor' style='left:0px;top:100px;'></div></div></td>";a+="<td><div class='cs_LumSelect_Mini' csid='cs_LumSelect'><div csid='cs_LumSelectArrow'></div><div class='cs_LumSelectLine' csid='cs_LumSelectLine' style='left:0px;top:0px;'></div></div></td>";a+="</tr>";a+="<tr><td style='padding-top:10px;' colspan='2'>";
a+="<table class='cs_ColorArea_Mini' cellpadding='0px' cellspacing='0px'>";a+="<tr><td rowspan='2' valign='top' style='text-align:left;'><div class='cs_EndColor_Mini' csid='cs_EndColor' ></div></td><td>"+this.language.labelHue+":</td><td><input tabindex='1' class='cs_Input_Mini"+X+"' csid='cs_InputHue' value='' /></td><td>"+this.language.labelRed+":</td><td><input tabindex='4' class='cs_Input_Mini"+X+"' csid='cs_InputRed' value='' /></td></tr>";a+="<tr><td>"+this.language.labelSat+":</td><td><input tabindex='2' class='cs_Input_Mini"+
X+"' csid='cs_InputSat' value='' /></td><td>"+this.language.labelGreen+":</td><td><input tabindex='4' class='cs_Input_Mini"+X+"' csid='cs_InputGreen' value='' /></td></tr>";a+="<tr><td style='vertical-align:top;width:80px;text-align:left;'># <input csid='cs_Hex' class='cs_Hex_Mini"+X+"'></td><td>"+this.language.labelLum+":</td><td><input tabindex='2' class='cs_Input_Mini"+X+"' csid='cs_InputLum' value='' /></td><td>"+this.language.labelBlue+":</td><td><input tabindex='4' class='cs_Input_Mini"+X+"' csid='cs_InputBlue' value='' /></td></tr>";
this._cc&&(a+="<tr><td colspan='6'><input tabindex='7' class='cs_CustomColorAdd_Mini' csid='cs_CustomColorAdd' type='button' value='"+this.language.btnAddColor+"'></td></tr>",a+="<tr><td colspan='6'><div class='cs_CustomColors_Mini' csid='cs_CustomColors'></div></td></tr>");a+="</table>";a+="</td></tr>";a+="</table>";a+="<table class='cs_ButtonsPanel' cellpadding='0' cellspacing='0' style='width:100%;'><tr><td style='width:100%;'><input tabindex='9' class='cs_ButtonCancel' csid='cs_ButtonCancel' type='button' value='"+
this.language.btnCancel+"' /><input tabindex='8' class='cs_ButtonOk' csid='cs_ButtonOk' type='button' value='"+this.language.btnSelect+"' /></td></tr></table>"}a+="</td><td style='width:2px;background:url("+(this.imgURL||"")+"right.gif);'></td></tr>";a+="<tr><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"left_bottom.gif);'></td><td style='height:2px;background:url("+(this.imgURL||"")+"bottom.gif);'></td><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"right_bottom.gif);'></td></tr>";
a+="</table>";a+="</div>";this.container.style.width=this.fullview?"320px":"252px";this.container.innerHTML=a;this._initCsIdElement();this.elements.cs_SelectorDiv.style.backgroundImage=this.fullview?"url("+(this.imgURL||"")+"color.png)":"url("+(this.imgURL||"")+"colormini.png)";this.elements.cs_SelectorDiv.z=this;this.elements.cs_LumSelect.z=this;this.elements.cs_LumSelectArrow.z=this;this.z=this;this._drawLum();this._colorizeLum(this.old_hue,this.old_sat);this._initEvents();this._cc&&this._initCustomColors();
this.ColorNum=0;this.restoreFromHSV();this._drawValues()};dhtmlXColorPicker.prototype._initCsIdElement=function(a){if(a==null)a=this.container;for(var b=a.childNodes,c=b.length,d=0;d<c;d++)if(b[d].nodeType==1){var e=b[d].getAttribute("csid");e!==null&&(this.elements[e]=b[d]);b[d].childNodes.length>0&&this._initCsIdElement(b[d])}};
dhtmlXColorPicker.prototype._initEvents=function(){this.elements.cs_SelectorDiv.onmousedown=this._startMoveColor;this.elements.cs_SelectorDiv.ondblclick=this.clickOk;this.elements.cs_LumSelect.onmousedown=this._startMoveLum;this.elements.cs_LumSelect.ondblclick=this.clickOk;this.elements.cs_LumSelectArrow.onmousedown=this._startMoveLum;if(this._cc)this.elements.cs_CustomColorAdd.z=this,this.elements.cs_CustomColorAdd.onclick=this.addCustomColor,this.elements.cs_CustomColorAdd.onmouseover=this.hoverButton,
this.elements.cs_CustomColorAdd.onmouseout=this.normalButton;for(var a="cs_InputHue,cs_InputRed,cs_InputSat,cs_InputGreen,cs_InputLum,cs_InputBlue".split(","),b=0;b<a.length;b++)this.elements[a[b]].z=this,this.elements[a[b]].onchange=b%2?this._changeValueRGB:this._changeValueHSV;this.elements.cs_Hex.z=this;this.elements.cs_Hex.onchange=this._changeValueHEX;this.elements.cs_ButtonOk.z=this;this.elements.cs_ButtonOk.onclick=this.clickOk;this.elements.cs_ButtonOk.onmouseover=this.hoverButton;this.elements.cs_ButtonOk.onmouseout=
this.normalButton;this.elements.cs_ButtonCancel.z=this;this.elements.cs_ButtonCancel.onclick=this.clickCancel;this.elements.cs_ButtonCancel.onmouseover=this.hoverButton;this.elements.cs_ButtonCancel.onmouseout=this.normalButton};dhtmlXColorPicker.prototype.resetHandlers=function(){};dhtmlXColorPicker.prototype.clickOk=function(){var a=this.z,b=a.getSelectedColor();a.callEvent("onSelect",[b[0]]);a.hideSelfOnSelect&&a.hide()};
dhtmlXColorPicker.prototype.clickCancel=function(){var a=this.z;a.callEvent("onCancel",[]);this.z.hideSelfOnSelect&&this.z.hide()};
dhtmlXColorPicker.prototype._setCrossPos=function(a){var b=this.z,c=b._getOffset(this.elements.cs_SelectorDiv),d=a.clientY-c[0];if(d<0)d=0;else if(d>this.colorSelectH)d=this.colorSelectH;var e=a.clientX-c[1];if(e<0)e=0;else if(e>this.colorSelectW)e=this.colorSelectW;b.elements.cs_SelectorVer.style.left=e+"px";b.elements.cs_SelectorHor.style.top=d+"px";var f=e==this.colorSelectW?0:360*e/this.colorSelectW,g=1-d/this.colorSelectH;return[f,g]};
dhtmlXColorPicker.prototype._getScrollers=function(){return[document.body.scrollLeft||document.documentElement.scrollLeft,document.body.scrollTop||document.documentElement.scrollTop]};dhtmlXColorPicker.prototype._setLumPos=function(a){var b=this.z,c=b._getOffset(b.elements.cs_LumSelect),d=a.clientY-c[0]-4;d<-3&&(d=-3);d>this.colorSelectH-4&&(d=this.colorSelectH-4);b.elements.cs_LumSelectArrow.style.top=d+"px";b.elements.cs_LumSelectLine.style.top=d+4+"px";var e=(d+3)/this.colorSelectH;return e};
dhtmlXColorPicker.prototype._startMoveColor=function(a){var b=this.z;a==null&&(a=event);b.elements.cs_SelectorDiv.onmousedown=null;b.b_move=document.body.onmousemove;b.b_up=document.body.onmouseup;var c=b;document.body.onmousemove=function(a){a==null&&(a=event);c._mouseMoveColor(a)};document.body.onmouseup=function(a){a==null&&(a=event);c._stopMoveColor(a);c=null};b.elements.cs_SelectorDiv.onmousemove=b._mouseMoveColor;b.elements.cs_SelectorDiv.onmouseup=b._stopMoveColor;var d=b._setCrossPos(a);b.h=
d[0];b.s=d[1];var e=b._calculateColor();b._colorizeLum(e[0],e[1])};dhtmlXColorPicker.prototype._mouseMoveColor=function(a){var b=this.z;a==null&&(a=event);var c=b._setCrossPos(a);if(!b.isClickOnly){b.h=c[0];b.s=c[1];var d=b._calculateColor();b._colorizeLum(d[0],d[1])}};
dhtmlXColorPicker.prototype._stopMoveColor=function(a){var b=this.z;a==null&&(a=event);b.elements.cs_SelectorDiv.onmousedown=b._startMoveColor;b.elements.cs_SelectorDiv.onmousemove=null;b.elements.cs_SelectorDiv.onmouseup=null;document.body.onmousemove=b.b_move;document.body.onmouseup=b.b_up;var c=b._setCrossPos(a);b.h=c[0];b.s=c[1];var d=b._calculateColor();b._colorizeLum(d[0],d[1])};
dhtmlXColorPicker.prototype._startMoveLum=function(a){var b=this.z;a==null&&(a=event);b.elements.cs_LumSelect.onmousedown=null;b.elements.cs_LumSelectArrow.onmousedown=null;b.elements.cs_LumSelect.onmousemove=b._mouseMoveLum;b.elements.cs_LumSelect.onmouseup=b._stopMoveLum;b.b_move=document.body.onmousemove;b.b_up=document.body.onmouseup;b.b_selstart=document.body.onselectstart;var c=b;document.body.onmousemove=function(a){a==null&&(a=event);c._mouseMoveLum(a)};document.body.onmouseup=function(a){a==
null&&(a=event);c._stopMoveLum(a);c=null};document.body.onselectstart=function(){return!1};b.v=b._setLumPos(a);b._calculateColor()};dhtmlXColorPicker.prototype._mouseMoveLum=function(a){var b=this.z;a==null&&(a=event);b.v=b._setLumPos(a);b.isClickOnly||b._calculateColor()};
dhtmlXColorPicker.prototype._stopMoveLum=function(a){var b=this.z;a==null&&(a=event);b.elements.cs_LumSelect.onmousedown=b._startMoveLum;b.elements.cs_LumSelectArrow.onmousedown=b._startMoveLum;b.elements.cs_LumSelect.onmousemove=null;b.elements.cs_LumSelect.onmouseup=null;b.v=b._setLumPos(a);b._calculateColor();document.body.onmousemove=b.b_move;document.body.onmouseup=b.b_up;document.body.onselectstart=b.b_selstart};
dhtmlXColorPicker.prototype._getOffset=function(a){var b=this._getOffsetTop(a),c=this._getOffsetLeft(a),d=this._getScrollers();return[b-d[1],c-d[0]]};dhtmlXColorPicker.prototype._getOffsetTop=function(a){var b=0;a.offsetParent&&(b+=a.offsetTop+this._getOffsetTop(a.offsetParent));return b};dhtmlXColorPicker.prototype._getOffsetLeft=function(a){var b=0;a.offsetParent&&(b+=a.offsetLeft+this._getOffsetLeft(a.offsetParent));return b};
dhtmlXColorPicker.prototype._calculateColor=function(){if(this.restoreFrom=="RGB")var a=[this.r,this.g,this.b];else a=this._hsv2rgb(this.h,this.s,1-this.v),this.r=a[0],this.g=a[1],this.b=a[2];this.hex=this._getColorHEX(a);this.elements.cs_EndColor.style.backgroundColor="#"+this.hex;this._drawValues();this.restoreFrom=null;return[this.h,this.s,1-this.v]};
dhtmlXColorPicker.prototype._drawValues=function(){this.elements.cs_Hex.value=this.hex;this.elements.cs_InputHue.value=Math.floor(this.h);this.elements.cs_InputSat.value=Math.floor(this.s*100);this.elements.cs_InputLum.value=Math.floor((1-this.v)*100);this.elements.cs_InputRed.value=Math.floor(this.r);this.elements.cs_InputGreen.value=Math.floor(this.g);this.elements.cs_InputBlue.value=Math.floor(this.b)};
dhtmlXColorPicker.prototype.saveColor=function(a,b){var c=new Date,d=c.valueOf()+26784E5,c=new Date(d),e="color_"+b+"="+a+"; expires="+c.toGMTString();document.cookie=e};dhtmlXColorPicker.prototype.restoreColor=function(a){var b=!1,c="color_"+a;if(document.cookie.length>0){var d=document.cookie.indexOf(c+"=");if(d!=-1){var e=document.cookie.indexOf(";",d);if(e==-1)e=document.cookie.length;var f=document.cookie.indexOf("=",d)+1,b=document.cookie.substr(f,e-f)}}return b};
dhtmlXColorPicker.prototype._hsv2rgb=function(a,b,c){Hi=Math.floor(a/60)%6;f=a/60-Hi;p=c*(1-b);q=c*(1-f*b);t=c*(1-(1-f)*b);var d=0,e=0,f=0;switch(Hi){case 0:d=c;e=t;f=p;break;case 1:d=q;e=c;f=p;break;case 2:d=p;e=c;f=t;break;case 3:d=p;e=q;f=c;break;case 4:d=t;e=p;f=c;break;case 5:d=c,e=p,f=q}d=Math.floor(d*255);e=Math.floor(e*255);f=Math.floor(f*255);return[d,e,f]};
dhtmlXColorPicker.prototype._rgb2hsv=function(a,b,c){R=a/255;G=b/255;B=c/255;var d=Math.max(R,G,B),e=Math.min(R,G,B),f=d,g=d==0?0:1-e/d,h=0;d==e?h=0:d==R&&G>=B?h=60*(G-B)/(d-e)+0:d==R&&G<B?h=60*(G-B)/(d-e)+360:d==G?h=60*(B-R)/(d-e)+120:d==B&&(h=60*(R-G)/(d-e)+240);return[h,g,f]};
dhtmlXColorPicker.prototype._drawLum=function(){for(var a=this.colorSelectH,b=!this.fullview?30:64,c=!this.fullview?8:4,d=0;d<b;d++){var e=document.createElement("div"),f=this._dec2hex(a);e.style.backgroundColor="#"+f+f+f;e.className="cs_LumElement";a-=c;this.elements.cs_LumSelect.appendChild(e)}};
dhtmlXColorPicker.prototype._colorizeLum=function(a,b){this.old_hue=a;this.old_sat=b;for(var c=255,d=!this.fullview?8:4,e=this.elements.cs_LumSelect.childNodes.length,f=2;f<e;f++){var g=c>255?1:c/255,h=this._hsv2rgb(a,b,g),h="#"+this._getColorHEX(h);this.elements.cs_LumSelect.childNodes[f].style.backgroundColor=h;c-=d}this.callEvent("onChange",[this.getSelectedColor()])};dhtmlXColorPicker.prototype._dec2hex=function(a){return window.cs_dechex[a]||"00"};
dhtmlXColorPicker.prototype._hex2dec=function(a){return parseInt(a,16)};
dhtmlXColorPicker.prototype._initCustomColors=function(){for(var a=this.elements.cs_CustomColors,b=0;b<this.customColorsCount;b++){var c=document.createElement("div");c.className=this.fullview?"cs_CustomColor":"cs_CustomColor_Mini";c.color_num=b;if(document.all)navigator.appName=="Opera"?this.fullview?(c.style.width="14px",c.style.height="14px"):(c.style.width="18px",c.style.height="18px"):this.fullview?(c.style.width="16px",c.style.height="16px"):(c.style.width=document.compatMode!="BackCompat"?
"18px":"20px",c.style.height="20px");c.z=this;c.onclick=this._selectCustomColor;c.ondblclick=this.clickOk;var d=this.restoreColor(b)||"0,0,0";c.color=d;var e=d.split(",");c.style.backgroundColor="#"+this._getColorHEX(e);this.customColors.push(c);a.appendChild(c)}};
dhtmlXColorPicker.prototype._reinitCustomColors=function(){for(var a=this.elements.cs_CustomColors,b=0;b<this.customColorsCount;b++){var c=this.customColors[b],d=this.restoreColor(b)||"0,0,0";c.color=d;var e=d.split(",");c.style.backgroundColor="#"+this._getColorHEX(e);this.customColors[b]=c}};dhtmlXColorPicker.prototype._getColorHEX=function(a){var b=this._dec2hex(a[0]),c=this._dec2hex(a[1]),d=this._dec2hex(a[2]);return b+c+d};
dhtmlXColorPicker.prototype._selectCustomColor=function(a){a==null&&(a=event);var b=this.z;if(!this.selected){for(var c=0;c<b.customColors.length;c++)b.customColors[c].style.border="1px solid gray";this.style.border="1px dashed black";this.selected=!0;if(b.selectedColor!=null)b.customColors[b.selectedColor].style.border="1px solid gray",b.customColors[b.selectedColor].selected=!1}b.selectedColor=this.color_num;b.ColorNum=this.color_num;var d=this.color.split(",");b.r=d[0];b.g=d[1];b.b=d[2];b.restoreFromRGB()};
dhtmlXColorPicker.prototype.addCustomColor=function(){var a=this.z;if(a.selectedColor!=null){var b=a.customColors[a.selectedColor],c=a.selectedColor;b.style.border="1px solid gray";a.selectedColor=null}else b=a.customColors[a.ColorNum],c=a.ColorNum,b.style.border="1px solid gray";var d=a.r+","+a.g+","+a.b;a.saveColor(d,c);b.color=d;a.ColorNum=a.ColorNum==9?0:a.ColorNum+1;a.customColors[a.ColorNum].style.border="1px dashed red";b.style.backgroundColor=a.elements.cs_EndColor.style.backgroundColor};
dhtmlXColorPicker.prototype.restoreFromRGB=function(){this.restoreFrom="RGB";var a=this._rgb2hsv(this.r,this.g,this.b);this.h=a[0];this.s=a[1];this.v=1-a[2];this.ready&&this.redraw()};dhtmlXColorPicker.prototype.restoreFromHSV=function(){this.restoreFrom="HSV";var a=this._hsv2rgb(this.h,this.s,this.v);this.r=a[0];this.g=a[1];this.b=a[2];this.redraw()};
dhtmlXColorPicker.prototype.restoreFromHEX=function(){this.r=this._hex2dec(this.hex.substr(0,2));this.g=this._hex2dec(this.hex.substr(2,2));this.b=this._hex2dec(this.hex.substr(4,2));this.restoreFromRGB()};
dhtmlXColorPicker.prototype.redraw=function(){var a=this.colorSelectW*this.h/360,b=(1-this.s)*this.colorSelectH,c=this.v*this.colorSelectH;this.elements.cs_SelectorHor.style.top=b+"px";this.elements.cs_SelectorVer.style.left=a+"px";this.elements.cs_LumSelectArrow.style.top=c-3+"px";this.elements.cs_LumSelectLine.style.top=c+1+"px";var d=this._calculateColor();this._colorizeLum(d[0],d[1])};
dhtmlXColorPicker.prototype._changeValueHSV=function(){var a=this.z,b=parseInt(a.elements.cs_InputHue.value)||0,c=parseInt(a.elements.cs_InputSat.value)||0,d=parseInt(a.elements.cs_InputLum.value)||0;if(b<0||b>359)b=0;if(c<0||c>100)c=0;if(d<0||d>100)d=0;a.elements.cs_InputHue.value=b;a.elements.cs_InputSat.value=c;a.elements.cs_InputLum.value=d;a.h=b;a.s=c/100;a.v=1-d/100;a.restoreFromHSV()};
dhtmlXColorPicker.prototype._changeValueRGB=function(){var a=this.z,b=parseInt(a.elements.cs_InputRed.value)||0,c=parseInt(a.elements.cs_InputGreen.value)||0,d=parseInt(a.elements.cs_InputBlue.value)||0;if(b<0||b>255)b=0;if(c<0||c>255)c=0;if(d<0||d>255)d=0;a.elements.cs_InputRed.value=b;a.elements.cs_InputGreen.value=c;a.elements.cs_InputBlue.value=d;a.r=b;a.g=c;a.b=d;a.restoreFromRGB()};
dhtmlXColorPicker.prototype._changeValueHEX=function(){var a=this.z,b=a.elements.cs_Hex.value||0,b=b.replace(/[^a-fA-F0-9]/gi,"0");if(b.length>6)b=b.substr(0,6);else for(;b.length<6;)b+="0";a.elements.cs_Hex.value=b;a.hex=b;a.restoreFromHEX()};
dhtmlXColorPicker.prototype.setCustomColors=function(a){for(var a=a.split(","),b=0;b<a.length;b++){var c=a[b];c.substr(0,1)=="#"&&(c=c.substr(1));var d=this._hex2dec(c.substr(0,2)),e=this._hex2dec(c.substr(2,2)),f=this._hex2dec(c.substr(4,2)),c=d+","+e+","+f;this.saveColor(c,b)}};
dhtmlXColorPicker.prototype.setColor=function(a){if(typeof a!="string")var b=a[0],c=a[1],d=a[2];else if(a.indexOf("rgb")!=-1)var e=a.substr(a.indexOf("(")+1,a.lastIndexOf(")")-a.indexOf("(")-1).split(","),b=e[0],c=e[1],d=e[2];else a.substr(0,1)=="#"&&(a=a.substr(1)),b=this._hex2dec(a.substr(0,2)),c=this._hex2dec(a.substr(2,2)),d=this._hex2dec(a.substr(4,2));b=parseInt(b)||0;c=parseInt(c)||0;d=parseInt(d)||0;if(b<0||b>255)b=0;if(c<0||c>255)c=0;if(d<0||d>255)d=0;this.r=b;this.g=c;this.b=d;this.restoreFromRGB()};
dhtmlXColorPicker.prototype.close=function(){this.elements.cs_SelectorDiv.z=null;this.elements.cs_LumSelect.z=null;this.elements.cs_LumSelectArrow.z=null;this.elements.cs_ButtonOk.z=null;this.elements.cs_ButtonCancel.z=null;if(this.cc)this.elements.cs_CustomColorAdd.z=null;this.container.innerHTML="";this.container._dhx_remove&&this.container.parentNode.removeChild(this.container)};
dhtmlXColorPicker.prototype.show=function(){this.callEvent("onShow",[]);if(this.container.innerHTML!="")this.elements.cs_Content.style.display="",this.elements.cs_InputHue.focus()};dhtmlXColorPicker.prototype.setPosition=function(a,b){this.container.style.position="absolute";this.container.style.top=(b>0?b:10)+"px";this.container.style.left=a+"px"};dhtmlXColorPicker.prototype.hide=function(){this.resetHandlers();if(this.elements.cs_Content)this.elements.cs_Content.style.display="none"};
dhtmlXColorPicker.prototype.setOnSelectHandler=function(a){this.attachEvent("onSelect",a)};dhtmlXColorPicker.prototype.setOnCancelHandler=function(a){this.attachEvent("onCancel",a)};dhtmlXColorPicker.prototype.getSelectedColor=function(){var a=[this.r,this.g,this.b],b=this._dec2hex(this.r)+this._dec2hex(this.g)+this._dec2hex(this.b),c=[this.h,this.s,this.v];return["#"+b,a,c]};
dhtmlXColorPicker.prototype.linkTo=function(a,b,c){typeof a!="object"&&(a=document.getElementById(a));typeof b!="object"&&(b=document.getElementById(b));typeof c!="object"&&(c=document.getElementById(c));this.linkToObjects=arguments;var d=this;b.onclick=function(){var b=d._getOffset(a),c=d._getScrollers(),g=b[1]+c[0],h=b[0]+c[1];d.setPosition(g+a.offsetWidth,h);d.isVisible()?d.hide():d.show()};this.setOnSelectHandler(function(b){a.style.backgroundColor=b;if(c)c.value=b});this.close=this.hide;this.hide()};
dhtmlXColorPicker.prototype.hideOnSelect=function(a){this.hideSelfOnSelect=a};dhtmlXColorPicker.prototype.setImagePath=function(a){this.imgURL=a};dhtmlXColorPicker.prototype.init=function(){this.language||this.loadUserLanguage("en-us");this.generate();this.ready=!0;this._cc&&this._reinitCustomColors();this.linkToObjects.length>0&&this.linkTo(this.linkToObjects[0],this.linkToObjects[1],this.linkToObjects[2]);this.hideOnInit||this.show()};
dhtmlXColorPicker.prototype.loadUserLanguage=function(a){if(window.dhtmlxColorPickerLangModules[a])this.language=window.dhtmlxColorPickerLangModules[a],this.ready&&(this.generate(),this.show())};dhtmlXColorPicker.prototype.setSkin=function(a){this.skinName=a;if(this.elements.cs_Content)this.elements.cs_Content.className="dhtmlxcolorpicker"+(a?"_"+a:a)};dhtmlXColorPicker.prototype.isVisible=function(){return this.elements.cs_Content.style.display!="none"};
dhtmlXColorPicker.prototype.hoverButton=function(){this.className+="_Hover"};dhtmlXColorPicker.prototype.normalButton=function(){this.className=this.className.substr(0,this.className.length-6)};(function(){dhtmlx.extend_api("dhtmlXColorPicker",{_init:function(a){return[a.parent,a.click,a.colors,a.hide,a.full]},show:"showA",link:"linkTo",image_path:"setImagePath",color:"setColor"},{showA:function(){this.init();this.show()}})})();
function dhtmlXComboFromSelect(a,b){typeof a=="string"&&(a=document.getElementById(a));b=b||a.getAttribute("width")||(window.getComputedStyle?window.getComputedStyle(a,null).width:a.currentStyle?a.currentStyle.width:0);if(!b||b=="auto")b=a.offsetWidth||100;var c=document.createElement("SPAN");a.parentNode.insertBefore(c,a);a.style.display="none";for(var d=a.getAttribute("opt_type"),e=new dhtmlXCombo(c,a.name,b,d,a.tabIndex),f=[],g=-1,h=0;h<a.options.length;h++){a.options[h].selected&&(g=h);var i=
a.options[h].innerHTML,j=a.options[h].getAttribute("value");if(typeof j=="undefined"||j===null)j=i;f[h]={value:j,text:i,img_src:a.options[h].getAttribute("img_src")}}f.length&&e.addOption(f);a.parentNode.removeChild(a);g>=0&&e.selectOption(g,null,!0);a.onchange&&e.attachEvent("onChange",a.onchange);a.style.direction=="rtl"&&e.setRTL&&e.setRTL(!0);return e}var dhtmlXCombo_optionTypes=[];
function dhtmlXCombo(a,b,c,d,e){typeof a=="string"&&(a=document.getElementById(a));this.dhx_Event();this.optionType=d!=window.undefined&&dhtmlXCombo_optionTypes[d]?d:"default";this._optionObject=dhtmlXCombo_optionTypes[this.optionType];this._disabled=!1;this.readonlyDelay=750;this.filterEntities="[,],{,},(,),+,*,\\,?,.,$,^".split(",");if(!window.dhx_glbSelectAr)window.dhx_glbSelectAr=[],window.dhx_openedSelect=null,window.dhx_SelectId=1,dhtmlxEvent(document.body,"click",this.closeAll),dhtmlxEvent(document.body,
"keydown",function(a){try{(a||event).keyCode==9&&window.dhx_glbSelectAr[0].closeAll()}catch(b){}return!0});if(a.tagName=="SELECT")return dhtmlXComboFromSelect(a);else this._createSelf(a,b,c,e);dhx_glbSelectAr.push(this)}dhtmlXCombo.prototype.setSize=function(a){this.DOMlist.style.width=a+"px";if(this.DOMlistF)this.DOMlistF.style.width=a+"px";this.DOMelem.style.width=a+"px";this.DOMelem_input.style.width=Math.max(0,a-19)+"px"};
dhtmlXCombo.prototype.enableFilteringMode=function(a,b,c,d){a=="between"?this._autoDisabled=this._anyPosition=this._filter=!0:this._filter=convertStringToBoolean(a);if(b)this._xml=b,this._autoxml=convertStringToBoolean(d);if(convertStringToBoolean(c))this._xmlCache=[]};dhtmlXCombo.prototype.setFilteringParam=function(a,b){if(!this._prs)this._prs=[];this._prs.push([a,b])};
dhtmlXCombo.prototype.disable=function(a){var b=convertStringToBoolean(a);if(this._disabled!=b)this._disabled=this.DOMelem_input.disabled=b};
dhtmlXCombo.prototype.readonly=function(a,b){this.DOMelem_input.readOnly=a?!0:!1;if(b===!1||a===!1)this.DOMelem.onkeyup=function(){};else{var c=this;this.DOMelem.onkeyup=function(a){a=a||window.event;c._searchTimeout&&window.clearTimeout(c._searchTimeout);if(a.keyCode!=9)a.cancelBubble=!0;if(a.keyCode>=48&&a.keyCode<=57||a.keyCode>=65&&a.keyCode<=90){if(!c._searchText)c._searchText="";c._searchText+=String.fromCharCode(a.keyCode);for(var b=0;b<c.optionsArr.length;b++){var f=c.optionsArr[b].text;if(f.toString().toUpperCase().indexOf(c._searchText)==
0){c.selectOption(b);break}}c._searchTimeout=window.setTimeout(function(){c._searchText=""},c.readonlyDelay);a.cancelBubble=!0}}}};dhtmlXCombo.prototype.getOption=function(a){for(var b=0;b<this.optionsArr.length;b++)if(this.optionsArr[b].value==a)return this.optionsArr[b];return null};dhtmlXCombo.prototype.getOptionByLabel=function(a){for(var b=0;b<this.optionsArr.length;b++)if(this.optionsArr[b].text==a||this.optionsArr[b]._ctext==a)return this.optionsArr[b];return null};
dhtmlXCombo.prototype.getOptionByIndex=function(a){return this.optionsArr[a]};dhtmlXCombo.prototype.clearAll=function(a){a&&this.setComboText("");this.optionsArr=[];this.redrawOptions();a&&(this._selOption&&this._selOption.RedrawHeader(this,!0),this._confirmSelection())};dhtmlXCombo.prototype.deleteOption=function(a){var b=this.getIndexByValue(a);if(!(b<0)){if(this.optionsArr[b]==this._selOption)this._selOption=null;this.optionsArr.splice(b,1);this.redrawOptions()}};
dhtmlXCombo.prototype.render=function(a){this._skiprender=!convertStringToBoolean(a);this.redrawOptions()};dhtmlXCombo.prototype.updateOption=function(a,b,c,d){var e=this.getOption(a);typeof b!="object"&&(b={text:c,value:b,css:d});e.setValue(b);this.redrawOptions()};
dhtmlXCombo.prototype.addOption=function(a){args=!arguments[0].length||typeof arguments[0]!="object"?[arguments]:a;this.render(!1);for(var b=0;b<args.length;b++){var c=args[b];if(c.length)c.value=c[0]||"",c.text=c[1]||"",c.css=c[2]||"";this._addOption(c)}this.render(!0)};dhtmlXCombo.prototype._addOption=function(a){dOpt=new this._optionObject;this.optionsArr.push(dOpt);dOpt.setValue.apply(dOpt,[a]);this.redrawOptions()};
dhtmlXCombo.prototype.getIndexByValue=function(a){for(var b=0;b<this.optionsArr.length;b++)if(this.optionsArr[b].value==a)return b;return-1};dhtmlXCombo.prototype.getSelectedValue=function(){return this._selOption?this._selOption.value:null};dhtmlXCombo.prototype.getComboText=function(){return this.DOMelem_input.value};dhtmlXCombo.prototype.setComboText=function(a){this.DOMelem_input.value=a};
dhtmlXCombo.prototype.setComboValue=function(a){this.setComboText(a);for(var b=0;b<this.optionsArr.length;b++)if(this.optionsArr[b].data()[0]==a)return this.selectOption(b,null,!0);this.DOMelem_hidden_input.value=a};dhtmlXCombo.prototype.getActualValue=function(){return this.DOMelem_hidden_input.value};dhtmlXCombo.prototype.getSelectedText=function(){return this._selOption?this._selOption.text:""};
dhtmlXCombo.prototype.getSelectedIndex=function(){for(var a=0;a<this.optionsArr.length;a++)if(this.optionsArr[a]==this._selOption)return a;return-1};dhtmlXCombo.prototype.setName=function(a){this.DOMelem_hidden_input.name=a;this.DOMelem_hidden_input2=a.replace(/(\]?)$/,"_new_value$1");this.name=a};dhtmlXCombo.prototype.show=function(a){this.DOMelem.style.display=convertStringToBoolean(a)?"":"none"};
dhtmlXCombo.prototype.destructor=function(){this.DOMParent.removeChild(this.DOMelem);this.DOMlist.parentNode.removeChild(this.DOMlist);this.DOMlistF&&this.DOMlistF.parentNode.removeChild(this.DOMlistF);var a=dhx_glbSelectAr;this.DOMParent=this.DOMlist=this.DOMlistF=this.DOMelem=0;for(var b=this.DOMlist.combo=this.DOMelem.combo=0;b<a.length;b++)if(a[b]==this){a[b]=null;a.splice(b,1);break}};
dhtmlXCombo.prototype._createSelf=function(a,b,c,d){if(c.toString().indexOf("%")!=-1){var e=this,f=parseInt(c)/100;window.setInterval(function(){if(a.parentNode){var b=a.parentNode.offsetWidth*f-2;if(!(b<0)&&b!=e._lastTs)e.setSize(e._lastTs=b)}},500);c=parseInt(a.offsetWidth)}c=parseInt(c||100);this.ListPosition="Bottom";this.DOMParent=a;this._inID=null;this.name=b;this._selOption=null;this.optionsArr=[];var g=new this._optionObject;g.DrawHeader(this,b,c,d);this.DOMlist=document.createElement("DIV");
this.DOMlist.className="dhx_combo_list "+(dhtmlx.skin?dhtmlx.skin+"_list":"");this.DOMlist.style.width=c-(_isIE?0:0)+"px";if(_isOpera||_isKHTML)this.DOMlist.style.overflow="auto";this.DOMlist.style.display="none";document.body.insertBefore(this.DOMlist,document.body.firstChild);if(_isIE)this.DOMlistF=document.createElement("IFRAME"),this.DOMlistF.style.border="0px",this.DOMlistF.className="dhx_combo_list",this.DOMlistF.style.width=c-(_isIE?0:0)+"px",this.DOMlistF.style.display="none",this.DOMlistF.src=
"javascript:false;",document.body.insertBefore(this.DOMlistF,document.body.firstChild);this.DOMlist.combo=this.DOMelem.combo=this;this.DOMelem_input.onkeydown=this._onKey;this.DOMelem_input.onkeypress=this._onKeyF;this.DOMelem_input.onblur=this._onBlur;this.DOMelem.onclick=this._toggleSelect;this.DOMlist.onclick=this._selectOption;this.DOMlist.onmousedown=function(){this._skipBlur=!0};this.DOMlist.onkeydown=function(a){(a||event).cancelBubble=!0;this.combo.DOMelem_input.onkeydown(a)};this.DOMlist.onmouseover=
this._listOver};dhtmlXCombo.prototype._listOver=function(a){a=a||event;a.cancelBubble=!0;var b=_isIE?event.srcElement:a.target,c=this.combo;if(b.parentNode==c.DOMlist){c._selOption&&c._selOption.deselect();c._tempSel&&c._tempSel.deselect();for(var d=0;d<c.DOMlist.childNodes.length;d++)if(c.DOMlist.childNodes[d]==b)break;var e=c.optionsArr[d];c._tempSel=e;c._tempSel.select();c._autoxml&&d+1==c._lastLength&&c._fetchOptions(d+1,c._lasttext||"")}};
dhtmlXCombo.prototype._positList=function(){var a=this.getPosition(this.DOMelem);this.ListPosition=="Bottom"?(this.DOMlist.style.top=a[1]+this.DOMelem.offsetHeight-1+"px",this.DOMlist.style.left=a[0]+"px"):this.ListPosition=="Top"?(this.DOMlist.style.top=a[1]-this.DOMlist.offsetHeight+"px",this.DOMlist.style.left=a[0]+"px"):(this.DOMlist.style.top=a[1]+"px",this.DOMlist.style.left=a[0]+this.DOMelem.offsetWidth+"px")};
dhtmlXCombo.prototype.getPosition=function(a,b){if(_isIE&&_isIE<8){if(!b)b=document.body;for(var c=a,d=0,e=0;c&&c!=b;)d+=c.offsetLeft-c.scrollLeft+c.clientLeft,e+=c.offsetTop-c.scrollTop+c.clientTop,c=c.offsetParent;document.documentElement.scrollTop&&(e+=document.documentElement.scrollTop);document.documentElement.scrollLeft&&(d+=document.documentElement.scrollLeft);return[d,e]}var f=getOffset(a);return[f.left,f.top]};
dhtmlXCombo.prototype._correctSelection=function(){if(this.getComboText()!="")for(var a=0;a<this.optionsArr.length;a++)if(!this.optionsArr[a].isHidden())return this.selectOption(a,!0,!1);this.unSelectOption()};dhtmlXCombo.prototype.selectNext=function(a){for(var b=this.getSelectedIndex()+a;this.optionsArr[b];){if(!this.optionsArr[b].isHidden())return this.selectOption(b,!1,!1);b+=a}};
dhtmlXCombo.prototype._onKeyF=function(a){var b=this.parentNode.combo,c=a||event;c.cancelBubble=!0;c.keyCode=="13"||c.keyCode=="9"?(b._confirmSelection(),b.closeAll()):c.keyCode=="27"?(b._resetSelection(),b.closeAll()):b._activeMode=!0;return c.keyCode=="13"||c.keyCode=="27"?(b.callEvent("onKeyPressed",[c.keyCode]),!1):!0};
dhtmlXCombo.prototype._onKey=function(a){var b=this.parentNode.combo;(a||event).cancelBubble=!0;var c=(a||event).keyCode;if(c>15&&c<19)return!0;if(c==27)return!0;if(b.DOMlist.style.display!="block"&&c!="13"&&c!="9"&&(!b._filter||b._filterAny))b.DOMelem.onclick(a||event);if(c!="13"&&c!="9"){if(window.setTimeout(function(){b._onKeyB(c)},1),c=="40"||c=="38")return!1}else if(c==9)b._confirmSelection(),b.closeAll(),(a||event).cancelBubble=!1};
dhtmlXCombo.prototype._onKeyB=function(a){if(a=="40")var b=this.selectNext(1);else if(a=="38")this.selectNext(-1);else{this.callEvent("onKeyPressed",[a]);if(this._filter)return this.filterSelf(a==8||a==46);for(var c=0;c<this.optionsArr.length;c++)if(this.optionsArr[c].data()[1]==this.DOMelem_input.value)return this.selectOption(c,!1,!1),!1;this.unSelectOption()}return!0};
dhtmlXCombo.prototype._onBlur=function(){var a=this.parentNode._self;window.setTimeout(function(){if(a.DOMlist._skipBlur)return!(a.DOMlist._skipBlur=!1);a._skipFocus=!0;a._confirmSelection();a.callEvent("onBlur",[])},100)};dhtmlXCombo.prototype.redrawOptions=function(){if(!this._skiprender){for(var a=this.DOMlist.childNodes.length-1;a>=0;a--)this.DOMlist.removeChild(this.DOMlist.childNodes[a]);for(a=0;a<this.optionsArr.length;a++)this.DOMlist.appendChild(this.optionsArr[a].render())}};
dhtmlXCombo.prototype.loadXML=function(a,b){this._load=!0;this.callEvent("onXLS",[]);if(this._prs)for(var c=0;c<this._prs.length;c++)a+=[getUrlSymbol(a),escape(this._prs[c][0]),"=",escape(this._prs[c][1])].join("");if(this._xmlCache&&this._xmlCache[a])this._fillFromXML(this,null,null,null,this._xmlCache[a]),b&&b();else{var d=new dtmlXMLLoaderObject(this._fillFromXML,this,!0,!0);if(b)d.waitCall=b;d._cPath=a;d.loadXML(a)}};
dhtmlXCombo.prototype.loadXMLString=function(a){var b=new dtmlXMLLoaderObject(this._fillFromXML,this,!0,!0);b.loadXMLString(a)};
dhtmlXCombo.prototype._fillFromXML=function(a,b,c,d,e){a._xmlCache&&(a._xmlCache[e._cPath]=e);var f=e.getXMLTopNode("complete");if(f.tagName!="complete")a._load=!1;else{var g=e.doXPath("//complete"),h=e.doXPath("//option"),i=!1;a.render(!1);if(!g[0]||!g[0].getAttribute("add")){if(a.clearAll(),a._lastLength=h.length,a._xml)if(!h||!h.length)a.closeAll();else if(a._activeMode)a._positList(),a.DOMlist.style.display="block",_isIE&&a._IEFix(!0)}else a._lastLength+=h.length||Infinity,i=!0;for(var j=0;j<
h.length;j++){var k={};k.text=h[j].firstChild?h[j].firstChild.nodeValue:"";for(var m=0;m<h[j].attributes.length;m++){var l=h[j].attributes[m];if(l)k[l.nodeName]=l.nodeValue}a._addOption(k)}a.render(i!=!0||!!h.length);a._load&&a._load!==!0?a.loadXML(a._load):(a._load=!1,!a._lkmode&&a._filter&&!a._autoDisabled&&a._correctSelection());var n=e.doXPath("//option[@selected]");n.length&&a.selectOption(a.getIndexByValue(n[0].getAttribute("value")),!1,!0);a.callEvent("onXLE",[])}};
dhtmlXCombo.prototype.unSelectOption=function(){this._selOption&&this._selOption.deselect();this._tempSel&&this._tempSel.deselect();this._tempSel=this._selOption=null};dhtmlXCombo.prototype.confirmValue=function(){this._confirmSelection()};
dhtmlXCombo.prototype._confirmSelection=function(a,b){var c=this.getComboText();this.setComboText("");this.setComboText(c);if(arguments.length==0){var d=this.getOptionByLabel(this.DOMelem_input.value),a=d?d.value:this.DOMelem_input.value,b=d==null;if(a==this.getActualValue())return this._skipFocus=!1}if(!this._skipFocus&&!this._disabled)try{this.DOMelem_input.focus()}catch(e){}this._skipFocus=!1;this.DOMelem_hidden_input.value=a;this.DOMelem_hidden_input2.value=b?"true":"false";this.callEvent("onChange",
[]);this._activeMode=!1};dhtmlXCombo.prototype._resetSelection=function(){var a=this.getOption(this.DOMelem_hidden_input.value);this.setComboValue(a?a.data()[0]:this.DOMelem_hidden_input.value);this.setComboText(a?a.data()[1]:this.DOMelem_hidden_input.value)};
dhtmlXCombo.prototype.selectOption=function(a,b,c){arguments.length<3&&(c=!0);this.unSelectOption();var d=this.optionsArr[a];if(d){this._selOption=d;this._selOption.select();var e=this._selOption.content.offsetTop+this._selOption.content.offsetHeight-this.DOMlist.scrollTop-this.DOMlist.offsetHeight;e>0&&(this.DOMlist.scrollTop+=e);e=this.DOMlist.scrollTop-this._selOption.content.offsetTop;e>0&&(this.DOMlist.scrollTop-=e);var f=this._selOption.data();c&&(this.setComboText(f[1]),this._confirmSelection(f[0],
!1),this._autoxml&&a+1==this._lastLength&&this._fetchOptions(a+1,this._lasttext||""));if(b){var g=this.getComboText();g!=f[1]&&(this.setComboText(f[1]),dhtmlXRange(this.DOMelem_input,g.length+1,f[1].length))}else this.setComboText(f[1]);this._selOption.RedrawHeader(this);this.callEvent("onSelectionChange",[])}};
dhtmlXCombo.prototype._selectOption=function(a){(a||event).cancelBubble=!0;for(var b=_isIE?event.srcElement:a.target,c=this.combo;!b._self;)if(b=b.parentNode,!b)return;for(var d=0;d<c.DOMlist.childNodes.length;d++)if(c.DOMlist.childNodes[d]==b)break;c.selectOption(d,!1,!0);c.closeAll();c.callEvent("onBlur",[]);c._activeMode=!1};
dhtmlXCombo.prototype.openSelect=function(){if(!this._disabled){this.closeAll();this.DOMlist.style.display="block";this._positList();this.callEvent("onOpen",[]);this._tempSel&&this._tempSel.deselect();this._selOption&&this._selOption.select();if(this._selOption){var a=this._selOption.content.offsetTop+this._selOption.content.offsetHeight-this.DOMlist.scrollTop-this.DOMlist.offsetHeight;a>0&&(this.DOMlist.scrollTop+=a);a=this.DOMlist.scrollTop-this._selOption.content.offsetTop;a>0&&(this.DOMlist.scrollTop-=
a)}_isIE&&this._IEFix(!0);this.DOMelem_input.focus();this._filter&&this.filterSelf()}};dhtmlXCombo.prototype._toggleSelect=function(a){var b=this.combo;b.DOMlist.style.display=="block"?b.closeAll():b.openSelect();(a||event).cancelBubble=!0};
dhtmlXCombo.prototype._fetchOptions=function(a,b){if(b=="")return this.closeAll(),this.clearAll();var c=this._xml+(this._xml.indexOf("?")!=-1?"&":"?")+"pos="+a+"&mask="+encodeURIComponent(b);this._lasttext=b;this._load?this._load=c:this.callEvent("onDynXLS",[b,a])&&this.loadXML(c)};dhtmlXCombo.prototype.disableAutocomplete=function(){this._autoDisabled=!0};
dhtmlXCombo.prototype.filterSelf=function(a){var b=this.getComboText();if(this._xml)this._lkmode=a,this._fetchOptions(0,b);var c=RegExp("(["+this.filterEntities.join("\\")+"])","g"),b=b.replace(c,"\\$1"),d=(this._anyPosition?"":"^")+b,e=RegExp(d,"i");this.filterAny=!1;for(var f=0;f<this.optionsArr.length;f++){var g=e.test(this.optionsArr[f].content?this.optionsArr[f].data()[1]:this.optionsArr[f].text);this.filterAny|=g;this.optionsArr[f].hide(!g)}this.filterAny?(this.DOMlist.style.display!="block"&&
this.openSelect(),_isIE&&this._IEFix(!0)):(this.closeAll(),this._activeMode=!0);!a&&!this._autoDisabled?this._correctSelection():this.unSelectOption()};dhtmlXCombo.prototype._IEFix=function(a){this.DOMlistF.style.display=a?"block":"none";this.DOMlistF.style.top=this.DOMlist.style.top;this.DOMlistF.style.left=this.DOMlist.style.left;this.DOMlistF.style.width=this.DOMlist.offsetWidth+"px";this.DOMlistF.style.height=this.DOMlist.offsetHeight+"px"};
dhtmlXCombo.prototype.closeAll=function(){if(window.dhx_glbSelectAr)for(var a=0;a<dhx_glbSelectAr.length;a++){if(dhx_glbSelectAr[a].DOMlist.style.display=="block")dhx_glbSelectAr[a].DOMlist.style.display="none",_isIE&&dhx_glbSelectAr[a]._IEFix(!1);dhx_glbSelectAr[a]._activeMode=!1}};dhtmlXCombo.prototype.changeOptionId=function(a,b){(this.getOption(a)||{}).value=b};
function dhtmlXRange(a,b,c){var d=typeof a=="object"?a:document.getElementById(a);try{d.focus()}catch(e){}var f=d.value.length;b--;if(b<0||b>c||b>f)b=0;c>f&&(c=f);if(b!=c)if(d.setSelectionRange)d.setSelectionRange(b,c);else if(d.createTextRange){var g=d.createTextRange();g.moveStart("character",b);g.moveEnd("character",c-f);try{g.select()}catch(h){}}}dhtmlXCombo_defaultOption=function(){this.init()};
dhtmlXCombo_defaultOption.prototype.init=function(){this.value=null;this.text="";this.selected=!1;this.css=""};dhtmlXCombo_defaultOption.prototype.select=function(){if(this.content)this.content.className="dhx_selected_option"+(dhtmlx.skin?" combo_"+dhtmlx.skin+"_sel":"")};dhtmlXCombo_defaultOption.prototype.hide=function(a){this.render().style.display=a?"none":""};dhtmlXCombo_defaultOption.prototype.isHidden=function(){return this.render().style.display=="none"};
dhtmlXCombo_defaultOption.prototype.deselect=function(){this.content&&this.render();this.content.className=""};dhtmlXCombo_defaultOption.prototype.setValue=function(a){this.value=a.value||"";this.text=a.text||"";this.css=a.css||"";this.content=null};
dhtmlXCombo_defaultOption.prototype.render=function(){if(!this.content){this.content=document.createElement("DIV");this.content._self=this;this.content.style.cssText="width:100%; overflow:hidden;"+this.css;if(_isOpera||_isKHTML)this.content.style.padding="2px 0px 2px 0px";this.content.innerHTML=this.text;this._ctext=typeof this.content.textContent!="undefined"?this.content.textContent:this.content.innerText}return this.content};
dhtmlXCombo_defaultOption.prototype.data=function(){if(this.content)return[this.value,this._ctext?this._ctext:this.text]};dhtmlXCombo_defaultOption.prototype.DrawHeader=function(a,b,c,d){var e=document.createElement("DIV");e.style.width=c+"px";e.className="dhx_combo_box "+(dhtmlx.skin||"");e._self=a;a.DOMelem=e;this._DrawHeaderInput(a,b,c,d);this._DrawHeaderButton(a,b,c);a.DOMParent.appendChild(a.DOMelem)};
dhtmlXCombo_defaultOption.prototype._DrawHeaderInput=function(a,b,c,d){var e=document.createElement("input");e.setAttribute("autocomplete","off");e.type="text";e.className="dhx_combo_input";if(d)e.tabIndex=d;e.style.width=c-19-(document.compatMode=="BackCompat"?0:3)+"px";a.DOMelem.appendChild(e);a.DOMelem_input=e;e=document.createElement("input");e.type="hidden";e.name=b;a.DOMelem.appendChild(e);a.DOMelem_hidden_input=e;e=document.createElement("input");e.type="hidden";e.name=(b||"").replace(/(\]?)$/,
"_new_value$1");e.value="true";a.DOMelem.appendChild(e);a.DOMelem_hidden_input2=e};dhtmlXCombo_defaultOption.prototype._DrawHeaderButton=function(a){var b=document.createElement("img");b.className="dhx_combo_img";if(dhtmlx.image_path)dhx_globalImgPath=dhtmlx.image_path;b.src=(window.dhx_globalImgPath?dhx_globalImgPath:"")+"combo_select"+(dhtmlx.skin?"_"+dhtmlx.skin:"")+".gif";a.DOMelem.appendChild(b);a.DOMelem_button=b};dhtmlXCombo_defaultOption.prototype.RedrawHeader=function(){};
dhtmlXCombo_optionTypes["default"]=dhtmlXCombo_defaultOption;
dhtmlXCombo.prototype.dhx_Event=function(){this.dhx_SeverCatcherPath="";this.attachEvent=function(a,b,c){c=c||this;a="ev_"+a;if(!this[a]||!this[a].addEvent){var d=new this.eventCatcher(c);d.addEvent(this[a]);this[a]=d}return a+":"+this[a].addEvent(b)};this.callEvent=function(a,b){return this["ev_"+a]?this["ev_"+a].apply(this,b):!0};this.checkEvent=function(a){return this["ev_"+a]?!0:!1};this.eventCatcher=function(a){var b=[],c=a,d=function(a,b){var a=a.split(":"),c="",d="",e=a[1];a[1]=="rpc"&&(c=
'<?xml version="1.0"?><methodCall><methodName>'+a[2]+"</methodName><params>",d="</params></methodCall>",e=b);var k=function(){};return k},e=function(){if(b)var a=!0;for(var d=0;d<b.length;d++)if(b[d]!=null)var e=b[d].apply(c,arguments),a=a&&e;return a};e.addEvent=function(a){typeof a!="function"&&(a=a&&a.indexOf&&a.indexOf("server:")==0?new d(a,c.rpcServer):eval(a));return a?b.push(a)-1:!1};e.removeEvent=function(a){b[a]=null};return e};this.detachEvent=function(a){if(a!=!1){var b=a.split(":");this[b[0]].removeEvent(b[1])}}};
(function(){dhtmlx.extend_api("dhtmlXCombo",{_init:function(a){if(a.image_path)dhx_globalImgPath=a.image_path;return[a.parent,a.name,a.width||"100%",a.type,a.index]},filter:"filter_command",auto_height:"enableOptionAutoHeight",auto_position:"enableOptionAutoPositioning",auto_width:"enableOptionAutoWidth",xml:"loadXML",readonly:"readonly",items:"addOption"},{filter_command:function(a){typeof a=="string"?this.enableFilteringMode(!0,a):this.enableFilteringMode(a)}})})();dhtmlXCombo_imageOption=function(){this.init()};
dhtmlXCombo_imageOption.prototype=new dhtmlXCombo_defaultOption;dhtmlXCombo_imageOption.prototype.setValue=function(a){this.value=a.value||"";this.text=a.text||"";this.css=a.css||"";this.img_src=a.img_src||this.getDefImage()};
dhtmlXCombo_imageOption.prototype.render=function(){if(!this.content){this.content=document.createElement("DIV");this.content._self=this;this.content.style.cssText="width:100%; overflow:hidden; "+this.css;var a="";this.img_src!=""&&(a+='<img style="float:left;" src="'+this.img_src+'" />');a+='<div style="float:left">'+this.text+"</div>";this.content.innerHTML=a}return this.content};dhtmlXCombo_imageOption.prototype.data=function(){return[this.value,this.text,this.img_src]};
dhtmlXCombo_imageOption.prototype.DrawHeader=function(a,b,c){var d=document.createElement("DIV");d.style.width=c+"px";d.className="dhx_combo_box";d._self=a;a.DOMelem=d;this._DrawHeaderImage(a,b,c);this._DrawHeaderInput(a,b,c-19);this._DrawHeaderButton(a,b,c);a.DOMParent.appendChild(a.DOMelem)};dhtmlXCombo_imageOption.prototype._DrawHeaderImage=function(a){var b=document.createElement("img");b.className="dhx_combo_option_img";b.style.visibility="hidden";a.DOMelem.appendChild(b);a.DOMelem_image=b};
dhtmlXCombo_imageOption.prototype.RedrawHeader=function(a,b){a.DOMelem_image.style.visibility=b?"hidden":"visible";a.DOMelem_image.src=b?"":this.img_src};dhtmlXCombo_imageOption.prototype.getDefImage=function(){return""};dhtmlXCombo.prototype.setDefaultImage=function(a){dhtmlXCombo_imageOption.prototype.getDefImage=function(){return a}};dhtmlXCombo_optionTypes.image=dhtmlXCombo_imageOption;dhtmlXCombo_checkboxOption=function(){this.init()};dhtmlXCombo_checkboxOption.prototype=new dhtmlXCombo_defaultOption;
dhtmlXCombo_checkboxOption.prototype.setValue=function(a){this.value=a.value||"";this.text=a.text||"";this.css=a.css||"";this.checked=a.checked||0};
dhtmlXCombo_checkboxOption.prototype.render=function(){if(!this.content){this.content=document.createElement("DIV");this.content._self=this;this.content.style.cssText="width:100%; overflow:hidden; "+this.css;var a="";a+=this.checked?'<input style="float:left;" type="checkbox" checked   />':'<input style="float:left;" type="checkbox" />';a+='<div style="float:left">'+this.text+"</div>";this.content.innerHTML=a;this.content.firstChild.onclick=function(a){this.parentNode.parentNode.combo.DOMelem_input.focus();
(a||event).cancelBubble=!0;if(!this.parentNode.parentNode.combo.callEvent("onCheck",[this.parentNode._self.value,this.checked]))return this.checked=!this.checked,!1}}return this.content};dhtmlXCombo_checkboxOption.prototype.data=function(){return[this.value,this.text,this.render().firstChild.checked]};
dhtmlXCombo_checkboxOption.prototype.DrawHeader=function(a,b,c){a.DOMelem=document.createElement("DIV");a.DOMelem.style.width=c+"px";a.DOMelem.className="dhx_combo_box";a.DOMelem._self=a;this._DrawHeaderCheckbox(a,b,c);this._DrawHeaderInput(a,b,c-19);this._DrawHeaderButton(a,b,c);a.DOMParent.appendChild(a.DOMelem)};
dhtmlXCombo_checkboxOption.prototype._DrawHeaderCheckbox=function(a){var b=document.createElement("input");b.type="checkbox";b.className="dhx_combo_option_img";b.style.visibility="hidden";b.onclick=function(c){var d=a.getIndexByValue(a.getActualValue());d!=-1&&(a.setChecked(d,b.checked),a.callEvent("onCheck",[a.getActualValue(),a.optionsArr[d].content.firstChild.checked]));(c||event).cancelBubble=!0};a.DOMelem.appendChild(b);a.DOMelem_checkbox=b};
dhtmlXCombo_checkboxOption.prototype.RedrawHeader=function(a,b){a.DOMelem_checkbox.style.visibility=b?"hidden":"";a.DOMelem_checkbox.checked=b?!1:this.content.firstChild.checked};dhtmlXCombo_optionTypes.checkbox=dhtmlXCombo_checkboxOption;dhtmlXCombo.prototype.getChecked=function(){for(var a=[],b=0;b<this.optionsArr.length;b++)this.optionsArr[b].data()[2]&&a.push(this.optionsArr[b].value);return a};
dhtmlXCombo.prototype.setChecked=function(a,b){this.optionsArr[a].content.firstChild.checked=b!==!1;this._selOption==this.optionsArr[a]&&this._selOption.RedrawHeader(this)};dhtmlXCombo.prototype.setCheckedByValue=function(a,b){return this.setChecked(this.getIndexByValue(a),b)};dhtmlXCombo.prototype.enableOptionAutoPositioning=function(a){if(!this.ListAutoPosit)this.ListAutoPosit=1;this.attachEvent("onOpen",function(){this._setOptionAutoPositioning(a)});this.attachEvent("onXLE",function(){this._setOptionAutoPositioning(a)})};
dhtmlXCombo.prototype._setOptionAutoPositioning=function(a){if(typeof a!="undefined"&&!convertStringToBoolean(a))return this.ListPosition="Bottom",this.ListAutoPosit=0,!0;var b=this.getPosition(this.DOMelem),c=this._getClientHeight()-b[1]-this.DOMelem.offsetHeight,d=this.autoHeight?this.DOMlist.scrollHeight:parseInt(this.DOMlist.offsetHeight);this.ListPosition=c<d&&b[1]>d?"Top":"Bottom";this._positList();_isIE&&this._IEFix(!0)};
dhtmlXCombo.prototype._getClientHeight=function(){return document.compatMode=="CSS1Compat"&&!window.opera?document.documentElement.clientHeight:document.body.clientHeight};dhtmlXCombo.prototype.setOptionWidth=function(a){if(arguments.length>0&&(this.DOMlist.style.width=a+"px",this.DOMlistF))this.DOMlistF.style.width=a+"px"};
dhtmlXCombo.prototype.setOptionHeight=function(a){if(arguments.length>0){this.DOMlist.style.height=_isIE?this.DOMlistF.style.height=a+"px":a+"px";if(this.DOMlistF)this.DOMlistF.style.height=this.DOMlist.style.height;this._positList()}};
dhtmlXCombo.prototype.enableOptionAutoWidth=function(a){if(!this._listWidthConf)this._listWidthConf=this.DOMlist.offsetWidth;arguments.length==0&&(a=1);if(convertStringToBoolean(a))this.autoOptionWidth=1,this.awOnOpen=this.attachEvent("onOpen",function(){this._setOptionAutoWidth()}),this.awOnXLE=this.attachEvent("onXLE",function(){this._setOptionAutoWidth()});else if(typeof this.awOnOpen!="undefined")this.autoOptionWidth=0,this.detachEvent(this.awOnOpen),this.detachEvent(this.awOnXLE),this.setOptionWidth(this._listWidthConf)};
dhtmlXCombo.prototype._setOptionAutoWidth=function(){var a=!this.ahOnOpen&&this.DOMlist.scrollHeight>this.DOMlist.offsetHeight;this.setOptionWidth(1);for(var b=this.DOMlist.offsetWidth,c=0;c<this.optionsArr.length;c++){var d=_isFF?this.DOMlist.childNodes[c].scrollWidth-2:this.DOMlist.childNodes[c].scrollWidth;if(d>b)b=this.DOMlist.childNodes[c].scrollWidth}b+=a?18:0;this.setOptionWidth(this.DOMelem.offsetWidth>b?this.DOMelem.offsetWidth:b+2)};
dhtmlXCombo.prototype.enableOptionAutoHeight=function(a,b){if(!this._listHeightConf)this._listHeightConf=this.DOMlist.style.height==""?100:parseInt(this.DOMlist.style.height);arguments.length==0&&(a=1);this.autoHeight=convertStringToBoolean(a);var c=this;if(this.autoHeight){var d=function(){window.setTimeout(function(){c._setOptionAutoHeight(a,b)},1)};this.ahOnOpen=this.attachEvent("onOpen",d);if(!this.awOnOpen)this.ahOnXLE=this.attachEvent("onXLE",d);var e;this.ahOnKey=this.attachEvent("onKeyPressed",
function(){this._filter&&(e&&window.clearTimeout(e),window.setTimeout(function(){c.DOMlist.style.display=="block"&&c._setOptionAutoHeight(a,b)},50))})}else typeof this.ahOnOpen!="undefined"&&(this.detachEvent(this.ahOnOpen),this.ahOnXLE&&this.detachEvent(this.ahOnXLE),this.ahOnKey&&this.detachEvent(this.ahOnKey),this.setOptionHeight(this._listHeightConf))};
dhtmlXCombo.prototype._setOptionAutoHeight=function(a,b){if(convertStringToBoolean(a)){this.setOptionHeight(1);var c=0;this.optionsArr.length>0?(c=this.DOMlist.scrollHeight>this.DOMlist.offsetHeight?this.DOMlist.scrollHeight+2:this.DOMlist.offsetHeight,arguments.length>1&&b&&(b=parseInt(b),c=c>b?b:c),this.setOptionHeight(c)):this.DOMlist.style.display="none"}};
dhtmlXCombo.prototype.attachChildCombo=function(a,b){if(!this._child_combos)this._child_combos=[];this._has_childen=1;this._child_combos[this._child_combos.length]=a;a.show(0);var c=this,d=arguments.length;this.attachEvent("onChange",function(){for(var e=0;e<c._child_combos.length;e++)c._child_combos[e]==a&&(a.show(1),a.callEvent("onMasterChange",[c.getActualValue(),c]));if(c.getActualValue()=="")c.showSubCombo(c,0);else if(a._xml){if(d==1)b=a._xml;a._xml=c.deleteParentVariable(b);a._xml+=(a._xml.indexOf("?")!=
-1?"&":"?")+"parent="+encodeURIComponent(c.getActualValue())}else b&&(a.clearAll(!0),a.loadXML(b+(b.indexOf("?")!=-1?"&":"?")+"parent="+encodeURIComponent(c.getActualValue())))})};
dhtmlXCombo.prototype.setAutoSubCombo=function(a,b){arguments.length==1&&(b="subcombo");if(this._parentCombo)c=new dhtmlXCombo(this._parentCombo.DOMParent,b,this._parentCombo.DOMelem.style.width),c._parentCombo=this._parentCombo;else{var c=new dhtmlXCombo(this.DOMParent,b,this.DOMelem.style.width);c._parentCombo=this}if(this._filter)c._filter=1;if(this._xml&&(c._xml=arguments.length>0?a:this._xml,a=c._xml,c._autoxml=this._autoxml,this._xmlCache))c._xmlCache=[];this.attachChildCombo(c,a);return c};
dhtmlXCombo.prototype.detachChildCombo=function(a){for(var b=0;b<this._child_combos.length;b++)this._child_combos.splice(b,1);a.show(1)};dhtmlXCombo.prototype.showSubCombo=function(a,b){if(a._child_combos)for(var c=0;c<a._child_combos.length;c++)a._child_combos[c].show(b),a.showSubCombo(a._child_combos[c],0)};dhtmlXCombo.prototype.deleteParentVariable=function(a){return a=a.replace(/parent\=[^&]*/g,"").replace(/\?\&/,"?")};
function dhtmlXTabBar(a,b,c){b=b||"top";dhtmlxEventable(this);this._hrefs={};this._s={};this._c={};this._s.mode=b;this._s.scrolls=!0;this._custom_height=c;this._s.line_height=(parseInt(c)||20)+3;this._s.skin_line=1;this._s.tab_margin=0;this._s.expand=0;this._s.ext_border=2;this._s._bMode=b=="right"||b=="bottom"?1:0;this._s._vMode=b=="right"||b=="left"?1:0;this._dx=this._s._vMode?"height":"width";this._dy=this._s._vMode?"width":"height";switch(b){case "top":this._py="top";this._px="left";this._pxc=
"right";break;case "bottom":this._py="bottom";this._px="left";this._pxc="right";break;case "right":this._py="right";this._px="top";this._pxc="bottom";break;case "left":this._py="left",this._px="top",this._pxc="bottom"}this._active=null;this._tabs={};this._content={};this._href={};this._rows=[];this._s._tabSize=150;this._styles={"default":{left:3,right:3,select_shift:3,select_top:2,margin:1,offset:5,tab_color:"#F4F3EE",data_color:"#F0F8FF"},winbiscarf:{left:18,right:18,select_shift:3,select_top:2,
margin:1,offset:5},winscarf:{left:18,right:4,select_shift:3,select_top:2,margin:5,offset:5},modern:{left:5,right:5,select_shift:3,select_top:2,margin:1,offset:5,tab_color:"#F4F3EE",data_color:"#F0F8FF"},silver:{left:7,right:7,select_shift:3,select_top:2,margin:1,offset:5,tab_color:"#F4F3EE",data_color:"#F0F8FF"},dark_blue:{left:2,right:2,select_shift:3,select_top:2,margin:1,offset:5},glassy_blue:{left:2,right:3,select_shift:3,select_top:2,margin:1,offset:5},dhx_terrace:{left:7,right:7,select_shift:0,
select_top:0,margin:-1,offset:0,tab_color:"",data_color:"#ffffff"},dhx_black:{left:2,right:2,select_shift:3,select_top:0,margin:1,offset:5},dhx_blue:{left:2,right:2,select_shift:3,select_top:0,margin:1,offset:5,tab_color:"#F4F3EE",data_color:"#F0F8FF"},dhx_skyblue:{left:3,right:3,select_shift:0,select_top:0,margin:-1,offset:5,data_color:"white",hover:!0},dhx_web:{left:3,right:3,select_shift:1,select_top:0,margin:5,offset:15,data_color:"white"}};typeof a!="object"&&(a=document.getElementById(a));this.entBox=
a;this.entBox.className+=" dhx_tabbar_zone_"+this._s.mode;dhtmlx.image_path&&this.setImagePath(dhtmlx.image_path);this.setStyle("default");this.__skin=!1;this._createSelf();_isIE&&this.preventIECashing(!0);return this}
dhtmlXTabBar.prototype={_get_size:function(a,b){var c=this.entBox.getAttribute(a)||this.entBox.style[a]||(window.getComputedStyle?window.getComputedStyle(this.entBox,null)[a]:this.entBox.currentStyle?this.entBox.currentStyle[a]:0);(c||"").indexOf("%")!=-1&&this.enableAutoReSize(!0,!0);if(!c||c.indexOf("%")!=-1||c=="auto")c=b+"px";return c},setStyle:function(a){this.setSkin(a)},_getSkin:function(){return this._a},setSkin:function(a){a=a.toLowerCase();this._styles[a]||(a="default");this._a=this._styles[a];
this.skin=a;if(this._tabAll)this._tabAll.className="dhx_tabbar_zone dhx_tabbar_zone_"+this.skin;var b=a.indexOf("dhx_sky")==0,c=a.indexOf("dhx_web")==0,d=a.indexOf("dhx_terrace")==0;if(d&&!this._custom_height)this._s.line_height=37,this._setRowSizes();if(b)this._s.skin_line=0;if(c)this._s.line_height=29,this._s.ext_border=-1,this._s.expand=!0;if(b){this._s.line_height=26;this._setRowSizes();if(this._s.expand)this._s.tab_margin=-1;this._s.skin_line_x=!0;this._s.skin_line=-3;var e=this._s._rendered;
if(e)for(var f=0;f<e.length;f++)e[f].parentNode.removeChild(e[f]);var g=document.createElement("DIV");g.className="dhx_tabbar_lineA";this._tabAll.appendChild(g);var h=document.createElement("DIV");h.className="dhx_tabbar_lineB";this._tabAll.appendChild(h);var i=document.createElement("DIV");i.className="dhx_tabbar_lineC";this._tabAll.appendChild(i);var j=document.createElement("DIV");j.className="dhx_tabbar_lineD";this._tabAll.appendChild(j);this._getCoverLine();this._s._rendered=[g,h,i,j];if(this._s.expand){this._conZone.style.borderWidth=
"0px 0px 0px 0px";this._tabZone.firstChild.style.borderWidth="0px 0px 0px 0px";i.style.borderWidth="0px 0px 0px 0px";j.style.left="0px";i.style.right="0px";g.style.borderWidth="0px 0px 0px 0px";if(this._s.mode=="top")this._lineA.style.borderWidth="1px 0px 0px 0px";h.style.left="1px";this._s.ext_border=0}var k=function(){this._lineA.style[this._dx]="1px";var a=_isIE&&document.compatMode=="BackCompat",b=this._tabAll[this._s._vMode?"offsetHeight":"offsetWidth"]+(a?2:0);this._lastActive&&(b=Math.max(b,
this._lastActive.parentNode[this._s._vMode?"scrollHeight":"scrollWidth"]));b<6||(g.style[this._py]=parseInt(this._conZone.style[this._py])-3+"px",g.style[this._dx]=b-2+"px",h.style[this._py]=parseInt(this._conZone.style[this._py])-3+"px",h.style[this._dx]=b-(a?6:4)+(this._s.expand?2:0)+"px",i.style[this._dy]=parseInt(this._tabZone.style[this._dy])-3+"px",this._lineA.style[this._dx]=b-2+"px")};k.call(this);var m=this._checkScroll;this._checkScroll=function(){k.apply(this,arguments);m.apply(this,arguments)};
var l=this._scrollTo;this._scrollTo=function(){l.apply(this,arguments);k.apply(this,arguments)}}if(this._a.data_color&&this._conZone)this._conZone.style.backgroundColor=this._a.data_color;this.__skin=!0},enableAutoReSize:function(){var a=this;dhtmlxEvent(window,"resize",function(){window.setTimeout(function(){a&&a._setSizes&&a._setSizes()},1)})},_createSelf:function(){this._tabAll=document.createElement("DIV");this._tabZone=document.createElement("DIV");this._conZone=document.createElement("DIV");
this.entBox.appendChild(this._tabAll);this._tabAll.appendChild(this._tabZone);this._tabAll.appendChild(this._conZone);this._tabAll.className="dhx_tabbar_zone dhx_tabbar_zone_"+this.skin;this._s._vMode&&(this._tabAll.className+="V");this._s._bMode&&(this._tabAll.className+="B");this._tabZone.className="dhx_tablist_zone";this._conZone.className="dhx_tabcontent_zone";if(this.entBox._hideBorders)this._conZone.style.borderLeft=this._conZone.style.borderRight=this._conZone.style.borderBottom="0px solid white";
if(this._a.data_color)this._conZone.style.backgroundColor=this._a.data_color;this._tabZone.onselectstart=function(){return!1};this._tabZone.onclick=this._onClickHandler;this._tabZone.onmouseover=this._onMouseOverHandler;this._tabZone[_isFF?"onmouseout":"onmouseleave"]=this._onMouseOutHandler;this._tabZone.tabbar=this;this._createRow()},_createRow:function(){var a=document.createElement("DIV");a.className="dhx_tabbar_row";a.tabCount=0;this._tabZone.appendChild(a);this._rows[this._rows.length]=a;this._setRowSizes()},
_removeRow:function(a){a.parentNode.removeChild(a);for(var b=[],c=0;c<this._rows.length;c++)this._rows[c]!=a&&(b[b.length]=this._rows[c]);this._rows=b},_setSizes:function(a,b){var c=["clientHeight","clientWidth"];this._dx!="width"&&c.reverse();var d=_isIE&&document.compatMode=="BackCompat",e=this._conZone.offsetWidth-this._conZone.clientWidth,f=b||this.entBox[c[0]]+(d?e:0),d=a||this.entBox[c[1]]+(d?e:0),g=this._rows.length*(this._s.line_height-(this._s.skin_line_x?4:2))+(this._s.skin_line_x?2:0);
this._tabZone.style[this._dy]=g+"px";this._conZone.style[this._dy]=Math.max(0,f-this._s.ext_border-g-(this._s.skin_line_x?3:0)-this._s.tab_margin)+"px";this._conZone.style[this._dx]=Math.max(0,d-(this._s.expand?0:2))+"px";this._tabZone.style[this._py]=this._s.tab_margin+"px";this._conZone.style[this._py]=g+this._s.tab_margin-this._s.skin_line+"px";this._checkScroll();var h=this.getActiveTab();h&&this.cells(h).activate()},_checkScroll:function(){if(this._lineA){this._lineA.style[this._dx]="1px";var a=
_isIE&&document.compatMode=="BackCompat",b=this._tabAll[this._s._vMode?"offsetHeight":"offsetWidth"]+(a?2:0);this._lastActive&&(b=Math.max(b,this._lastActive.parentNode[this._s._vMode?"scrollHeight":"scrollWidth"]));b>2&&(this._lineA.style[this._dx]=b-2+"px")}if(!this._s._vMode&&this._s.scrolls)for(var c=0;c<this._rows.length;c++)this._rows[c].scrollWidth-this._rows[c].offsetWidth>2?this._showScroll(c):this._hideScroll(c)},_showScroll:function(a){if(!this._rows[a]._scroll){this.callEvent("onBeforeShowScroll",
[a]);var b=this._rows[a]._scroll=[],c=Math.max(0,this._s.line_height-23);b[0]=document.createElement("DIV");b[0].style.cssText="background-image:url("+this.imgUrl+this.skin+"/"+this.skin+"_scroll_left.gif); width:20px; height:21px;position:absolute;left:0px;z-index:990;top:"+c+"px;";b[0].className="dhx_tab_scroll_left";this._rows[a].appendChild(b[0]);b[1]=document.createElement("DIV");b[1].style.cssText="background-image:url("+this.imgUrl+this.skin+"/"+this.skin+"_scroll_right.gif); width:20px; height:21px;position:absolute;right:0px;z-index:990;top:"+
c+"px;";b[1].className="dhx_tab_scroll_right";this._rows[a].appendChild(b[1])}},_hideScroll:function(a){this._rows[a]._scroll&&this.callEvent("onBeforeHideScroll",[a]);if(this._rows[a]._scroll)this._rows[a].removeChild(this._rows[a]._scroll[0]),this._rows[a].removeChild(this._rows[a]._scroll[1]),this._rows[a]._scroll=null},_setRowSizes:function(){for(var a=0;a<this._rows.length;a++)this._rows[a].style[this._dy]=this._s.line_height+"px",this._rows[a].style[this._py]=a*(this._s.line_height-(this._s.skin_line_x?
4:2))-(_isIE&&!window.postMessage&&this._s._bMode?0:0)+"px",this._rows[a].style.zIndex=10+a;this._setSizes()},_setTabSizes:function(a){for(var b=this._a.offset,c=this._s.align?this._pxc:this._px,d=0;d<a.tabCount;d++){var e=a.childNodes[d];e.style.display!="none"&&(e.style[c]=b-(this._lastActive==e?this._a.select_shift:0)+"px",b+=e._size+this._a.margin)}},addTab:function(a,b,c,d,e){!this.__skin&&dhtmlx.skin&&this.setSkin(dhtmlx.skin);for(var e=e||0,f=this._rows.length;f<=e;f++)this._createRow();var g=
this._rows[e].tabCount;!d&&d!==0&&(d=g);var h=this._createTab(a,b,c=="*"?10:c||this._s._tabSize);this._addTab(this._rows[e],h,c,d);this._tabs[a]=h;this.cells(a).hide();this._checkScroll()},removeTab:function(a,b){var c=this._tabs[a];if(c){this.cells(a)._dhxContDestruct();this._content[a]&&this._content[a].parentNode&&this._content[a].parentNode.removeChild(this._content[a]);this._content[a]=null;this._goToAny(c,b);var d=c.parentNode;c.innerHTML="";d.removeChild(c);d.tabCount--;d.tabCount==0&&this._rows.length>
1?this._removeRow(d):this._setTabSizes(d);delete this._tabs[a];if(this._lastActive==c)this._lastActive=null;this._setRowSizes()}},_goToAny:function(a,b){if(this._lastActive==a&&(b&&this.goToNextTab()==a&&this.goToPrevTab(),this._lastActive==a))this._lastActive=null},_createTab:function(a,b,c){var d=document.createElement("DIV");d.className="dhx_tab_element dhx_tab_element_inactive";var e="<span>"+b+"</span><div></div><div></div><div></div>";this._close&&(e+="<IMG style='"+this._pxc+":4px; "+this._py+
(this.skin=="dhx_web"?":7":":4")+"px; position:absolute;z-index:11;' src='"+this.imgUrl+this.skin+"/close.png' >");d.innerHTML=e;d.setAttribute("tab_id",a);d._size=parseInt(c);d.style[this._dx]=parseInt(c)+"px";d.style[this._dy]=this._s.line_height+"px";d.style[this._py]=this._a.select_top+"px";d.skin=this.skin;if(this._a.tab_color)d.style.backgroundColor=this._a.tab_color;if(this._c[a])d.childNodes[0].style.cssText=this._c[a].color;this._img_all(d);if(this._close){var f=this;d.childNodes[4].onclick=
function(a){var b=this.parentNode.getAttribute("tab_id");f.callEvent("onTabClose",[b])&&f.removeTab(b,!0);(a||event).cancelBubble=!0}}return d},_img_all:function(a){var b=this._getSkin(a),c=a._active?1:4;this._img(a.childNodes[1],c,this._px,b.left);this._img(a.childNodes[2],c+2,this._pxc,b.right);this._img(a.childNodes[3],c+1,this._px,parseInt(a.style[this._dx])-(b.left+b.right),b.left)},_get_img_pos:function(a){this._s._bMode&&a<7&&(a=Math.abs(a-6));a=-5-a*(this._s._vMode==1&&this.skin=="dhx_terrace"?
245:45);return this._s._vMode?a+"px 0px":"0px "+a+"px"},_img:function(a,b,c,d,e){if(typeof a!="undefined"){a.style.backgroundImage="url("+this.imgUrl+this.skin+"/"+this.skin+"_"+this._s.mode+".gif)";a.style.backgroundPosition=this._get_img_pos(b);if(this._s._vMode==1&&this.skin=="dhx_terrace")a.style.width="240px";a.style[this._py]="0px";c&&(a.style[this._dx]=Math.max(d,0)+"px",a.style[c]=(e||0)+"px")}},_addTab:function(a,b,c,d){var e=this._a.offset;if(a.tabCount)var f=a.childNodes[a.tabCount-1],
e=parseInt(f.style[this._s.align?this._pxc:this._px])+parseInt(f._size)+this._a.margin;var g=a.childNodes[d];g?a.insertBefore(b,g):a.appendChild(b);a.tabCount++;if(c=="*")b.style.whiteSpace="nowrap",this.adjustTabSize(b);b.style[this._s.align?this._pxc:this._px]=e+"px";d!=a.tabCount-1&&this._setTabSizes(a)},adjustTabSize:function(a,b){var c=this._getSkin(c);if(!b)a.style.fontWeight="bold",a.childNodes[3].style[this._dx]=a.style[this._dx]="10px",b=a[this._s._vMode?"scrollHeight":"scrollWidth"]+10+
(this._close?20:0),a.style.fontWeight="";a.style[this._dx]=b+"px";a._size=b;this._img_all(a)},_onMouseOverHandler:function(a){var b=this.tabbar._getTabTarget(a?a.target:event.srcElement);this.tabbar._showHover(b)},_onMouseOutHandler:function(){this.tabbar._showHover()},_showHover:function(a){if(a!=this._lastHower){if(this._lastHower&&this._lastHower!=this._lastActive){var b=this._getSkin(this._lastHower);this._lastHower.className=this._lastHower.className.replace(/[ ]*dhx_tab_hover/gi,"");b.hover?
this._img_all(this._lastHower):this._img(this._lastHower.childNodes[3],5,this._px,parseInt(this._lastHower.style[this._dx])-(b.left+b.right),b.left);this._lastHower=null}if(!a||!(a==this._lastActive||a._disabled))if(this._lastHower=a)b=this._getSkin(a),a.className+=" dhx_tab_hover",b.hover&&(this._img(a.childNodes[1],7,this._px,b.left),this._img(a.childNodes[2],8,this._pxc,b.right)),this._img(a.childNodes[3],0,this._px,parseInt(a.style[this._dx])-(b.left+b.right),b.left)}},_getTabTarget:function(a){if(!a)return null;
for(;!a.className||a.className.indexOf("dhx_tab_element")==-1;){if(a.className&&a.className.indexOf("dhx_tabbar_zone")!=-1)return null;a=a.parentNode;if(!a)return null}return a},_onClickHandler:function(a){var b=a?a.target:event.srcElement,c=this.tabbar._getTabTarget(b);if(c&&!c._disabled)this.tabbar._setTabActive(c);else{var d=null;if(b.className=="dhx_tab_scroll_left")b.parentNode.scrollLeft=Math.max(0,b.parentNode.scrollLeft-b.parentNode.offsetWidth/2),d=b,this.tabbar._setTabTop(this.tabbar._lastActive);
else if(b.className=="dhx_tab_scroll_right")b.parentNode.scrollLeft+=b.parentNode.offsetWidth/2,d=b.previousSibling,this.tabbar._setTabTop(this.tabbar._lastActive);if(d&&d.parentNode&&d.parentNode.tagName){d.style.left=d.parentNode.scrollLeft+"px";if(!_isIE||window.XMLHttpRequest)d.nextSibling.style.right=d.parentNode.scrollLeft*-1+"px";return!1}}},_deactivateTab:function(){this._setTabInActive(this._lastActive);this._lastActive=null},_setTabInActive:function(a){if(!a||a!=this._lastActive)return!0;
var b=this._getSkin(a),c=a.getAttribute("tab_id"),d=this._s.align?this._pxc:this._px;a.className=a.className.replace("_active","_inactive");a.style[this._py]=b.select_top+"px";a.style[d]=parseInt(a.style[d])+b.select_shift+"px";a.style[this._dx]=a._size+"px";a._active=!1;if(b.tab_color)a.style.backgroundColor=b.tab_color;if(this._c[c])a.childNodes[0].style.cssText=this._c[c].color;this._img_all(a);this.cells(c).hide()},_setTabActive:function(a,b){if(!a)return!0;var c=a.getAttribute("tab_id"),d=this._lastActive?
this._lastActive.getAttribute("tab_id"):null,e=this._getSkin(a);b||this.callEvent("onTabClick",[c,d]);if(a==this._lastActive)return!0;if(b||this.callEvent("onSelect",[c,d])){var f=this._s.align?this._pxc:this._px;this._setTabInActive(this._lastActive);a.className=a.className.replace("_inactive","_active");a.style[this._py]="0px";a.style[f]=parseInt(a.style[f])-e.select_shift+"px";a.style[this._dx]=a._size+e.select_shift*2+"px";a._active=!0;if(e.data_color)a.style.backgroundColor=e.data_color;if(this._c[c])a.childNodes[0].style.cssText=
this._c[c].scolor;this._img_all(a);this._setTabTop(a);this._lastActive=a;this.cells(c).show();this._scrollTo(a);return!0}},_scrollTo:function(a){if(this._s.scrolls&&(a.offsetLeft<a.parentNode.scrollLeft||a.offsetLeft+a.offsetWidth>a.parentNode.scrollLeft+a.parentNode.offsetWidth)){a.parentNode.scrollLeft=a.offsetLeft;var b=a.parentNode._scroll;if(b&&b[0]&&(b[0].style.left=b[0].parentNode.scrollLeft+"px",!_isIE||window.XMLHttpRequest))b[1].style.right=b[1].parentNode.scrollLeft*-1+"px"}},_setTabTop:function(a){if(!a)return!1;
for(var b=this._rows.length-1,c=0;c<this._rows.length;c++)if(this._rows[c]==a.parentNode){var d=this._rows[c];c!=b&&(this._rows[c]=this._rows[b],this._rows[b]=d);var e=this._getCoverLine();d.appendChild(e);e.style[this._dx]="1px";var f=this._s._vMode?Math.max(this._tabZone.offsetHeight,d.scrollHeight):Math.max(this._tabZone.offsetWidth,d.scrollWidth);f>0&&(e.style[this._dx]=f+"px");a.style.zIndex=e._index++;break}this._setRowSizes()},_getCoverLine:function(){if(!this._lineA)this._lineA=document.createElement("div"),
this._lineA.className="dhx_tablist_line",this._lineA.style[this._py]=this._s.line_height-3-(this._s.skin_line_x?1:0)+"px",this._lineA.style[this._dx]="100%",this._lineA._index=1;this._lineA.style.zIndex=this._lineA._index++;return this._lineA},cells:function(a){if(!this._tabs[a])return null;if(!this._content[a]){var b=document.createElement("DIV");b.style.cssText="width:100%;height:100%;visibility:hidden;overflow:hidden;position:absolute;top:0px; left:0px;";b.setAttribute("tab_id",a);b.skin=this.skin;
this._conZone.appendChild(b);(new dhtmlXContainer(b)).setContent(b);this.skin=="dhx_web"&&b._setPadding&&b._setPadding(1,"dhxcont_tabbar_dhx_web");b._isTabbarCell=!0;this._content[a]=b;var c=this;b.show=function(){if(c._s.hide)this.style.display="";this.style.visibility="";this.style.zIndex="1";this.autoSize();this._activate()};b.hide=function(){c._s.hide?(this.style.visibility="",this.style.display="none"):this.style.visibility="hidden";this.style.zIndex=-1;c._hrfmode=="iframe"&&this.attachURL("javascript:false")};
b.autoSize=function(){if(c._awdj||c._ahdj){var a=this.vs?this.vs[this.av].dhxcont.mainCont[this.av]:this.mainCont;if(!a.offsetWidth)a.style.width=Math.max(0,c.entBox.offsetWidth-2)+"px";if(c._ahdj)a.style.height="1px";var b=this._getContentDim();if(c._awdj)c.entBox.style.width=b[0]+2+"px",a.style.width=b[0]+"px";if(c._ahdj)c._tabAll.style.height=c.entBox.style.height=b[1]+c._rows.length*(c._s.line_height-2)+(c._s.expand?0:2)+2+"px",a.style.height=b[1]+"px";c._setSizes();c._setTabTop(c._lastActive)}};
b._activate=function(){this._delay&&this._attachContent.apply(this,this._delay);this.activate();if(c._hrfmode!="iframe")this._delay=null};b._doOnResize=function(){this.activate()};b.activate=function(){this.adjustContent(this.parentNode,0,0,!1,0);b.updateNestedObjects()};b._doOnAttachStatusBar=b.activate;b._doOnAttachMenu=b.activate;b._doOnAttachToolbar=b.activate;b._getContentDim=function(){var a=this.vs?this.vs[this.av].dhxcont.mainCont[this.av]:this.mainCont;return[a.scrollWidth,a.scrollHeight]};
b._doOnFrameContentLoaded=function(){(c._awdj||c._ahdj)&&c.cells(a).autoSize();c.callEvent("onXLE",[]);c.callEvent("onTabContentLoaded",[this.getAttribute("tab_id")])};b._doOnBeforeAttachURL=function(){c.callEvent("onXLS",[])};b.adjustContent(b.parentNode,0,0,!1,0)}return this._content[a]},forceLoad:function(a,b){this.setContentHref(a,b||this._hrefs[a]);this.cells(a)._activate()},enableAutoSize:function(a,b){this._ahdj=convertStringToBoolean(b);this._awdj=convertStringToBoolean(a)},clearAll:function(){for(var a in this._tabs)this.removeTab(a,
!1);if(this._lineA){var b=this._getCoverLine();b.parentNode&&b.parentNode.removeChild(b)}},enableTabCloseButton:function(a){this._close=convertStringToBoolean(a)},preventIECashing:function(a){this.no_cashe=convertStringToBoolean(a);if(this.XMLLoader)this.XMLLoader.rSeed=this.no_cashe},setTabActive:function(a,b){this._setTabActive(this._tabs[a],b===!1)},setTabInActive:function(){var a=this._lastActive;a&&(this._deactivateTab(),this._setTabTop(a),this._getCoverLine())},loadXMLString:function(a,b){this.XMLLoader=
new dtmlXMLLoaderObject(this._parseXML,this,!0,this.no_cashe);this.XMLLoader.waitCall=b||0;this.XMLLoader.loadXMLString(a)},loadXML:function(a,b){this.callEvent("onXLS",[]);this.XMLLoader=new dtmlXMLLoaderObject(this._parseXML,this,!0,this.no_cashe);this.XMLLoader.waitCall=b||0;this.XMLLoader.loadXML(a)},_parseXML:function(a,b,c,d,e){a.clearAll();var f="";if(!e)e=a.XMLLoader;var g=e.getXMLTopNode("tabbar"),h=e.doXPath("//row",g),i=g.getAttribute("tabstyle");i&&a.setStyle(i);a._hrfmode=g.getAttribute("hrefmode")||
a._hrfmode;a._a.margin=parseInt(g.getAttribute("margin")||a._a.margin,10);if(i=g.getAttribute("align"))a._s.align=i=="right"||i=="bottom";a._a.offset=parseInt(g.getAttribute("offset")||a._a.offset,10);(i=g.getAttribute("skinColors"))&&a.setSkinColors(i.split(",")[0],i.split(",")[1]);for(var j=0;j<h.length;j++)for(var k=e.doXPath("./tab",h[j]),m=0;m<k.length;m++){var l=k[m].getAttribute("width"),n=a._getXMLContent(k[m]),o=k[m].getAttribute("id");a.addTab(o,n,l,"",j);k[m].getAttribute("selected")&&
(f=o);if(a._hrfmode)a.setContentHref(o,k[m].getAttribute("href"));else for(var p=0;p<k[m].childNodes.length;p++){var r=k[m].childNodes[p];r.tagName=="content"&&(r.getAttribute("id")?a.setContent(o,r.getAttribute("id")):a.setContentHTML(o,a._getXMLContent(r)))}}f&&a.setTabActive(f);a.callEvent("onXLE",[])},adjustOuterSize:function(){this._setSizes()},_getXMLContent:function(a){for(var b="",c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];b+=d.nodeValue===null?"":d.nodeValue}return b},enableContentZone:function(a){this._conZone.style.display=
convertStringToBoolean(a)?"":"none";this._setSizes()},enableForceHiding:function(a){this._s.hide=convertStringToBoolean(a)},setSize:function(a,b){this.entBox.style.width=a+"px";this.entBox.style.height=b+"px";this._setSizes()},setSkinColors:function(a,b,c){if(a)this._a.data_color=a;if(b)this._a.tab_color=b;this._conZone.style.backgroundColor=c||a},setCustomStyle:function(a,b,c,d){var e="";this._c[a]={color:";"+(b?"color:"+b+";":"")+(d||""),scolor:";"+(c?"color:"+c+";":"")+(d||"")};if(this._tabs[a])this._tabs[a].childNodes[0].style.cssText=
this._tabs[a]==this._lastActive?this._c[a].scolor:this._c[a].color},setImagePath:function(a){this.imgUrl=a},getNext:function(a,b){var b=b||"nextSibling",c=a[b];c&&c.className.indexOf("dhx_tab_element")==-1&&(c=null);!c&&a.parentNode[b]&&(c=a.parentNode[b].childNodes[0]);return c||a},getAllTabs:function(){var a=[],b;for(b in this._tabs)a.push(b);return a},goToNextTab:function(a){do a=this.getNext(a||this._lastActive);while(!this._setTabActive(a));return a},goToPrevTab:function(a){do a=this.getNext(a||
this._lastActive,"previousSibling");while(!this._setTabActive(a));return a},disableTab:function(a){this._tabs[a]._disabled=!0;this._tabs[a].style.color="silver"},enableTab:function(a){this._tabs[a]._disabled=!1;this._tabs[a].style.color=""},showTab:function(a){var b=this._tabs[a];b.style.display="";this._setTabSizes(b.parentNode)},hideTab:function(a,b){var c=this._tabs[a];c.style.display="none";c==this._lastActive&&b!==!1&&this.goToNextTab();this._setTabSizes(c.parentNode)},getActiveTab:function(){return!this._lastActive?
null:this._lastActive.getAttribute("tab_id")},setLabel:function(a,b,c){var d=this.getActiveTab();this._tabs[a].firstChild.innerHTML=b;this.adjustTabSize(this._tabs[a],c);this._setTabSizes(this._tabs[a].parentNode);this._checkScroll()},getLabel:function(a){return this._tabs[a].firstChild.innerHTML},setOffset:function(a){this._a.offset=a*1},enableScroll:function(a){this._s.scrolls=convertStringToBoolean(a)},setMargin:function(a){this._a.margin=a*1},setAlign:function(a){this._s.align=a=="bottom"||a==
"right"},tabWindow:function(a){return this._content[a]?this._content[a]._frame.contentWindow:null},setContentHTML:function(a,b){this.cells(a).attachHTMLString(b)},setContent:function(a,b){this.cells(a).attachObject(b);this.cells(a).activate()},setHrefMode:function(a){this._hrfmode=a},setContentHref:function(a,b){this._hrefs[a]=b;switch(this._hrfmode){case "iframes":this.cells(a).attachURL(b);break;case "iframe":case "iframes-on-demand":this.cells(a)._delay=["url",b,!1];break;case "ajax":var c=this.cells(a),
d=this;c._delay=["urlajax",b,!0];if(!c.attachHTMLStringA)c.attachHTMLStringA=c.attachHTMLString,c.attachHTMLString=function(a,b){b&&(a=d._getXMLContent(b.doXPath("//content")[0]));return this.attachHTMLStringA(a)};break;case "ajax-html":this.cells(a)._delay=["urlajax",b,!0]}this._tabs[a]==this._lastActive&&this.cells(a).show(!0)},normalize:function(a,b){function c(a,b){d[b]._size+=j!=Infinity?j-i:0;a.adjustTabSize(d[b],d[b]._size)}for(var a=a||this._tabZone.offsetWidth,d=[],e=0;e<this._rows.length;e++)for(var f=
0;f<this._rows[e].tabCount;f++)d.push(this._rows[e].removeChild(this._rows[e].childNodes[0]));this._tabZone.innerHTML="";this._rows=[];var g=this._lastActive;this._lastActive=null;this._createRow();for(var h=0,i=this._a.offset,j=Infinity,k=null,f=0;f<d.length;f++)i+d[f]._size+this._a.margin<a?(this._rows[h].appendChild(d[f]),this._rows[h].tabCount++,i+=d[f]._size+this._a.margin):(b&&i<j&&c(this,f-1),this._createRow(),f--,h++,j=i,i=this._a.offset);b&&i<j&&j!=Infinity&&c(this,f-1);for(e=0;e<this._rows.length;e++)this._setTabSizes(this._rows[e]);
this._setSizes();(this._lastActive=g)&&this._setTabTop(this._lastActive)},showInnerScroll:function(){for(var a in this._tabs)if(this.cells(a).vs){var b=this.cells(a).av;this.cells(a).vs[b].dhxcont.mainCont[b].style.overflow="auto"}else this.cells(a).dhxcont.mainCont.style.overflow="auto"},getNumberOfTabs:function(){for(var a=0,b=0;b<this._rows.length;b++)a+=this._rows[b].tabCount;return a},destructor:function(){}};
if(!window.dhtmlXContainer)window.dhtmlXContainer=function(a){var b=this;this.obj=a;this.dhxcont=null;this.setContent=function(a){this.dhxcont=a;this.dhxcont.innerHTML="<div id='dhxMainCont' class='dhxcont_main_content'></div><div id='dhxContBlocker' class='dhxcont_content_blocker' style='display: none;'></div>";this.dhxcont.mainCont=this.dhxcont.childNodes[0];this.obj.dhxcont=this.dhxcont};this.obj._genStr=function(a){for(var b="",e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
f=0;f<a;f++)b+=e.charAt(Math.round(Math.random()*e.length));return b};this.obj.setMinContentSize=function(a,b){this._minDataSizeW=a;this._minDataSizeH=b};this.obj.moveContentTo=function(a){a.updateNestedObjects()};this.obj.adjustContent=function(a,b,e,f,g){this.dhxcont.style.top=b+"px";this.dhxcont.style.left="0px";if(f!=!0)this.dhxcont.style.width=a.clientWidth+"px";var h=a.clientHeight-b;h<0&&(h=0);this.dhxcont.style.height=h+(e!=null?e:0)+"px";if(f!=!0&&this.dhxcont.offsetWidth>a.clientWidth)this.dhxcont.style.width=
Math.max(0,a.clientWidth*2-this.dhxcont.offsetWidth)+"px";if(this.dhxcont.offsetHeight>a.clientHeight-b)h=(a.clientHeight-b)*2-this.dhxcont.offsetHeight,h<0&&(h=0),this.dhxcont.style.height=h+"px";if(g&&!isNaN(g))this.dhxcont.style.height=parseInt(this.dhxcont.style.height)-g+"px";if(this._minDataSizeH!=null&&parseInt(this.dhxcont.style.height)<this._minDataSizeH)this.dhxcont.style.height=this._minDataSizeH+"px";if(this._minDataSizeW!=null&&parseInt(this.dhxcont.style.width)<this._minDataSizeW)this.dhxcont.style.width=
this._minDataSizeW+"px";if(f!=!0)this.dhxcont.mainCont.style.width=this.dhxcont.clientWidth+"px";var i=this.menu!=null?!this.menuHidden?this.menuHeight:0:0,j=this.toolbar!=null?!this.toolbarHidden?this.toolbarHeight:0:0,k=this.sb!=null?!this.sbHidden?this.sbHeight:0:0;this.dhxcont.mainCont.style.height=this.dhxcont.clientHeight-i-j-k+"px"};this.obj.updateNestedObjects=function(){};this.obj.attachObject=function(a,b){typeof a=="string"&&(a=document.getElementById(a));if(b){a.style.visibility="hidden";
a.style.display="";var e=a.offsetWidth,f=a.offsetHeight}this._attachContent("obj",a);if(b&&this._isWindow)a.style.visibility="",this._adjustToContent(e,f)};this.obj.appendObject=function(a){typeof a=="string"&&(a=document.getElementById(a));this._attachContent("obj",a,!0)};this.obj.attachHTMLString=function(a){this._attachContent("str",a);for(var b=a.match(/<script[^>]*>[^\f]*?<\/script>/g)||[],e=0;e<b.length;e++){var f=b[e].replace(/<([\/]{0,1})script[^>]*>/g,"");if(window.execScript){var g=b[e].match(/<script[^>]*src\s*=\s*("|')([^"']+)("|')/);
if(g)f=dhtmlxAjax.getSync(g[2]).xmlDoc.responseText;f&&window.execScript(f)}else window.eval(f)}};this.obj.attachURL=function(a,b){this._attachContent(b==!0?"urlajax":"url",a,!1)};this.obj._attachContent=function(a,d,e){if(e!==!0)for(;b.dhxcont.mainCont.childNodes.length>0;)b.dhxcont.mainCont.removeChild(b.dhxcont.mainCont.childNodes[0]);if(a=="url"){var f=document.createElement("IFRAME");f.frameBorder=0;f.border=0;f.style.width="100%";f.style.height="100%";b.dhxcont.mainCont.appendChild(f);f.src=
d;this._frame=f;this._doOnFrameContentLoaded&&this._doOnFrameContentLoaded(!0)}else if(a=="urlajax"){var g=this,h=function(){g.attachHTMLString(this.xmlDoc.responseText,this);g._doOnFrameContentLoaded&&g._doOnFrameContentLoaded(!1);this.destructor()},i=new dtmlXMLLoaderObject(h,window);i.loadXML(d);g._doOnBeforeAttachURL&&g._doOnBeforeAttachURL(!1)}else if(a=="obj")b.dhxcont._frame=null,b.dhxcont.mainCont.appendChild(d),b.dhxcont.mainCont.style.overflow=e===!0?"auto":"hidden",d.style.display="";else if(a==
"str")b.dhxcont._frame=null,b.dhxcont.mainCont.innerHTML=d};this.obj._dhxContDestruct=function(){}};
(function(){dhtmlx.extend_api("dhtmlXTabBar",{_init:function(a){return[a.parent,a.mode,a.height]},tabs:"tabs",skin:"setSkin",offset:"setOffset",margin:"setMargin",image_path:"setImagePath",href_mode:"setHrefMode",align:"setAlign",xml:"loadXML",close_button:"enableTabCloseButton",scroll:"enableScroll",forced:"enableForceHiding",content_zone:"enableContentZone",size_by_content:"enableAutoSize",auto_size:"enableAutoReSize"},{tabs:function(a){for(var b=0;b<a.length;b++){var c=a[b];this.addTab(c.id,c.label,
c.width,c.index,c.row);c.active&&this.setTabActive(c.id)}}})})();
function dhx_init_tabbars(){for(var a=document.getElementsByTagName("div"),b=0;b<a.length;b++)if(a[b].className.indexOf("dhtmlxTabBar")!=-1){var c=a[b],d=c.id;c.className="";for(var e=[],f=0;f<c.childNodes.length;f++)c.childNodes[f].tagName&&c.childNodes[f].tagName!="!"&&(e[e.length]=c.childNodes[f]);var g=new dhtmlXTabBar(d,c.getAttribute("mode")||"top",c.getAttribute("tabheight")||20);window[d]=g;(h=c.getAttribute("onbeforeinit"))&&eval(h);c.getAttribute("enableForceHiding")&&g.enableForceHiding(!0);
g.setImagePath(c.getAttribute("imgpath"));var h=c.getAttribute("margin");if(h!=null)g._margin=h;if(h=c.getAttribute("align"))g._align=h;(h=c.getAttribute("hrefmode"))&&g.setHrefMode(h);h=c.getAttribute("offset");if(h!=null)g._offset=h;h=c.getAttribute("tabstyle");h!=null&&g.setStyle(h);var h=c.getAttribute("select"),i=c.getAttribute("skinColors");i&&g.setSkinColors(i.split(",")[0],i.split(",")[1]);for(f=0;f<e.length;f++){var j=e[f];j.parentNode.removeChild(j);g.addTab(j.id,j.getAttribute("name"),
j.getAttribute("width"),null,j.getAttribute("row"));var k=j.getAttribute("href");k?g.setContentHref(j.id,k):g.setContent(j.id,j);if(!g._dspN&&j.style.display=="none")j.style.display=""}e.length&&g.setTabActive(h||e[0].id);(h=c.getAttribute("oninit"))&&eval(h)}}dhtmlxEvent(window,"load",dhx_init_tabbars);function dhtmlXAccordionItem(){}
function dhtmlXAccordion(a,b){if(window.dhtmlXContainer){var c=this;this.skin=b!=null?b:typeof dhtmlx!="undefined"&&typeof dhtmlx.skin=="string"?dhtmlx.skin:"dhx_skyblue";if(a==document.body){this._isAccFS=!0;document.body.className+=" dhxacc_fullscreened";var d=document.createElement("DIV");d.className="dhxcont_global_layout_area";a.appendChild(d);this.cont=new dhtmlXContainer(a);this.cont.setContent(d);a.adjustContent(a,0);this.base=document.createElement("DIV");this.base.className="dhx_acc_base_"+
this.skin;this.base.style.overflow="hidden";this.base.style.position="absolute";this._adjustToFullScreen=function(){this.base.style.left="2px";this.base.style.top="2px";this.base.style.width=parseInt(d.childNodes[0].style.width)-4+"px";this.base.style.height=parseInt(d.childNodes[0].style.height)-4+"px"};this._adjustToFullScreen();d.childNodes[0].appendChild(this.base);this._resizeTM=null;this._resizeTMTime=400;this._doOnResize=function(){window.clearTimeout(c._resizeTM);c._resizeTM=window.setTimeout(function(){c._adjustAccordion()},
c._resizeTMTime)};this._adjustAccordion=function(){document.body.adjustContent(document.body,0);this._adjustToFullScreen();this.setSizes()};dhtmlxEvent(window,"resize",this._doOnResize)}else this.base=typeof a=="string"?document.getElementById(a):a,this.base.className="dhx_acc_base_"+this.skin,this.base.innerHTML="";this.w=this.base.offsetWidth;this.h=this.base.offsetHeight;this.skinParams={dhx_blue:{cell_height:24,cell_space:1,content_offset:1},dhx_skyblue:{cell_height:27,cell_space:-1,content_offset:-1},
dhx_black:{cell_height:24,cell_space:1,content_offset:1},dhx_web:{cell_height:26,cell_space:9,content_offset:0,cell_pading_max:1,cell_pading_min:0},dhx_terrace:{cell_height:37,cell_space:-1,content_offset:-1}};this.sk=this.skinParams[this.skin];this.setSkinParameters=function(a,b){isNaN(a)||(this.sk.cell_space=a);isNaN(b)||(this.sk.content_offset=b);this._reopenItem()};this.setSkin=function(a){if(this.skinParams[a]){this.skin=a;this.sk=this.skinParams[this.skin];this.base.className="dhx_acc_base_"+
this.skin+(this._r?" dhx_acc_rtl":"");for(var b in this.idPull)this.idPull[b].skin=this.skin;this._reopenItem()}};this.idPull={};this.opened=null;this.cells=function(a){return this.idPull[a]==null?null:this.idPull[a]};this.itemH=90;this.multiMode=!1;this.enableMultiMode=function(){var a=0,b;for(b in this.idPull)a++;if(a==0)this.userOffset||(this.skinParams.dhx_skyblue.cell_space=3),this.multiMode=!0;this.skin=="dhx_terrace"&&(this.skinParams.dhx_terrace.cell_space=12)};this.userOffset=!1;this.setOffset=
function(a,b){this.userOffset=!0;isNaN(a)||(this.skinParams[this.skin].cell_space=a);isNaN(b)||(this.skinParams[this.skin].content_offset=b);this.setSizes()};this.imagePath="";this.setIconsPath=function(a){this.imagePath=a};this.addItem=function(a,b){if(this.multiMode)var d=this._lastVisible();var h=document.createElement("DIV");h.className="dhx_acc_item";h.dir="ltr";h._isAcc=!0;h.skin=this.skin;this.base.appendChild(h);if(this.multiMode)h.h=this.itemH;var i=document.createElement("DIV");i._idd=a;
i.className="dhx_acc_item_label";i.innerHTML="<span>"+b+"</span><div class='dhx_acc_item_label_btmbrd'>&nbsp;</div><div class='dhx_acc_item_arrow'></div><div class='dhx_acc_hdr_line_l'></div><div class='dhx_acc_hdr_line_r'></div>";i.onselectstart=function(a){a=a||event;a.returnValue=!1};i.onclick=function(){if(c.multiMode||!c.idPull[this._idd]._isActive)c.multiMode?(c.idPull[this._idd]._isActive?c.checkEvent("onBeforeActive")?c.callEvent("onBeforeActive",[this._idd,"close"])&&c.closeItem(this._idd,
"dhx_accord_outer_event"):c.closeItem(this._idd,"dhx_accord_outer_event"):c.checkEvent("onBeforeActive")?c.callEvent("onBeforeActive",[this._idd,"open"])&&c.openItem(this._idd,"dhx_accord_outer_event"):c.openItem(this._idd,"dhx_accord_outer_event"),c._autoHeightEnabled&&c.setSizes()):c.checkEvent("onBeforeActive")?c.callEvent("onBeforeActive",[this._idd,"open"])&&c.openItem(this._idd,"dhx_accord_outer_event"):c.openItem(this._idd,"dhx_accord_outer_event")};i.onmouseover=function(){this.className=
"dhx_acc_item_label dhx_acc_item_lavel_hover"};i.onmouseout=function(){this.className="dhx_acc_item_label"};h.appendChild(i);var j=document.createElement("DIV");j.className="dhxcont_global_content_area";h.appendChild(j);var k=new dhtmlXContainer(h);k.setContent(j);this.skin=="dhx_terrace"&&this._hideBorders===!0&&h._setPadding([0,-1,2,0]);h.adjustContent(h,this.sk.cell_height+this.sk.content_offset);h._id=a;this.idPull[a]=h;h.getId=function(){return this._id};h.setText=function(a){c.setText(this._id,
a)};h.getText=function(){return c.getText(this._id)};h.open=function(){c.openItem(this._id)};h.isOpened=function(){return c.isActive(this._id)};h.close=function(){c.closeItem(this._id)};h.setIcon=function(a){c.setIcon(this._id,a)};h.clearIcon=function(){c.clearIcon(this._id)};h.dock=function(){c.dockItem(this._id)};h.undock=function(){c.undockItem(this._id)};h.show=function(){c.showItem(this._id)};h.hide=function(){c.hideItem(this._id)};h.setHeight=function(a){c.setItemHeight(this._id,a)};h.moveOnTop=
function(){c.moveOnTop(this._id)};h._doOnAttachMenu=function(){c._reopenItem()};h._doOnAttachToolbar=function(){c._reopenItem()};h._doOnAttachStatusBar=function(){c._reopenItem()};h._doOnFrameContentLoaded=function(){c.callEvent("onContentLoaded",[this])};if(this.multiMode&&d!=null)d._isActive==!0?(this.idPull[d._id].adjustContent(this.idPull[d._id],this.sk.cell_height+this.sk.content_offset,null,null,this.sk.cell_space),this.idPull[d._id].updateNestedObjects()):this.idPull[d._id].style.height=this.sk.cell_height+
this.sk.cell_space+"px",d=null;var m=this._enableOpenEffect;this._enableOpenEffect=!1;this.openItem(a);this._enableOpenEffect=m;this.multiMode?this.setSizes():this._defineLastItem();return h};this.openItem=function(a,b,c){this.multiMode&&this._checkAutoHeight();if(!this._openBuzy)if(this._enableOpenEffect&&!c)(!this.multiMode||!this.idPull[a]._isActive)&&this._openWithEffect(a,null,null,null,null,b);else if(this.multiMode)for(var d in this.idPull){if(this.idPull[d]._isActive||d==a)this.idPull[d].style.height=
this.idPull[d].h+"px",this.idPull[d].childNodes[1].style.display="",this.skin=="dhx_web"&&this.idPull[d]._setPadding(this.skinParams[this.skin].cell_pading_max,"dhxcont_acc_dhx_web"),this.idPull[d].adjustContent(this.idPull[d],this.sk.cell_height+this.sk.content_offset,null,null,this.idPull[d]==this._lastVisible()&&this.skin!="dhx_web"?0:this.sk.cell_space),this.idPull[d].updateNestedObjects(),this.idPull[d]._isActive=!0,this._updateArrows(),b=="dhx_accord_outer_event"&&d==a&&this.callEvent("onActive",
[a,!0])}else if(!a||!this.idPull[a]._isActive||c){var i=0;for(d in this.idPull)if(this.idPull[d].style.height=this.sk.cell_height+(this.idPull[d]!=this._lastVisible()&&d!=a?this.sk.cell_space:0)+"px",d!=a)this.idPull[d].childNodes[1].style.display="none",this.skin=="dhx_web"&&this.idPull[d]._setPadding(this.skinParams[this.skin].cell_pading_min,""),this.idPull[d]._isActive=!1,i+=this.idPull[d].offsetHeight;i=this.base.offsetHeight-i;if(a)this.idPull[a].style.height=i+"px",this.idPull[a].childNodes[1].style.display=
"",this.skin=="dhx_web"&&this.idPull[a]._setPadding(this.skinParams[this.skin].cell_pading_max,"dhxcont_acc_dhx_web"),this.idPull[a].adjustContent(this.idPull[a],this.sk.cell_height+this.sk.content_offset,null,null,this.idPull[a]==this._lastVisible()?0:this.sk.cell_space),this.idPull[a].updateNestedObjects(),this.idPull[a]._isActive=!0,b=="dhx_accord_outer_event"&&this.callEvent("onActive",[a,!0]);this._updateArrows()}};this._lastVisible=function(){for(var a=null,b=this.base.childNodes.length-1;b>=
0;b--)!this.base.childNodes[b]._isHidden&&!a&&(a=this.base.childNodes[b]);return a};this.closeItem=function(a,b){if(this.idPull[a]!=null&&this.idPull[a]._isActive&&!this._openBuzy)this._enableOpenEffect?this._openWithEffect(this.multiMode?a:null,null,null,null,null,b):(this.idPull[a].style.height=this.sk.cell_height+(this.idPull[a]!=this._lastVisible()?this.sk.cell_space:0)+"px",this.idPull[a].childNodes[1].style.display="none",this.skin=="dhx_web"&&this.idPull[a]._setPadding(this.skinParams[this.skin].cell_pading_min,
""),this.idPull[a]._isActive=!1,b=="dhx_accord_outer_event"&&this.callEvent("onActive",[a,!1]),this._updateArrows())};this._updateArrows=function(){for(var a in this.idPull){for(var b=this.idPull[a].childNodes[0],c=null,d=0;d<b.childNodes.length;d++)String(b.childNodes[d].className).search("dhx_acc_item_arrow")!=-1&&(c=b.childNodes[d]);if(c!=null)c.className="dhx_acc_item_arrow "+(this.idPull[a]._isActive?"item_opened":"item_closed"),c=null}};this.setText=function(a,b,d){if(c.idPull[a]!=null){for(var h=
c.idPull[a].childNodes[0],i=null,j=0;j<h.childNodes.length;j++)h.childNodes[j].tagName!=null&&String(h.childNodes[j].tagName).toLowerCase()=="span"&&(i=h.childNodes[j]);isNaN(d)?i.innerHTML=b:(i.style.paddingLeft=d+"px",i.style.paddingRight=d+"px")}};this.getText=function(a){if(c.idPull[a]!=null){for(var b=c.idPull[a].childNodes[0],d=null,h=0;h<b.childNodes.length;h++)b.childNodes[h].tagName!=null&&String(b.childNodes[h].tagName).toLowerCase()=="span"&&(d=b.childNodes[h]);return d.innerHTML}};this._initWindows=
function(a){if(window.dhtmlXWindows){if(!this.dhxWins&&(this.dhxWins=new dhtmlXWindows,this.dhxWins.setSkin(this.skin),this.dhxWins.setImagePath(this.imagePath),this.dhxWinsIdPrefix="",!a))return;var b=this.dhxWinsIdPrefix+a;if(this.dhxWins.window(b))this.dhxWins.window(b).show();else{var c=this,d=this.dhxWins.createWindow(b,20,20,320,200);d.setText(this.getText(a));d.button("close").hide();d.attachEvent("onClose",function(a){a.hide()});d.addUserButton("dock",99,this.dhxWins.i18n.dock,"dock");d.button("dock").attachEvent("onClick",
function(){c.cells(a).dock()})}}};this.dockWindow=function(a){if(this.idPull[a]._isUnDocked&&this.dhxWins&&this.dhxWins.window(this.dhxWinsIdPrefix+a))this.dhxWins.window(this.dhxWinsIdPrefix+a).moveContentTo(this.idPull[a]),this.dhxWins.window(this.dhxWinsIdPrefix+a).close(),this.idPull[a]._isUnDocked=!1,this.showItem(a),this.callEvent("onDock",[a])};this.undockWindow=function(a){if(!this.idPull[a]._isUnDocked)this._initWindows(a),this.idPull[a].moveContentTo(this.dhxWins.window(this.dhxWinsIdPrefix+
a)),this.idPull[a]._isUnDocked=!0,this.hideItem(a),this.callEvent("onUnDock",[a])};this.setSizes=function(){this._reopenItem()};this.showItem=function(a){if(this.idPull[a]!=null&&this.idPull[a]._isHidden)this.idPull[a]._isUnDocked?this.dockItem(a):(this.idPull[a].className="dhx_acc_item",this.idPull[a]._isHidden=!1,this._defineLastItem(),this._reopenItem())};this.hideItem=function(a){if(this.idPull[a]!=null&&!this.idPull[a]._isHidden)this.closeItem(a),this.idPull[a].className="dhx_acc_item_hidden",
this.idPull[a]._isHidden=!0,this._defineLastItem(),this._reopenItem()};this.isItemHidden=function(a){return this.idPull[a]==null?void 0:this.idPull[a]._isHidden==!0};this._reopenItem=function(){var a=null,b;for(b in this.idPull)this.idPull[b]._isActive&&!this.idPull[b]._isHidden&&(a=b);this.openItem(a,null,!0)};this.forEachItem=function(a){for(var b in this.idPull)a(this.idPull[b])};this._enableOpenEffect=!1;this._openStep=10;this._openStepIncrement=5;this._openStepTimeout=10;this._openBuzy=!1;this.setEffect=
function(a){this._enableOpenEffect=a==!0?!0:!1};this._openWithEffect=function(a,b,c,d,i,j){if(this.multiMode){if(!i)this._openBuzy=!0,i=this._openStep,this.idPull[a]._isActive?(b=a,a=null,c=this.sk.cell_height+(this.idPull[b]!=this._lastVisible()?this.sk.cell_space:0),this.idPull[b].childNodes[1].style.display=""):(d=this.idPull[a].h,this.idPull[a].childNodes[1].style.display="");var k=!1;if(a){var m=parseInt(this.idPull[a].style.height||0)+i;m>d&&(m=d,k=!0);this.idPull[a].style.height=m+"px"}if(b)m=
parseInt(this.idPull[b].style.height)-i,m<c&&(m=c,k=!0),this.idPull[b].style.height=m+"px";i+=this._openStepIncrement;if(k){if(a)this.idPull[a].adjustContent(this.idPull[a],this.sk.cell_height+this.sk.content_offset,null,null,this.idPull[a]==this._lastVisible()?0:this.sk.cell_space),this.idPull[a].updateNestedObjects(),this.idPull[a]._isActive=!0;if(b)this.idPull[b].childNodes[1].style.display="none",this.idPull[b]._isActive=!1;this._updateArrows();this._openBuzy=!1;a&&j=="dhx_accord_outer_event"&&
this.callEvent("onActive",[a,!0]);b&&j=="dhx_accord_outer_event"&&this.callEvent("onActive",[b,!1])}else{var l=this;window.setTimeout(function(){l._openWithEffect(a,b,c,d,i,j)},this._openStepTimeout)}}else{if(!i&&(this._openBuzy=!0,i=this._openStep,a))this.idPull[a].childNodes[1].style.display="";if(!b||!c||!d){var d=c=0,n;for(n in this.idPull){var o=this.sk.cell_height+(this.idPull[n]!=this._lastVisible()&&n!=a?this.sk.cell_space:0);this.idPull[n]._isActive&&a!=n&&(b=n,c=o);n!=a&&(d+=o)}d=this.base.offsetHeight-
d}k=!1;if(a){var p=parseInt(this.idPull[a].style.height)+i;p>d&&(k=!0)}if(b){var r=parseInt(this.idPull[b].style.height)-i;r<c&&(k=!0)}i+=this._openStepIncrement;k&&(p=d,r=c);if(b)this.idPull[b].style.height=r+"px";if(a)this.idPull[a].style.height=p+"px";if(k){if(b)this.idPull[b].childNodes[1].style.display="none",this.idPull[b]._isActive=!1;if(a)this.idPull[a].adjustContent(this.idPull[a],this.sk.cell_height+this.sk.content_offset,null,null,this.idPull[a]==this._lastVisible()?0:this.sk.cell_space),
this.idPull[a].updateNestedObjects(),this.idPull[a]._isActive=!0;this._updateArrows();this._openBuzy=!1;j=="dhx_accord_outer_event"&&a&&this.callEvent("onActive",[a,!0])}else l=this,window.setTimeout(function(){l._openWithEffect(a,b,c,d,i,j)},this._openStepTimeout)}};this.setActive=function(a){this.openItem(a)};this.isActive=function(a){return this.idPull[a]._isActive===!0?!0:!1};this.dockItem=function(a){this.dockWindow(a)};this.undockItem=function(a){this.undockWindow(a)};this.setItemHeight=function(a,
b){if(this.multiMode){if(b=="*")this.idPull[a].h_auto=!0;else{if(isNaN(b))return;this.idPull[a].h_auto=!1;this.idPull[a].h=b}this._reopenItem()}};this._checkAutoHeight=function(){var a=this.base.offsetHeight;this._autoHeightEnabled=!1;var b=[],c;for(c in this.idPull){if(!this._autoHeightEnabled&&this.idPull[c].h_auto)this._autoHeightEnabled=!0;this.idPull[c].h_auto&&this.idPull[c]._isActive?b.push(c):a=this.idPull[c]._isActive?Math.max(0,a-this.idPull[c].h):Math.max(0,a-this.idPull[c].offsetHeight)}if(b.length>
0)for(var d=Math.floor(a/b.length),i=0;i<b.length;i++)i==b.length-1?d=a:a-=d,this.idPull[b[i]].h=d};this.setIcon=function(a,b){if(this.idPull[a]!=null){for(var c=this.idPull[a].childNodes[0],d=null,i=0;i<c.childNodes.length;i++)c.childNodes[i].className=="dhx_acc_item_icon"&&(d=c.childNodes[i]);if(d==null)d=document.createElement("IMG"),d.className="dhx_acc_item_icon",c.insertBefore(d,c.childNodes[0]),this.setText(a,null,20);d.src=this.imagePath+b}};this.clearIcon=function(a){if(this.idPull[a]!=null){for(var b=
this.idPull[a].childNodes[0],c=null,d=0;d<b.childNodes.length;d++)b.childNodes[d].className=="dhx_acc_item_icon"&&(c=b.childNodes[d]);c!=null&&(b.removeChild(c),c=null,this.setText(a,null,0))}};this.moveOnTop=function(a){this.idPull[a]&&!(this.base.childNodes.length<=1)&&(this.base.insertBefore(this.idPull[a],this.base.childNodes[0]),this.setSizes())};this._defineLastItem=function(){if(!this.multiMode)for(var a=!1,b=this.base.childNodes.length-1;b>=0;b--)this.base.childNodes[b].className.search("last_item")>=
0?this.base.childNodes[b]._isHidden||a?this.base.childNodes[b].className=String(this.base.childNodes[b].className).replace(/last_item/gi,""):a=!0:!this.base.childNodes[b]._isHidden&&!a&&(this.base.childNodes[b].className+=" last_item",a=!0)};this.removeItem=function(a){var b=this.idPull[a],c=b.childNodes[0];c.onclick=null;c.onmouseover=null;c.onmouseout=null;c.onselectstart=null;c._idd=null;c.className="";for(b._dhxContDestruct();c.childNodes.length>0;)c.removeChild(c.childNodes[0]);c.parentNode&&
c.parentNode.removeChild(c);for(c=null;b.childNodes.length>0;)b.removeChild(b.childNodes[0]);b._dhxContDestruct=null;b._doOnAttachMenu=null;b._doOnAttachToolbar=null;b._doOnAttachStatusBar=null;b.clearIcon=null;b.close=null;b.dock=null;b.getId=null;b.getText=null;b.hide=null;b.isOpened=null;b.open=null;b.setHeight=null;b.setIcon=null;b.setText=null;b.show=null;b.undock=null;b.parentNode&&b.parentNode.removeChild(b);b=null;this.idPull[a]=null;try{delete this.idPull[a]}catch(d){}};this.unload=function(){for(var a in this.skinParams){this.skinParams[a]=
null;try{delete this.skinParams[a]}catch(b){}}this.skinParams=null;for(a in this.idPull)this.removeItem(a);this.userOffset=this.unload=this.undockWindowunload=this.undockWindow=this.undockItem=this.w=this.skin=this.showItem=this.setText=this.setSkinParameters=this.setSkin=this.setSizes=this.setOffset=this.setItemHeight=this.setIconsPath=this.setIcon=this.setEffect=this.setActive=this.removeItem=this.openItem=this.multiMode=this.itemH=this.isActive=this.imagePath=this.hideItem=this.h=this.getText=
this.forEachItem=this.eventCatcher=this.enableMultiMode=this.dockWindow=this.dockItem=this.detachEvent=this.closeItem=this.clearIcon=this.checkEvent=this.cells=this.callEvent=this.attachEvent=this.addItem=this._updateArrows=this._reopenItem=this._lastVisible=this._initWindows=this.sk=this.idPull=null;if(this._isAccFS==!0)_isIE?window.detachEvent("onresize",this._doOnResize):window.removeEventListener("resize",this._doOnResize,!1),this._resizeTMTime=this._resizeTM=this._adjustToFullScreen=this._adjustAccordion=
this._doOnResize=this._isAccFS=null,document.body.className=String(document.body.className).replace("dhxacc_fullscreened",""),this.cont.obj._dhxContDestruct(),this.cont.dhxcont.parentNode&&this.cont.dhxcont.parentNode.removeChild(this.cont.dhxcont),this.cont.dhxcont=null,this.cont=this.cont.setContent=null;if(this.dhxWins)this.dhxWins.unload(),this.dhxWins=null;this.base.className="";this.base=null;for(a in this)try{delete this[a]}catch(c){}};this._initWindows();dhtmlxEventable(this);return this}else alert(this.i18n.dhxcontalert)}
dhtmlXAccordion.prototype.i18n={dhxcontalert:"dhtmlxcontainer.js is missed on the page"};
(function(){dhtmlx.extend_api("dhtmlXAccordion",{_init:function(a){return[a.parent,a.skin]},icon_path:"setIconsPath",items:"_items",effect:"setEffect",multi_mode:"enableMultiMode"},{_items:function(a){for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d];this.addItem(e.id,e.text);e.img&&this.cells(e.id).setIcon(e.img);e.height&&this.cells(e.id).setHeight(e.height);if(e.open===!0)b[b.length]=e.id;if(e.open===!1)c[c.length]=e.id}for(var f=0;f<b.length;f++)this.cells(b[f]).open();for(f=0;f<c.length;f++)this.cells(c[f]).close()}})})();
dhtmlXAccordion.prototype.loadJSON=function(a){var b={skin:"setSkin",icons_path:"setIconsPath",multi_mode:"enableMultiMode",effect:"setEffect"},c;for(c in b)if(typeof a[c]!="undefined")this[b[c]](a[c]);for(var d=null,e=0;e<a.cells.length;e++)if(this.addItem(a.cells[e].id,a.cells[e].text),typeof a.cells[e].icon!="undefined"&&this.setIcon(a.cells[e].id,a.cells[e].icon),typeof a.cells[e].height!="undefined"&&this.setItemHeight(a.cells[e].id,a.cells[e].height),typeof a.cells[e].open!="undefined")d=a.cells[e].id;
d!=null&&this.openItem(d)};
dhtmlXAccordion.prototype.loadXML=function(a,b){var c=this;this.callEvent("onXLS",[]);dhtmlxAjax.get(a,function(a){var e=a.xmlDoc.responseXML.getElementsByTagName("accordion")[0],f={0:!1,"true":!0,1:!0,y:!0,yes:!0},g={cells:[]};if(e.getAttribute("skin")!=null)g.skin=e.getAttribute("skin");if(e.getAttribute("iconsPath")!=null)g.icons_path=e.getAttribute("iconsPath");if(e.getAttribute("mode")=="multi")g.multi_mode=!0;if(f[e.getAttribute("openEffect")||0])g.effect=!0;for(var h=null,i=0;i<e.childNodes.length;i++)if(typeof e.childNodes[i].tagName!=
"indefined"&&String(e.childNodes[i].tagName).toLowerCase()=="cell"){var j=e.childNodes[i].getAttribute("id")||c._genStr(12),k=e.childNodes[i].firstChild.nodeValue||"";g.cells.push({id:j,text:k});if(e.childNodes[i].getAttribute("icon")!=null)g.cells[g.cells.length-1].icon=e.childNodes[i].getAttribute("icon");if(e.childNodes[i].getAttribute("height")!=null)g.cells[g.cells.length-1].height=e.childNodes[i].getAttribute("height");if(f[e.childNodes[i].getAttribute("open")||0])g.cells[g.cells.length-1].open=
!0}c.loadJSON(g);c.callEvent("onXLE",[]);typeof b=="function"&&b();c=b=null})};
function dhtmlxSlider(a,b,c,d,e,f,g,h){if(_isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(i){}var j;if(a&&typeof a=="object"&&!a.nodeName)j=a.parent,c=a.skin,e=a.min,f=a.max,h=a.step,d=a.vertical,g=a.value,b=a.size;if(a)j=typeof a!="object"?document.getElementById(a):a;else{var k="slider_div_"+(new Date).valueOf()+Math.random(1E3);j=document.createElement("div");j.setAttribute("id",k);for(var m=document.body.lastChild;m.lastChild&&m.lastChild.nodeType==1;)m=m.lastChild;m.parentNode.insertBefore(j,
m)}if(typeof b=="object")c=b.skin,e=b.min,f=b.max,h=b.step,d=b.vertical,g=b.value,b=b.size;this.size=b;this.vMode=d||!1;this.skin=dhtmlx.skin||c||"default";this.parent=j;this.disabled=this.isInit=!1;this.value=g=="undefined"?e||0:g;this.inputPriority=!0;this.stepping=!1;this.imgURL=window.dhx_globalImgPath||dhtmlx.image_path||"";this._skinsImgs={"default":{ls:1,lz:1,rz:1,rs:1},ball:{ls:1,lz:1,rz:1,rs:1},zipper:{bg:1,lz:1,rz:1},arrow:{bg:1,ls:1,rs:1},arrowgreen:{bg:1,ls:1,rs:1},simplesilver:{lz:1,
ls:1,rs:1,rz:1},simplegray:{lz:1,ls:1,rs:1,rz:1},bar:{bg:1,ls:1,rs:1},dhx_skyblue:{bg:1}};this._def=[e-0||0,f-0||100,h-0||1,g-0||0,b-0];dhtmlxEventable(this);return this}
dhtmlxSlider.prototype.createStructure=function(){if(this.con)this.con.parentNode.removeChild(this.con),this.con=null;if(this.vMode){this._sW="height";this._sH="width";this._sL="top";this._sT="left";var a=this.imgURL+"skins/"+this.skin+"/vertical/"}else this._sW="width",this._sH="height",this._sL="left",this._sT="top",a=this.imgURL+"skins/"+this.skin+"/";this.con=document.createElement("DIV");this.con.onselectstart=function(){return!1};this.con._etype="slider";this.con.className="dhtmlxSlider"+(this.skin!=
"default"?"_"+this.skin:"");if(this._skinsImgs[this.skin].bg)this.con.style.backgroundImage="url("+a+"bg.gif)";this.drag=document.createElement("DIV");this.drag._etype="drag";this.drag.className="selector";this.drag.style.backgroundImage="url("+a+"selector.gif)";var b=document.createElement("DIV");b.className="leftSide";if(this._skinsImgs[this.skin].ls)b.style.background="url("+a+"leftside_bg.gif)";this.leftZone=document.createElement("DIV");this.leftZone.className="leftZone";if(this._skinsImgs[this.skin].lz)this.leftZone.style.background=
"url("+a+"leftzone_bg.gif)";var c=document.createElement("DIV");c.className="rightSide";if(this._skinsImgs[this.skin].rs)c.style.background="url("+a+"rightside_bg.gif)";this.rightZone=document.createElement("DIV");this.rightZone.className="rightZone";if(this._skinsImgs[this.skin].rz)this.rightZone.style.background="url("+a+"rightzone_bg.gif)";this.con.appendChild(b);this.con.appendChild(this.leftZone);this.con.appendChild(this.rightZone);this.con.appendChild(c);this.con.appendChild(this.drag);this.parent.appendChild(this.con);
(!this.parent.parentNode||!this.parent.parentNode.tagName)&&document.body.appendChild(this.parent);if(this.vMode){this._sW="height";this._sH="width";this._sL="top";this._sT="left";this.con.style.width=this.con.offsetHeight+"px";for(var d=0;d<this.con.childNodes.length;d++){this.con.childNodes[d].style.fontSize="0";var e=this.con.childNodes[d].offsetWidth;this.con.childNodes[d].style.width=this.con.childNodes[d].offsetHeight+"px";this.con.childNodes[d].style.height=e+"px";e=this.con.childNodes[d].offsetLeft;
this.con.childNodes[d].style.left=this.con.childNodes[d].offsetTop+"px";this.con.childNodes[d].style.top=e+"px"}c.style.top=this.size-c.offsetHeight+"px";this.zoneSize=this.size-c.offsetHeight;this.dragLeft=this.drag.offsetTop;this.dragWidth=this.drag.offsetHeight;this.rightZone.style.height=this.zoneSize+"px"}else this.zoneSize=this.size-c.offsetWidth,this.dragLeft=this.drag.offsetLeft,this.dragWidth=this.drag.offsetWidth,this.rightZone.style.width=this.zoneSize+"px";this.con.style[this._sW]=this.size+
"px";this.con.onmousedown=this._onMouseDown;this.con.onmouseup=this.con.onmouseout=function(){clearInterval(this.that._int)};this.con.that=this;this._aCalc(this._def)};
dhtmlxSlider.prototype._aCalc=function(a){if(this.isInit){this.shift=a[0];this.limit=a[1]-this.shift;this._mod=(a[4]-this.dragLeft*2-this.dragWidth)/this.limit;this._step=a[2];this.step=this._step*this._mod;this._xlimit=a[4]-this.dragLeft*2-this.dragWidth;if(!this.posX)this.posX=this._xlimit*(a[3]-this.shift)/this.limit;this._applyPos(!0);return this}};dhtmlxSlider.prototype.setMin=function(a){this._def[0]=a-0;this._aCalc(this._def)};dhtmlxSlider.prototype.setMax=function(a){this._def[1]=a-0;this._aCalc(this._def)};
dhtmlxSlider.prototype.setStep=function(a){this._def[2]=a-0;this._aCalc(this._def)};
dhtmlxSlider.prototype._applyPos=function(a){if(this.isInit){if(this.step!=1&&this.step)this.posX=Math.round(this.posX/this.step)*this.step;if(this.posX<0)this.posX=0;if(this.value<(this._def[0]||0))this.value=this._def[0]||0;if(this.value>this._def[1])this.value=this._def[1];if(this.posX>this._xlimit)this.posX=this._xlimit;var b=this.drag.style[this._sL];this.drag.style[this._sL]=this.posX+this.dragLeft*1+"px";this.leftZone.style[this._sW]=this.posX+this.dragLeft*1+"px";this.rightZone.style[this._sL]=
this.posX+this.dragLeft*1+1+"px";this.rightZone.style[this._sW]=this.zoneSize-(this.posX+this.dragLeft*1)+"px";var c=this.getValue();if(this._link)this._linkBoth?this._link.value=c:this._link.innerHTML=c;!a&&b!=this.drag.style[this._sL]&&this.callEvent("onChange",[c,this]);this.value=this.getValue();this._dttp||this._setTooltip(c)}};dhtmlxSlider.prototype._setTooltip=function(a){this.con.title=a};dhtmlxSlider.prototype.setSkin=function(a){this.skin=a||"default";this.isInit&&this.createStructure()};
dhtmlxSlider.prototype.startDrag=function(a){if(!this._busy&&(a.button===0||a.button===1)){this.drag_mx=a.clientX;this.drag_my=a.clientY;this.drag_cx=this.posX;this.d_b_move=document.body.onmousemove;this.d_b_up=document.body.onmouseup;var b=this;document.body.onmouseup=function(a){b.stopDrag(a||event);b=null};document.body.onmousemove=function(a){b.onDrag(a||event)};this._busy=!0}};
dhtmlxSlider.prototype.onDrag=function(a){if(this._busy)this.posX=this.vMode?this.drag_cx+a.clientY-this.drag_my:this.drag_cx+a.clientX-this.drag_mx,this._applyPos()};dhtmlxSlider.prototype.stopDrag=function(){document.body.onmousemove=this.d_b_move?this.d_b_move:null;document.body.onmouseup=this.d_b_up?this.d_b_up:null;this.d_b_move=this.d_b_up=null;this._busy=!1;this.callEvent("onSlideEnd",[this.getValue()])};
dhtmlxSlider.prototype.getValue=function(){return!this._busy&&this.inputPriority?(Math.round(this.value/this._step)*this._step).toFixed(6)-0:Math.round((Math.round(this.posX/this._mod/this._step)*this._step+this.shift*1)*1E4)/1E4};dhtmlxSlider.prototype.setValue=function(a,b){if(!isNaN(a))this._def[3]=this.value=a-0,this.posX=Math.round(((a||0)-this.shift)*this._mod),this._applyPos(b==null?!0:b)};
dhtmlxSlider.prototype._getActionElement=function(a){return a._etype?a:a.parentNode?this._getActionElement(a.parentNode):null};
dhtmlxSlider.prototype._onMouseDown=function(a){if(!this.that.disabled){var a=a||event,b=this.that,c=b._getActionElement(_isIE?a.srcElement:a.target);switch(c._etype){case "slider":var d=b.vMode?a.clientY-(getAbsoluteTop(b.con)-document.body.scrollTop):a.clientX-(getAbsoluteLeft(b.con)-document.body.scrollLeft),e=b.posX;b.posX=d-b.dragLeft-b.dragWidth/2;b.direction=b.posX>e?1:-1;b.stepping?(clearInterval(b._int),b.setValue(b.value+b._step*b.direction,!1),b._int=setInterval(function(){b.setValue(b.value+
b._step*b.direction,!1)},600)):(b._busy=!0,b._applyPos(),b._busy=!1);break;case "drag":b.startDrag(a||event)}return!1}};dhtmlxSlider.prototype.setOnChangeHandler=function(a){this.attachEvent("onChange",a)};dhtmlxSlider.prototype._linkFrom=function(){this.disabled||this.setValue(parseFloat(this._link.value),!1)};
dhtmlxSlider.prototype.linkTo=function(a){this._link=a=typeof a!="object"?document.getElementById(a):a;var b=a.tagName.toString().toLowerCase();if(this._linkBoth=b=="input"||b=="select"||b=="textarea"?1:0){var c=this,d=function(){this._nextSlider&&window.clearTimeout(this._nextSlider);this._nextSlider=window.setTimeout(function(){c._linkFrom()},500)};a.onblur=a.onkeypress=a.onchange=d}this._applyPos()};
dhtmlxSlider.prototype.enableTooltip=function(a){this._dttp=!convertStringToBoolean(a);this._setTooltip(this._dttp?"":this.getValue())};dhtmlxSlider.prototype.setImagePath=function(a){this.imgURL=a};dhtmlxSlider.prototype.init=function(){this.isInit=!0;this.createStructure()};dhtmlxSlider.prototype.setInputPriority=function(a){this.inputPriority=a};dhtmlxSlider.prototype.setSteppingMode=function(a){this.stepping=a};dhtmlxSlider.prototype.disable=function(a){this.disabled=a};
(function(){dhtmlx.extend_api("dhtmlxSlider",{_init:function(a){return[a.parent,a.size,a.skin,a.vertical,a.min,a.max,a.value,a.step]},link:"linkTo"},{})})();
function dhtmlXEditor(a,b){var c=this;this.skin=b||dhtmlx.skin||"dhx_skyblue";this.iconsPath=dhtmlx.image_path||"../../codebase/imgs/";typeof a=="string"&&(a=document.getElementById(a));for(this.base=a;this.base.childNodes.length>0;)this.base.removeChild(this.base.childNodes[0]);this.tbData=(this._isToolbar=this.initDhtmlxToolbar!=null&&window.dhtmlXToolbarObject!=null?!0:!1)?"":"<div class='dhxeditor_"+this.skin+"_btns'><a href='javascript:void(0);' onclick='return false;' tabindex='-1'><div actv='b' cmd='applyBold' class='dhxeditor_"+
this.skin+"_tbbtn btn_bold'></div></a><a href='javascript:void(0);' onclick='return false;' tabindex='-1'><div actv='i' cmd='applyItalic' class='dhxeditor_"+this.skin+"_tbbtn btn_italic'></div></a><a href='javascript:void(0);' onclick='return false;' tabindex='-1'><div actv='u' cmd='applyUnderscore' class='dhxeditor_"+this.skin+"_tbbtn btn_underline'></div></a><a href='javascript:void(0);' onclick='return false;' tabindex='-1'><div actv='c' cmd='clearFormatting' class='dhxeditor_"+this.skin+"_tbbtn btn_clearformat'></div></a><div class='verline_l'></div><div class='verline_r'></div></div>";
var d=_isIE?this.base.currentStyle.position:window.getComputedStyle(this.base,null).getPropertyValue("position");if(!(d=="relative"||d=="absolute"))this.base.style.position="relative";this.base.innerHTML=this.tbData+"<div style='position:absolute; width: 100%; overflow: hidden;'></div>";var e=new dhtmlXContainerLite(this.base);e.skin=this.skin;e.setContent(this.base.childNodes[this._isToolbar?0:1]);var f=this._isToolbar?0:this.base.childNodes[0].offsetHeight;this.base.adjustContent(this.base,f);this.cBlock=
document.createElement("DIV");this.cBlock.className="dhxcont_content_blocker";this.cBlock.style.display="none";this.base.appendChild(this.cBlock);this.editor=document.createElement("IFRAME");this.editor.className="dhxeditor_mainiframe_"+this.skin;this.editor.frameBorder=0;if(_isOpera)this.editor.scrolling="yes";var g=this.editor;if(_isIE)g.onreadystatechange=function(){if(g.readyState=="complete")try{this.contentWindow.document.body.attachEvent("onfocus",function(a){c._ev("focus",a)}),this.contentWindow.document.body.attachEvent("onblur",
function(a){c._ev("blur",a)}),this.contentWindow.document.body.attachEvent("onkeydown",function(a){c._ev("keydown",a)}),this.contentWindow.document.body.attachEvent("onkeyup",function(a){c._ev("keyup",a)}),this.contentWindow.document.body.attachEvent("onkeypress",function(a){c._ev("keypress",a)}),this.contentWindow.document.body.attachEvent("onmouseup",function(a){c._ev("mouseup",a)}),this.contentWindow.document.body.attachEvent("onmousedown",function(a){c._ev("mousedown",a)}),this.contentWindow.document.body.attachEvent("onclick",
function(a){c._ev("click",a)})}catch(a){}},g.onunload=function(){this.contentWindow.document.body.detachEvent("onfocus",function(){c._ev("focus",event)});this.contentWindow.document.body.detachEvent("onblur",function(){c._ev("blur",event)});this.contentWindow.document.body.detachEvent("onkeydown",function(){c._ev("keydown",event)});this.contentWindow.document.body.detachEvent("onkeyup",function(){c._ev("keyup",event)});this.contentWindow.document.body.detachEvent("onkeypress",function(){c._ev("keypress",
event)});this.contentWindow.document.body.detachEvent("onmouseup",function(){c._ev("mouseup",event)});this.contentWindow.document.body.detachEvent("onmousedown",function(){c._ev("mousedown",event)});this.contentWindow.document.body.detachEvent("onclick",function(){c._ev("click",event)})};else{var h=this.editor;g.onload=function(){this.contentWindow.addEventListener("focus",function(a){c._ev("focus",a)},!1);this.contentWindow.addEventListener("blur",function(a){c._ev("blur",a)},!1);this.contentWindow.addEventListener("keydown",
function(a){c._ev("keydown",a)},!1);this.contentWindow.addEventListener("keyup",function(a){c._ev("keyup",a)},!1);this.contentWindow.addEventListener("keypress",function(a){c._ev("keypress",a)},!1);this.contentWindow.addEventListener("mouseup",function(a){c._ev("mouseup",a)},!1);this.contentWindow.addEventListener("mousedown",function(a){c._ev("mousedown",a)},!1);this.contentWindow.addEventListener("click",function(a){c._ev("click",a)},!1)};g.onunload=function(){this.contentWindow.removeEventListener("focus",
function(a){c._ev("focus",a)},!1);this.contentWindow.removeEventListener("blur",function(a){c._ev("blur",a)},!1);this.contentWindow.removeEventListener("keydown",function(a){c._ev("keydown",a)},!1);this.contentWindow.removeEventListener("keyup",function(a){c._ev("keyup",a)},!1);this.contentWindow.removeEventListener("keypress",function(a){c._ev("keypress",a)},!1);this.contentWindow.removeEventListener("mouseup",function(a){c._ev("mouseup",a)},!1);this.contentWindow.removeEventListener("mousedown",
function(a){c._ev("mousedown",a)},!1);this.contentWindow.removeEventListener("click",function(a){c._ev("click",a)},!1)}}this._ev=function(a,b){this.callEvent("onAccess",[a,b])};this._focus=function(){_isIE?this.editor.contentWindow.document.body.focus():this.editor.contentWindow.focus()};this.base.attachObject(this.editor);this.edWin=this.editor.contentWindow;this.edDoc=this.edWin.document;this._prepareContent=function(a,b){var c="";a===!0&&this.getContent!=null&&(c=this.getContent());var d=this.editor.contentWindow.document;
d.open("text/html","replace");_isOpera?d.write("<html><head><style> html, body { overflow:auto;-webkit-overflow-scrolling: touch; padding:0px; padding-left:1px !important; height:100%; margin:0px; font-family:Tahoma; font-size:10pt; background-color:#ffffff;} </style></head><body "+(b!==!0?"contenteditable='true'":"")+" tabindex='0'></body></html>"):window._KHTMLrv?d.write("<html><head><style> html {overflow-x: auto;-webkit-overflow-scrolling: touch; overflow-y: auto;} body { overflow: auto; overflow-y: scroll;} html,body { padding:0px; padding-left:1px !important; height:100%; margin:0px; font-family:Tahoma; font-size:10pt; background-color:#ffffff;} </style></head><body "+
(b!==!0?"contenteditable='true'":"")+" tabindex='0'></body></html>"):_isIE?d.write("<html><head><style> html {overflow-y: auto;} body {overflow-y: scroll;-webkit-overflow-scrolling: touch;} html,body { overflow-x: auto; padding:0px; padding-left:1px !important; height:100%; margin:0px; font-family:Tahoma; font-size:10pt; background-color:#ffffff;} </style></head><body "+(b!==!0?"contenteditable='true'":"")+" tabindex='0'></body></html>"):d.write("<html><head><style> html,body { overflow-x: auto; overflow-y:-webkit-overflow-scrolling: touch; scroll; padding:0px; padding-left:1px !important; height:100%; margin:0px; font-family:Tahoma; font-size:10pt; background-color:#ffffff;} </style></head><body "+
(b!==!0?"contenteditable='true'":"")+" tabindex='0'></body></html>");d.close();_isIE?d.contentEditable=b!==!0:d.designMode=b!==!0?"On":"Off";if(_isFF)try{d.execCommand("useCSS",!1,!0)}catch(e){}a===!0&&this.setContent!=null&&this.setContent(c)};this._prepareContent();this.setIconsPath=function(){};this.init=function(){};this.setSizes=function(){var a=this._isToolbar?0:this.base.childNodes[0].offsetHeight;this.base.adjustContent(this.base,a)};this._resizeTM=null;this._resizeTMTime=100;this._doOnResize=
function(){window.clearTimeout(c._resizeTM);c._resizeTM=window.setTimeout(function(){c.setSizes&&c.setSizes()},c._resizeTMTime)};this._doOnUnload=function(){window.detachEvent("onresize",this._doOnResize);window.removeEventListener("resize",this._doOnResize,!1)};dhtmlxEvent(window,"resize",this._doOnResize);this.base.childNodes[0].onselectstart=function(a){a=a||event;a.cancelBubble=!0;a.returnValue=!1;a.preventDefault&&a.preventDefault();return!1};for(var i=0;i<this.base.childNodes[0].childNodes.length-
2;i++)this.base.childNodes[0].childNodes[i].childNodes[0].onmousedown=function(){var a=this.getAttribute("cmd");typeof c[a]=="function"&&(c[a](),c.callEvent("onToolbarClick",[this.getAttribute("actv")]));return!1},this.base.childNodes[0].childNodes[i].childNodes[0].onclick=function(){return!1};this.runCommand=function(a,b){if(this._roMode!==!0){arguments.length<2&&(b=null);_isIE&&this.edWin.focus();try{var c=this.editor.contentWindow.document;c.execCommand(a,!1,b)}catch(d){}if(_isIE){this.edWin.focus();
var e=this;window.setTimeout(function(){e.edWin.focus()},1)}}};this.applyBold=function(){this.runCommand("Bold")};this.applyItalic=function(){this.runCommand("Italic")};this.applyUnderscore=function(){this.runCommand("Underline")};this.clearFormatting=function(){this.runCommand("RemoveFormat")};this._isToolbar&&this.initDhtmlxToolbar();dhtmlxEventable(this);dhtmlxEvent(this.edDoc,"click",function(a){var b=a||window.event,d=b.target||b.srcElement;c.showInfo(d)});_isOpera&&dhtmlxEvent(this.edDoc,"mousedown",
function(a){var b=a||window.event,d=b.target||b.srcElement;c.showInfo(d)});dhtmlxEvent(this.edDoc,"keyup",function(a){var b=a||window.event,d=b.keyCode,e=b.target||b.srcElement;(d==37||d==38||d==39||d==40||d==13)&&c.showInfo(e)});this.attachEvent("onFocusChanged",function(a){c._doOnFocusChanged&&c._doOnFocusChanged(a)});this.showInfo=function(a){if(a=this.getSelectionBounds().end?this.getSelectionBounds().end:a)try{if(this.edWin.getComputedStyle){var b=this.edWin.getComputedStyle(a,null),c=b.getPropertyValue("font-weight")==
401?700:b.getPropertyValue("font-weight");this.style={fontStyle:b.getPropertyValue("font-style"),fontSize:b.getPropertyValue("font-size"),textDecoration:b.getPropertyValue("text-decoration"),fontWeight:c,fontFamily:b.getPropertyValue("font-family"),textAlign:b.getPropertyValue("text-align")};if(window._KHTMLrv)this.style.fontStyle=b.getPropertyValue("font-style"),this.style.vAlign=b.getPropertyValue("vertical-align"),this.style.del=this.isStyleProperty(a,"span","textDecoration","line-through"),this.style.u=
this.isStyleProperty(a,"span","textDecoration","underline")}else b=a.currentStyle,this.style={fontStyle:b.fontStyle,fontSize:b.fontSize,textDecoration:b.textDecoration,fontWeight:b.fontWeight,fontFamily:b.fontFamily,textAlign:b.textAlign};this.setStyleProperty(a,"h1");this.setStyleProperty(a,"h2");this.setStyleProperty(a,"h3");this.setStyleProperty(a,"h4");window._KHTMLrv||(this.setStyleProperty(a,"del"),this.setStyleProperty(a,"sub"),this.setStyleProperty(a,"sup"),this.setStyleProperty(a,"u"));this.callEvent("onFocusChanged",
[this.style,b])}catch(d){return null}};this.getSelectionBounds=function(){var a,b,c,d;if(this.edWin.getSelection){var e=this.edWin.getSelection();a=e.getRangeAt(e.rangeCount-1);c=a.startContainer;d=a.endContainer;b=a.commonAncestorContainer;if(c.nodeName=="#text")b=b.parentNode;if(c.nodeName=="#text")c=c.parentNode;if(c.nodeName.toLowerCase()=="body")c=c.firstChild;if(d.nodeName=="#text")d=d.parentNode;if(d.nodeName.toLowerCase()=="body")d=d.lastChild;c==d&&(b=c);return{root:b,start:c,end:d}}else if(this.edWin.document.selection){a=
this.edDoc.selection.createRange();if(!a.duplicate)return null;b=a.parentElement();var f=a.duplicate(),g=a.duplicate();f.collapse(!0);g.moveToElementText(f.parentElement());g.setEndPoint("EndToStart",f);c=f.parentElement();f=a.duplicate();g=a.duplicate();g.collapse(!1);f.moveToElementText(g.parentElement());f.setEndPoint("StartToEnd",g);d=g.parentElement();if(c.nodeName.toLowerCase()=="body")c=c.firstChild;if(d.nodeName.toLowerCase()=="body")d=d.lastChild;c==d&&(b=c);return{root:b,start:c,end:d}}return null};
this.getContent=function(){return this.edDoc.body?_isFF?this.editor.contentWindow.document.body.innerHTML.replace(/<\/{0,}br\/{0,}>\s{0,}$/gi,""):_isIE&&this.edDoc.body.innerText.length==0?"":this.edDoc.body.innerHTML:""};this.setContent=function(a){a=a||"";if(this.edDoc.body){if(navigator.userAgent.indexOf("Firefox")!=-1){if(typeof this._ffTest=="undefined")this.editor.contentWindow.document.body.innerHTML="",this.runCommand("InsertHTML","test"),this._ffTest=this.editor.contentWindow.document.body.innerHTML.length>
0;this._ffTest?this.editor.contentWindow.document.body.innerHTML=a:(this.editor.contentWindow.document.body.innerHTML="",a.length==0&&(a=" "),this.runCommand("InsertHTML",a))}else this.editor.contentWindow.document.body.innerHTML=a;this.callEvent("onContentSet",[])}else dhtmlxEvent(this.edWin,"load",function(){c.setContent(a)})};this.setContentHTML=function(a){(new dtmlXMLLoaderObject(this._ajaxOnLoad,this,!1,!0)).loadXML(a)};this._ajaxOnLoad=function(a,b,c,d,e){e.xmlDoc.responseText&&a.setContent(e.xmlDoc.responseText)}}
function dhtmlXContainerLite(a){var b=this;this.obj=a;this.dhxcont=null;this.setContent=function(a){this.dhxcont=a;this.dhxcont.innerHTML="<div style='position: relative; left: 0px; top: 0px; overflow: hidden;'></div>";this.dhxcont.mainCont=this.dhxcont.childNodes[0];this.obj.dhxcont=this.dhxcont};this.obj._genStr=function(a){for(var b="",e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",f=0;f<a;f++)b+=e.charAt(Math.round(Math.random()*(e.length-1)));return b};this.obj.adjustContent=
function(a,b,e,f,g){this.dhxcont.style.left=(this._offsetLeft||0)+"px";this.dhxcont.style.top=(this._offsetTop||0)+b+"px";var h=a.clientWidth+(this._offsetWidth||0);if(f!==!0)this.dhxcont.style.width=Math.max(0,h)+"px";if(f!==!0&&this.dhxcont.offsetWidth>h)this.dhxcont.style.width=Math.max(0,h*2-this.dhxcont.offsetWidth)+"px";var i=a.clientHeight+(this._offsetHeight||0);this.dhxcont.style.height=Math.max(0,i-b)+(e!=null?e:0)+"px";if(this.dhxcont.offsetHeight>i-b)this.dhxcont.style.height=Math.max(0,
(i-b)*2-this.dhxcont.offsetHeight)+"px";if(g&&!isNaN(g))this.dhxcont.style.height=Math.max(0,parseInt(this.dhxcont.style.height)-g)+"px";if(this._minDataSizeH!=null&&parseInt(this.dhxcont.style.height)<this._minDataSizeH)this.dhxcont.style.height=this._minDataSizeH+"px";if(this._minDataSizeW!=null&&parseInt(this.dhxcont.style.width)<this._minDataSizeW)this.dhxcont.style.width=this._minDataSizeW+"px";if(f!==!0&&(this.dhxcont.mainCont.style.width=this.dhxcont.clientWidth+"px",this.dhxcont.mainCont.offsetWidth>
this.dhxcont.clientWidth))this.dhxcont.mainCont.style.width=Math.max(0,this.dhxcont.clientWidth*2-this.dhxcont.mainCont.offsetWidth)+"px";var j=this.menu!=null?!this.menuHidden?this.menuHeight:0:0,k=this.toolbar!=null?!this.toolbarHidden?this.toolbarHeight:0:0,m=this.sb!=null?!this.sbHidden?this.sbHeight:0:0;this.dhxcont.mainCont.style.height=this.dhxcont.clientHeight+"px";if(this.dhxcont.mainCont.offsetHeight>this.dhxcont.clientHeight)this.dhxcont.mainCont.style.height=Math.max(0,this.dhxcont.clientHeight*
2-this.dhxcont.mainCont.offsetHeight)+"px";this.dhxcont.mainCont.style.height=Math.max(0,parseInt(this.dhxcont.mainCont.style.height)-j-k-m)+"px"};this.obj.attachToolbar=function(){var a=document.createElement("DIV");a.style.position="relative";a.style.overflow="hidden";a.id="dhxtoolbar_"+this._genStr(12);this.dhxcont.insertBefore(a,this.dhxcont.childNodes[this.menu!=null?1:0]);this.toolbar=new dhtmlXToolbarObject(a.id,this.skin);b.skin=="dhx_web"?(this.toolbarHeight=32,this.dhxcont.className="dhtmlx_editor_extended_"+
b.skin):b.skin=="dhx_terrace"?(this._attached?(this.toolbarHeight=46,a.style.marginBottom="14px"):(this.toolbarHeight=34,a.style.marginTop="2px",a.style.marginLeft="2px",a.style.marginBottom="2px"),this.dhxcont.className="dhtmlx_editor_extended_"+b.skin):this.toolbarHeight=a.offsetHeight+(this._isLayout&&this.skin=="dhx_skyblue"?2:0);this.toolbarId=a.id;this._doOnAttachToolbar&&this._doOnAttachToolbar("init");this.adjust();return this.toolbar};this.obj.attachObject=function(a,b){typeof a=="string"&&
(a=document.getElementById(a));if(b){a.style.visibility="hidden";a.style.display="";var e=a.offsetWidth,f=a.offsetHeight}this._attachContent("obj",a);if(b&&this._isWindow)a.style.visibility="visible",this._adjustToContent(e,f)};this.obj.adjust=function(){if(this.skin=="dhx_skyblue"&&this.toolbar){if(this._isWindow||this._isLayout)document.getElementById(this.toolbarId).style.height="29px",this.toolbarHeight=document.getElementById(this.toolbarId).offsetHeight,this._doOnAttachToolbar&&this._doOnAttachToolbar("show");
this._isCell&&(document.getElementById(this.toolbarId).className+=" in_layoutcell");this._isAcc&&(document.getElementById(this.toolbarId).className+=" in_acccell")}};this.obj._attachContent=function(a,d,e){for(;b.dhxcont.mainCont.childNodes.length>0;)b.dhxcont.mainCont.removeChild(b.dhxcont.mainCont.childNodes[0]);if(a=="obj"){if(this._isWindow&&d.cmp==null&&this.skin=="dhx_skyblue")this.dhxcont.mainCont.style.border="#a4bed4 1px solid",this.dhxcont.mainCont.style.backgroundColor="#FFFFFF",this._redraw();
b.dhxcont._frame=null;b.dhxcont.mainCont.appendChild(d);b.dhxcont.mainCont.style.overflow=e===!0?"auto":"hidden";d.style.display=""}};this.obj._dhxContDestruct=function(){for(;this.dhxcont.mainCont.childNodes.length>0;)this.dhxcont.mainCont.removeChild(this.dhxcont.mainCont.childNodes[0]);this.dhxcont.mainCont.innerHTML="";this.dhxcont.mainCont=null;try{delete this.dhxcont.mainCont}catch(a){}for(;this.dhxcont.childNodes.length>0;)this.dhxcont.removeChild(this.dhxcont.childNodes[0]);this.dhxcont.innerHTML=
"";this.dhxcont=null;try{delete this.dhxcont}catch(b){}this.attachToolbar=this.adjustContent=this.moveContentTo=this.attachObject=this.adjust=this._dhxContDestruct=this._attachContent=this._genStr=null}}(function(){dhtmlx.extend_api("dhtmlXEditor",{_init:function(a){return[a.parent,a.skin]},content:"setContent"},{})})();
dhtmlXEditor.prototype.unload=function(){if(this._isToolbar)this._unloadExtModule();else for(;this.base.childNodes[0].childNodes.length>0;){if(this.base.childNodes[0].childNodes[0].tagName&&String(this.base.childNodes[0].childNodes[0].tagName).toLowerCase()=="a")this.base.childNodes[0].childNodes[0].childNodes[0].onclick=null,this.base.childNodes[0].childNodes[0].childNodes[0].onmousedown=null,this.base.childNodes[0].childNodes[0].removeChild(this.base.childNodes[0].childNodes[0].childNodes[0]);this.base.childNodes[0].removeChild(this.base.childNodes[0].childNodes[0])}this.tbData=
this.base.childNodes[0].onselectstart=null;this.detachAllEvents();_isIE?this.editor.onreadystatechange=null:this.editor.onload=null;this.editor.parentNode.removeChild(this.editor);this.edWin=this.edDoc=this.editor=this.editor.onunload=null;this.base._dhxContDestruct();this.base._idd=null;for(this.base.name=null;this.base.childNodes.length>0;)this.base.removeChild(this.base.childNodes[0]);this.unload=this.isReadonly=this.setReadonly=this.setContentHTML=this.setContent=this.getContent=this.getSelectionBounds=
this.showInfo=this.detachAllEvents=this.detachEvent=this.eventCatcher=this.checkEvent=this.callEvent=this.attachEvent=this.clearFormatting=this.applyUnderscore=this.applyItalic=this.applyBold=this.runCommand=this.setSizes=this.init=this.setIconsPath=this._doOnUnload=this._doOnResize=this._prepareContent=this._focus=this._ev=this._ajaxOnLoad=this.iconsPath=this.skin=this._resizeTMTime=this._resizeTM=this._isToolbar=this.cBlock=this.base=null};
dhtmlXEditor.prototype.setReadonly=function(a){this._roMode=a===!0;this._prepareContent(!0,this._roMode);this.cBlock.style.display=this._roMode?"":"none"};dhtmlXEditor.prototype.isReadonly=function(){return this._roMode||!1};
dhtmlXEditor.prototype.initDhtmlxToolbar=function(){this.tb=this.base.attachToolbar();this.tb.setSkin(this.skin);if(this.skin=="dhx_skyblue")this.tb.base.style.borderLeft="none",this.tb.base.style.borderRight="none",this.tb.base.style.top="-1px";this.setSizes();this.tb.setIconsPath(this.iconsPath+"dhxeditor_"+this.skin+"/");this._availFonts="Arial,Arial Narrow,Comic Sans MS,Courier,Georgia,Impact,Tahoma,Times New Roman,Verdana".split(",");this._initFont=this._availFonts[0];this._xmlFonts="";for(var a=
0;a<this._availFonts.length;a++){var b=String(this._availFonts[a]).replace(/\s/g,"_");this._xmlFonts+='<item type="button" id="applyFontFamily:'+b+'"><itemText><![CDATA[<img src="'+this.tb.imagePath+"font_"+String(b).toLowerCase()+'.gif" border="0" style="/*margin-top:1px;margin-bottom:1px;*/width:110px;height:16px;">]]\></itemText></item>'}this._availSizes={1:"8pt",2:"10pt",3:"12pt",4:"14pt",5:"18pt",6:"24pt",7:"36pt"};this._xmlSizes="";for(var c in this._availSizes)this._xmlSizes+='<item type="button" id="applyFontSize:'+
c+":"+this._availSizes[c]+'" text="'+this._availSizes[c]+'"/>';this.tbXML='<toolbar><item id="applyH1" type="buttonTwoState" img="h1.gif" imgdis="h4_dis.gif" title="H1"/><item id="applyH2" type="buttonTwoState" img="h2.gif" imgdis="h4_dis.gif" title="H2"/><item id="applyH3" type="buttonTwoState" img="h3.gif" imgdis="h4_dis.gif" title="H3"/><item id="applyH4" type="buttonTwoState" img="h4.gif" imgdis="h4_dis.gif" title="H4"/><item id="separ01" type="separator"/><item id="applyBold" type="buttonTwoState" img="bold.gif" imgdis="bold_dis.gif" title="Bold Text"/><item id="applyItalic" type="buttonTwoState" img="italic.gif" imgdis="italic_dis.gif" title="Italic Text"/><item id="applyUnderscore" type="buttonTwoState" img="underline.gif" imgdis="underline_dis.gif" title="Underscore Text"/><item id="applyStrikethrough" type="buttonTwoState" img="strike.gif" imgdis="strike_dis.gif" title="Strikethrough Text"/><item id="separ02" type="separator"/><item id="alignLeft" type="buttonTwoState" img="align_left.gif" imgdis="align_left_dis.gif" title="Left Alignment"/><item id="alignCenter" type="buttonTwoState" img="align_center.gif" imgdis="align_center_dis.gif" title="Center Alignment"/><item id="alignRight" type="buttonTwoState" img="align_right.gif" imgdis="align_right_dis.gif" title="Right Alignment"/><item id="alignJustify" type="buttonTwoState" img="align_justify.gif" title="Justified Alignment"/><item id="separ03" type="separator"/><item id="applySub" type="buttonTwoState" img="script_sub.gif" imgdis="script_sub.gif" title="Subscript"/><item id="applySuper" type="buttonTwoState" img="script_super.gif" imgdis="script_super_dis.gif" title="Superscript"/><item id="separ04" type="separator"/><item id="createNumList" type="button" img="list_number.gif" imgdis="list_number_dis.gif" title="Number List"/><item id="createBulList" type="button" img="list_bullet.gif" imgdis="list_bullet_dis.gif" title="Bullet List"/><item id="separ05" type="separator"/><item id="increaseIndent" type="button" img="indent_inc.gif" imgdis="indent_inc_dis.gif" title="Increase Indent"/><item id="decreaseIndent" type="button" img="indent_dec.gif" imgdis="indent_dec_dis.gif" title="Decrease Indent"/><item id="separ06" type="separator"/><item id="clearFormatting" type="button" img="clear.gif" title="Clear Formatting"/></toolbar>';
this.tb.loadXMLString(this.tbXML);this._checkAlign=function(a){this.tb.setItemState("alignCenter",!1);this.tb.setItemState("alignRight",!1);this.tb.setItemState("alignJustify",!1);this.tb.setItemState("alignLeft",!1);a&&this.tb.setItemState(a,!0)};this._checkH=function(a){this.tb.setItemState("applyH1",!1);this.tb.setItemState("applyH2",!1);this.tb.setItemState("applyH3",!1);this.tb.setItemState("applyH4",!1);a&&this.tb.setItemState(a,!0)};this._doOnFocusChanged=function(a){if(!a.h1&&!a.h2&&!a.h3&&
!a.h4){var b=String(a.fontWeight).search(/bold/i)!=-1||Number(a.fontWeight)>=700;this.tb.setItemState("applyBold",b)}else this.tb.setItemState("applyBold",!1);var c="alignLeft";String(a.textAlign).search(/center/)!=-1&&(c="alignCenter");String(a.textAlign).search(/right/)!=-1&&(c="alignRight");String(a.textAlign).search(/justify/)!=-1&&(c="alignJustify");this.tb.setItemState(c,!0);this._checkAlign(c);this.tb.setItemState("applyH1",a.h1);this.tb.setItemState("applyH2",a.h2);this.tb.setItemState("applyH3",
a.h3);this.tb.setItemState("applyH4",a.h4);if(window._KHTMLrv)a.sub=a.vAlign=="sub",a.sup=a.vAlign=="super";this.tb.setItemState("applyItalic",a.fontStyle=="italic");this.tb.setItemState("applyStrikethrough",a.del);this.tb.setItemState("applySub",a.sub);this.tb.setItemState("applySuper",a.sup);this.tb.setItemState("applyUnderscore",a.u)};this._doOnToolbarClick=function(a){var b=String(a).split(":");this[b[0]]!=null&&typeof this[b[0]]=="function"&&(this[b[0]](b[1]),this.callEvent("onToolbarClick",
[a]))};this._doOnStateChange=function(a){this[a]();switch(a){case "alignLeft":case "alignCenter":case "alignRight":case "alignJustify":this._checkAlign(a);break;case "applyH1":case "applyH2":case "applyH3":case "applyH4":this._checkH(a)}this.callEvent("onToolbarClick",[a])};this._doOnBeforeStateChange=function(a,b){return(a=="alignLeft"||a=="alignCenter"||a=="alignRight"||a=="alignJustify")&&b==!0?!1:!0};var d=this;this.tb.attachEvent("onClick",function(a){d._doOnToolbarClick(a)});this.tb.attachEvent("onStateChange",
function(a,b){d._doOnStateChange(a,b)});this.tb.attachEvent("onBeforeStateChange",function(a,b){return d._doOnBeforeStateChange(a,b)});this.applyBold=function(){this.runCommand("Bold")};this.applyItalic=function(){this.runCommand("Italic")};this.applyUnderscore=function(){this.runCommand("Underline")};this.applyStrikethrough=function(){this.runCommand("StrikeThrough")};this.alignLeft=function(){this.runCommand("JustifyLeft")};this.alignRight=function(){this.runCommand("JustifyRight")};this.alignCenter=
function(){this.runCommand("JustifyCenter")};this.alignJustify=function(){this.runCommand("JustifyFull")};this.applySub=function(){this.runCommand("Subscript")};this.applySuper=function(){this.runCommand("Superscript")};this.applyH1=function(){this.runCommand("FormatBlock","<H1>")};this.applyH2=function(){this.runCommand("FormatBlock","<H2>")};this.applyH3=function(){this.runCommand("FormatBlock","<H3>")};this.applyH4=function(){this.runCommand("FormatBlock","<H4>")};this.createNumList=function(){this.runCommand("InsertOrderedList")};
this.createBulList=function(){this.runCommand("InsertUnorderedList")};this.increaseIndent=function(){this.runCommand("Indent")};this.decreaseIndent=function(){this.runCommand("Outdent")};this.clearFormatting=function(){this.runCommand("RemoveFormat");this.tb.setItemState("applyBold",!1);this.tb.setItemState("applyItalic",!1);this.tb.setItemState("applyStrikethrough",!1);this.tb.setItemState("applySub",!1);this.tb.setItemState("applySuper",!1);this.tb.setItemState("applyUnderscore",!1)};this.getParentByTag=
function(a,b){var b=b.toLowerCase(),c=a;do if(b==""||c.nodeName.toLowerCase()==b)return c;while(c=c.parentNode);return a};this.isStyleProperty=function(a,b,c,d){var b=b.toLowerCase(),i=a;do if(i.nodeName.toLowerCase()==b&&i.style[c]==d)return!0;while(i=i.parentNode);return!1};this.setStyleProperty=function(a,b){this.style[b]=!1;var c=this.getParentByTag(a,b);c&&c.tagName.toLowerCase()==b&&(this.style[b]=!0);if(b=="del"&&this.getParentByTag(a,"strike")&&this.getParentByTag(a,"strike").tagName.toLowerCase()==
"strike")this.style.del=!0};this._unloadExtModule=function(){this.tb.unload();this.setStyleProperty=this.isStyleProperty=this.getParentByTag=this.clearFormatting=this.decreaseIndent=this.increaseIndent=this.createBulList=this.createNumList=this.applyH4=this.applyH3=this.applyH2=this.applyH1=this.applySuper=this.applySub=this.alignJustify=this.alignCenter=this.alignRight=this.alignLeft=this.applyStrikethrough=this.applyUnderscore=this.applyItalic=this.applyBold=this._doOnBeforeStateChange=this._doOnStateChange=
this._doOnToolbarClick=this._doOnFocusChanged=this._checkH=this._checkAlign=this.tbXML=this._xmlSizes=this._availSizes=this._xmlFonts=this._initFont=this._availFonts=this.tb=null}};
function dhtmlXForm(a,b){this.i={position:"label-left",labelWidth:"auto",labelHeight:"auto",inputWidth:"auto",inputHeight:"auto",labelAlign:"left",noteWidth:"auto",offsetTop:0,offsetLeft:0};this.apos_css={"label-left":"dhxform_item_label_left","label-right":"dhxform_item_label_right","label-top":"dhxform_item_label_top","label-bottom":"dhxform_item_label_bottom",absolute:"dhxform_item_absolute"};this.align_css={left:"dhxform_label_align_left",center:"dhxform_label_align_center",right:"dhxform_label_align_right"};
var c=this;this.skin=typeof dhtmlx!="undefined"?dhtmlx.skin||"dhx_skyblue":"dhx_skyblue";this.setSkin=function(a){this.skin=a;this.cont.className="dhxform_obj_"+this.skin;this.cont.style.fontSize="13px";this._updateBlocks();this.forEachItem(function(b){c.getItemType(b)=="calendar"&&c.doWithItem(b,"setSkin",a)})};this.separator=",";this.live_validate=!1;this._type="checkbox";this._rGroup="default";this._idIndex={};this._indexId=[];this.cont=typeof a=="object"?a:document.getElementById(a);if(!a._isNestedForm)this._parentForm=
!0,this.cont.style.fontSize="13px",this.cont.className="dhxform_obj_"+this.skin,this.setFontSize=function(a){this.cont.style.fontSize=a;this._updateBlocks()},this.getForm=function(){return this},this.cont.onkeypress=function(a){a=a||event;if(a.keyCode==13){var b=a.target||a.srcElement;typeof b.tagName!="undefined"&&String(b.tagName).toLowerCase()=="textarea"&&!a.ctrlKey||c.callEvent("onEnter",[])}};this.b_index=null;this.base=[];this._prepare=function(a){this.b_index==null?this.b_index=0:this.b_index++;
this.base[this.b_index]=document.createElement("DIV");this.base[this.b_index].className="dhxform_base";typeof a!="undefined"&&(this.base[this.b_index].style.cssText+=" margin-left:"+a+"px!important;");this.cont.appendChild(this.base[this.b_index])};this.setSizes=function(){};this._mergeSettings=function(a){var b=-1,c={type:"settings"},d;for(d in this.i)c[d]=this.i[d];for(var i=0;i<a.length;i++)if(typeof a[i]!="undefined"&&a[i].type=="settings"){for(d in a[i])c[d]=a[i][d];b=i}a[b>=0?b:a.length]=c;
return a};this._genStr=function(a){for(var b="",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",d=0;d<a;d++)b+=c.charAt(Math.round(Math.random()*(c.length-1)));return b};this.idPrefix="dhxForm_"+this._genStr(12)+"_";this._rId=this._parentForm?this._genStr(12)+"_":a._rId;this.objPull={};this.itemPull={};this._ic=0;this._addItem=function(a,b,d,h,i){this.items[a]._index&&(this.getForm()._indexId.push(b),this.getForm()._idIndex[b]={ind:this.getForm()._indexId.length-1},this.getForm()._idIndex[b]=
{ind:this.getForm()._indexId.length-1});if(!a)a=this._type;if(a=="list"&&{fieldset:!0,block:!0}[this.getItemType(i)]==!0)var j=this.itemPull[this.idPrefix+i]._addSubListNode();else a=="newcolumn"?j={}:(j=document.createElement("DIV"),this.base[this.b_index].appendChild(j));j._idd=b;j._rId=this._rId;if(typeof j.style!="undefined"){if(typeof d.offsetLeft=="undefined"&&this.i.offsetLeft>0)d.offsetLeft=this.i.offsetLeft;if(typeof d.offsetTop=="undefined"&&this.i.offsetTop>0)d.offsetTop=this.i.offsetTop;
typeof d.offsetLeft!="undefined"&&(j.style.cssText+=" padding-left:"+d.offsetLeft+"px!important;");typeof d.offsetTop!="undefined"&&(j.style.cssText+=" padding-top:"+d.offsetTop+"px!important;")}if(a=="list"){if(h!=null)j._sId=h;var k=this.items[a].render(j);if(!this.itemPull[this.idPrefix+b]._listObj)this.itemPull[this.idPrefix+b]._listObj=[];if(!this.itemPull[this.idPrefix+b]._list)this.itemPull[this.idPrefix+b]._list=[];if(!this.itemPull[this.idPrefix+b]._listBase)this.itemPull[this.idPrefix+b]._listBase=
[];this.itemPull[this.idPrefix+b]._listObj.push(k[0]);this.itemPull[this.idPrefix+b]._list.push(k[1]);this.itemPull[this.idPrefix+b]._listBase.push(j);k[1].checkEvent=function(a){return c.checkEvent(a)};k[1].callEvent=function(a,b){return c.callEvent(a,b)};k[1].getForm=function(){return c.getForm()};k[1]._initObj(this._mergeSettings(d));j._inBlcok&&(j.className+=" in_block");return k[1]}if(a=="newcolumn")this._prepare(d.offset);else{if({input:!0,fieldset:!0,block:!0,password:!0,calendar:!0,colorpicker:!0}[a]!==
!0)j.onselectstart=function(a){a=a||event;return a.returnValue=!1};if(a=="label"&&this._ic++==0)d._isTopmost=!0;if(a=="select"&&this.skin=="dhx_terrace")j._inpWidthFix=6;d.position=this.apos_css[!d.position||!this.apos_css[d.position]?this.i.position:d.position];j.className=d.position+(typeof d.className=="string"?" "+d.className:"");if(!d.labelWidth)d.labelWidth=this.i.labelWidth;if(!d.labelHeight)d.labelHeight=this.i.labelHeight;if(typeof d.wrap!="undefined")d.wrap=this._s2b(d.wrap);d.labelAlign=
this.align_css[d.labelAlign]?this.align_css[d.labelAlign]:this.align_css[this.i.labelAlign];d.inputWidth=d.width?d.width:d.inputWidth?d.inputWidth:this.i.inputWidth;if(!d.inputHeight)d.inputHeight=this.i.inputHeight;if(typeof d.note!="undefined"){if(d.note.length!=null&&d.note[0]!=null)d.note=d.note[0];if(typeof d.note.width=="undefined")d.note.width=this.i.noteWidth;if(d.note.width=="auto")d.note.width=d.inputWidth}j.checkEvent=function(a){return c.checkEvent(a)};j.callEvent=function(a,b){return c.callEvent(a,
b)};j.getForm=function(){return c.getForm()};j._autoCheck=function(a){c._autoCheck(a)};if(typeof d.readonly=="string")d.readonly=this._s2b(d.readonly);if(typeof d.autoStart=="string")d.autoStart=this._s2b(d.autoStart);if(typeof d.autoRemove=="string")d.autoRemove=this._s2b(d.autoRemove);if(typeof d.titleScreen=="string")d.titleScreen=this._s2b(d.titleScreen);if(typeof d.info=="string")d.info=this._s2b(d.info);if(typeof d.userdata!="undefined")for(var m in d.userdata)this.getForm().setUserData(b,m,
d.userdata[m]);if(d.validate)j._validate=typeof(d.validate!="undefined")&&(typeof d.validate=="function"||typeof window[d.validate]=="function")?[d.validate]:String(d.validate).split(this.separator);if(typeof d.required!="undefined"){if(typeof d.required=="string")d.required=this._s2b(d.required);j._required=d.required==!0}if(j._required){if(!j._validate)j._validate=[];var l=!1;for(q=0;q<j._validate.length;q++)l=l||j._validate[q]=="NotEmpty";l||j._validate.push("NotEmpty")}j._ll=d.position==this.apos_css["label-left"]||
d.position==this.apos_css["label-top"];this.objPull[this.idPrefix+b]=this.items[a].render(j,d);this.itemPull[this.idPrefix+b]=j}};this._initObj=function(a){this._prepare();for(var b=0;b<a.length;b++)if(typeof a[b]!="undefined"&&a[b].type=="settings")for(var c in a[b])this.i[c]=a[b][c];for(b=0;b<a.length;b++)if(typeof a[b]!="undefined"){var d=a[b].type||"";if(this.items[d]){if(!a[b].name)a[b].name=this._genStr(12);var i=a[b].name;if(this.objPull[this.idPrefix+i]!=null||d=="radio")i=this._genStr(12);
var j=a[b];j.label=j.label||"";j.value=j.value;j.checked=!!j.checked;j.disabled=!!j.disabled;j.name=j.name||this._genStr(12);j.options=j.options||[];j.rows=j.rows||"none";j.uid=this._genStr(12);this._addItem(d,i,j);this._parentEnabled===!1&&this._disableItem(i);for(var k=0;k<j.options.length;k++)if(j.options[k].list!=null){if(!j.options[k].value)j.options[k].value=this._genStr();var m=this._addItem("list",i,j.options[k].list,j.options[k].value);m._subSelect=!0;m._subSelectId=j.options[k].value}if(a[b].list!=
null){if(!a[b].listParent)a[b].listParent=j.name;m=this._addItem("list",i,a[b].list,null,a[b].listParent)}}}this._autoCheck()};this._s2b=function(a){return a=="true"||a=="1"||a=="yes"||a==!0?!0:!1};this._xmlSubItems={item:"list",option:"options",note:"note",userdata:"_userdata"};this._xmlToObject=function(a,b){for(var c=b?[]:{},d=0;d<a.childNodes.length;d++)if(typeof a.childNodes[d].tagName!="undefined"){var i=a.childNodes[d].tagName;if(this._xmlSubItems[i]!=null){var j=this._xmlSubItems[i];typeof c[j]==
"undefined"&&(c[j]=[]);for(var k={},m=0;m<a.childNodes[d].attributes.length;m++){var l=a.childNodes[d].attributes[m].name,n=a.childNodes[d].attributes[m].value;k[l]=n}if(j=="note")k.text=a.childNodes[d].firstChild.nodeValue;if(j=="_userdata")k.value=a.childNodes[d].firstChild.nodeValue;var o=this._xmlToObject(a.childNodes[d]),p;for(p in o)if(p=="_userdata"){if(!k.userdata)k.userdata={};for(m=0;m<o[p].length;m++)k.userdata[o[p][m].name]=o[p][m].value}else k[p]=o[p];b?c.push(k):c[j].push(k)}}return c};
this._xmlParser=function(){if(c._loadType=="json")eval("var formJSONData="+this.xmlDoc.responseText),typeof formJSONData=="object"&&formJSONData!=null&&c._initObj(formJSONData);else{var a=c._xmlToObject(this.getXMLTopNode("items"),!0);c._initObj(a)}c.cont&&c.cont.cmp&&c.cont.cmp=="form"&&c.setSizes();c.callEvent("onXLE",[]);typeof c._doOnLoad=="function"&&c._doOnLoad()};this._doOnLoad=null;this._xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window);this.loadStruct=function(a,b,c){this._loadType=
"xml";if(typeof b=="string"){if(b.toLowerCase()=="json"&&(this._loadType="json",typeof a!="string")){this._initObj(a);return}this._doOnLoad=c||null}else this._doOnLoad=b||null;this.callEvent("onXLS",[]);this._xmlLoader.loadXML(a)};this.loadStructString=function(a,b){this._doOnLoad=b||null;this._xmlLoader.loadXMLString(a)};this._autoCheck=function(a){this._locked===!0?a=!1:typeof a=="undefined"&&(a=!0);for(var b in this.itemPull){var c=a&&this.itemPull[b]._udis!==!0;this[c?"_enableItem":"_disableItem"](this.itemPull[b]._idd);
if(this.getForm()._idIndex[this.itemPull[b]._idd]!=null)this.getForm()._idIndex[this.itemPull[b]._idd].enabled=c;var d=c&&(typeof this.itemPull[b]._checked=="boolean"?this.itemPull[b]._checked:!0);if(this.itemPull[b]._list)for(var i=0;i<this.itemPull[b]._list.length;i++){var j=!0;if(this.itemPull[b]._list[i]._subSelect==!0){var j=!1,k=this.getItemValue(this.itemPull[b]._idd);typeof k=="object"&&typeof k.length=="number"||(k=[k]);for(var m=0;m<k.length;m++)j=k[m]==this.itemPull[b]._list[i]._subSelectId||
j;this.itemPull[b]._listObj[i][j?"show":"hide"](this.itemPull[b]._listBase[i])}this.itemPull[b]._list[i]._autoCheck(d&&j)}}};this.doWithItem=function(a,b,c,d,i,j){if(typeof a=="object"){var k=a[0],m=a[1],l=null,n=null,o;for(o in this.itemPull){if((this.itemPull[o]._value==m||m===null)&&this.itemPull[o]._group==k)return this.objPull[o][b](this.itemPull[o],c,d,i,j);if(this.itemPull[o]._list!=null&&!n)for(var p=0;p<this.itemPull[o]._list.length;p++)n=this.itemPull[o]._list[p].doWithItem(a,b,c,d,i)}if(n!=
null)return n;else if(b=="getType")return this.doWithItem(a[0],"getType")}else if(this.itemPull[this.idPrefix+a])return this.objPull[this.idPrefix+a][b](this.itemPull[this.idPrefix+a],c,d,i,j);else{n=null;for(o in this.itemPull)if(this.itemPull[o]._list&&!n)for(p=0;p<this.itemPull[o]._list.length;p++)n==null&&(n=this.itemPull[o]._list[p].doWithItem(a,b,c,d,i,j));return n}};this.removeItem=function(a,b){b!=null?a=this.doWithItem([a,b],"destruct"):this.doWithItem(a,"destruct");this._clearItemData(a)};
this._clearItemData=function(a){if(this.itemPull[this.idPrefix+a]){a=this.idPrefix+a;try{this.objPull[a]=null,this.itemPull[a]=null,delete this.objPull[a],delete this.itemPull[a]}catch(b){}}else for(var c in this.itemPull)if(this.itemPull[c]._list)for(var d=0;d<this.itemPull[c]._list.length;d++)this.itemPull[c]._list[d]._clearItemData(a)};this.isItem=function(a,b){b!=null&&(a=[a,b]);return this.doWithItem(a,"isExist")};this.getItemType=function(a,b){a=[a,b||null];return this.doWithItem(a,"getType")};
this.getItemsList=function(){var a=[],b=[],c;for(c in this.itemPull){var d=null,d=this.itemPull[c]._group?this.itemPull[c]._group:c.replace(this.idPrefix,"");b[d]!=!0&&a.push(d);b[d]=!0}return a};this.forEachItem=function(a){for(var b in this.objPull)if(a(String(b).replace(this.idPrefix,"")),this.itemPull[b]._list)for(var c=0;c<this.itemPull[b]._list.length;c++)this.itemPull[b]._list[c].forEachItem(a)};this.setItemLabel=function(a,b,c){c!=null?a=[a,b]:c=b;this.doWithItem(a,"setText",c)};this.getItemLabel=
function(a,b){b!=null&&(a=[a,b]);return this.doWithItem(a,"getText")};this.setItemText=this.setItemLabel;this.getItemText=this.getItemLabel;this._enableItem=function(a){this.doWithItem(a,"enable")};this._disableItem=function(a){this.doWithItem(a,"disable")};this._isItemEnabled=function(a){return this.doWithItem(a,"isEnabled")};this.checkItem=function(a,b){b!=null&&(a=[a,b]);this.doWithItem(a,"check");this._autoCheck()};this.uncheckItem=function(a,b){b!=null&&(a=[a,b]);this.doWithItem(a,"unCheck");
this._autoCheck()};this.isItemChecked=function(a,b){b!=null&&(a=[a,b]);return this.doWithItem(a,"isChecked")};this.getCheckedValue=function(a){return this.doWithItem([a,null],"getChecked")};this._getRGroup=function(a,b){for(var c in this.itemPull){if(this.itemPull[c]._group==a&&(b==null||this.itemPull[c]._value==b))return this.itemPull[c]._idd;if(this.itemPull[c]._list!=null)for(var d=0;d<this.itemPull[c]._list.length;d++){var i=this.itemPull[c]._list[d]._getRGroup(a,b);if(i!=null)return i}}return null};
this.setItemValue=function(a,b){return this.getItemType(a)=="radio"?(this._getRGroup(a,b)!=null?this.checkItem(a,b):this.uncheckItem(a,this.getCheckedValue(a)),null):this.doWithItem(a,"setValue",b)};this.getItemValue=function(a,b){this._updateValues();return this.getItemType(a)=="radio"?this.getCheckedValue(a):this.doWithItem(a,"getValue",b)};this.updateValues=function(){this._updateValues()};this.showItem=function(a,b){b!=null&&(a=[a,b]);this.doWithItem(a,"show")};this.hideItem=function(a,b){b!=
null&&(a=[a,b]);this.doWithItem(a,"hide")};this.isItemHidden=function(a,b){b!=null&&(a=[a,b]);return this.doWithItem(a,"isHidden")};this.getOptions=function(a){return this.doWithItem(a,"getOptions")};this.setItemWidth=function(a,b){this.doWithItem(a,"setWidth",b)};this.getItemWidth=function(a){return this.doWithItem(a,"getWidth")};this.setItemHeight=function(a,b){this.doWithItem(a,"setHeight",b)};this.setItemFocus=function(a){this.doWithItem(a,"setFocus")};this._updateValues=function(){for(var a in this.itemPull)if(this.objPull[a]&&
typeof this.objPull[a].updateValue=="function"&&this.objPull[a].updateValue(this.itemPull[a]),this.itemPull[a]._list)for(var b=0;b<this.itemPull[a]._list.length;b++)this.itemPull[a]._list[b]._updateValues()};this._getItemByName=function(a){for(var b in this.itemPull){if(this.itemPull[b]._idd==a)return this.itemPull[b];if(this.itemPull[b]._list!=null)for(var c=0;c<this.itemPull[b]._list.length;c++){var d=this.itemPull[b]._list[c]._getItemByName(a);if(d!=null)return d}}return null};this._resetValidateCss=
function(a){a.className=a.className.replace(a._vcss,"");a._vcss=null};this.setValidateCss=function(a,b,c){var d=this[this.getItemType(a)=="radio"?"_getRGroup":"_getItemByName"](a);if(d)d._vcss!=null&&this._resetValidateCss(d),d._vcss=typeof c=="string"?c:"validate_"+(b===!0?"ok":"error"),d.className+=" "+d._vcss};this.resetValidateCss=function(){for(var a in this.itemPull)if(this.itemPull[a]._vcss!=null&&this._resetValidateCss(this.itemPull[a]),this.itemPull[a]._list!=null)for(var b=0;b<this.itemPull[a]._list.length;b++)this.itemPull[a]._list[b].resetValidateCss()};
this.validate=function(){this._updateValues();if(this.callEvent("onBeforeValidate",[])!=!1){var a=!0;this.forEachItem(function(b){a=c.doWithItem(b,"_validate")&&a});this.callEvent("onAfterValidate",[a]);return a}};this.validateItem=function(a){return this.doWithItem(a,"_validate")};this.enableLiveValidation=function(a){this.live_validate=a==!0};this.setReadonly=function(a,b){this.doWithItem(a,"setReadonly",b)};this.isReadonly=function(a){return this.doWithItem(a,"isReadonly")};this.getFirstActive=
function(a){for(var b=0;b<this._indexId.length;b++){var c=!0;if(a==!0){var d=this.getItemType(this._indexId[b]);dhtmlXForm.prototype.items[d].setFocus||(c=!1)}if(c&&this._idIndex[this._indexId[b]].enabled)return this._indexId[b]}return null};this.setFocusOnFirstActive=function(){var a=this.getFirstActive(!0);a!=null&&this.setItemFocus(a)};this.enableItem=function(a,b){b!=null&&(a=[a,b]);this.doWithItem(a,"userEnable");this._autoCheck()};this.disableItem=function(a,b){b!=null&&(a=[a,b]);this.doWithItem(a,
"userDisable");this._autoCheck()};this.isItemEnabled=function(a,b){b!=null&&(a=[a,b]);return this.doWithItem(a,"isUserEnabled")};this.clear=function(){var a={};this.formId=(new Date).valueOf();this.resetDataProcessor("inserted");for(var b in this.itemPull){var c=this.itemPull[b]._idd;this.itemPull[b]._type=="ch"&&this.uncheckItem(c);this.itemPull[b]._type in{ta:1,editor:1,calendar:1,pw:1,hd:1}&&this.setItemValue(c,"");this.itemPull[b]._type=="combo"&&this.getCombo(c).selectOption(0);if(this.itemPull[b]._type==
"se"){var d=this.getOptions(c);if(d.length>0)d[0].selected=!0}if(this.itemPull[b]._type=="ra"){var i=this.itemPull[b]._group;a[i]||(this.checkItem(i,this.doWithItem(c,"_getFirstValue")),a[i]=!0)}if(this.itemPull[b]._list)for(var j=0;j<this.itemPull[b]._list.length;j++)this.itemPull[b]._list[j].clear()}a=null;this._parentForm&&this._autoCheck();this.resetValidateCss()};this.unload=function(){for(var a in this.objPull)this.removeItem(String(a).replace(this.idPrefix,""));this.detachAllEvents();this._ccTm&&
window.clearTimeout(this._ccTm);this._formLS=null;this._xmlLoader.destructor();this._subSelectId=this._subSelect=this.idPrefix=this.skin=this.i=this.b_index=this.align_css=this.apos_css=this.isReadonly=this.setReadonly=this.isLocked=this.unlock=this.lock=this.getItemsList=this.getFormData=this.setFormData=this.getEditor=this.getCombo=this.getColorPicker=this.getCalendar=this.setSizes=this.setRTL=this.getUserData=this.setUserData=this.getItemWidth=this.getCheckedValue=this.detachAllEvents=this._prepare=
this._locked=this._mergeSettings=this._doLock=this._parentForm=this._parentEnabled=this._type=this._rGroup=this.setSkin=this.setItemWidth=this.setItemHeight=this.setFontSize=this.remove=this.loadStructString=this.loadStruct=this._ulToObject=this._ic=this.getOptions=this.isItemChecked=this.uncheckItem=this.checkItem=this.isItemHidden=this.hideItem=this.showItem=this.getItemValue=this.setItemValue=this.getItemText=this.setItemText=this.getItemLabel=this.setItemLabel=this._getPosition=this._setPosition=
this.getItemPosition=this.setItemPosition=this.eventCatcher=this.detachEvent=this.checkEvent=this.callEvent=this.attachEvent=this.getForm=this.unload=this.removeItem=this.getItemType=this.doWithItem=this.clear=this.isItem=this.forEachItem=this._isItemEnabled=this._disableItem=this._enableItem=this._clearItemData=this._autoCheck=this._initObj=this._genStr=this._addItem=this.itemPull=this.objPull=this.items=this.loadXMLString=this.loadXML=this._xmlToObject=this._xmlParser=this._xmlLoader=null;for(var b=
0;b<this.base.length;b++){for(;this.base[b].childNodes.length>0;)this.base[b].removeChild(this.base[b].childNodes[0]);this.base[b].parentNode&&this.base[b].parentNode.removeChild(this.base[b]);this.base[b]=null}this.base=null;this.cont.onkeypress=null;this.cont.className="";this.cont=null};for(var d in this.items){this.items[d].t=d;if(typeof this.items[d]._index=="undefined")this.items[d]._index=!0;if(!this.items[d].show)this.items[d].show=function(a){a.style.display="";if(a._listObj)for(var b=0;b<
a._listObj.length;b++)a._listObj[b].show(a._listBase[b])};if(!this.items[d].hide)this.items[d].hide=function(a){a.style.display="none";if(a._listObj)for(var b=0;b<a._listObj.length;b++)a._listObj[b].hide(a._listBase[b])};if(!this.items[d].isHidden)this.items[d].isHidden=function(a){return a.style.display=="none"};if(!this.items[d].userEnable)this.items[d].userEnable=function(a){a._udis=!1};if(!this.items[d].userDisable)this.items[d].userDisable=function(a){a._udis=!0};if(!this.items[d].isUserEnabled)this.items[d].isUserEnabled=
function(a){return a._udis!==!0};if(!this.items[d].getType)this.items[d].getType=function(){return this.t};if(!this.items[d].isExist)this.items[d].isExist=function(){return!0};if(!this.items[d].validate)this.items[d]._validate=function(a){if(!a._validate||!a._enabled)return!0;for(var b=a._type=="ch"?this.isChecked(a)?this.getValue(a):0:this.getValue(a),c=!0,d=0;d<a._validate.length;d++){var i="is"+a._validate[d];if(!((b==null||b.length==0)&&i!="isNotEmpty")){var j=dhtmlxValidation[i];typeof j!="function"&&
typeof a._validate[d]=="function"&&(j=a._validate[d]);typeof j!="function"&&typeof window[a._validate[d]]=="function"&&(j=window[a._validate[d]]);c=(typeof j=="function"?j(b):RegExp(a._validate[d]).test(b))&&c;j=null}}a.callEvent("onValidate"+(c?"Success":"Error"),[a._idd,b,c])!==!1&&a.getForm().setValidateCss(a._idd,c);return c}}this._locked=!1;this._doLock=function(a){var b=a===!0?!0:!1;if(this._locked!=b)this._locked=b,this._autoCheck(!this._locked)};this.lock=function(){this._doLock(!0)};this.unlock=
function(){this._doLock(!1)};this.isLocked=function(){return this._locked};this.setNumberFormat=function(a,b,c,d){return this.doWithItem(a,"setNumberFormat",b,c,d)};dhtmlxEventable(this);this.attachEvent("_onButtonClick",function(a,b){this.callEvent("onButtonClick",[a,b])});this._updateBlocks=function(){this.forEachItem(function(a){(c.getItemType(a)=="block"||c.getItemType(a)=="combo")&&c.doWithItem(a,"_setCss",c.skin,c.cont.style.fontSize)})};this._isObj=function(a){return a!=null&&typeof a=="object"&&
typeof a.length=="undefined"};this._copyObj=function(a){if(this._isObj(a)){var b={},c;for(c in a)b[c]=typeof a[c]=="object"&&a[c]!=null?this._copyObj(a[c]):a[c]}else{b=[];for(c=0;c<a.length;c++)b[c]=typeof a[c]=="object"&&a[c]!=null?this._copyObj(a[c]):a[c]}return b};b!=null&&typeof b=="object"&&this._initObj(this._copyObj(b));this._parentForm&&this._updateBlocks();this._ccActive=!1;this._ccTm=null;this._ccActivate=function(a,b,c){if(!this._formLS)this._formLS={};this._formLS[a]||(this._formLS[a]=
{input:b,value:c});if(!this._ccActive)this._ccActive=!0,this._ccDo();b=null};this._ccDeactivate=function(a){this._ccTm&&window.clearTimeout(this._ccTm);this._ccActive=!1;if(this._formLS!=null&&this._formLS[a]!=null)this._formLS[a].input=null,this._formLS[a]=null,delete this._formLS[a]};this._ccDo=function(){this._ccTm&&window.clearTimeout(this._ccTm);for(var a in this._formLS){var b=this._formLS[a].input;if(String(b.tagName).toLowerCase()=="select"){var d="";if(b.selectedIndex>=0&&b.selectedIndex<
b.options.length)d=b.options[b.selectedIndex].value}else d=b.value;if(d!=this._formLS[a].value)this._formLS[a].value=d,this.callEvent("onInputChange",[b._idd,d,this]);b=null}if(this._ccActive)this._ccTm=window.setTimeout(function(){c._ccDo()},100)};return this}dhtmlXForm.prototype.getInput=function(a){return this.doWithItem(a,"getInput")};dhtmlXForm.prototype.getSelect=function(a){return this.doWithItem(a,"getSelect")};dhtmlXForm.prototype.items={};
dhtmlXForm.prototype.items.checkbox={render:function(a,b){a._type="ch";a._enabled=!0;a._checked=!1;a._value=typeof b.value=="undefined"?null:String(b.value);a._ro=b.readonly==!0;if(b._autoInputWidth!==!1)b.inputWidth=14;this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","TEXT",!0,!0,"dhxform_textarea");a.childNodes[a._ll?1:0].className+=" dhxform_img_node";var c=document.createElement("DIV");c.className="dhxform_img chbx0";a.appendChild(c);if(!isNaN(b.inputLeft))a.childNodes[a._ll?1:0].style.left=parseInt(b.inputLeft)+
"px";if(!isNaN(b.inputTop))a.childNodes[a._ll?1:0].style.top=parseInt(b.inputTop)+"px";a.childNodes[a._ll?1:0].appendChild(c);a.childNodes[a._ll?1:0].firstChild.value=String(b.value);a._updateImgNode=function(a,b){if(a.getForm().skin=="dhx_terrace"){var c=a.childNodes[a._ll?1:0].lastChild;c.className=b?c.className.replace(/dhxform_img/gi,"dhxform_actv_c"):c.className.replace(/dhxform_actv_c/gi,"dhxform_img");c=null}};b.checked==!0&&this.check(a);b.hidden==!0&&this.hide(a);b.disabled==!0&&this.userDisable(a);
this.doAttachEvents(a);return this},destruct:function(a){this.doUnloadNestedLists(a);this.doDestruct(a)},doAddLabel:function(a,b){var c=document.createElement("DIV");c.className="dhxform_label "+b.labelAlign;if(b.wrap==!0)c.style.whiteSpace="normal";a._ll?a.insertBefore(c,a.firstChild):a.appendChild(c);if(typeof b.tooltip!="undefined")c.title=b.tooltip;c.innerHTML="<div class='dhxform_label_nav_link' onfocus='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,true);' onblur='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,false);' onkeypress='e=event||window.arguments[0];if(e.keyCode==32||e.charCode==32){e.cancelBubble=true;e.returnValue=false;_dhxForm_doClick(this,\"mousedown\");return false;}' "+
(_dhxForm_isIPad?"ontouchstart='e=event;e.preventDefault();_dhxForm_doClick(this,\"mousedown\");' ":"")+"role='link' tabindex='0'>"+b.label+(b.info?"<span class='dhxform_info'>[?]</span>":"")+(a._required?"<span class='dhxform_item_required'>*</span>":"")+"</div>";if(!isNaN(b.labelWidth))c.firstChild.style.width=parseInt(b.labelWidth)+"px";if(!isNaN(b.labelHeight))c.firstChild.style.height=parseInt(b.labelHeight)+"px";if(!isNaN(b.labelLeft))c.style.left=parseInt(b.labelLeft)+"px";if(!isNaN(b.labelTop))c.style.top=
parseInt(b.labelTop)+"px"},doAddInput:function(a,b,c,d,e,f,g){var h=document.createElement("DIV");h.className="dhxform_control";a._ll?a.appendChild(h):a.insertBefore(h,a.firstChild);var i=document.createElement(c);i.className=g;i.name=a._idd;i._idd=a._idd;i.id=b.uid;if(typeof d=="string")i.type=d;if(c=="INPUT"||c=="TEXTAREA")i.onkeyup=function(b){b=b||event;a.callEvent("onKeyUp",[this,b])};h.appendChild(i);b.readonly&&this.setReadonly(a,!0);b.hidden==!0&&this.hide(a);b.disabled==!0&&this.userDisable(a);
if(e){if(!isNaN(b.inputLeft))h.style.left=parseInt(b.inputLeft)+"px";if(!isNaN(b.inputTop))h.style.top=parseInt(b.inputTop)+"px"}var j="";f&&(isNaN(b.inputWidth)||(j+="width:"+parseInt(b.inputWidth)+"px;"),isNaN(b.inputHeight)||(j+="height:"+parseInt(b.inputHeight)+"px;"));typeof b.style=="string"&&(j+=b.style);i.style.cssText=j;b.maxLength&&i.setAttribute("maxLength",b.maxLength);b.connector&&i.setAttribute("connector",b.connector);if(typeof b.note=="object"){var k=document.createElement("DIV");
k.className="dhxform_note";k.style.width=(isNaN(b.note.width)?i.offsetWidth:parseInt(b.note.width))+"px";k._w=b.note.width;k.innerHTML=b.note.text;h.appendChild(k);k=null}},doUnloadNestedLists:function(a){if(a._list){for(var b=0;b<a._list.length;b++)a._list[b].unload(),a._list[b]=null,a._listObj[b]=null,a._listBase[b].parentNode.removeChild(a._listBase[b]),a._listBase[b]=null;a._list=null;a._listObj=null;a._listBase=null}},doDestruct:function(a){a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=
null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._group=null;a.onselectstart=null;a.childNodes[a._ll?1:0].onmousedown=null;a.childNodes[a._ll?1:0].ontouchstart=null;a.childNodes[a._ll?0:1].onmousedown=null;a.childNodes[a._ll?0:1].ontouchstart=null;a.childNodes[a._ll?0:1].childNodes[0].onkeypress=null;a.childNodes[a._ll?0:1].childNodes[0].ontouchstart=null;for(a.childNodes[a._ll?0:1].removeChild(a.childNodes[a._ll?0:1].childNodes[0]);a.childNodes.length>0;)a.removeChild(a.childNodes[0]);
a.parentNode.removeChild(a);a=null},doAttachEvents:function(a){var b=this;a.childNodes[a._ll?1:0][_dhxForm_isIPad?"ontouchstart":"onmousedown"]=function(a){a=a||event;a.preventDefault&&a.preventDefault();var d=a.target||a.srcElement;if(!this.parentNode._enabled||this.parentNode._ro||typeof d.className!="undefined"&&d.className=="dhxform_note")return a.cancelBubble=!0,a.returnValue=!1;b.doClick(this.parentNode)};a.childNodes[a._ll?0:1].childNodes[0][_dhxForm_isIPad?"ontouchstart":"onmousedown"]=function(a){a=
a||event;a.preventDefault&&a.preventDefault();if(!this.parentNode.parentNode._enabled)return a.cancelBubble=!0,a.returnValue=!1;var d=a.target||a.srcElement;if(typeof d.className!="undefined"&&d.className=="dhxform_info")return this.parentNode.parentNode.callEvent("onInfo",[this.parentNode.parentNode._idd]),a.cancelBubble=!0,a.returnValue=!1;b.doClick(this.parentNode.parentNode)}},doClick:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus();a._enabled&&!a._ro&&!(a.checkEvent("onBeforeChange")&&
a.callEvent("onBeforeChange",[a._idd,a._value,a._checked])!==!0)&&(this.setChecked(a,!a._checked),a._autoCheck(),a.callEvent("onChange",[a._idd,a._value,a._checked]))},doCheckValue:function(a){a._checked&&a._enabled?a.childNodes[a._ll?1:0].firstChild.setAttribute("name",String(a._idd)):a.childNodes[a._ll?1:0].firstChild.removeAttribute("name")},setChecked:function(a,b){a._checked=b===!0?!0:!1;a.childNodes[a._ll?1:0].lastChild.className=a.childNodes[a._ll?1:0].lastChild.className.replace(/chbx[0-1]{1}/gi,
"")+(a._checked?" chbx1":" chbx0");this.doCheckValue(a)},check:function(a){this.setChecked(a,!0)},unCheck:function(a){this.setChecked(a,!1)},isChecked:function(a){return a._checked},enable:function(a){if(String(a.className).search("disabled")>=0)a.className=String(a.className).replace(/disabled/gi,"");a._enabled=!0;a.childNodes[a._ll?0:1].childNodes[0].tabIndex=0;a.childNodes[a._ll?0:1].childNodes[0].removeAttribute("disabled");this.doCheckValue(a)},disable:function(a){String(a.className).search("disabled")<
0&&(a.className+=" disabled");a._enabled=!1;a.childNodes[a._ll?0:1].childNodes[0].tabIndex=-1;a.childNodes[a._ll?0:1].childNodes[0].setAttribute("disabled","true");this.doCheckValue(a)},isEnabled:function(a){return a._enabled},setText:function(a,b){a.childNodes[a._ll?0:1].childNodes[0].innerHTML=b},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML},setValue:function(a,b){this.setChecked(a,b===!0||a._value===b)},getValue:function(a){return typeof a._value=="undefined"||a._value==
null?a._checked?1:0:a._value},setReadonly:function(a,b){a._ro=b===!0},isReadonly:function(a){return a._ro}};
dhtmlXForm.prototype.items.radio={input:{},r:{},firstValue:{},render:function(a,b,c){a._type="ra";a._enabled=!0;a._checked=!1;a._group=b.name;a._value=b.value;a._uid=c;a._ro=b.readonly==!0;this.r[a._idd]=a;b.inputWidth=14;this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","TEXT",!0,!0,"dhxform_textarea");a.childNodes[a._ll?1:0].className+=" dhxform_img_node";var d=document.createElement("DIV");d.className="dhxform_img rdbt0";a.appendChild(d);if(!isNaN(b.inputLeft))a.childNodes[a._ll?1:0].style.left=
parseInt(b.inputLeft)+"px";if(!isNaN(b.inputTop))a.childNodes[a._ll?1:0].style.top=parseInt(b.inputTop)+"px";a.childNodes[a._ll?1:0].appendChild(d);a.childNodes[a._ll?1:0].firstChild.value=String(b.value);a._updateImgNode=function(a,b){if(a.getForm().skin=="dhx_terrace"){var c=a.childNodes[a._ll?1:0].lastChild;c.className=b?c.className.replace(/dhxform_img/gi,"dhxform_actv_r"):c.className.replace(/dhxform_actv_r/gi,"dhxform_img");c=null}};if(this.input[b.name]==null){var e=document.createElement("INPUT");
e.type="HIDDEN";e.name=b.name;e.firstValue=a._value;a.appendChild(e);this.input[b.name]=e}if(!this.firstValue[b.name])this.firstValue[b.name]=b.value;b.checked==!0&&this.check(a);b.hidden==!0&&this.hide(a);b.disabled==!0&&this.userDisable(a);this.doAttachEvents(a);return this},destruct:function(a){if(a.lastChild==this.input[a._group]){var b=!1,c;for(c in this.r)!b&&this.r[c]._group==a._group&&this.r[c]._idd!=a._idd&&(this.r[c].appendChild(this.input[a._group]),b=!0);b||(this.input[a._group].parentNode.removeChild(this.input[a._group]),
this.input[a._group]=null,this.firstValue[a._group]=null)}var d=a._idd;this.doUnloadNestedLists(a);this.doDestruct(a);return d},doClick:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus();if(a._enabled&&!a._checked&&!a._ro){var b=[a._group,a._value,!0];a.checkEvent("onBeforeChange")&&a.callEvent("onBeforeChange",b)!==!0||(this.setChecked(a,!0),a.getForm()._autoCheck(),a.callEvent("onChange",b))}},doCheckValue:function(a){var b=null,c;for(c in this.r)if(this.r[c]._checked&&this.r[c]._enabled&&
this.r[c]._group==a._group&&this.r[c]._rId==a._rId)b=this.r[c]._value;b!=null?(this.input[a._group].setAttribute("name",String(a._group)),this.input[a._group].setAttribute("value",b),this.input[a._group]._value=b):(this.input[a._group].removeAttribute("name"),this.input[a._group].removeAttribute("value"),this.input[a._group]._value=null)},setChecked:function(a,b){var b=b===!0,c;for(c in this.r)if(this.r[c]._group==a._group&&this.r[c]._rId==a._rId){var d=!1;if(this.r[c]._idd==a._idd){if(this.r[c]._checked!=
b)this.r[c]._checked=b,d=!0}else if(this.r[c]._checked)this.r[c]._checked=!1,d=!0;if(d){var e=this.r[c].childNodes[this.r[c]._ll?1:0].childNodes[1];e.className=e.className.replace(/rdbt[0-1]{1}/gi,"")+(this.r[c]._checked?" rdbt1":" rdbt0");e=null}}this.doCheckValue(a)},getChecked:function(a){return this.input[a._group]._value},_getFirstValue:function(a){return this.firstValue[a._group]},_getId:function(a){return a._idd},setValue:function(){}};
(function(){for(var a in{doAddLabel:1,doAddInput:1,doDestruct:1,doUnloadNestedLists:1,doAttachEvents:1,check:1,unCheck:1,isChecked:1,enable:1,disable:1,isEnabled:1,setText:1,getText:1,getValue:1,setReadonly:1,isReadonly:1})dhtmlXForm.prototype.items.radio[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.select={render:function(a,b){a._type="se";a._enabled=!0;a._value=null;a._newValue=null;if((_isFF||_isIE)&&typeof b.inputWidth=="number")b.inputWidth+=a._inpWidthFix||2;this.doAddLabel(a,b);this.doAddInput(a,b,"SELECT",null,!0,!0,"dhxform_select");this.doAttachEvents(a);this.doLoadOpts(a,b);if(b.connector){var c=this;a._connector_working=!0;dhtmlxAjax.get(b.connector,function(b){for(var e=b.doXPath("//item"),f=[],g=0;g<e.length;g++)f[g]={label:e[g].getAttribute("label"),
value:e[g].getAttribute("value"),selected:e[g].getAttribute("selected")!=null};c.doLoadOpts(a,{options:f},!0);a._connector_working=!1;if(a._connector_value!=null)c.setValue(a,a._connector_value),a._connector_value=null})}return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._newValue=null;a.onselectstart=null;a.childNodes[a._ll?1:0].childNodes[0].onclick=null;a.childNodes[a._ll?
1:0].childNodes[0].onkeydown=null;a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a.childNodes[a._ll?1:0].childNodes[0].onfocus=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;a.childNodes[a._ll?1:0].childNodes[0].onkeyup=null;for(a.childNodes[a._ll?1:0].removeChild(a.childNodes[a._ll?1:0].childNodes[0]);a.childNodes.length>0;)a.removeChild(a.childNodes[0]);a.parentNode.removeChild(a);a=null},doAddLabel:function(a,b){var c=document.createElement("DIV");c.className="dhxform_label "+b.labelAlign;
c.innerHTML="<label for='"+b.uid+"'>"+b.label+(b.info?"<span class='dhxform_info'>[?]</span>":"")+(a._required?"<span class='dhxform_item_required'>*</span>":"")+"</label>";if(b.wrap==!0)c.style.whiteSpace="normal";if(typeof b.tooltip!="undefined")c.title=b.tooltip;a.appendChild(c);if(typeof b.label=="undefined"||b.label==null||b.label.length==0)c.style.display="none";if(!isNaN(b.labelWidth))c.style.width=parseInt(b.labelWidth)+"px";if(!isNaN(b.labelHeight))c.style.height=parseInt(b.labelHeight)+
"px";if(!isNaN(b.labelLeft))c.style.left=parseInt(b.labelLeft)+"px";if(!isNaN(b.labelTop))c.style.top=parseInt(b.labelTop)+"px";if(b.info)c.onclick=function(a){var a=a||event,b=a.target||a.srcElement;if(typeof b.className!="undefined"&&b.className=="dhxform_info")return this.parentNode.callEvent("onInfo",[this.parentNode._idd]),a.cancelBubble=!0,a.returnValue=!1}},doAttachEvents:function(a){var b=a.childNodes[1].childNodes[0],c=this;b.onclick=function(){c.doOnChange(this);c.doValidate(this.parentNode.parentNode)};
b.onkeydown=function(){c.doOnChange(this);c.doValidate(this.parentNode.parentNode)};b.onchange=function(){c.doOnChange(this);c.doValidate(this.parentNode.parentNode)};b=null;this.doAttachChangeLS(a)},doAttachChangeLS:function(a){var b=a.childNodes[1].childNodes[0];b.onfocus=function(){var a=this.parentNode.parentNode;a.getForm()._ccActivate(a._idd,this,a.getForm().getItemValue(a._idd,!0))};b.onblur=function(){var a=this.parentNode.parentNode;a.getForm()._ccDeactivate(a._idd)};b=null},doValidate:function(a){a.getForm().live_validate&&
this._validate(a)},doLoadOpts:function(a,b,c){for(var d=a.childNodes[a._ll?1:0].childNodes[0],e=b.options,f=0;f<e.length;f++){var g=e[f].text||e[f].label;if(!g||typeof g=="undefined")g="";var h=new Option(g,e[f].value);typeof e[f].img_src=="string"&&h.setAttribute("img_src",e[f].img_src);d.options.add(h);if(e[f].selected==!0||e[f].selected=="true")h.selected=!0,a._value=e[f].value}c===!0&&a.callEvent("onOptionsLoaded",[a._idd]);this._checkNoteWidth(a)},doOnChange:function(a){var b=a.parentNode.parentNode;
b._newValue=a.selectedIndex>=0?a.options[a.selectedIndex].value:null;if(b._newValue!=b._value){if(b.checkEvent("onBeforeChange")&&b.callEvent("onBeforeChange",[b._idd,b._value,b._newValue])!==!0){for(var c=0;c<a.options.length;c++)if(a.options[c].value==b._value)a.options[c].selected=!0;return}b._value=b._newValue;b.callEvent("onChange",[b._idd,b._value])}b._autoCheck()},setText:function(a,b){b||(b="");a.childNodes[a._ll?0:1].childNodes[0].innerHTML=b;a.childNodes[a._ll?0:1].style.display=b.length==
0||b==null?"none":""},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML},enable:function(a){if(String(a.className).search("disabled")>=0)a.className=String(a.className).replace(/disabled/gi,"");a._enabled=!0;a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("disabled")},disable:function(a){String(a.className).search("disabled")<0&&(a.className+=" disabled");a._enabled=!1;a.childNodes[a._ll?1:0].childNodes[0].setAttribute("disabled",!0)},getOptions:function(a){return a.childNodes[a._ll?
1:0].childNodes[0].options},setValue:function(a,b){if(a._connector_working)a._connector_value=b;else for(var c=this.getOptions(a),d=0;d<c.length;d++)if(c[d].value==b)c[d].selected=!0,a._value=c[d].value},getValue:function(a){for(var b=-1,c=this.getOptions(a),d=0;d<c.length;d++)if(c[d].selected)b=c[d].value;return b},setWidth:function(a,b){a.childNodes[a._ll?1:0].childNodes[0].style.width=b+"px"},getSelect:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setFocus:function(a){a.childNodes[a._ll?
1:0].childNodes[0].focus()},_checkNoteWidth:function(a){var b;if(a.childNodes[a._ll?1:0].childNodes[1]!=null)if(b=a.childNodes[a._ll?1:0].childNodes[1],b.className!=null&&b.className.search(/dhxform_note/gi)>=0&&b._w=="auto")b.style.width=a.childNodes[a._ll?1:0].childNodes[0].offsetWidth+"px";b=null}};(function(){for(var a in{doAddInput:1,doUnloadNestedLists:1,isEnabled:1})dhtmlXForm.prototype.items.select[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.multiselect={doLoadOpts:function(a,b,c){var d=a.childNodes[a._ll?1:0].childNodes[0];d.multiple=!0;if(!isNaN(b.size))d.size=Number(b.size);a._value=[];a._newValue=[];for(var e=b.options,f=0;f<e.length;f++){var g=new Option(e[f].text||e[f].label,e[f].value);d.options.add(g);if(e[f].selected==!0||e[f].selected=="true")g.selected=!0,a._value.push(e[f].value)}c===!0&&a.callEvent("onOptionsLoaded",[a._idd]);this._checkNoteWidth(a)},doAttachEvents:function(a){var b=a.childNodes[a._ll?
1:0].childNodes[0],c=this;b.onblur=function(){c.doOnChange(this)};b.onclick=function(){a._autoCheck()}},doOnChange:function(a){var b=a.parentNode.parentNode;b._newValue=[];for(var c=0;c<a.options.length;c++)a.options[c].selected&&b._newValue.push(a.options[c].value);if(b._value.sort().toString()!=b._newValue.sort().toString()){if(b.checkEvent("onBeforeChange")&&b.callEvent("onBeforeChange",[b._idd,b._value,b._newValue])!==!0){for(var d={},c=0;c<b._value.length;c++)d[b._value[c]]=!0;for(c=0;c<a.options.length;c++)a.options[c].selected=
d[a.options[c].value]==!0;d=null;return}b._value=[];for(c=0;c<b._newValue.length;c++)b._value.push(b._newValue[c]);b.callEvent("onChange",[b._idd,b._value])}b._autoCheck()},setValue:function(a,b){var c={};typeof b=="string"&&(b=b.split(","));typeof b!="object"&&(b=[b]);for(var d=0;d<b.length;d++)c[b[d]]=!0;for(var e=this.getOptions(a),d=0;d<e.length;d++)e[d].selected=c[e[d].value]==!0;a._autoCheck()},getValue:function(a){for(var b=[],c=this.getOptions(a),d=0;d<c.length;d++)c[d].selected&&b.push(c[d].value);
return b}};(function(){for(var a in dhtmlXForm.prototype.items.select)dhtmlXForm.prototype.items.multiselect[a]||(dhtmlXForm.prototype.items.multiselect[a]=dhtmlXForm.prototype.items.select[a])})();
dhtmlXForm.prototype.items.input={render:function(a,b){var c=!isNaN(b.rows);a._type="ta";a._enabled=!0;this.doAddLabel(a,b);this.doAddInput(a,b,c?"TEXTAREA":"INPUT",c?null:"TEXT",!0,!0,"dhxform_textarea");this.doAttachEvents(a);if(c)a.childNodes[a._ll?1:0].childNodes[0].rows=b.rows;if(typeof b.numberFormat!="undefined"){var d,e=null,f=null;if(typeof b.numberFormat!="string")d=b.numberFormat[0],e=b.numberFormat[1]||null,f=b.numberFormat[2]||null;else{d=b.numberFormat;if(typeof b.groupSep=="string")e=
b.groupSep;if(typeof b.decSep=="string")f=b.decSep}this.setNumberFormat(a,d,e,f,!1)}this.setValue(a,b.value);return this},doAttachEvents:function(a){var b=this;if(a._type=="ta"||a._type=="se"||a._type=="pw")a.childNodes[a._ll?1:0].childNodes[0].onfocus=function(){var a=this.parentNode.parentNode;if(a._df!=null)this.value=a._value||"";a.getForm()._ccActivate(a._idd,this,this.value)};a.childNodes[a._ll?1:0].childNodes[0].onblur=function(){var a=this.parentNode.parentNode;a.getForm()._ccDeactivate(a._idd);
b.updateValue(a);a.getForm().live_validate&&b._validate(a);a=null}},updateValue:function(a){var b=a.childNodes[a._ll?1:0].childNodes[0].value;if(!(a._df!=null&&b==this._getFmtValue(a,b))){var c=this;a._value!=b?a.checkEvent("onBeforeChange")&&a.callEvent("onBeforeChange",[a._idd,a._value,b])!==!0?a._df!=null?c.setValue(a,a._value):a.childNodes[a._ll?1:0].childNodes[0].value=a._value:(a._df!=null?c.setValue(a,b):a._value=b,a.callEvent("onChange",[a._idd,b])):a._df!=null&&this.setValue(a,a._value)}},
setValue:function(a,b){a._value=typeof b!="undefined"&&b!=null?b:"";var c=a._value||"",d=a.childNodes[a._ll?1:0].childNodes[0];a._df!=null&&typeof this._getFmtValue=="function"&&(c=this._getFmtValue(a,c));if(d.value!=c)d.value=c;d=null},getValue:function(a){return typeof a._value!="undefined"&&a._value!=null?a._value:""},setReadonly:function(a,b){a._ro=b===!0;a._ro?a.childNodes[a._ll?1:0].childNodes[0].setAttribute("readOnly","true"):a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("readOnly")},
isReadonly:function(a){if(!a._ro)a._ro=!1;return a._ro},getInput:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setNumberFormat:function(a,b,c,d,e){typeof e!="boolean"&&(e=!0);if(b=="")return a._df=null,e&&this.setValue(a,a._value),!0;if(typeof b=="string"){var f=b.match(/^([^\.\,0-9]*)([0\.\,]*)([^\.\,0-9]*)/);if(f==null||f.length!=4)return!1;a._df={i_len:!1,i_sep:typeof c=="string"?c:",",d_len:!1,d_sep:typeof d=="string"?d:".",s_bef:typeof f[1]=="string"?f[1]:"",s_aft:typeof f[3]=="string"?
f[3]:""};var g=f[2].split(".");if(g[1]!=null)a._df.d_len=g[1].length;var h=g[0].split(",");if(h.length>1)a._df.i_len=h[h.length-1].length;e&&this.setValue(a,a._value);return!0}},_getFmtValue:function(a,b){var c=b.match(/^(-)?([0-9]{1,})(\.([0-9]{1,}))?$/);if(c!=null&&c.length==5){var d="";c[1]!=null&&(d+=c[1]);d+=a._df.s_bef;if(a._df.i_len!==!1){for(var e=0,f="",g=c[2].length-1;g>=0;g--)f=""+c[2][g]+f,++e==a._df.i_len&&g>0&&(f=a._df.i_sep+f,e=0);d+=f}else d+=c[2];if(a._df.d_len!==!1){for(c[4]==null&&
(c[4]="");c[4].length<a._df.d_len;)c[4]+="0";eval("var t0 = new RegExp(/\\d{"+a._df.d_len+"}/);");var h=c[4].match(t0);h!=null&&(d+=a._df.d_sep+h);t0=h=null}d+=a._df.s_aft;return d}return b}};(function(){for(var a in{doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setFocus:1})dhtmlXForm.prototype.items.input[a]=dhtmlXForm.prototype.items.select[a]})();
dhtmlXForm.prototype.items.password={render:function(a,b){a._type="pw";a._enabled=!0;this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","PASSWORD",!0,!0,"dhxform_textarea");this.doAttachEvents(a);this.setValue(a,b.value);return this}};
(function(){for(var a in{doAddLabel:1,doAddInput:1,doAttachEvents:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,setValue:1,getValue:1,updateValue:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1})dhtmlXForm.prototype.items.password[a]=dhtmlXForm.prototype.items.input[a]})();
dhtmlXForm.prototype.items.file={render:function(a,b){a._type="fl";a._enabled=!0;this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","FILE",!0,!1,"dhxform_textarea");a.childNodes[a._ll?1:0].childNodes[0].onchange=function(){a.callEvent("onChange",[a._idd,this.value])};return this},setValue:function(){},getValue:function(a){return a.childNodes[a._ll?1:0].childNodes[0].value}};
(function(){for(var a in{doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1})dhtmlXForm.prototype.items.file[a]=dhtmlXForm.prototype.items.input[a]})();
dhtmlXForm.prototype.items.label={_index:!1,render:function(a,b){a._type="lb";a._enabled=!0;a._checked=!0;var c=document.createElement("DIV");c.className="dhxform_txt_label2"+(b._isTopmost?" topmost":"");c.innerHTML=b.label;a.appendChild(c);b.hidden==!0&&this.hide(a);b.disabled==!0&&this.userDisable(a);if(!isNaN(b.labelWidth))c.style.width=parseInt(b.labelWidth)+"px";if(!isNaN(b.labelHeight))c.style.height=parseInt(b.labelHeight)+"px";if(!isNaN(b.labelLeft))c.style.left=parseInt(b.labelLeft)+"px";
if(!isNaN(b.labelTop))c.style.top=parseInt(b.labelTop)+"px";return this},destruct:function(a){this.doUnloadNestedLists(a);a._autoCheck=null;a._enabled=null;a._type=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.onselectstart=null;a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0)a.className=String(a.className).replace(/disabled/gi,"");a._enabled=!0},disable:function(a){String(a.className).search("disabled")<0&&(a.className+=" disabled");
a._enabled=!1},setText:function(a,b){a.firstChild.innerHTML=b},getText:function(a){return a.firstChild.innerHTML}};(function(){for(var a in{doUnloadNestedLists:1,isEnabled:1})dhtmlXForm.prototype.items.label[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.button={render:function(a,b){a._type="bt";a._enabled=!0;a._name=b.name;a.className=String(a.className).replace("item_label_top","item_label_left").replace("item_label_right","item_label_left");if(!isNaN(b.width))var c=Math.max(b.width,10);var d=typeof c!="undefined";a.innerHTML='<div class="dhxform_btn" role="link" tabindex="0" dir="ltr" '+(d?' style="width:'+c+'px;"':"")+'onkeypress="e=event||window.arguments[0];if((e.keyCode==32||e.charCode==32||e.keyCode==13||e.charCode==13)&&!this.parentNode._busy){this.parentNode._busy=true;e.cancelBubble=true;e.returnValue=false;_dhxForm_doClick(this.childNodes[0],[\'mousedown\',\'mouseup\']);return false;}" ontouchstart="e=event;e.preventDefault();if(!this.parentNode._busy){this.parentNode._busy=true;_dhxForm_doClick(this.childNodes[0],[\'mousedown\',\'mouseup\']);}" onblur="_dhxForm_doClick(this.childNodes[0],\'mouseout\');" ><table cellspacing="0" cellpadding="0" border="0" align="left" style="font-size:inherit; '+
(d?"width:"+c+"px;table-layout:fixed;":"")+'"><tr><td class="btn_l"><div class="btn_l">&nbsp;</div></td><td class="btn_m" '+(d?'style="width:'+(c-10)+'px;"':"")+'><div class="btn_txt'+(d?" btn_txt_fixed_size":"")+'">'+b.value+'</div></td><td class="btn_r"><div class="btn_r">&nbsp;</div></td></tr></table></div>';if(!isNaN(b.inputLeft))a.childNodes[0].style.left=parseInt(b.inputLeft)+"px";if(!isNaN(b.inputTop))a.childNodes[0].style.top=parseInt(b.inputTop)+"px";b.hidden==!0&&this.hide(a);b.disabled==
!0&&this.userDisable(a);if(typeof b.tooltip!="undefined")a.firstChild.title=b.tooltip;a.onselectstart=function(a){a=a||event;a.cancelBubble=!0;return a.returnValue=!1};a.childNodes[0].onselectstart=function(a){a=a||event;a.cancelBubble=!0;return a.returnValue=!1};a.childNodes[0].childNodes[0].onmouseover=function(){var a=this.parentNode.parentNode;if(a._enabled)this._isOver=!0,this.className="dhxform_btn_over",a=null};a.childNodes[0].childNodes[0].onmouseout=function(){var a=this.parentNode.parentNode;
if(a._enabled)this.className="",this._isOver=this._pressed=this._allowClick=!1,a=null};a.childNodes[0].childNodes[0].onmousedown=function(){if(!this._pressed){var a=this.parentNode.parentNode;if(a._enabled)this.className="dhxform_btn_pressed",this._pressed=this._allowClick=!0,a=null}};a.childNodes[0].childNodes[0].onmouseup=function(){if(this._pressed){var a=this.parentNode.parentNode;if(a._enabled)a._busy=!1,this.className=this._isOver?"dhxform_btn_over":"",this._pressed&&this._allowClick&&a.callEvent("_onButtonClick",
[a._name,a._cmd]),this._pressed=this._allowClick=!1,a=null}};return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._type=null;a._enabled=null;a._cmd=null;a._name=null;a.onselectstart=null;a.childNodes[0].onselectstart=null;a.childNodes[0].onkeypress=null;a.childNodes[0].ontouchstart=null;a.childNodes[0].onblur=null;a.childNodes[0].childNodes[0].onmouseover=null;a.childNodes[0].childNodes[0].onmouseout=null;a.childNodes[0].childNodes[0].onmousedown=
null;for(a.childNodes[0].childNodes[0].onmouseup=null;a.childNodes.length>0;)a.removeChild(a.childNodes[0]);a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0)a.className=String(a.className).replace(/disabled/gi,"");a._enabled=!0;a.childNodes[0].tabIndex=0;a.childNodes[0].removeAttribute("disabled")},disable:function(a){String(a.className).search("disabled")<0&&(a.className+=" disabled");a._enabled=!1;a.childNodes[0].tabIndex=-1;a.childNodes[0].setAttribute("disabled",
"true")},setText:function(a,b){a.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML=b},getText:function(a){return a.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML}};(function(){for(var a in{doUnloadNestedLists:1,isEnabled:1})dhtmlXForm.prototype.items.button[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.hidden={_index:!1,render:function(a,b){a.style.display="none";a._name=b.name;a._type="hd";a._enabled=!0;var c=document.createElement("INPUT");c.type="HIDDEN";c.name=b.name;c.value=b.value||"";a.appendChild(c);return this},destruct:function(a){for(this.doUnloadNestedLists(a);a.childNodes.length>0;)a.removeChild(a.childNodes[0]);a._autoCheck=null;a._name=null;a._type=null;a._enabled=null;a.onselectstart=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.parentNode.removeChild(a);
a=null},enable:function(a){a._enabled=!0;a.childNodes[0].setAttribute("name",a._name)},disable:function(a){a._enabled=!1;a.childNodes[0].removeAttribute("name")},show:function(){},hide:function(){},isHidden:function(){return!0},setValue:function(a,b){a.childNodes[0].value=b},getValue:function(a){return a.childNodes[0].value},getInput:function(a){return a.childNodes[0]}};(function(){for(var a in{doUnloadNestedLists:1,isEnabled:1})dhtmlXForm.prototype.items.hidden[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.list={_index:!1,render:function(a){a._type="list";a._enabled=!0;a._isNestedForm=!0;a.className="dhxform_base_nested";return[this,new dhtmlXForm(a)]},destruct:function(){}};
dhtmlXForm.prototype.items.fieldset={_index:!1,render:function(a,b){a._type="fs";if(typeof parseInt(b.inputWidth)=="number"&&(_isFF||_isOpera))b.inputWidth-=12;a._width=b.width;a._enabled=!0;a._checked=!0;a.className="fs_"+b.position+(typeof b.className=="string"?" "+b.className:"");var c=document.createElement("FIELDSET");c.className="dhxform_fs";var d=String(b.labelAlign).replace("align_","");c.innerHTML="<legend class='fs_legend' align='"+d+"' style='text-align:"+d+"'>"+b.label+"</legend>";a.appendChild(c);
if(!isNaN(b.inputLeft))c.style.left=parseInt(b.inputLeft)+"px";if(!isNaN(b.inputTop))c.style.top=parseInt(b.inputTop)+"px";if(b.inputWidth!="auto"&&!isNaN(b.inputWidth))c.style.width=parseInt(b.inputWidth)+"px";a._addSubListNode=function(){var a=document.createElement("DIV");this.childNodes[0].appendChild(a);return a};b.hidden==!0&&this.hide(a);b.disabled==!0&&this.userDisable(a);return this},destruct:function(a){this.doUnloadNestedLists(a);a._checked=null;a._enabled=null;a._idd=null;a._type=null;
a._width=null;a.onselectstart=null;a._addSubListNode=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;for(a.getForm=null;a.childNodes.length>0;)a.removeChild(a.childNodes[0]);a.parentNode.removeChild(a);a=null},setText:function(a,b){a.childNodes[0].childNodes[0].innerHTML=b},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},enable:function(a){a._enabled=!0;if(String(a.className).search("disabled")>=0)a.className=String(a.className).replace(/disabled/gi,"")},disable:function(a){a._enabled=
!1;String(a.className).search("disabled")<0&&(a.className+=" disabled")},setWidth:function(a,b){a.childNodes[0].style.width=b+"px";a._width=b},getWidth:function(a){return a._width}};(function(){for(var a in{doUnloadNestedLists:1,isEnabled:1})dhtmlXForm.prototype.items.fieldset[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.block={_index:!1,render:function(a,b){a._type="bl";a._width=b.width;a._enabled=!0;a._checked=!0;a.className="block_"+b.position+(typeof b.className=="string"?" "+b.className:"");var c=document.createElement("DIV");c.className="dhxform_block";if(b.style)c.style.cssText=b.style;if(typeof b.id!="undefined")c.id=b.id;a.appendChild(c);if(!isNaN(b.inputLeft))c.style.left=parseInt(b.inputLeft)+"px";if(!isNaN(b.inputTop))c.style.top=parseInt(b.inputTop)+"px";if(b.inputWidth!="auto"&&
!isNaN(b.inputWidth))c.style.width=parseInt(b.inputWidth)+"px";a._addSubListNode=function(){var a=document.createElement("DIV");a._inBlcok=!0;this.childNodes[0].appendChild(a);return a};b.hidden==!0&&this.hide(a);b.disabled==!0&&this.userDisable(a);return this},_setCss:function(a,b,c){a.firstChild.className="dhxform_obj_"+b+" dhxform_block";a.firstChild.style.fontSize=c}};
(function(){for(var a in{enable:1,disable:1,isEnabled:1,setWidth:1,getWidth:1,doUnloadNestedLists:1,destruct:1})dhtmlXForm.prototype.items.block[a]=dhtmlXForm.prototype.items.fieldset[a]})();dhtmlXForm.prototype.items.newcolumn={_index:!1};
dhtmlXForm.prototype.items.template={render:function(a,b){var c=!isNaN(b.rows);a._type="tp";a._enabled=!0;if(b.format){if(typeof b.format=="function")a.format=b.format;if(typeof window[b.format]=="function")a.format=window[b.format]}if(!a.format)a.format=function(a,b){return b};this.doAddLabel(a,b);this.doAddInput(a,b,"DIV",null,!0,!0,"dhxform_item_template");a._value=b.value||"";a.childNodes[1].childNodes[0].innerHTML=a.format(a._idd,a._value);return this},setValue:function(a,b){a._value=b;a.childNodes[1].childNodes[0].innerHTML=
a.format(a._idd,a._value)},getValue:function(a){return a._value},enable:function(a){if(String(a.className).search("disabled")>=0)a.className=String(a.className).replace(/disabled/gi,"");a._enabled=!0},disable:function(a){String(a.className).search("disabled")<0&&(a.className+=" disabled");a._enabled=!1}};(function(){for(var a in{doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,setWidth:1})dhtmlXForm.prototype.items.template[a]=dhtmlXForm.prototype.items.select[a]})();
dhtmlXForm.prototype._ulToObject=function(a,b){for(var c=[],d=0;d<a.childNodes.length;d++){if(String(a.childNodes[d].tagName||"").toLowerCase()=="li"){for(var e={},f=a.childNodes[d],g=0;g<b.length;g++)f.getAttribute(b[g])!=null&&(e[String(b[g]).replace("ftype","type")]=f.getAttribute(b[g]));if(!e.label)try{e.label=f.firstChild.nodeValue}catch(h){}var i=f.getElementsByTagName("UL");i[0]!=null&&(e[e.type=="select"?"options":"list"]=dhtmlXForm.prototype._ulToObject(i[0],b));for(g=0;g<f.childNodes.length;g++)if(String(f.childNodes[g].tagName||
"").toLowerCase()=="userdata"){if(!e.userdata)e.userdata={};e.userdata[f.childNodes[g].getAttribute("name")]=f.childNodes[g].firstChild.nodeValue}c[c.length]=e}if(String(a.childNodes[d].tagName||"").toLowerCase()=="div"){e={type:"label"};try{e.label=a.childNodes[d].firstChild.nodeValue}catch(j){}c[c.length]=e}}return c};
dhtmlxEvent(window,"load",function(){for(var a="ftype,name,value,label,check,checked,disabled,text,rows,select,selected,width,style,className,labelWidth,labelHeight,labelLeft,labelTop,inputWidth,inputHeight,inputLeft,inputTop,position,size".split(","),b=document.getElementsByTagName("UL"),c=[],d=0;d<b.length;d++)if(b[d].className=="dhtmlxForm"){var e=document.createElement("DIV");c[c.length]={nodeUL:b[d],nodeForm:e,data:dhtmlXForm.prototype._ulToObject(b[d],a),name:b[d].getAttribute("name")||null}}for(d=
0;d<c.length;d++){c[d].nodeUL.parentNode.insertBefore(c[d].nodeForm,c[d].nodeUL);var f=new dhtmlXForm(c[d].nodeForm,c[d].data);c[d].name!==null&&(window[c[d].name]=f);var g=c[d].nodeUL.getAttribute("oninit")||null;c[d].nodeUL.parentNode.removeChild(c[d].nodeUL);c[d].nodeUL=null;c[d].nodeForm=null;c[d].data=null;c[d]=null;if(g)if(typeof g=="function")g();else if(typeof window[g]=="function")window[g]()}});
if(window.dhtmlXContainer){if(!dhtmlx.attaches)dhtmlx.attaches={};dhtmlx.attaches.attachForm||(dhtmlx.attaches.attachForm=function(a){var b=document.createElement("DIV");b.id="dhxFormObj_"+this._genStr(12);b.style.position="relative";b.style.width="100%";b.style.height="100%";b.style.overflow="auto";b.cmp="form";this.attachObject(b,!1,!0,!1);this.vs[this.av].form=new dhtmlXForm(b,a);this.vs[this.av].form.setSkin(this.skin);this.vs[this.av].form.setSizes();this.vs[this.av].formObj=b;this.skin=="dhx_terrace"&&
(this.adjust(),this.updateNestedObjects());return this.vs[this.av].form});if(!dhtmlx.detaches)dhtmlx.detaches={};dhtmlx.detaches.detachForm||(dhtmlx.detaches.detachForm=function(a){if(a.form)a.form.unload(),a.form=null,a.formObj=null,a.attachForm=null})}dhtmlXForm.prototype.setUserData=function(a,b,c,d){if(typeof d!="undefined"){var e=this.doWithItem([a,b],"_getId");e!=null&&(a=e,b=c,c=d)}if(!this._userdata)this._userdata={};this._userdata[a]=this._userdata[a]||{};this._userdata[a][b]=c};
dhtmlXForm.prototype.getUserData=function(a,b,c){if(typeof c!="undefined"){var d=this.doWithItem([a,b],"_getId");d!=null&&(a=d,b=c)}return this._userdata!=null&&typeof this._userdata[a]!="undefined"&&typeof this._userdata[a][b]!="undefined"?this._userdata[a][b]:""};
dhtmlXForm.prototype.setRTL=function(a){this._rtl=a===!0?!0:!1;for(var b=0;b<this.base.length;b++)if(this._rtl)String(this.base[b].className).search(/dhxform_rtl/gi)<0&&(this.base[b].className+=" dhxform_rtl");else if(String(this.base[b].className).search(/dhxform_rtl/gi)>=0)this.base[b].className=String(this.base[b].className).replace(/dhxform_rtl/gi,"")};
_dhxForm_doClick=function(a,b){if(typeof b=="object")var c=b[1],b=b[0];if(document.createEvent){var d=document.createEvent("MouseEvents");d.initEvent(b,!0,!1);a.dispatchEvent(d)}else if(document.createEventObject)d=document.createEventObject(),d.button=1,a.fireEvent("on"+b,d);c&&window.setTimeout(function(){_dhxForm_doClick(a,c)},100)};
dhtmlXForm.prototype.setFormData=function(a){for(var b in a){var c=this.getItemType(b);switch(c){case "checkbox":this[a[b]==!0||parseInt(a[b])==1||a[b]=="true"?"checkItem":"uncheckItem"](b);break;case "radio":this.checkItem(b,a[b]);break;case "input":case "textarea":case "select":case "multiselect":case "hidden":case "template":case "combo":case "calendar":case "colorpicker":case "editor":this.setItemValue(b,a[b]);break;default:if(this["setFormData_"+c])this["setFormData_"+c](b,a[b]);else{if(!this.hId)this.hId=
this._genStr(12);this.setUserData(this.hId,b,a[b])}}}};
dhtmlXForm.prototype.getFormData=function(a,b){this._updateValues();var c={},d=this,e;for(e in this.itemPull){var f=this.itemPull[e]._idd,g=this.itemPull[e]._type;g=="ch"&&(c[f]=this.isItemChecked(f)?this.getItemValue(f):0);g=="ra"&&!c[this.itemPull[e]._group]&&(c[this.itemPull[e]._group]=this.getCheckedValue(this.itemPull[e]._group));g in{se:1,ta:1,pw:1,hd:1,tp:1,fl:1,calendar:1,combo:1,editor:1,colorpicker:1}&&(c[f]=this.getItemValue(f,a));this["getFormData_"+g]&&(c[f]=this["getFormData_"+g](f));
if(g=="up"){var h=this.getItemValue(f),i;for(i in h)c[i]=h[i]}if(this.itemPull[e]._list)for(var j=0;j<this.itemPull[e]._list.length;j++){var k=this.itemPull[e]._list[j].getFormData(a,b),m;for(m in k)c[m]=k[m]}}if(!b&&this.hId&&this._userdata[this.hId])for(e in this._userdata[this.hId])c[e]||(c[e]=this._userdata[this.hId][e]);return c};
dhtmlXForm.prototype.adjustParentSize=function(){for(var a=0,b=-1,c=0;c<this.base.length;c++)if(a+=this.base[c].offsetWidth,this.base[c].offsetHeight>b)b=this.base[c].offsetHeight;var d=!1;try{if(d=this.cont.parentNode.parentNode.parentNode.parentNode._isCell==!0)var e=this.cont.parentNode.parentNode.parentNode.parentNode}catch(f){}if(d&&typeof e!="undefined")a>0&&e.setWidth(a+10),b>0&&e.setHeight(b+e.firstChild.firstChild.offsetHeight+5),d=e=null;else{var g=!1;try{if(g=this.cont.parentNode.parentNode.parentNode.parentNode._isWindow==
!0)var h=this.cont.parentNode.parentNode.parentNode.parentNode}catch(i){}if(g&&typeof h!="undefined")this.cont.style.display="none",(a>0||b>0)&&h._adjustToContent(a+10,b+10),this.cont.style.display="",g=h=null}};_dhxForm_isIPad=navigator.userAgent.search(/iPad/gi)>=0;
dhtmlXForm.prototype.load=function(a,b,c){var d=this;d.callEvent("onXLS",[]);typeof b=="function"&&(c=b,b="xml");dhtmlxAjax.get(a,function(e){var f={};if(b=="json")eval("data="+e.xmlDoc.responseText);else{var g=e.doXPath("//data")[0];if(g&&g.getAttribute("dhx_security"))dhtmlx.security_key=g.getAttribute("dhx_security");for(var h=e.doXPath("//data/*"),i=0;i<h.length;i++)f[h[i].tagName]=h[i].firstChild?h[i].firstChild.nodeValue:""}var j=a.match(/(\?|\&)id\=([a-z0-9_]*)/i);j&&j[0]&&(j=j[0].split("=")[1]);
if(d.callEvent("onBeforeDataLoad",[j,f]))d.formId=j,d._last_load_data=f,d.setFormData(f),d.resetDataProcessor("updated");d.callEvent("onXLE",[]);c&&c.call(this)})};dhtmlXForm.prototype.reset=function(){this.callEvent("onBeforeReset",[this.formId,this.getFormData()])&&(this._last_load_data&&this.setFormData(this._last_load_data),this.callEvent("onAfterReset",[this.formId]))};
dhtmlXForm.prototype.send=function(a,b,c,d){typeof b=="function"&&(c=b,b="post");if(d===!0||this.validate()){var e=this.getFormData(!0),f=[],g;for(g in e)f.push(g+"="+encodeURIComponent(e[g]));var h=function(a){c&&c.call(this,a,a.xmlDoc.responseText)};b=="get"?dhtmlxAjax.get(a+(a.indexOf("?")==-1?"?":"&")+f.join("&"),h):dhtmlxAjax.post(a,f.join("&"),h)}};dhtmlXForm.prototype.save=function(){};dhtmlXForm.prototype.dummy=function(){};dhtmlXForm.prototype._changeFormId=function(a,b){this.formId=b};
dhtmlXForm.prototype._dp_init=function(a){a._methods=["dummy","dummy","_changeFormId","dummy"];a._getRowData=function(a){var c=this.obj.getFormData(!0);c[this.action_param]=this.obj.getUserData(a,this.action_param);return c};a._clearUpdateFlag=function(){};a.attachEvent("onAfterUpdate",function(a,c,d,e){if(c=="inserted"||c=="updated")this.obj.resetDataProcessor("updated"),this.obj._last_load_data=this.obj.getFormData(!0);this.obj.callEvent("onAfterSave",[this.obj.formId,e]);return!0});a.autoUpdate=
!1;a.setTransactionMode("POST",!0);this.dp=a;this.formId=(new Date).valueOf();this.resetDataProcessor("inserted");this.save=function(){this.callEvent("onBeforeSave",[this.formId,this.getFormData()])&&this.validate()&&a.sendData()}};dhtmlXForm.prototype.resetDataProcessor=function(a){if(this.dp)this.dp.updatedRows=[],this.dp._in_progress=[],this.dp.setUpdated(this.formId,!0,a)};
if(!window.dhtmlxValidation)dhtmlxValidation=function(){},dhtmlxValidation.prototype={isEmpty:function(a){return a==""},isNotEmpty:function(a){return!a==""},isValidBoolean:function(a){return!!a.match(/^(0|1|true|false)$/)},isValidEmail:function(a){return!!a.match(/(^[a-z]([a-z0-9_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\-\.]*)(\.[a-z]{2,3})$)/i)},isValidInteger:function(a){return!!a.match(/(^-?\d+$)/)},isValidNumeric:function(a){return!!a.match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/)},
isValidAplhaNumeric:function(a){return!!a.match(/^[_\-a-z0-9]+$/gi)},isValidDatetime:function(a){var b=a.match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);return b&&!!(b[1]<=9999&&b[2]<=12&&b[3]<=31&&b[4]<=59&&b[5]<=59&&b[6]<=59)||!1},isValidDate:function(a){var b=a.match(/^(\d{4})-(\d{2})-(\d{2})$/);return b&&!!(b[1]<=9999&&b[2]<=12&&b[3]<=31)||!1},isValidTime:function(a){var b=a.match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return b&&!!(b[1]<=24&&b[2]<=59&&b[3]<=59)||!1},isValidIPv4:function(a){var b=
a.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return b&&!!(b[1]<=255&&b[2]<=255&&b[3]<=255&&b[4]<=255)||!1},isValidCurrency:function(a){return a.match(/^\$?\s?\d+?[\.,\,]?\d+?\s?\$?$/)&&!0||!1},isValidSSN:function(a){return a.match(/^\d{3}\-?\d{2}\-?\d{4}$/)&&!0||!1},isValidSIN:function(a){return a.match(/^\d{9}$/)&&!0||!1}},dhtmlxValidation=new dhtmlxValidation;
dhtmlXForm.prototype.items.calendar={render:function(a,b){var c=this;a._type="calendar";a._enabled=!0;this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","TEXT",!0,!0,"dhxform_textarea calendar");this.doAttachChangeLS(a);a.childNodes[a._ll?1:0].childNodes[0]._idd=a._idd;a._f=b.dateFormat||"%d-%m-%Y";a._f0=b.serverDateFormat||a._f;a._c=new dhtmlXCalendarObject(a.childNodes[a._ll?1:0].childNodes[0],b.skin||a.getForm().skin||"dhx_skyblue");a._c._nullInInput=!0;a._c.enableListener(a.childNodes[a._ll?1:0].childNodes[0]);
a._c.setDateFormat(a._f);b.enableTime||a._c.hideTime();isNaN(b.weekStart)||a._c.setWeekStartDay(b.weekStart);typeof b.calendarPosition!="undefined"&&a._c.setPosition(b.calendarPosition);a._c._itemIdd=a._idd;a._c.attachEvent("onBeforeChange",function(b){if(a._value!=b){if(a.checkEvent("onBeforeChange")&&a.callEvent("onBeforeChange",[a._idd,a._value,b])!==!0)return!1;a._value=b;c.setValue(a,b);a.callEvent("onChange",[this._itemIdd,a._value])}return!0});this.setValue(a,b.value);return this},getCalendar:function(a){return a._c},
setSkin:function(a,b){a._c.setSkin(b)},setValue:function(a,b){!b||b==null||typeof b=="undefined"||b==""?(a._value=null,a.childNodes[a._ll?1:0].childNodes[0].value=""):(a._value=b instanceof Date?b:a._c._strToDate(b,a._f0),a.childNodes[a._ll?1:0].childNodes[0].value=a._c._dateToStr(a._value,a._f));a._c.setDate(a._value)},getValue:function(a,b){var c=a._c.getDate();return b===!0&&c==null?"":b===!0?a._c._dateToStr(c,a._f0):c},destruct:function(a){a._c.disableListener(a.childNodes[a._ll?1:0].childNodes[0]);
a._c.unload();a._c=null;try{delete a._c}catch(b){}a._f=null;try{delete a._f}catch(c){}a._f0=null;try{delete a._f0}catch(d){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;this.d2(a);a=null}};(function(){for(var a in{doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1})dhtmlXForm.prototype.items.calendar[a]=dhtmlXForm.prototype.items.input[a]})();
dhtmlXForm.prototype.items.calendar.doAttachChangeLS=dhtmlXForm.prototype.items.select.doAttachChangeLS;dhtmlXForm.prototype.items.calendar.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getCalendar=function(a){return this.doWithItem(a,"getCalendar")};
dhtmlXForm.prototype.items.upload={render:function(a,b){a._type="up";a._enabled=!0;a._checked=!0;a.className=b.position+(typeof b.className=="string"?" "+b.className:"");var c=document.createElement("DIV");a.appendChild(c);if(!isNaN(b.inputLeft))a.style.left=parseInt(b.inputLeft)+"px";if(!isNaN(b.inputTop))a.style.top=parseInt(b.inputTop)+"px";if(b.inputWidth!="auto"&&!isNaN(b.inputWidth))c.style.width=parseInt(b.inputWidth)+"px";a._uploader=new dhtmlXFileUploader(c,b.swfPath||"",b.swfUrl||"",b.mode||
null,b.swfLogs);a._uploader.setURL(b.url||"");a._uploader.callEvent=a.callEvent;typeof b.autoStart!="undefined"&&a._uploader.setAutoStart(b.autoStart);typeof b.autoRemove!="undefined"&&a._uploader.setAutoRemove(b.autoRemove);typeof b.titleScreen!="undefined"&&a._uploader.enableTitleScreen(b.titleScreen);typeof b.titleText!="undefined"&&a._uploader.setTitleText(b.titleText);b.hidden==!0&&this.hide(a);b.disabled==!0&&this.userDisable(a);if(!(b.inputHeight=="auto"||parseInt(b.inputHeight)==NaN))a._uploader.p_files.style.height=
parseInt(b.inputHeight)+"px";return this},destruct:function(a){this.doUnloadNestedLists(a);a._uploader.unload();a._uploader=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a.onselectstart=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;for(a.getForm=null;a.childNodes.length>0;)a.removeChild(a.childNodes[0]);a.parentNode.removeChild(a);a=null},setText:function(){},getText:function(){},enable:function(a){a._enabled=!0;if(String(a.className).search("disabled")>=0)a.className=
String(a.className).replace(/disabled/gi,"");a._uploader.enable()},disable:function(a){a._enabled=!1;String(a.className).search("disabled")<0&&(a.className+=" disabled");a._uploader.disable()},setWidth:function(a,b){a.childNodes[0].style.width=b+"px";a._width=b},getWidth:function(a){return a._width||parseInt(a.childNodes[0].style.width)},setValue:function(a){a._uploader.clear()},getValue:function(a){var b=a._uploader.getData(),c={},d=0,e;for(e in b)c[a._idd+"_r_"+d]=b[e].realName,c[a._idd+"_s_"+d]=
b[e].serverName,d++;c[a._idd+"_count"]=d;return c},getUploader:function(a){return a._uploader},getStatus:function(a){return a._uploader.getStatus()}};(function(){for(var a in{doUnloadNestedLists:1,isEnabled:1})dhtmlXForm.prototype.items.upload[a]=dhtmlXForm.prototype.items.checkbox[a]})();dhtmlXForm.prototype.setFormData_upload=function(a){this.doWithItem(a,"setValue")};dhtmlXForm.prototype.getUploader=function(a){return this.doWithItem(a,"getUploader")};
dhtmlXForm.prototype.getUploaderStatus=function(a){return this.doWithItem(a,"getStatus")};
function dhtmlXFileUploader(a,b,c,d,e){var f=this;if(typeof d=="string"&&typeof this[d]=="function")this.engine=d;else if(this.engine="html4",typeof window.FormData!="undefined"&&typeof window.XMLHttpRequest!="undefined"&&typeof window.XMLHttpRequestUpload!="undefined")this.engine="html5";else if(typeof window.swfobject!="undefined"){var g=swfobject.getFlashPlayerVersion();if(g.major>=10)this.engine="flash"}typeof a=="string"&&(a=document.getElementById(a));this._swf_file_url=b||"";this._swf_upolad_url=
c||"";this._swf_logs=e;this.p=document.createElement("DIV");this.p.className+=" dhx_file_uploader";a.appendChild(this.p);this.p_files=document.createElement("DIV");this.p_files.className="dhx_upload_files";this.p.appendChild(this.p_files);this.p_controls=document.createElement("DIV");this.p_controls.className="dhx_upload_controls";this.p.appendChild(this.p_controls);this._files={};this._items={};this._data={};this._autoRemove=this._autoStart=!1;this._enabled=this._titleScreen=!0;this._uploaded_count=
0;this._uid=function(){this._idd?this._idd++:this._idd=(new Date).getTime();return this._idd};this._initToolbar=function(){this.b_opts={info:{onclick:null},browse:{onclick:null,tooltip:"Browse"},upload:{onclick:function(){f._enabled&&!f._uploading&&(f._switchButton(!0),f._uploadStart())},tooltip:"Upload"},cancel:{onclick:function(){f._enabled&&(f._uploadStop(),f._switchButton(!1))},tooltip:"Stop"},clear:{onclick:function(){f._enabled&&f.clear()},tooltip:"Clear list"}};this.buttons={};for(var a in this.b_opts){var b=
document.createElement("DIV");b.innerHTML="&nbsp;";b.className="dhx_file_uploader_button button_"+a;b.onclick=this.b_opts[a].onclick;if(this.b_opts[a].tooltip)b.title=this.b_opts[a].tooltip;this.p_controls.appendChild(b);this.buttons[a]=b;b=null}this.buttons.cancel.style.display="none"};this._readableSize=function(a){for(var b=!1,c="b,Kb,Mb,Gb,Tb,Pb,Eb".split(","),d=0;d<c.length;d++)a>1024?a/=1024:b===!1&&(b=d);b===!1&&(b=c.length-1);return Math.round(a*100)/100+" "+c[b]};this._addFileToList=function(a,
b,c,d,e){this._checkTitleScreen();var g=document.createElement("DIV");g._idd=a;g.className="dhx_file dhx_file_"+d;g.innerHTML="<div class='dhx_file_param dhx_file_name'>&nbsp;</div><div class='dhx_file_param dhx_file_progress'>"+e+"%</div><div class='dhx_file_param dhx_file_delete' title='Remove from list'>&nbsp;</div>";this.p_files.appendChild(g);g.childNodes[0].style.width=g.offsetWidth-127+"px";this._items[a]=g;this._updateFileNameSize(a);g.childNodes[2].onclick=function(){if(f._enabled){var a=
this.parentNode._idd;f._removeFileFromQueue(a)}}};this._removeFileFromList=function(a){if(this._items[a])this._items[a].childNodes[2].onclick=null,this._items[a].parentNode.removeChild(this._items[a]),this._items[a]=null,delete this._items[a],this._data[a]&&(this._data[a]=null,delete this._data[a]),this._checkTitleScreen()};this._updateFileNameSize=function(a){this._items[a].childNodes[0].innerHTML=this._files[a].name+(!isNaN(this._files[a].size)?" ("+this._readableSize(this._files[a].size)+")":"&nbsp;");
this._items[a].childNodes[0].title=this._files[a].name+(!isNaN(this._files[a].size)?" ("+this._readableSize(this._files[a].size)+")":"")};this._updateFileInList=function(a,b,c){if(this._items[a])this._items[a].className="dhx_file dhx_file_"+b,b=="uploading"&&c<100&&this._progress_type=="loader"?(this._items[a].childNodes[1].className="dhx_file_param dhx_file_uploading",this._items[a].childNodes[1].innerHTML="&nbsp;"):(this._items[a].childNodes[1].className="dhx_file_param dhx_file_progress",this._items[a].childNodes[1].innerHTML=
c+"%"),this._updateFileNameSize(a)};this._removeFilesByState=function(a){for(var b in this._files)(a===!0||this._files[b].state==a)&&this._removeFileFromQueue(b)};this._switchButton=function(a){if(a==!0)this.buttons.upload.style.display="none",this.buttons.cancel.style.display="";else{var b=this._uploaded_count;this.buttons.upload.style.display="";this.buttons.cancel.style.display="none";this._uploaded_count=0;b>0&&this.callEvent("onUploadComplete",[b])}};this._uploadStart=function(){if(!this._uploading)for(var a in this._files)if(this._files[a].state==
"fail")this._files[a].state="added",this._updateFileInList(a,"added",0);this._uploading=!0;var b=!1;for(a in this._files)if(!b&&[this._files[a].state]=="added")b=!0,this._files[a].state="uploading",this._updateFileInList(a,"uploading",0),this._doUploadFile(a);if(!b)this._uploading=!1,this._switchButton(!1)};this._onUploadSuccess=function(a,b,c){try{eval("var t="+c.data)}catch(d){}if(typeof t!="undefined"&&t.state==!0&&t.name!=null)b=t.name;this._uploaded_count++;this._data[a]={realName:this._files[a].name,
serverName:b};this._files[a].state="uploaded";this._updateFileInList(a,"uploaded",100);this.callEvent("onUploadFile",[this._files[a].name,b]);this._autoRemove&&this._removeFileFromQueue(a);this._uploading&&this._uploadStart()};this._onUploadFail=function(a){this._files[a].state="fail";this._updateFileInList(a,"fail",0);this.callEvent("onUploadFail",[this._files[a].name]);this._uploading&&this._uploadStart()};this._onUploadAbort=function(a){this._uploading=!1;this._files[a].state="added";this._updateFileInList(a,
"added",0);this.callEvent("onUploadCancel",[this._files[a].name])};this._checkTitleScreen=function(){var a=0,b;for(b in this._files)a++;if(a==0&&this.p.className.search("dhx_file_uploader_title")<0&&this._titleScreen)this.p.className+=" dhx_file_uploader_title",this.buttons.info.innerHTML=this._titleText,this.buttons.info.style.width=Math.max(this.p_controls.offsetWidth-134,0)+"px";if((a>0||!this._titleScreen)&&this.p.className.search("dhx_file_uploader_title")>=0)this.p.className=this.p.className.replace(/dhx_file_uploader_title/g,
""),this.buttons.info.innerHTML=""};this.callEvent=function(){};this.upload=function(){this._uploading||this._uploadStart()};this.setAutoStart=function(a){this._autoStart=a==!0};this.setAutoRemove=function(a){this._autoRemove=a==!0};this.enableTitleScreen=function(a){this._titleScreen=a==!0;this._checkTitleScreen()};this.setTitleText=function(a){this._titleText=a;if(this.p.className.search("dhx_file_uploader_title")>=0)this.buttons.info.innerHTML=this._titleText};this.setURL=function(a){this._url=
a};this.setSWFURL=function(a){this._swf_upolad_url=a};this.enable=function(){this._enabled=!0;this.p_files.className="dhx_upload_files";this.p_controls.className="dhx_upload_controls"};this.disable=function(){this._enabled=!1;this.p_files.className="dhx_upload_files dhx_uploader_dis";this.p_controls.className="dhx_upload_controls dhx_uploader_dis"};this.getStatus=function(){var a=0,b;for(b in this._files){if(this._files[b].state!="uploaded")return-1;a=1}return a};this.getData=function(){return this._data};
this.clear=function(){this._uploading&&f._uploadStop();f._switchButton(!1);f._removeFilesByState(!0);this.callEvent("onClear",[])};this.unload=function(){this._removeFilesByState(!0);this._items=this._files=this._data=null;this._unloadEngine();for(var a in this.buttons)this.buttons[a].onclick=null,this.buttons[a].parentNode.removeChild(this.buttons[a]),this.buttons[a]=null,delete this.buttons[a];this.buttons=null;for(a in this.b_opts)this.b_opts[a].onclick=null,this.b_opts[a]=null,delete this.b_opts[a];
this.b_opts=null;this.p_controls.parentNode.removeChild(this.p_controls);this.p_controls=null;this.p_files.parentNode.removeChild(this.p_files);this.engine=this._swf_upolad_url=this._swf_file_url=this.unload=this.clear=this.getData=this.getStatus=this.disable=this.enable=this.setURL=this.setTitleText=this.enableTitleScreen=this.setAutoRemove=this.setAutoStart=this.upload=this.callEvent=this._checkTitleScreen=this._onUploadAbort=this._onUploadFail=this._onUploadSuccess=this._uploadStart=this._switchButton=
this._removeFilesByState=this._updateFileInList=this._updateFileNameSize=this._removeFileFromList=this._addFileToList=this._readableSize=this._initToolbar=this._uid=this._idd=this._uploading=this._url=this._uploaded_count=this._titleText=this._titleScreen=this._progress_type=this._enabled=this._autoStart=this._autoRemove=this.p_files=null;this.p.className=this.p.className.replace(/dhx_file_uploader_title/gi,"").replace(/dhx_file_uploader/gi,"");f=a=this.p=null};var h=new this[this.engine],i;for(i in h)this[i]=
h[i],h[i]=null;i=h=a=null;this._initToolbar();this._initEngine();this._checkTitleScreen();return this}dhtmlXFileUploader.prototype.html5=function(){};
dhtmlXFileUploader.prototype.html5.prototype={_initEngine:function(){var a=this;this.buttons.browse.onclick=function(){a._enabled&&a.f.click()};this._progress_type="percentage";this.f=document.createElement("INPUT");this.f.type="file";this.f.multiple="1";this.f.className="dhx_uploader_input";this.p_controls.appendChild(this.f);this.f.onchange=function(){a._parseFilesInInput(this.files)};this.p.ondragenter=function(a){a.dataTransfer&&(a.stopPropagation(),a.preventDefault())};this.p.ondragover=function(a){a.dataTransfer&&
(a.stopPropagation(),a.preventDefault())};this.p.ondrop=function(b){b.dataTransfer&&(b.stopPropagation(),b.preventDefault(),a._enabled&&a._parseFilesInInput(b.dataTransfer.files))};this._titleText="Drag-n-Drop files here or<br> click to select files for upload."},_doUploadFile:function(a){var b=this;if(!this._loader)this._loader=new XMLHttpRequest,this._loader.upload.onprogress=function(a){b._files[this._idd].state=="uploading"&&b._updateFileInList(this._idd,"uploading",Math.round(a.loaded*100/a.total))},
this._loader.onload=function(){try{eval("var r="+this.responseText)}catch(a){}typeof r=="object"&&typeof r.state!="undefined"&&r.state==!0?(b._onUploadSuccess(this._idd,r.name),r=null):b._onUploadFail(this._idd)},this._loader.onerror=function(){b._onUploadFail(this._idd)},this._loader.onabort=function(){b._onUploadAbort(this._idd)};this._loader._idd=a;this._loader.upload._idd=a;var c=new FormData;c.append("file",this._files[a].file);this._loader.open("POST",this._url+(String(this._url).indexOf("?")<
0?"?":"&")+"mode=html5&"+(new Date).getTime(),!0);this._loader.setRequestHeader("X-Requested-With","XMLHttpRequest");this._loader.send(c)},_uploadStop:function(){this._uploading&&this._loader&&this._loader.abort()},_parseFilesInInput:function(a){for(var b=0;b<a.length;b++)this._addFileToQueue(a[b])},_addFileToQueue:function(a){var b=a._idd||this._uid();this._files[b]={file:a,name:a.name,size:a.size,state:"added"};this._addFileToList(b,a.name,a.size,"added",0);this._autoStart&&!this._uploading&&this._uploadStart(!0)},
_removeFileFromQueue:function(a){if(this._files[a]){var b=this._files[a].name,c=this._data!=null&&this._data[a]!=null?this._data[a].serverName:null,d=!1;this._uploading&&a==this._loader._idd&&this._files[a].state=="uploading"&&(this._uploadStop(),d=!0);this._files[a].file=null;this._files[a].name=null;this._files[a].size=null;this._files[a].state=null;this._files[a]=null;delete this._files[a];this._removeFileFromList(a);this.callEvent("onFileRemove",[b,c]);d&&this._uploadStart()}},_unloadEngine:function(){this.buttons.browse.onclick=
null;this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null;this.p.ondragenter=null;this.p.ondragover=null;this.p.ondrop=null;if(this._loader)this._loader.upload.onprogress=null,this._loader.onload=null,this._loader.onerror=null,this._loader.onabort=null,this._loader._idd=null,this._loader=this._loader.upload._idd=null;this._unloadEngine=this._removeFileFromQueue=this._addFileToQueue=this._parseFilesInInput=this._uploadStop=this._doUploadFile=this._initEngine=null}};
dhtmlXFileUploader.prototype.html4=function(){};
dhtmlXFileUploader.prototype.html4.prototype={_initEngine:function(){this._addForm();this._progress_type="loader";this._titleText="Click button<br>to select files for upload."},_addForm:function(){var a=this,b=this._uid();if(!this.k)this.k=document.createElement("DIV"),this.k.className="dhx_file_form_cont",this.buttons.browse.appendChild(this.k),this.fr_name="dhx_file_"+(new Date).getTime(),this.k.innerHTML='<iframe name="'+this.fr_name+'" style="height:0px;width:0px;" frameBorder="0"></iframe>',this.fr=
this.k.firstChild,window.navigator.userAgent.indexOf("MSIE")>=0?this.fr.onreadystatechange=function(){this.readyState=="complete"&&a._onLoad()}:this.fr.onload=function(){a._onLoad()};var c=document.createElement("DIV");c.innerHTML="<form method='POST' enctype='multipart/form-data' target='"+this.fr_name+"' class='dhx_file_form' name='dhx_file_form_"+(new Date).getTime()+"'><input type='hidden' name='mode' value='html4'><input type='hidden' name='uid' value='"+b+"'><input type='file' name='file' class='dhx_file_input'></form>";
this.k.appendChild(c);c.firstChild.lastChild._idd=b;c.firstChild.lastChild.onchange=function(){a._addFileToQueue(this);this.onchange=null;this.parentNode.parentNode.style.display="none";a._addForm()};c=null},_onLoad:function(){if(this._uploading){try{eval("var r="+this.fr.contentWindow.document.body.innerHTML)}catch(a){}if(typeof r=="object"&&typeof r.state!="undefined"){if(r.state=="cancelled")this._onUploadAbort(this.fr._idd);else if(r.state==!0){if(typeof r.size!="undefined"&&!isNaN(r.size))this._files[this.fr._idd].size=
r.size;this._onUploadSuccess(this.fr._idd,r.name)}r=null}else this._onUploadFail(this.fr._idd)}},_addFileToQueue:function(a){var b=a.value.match(/[^\\\/]*$/g),b=b[0]!=null?b[0]:a.value;this._files[a._idd]={name:b,form:a.parentNode,node:a.parentNode.parentNode,input:a,state:"added"};this._addFileToList(a._idd,a.value,!1,"added",0)},_removeFileFromQueue:function(a){var b=this._files[a].name,c=this._data!=null&&this._data[a]!=null?this._data[a].serverName:null;this._files[a].input.onchange=null;this._files[a].form.removeChild(this._files[a].input);
this._files[a].node.removeChild(this._files[a].form);this._files[a].node.parentNode.removeChild(this._files[a].node);this._files[a].input=null;this._files[a].name=null;this._files[a].form=null;this._files[a].node=null;this._files[a].size=null;this._files[a].state=null;this._files[a]=null;delete this._files[a];this._removeFileFromList(a);this.callEvent("onFileRemove",[b,c])},_doUploadFile:function(a){this.fr._idd=a;this._files[a].form.action=this._url;this._files[a].form.submit()},_uploadStop:function(){if(this._uploading)this.fr.contentWindow.location.href=
this._url+(this._url.indexOf("?")<0?"?":"&")+"mode=html4&action=cancel&etc="+(new Date).getTime()},_unloadEngine:function(){if(this.k)this.fr_name=null,this.fr.onreadystatechange=null,this.fr.onload=null,this.fr.parentNode.removeChild(this.fr),this.fr=null,this.k.firstChild.firstChild.lastChild.onchange=null,this.k.parentNode.removeChild(this.k),this.k=null;this._unloadEngine=this._uploadStop=this._doUploadFile=this._removeFileFromQueue=this._addFileToQueue=this._onLoad=this._addForm=this._initEngine=
null}};dhtmlXFileUploader.prototype.flash=function(){};
dhtmlXFileUploader.prototype.flash.prototype={_initEngine:function(){if(!window.dhtmlXFileUploaderSWFObjects)window.dhtmlXFileUploaderSWFObjects={items:{},uid:function(){this.id?this.id++:this.id=(new Date).getTime();return this.id},callEvent:function(a,b,e){window.dhtmlXFileUploaderSWFObjects.items[a].uploader[b].apply(window.dhtmlXFileUploaderSWFObjects.items[a].uploader,e)}};var a=this;this._swf_obj_id="dhtmlXFileUploaderSWFObject_"+window.dhtmlXFileUploaderSWFObjects.uid();this._swf_file_url=
this._swf_file_url+(this._swf_file_url.indexOf("?")>=0?"&":"?")+"etc="+(new Date).getTime();this.buttons.browse.innerHTML="<div id='"+this._swf_obj_id+"' style='width:100%;height:100%;'></div>";swfobject.embedSWF(this._swf_file_url,this._swf_obj_id,"100%","100%","9",null,{ID:this._swf_obj_id,enableLogs:this._swf_logs},{wmode:"transparent"});var b=swfobject.getFlashPlayerVersion();this._titleText="Engine successfuly inited<br>Flash Player: "+b.major+"."+b.minor+"."+b.release;this._progress_type="percentage";
window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]={id:this._swf_obj_id,uploader:this}},_addFileToQueue:function(a,b,c){this._files[a]={name:b,size:c,state:"added"};this._addFileToList(a,b,c,"added",0);this._autoStart&&!this._uploading&&this._uploadStart(!0)},_removeFileFromQueue:function(a){if(this._files[a]){var b=this._files[a].name,c=this._data!=null&&this._data[a]!=null?this._data[a].serverName:null,d=!1;this._uploading&&this._files[a].state=="uploading"&&(this._uploadStop(),d=!0);swfobject.getObjectById(this._swf_obj_id).removeFileById(a);
this._files[a].name=null;this._files[a].size=null;this._files[a].state=null;this._files[a]=null;delete this._files[a];this._removeFileFromList(a);this.callEvent("onFileRemove",[b,c]);d&&this._uploadStart()}},_doUploadFile:function(a){swfobject.getObjectById(this._swf_obj_id).upload(a,this._swf_upolad_url)},_uploadStop:function(){for(var a in this._files)this._files[a].state=="uploading"&&swfobject.getObjectById(this._swf_obj_id).uploadStop(a)},_unloadEngine:function(){if(window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id])window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].id=
null,window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].uploader=null,window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]=null,delete window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id];this._unloadEngine=this._uploadStop=this._doUploadFile=this._removeFileFromQueue=this._addFileToQueue=this._initEngine=this._swf_obj_id=null}};
dhtmlXForm.prototype.items.colorpicker={ev:!1,inp:null,colorpicker:{},cz:{},render:function(a,b){var c=this;a._type="colorpicker";a._enabled=!0;this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","TEXT",!0,!0,"dhxform_textarea");this.doAttachChangeLS(a);a._value=b.value||"";a.childNodes[a._ll?1:0].childNodes[0].value=a._value;this.cz[a._idd]=document.createElement("DIV");this.cz[a._idd].style.position="absolute";this.cz[a._idd].style.top="0px";this.cz[a._idd].style.zIndex=249;document.body.insertBefore(this.cz[a._idd],
document.body.firstChild);this.colorpicker[a._idd]=new dhtmlXColorPicker(this.cz[a._idd],null,null,!0);this.colorpicker[a._idd].setImagePath(b.imagePath||"");this.colorpicker[a._idd].init();this.colorpicker[a._idd].elements.cs_Content.onclick=function(a){(a||event).cancelBubble=!0};this.colorpicker[a._idd].setOnSelectHandler(function(b){if(a._value!=b&&!(a.checkEvent("onBeforeChange")&&a.callEvent("onBeforeChange",[a._idd,a._value,b])!==!0))a._value=b,c.setValue(a,b),a.callEvent("onChange",[a._idd,
a._value])});a.childNodes[a._ll?1:0].childNodes[0]._idd=a._idd;a.childNodes[a._ll?1:0].childNodes[0].onclick=function(){c.colorpicker[this._idd].isVisible()?(c.colorpicker[this._idd].hide(),c.inp=null):(c.colorpicker[this._idd].setPosition(getAbsoluteLeft(this),getAbsoluteTop(this)+this.offsetHeight-1),c.colorpicker[this._idd].setColor(a._value),c.colorpicker[this._idd].show(),c.inp=this._idd)};if(!this.ev)_isIE?document.body.attachEvent("onclick",this.clickEvent):window.addEventListener("click",
this.clickEvent,!1),this.ev=!0;return this},clickEvent:function(){dhtmlXForm.prototype.items.colorpicker.hideAllColorPickers()},hideAllColorPickers:function(){for(var a in this.colorpicker)a!=this.inp&&this.colorpicker[a].hide();this.inp=null},getColorPicker:function(a){return this.colorpicker[a._idd]},destruct:function(a){this.colorpicker[a._idd].elements.cs_Content.onclick=null;this.colorpicker[a._idd].unload();this.colorpicker[a._idd]=null;try{delete this.colorpicker[a._idd]}catch(b){}this.cz[a._idd].parentNode.removeChild(this.cz[a._idd]);
this.cz[a._idd]=null;try{delete this.cz[a._idd]}catch(c){}var d=0,e;for(e in this.colorpicker)d++;if(d==0)_isIE?document.body.detachEvent("onclick",this.clickEvent):window.removeEventListener("click",this.clickEvent,!1),this.ev=!1;a.childNodes[a._ll?1:0].childNodes[0]._idd=null;this.d2(a);a=null}};
(function(){for(var a in{doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setValue:1,getValue:1,setFocus:1,getInput:1})dhtmlXForm.prototype.items.colorpicker[a]=dhtmlXForm.prototype.items.input[a]})();dhtmlXForm.prototype.items.colorpicker.doAttachChangeLS=dhtmlXForm.prototype.items.select.doAttachChangeLS;dhtmlXForm.prototype.items.colorpicker.d2=dhtmlXForm.prototype.items.input.destruct;
dhtmlXForm.prototype.getColorPicker=function(a){return this.doWithItem(a,"getColorPicker")};
dhtmlXColorPicker.prototype.unload=function(){this.elements.cs_SelectorVer.parentNode.removeChild(this.elements.cs_SelectorVer);this.elements.cs_SelectorHor.parentNode.removeChild(this.elements.cs_SelectorHor);this.elements.cs_SelectorVer=null;this.elements.cs_SelectorHor=null;this.elements.cs_SelectorDiv.ondblclick=null;this.elements.cs_SelectorDiv.onmousedown=null;this.elements.cs_SelectorDiv.z=null;this.elements.cs_SelectorDiv.parentNode.removeChild(this.elements.cs_SelectorDiv);this.elements.cs_SelectorDiv=
null;this.elements.cs_LumSelectArrow.onmousedown=null;this.elements.cs_LumSelectArrow.z=null;this.elements.cs_LumSelectArrow.parentNode.removeChild(this.elements.cs_LumSelectArrow);this.elements.cs_LumSelectArrow=null;this.elements.cs_LumSelectLine.parentNode.removeChild(this.elements.cs_LumSelectLine);for(this.elements.cs_LumSelectLine=null;this.elements.cs_LumSelect.childNodes.length>0;)this.elements.cs_LumSelect.removeChild(this.elements.cs_LumSelect.childNodes[0]);this.elements.cs_LumSelect.ondblclick=
null;this.elements.cs_LumSelect.onmousedown=null;this.elements.cs_LumSelect.z=null;this.elements.cs_LumSelect.parentNode.removeChild(this.elements.cs_LumSelect);this.elements.cs_LumSelect=null;this.elements.cs_EndColor.parentNode.removeChild(this.elements.cs_EndColor);this.elements.cs_EndColor=null;this.elements.cs_InputHue.onchange=null;this.elements.cs_InputHue.z=null;this.elements.cs_InputHue.parentNode.removeChild(this.elements.cs_InputHue);this.elements.cs_InputHue=null;this.elements.cs_InputRed.onchange=
null;this.elements.cs_InputRed.z=null;this.elements.cs_InputRed.parentNode.removeChild(this.elements.cs_InputRed);this.elements.cs_InputRed=null;this.elements.cs_InputSat.onchange=null;this.elements.cs_InputSat.z=null;this.elements.cs_InputSat.parentNode.removeChild(this.elements.cs_InputSat);this.elements.cs_InputSat=null;this.elements.cs_InputGreen.onchange=null;this.elements.cs_InputGreen.z=null;this.elements.cs_InputGreen.parentNode.removeChild(this.elements.cs_InputGreen);this.elements.cs_InputGreen=
null;this.elements.cs_Hex.onchange=null;this.elements.cs_Hex.z=null;this.elements.cs_Hex.parentNode.removeChild(this.elements.cs_Hex);this.elements.cs_Hex=null;this.elements.cs_InputLum.onchange=null;this.elements.cs_InputLum.z=null;this.elements.cs_InputLum.parentNode.removeChild(this.elements.cs_InputLum);this.elements.cs_InputLum=null;this.elements.cs_InputBlue.onchange=null;this.elements.cs_InputBlue.z=null;this.elements.cs_InputBlue.parentNode.removeChild(this.elements.cs_InputBlue);this.elements.cs_InputBlue=
null;this.elements.cs_ButtonOk.onclick=null;this.elements.cs_ButtonOk.onmouseout=null;this.elements.cs_ButtonOk.onmouseover=null;this.elements.cs_ButtonOk.z=null;this.elements.cs_ButtonOk.parentNode.removeChild(this.elements.cs_ButtonOk);this.elements.cs_ButtonOk=null;this.elements.cs_ButtonCancel.onclick=null;this.elements.cs_ButtonCancel.onmouseout=null;this.elements.cs_ButtonCancel.onmouseover=null;this.elements.cs_ButtonCancel.z=null;this.elements.cs_ButtonCancel.parentNode.removeChild(this.elements.cs_ButtonCancel);
this.elements.cs_ButtonCancel=null;this.elements.cs_ContentTable.parentNode.removeChild(this.elements.cs_ContentTable);this.elements.cs_ContentTable=null;this.elements.cs_Content.parentNode.removeChild(this.elements.cs_Content);this.z=this.elements.cs_Content=null;this.detachAllEvents();this.customColors=this.linkToObjects=this.language=this.elements=this.container=this._changeValueHEX=this._changeValueRGB=this._changeValueHSV=this._selectCustomColor=this._getColorHEX=this._reinitCustomColors=this._initCustomColors=
this._hex2dec=this._dec2hex=this._colorizeLum=this._drawLum=this._rgb2hsv=this._hsv2rgb=this._drawValues=this._calculateColor=this._getOffsetLeft=this._getOffsetTop=this._getOffset=this._stopMoveLum=this._mouseMoveLum=this._startMoveLum=this._stopMoveColor=this._mouseMoveColor=this._startMoveColor=this._setLumPos=this._getScrollers=this._setCrossPos=this._initEvents=this._initCsIdElement=this.unload=this.showA=this.show=this.normalButton=this.hoverButton=this.isVisible=this.setSkin=this.loadUserLanguage=
this.init=this.setImagePath=this.hideOnSelect=this.linkTo=this.getSelectedColor=this.setOnCancelHandler=this.setOnSelectHandler=this.hide=this.setPosition=this.close=this.setColor=this.setCustomColors=this.redraw=this.restoreFromHEX=this.restoreFromHSV=this.restoreFromRGB=this.addCustomColor=this.restoreColor=this.saveColor=this.clickCancel=this.clickOk=this.resetHandlers=this.generate=this.detachAllEvents=this.detachEvent=this.eventCatcher=this.checkEvent=this.callEvent=this.attachEvent=null};
dhtmlXForm.prototype.items.combo={render:function(a,b){a._type="combo";a._enabled=!0;a._value=null;a._newValue=null;this.doAddLabel(a,b);this.doAddInput(a,b,"SELECT",null,!0,!0,"dhxform_select");this.doAttachEvents(a);this.doLoadOpts(a,b);a.onselectstart=function(a){a=a||event;return a.returnValue=!0};a.childNodes[a._ll?1:0].childNodes[0].setAttribute("opt_type",b.comboType||"");a._combo=new dhtmlXComboFromSelect(a.childNodes[a._ll?1:0].childNodes[0]);a._combo._currentComboValue=a._combo.getSelectedValue();
a._combo.DOMelem_input.id=b.uid;if(b.connector){var c=this;a._connector_working=!0;a._combo.loadXML(b.connector,function(){a.callEvent("onOptionsLoaded",[a._idd]);a._connector_working=!1;if(a._connector_value!=null)c.setValue(a,a._connector_value),a._connector_value=null})}b.filtering&&a._combo.enableFilteringMode(!0);b.readonly==!0&&this.setReadonly(a,!0);b.style&&(a._combo.DOMelem_input.style.cssText+=b.style);typeof window.addEventListener=="function"&&a.getForm().skin=="dhx_terrace"&&(a._combo.DOMelem_input.addEventListener("focus",
function(){var a=this.parentNode.parentNode;a._inFocus=!0;a.className.search(/combo_in_focus/)<0&&(a.className+=" combo_in_focus");a=null},!1),a._combo.DOMelem_input.addEventListener("blur",function(){var a=this.parentNode.parentNode;if(a.className.search(/combo_in_focus/)>=0)a.className=a.className.replace(/combo_in_focus/gi,"");a=null},!1));return this},destruct:function(a){a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a._combo._currentComboValue=null;a._combo.destructor();a._combo=null;a._apiChange=
null;this.d2(a);a=null},doAttachEvents:function(a){var b=this;a.childNodes[a._ll?1:0].childNodes[0].onchange=function(){b.doOnChange(this);b.doValidate(this.DOMParent.parentNode.parentNode)}},doValidate:function(a){a.getForm().hot_validate&&this._validate(a)},doOnChange:function(a){var b=a.DOMParent.parentNode.parentNode;if(!b._apiChange){a._newComboValue=a.getSelectedValue();if(a._newComboValue!=a._currentComboValue){if(b.checkEvent("onBeforeChange")&&b.callEvent("onBeforeChange",[b._idd,a._currentComboValue,
a._newComboValue])!==!0)return window.setTimeout(function(){a.setComboValue(a._currentComboValue)},1),!1;a._currentComboValue=a._newComboValue;b.callEvent("onChange",[b._idd,a._currentComboValue])}b._autoCheck(b._enabled)}},enable:function(a){if(String(a.className).search("disabled")>=0)a.className=String(a.className).replace(/disabled/gi,"");a._enabled=!0;a._combo.disable(!1);a._combo.DOMelem_button.src=(window.dhx_globalImgPath?dhx_globalImgPath:"")+"combo_select"+(dhtmlx.skin?"_"+dhtmlx.skin:"")+
".gif"},disable:function(a){String(a.className).search("disabled")<0&&(a.className+=" disabled");a._enabled=!1;a._combo.disable(!0);a._combo.DOMelem_button.src=(window.dhx_globalImgPath?dhx_globalImgPath:"")+"combo_select_dis"+(dhtmlx.skin?"_"+dhtmlx.skin:"")+".gif"},getCombo:function(a){return a._combo},setValue:function(a,b){a._connector_working?a._connector_value=b:(a._apiChange=!0,a._combo.setComboValue(b),a._combo._currentComboValue=a._combo.getActualValue(),a._apiChange=!1)},getValue:function(a){return a._combo.getActualValue()},
setWidth:function(a,b){a.childNodes[a._ll?1:0].childNodes[0].style.width=b+"px"},setReadonly:function(a,b){if(a._combo)a._combo_ro=b,a._combo.readonly(a._combo_ro)},isReadonly:function(a){return a._combo_ro||!1},_setCss:function(a,b,c){a._combo.DOMlist.style.fontSize=c}};(function(){for(var a in{doAddLabel:1,doAddInput:1,doLoadOpts:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,_checkNoteWidth:1})dhtmlXForm.prototype.items.combo[a]=dhtmlXForm.prototype.items.select[a]})();
dhtmlXForm.prototype.items.combo.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.getCombo=function(a){return this.doWithItem(a,"getCombo")};
dhtmlXForm.prototype.items.editor={editor:{},render:function(a,b){var c=!isNaN(b.rows);a._type="editor";a._enabled=!0;this.doAddLabel(a,b);this.doAddInput(a,b,"DIV",null,!0,!0,"dhxform_item_template");a._value=b.value||"";a.childNodes[a._ll?1:0].childNodes[0].className+=" dhxeditor_inside";var d=this;this.editor[a._idd]=new dhtmlXEditor(a.childNodes[a._ll?1:0].childNodes[0]);this.editor[a._idd].setContent(a._value);this.editor[a._idd].attachEvent("onAccess",function(b,c){_dhxForm_doClick(document.body,
"click");b=="blur"&&d.doOnBlur(a,this);a.callEvent("onEditorAccess",[a._idd,b,c,this,a.getForm()])});this.editor[a._idd].attachEvent("onToolbarClick",function(b){a.callEvent("onEditorToolbarClick",[a._idd,b,this,a.getForm()])});b.readonly&&this.setReadonly(a,!0);a.childNodes[a._ll?0:1].childNodes[0].removeAttribute("for");a.childNodes[a._ll?0:1].childNodes[0].onclick=function(){d.editor[a._idd]._focus()};return this},doOnBlur:function(a,b){var c=b.getContent();if(a._value!=c)a.checkEvent("onBeforeChange")&&
a.callEvent("onBeforeChange",[a._idd,a._value,c])!==!0?b.setContent(a._value):(a._value=c,a.callEvent("onChange",[a._idd,c]))},setValue:function(a,b){if(a._value!=b)a._value=b,this.editor[a._idd].setContent(a._value)},getValue:function(a){a._value=this.editor[a._idd].getContent();return a._value},enable:function(a){this.editor[a._idd].setReadonly(!1);this.doEn(a)},disable:function(a){this.editor[a._idd].setReadonly(!0);this.doDis(a)},setReadonly:function(a,b){this.editor[a._idd].setReadonly(b)},getEditor:function(a){return this.editor[a._idd]||
null},destruct:function(a){a.childNodes[a._ll?0:1].childNodes[0].onclick=null;this.editor[a._idd].unload();this.editor[a._idd]=null;this.d2(a);a=null},setFocus:function(a){this.editor[a._idd]._focus()}};(function(){for(var a in{doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,setWidth:1,isEnabled:1})dhtmlXForm.prototype.items.editor[a]=dhtmlXForm.prototype.items.template[a]})();dhtmlXForm.prototype.items.editor.d2=dhtmlXForm.prototype.items.select.destruct;
dhtmlXForm.prototype.items.editor.doEn=dhtmlXForm.prototype.items.select.enable;dhtmlXForm.prototype.items.editor.doDis=dhtmlXForm.prototype.items.select.disable;dhtmlXForm.prototype.getEditor=function(a){return this.doWithItem(a,"getEditor")};window.dhtmlx||(dhtmlx={});dhtmlx.version="3.0";dhtmlx.codebase="./";dhtmlx.copy=function(a){var b=dhtmlx.copy._function;b.prototype=a;return new b};dhtmlx.copy._function=function(){};dhtmlx.extend=function(a,b){for(var c in b)a[c]=b[c];b._init&&a._init();return a};
dhtmlx.proto_extend=function(){for(var a=arguments,b=a[0],c=[],d=a.length-1;d>0;d--){if(typeof a[d]=="function")a[d]=a[d].prototype;for(var e in a[d])e=="_init"?c.push(a[d][e]):b[e]||(b[e]=a[d][e])}a[0]._init&&c.push(a[0]._init);b._init=function(){for(var a=0;a<c.length;a++)c[a].apply(this,arguments)};b.base=a[1];var f=function(a){this._init(a);this._parseSettings&&this._parseSettings(a,this.defaults)};f.prototype=b;b=a=null;return f};dhtmlx.bind=function(a,b){return function(){return a.apply(b,arguments)}};
dhtmlx.require=function(a){dhtmlx._modules[a]||(dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase+a).responseText),dhtmlx._modules[a]=!0)};dhtmlx._modules={};dhtmlx.exec=function(a){window.execScript?window.execScript(a):window.eval(a)};dhtmlx.methodPush=function(a,b){return function(){var c=!1;return c=a[b].apply(a,arguments)}};dhtmlx.isNotDefined=function(a){return typeof a=="undefined"};dhtmlx.delay=function(a,b,c,d){setTimeout(function(){var d=a.apply(b,c);a=b=c=null;return d},d||1)};
dhtmlx.uid=function(){if(!this._seed)this._seed=(new Date).valueOf();this._seed++;return this._seed};dhtmlx.toNode=function(a){return typeof a=="string"?document.getElementById(a):a};dhtmlx.toArray=function(a){return dhtmlx.extend(a||[],dhtmlx.PowerArray)};dhtmlx.toFunctor=function(a){return typeof a=="string"?eval(a):a};dhtmlx._events={};
dhtmlx.event=function(a,b,c,d){var a=dhtmlx.toNode(a),e=dhtmlx.uid();dhtmlx._events[e]=[a,b,c];d&&(c=dhtmlx.bind(c,d));a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c);return e};dhtmlx.eventRemove=function(a){if(a){var b=dhtmlx._events[a];b[0].removeEventListener?b[0].removeEventListener(b[1],b[2],!1):b[0].detachEvent&&b[0].detachEvent("on"+b[1],b[2]);delete this._events[a]}};
dhtmlx.EventSystem={_init:function(){this._events={};this._handlers={};this._map={}},block:function(){this._events._block=!0},unblock:function(){this._events._block=!1},mapEvent:function(a){dhtmlx.extend(this._map,a)},callEvent:function(a,b){if(this._events._block)return!0;var a=a.toLowerCase(),c=this._events[a.toLowerCase()],d=!0;if(c)for(var e=0;e<c.length;e++)if(c[e].apply(this,b||[])===!1)d=!1;this._map[a]&&!this._map[a].callEvent(a,b)&&(d=!1);return d},attachEvent:function(a,b,c){var a=a.toLowerCase(),
c=c||dhtmlx.uid(),b=dhtmlx.toFunctor(b),d=this._events[a]||dhtmlx.toArray();d.push(b);this._events[a]=d;this._handlers[c]={f:b,t:a};return c},detachEvent:function(a){if(this._handlers[a]){var b=this._handlers[a].t,c=this._handlers[a].f,d=this._events[b];d.remove(c);delete this._handlers[a]}}};
dhtmlx.PowerArray={removeAt:function(a,b){a>=0&&this.splice(a,b||1)},remove:function(a){this.removeAt(this.find(a))},insertAt:function(a,b){if(!b&&b!==0)this.push(a);else{var c=this.splice(b,this.length-b);this[b]=a;this.push.apply(this,c)}},find:function(a){for(i=0;i<this.length;i++)if(a==this[i])return i;return-1},each:function(a,b){for(var c=0;c<this.length;c++)a.call(b||this,this[c])},map:function(a,b){for(var c=0;c<this.length;c++)this[c]=a.call(b||this,this[c]);return this}};dhtmlx.env={};
if(navigator.userAgent.indexOf("Opera")!=-1)dhtmlx._isOpera=!0;else{dhtmlx._isIE=!!document.all;dhtmlx._isFF=!document.all;dhtmlx._isWebKit=navigator.userAgent.indexOf("KHTML")!=-1;if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat")dhtmlx._isIE=8;if(navigator.appVersion.indexOf("MSIE 9.0")!=-1&&document.compatMode!="BackCompat")dhtmlx._isIE=9}dhtmlx.env={};
(function(){dhtmlx.env.transform=!1;dhtmlx.env.transition=!1;for(var a={names:["transform","transition"],transform:["transform","WebkitTransform","MozTransform","oTransform","msTransform"],transition:["transition","WebkitTransition","MozTransition","oTransition"]},b=document.createElement("DIV"),c,d=0;d<a.names.length;d++)for(;p=a[a.names[d]].pop();)typeof b.style[p]!="undefined"&&(dhtmlx.env[a.names[d]]=!0)})();
dhtmlx.env.transform_prefix=function(){var a;dhtmlx._isOpera?a="-o-":(a="",dhtmlx._isFF&&(a="-moz-"),dhtmlx._isWebKit&&(a="-webkit-"));return a}();dhtmlx.env.svg=function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}();dhtmlx.zIndex={drag:1E4};
dhtmlx.html={create:function(a,b,c){var b=b||{},d=document.createElement(a),e;for(e in b)d.setAttribute(e,b[e]);if(b.style)d.style.cssText=b.style;if(b["class"])d.className=b["class"];if(c)d.innerHTML=c;return d},getValue:function(a){a=dhtmlx.toNode(a);return!a?"":dhtmlx.isNotDefined(a.value)?a.innerHTML:a.value},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else a&&a.parentNode&&a.parentNode.removeChild(a)},insertBefore:function(a,b,c){a&&(b?b.parentNode.insertBefore(a,
b):c.appendChild(a))},locate:function(a,b){for(var a=a||event,c=a.target||a.srcElement;c;){if(c.getAttribute){var d=c.getAttribute(b);if(d)return d}c=c.parentNode}return null},offset:function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{y:Math.round(i),
x:Math.round(j)}}else{for(j=i=0;a;)i+=parseInt(a.offsetTop,10),j+=parseInt(a.offsetLeft,10),a=a.offsetParent;return{y:i,x:j}}},pos:function(a){a=a||event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};var b=dhtmlx._isIE&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:a.clientX+b.scrollLeft-b.clientLeft,y:a.clientY+b.scrollTop-b.clientTop}},preventEvent:function(a){a&&a.preventDefault&&a.preventDefault();dhtmlx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=
!0;return!1},addCss:function(a,b){a.className+=" "+b},removeCss:function(a,b){a.className=a.className.replace(RegExp(b,"g"),"")}};(function(){var a=document.getElementsByTagName("SCRIPT");if(a.length)a=(a[a.length-1].getAttribute("src")||"").split("/"),a.splice(a.length-1,1),dhtmlx.codebase=a.slice(0,a.length).join("/")+"/"})();if(!dhtmlx.ui)dhtmlx.ui={};
dhtmlx.Destruction={_init:function(){dhtmlx.destructors.push(this)},destructor:function(){this.destructor=function(){};this._htmlrows=this._htmlmap=null;this._html&&document.body.appendChild(this._html);this._html=null;if(this._obj)this._obj.innerHTML="",this._obj._htmlmap=null;this.data=this._obj=this._dataobj=null;this._events=this._handlers={}}};dhtmlx.destructors=[];
dhtmlx.event(window,"unload",function(){for(var a=0;a<dhtmlx.destructors.length;a++)dhtmlx.destructors[a].destructor();dhtmlx.destructors=[];for(var b in dhtmlx._events){var c=dhtmlx._events[b];c[0].removeEventListener?c[0].removeEventListener(c[1],c[2],!1):c[0].detachEvent&&c[0].detachEvent("on"+c[1],c[2]);delete dhtmlx._events[b]}});dhtmlx.math={};dhtmlx.math._toHex="0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F".split(",");
dhtmlx.math.toHex=function(a,b){a=parseInt(a,10);for(str="";a>0;)str=this._toHex[a%16]+str,a=Math.floor(a/16);for(;str.length<b;)str="0"+str;return str};dhtmlx.math.hexToDec=function(a){return parseInt(a,16)};
dhtmlx.math.toRgb=function(a){var b,c,d,e;typeof a!="string"?(b=a[0],c=a[1],d=a[2]):a.indexOf("rgb")!=-1?(e=a.substr(a.indexOf("(")+1,a.lastIndexOf(")")-a.indexOf("(")-1).split(","),b=e[0],c=e[1],d=e[2]):(a.substr(0,1)=="#"&&(a=a.substr(1)),b=this.hexToDec(a.substr(0,2)),c=this.hexToDec(a.substr(2,2)),d=this.hexToDec(a.substr(4,2)));b=parseInt(b,10)||0;c=parseInt(c,10)||0;d=parseInt(d,10)||0;if(b<0||b>255)b=0;if(c<0||c>255)c=0;if(d<0||d>255)d=0;return[b,c,d]};
dhtmlx.math.hsvToRgb=function(a,b,c){var d,e,f,g,h,i,j,k;d=Math.floor(a/60)%6;e=a/60-d;f=c*(1-b);g=c*(1-e*b);h=c*(1-(1-e)*b);k=j=i=0;switch(d){case 0:i=c;j=h;k=f;break;case 1:i=g;j=c;k=f;break;case 2:i=f;j=c;k=h;break;case 3:i=f;j=g;k=c;break;case 4:i=h;j=f;k=c;break;case 5:i=c,j=f,k=g}i=Math.floor(i*255);j=Math.floor(j*255);k=Math.floor(k*255);return[i,j,k]};
dhtmlx.math.rgbToHsv=function(a,b,c){var d,e,f,g,h,i,j,k;d=a/255;e=b/255;f=c/255;g=Math.min(d,e,f);h=Math.max(d,e,f);j=0;i=h==0?0:1-g/h;k=h;h==g?j=0:h==d&&e>=f?j=60*(e-f)/(h-g)+0:h==d&&e<f?j=60*(e-f)/(h-g)+360:h==e?j=60*(f-d)/(h-g)+120:h==f&&(j=60*(d-e)/(h-g)+240);return[j,i,k]};if(!dhtmlx.presets)dhtmlx.presets={};
dhtmlx.presets.chart={simple:{item:{borderColor:"#ffffff",color:"#2b7100",shadow:!1,borderWidth:2},line:{color:"#8ecf03",width:2}},plot:{color:"#1293f8",item:{borderColor:"#636363",borderWidth:1,color:"#ffffff",type:"r",shadow:!1},line:{color:"#1293f8",width:2}},diamond:{color:"#b64040",item:{borderColor:"#b64040",color:"#b64040",type:"d",radius:3,shadow:!0},line:{color:"#ff9000",width:2}},point:{color:"#fe5916",disableLines:!0,fill:!1,disableItems:!1,item:{color:"#feb916",borderColor:"#fe5916",radius:2,
borderWidth:1,type:"r"},alpha:1},line:{line:{color:"#3399ff",width:2},item:{color:"#ffffff",borderColor:"#3399ff",radius:2,borderWidth:2,type:"d"},fill:!1,disableItems:!1,disableLines:!1,alpha:1},area:{fill:"#3399ff",line:{color:"#3399ff",width:1},disableItems:!0,alpha:0.2,disableLines:!1},round:{item:{radius:3,borderColor:"#3f83ff",borderWidth:1,color:"#3f83ff",type:"r",shadow:!1,alpha:0.6}},square:{item:{radius:3,borderColor:"#447900",borderWidth:2,color:"#69ba00",type:"s",shadow:!1,alpha:1}},column:{color:"RAINBOW",
gradient:!1,width:45,radius:0,alpha:1,border:!0},stick:{width:5,gradient:!1,color:"#67b5c9",radius:2,alpha:1,border:!1},alpha:{color:"#b9a8f9",width:70,gradient:"falling",radius:0,alpha:0.5,border:!0}};dhtmlx.ui.Map=function(a){this.name="Map";this._id="map_"+dhtmlx.uid();this._key=a;this._map=[]};
dhtmlx.ui.Map.prototype={addRect:function(a,b,c){this._createMapArea(a,"RECT",b,c)},addPoly:function(a,b){this._createMapArea(a,"POLY",b)},_createMapArea:function(a,b,c,d){var e="";arguments.length==4&&(e="userdata='"+d+"'");this._map.push("<area "+this._key+"='"+a+"' shape='"+b+"' coords='"+c.join()+"' "+e+"></area>")},addSector:function(a,b,c,d,e,f,g){var h=[];h.push(d);h.push(Math.floor(e*g));for(var i=b;i<c;i+=Math.PI/18)h.push(Math.floor(d+f*Math.cos(i))),h.push(Math.floor((e+f*Math.sin(i))*
g));h.push(Math.floor(d+f*Math.cos(c)));h.push(Math.floor((e+f*Math.sin(c))*g));h.push(d);h.push(Math.floor(e*g));return this.addPoly(a,h)},render:function(a){var b=dhtmlx.html.create("DIV");b.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;";a.appendChild(b);var c=dhtmlx._isIE?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";b.innerHTML="<map id='"+this._id+"' name='"+this._id+"'>"+this._map.join("\n")+"</map><img "+
c+" class='dhx_map_img' usemap='#"+this._id+"'>";a._htmlmap=b;this._map=[]}};dhtmlx.chart={};
dhtmlx.chart.scatter={pvt_render_scatter:function(a,b,c,d,e,f){if(!this._settings.xValue)return null;var g=this._getLimits(),h=this._getLimits("h","xValue");e||(this._drawYAxis(a,b,c,d,g.min,g.max),this._drawHXAxis(a,b,c,d,h.min,h.max));for(var g={min:this._settings.yAxis.start,max:this._settings.yAxis.end},h={min:this._settings.xAxis.start,max:this._settings.xAxis.end},i=this._getScatterParams(a,b,c,d,h,g),j=0;j<b.length;j++)this._drawScatterItem(a,f,c,d,i,h,g,b[j],e)},_getScatterParams:function(a,
b,c,d,e,f){var g={};g.totalHeight=d.y-c.y;g.totalWidth=d.x-c.x;this._calcScatterUnit(g,e.min,e.max,g.totalWidth,"X");this._calcScatterUnit(g,f.min,f.max,g.totalHeight,"Y");return g},_drawScatterItem:function(a,b,c,d,e,f,g,h,i){var j=this._calculateScatterItemPosition(e,d,c,f,h,"X"),k=this._calculateScatterItemPosition(e,c,d,g,h,"Y");this._drawItemOfLineChart(a,j,k,h,1);var m=this._settings,l=m.eventRadius||Math.floor(m.item.radius+1);b.addRect(h.id,[j-l,k-l,j+l,k+l],i)},_calculateScatterItemPosition:function(a,
b,c,d,e,f){var g=this._settings[f=="X"?"xValue":"value"].call(this,e),h=a["valueFactor"+f],i=(parseFloat(g||0)-d.min)*h,j=a["unit"+f],k=c[f.toLowerCase()]-(f=="X"?-1:1)*Math.floor(j*i);i<0&&(k=c[f.toLowerCase()]);g>d.max&&(k=b[f.toLowerCase()]);g<d.min&&(k=c[f.toLowerCase()]);return k},_calcScatterUnit:function(a,b,c,d,e){var f=this._getRelativeValue(b,c),e=e||"";a["relValue"+e]=f[0];a["valueFactor"+e]=f[1];a["unit"+e]=a["relValue"+e]?d/a["relValue"+e]:10}};
dhtmlx.chart.radar={pvt_render_radar:function(a,b,c,d,e,f){this._renderRadarChart(a,b,c,d,e,f)},_renderRadarChart:function(a,b,c,d,e,f){if(b.length){for(var g=this._getPieParameters(c,d),h=this._settings.radius?this._settings.radius:g.radius,i=this._settings.x?this._settings.x:g.x,j=this._settings.y?this._settings.y:g.y,k=[],m=0;m<b.length;m++)k.push(1);var l=this._getRatios(k,b.length);e||this._drawRadarAxises(a,l,i,j,h,b);this._drawRadarData(a,l,i,j,h,b,e,f)}},_drawRadarData:function(a,b,c,d,e,
f,g,h){var i,j,k,m,l,n,o,p,r,q,s,w,t,v,u,x,A,y,B,z;m=this._settings;n=m.yAxis.start;o=m.yAxis.end;z=this._getRelativeValue(n,o);B=(t=z[0])?e/t:e/2;y=z[1];i=j=v=-Math.PI/2;q=[];for(l=0;l<f.length;l++)A?x=A:(u=m.value(f[l]),x=A||(parseFloat(u||0)-n)*y),s=Math.floor(B*x),u=m.value(l!=f.length-1?f[l+1]:f[0]),A=(parseFloat(u||0)-n)*y,w=Math.floor(B*A),i=j,j=l!=f.length-1?v+b[l]-1.0E-4:v,p=r||this._getPositionByAngle(i,c,d,s),r=this._getPositionByAngle(j,c,d,w),k=m.eventRadius||parseInt(m.item.radius.call(this,
f[l]),10)+m.item.borderWidth,h.addRect(f[l].id,[p.x-k,p.y-k,p.x+k,p.y+k],g),q.push(p);m.fill&&this._fillRadarChart(a,q,f);m.disableLines||this._strokeRadarChart(a,q,f);m.disableItems||this._drawRadarItemMarkers(a,q,f);q=null},_drawRadarItemMarkers:function(a,b,c){for(var d=0;d<b.length;d++)this._drawItemOfLineChart(a,b[d].x,b[d].y,c[d])},_fillRadarChart:function(a,b,c){var d,e;a.globalAlpha=this._settings.alpha.call(this,{});a.beginPath();for(var f=0;f<b.length;f++)a.fillStyle=this._settings.fill.call(this,
c[f]),d=b[f],e=b[f+1]||b[0],f||a.moveTo(d.x,d.y),a.lineTo(e.x,e.y);a.fill();a.globalAlpha=1},_strokeRadarChart:function(a,b,c){for(var d,e,f=0;f<b.length;f++)d=b[f],e=b[f+1]||b[0],this._drawLine(a,d.x,d.y,e.x,e.y,this._settings.line.color.call(this,c[f]),this._settings.line.width)},_drawRadarAxises:function(a,b,c,d,e,f){var g=this._settings.yAxis,h=this._settings.xAxis,i=g.start,j=g.end,k=g.step,m={},l=this._settings.configYAxis;if(typeof l.step=="undefined"||typeof l.start=="undefined"||typeof l.end==
"undefined"){var n=this._getLimits(),m=this._calculateScale(n.min,n.max),i=m.start,j=m.end,k=m.step;g.end=j;g.start=i}var o=[],p,r,q,s=0,w=e*k/(j-i),t,v;k<1&&(t=Math.min(this._log10(k),i<=0?0:this._log10(i)),v=Math.pow(10,-t));var u=[];for(p=j;p>=i;p-=k){m.fixNum&&(p=parseFloat((new Number(p)).toFixed(m.fixNum)));o.push(Math.floor(s*w)+0.5);v&&(p=Math.round(p*v)/v);var x=d-e+o[o.length-1];this.renderTextAt("middle","left",c,x,g.template(p.toString()),"dhx_axis_item_y dhx_radar");if(b.length<2){this._drawScaleSector(a,
"arc",c,d,e-o[o.length-1],-Math.PI/2,3*Math.PI/2,p);return}var A=-Math.PI/2,y=A,B;for(r=0;r<b.length;r++)p==j&&u.push(y),B=A+b[r]-1.0E-4,this._drawScaleSector(a,l.lineShape||"line",c,d,e-o[o.length-1],y,B,p,r,f[p]),y=B;s++}for(p=0;p<u.length;p++)q=this._getPositionByAngle(u[p],c,d,e),this._drawLine(a,c,d,q.x,q.y,h?h.lineColor.call(this,f[p]):"#cfcfcf",h&&h.lineWidth?h.lineWidth.call(this,f[p]):1),this._drawRadarScaleLabel(a,c,d,e,u[p],h?h.template.call(this,f[p]):"&nbsp;")},_drawScaleSector:function(a,
b,c,d,e,f,g,h,i){var j,k;if(e<0)return!1;j=this._getPositionByAngle(f,c,d,e);k=this._getPositionByAngle(g,c,d,e);var m=this._settings.yAxis;if(m.bg)a.beginPath(),a.moveTo(c,d),b=="arc"?a.arc(c,d,e,f,g,!1):(a.lineTo(j.x,j.y),a.lineTo(k.x,k.y)),a.fillStyle=m.bg(h,i),a.moveTo(c,d),a.fill(),a.closePath();if(m.lines(h,i))a.lineWidth=1,a.beginPath(),b=="arc"?a.arc(c,d,e,f,g,!1):(a.moveTo(j.x,j.y),a.lineTo(k.x,k.y)),a.strokeStyle=m.lineColor(h,i),a.stroke()},_drawRadarScaleLabel:function(a,b,c,d,e,f){var g=
this.renderText(0,0,f,"dhx_axis_radar_title",1),h=g.scrollWidth,i=g.offsetHeight,j=0.001,k=this._getPositionByAngle(e,b,c,d+5),m=0,l=0;if(e<0||e>Math.PI)l=-i;e>Math.PI/2&&(m=-h);if(Math.abs(e+Math.PI/2)<j||Math.abs(e-Math.PI/2)<j)m=-h/2;else if(Math.abs(e)<j||Math.abs(e-Math.PI)<j)l=-i/2;g.style.top=k.y+l+"px";g.style.left=k.x+m+"px";g.style.width=h+"px";g.style.whiteSpace="nowrap"}};
dhtmlx.chart.area={pvt_render_area:function(a,b,c,d,e,f){var g=this._calculateParametersOfLineChart(a,b,c,d,e),h=this._settings.eventRadius||Math.floor(g.cellWidth/2);if(b.length){a.globalAlpha=this._settings.alpha.call(this,b[0]);a.fillStyle=this._settings.color.call(this,b[0]);var i=this._getYPointOfLineChart(b[0],c,d,g),j=this._settings.offset?c.x+g.cellWidth*0.5:c.x;a.beginPath();a.moveTo(j,d.y);a.lineTo(j,i);f.addRect(b[0].id,[j-h,i-h,j+h,i+h],e);this._settings.yAxis||this.renderTextAt(!1,!this._settings.offset?
!1:!0,j,i-this._settings.labelOffset,this._settings.label(b[0]));for(var k=1;k<b.length;k++){var m=j+Math.floor(g.cellWidth*k)-0.5,l=this._getYPointOfLineChart(b[k],c,d,g);a.lineTo(m,l);f.addRect(b[k].id,[m-h,l-h,m+h,l+h],e);this._settings.yAxis||this.renderTextAt(!1,!this._settings.offset&&k==b.length-1?"left":"center",m,l-this._settings.labelOffset,this._settings.label(b[k]))}a.lineTo(j+Math.floor(g.cellWidth*[b.length-1]),d.y);a.lineTo(j,d.y);a.fill()}}};
dhtmlx.chart.stackedArea={pvt_render_stackedArea:function(a,b,c,d,e,f){var g=this._calculateParametersOfLineChart(a,b,c,d,e),h=this._settings.eventRadius||Math.floor(g.cellWidth/2),i=[];if(b.length){a.globalAlpha=this._settings.alpha.call(this,b[0]);a.fillStyle=this._settings.color.call(this,b[0]);var j=e?b[0].$startY:d.y,k=this._settings.offset?c.x+g.cellWidth*0.5:c.x,m=this._getYPointOfLineChart(b[0],c,d,g)-(e?d.y-j:0);i[0]=m;a.beginPath();a.moveTo(k,j);a.lineTo(k,m);f.addRect(b[0].id,[k-h,m-h,
k+h,m+h],e);this._settings.yAxis||this.renderTextAt(!1,!0,k,m-this._settings.labelOffset,this._settings.label(b[0]));for(var l=1;l<b.length;l++){var n=k+Math.floor(g.cellWidth*l)-0.5,o=this._getYPointOfLineChart(b[l],c,d,g)-(e?d.y-b[l].$startY:0);i[l]=o;a.lineTo(n,o);f.addRect(b[l].id,[n-h,o-h,n+h,o+h],e);this._settings.yAxis||this.renderTextAt(!1,!0,n,o-this._settings.labelOffset,this._settings.label(b[l]))}a.lineTo(k+Math.floor(g.cellWidth*[b.length-1]),j);if(e)for(l=b.length-1;l>=0;l--){var n=
k+Math.floor(g.cellWidth*l)-0.5,p=b[l].$startY;a.lineTo(n,p)}else a.lineTo(k+Math.floor(g.cellWidth*(length-1))-0.5,j);a.lineTo(k,j);a.fill();for(l=0;l<b.length;l++)b[l].$startY=i[l]}}};
dhtmlx.chart.spline={pvt_render_spline:function(a,b,c,d,e,f){var g,h,i,j,k,m,l,n,o,p,r,q,s,w,t;m=this._calculateParametersOfLineChart(a,b,c,d,e);h=this._settings;j=[];if(b.length){p=h.offset?c.x+m.cellWidth*0.5:c.x;for(i=0;i<b.length;i++)o=!i?p:Math.floor(m.cellWidth*i)-0.5+p,s=this._getYPointOfLineChart(b[i],c,d,m),j.push({x:o,y:s});n=this._getSplineParameters(j);for(i=0;i<j.length;i++){r=j[i].x;w=j[i].y;if(i<j.length-1){q=j[i+1].x;t=j[i+1].y;for(k=r;k<q;k++)this._drawLine(a,k,this._getSplineYPoint(k,
r,i,n.a,n.b,n.c,n.d),k+1,this._getSplineYPoint(k+1,r,i,n.a,n.b,n.c,n.d),h.line.color(b[i]),h.line.width);this._drawLine(a,q-1,this._getSplineYPoint(k,r,i,n.a,n.b,n.c,n.d),q,t,h.line.color(b[i]),h.line.width)}this._drawItemOfLineChart(a,r,w,b[i],h.label(b[i]));l=parseInt(h.item.radius.call(this,b[i-1]),10)||2;g=h.eventRadius||l+1;f.addRect(b[i].id,[r-g,w-g,r+g,w+g],e)}}},_getSplineParameters:function(a){var b,c,d,e,f,g,h,i,j,k;b=[];m=[];k=a.length;for(c=0;c<k-1;c++)b[c]=a[c+1].x-a[c].x,m[c]=(a[c+1].y-
a[c].y)/b[c];d=[];e=[];d[0]=0;d[1]=2*(b[0]+b[1]);e[0]=0;e[1]=6*(m[1]-m[0]);for(c=2;c<k-1;c++)d[c]=2*(b[c-1]+b[c])-b[c-1]*b[c-1]/d[c-1],e[c]=6*(m[c]-m[c-1])-b[c-1]*e[c-1]/d[c-1];f=[];f[k-1]=f[0]=0;for(c=k-2;c>=1;c--)f[c]=(e[c]-b[c]*f[c+1])/d[c];g=[];h=[];i=[];j=[];for(c=0;c<k-1;c++)g[c]=a[c].y,h[c]=-b[c]*f[c+1]/6-b[c]*f[c]/3+(a[c+1].y-a[c].y)/b[c],i[c]=f[c]/2,j[c]=(f[c+1]-f[c])/(6*b[c]);return{a:g,b:h,c:i,d:j}},_getSplineYPoint:function(a,b,c,d,e,f,g){return d[c]+(a-b)*(e[c]+(a-b)*(f[c]+(a-b)*g[c]))}};
dhtmlx.chart.barH={pvt_render_barH:function(a,b,c,d,e,f){var g,h,i,j,k=d.x-c.x,m=!!this._settings.yAxis,l=!!this._settings.xAxis,n=this._getLimits("h");g=n.max;h=n.min;var o=Math.floor((d.y-c.y)/b.length);e||this._drawHScales(a,b,c,d,h,g,o);m&&(g=parseFloat(this._settings.xAxis.end),h=parseFloat(this._settings.xAxis.start));var p=this._getRelativeValue(h,g);j=p[0];i=p[1];var r=j?k/j:10;if(!m)var q=10,r=j?(k-q)/j:10;var s=parseInt(this._settings.width,10);s*this._series.length+4>o&&(s=o/this._series.length-
4);var w=Math.floor((o-s*this._series.length)/2),t=typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(s/5),v=!1,u=this._settings.gradient;u&&typeof u!="function"?(v=u,u=!1):u&&(u=a.createLinearGradient(c.x,c.y,d.x,c.y),this._settings.gradient(u));var x=0;m||this._drawLine(a,c.x-0.5,c.y,c.x-0.5,d.y,"#000000",1);for(var A=0;A<b.length;A++){var y=parseFloat(this._settings.value(b[A]||0));y>g&&(y=g);y-=h;y*=i;var B=c.x,z=c.y+w+A*o+(s+1)*e;if(y<0&&this._settings.origin==
"auto"||this._settings.xAxis&&y===0&&!(this._settings.origin!="auto"&&this._settings.origin>h))this.renderTextAt("middle","right",B+10,z+s/2+w,this._settings.label(b[A]));else{y<0&&this._settings.origin!="auto"&&this._settings.origin>h&&(y=0);m||(y+=q/r);var C=u||this._settings.color.call(this,b[A]);this._settings.border&&this._drawBarHBorder(a,B,z,s,h,t,r,y,C);a.globalAlpha=this._settings.alpha.call(this,b[A]);var D=this._drawBarH(a,c,B,z,s,h,t,r,y,C,u,v);v!=!1&&this._drawBarHGradient(a,B,z,s,h,
t,r,y,C,v);a.globalAlpha=1;D[3]==z?(this.renderTextAt("middle","left",D[0]-5,D[3]+Math.floor(s/2),this._settings.label(b[A])),f.addRect(b[A].id,[D[0],D[3],D[2],D[3]+s],e)):(this.renderTextAt("middle",!1,D[2]+5,D[1]+Math.floor(s/2),this._settings.label(b[A])),f.addRect(b[A].id,[D[0],z,D[2],D[3]],e))}}},_setBarHPoints:function(a,b,c,d,e,f,g,h,i){var j=0;if(e>f*g)var k=(e-f*g)/e,j=-Math.asin(k)+Math.PI/2;a.moveTo(b,c+h);var m=b+f*g-e-(e?0:h);e<f*g&&a.lineTo(m,c+h);var l=c+e;e&&e>0&&a.arc(m,l,e-h,-Math.PI/
2+j,0,!1);var n=c+d-e-(e?0:h),o=m+e-(e?h:0);a.lineTo(o,n);var p=m;e&&e>0&&a.arc(p,n,e-h,0,Math.PI/2-j,!1);var r=c+d-h;a.lineTo(b,r);i||a.lineTo(b,c+h);return[o,r]},_drawHScales:function(a,b,c,d,e,f,g){var h=this._drawHXAxis(a,b,c,d,e,f);this._drawHYAxis(a,b,c,d,g,h)},_drawHYAxis:function(a,b,c,d,e,f){if(this._settings.yAxis){var g,h=parseInt(f?f:c.x,10)-0.5,i=d.y+0.5,j=c.y;this._drawLine(a,h,i,h,j,this._settings.yAxis.color,1);for(var k=0;k<b.length;k++){var m=this._settings.origin!="auto"&&this._settings.view==
"barH"&&parseFloat(this._settings.value(b[k]))<this._settings.origin;g=j+e/2+k*e;this.renderTextAt("middle",m?!1:"left",m?h+5:h-5,g,this._settings.yAxis.template(b[k]),"dhx_axis_item_y",m?0:h-10);this._settings.yAxis.lines.call(this,b[k])&&this._drawLine(a,c.x,g,d.x,g,this._settings.yAxis.lineColor.call(this,b[k]),1)}this._drawLine(a,c.x+0.5,j+0.5,d.x,j+0.5,this._settings.yAxis.lineColor.call(this,{}),1);this._setYAxisTitle(c,d)}},_drawHXAxis:function(a,b,c,d,e,f){var g,h={},i=this._settings.xAxis;
if(i){var j=d.y+0.5,k=c.x-0.5,m=d.x-0.5,l=c.x;this._drawLine(a,k,j,m,j,i.color,1);i.step&&(g=parseFloat(i.step));if(typeof this._settings.configXAxis.step=="undefined"||typeof this._settings.configXAxis.start=="undefined"||typeof this._settings.configXAxis.end=="undefined")h=this._calculateScale(e,f),e=h.start,f=h.end,g=h.step,this._settings.xAxis.end=f,this._settings.xAxis.start=e,this._settings.xAxis.step=g;if(g!==0){for(var n=(m-k)*g/(f-e),o=0,p=e;p<=f;p+=g){h.fixNum&&(p=parseFloat((new Number(p)).toFixed(h.fixNum)));
var r=Math.floor(k+o*n)+0.5;!(p==e&&this._settings.origin=="auto")&&i.lines.call(this,p)&&this._drawLine(a,r,j,r,c.y,this._settings.xAxis.lineColor.call(this,p),1);p==this._settings.origin&&(l=r+1);this.renderTextAt(!1,!0,r,j+2,i.template(p.toString()),"dhx_axis_item_x");o++}this.renderTextAt(!0,!1,k,d.y+this._settings.padding.bottom-3,this._settings.xAxis.title,"dhx_axis_title_x",d.x-c.x);i.lines||this._drawLine(a,k,c.y-0.5,m,c.y-0.5,this._settings.xAxis.color,0.2);return l}}},_correctBarHParams:function(a,
b,c,d,e,f,g){var h=this._settings.yAxis,i=b;h&&this._settings.origin!="auto"&&this._settings.origin>g&&(b+=(this._settings.origin-g)*e,i=b,d-=this._settings.origin-g,d<0&&(d*=-1,a.translate(b,c+f),a.rotate(Math.PI),b=0.5,c=0),b+=0.5);return{value:d,x0:b,y0:c,start:i}},_drawBarH:function(a,b,c,d,e,f,g,h,i,j,k,m){a.save();var l=this._correctBarHParams(a,c,d,i,h,e,f);a.fillStyle=j;a.beginPath();var n=this._setBarHPoints(a,l.x0,l.y0,e,g,h,l.value,this._settings.border?1:0);k&&!m&&a.lineTo(b.x+total_width,
l.y0+(this._settings.border?1:0));a.fill();a.restore();var o=l.y0,p=l.y0!=d?d:n[1],r=l.y0!=d?l.start-n[0]:l.start,q=l.y0!=d?l.start:n[0];return[r,o,q,p]},_drawBarHBorder:function(a,b,c,d,e,f,g,h,i){a.save();var j=this._correctBarHParams(a,b,c,h,g,d,e);a.beginPath();this._setBorderStyles(a,i);a.globalAlpha=0.9;this._setBarHPoints(a,j.x0,j.y0,d,f,g,j.value,a.lineWidth/2,1);a.stroke();a.restore()},_drawBarHGradient:function(a,b,c,d,e,f,g,h,i,j){a.save();var k=this._correctBarHParams(a,b,c,h,g,d,e),m=
this._setBarGradient(a,k.x0,k.y0+d,k.x0+g*k.value,k.y0,j,i,"x");a.fillStyle=m.gradient;a.beginPath();var l=this._setBarHPoints(a,k.x0,k.y0+m.offset,d-m.offset*2,f,g,k.value,m.offset);a.fill();a.globalAlpha=1;a.restore()}};
dhtmlx.chart.stackedBarH={pvt_render_stackedBarH:function(a,b,c,d,e,f){var g,h,i,j,k=d.x-c.x,m=!!this._settings.yAxis,l=this._getStackedLimits(b);g=l.max;h=l.min;var n=Math.floor((d.y-c.y)/b.length);e||this._drawHScales(a,b,c,d,h,g,n);m&&(g=parseFloat(this._settings.xAxis.end),h=parseFloat(this._settings.xAxis.start));var o=this._getRelativeValue(h,g);j=o[0];i=o[1];var p=j?k/j:10;if(!m)var r=10,p=j?(k-r)/j:10;var q=parseInt(this._settings.width,10);q+4>n&&(q=n-4);var s=Math.floor((n-q)/2),w=0,t=!1,
v=this._settings.gradient;v&&(t=!0);m||this._drawLine(a,c.x-0.5,c.y,c.x-0.5,d.y,"#000000",1);for(var u=0;u<b.length;u++){if(!e)b[u].$startX=c.x;var x=parseFloat(this._settings.value(b[u]||0));x>g&&(x=g);x-=h;x*=i;var A=c.x,y=c.y+s+u*n;e?A=b[u].$startX:b[u].$startX=A;if(x<0||this._settings.yAxis&&x===0)this.renderTextAt("middle",!0,A+10,y+q/2,this._settings.label(b[u]));else{m||(x+=r/p);var B=this._settings.color.call(this,b[u]);a.globalAlpha=this._settings.alpha.call(this,b[u]);a.fillStyle=this._settings.color.call(this,
b[u]);a.beginPath();var z=this._setBarHPoints(a,A,y,q,w,p,x,this._settings.border?1:0);v&&!t&&a.lineTo(c.x+k,y+(this._settings.border?1:0));a.fill();if(t!=!1){var C=this._setBarGradient(a,A,y+q,A,y,t,B,"x");a.fillStyle=C.gradient;a.beginPath();z=this._setBarHPoints(a,A,y,q,w,p,x,0);a.fill()}this._settings.border&&this._drawBarHBorder(a,A,y,q,h,w,p,x,B);a.globalAlpha=1;this.renderTextAt("middle",!0,b[u].$startX+(z[0]-b[u].$startX)/2-1,y+(z[1]-y)/2,this._settings.label(b[u]));f.addRect(b[u].id,[b[u].$startX,
y,z[0],z[1]],e);b[u].$startX=z[0]}}}};
dhtmlx.chart.stackedBar={pvt_render_stackedBar:function(a,b,c,d,e,f){var g,h,i,j,k=d.y-c.y,m=!!this._settings.yAxis,l=!!this._settings.xAxis,n=this._getStackedLimits(b);g=n.max;h=n.min;var o=Math.floor((d.x-c.x)/b.length);e||this._drawScales(a,b,c,d,h,g,o);m&&(g=parseFloat(this._settings.yAxis.end),h=parseFloat(this._settings.yAxis.start));var p=this._getRelativeValue(h,g);j=p[0];i=p[1];var r=j?k/j:10,q=parseInt(this._settings.width,10);q+4>o&&(q=o-4);var s=Math.floor((o-q)/2),w=this._settings.gradient?
this._settings.gradient:!1;l||this._drawLine(a,c.x,d.y+0.5,d.x,d.y+0.5,"#000000",1);for(var t=0;t<b.length;t++){var v=parseFloat(this._settings.value(b[t]||0));if(v){e||(v-=h);v*=i;var u=c.x+s+t*o,x=d.y;e?x=b[t].$startY:b[t].$startY=x;if(!(x<c.y+1))if(v<0||this._settings.yAxis&&v===0)this.renderTextAt(!0,!0,u+Math.floor(q/2),x,this._settings.label(b[t]));else{var A=this._settings.color.call(this,b[t]);a.globalAlpha=this._settings.alpha.call(this,b[t]);a.fillStyle=this._settings.color.call(this,b[t]);
a.beginPath();var y=this._setStakedBarPoints(a,u-(this._settings.border?0.5:0),x,q+(this._settings.border?0.5:0),r,v,0,c.y);a.fill();if(w){a.save();var B=this._setBarGradient(a,u,x,u+q,y[1],w,A,"y");a.fillStyle=B.gradient;a.beginPath();y=this._setStakedBarPoints(a,u+B.offset,x,q-B.offset*2,r,v,this._settings.border?1:0,c.y);a.fill();a.restore()}this._settings.border&&(a.save(),this._setBorderStyles(a,A),a.beginPath(),this._setStakedBarPoints(a,u-0.5,x,q+1,r,v,0,c.y,1),a.stroke(),a.restore());a.globalAlpha=
1;this.renderTextAt(!1,!0,u+Math.floor(q/2),y[1]+(x-y[1])/2-7,this._settings.label(b[t]));f.addRect(b[t].id,[u,y[1],y[0],b[t].$startY||x],e);b[t].$startY=this._settings.border?y[1]+1:y[1]}}else if(!e||!b[t].$startY)b[t].$startY=d.y}},_setStakedBarPoints:function(a,b,c,d,e,f,g,h,i){a.moveTo(b,c);var j=c-e*f+g;j<h&&(j=h);a.lineTo(b,j);var k=b+d,m=j;a.lineTo(k,m);var l=b+d;a.lineTo(l,c);i||a.lineTo(b,c);return[l,m-2*g]}};
dhtmlx.chart.line={pvt_render_line:function(a,b,c,d,e,f){var g,h,i,j,k,m,l,n,o,p;j=this._calculateParametersOfLineChart(a,b,c,d,e);h=this._settings;if(b.length){o=this._getYPointOfLineChart(b[0],c,d,j);m=l=h.offset?c.x+j.cellWidth*0.5:c.x;for(i=1;i<=b.length;i++){n=i==b.length-1&&!this._settings.offset?d.x:Math.floor(j.cellWidth*i)-0.5+m;if(b.length!=i){p=this._getYPointOfLineChart(b[i],c,d,j);if(!p)continue;if(h.line.width&&(this._drawLine(a,l,o,n,p,h.line.color.call(this,b[i-1]),h.line.width),h.line&&
h.line.shadow))a.globalAlpha=0.3,this._drawLine(a,l+2,o+h.line.width+8,n+2,p+h.line.width+8,"#eeeeee",h.line.width+3),a.globalAlpha=1}this._drawItemOfLineChart(a,l,o,b[i-1],!!h.offset);k=parseInt(h.item.radius.call(this,b[i-1]),10)||2;g=h.eventRadius||k+1;f.addRect(b[i-1].id,[l-g,o-g,l+g,o+g],e);o=p;l=n}}},_drawItemOfLineChart:function(a,b,c,d,e){var f=this._settings.item,g=parseInt(f.radius.call(this,d),10);a.save();if(f.shadow){a.lineWidth=1;a.strokeStyle="#bdbdbd";a.fillStyle="#bdbdbd";for(var h=
[0.1,0.2,0.3],i=h.length-1;i>=0;i--)a.globalAlpha=h[i],a.strokeStyle="#d0d0d0",a.beginPath(),this._strokeChartItem(a,b,c+2*g/3,g+i+1,f.type),a.stroke();a.beginPath();a.globalAlpha=0.3;a.fillStyle="#bdbdbd";this._strokeChartItem(a,b,c+2*g/3,g+1,f.type);a.fill()}a.restore();a.lineWidth=f.borderWidth;a.fillStyle=f.color.call(this,d);a.strokeStyle=f.borderColor.call(this,d);a.globalAlpha=f.alpha.call(this,d);a.beginPath();this._strokeChartItem(a,b,c,g+1,f.type);a.fill();a.stroke();a.globalAlpha=1;e&&
this.renderTextAt(!1,!0,b,c-g-this._settings.labelOffset,this._settings.label.call(this,d))},_strokeChartItem:function(a,b,c,d,e){if(e&&(e=="square"||e=="s"))d*=Math.sqrt(2)/2,a.moveTo(b-d-a.lineWidth/2,c-d),a.lineTo(b+d,c-d),a.lineTo(b+d,c+d),a.lineTo(b-d,c+d),a.lineTo(b-d,c-d);else if(e&&(e=="diamond"||e=="d")){var f=a.lineWidth>1?a.lineWidth*Math.sqrt(2)/4:0;a.moveTo(b,c-d);a.lineTo(b+d,c);a.lineTo(b,c+d);a.lineTo(b-d,c);a.lineTo(b+f,c-d-f)}else e&&(e=="triangle"||e=="t")?(a.moveTo(b,c-d),a.lineTo(b+
Math.sqrt(3)*d/2,c+d/2),a.lineTo(b-Math.sqrt(3)*d/2,c+d/2),a.lineTo(b,c-d)):a.arc(b,c,d,0,Math.PI*2,!0)},_getYPointOfLineChart:function(a,b,c,d){var e=d.minValue,f=d.maxValue,g=d.unit,h=d.valueFactor,i=this._settings.value(a),j=(parseFloat(i||0)-e)*h;this._settings.yAxis||(j+=d.startValue/g);var k=c.y-Math.floor(g*j);if(j<0)k=c.y;if(i>f)k=b.y;if(i<e)k=c.y;return k},_calculateParametersOfLineChart:function(a,b,c,d,e){var f={},g;f.totalHeight=d.y-c.y;f.cellWidth=Math.round((d.x-c.x)/(!this._settings.offset?
b.length-1:b.length));var h=!!this._settings.yAxis,i=this._settings.view.indexOf("stacked")!=-1?this._getStackedLimits(b):this._getLimits();f.maxValue=i.max;f.minValue=i.min;e||this._drawScales(a,b,c,d,f.minValue,f.maxValue,f.cellWidth);if(h)f.maxValue=parseFloat(this._settings.yAxis.end),f.minValue=parseFloat(this._settings.yAxis.start);var j=this._getRelativeValue(f.minValue,f.maxValue);g=j[0];f.valueFactor=j[1];f.unit=g?f.totalHeight/g:10;f.startValue=0;if(!h&&(f.startValue=10,f.unit!=f.totalHeight))f.unit=
g?(f.totalHeight-f.startValue)/g:10;return f}};
dhtmlx.chart.bar={pvt_render_bar:function(a,b,c,d,e,f){var g,h,i,j,k=d.y-c.y,m=!!this._settings.yAxis,l=!!this._settings.xAxis,n=this._getLimits();g=n.max;h=n.min;var o=Math.floor((d.x-c.x)/b.length);!e&&(this._settings.origin=="auto"||m)&&this._drawScales(a,b,c,d,h,g,o);m&&(g=parseFloat(this._settings.yAxis.end),h=parseFloat(this._settings.yAxis.start));var p=this._getRelativeValue(h,g);j=p[0];i=p[1];var r=j?k/j:j;if(!m&&!(this._settings.origin!="auto"&&l))var q=10,r=j?(k-q)/j:q;!e&&this._settings.origin!=
"auto"&&!m&&this._settings.origin>h&&this._drawXAxis(a,b,c,d,o,d.y-r*(this._settings.origin-h));var s=parseInt(this._settings.width,10);this._series&&s*this._series.length+4>o&&(s=parseInt(o/this._series.length-4,10));var w=Math.floor((o-s*this._series.length)/2),t=typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(s/5),v=!1,u=this._settings.gradient;u&&typeof u!="function"?(v=u,u=!1):u&&(u=a.createLinearGradient(0,d.y,0,c.y),this._settings.gradient(u));l||this._drawLine(a,
c.x,d.y+0.5,d.x,d.y+0.5,"#000000",1);for(var x=0;x<b.length;x++){var A=parseFloat(this._settings.value(b[x]||0));A>g&&(A=g);A-=h;A*=i;var y=c.x+w+x*o+(s+1)*e,B=d.y+0.5;if(A<0||this._settings.yAxis&&A===0&&!(this._settings.origin!="auto"&&this._settings.origin>h))this.renderTextAt(!0,!0,y+Math.floor(s/2),B,this._settings.label(b[x]));else{!m&&!(this._settings.origin!="auto"&&l)&&(A+=q/r);var z=u||this._settings.color.call(this,b[x]);a.globalAlpha=this._settings.alpha.call(this,b[x]);var C=this._drawBar(a,
c,y,B,s,h,t,r,A,z,u,v);v&&this._drawBarGradient(a,y,B,s,h,t,r,A,z,v);this._settings.border&&this._drawBarBorder(a,y,B,s,h,t,r,A,z);a.globalAlpha=1;C[0]!=y?this.renderTextAt(!1,!0,y+Math.floor(s/2),C[1],this._settings.label(b[x])):this.renderTextAt(!0,!0,y+Math.floor(s/2),C[3],this._settings.label(b[x]));f.addRect(b[x].id,[y,C[3],C[2],C[1]],e)}}},_correctBarParams:function(a,b,c,d,e,f,g){var h=this._settings.xAxis,i=c;h&&this._settings.origin!="auto"&&this._settings.origin>g&&(c-=(this._settings.origin-
g)*e,i=c,d-=this._settings.origin-g,d<0&&(d*=-1,a.translate(b+f,c),a.rotate(Math.PI),c=b=0),c-=0.5);return{value:d,x0:parseInt(b,10),y0:parseInt(c,10),start:i}},_drawBar:function(a,b,c,d,e,f,g,h,i,j,k,m){a.save();a.fillStyle=j;var l=this._correctBarParams(a,c,d,i,h,e,f),n=this._setBarPoints(a,l.x0,l.y0,e,g,h,l.value,this._settings.border?1:0);k&&!m&&a.lineTo(l.x0+(this._settings.border?1:0),b.y);a.fill();a.restore();var o=l.x0,p=l.x0!=c?c+n[0]:n[0],r=l.x0!=c?l.start-n[1]:d,q=l.x0!=c?l.start:n[1];
return[o,r,p,q]},_setBorderStyles:function(a,b){var c,d;d=dhtmlx.math.toRgb(b);c=dhtmlx.math.rgbToHsv(d[0],d[1],d[2]);c[2]/=2;b="rgb("+dhtmlx.math.hsvToRgb(c[0],c[1],c[2])+")";a.strokeStyle=b;if(a.globalAlpha==1)a.globalAlpha=0.9},_drawBarBorder:function(a,b,c,d,e,f,g,h,i){var j;a.save();j=this._correctBarParams(a,b,c,h,g,d,e);this._setBorderStyles(a,i);this._setBarPoints(a,j.x0,j.y0,d,f,g,j.value,a.lineWidth/2,1);a.stroke();a.restore()},_drawBarGradient:function(a,b,c,d,e,f,g,h,i,j){a.save();var k=
this._correctBarParams(a,b,c,h,g,d,e),m=this._setBarGradient(a,k.x0,k.y0,k.x0+d,k.y0-g*k.value+2,j,i,"y"),l=this._settings.border?1:0;a.fillStyle=m.gradient;this._setBarPoints(a,k.x0+m.offset,k.y0,d-m.offset*2,f,g,k.value,m.offset+l);a.fill();a.restore()},_setBarPoints:function(a,b,c,d,e,f,g,h,i){a.beginPath();var j=0;if(e>f*g){var k=(e-f*g)/e;k<=1&&k>=-1&&(j=-Math.acos(k)+Math.PI/2)}a.moveTo(b+h,c);var m=c-Math.floor(f*g)+e+(e?0:h);e<f*g&&a.lineTo(b+h,m);var l=b+e;e&&e>0&&a.arc(l,m,e-h,-Math.PI+
j,-Math.PI/2,!1);var n=b+d-e-(e?0:h),o=m-e+(e?h:0);a.lineTo(n,o);e&&e>0&&a.arc(n,m,e-h,-Math.PI/2,0-j,!1);var p=b+d-h;a.lineTo(p,c);i||a.lineTo(b+h,c);return[p,o]}};
dhtmlx.chart.pie={pvt_render_pie:function(a,b,c,d,e,f){this._renderPie(a,b,c,d,1,f)},_renderPie:function(a,b,c,d,e,f){if(b.length){var g=this._getPieParameters(c,d),h=this._settings.radius?this._settings.radius:g.radius;if(!(h<0)){var i=this._getValues(b),j=this._getTotalValue(i),k=this._getRatios(i,j),m=this._settings.x?this._settings.x:g.x,l=this._settings.y?this._settings.y:g.y;e==1&&this._settings.shadow&&this._addShadow(a,m,l,h);l/=e;var n=-Math.PI/2,o=[];a.scale(1,e);if(this._settings.gradient){var p=
e!=1?m+h/3:m,r=e!=1?l+h/3:l;this._showRadialGradient(a,m,l,h,p,r)}for(var q=0;q<b.length;q++)if(i[q]){a.strokeStyle=this._settings.lineColor.call(this,b[q]);a.beginPath();a.moveTo(m,l);o.push(n);alpha1=-Math.PI/2+k[q]-1.0E-4;a.arc(m,l,h,n,alpha1,!1);a.lineTo(m,l);var s=this._settings.color.call(this,b[q]);a.fillStyle=s;a.fill();this._settings.pieInnerText&&this._drawSectorLabel(m,l,5*h/6,n,alpha1,e,this._settings.pieInnerText(b[q],j),!0);this._settings.label&&this._drawSectorLabel(m,l,h+this._settings.labelOffset,
n,alpha1,e,this._settings.label(b[q]));if(e!=1)this._createLowerSector(a,m,l,n,alpha1,h,!0),a.fillStyle="#000000",a.globalAlpha=0.2,this._createLowerSector(a,m,l,n,alpha1,h,!1),a.globalAlpha=1,a.fillStyle=s;f.addSector(b[q].id,n,alpha1,m,l,h,e);n=alpha1}a.globalAlpha=0.8;for(var w,q=0;q<o.length;q++)w=this._getPositionByAngle(o[q],m,l,h),this._drawLine(a,m,l,w.x,w.y,this._settings.lineColor.call(this,b[q]),2);if(e==1)a.lineWidth=2,a.strokeStyle="#ffffff",a.beginPath(),a.arc(m,l,h+1,0,2*Math.PI,!1),
a.stroke();a.globalAlpha=1;a.scale(1,1/e)}}},_getValues:function(a){for(var b=[],c=0;c<a.length;c++)b.push(parseFloat(this._settings.value(a[c])||0));return b},_getTotalValue:function(a){for(var b=0,c=0;c<a.length;c++)b+=a[c];return b},_getRatios:function(a,b){for(var c,d=[],e=0,b=b||this._getTotalValue(a),f=0;f<a.length;f++)c=a[f],d[f]=Math.PI*2*(b?(c+e)/b:1/data.length),e+=c;return d},_getPieParameters:function(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.x+c/2,f=a.y+d/2,g=Math.min(c/2,d/2);return{x:e,y:f,
radius:g}},_createLowerSector:function(a,b,c,d,e,f,g){a.lineWidth=1;if(d<=0&&e>=0||d>=0&&e<=Math.PI||Math.abs(d-Math.PI)>0.003&&d<=Math.PI&&e>=Math.PI){d<=0&&e>=0&&(d=0,g=!1,this._drawSectorLine(a,b,c,f,d,e));if(d<=Math.PI&&e>=Math.PI)e=Math.PI,g=!1,this._drawSectorLine(a,b,c,f,d,e);var h=(this._settings.height||Math.floor(f/4))/this._settings.cant;a.beginPath();a.arc(b,c,f,d,e,!1);a.lineTo(b+f*Math.cos(e),c+f*Math.sin(e)+h);a.arc(b,c+h,f,e,d,!0);a.lineTo(b+f*Math.cos(d),c+f*Math.sin(d));a.fill();
g&&a.stroke()}},_drawSectorLine:function(a,b,c,d,e,f){a.beginPath();a.arc(b,c,d,e,f,!1);a.stroke()},_addShadow:function(a,b,c,d){a.globalAlpha=0.5;for(var e="#c4c4c4,#c6c6c6,#cacaca,#dcdcdc,#dddddd,#e0e0e0,#eeeeee,#f5f5f5,#f8f8f8".split(","),f=e.length-1;f>-1;f--)a.beginPath(),a.fillStyle=e[f],a.arc(b+1,c+1,d+f,0,Math.PI*2,!0),a.fill();a.globalAlpha=1},_getGrayGradient:function(a){a.addColorStop(0,"#ffffff");a.addColorStop(0.7,"#7a7a7a");a.addColorStop(1,"#000000");return a},_showRadialGradient:function(a,
b,c,d,e,f){a.beginPath();var g;typeof this._settings.gradient!="function"?(g=a.createRadialGradient(e,f,d/4,b,c,d),g=this._getGrayGradient(g)):g=this._settings.gradient(g);a.fillStyle=g;a.arc(b,c,d,0,Math.PI*2,!0);a.fill();a.globalAlpha=0.7},_drawSectorLabel:function(a,b,c,d,e,f,g,h){var i=this.renderText(0,0,g,0,1);if(i){var j=i.scrollWidth;i.style.width=j+"px";j>a&&(j=a);var k=e-d<0.2?4:8;h&&(k=j/1.8);var m=d+(e-d)/2;c-=(k-8)/2;var l=-k,n=-8,o="right";if(m>=Math.PI/2&&m<Math.PI||m<=3*Math.PI/2&&
m>=Math.PI)l=-j-l+1,o="left";var p=0;!h&&f<1&&m>0&&m<Math.PI&&(p=(this._settings.height||Math.floor(c/4))/f);var r=(b+Math.floor((c+p)*Math.sin(m)))*f+n,q=a+Math.floor((c+k/2)*Math.cos(m))+l,s=e<Math.PI/2+0.01,w=d<Math.PI/2;if(w&&s)q=Math.max(q,a+3),e-d<0.2&&(q=a);else if(!w&&!s)q=Math.min(q,a-j);else if(!h&&(m>=Math.PI/2&&m<Math.PI||m<=3*Math.PI/2&&m>=Math.PI))q+=j/3;i.style.top=r+"px";i.style.left=q+"px";i.style.width=j+"px";i.style.textAlign=o;i.style.whiteSpace="nowrap"}}};
dhtmlx.chart.pie3D={pvt_render_pie3D:function(a,b,c,d,e,f){this._renderPie(a,b,c,d,this._settings.cant,f)}};dhtmlx.chart.donut={pvt_render_donut:function(a,b,c,d,e,f){if(b.length){this._renderPie(a,b,c,d,1,f);var g=this._settings,h=this._getPieParameters(c,d),i=g.radius?g.radius:h.radius,j=g.innerRadius&&g.innerRadius<i?g.innerRadius:i/3,k=g.x?g.x:h.x,m=g.y?g.y:h.y;a.fillStyle="#ffffff";a.beginPath();a.arc(k,m,j,0,Math.PI*2,!0);a.fill()}}};
dhtmlx.Template={_cache:{},empty:function(){return""},setter:function(a){return dhtmlx.Template.fromHTML(a)},obj_setter:function(a){var b=dhtmlx.Template.setter(a),c=this;return function(){return b.apply(c,arguments)}},fromHTML:function(a){if(typeof a=="function")return a;if(this._cache[a])return this._cache[a];a=(a||"").toString();a=a.replace(/[\r\n]+/g,"\\n");a=a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');a=a.replace(/\{common\.([^}\(]*)\}/g,'"+common.$1+"');a=a.replace(/\{common\.([^\}\(]*)\(\)\}/g,
'"+(common.$1?common.$1(obj):"")+"');a=a.replace(/\{obj\.([^}]*)\}/g,'"+obj.$1+"');a=a.replace(/#([a-z0-9_]+)#/gi,'"+obj.$1+"');a=a.replace(/\{obj\}/g,'"+obj+"');a=a.replace(/\{-obj/g,"{obj");a=a.replace(/\{-common/g,"{common");a='return "'+a+'";';return this._cache[a]=Function("obj","common",a)}};
dhtmlx.Type={add:function(a,b){if(!a.types&&a.prototype.types)a=a.prototype;var c=b.name||"default";this._template(b);this._template(b,"edit");this._template(b,"loading");a.types[c]=dhtmlx.extend(dhtmlx.extend({},a.types[c]||this._default),b);return c},_default:{css:"default",template:function(){return""},template_edit:function(){return""},template_loading:function(){return"..."},width:150,height:80,margin:5,padding:0},_template:function(a,b){var b="template"+(b?"_"+b:""),c=a[b];if(c&&typeof c=="string"){if(c.indexOf("->")!=
-1)switch(c=c.split("->"),c[0]){case "html":c=dhtmlx.html.getValue(c[1]).replace(/\"/g,'\\"');break;case "http":c=(new dhtmlx.ajax).sync().get(c[1],{uid:(new Date).valueOf()}).responseText}a[b]=dhtmlx.Template.fromHTML(c)}}};
dhtmlx.SingleRender={_init:function(){},_toHTML:function(a){return this.type._item_start(a,this.type)+this.type.template(a,this.type)+this.type._item_end},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data)this._dataobj.innerHTML=this._toHTML(this.data);this.callEvent&&this.callEvent("onAfterRender",[])}}};
dhtmlx.ui.Tooltip=function(a){this.name="Tooltip";this.version="3.0";typeof a=="string"&&(a={template:a});dhtmlx.extend(this,dhtmlx.Settings);dhtmlx.extend(this,dhtmlx.SingleRender);this._parseSettings(a,{type:"default",dy:0,dx:20});this._dataobj=this._obj=document.createElement("DIV");this._obj.className="dhx_tooltip";dhtmlx.html.insertBefore(this._obj,document.body.firstChild)};
dhtmlx.ui.Tooltip.prototype={show:function(a,b){if(!this._disabled){if(this.data!=a)this.data=a,this.render(a);this._obj.style.top=b.y+this._settings.dy+"px";this._obj.style.left=b.x+this._settings.dx+"px";this._obj.style.display="block"}},hide:function(){this.data=null;this._obj.style.display="none"},disable:function(){this._disabled=!0},enable:function(){this._disabled=!1},types:{"default":dhtmlx.Template.fromHTML("{obj.id}")},template_item_start:dhtmlx.Template.empty,template_item_end:dhtmlx.Template.empty};
dhtmlx.AutoTooltip={tooltip_setter:function(a){var b=new dhtmlx.ui.Tooltip(a);this.attachEvent("onMouseMove",function(a,d){b.show(this.get(a),dhtmlx.html.pos(d))});this.attachEvent("onMouseOut",function(){b.hide()});this.attachEvent("onMouseMoving",function(){b.hide()});return b}};dhtmlx.ajax=function(a,b,c){if(arguments.length!==0){var d=new dhtmlx.ajax;if(c)d.master=c;d.get(a,null,b)}return!this.getXHR?new dhtmlx.ajax:this};
dhtmlx.ajax.prototype={getXHR:function(){return dhtmlx._isIE?new ActiveXObject("Microsoft.xmlHTTP"):new XMLHttpRequest},send:function(a,b,c){var d=this.getXHR();typeof c=="function"&&(c=[c]);if(typeof b=="object"){var e=[],f;for(f in b){var g=b[f];if(g===null||g===dhtmlx.undefined)g="";e.push(f+"="+encodeURIComponent(g))}b=e.join("&")}b&&!this.post&&(a=a+(a.indexOf("?")!=-1?"&":"?")+b,b=null);d.open(this.post?"POST":"GET",a,!this._sync);this.post&&d.setRequestHeader("Content-type","application/x-www-form-urlencoded");
var h=this;d.onreadystatechange=function(){if(!d.readyState||d.readyState==4){if(c&&h)for(var a=0;a<c.length;a++)c[a]&&c[a].call(h.master||h,d.responseText,d.responseXML,d);c=h=h.master=null}};d.send(b||null);return d},get:function(a,b,c){this.post=!1;return this.send(a,b,c)},post:function(a,b,c){this.post=!0;return this.send(a,b,c)},sync:function(){this._sync=!0;return this}};
dhtmlx.AtomDataLoader={_init:function(a){this.data={};if(a)this._settings.datatype=a.datatype||"json",this._after_init.push(this._load_when_ready)},_load_when_ready:function(){this._ready_for_data=!0;this._settings.url&&this.url_setter(this._settings.url);this._settings.data&&this.data_setter(this._settings.data)},url_setter:function(a){if(!this._ready_for_data)return a;this.load(a,this._settings.datatype);return a},data_setter:function(a){if(!this._ready_for_data)return a;this.parse(a,this._settings.datatype);
return!0},load:function(a,b,c){this.callEvent("onXLS",[]);typeof b=="string"?(this.data.driver=dhtmlx.DataDriver[b],b=c):this.data.driver=dhtmlx.DataDriver.xml;dhtmlx.ajax(a,[this._onLoad,b],this)},parse:function(a,b){this.callEvent("onXLS",[]);this.data.driver=dhtmlx.DataDriver[b||"xml"];this._onLoad(a,null)},_onLoad:function(a,b){var c=this.data.driver,d=c.getRecords(c.toObject(a,b))[0];this.data=c?c.getDetails(d):a;this.callEvent("onXLE",[])},_check_data_feed:function(a){if(!this._settings.dataFeed||
this._ignore_feed||!a)return!0;var b=this._settings.dataFeed;if(typeof b=="function")return b.call(this,a.id||a,a);b=b+(b.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(a.id||a);this.callEvent("onXLS",[]);dhtmlx.ajax(b,function(a){this._ignore_feed=!0;this.setValues(dhtmlx.DataDriver.json.toObject(a)[0]);this._ignore_feed=!1;this.callEvent("onXLE",[])},this);return!1}};dhtmlx.DataDriver={};
dhtmlx.DataDriver.json={toObject:function(a){a||(a="[]");return typeof a=="string"?(eval("dhtmlx.temp="+a),dhtmlx.temp):a},getRecords:function(a){return a&&!(a instanceof Array)?[a]:a},getDetails:function(a){return a},getInfo:function(a){return{_size:a.total_count||0,_from:a.pos||0,_key:a.dhx_security}}};
dhtmlx.DataDriver.json_ext={toObject:function(a){a||(a="[]");if(typeof a=="string"){var b;eval("temp="+a);dhtmlx.temp=[];for(var c=b.header,d=0;d<b.data.length;d++){for(var e={},f=0;f<c.length;f++)typeof b.data[d][f]!="undefined"&&(e[c[f]]=b.data[d][f]);dhtmlx.temp.push(e)}return dhtmlx.temp}return a},getRecords:function(a){return a&&!(a instanceof Array)?[a]:a},getDetails:function(a){return a},getInfo:function(a){return{_size:a.total_count||0,_from:a.pos||0}}};
dhtmlx.DataDriver.html={toObject:function(a){if(typeof a=="string"){var b=null;a.indexOf("<")==-1&&(b=dhtmlx.toNode(a));if(!b)b=document.createElement("DIV"),b.innerHTML=a;return b.getElementsByTagName(this.tag)}return a},getRecords:function(a){return a.tagName?a.childNodes:a},getDetails:function(a){return dhtmlx.DataDriver.xml.tagToObject(a)},getInfo:function(){return{_size:0,_from:0}},tag:"LI"};
dhtmlx.DataDriver.jsarray={toObject:function(a){return typeof a=="string"?(eval("dhtmlx.temp="+a),dhtmlx.temp):a},getRecords:function(a){return a},getDetails:function(a){for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{_size:0,_from:0}}};
dhtmlx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(a){for(var a=this.stringToArray(a),b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{_size:0,_from:0}},stringToArray:function(a){for(var a=a.split(this.cell),b=0;b<a.length;b++)a[b]=a[b].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"");return a},row:"\n",cell:","};
dhtmlx.DataDriver.xml={toObject:function(a,b){return b&&(b=this.checkResponse(a,b))?b:typeof a=="string"?this.fromString(a):a},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(a){return{_size:a.documentElement.getAttribute("total_count")||0,_from:a.documentElement.getAttribute("pos")||0,_key:a.documentElement.getAttribute("dhx_security")}},xpath:function(a,b){if(window.XPathResult){var c=a;if(a.nodeName.indexOf("document")==
-1)a=a.ownerDocument;for(var d=[],e=a.evaluate(b,c,null,XPathResult.ANY_TYPE,null),f=e.iterateNext();f;)d.push(f),f=e.iterateNext();return d}else{var g=!0;try{typeof a.selectNodes=="undefined"&&(g=!1)}catch(h){}if(g)return a.selectNodes(b);else{var i=b.split("/").pop();return a.getElementsByTagName(i)}}},tagToObject:function(a,b){var b=b||{},c=!1,d=a.attributes;if(d&&d.length){for(var e=0;e<d.length;e++)b[d[e].name]=d[e].value;c=!0}for(var f=a.childNodes,g={},e=0;e<f.length;e++)if(f[e].nodeType==
1){var h=f[e].tagName;typeof b[h]!="undefined"?(b[h]instanceof Array||(b[h]=[b[h]]),b[h].push(this.tagToObject(f[e],{}))):b[f[e].tagName]=this.tagToObject(f[e],{});c=!0}if(!c)return this.nodeValue(a);b.value=this.nodeValue(a);return b},nodeValue:function(a){return a.firstChild?a.firstChild.data:""},fromString:function(a){if(window.DOMParser&&!dhtmlx._isIE)return(new DOMParser).parseFromString(a,"text/xml");if(window.ActiveXObject){var b=new ActiveXObject("Microsoft.xmlDOM");b.loadXML(a);return b}},
checkResponse:function(a,b){if(b&&b.firstChild&&b.firstChild.tagName!="parsererror")return b;var c=this.fromString(a.replace(/^[\s]+/,""));if(c)return c}};
dhtmlx.DataLoader={_init:function(a){a=a||"";this.name="DataStore";this.data=a.datastore||new dhtmlx.DataStore;this._readyHandler=this.data.attachEvent("onStoreLoad",dhtmlx.bind(this._call_onready,this))},load:function(a,b){dhtmlx.AtomDataLoader.load.apply(this,arguments);if(!this.data.feed)this.data.feed=function(b,d){if(this._load_count)return this._load_count=[b,d];else this._load_count=!0;this.load(a+(a.indexOf("?")==-1?"?":"&")+"posStart="+b+"&count="+d,function(){var a=this._load_count;this._load_count=
!1;typeof a=="object"&&this.data.feed.apply(this,a)})}},_onLoad:function(a,b){this.data._parse(this.data.driver.toObject(a,b));this.callEvent("onXLE",[]);if(this._readyHandler)this.data.detachEvent(this._readyHandler),this._readyHandler=null},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhtmlx.bind(function(a,c){if(this._settings.dataFeed){var d={};if(a||d){if(typeof a=="function"){if(!c)return;a(c,d)}else d={text:c};this.clearAll();var e=this._settings.dataFeed;if(typeof e==
"function")return e.call(this,c,d);var f=[],g;for(g in d)f.push("dhx_filter["+g+"]="+encodeURIComponent(d[g]));this.load(e+(e.indexOf("?")<0?"?":"&")+f.join("&"),this._settings.datatype);return!1}}},this));return a},_call_onready:function(){if(this._settings.ready){var a=dhtmlx.toFunctor(this._settings.ready);a&&a.call&&a.apply(this,arguments)}}};dhtmlx.DataStore=function(){this.name="DataStore";dhtmlx.extend(this,dhtmlx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhtmlx.toArray()};
dhtmlx.DataStore.prototype={setDriver:function(a){this.driver=dhtmlx.DataDriver[a]},_parse:function(a){this.callEvent("onParse",[this.driver,a]);this._filter_order&&this.filter();var b=this.driver.getInfo(a);if(b._key)dhtmlx.security_key=b._key;var c=this.driver.getRecords(a),d=(b._from||0)*1;if(d===0&&this.order[0])d=this.order.length;for(var e=0,f=0;f<c.length;f++){var g=this.driver.getDetails(c[f]),h=this.id(g);this.pull[h]||(this.order[e+d]=h,e++);this.pull[h]=g;this.extraParser&&this.extraParser(g);
this._scheme&&(this._scheme.$init?this._scheme.$update(g):this._scheme.$update&&this._scheme.$update(g))}for(f=0;f<b._size;f++)this.order[f]||(h=dhtmlx.uid(),g={id:h,$template:"loading"},this.pull[h]=g,this.order[f]=h);this.callEvent("onStoreLoad",[this.driver,a]);this.refresh()},id:function(a){return a.id||(a.id=dhtmlx.uid())},changeId:function(a,b){this.pull[b]=this.pull[a];this.pull[b].id=b;this.order[this.order.find(a)]=b;this._filter_order&&(this._filter_order[this._filter_order.find(a)]=b);
this.callEvent("onIdChange",[a,b]);this._render_change_id&&this._render_change_id(a,b)},get:function(a){return this.item(a)},set:function(a,b){return this.update(a,b)},item:function(a){return this.pull[a]},update:function(a,b){this._scheme&&this._scheme.$update&&this._scheme.$update(b);if(this.callEvent("onBeforeUpdate",[a,b])===!1)return!1;this.pull[a]=b;this.refresh(a)},refresh:function(a){this._skip_refresh||(a?this.callEvent("onStoreUpdated",[a,this.pull[a],"update"]):this.callEvent("onStoreUpdated",
[null,null,null]))},silent:function(a){this._skip_refresh=!0;a.call(this);this._skip_refresh=!1},getRange:function(a,b){a=a?this.indexById(a):this.startOffset||0;b?b=this.indexById(b):(b=Math.min(this.endOffset||Infinity,this.dataCount()-1),b<0&&(b=0));if(a>b)var c=b,b=a,a=c;return this.getIndexRange(a,b)},getIndexRange:function(a,b){for(var b=Math.min(b||Infinity,this.dataCount()-1),c=dhtmlx.toArray(),d=a||0;d<=b;d++)c.push(this.item(this.order[d]));return c},dataCount:function(){return this.order.length},
exists:function(a){return!!this.pull[a]},move:function(a,b){if(!(a<0||b<0)){var c=this.idByIndex(a),d=this.item(c);this.order.removeAt(a);this.order.insertAt(c,Math.min(this.order.length,b));this.callEvent("onStoreUpdated",[c,d,"move"])}},scheme:function(a){this._scheme=a},sync:function(a,b,c){typeof b!="function"&&(c=b,b=null);if(dhtmlx.debug_bind)this.debug_sync_master=a;var d=a;if(a.name!="DataStore")a=a.data;var e=dhtmlx.bind(function(d,e,h){if(h!="update"||b)d=null;if(!d)this.order=dhtmlx.toArray([].concat(a.order)),
this._filter_order=null,this.pull=a.pull,b&&this.silent(b),this._on_sync&&this._on_sync();c?c=!1:this.refresh(d)},this);a.attachEvent("onStoreUpdated",e);this.feed=function(a,b){d.loadNext(b,a)};e()},add:function(a,b){if(this._scheme){var a=a||{},c;for(c in this._scheme)a[c]=a[c]||this._scheme[c];this._scheme&&(this._scheme.$init?this._scheme.$update(a):this._scheme.$update&&this._scheme.$update(a))}var d=this.id(a),e=this.dataCount();if(dhtmlx.isNotDefined(b)||b<0)b=e;b>e&&(b=Math.min(this.order.length,
b));if(this.callEvent("onBeforeAdd",[d,a,b])===!1)return!1;if(this.exists(d))return null;this.pull[d]=a;this.order.insertAt(d,b);if(this._filter_order){var f=this._filter_order.length;!b&&this.order.length&&(f=0);this._filter_order.insertAt(d,f)}this.callEvent("onafterAdd",[d,b]);this.callEvent("onStoreUpdated",[d,a,"add"]);return d},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else{if(this.callEvent("onBeforeDelete",[a])===!1)return!1;if(!this.exists(a))return null;
var c=this.item(a);this.order.remove(a);this._filter_order&&this._filter_order.remove(a);delete this.pull[a];this.callEvent("onafterdelete",[a]);this.callEvent("onStoreUpdated",[a,c,"delete"])}},clearAll:function(){this.pull={};this.order=dhtmlx.toArray();this._filter_order=this.feed=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){return this.order[a]},indexById:function(a){var b=this.order.find(a);return b},next:function(a,b){return this.order[this.indexById(a)+(b||1)]},
first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(a,b){return this.order[this.indexById(a)-(b||1)]},sort:function(a,b,c){var d=a;typeof a=="function"?d={as:a,dir:b}:typeof a=="string"&&(d={by:a,dir:b,as:c});var e=[d.by,d.dir,d.as];if(this.callEvent("onbeforesort",e)){if(this.order.length){var f=dhtmlx.sort.create(d),g=this.getRange(this.first(),this.last());g.sort(f);this.order=g.map(function(a){return this.id(a)},this)}this.refresh();
this.callEvent("onaftersort",e)}},filter:function(a,b){if(this.callEvent("onBeforeFilter",[a,b])){if(this._filter_order)this.order=this._filter_order,delete this._filter_order;if(this.order.length){if(a){var c=a,b=b||"";typeof a=="string"&&(a=dhtmlx.Template.fromHTML(a),b=b.toString().toLowerCase(),c=function(b,c){return a(b).toLowerCase().indexOf(c)!=-1});for(var d=dhtmlx.toArray(),e=0;e<this.order.length;e++){var f=this.order[e];c(this.item(f),b)&&d.push(f)}this._filter_order=this.order;this.order=
d}this.refresh();this.callEvent("onAfterFilter",[])}}},each:function(a,b){for(var c=0;c<this.order.length;c++)a.call(b||this,this.item(this.order[c]))},provideApi:function(a,b){this.debug_bind_master=a;b&&this.mapEvent({onbeforesort:a,onaftersort:a,onbeforeadd:a,onafteradd:a,onbeforedelete:a,onafterdelete:a,onbeforeupdate:a});for(var c="get,set,sort,add,remove,exists,idByIndex,indexById,item,update,refresh,dataCount,filter,next,previous,clearAll,first,last,serialize".split(","),d=0;d<c.length;d++)a[c[d]]=
dhtmlx.methodPush(this,c[d])},serialize:function(){for(var a=this.order,b=[],c=0;c<a.length;c++)b.push(this.pull[a[c]]);return b}};
dhtmlx.sort={create:function(a){return dhtmlx.sort.dir(a.dir,dhtmlx.sort.by(a.by,a.as))},as:{"int":function(a,b){a*=1;b*=1;return a>b?1:a<b?-1:0},string_strict:function(a,b){a=a.toString();b=b.toString();return a>b?1:a<b?-1:0},string:function(a,b){a=a.toString().toLowerCase();b=b.toString().toLowerCase();return a>b?1:a<b?-1:0}},by:function(a,b){if(!a)return b;typeof b!="function"&&(b=dhtmlx.sort.as[b||"string"]);a=dhtmlx.Template.fromHTML(a);return function(c,d){return b(a(c),a(d))}},dir:function(a,
b){return a=="asc"?b:function(a,d){return b(a,d)*-1}}};
dhtmlx.Group={_init:function(){this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(){this._settings.group&&this.group(this._settings.group,!1)},this));this.attachEvent("onBeforeRender",dhtmlx.bind(function(a){this._settings.sort&&(a.block(),a.sort(this._settings.sort),a.unblock())},this));this.attachEvent("onBeforeSort",dhtmlx.bind(function(){this._settings.sort=null},this))},_init_group_data_event:function(a,b){a.attachEvent("onClearAll",dhtmlx.bind(function(){this.ungroup(!1);this.block();
this.clearAll();this.unblock()},b))},sum:function(a,b){var a=dhtmlx.Template.setter(a),b=b||this.data,c=0;b.each(function(b){c+=a(b)*1});return c},min:function(a,b){var a=dhtmlx.Template.setter(a),b=b||this.data,c=Infinity;b.each(function(b){a(b)*1<c&&(c=a(b)*1)});return c*1},max:function(a,b){var a=dhtmlx.Template.setter(a),b=b||this.data,c=-Infinity;b.each(function(b){a(b)*1>c&&(c=a(b)*1)});return c},_split_data_by:function(a){var b=function(a,b){a=dhtmlx.Template.setter(a);return a(b[0])},c=dhtmlx.Template.setter(a.by);
a.map[c]||(a.map[c]=[c,b]);var d={},e=[];this.data.each(function(a){var b=c(a);d[b]||(e.push({id:b}),d[b]=dhtmlx.toArray());d[b].push(a)});for(var f in a.map){var g=a.map[f][1]||b;typeof g!="function"&&(g=this[g]);for(var h=0;h<e.length;h++)e[h][f]=g.call(this,a.map[f][0],d[e[h].id])}this._not_grouped_data=this.data;this.data=new dhtmlx.DataStore;this.data.provideApi(this,!0);this._init_group_data_event(this.data,this);this.parse(e,"json")},group:function(a,b){this.ungroup(!1);this._split_data_by(a);
b!==!1&&this.render()},ungroup:function(a){if(this._not_grouped_data)this.data=this._not_grouped_data,this.data.provideApi(this,!0);a!==!1&&this.render()},group_setter:function(a){return a},sort_setter:function(a){typeof a!="object"&&(a={by:a});this._mergeSettings(a,{as:"string",dir:"asc"});return a}};
dhtmlx.KeyEvents={_init:function(){dhtmlx.event(this._obj,"keypress",this._onKeyPress,this)},_onKeyPress:function(a){var a=a||event,b=a.which||a.keyCode;this.callEvent(this._edit_id?"onEditKeyPress":"onKeyPress",[b,a.ctrlKey,a.shiftKey,a])}};
dhtmlx.MouseEvents={_init:function(){this.on_click&&(dhtmlx.event(this._obj,"click",this._onClick,this),dhtmlx.event(this._obj,"contextmenu",this._onContext,this));this.on_dblclick&&dhtmlx.event(this._obj,"dblclick",this._onDblClick,this);this.on_mouse_move&&(dhtmlx.event(this._obj,"mousemove",this._onMouse,this),dhtmlx.event(this._obj,dhtmlx._isIE?"mouseleave":"mouseout",this._onMouse,this))},_onClick:function(a){return this._mouseEvent(a,this.on_click,"ItemClick")},_onDblClick:function(a){return this._mouseEvent(a,
this.on_dblclick,"ItemDblClick")},_onContext:function(a){var b=dhtmlx.html.locate(a,this._id);if(b&&!this.callEvent("onBeforeContextMenu",[b,a]))return dhtmlx.html.preventEvent(a)},_onMouse:function(a){dhtmlx._isIE&&(a=document.createEventObject(event));this._mouse_move_timer&&window.clearTimeout(this._mouse_move_timer);this.callEvent("onMouseMoving",[a]);this._mouse_move_timer=window.setTimeout(dhtmlx.bind(function(){a.type=="mousemove"?this._onMouseMove(a):this._onMouseOut(a)},this),500)},_onMouseMove:function(a){this._mouseEvent(a,
this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[a||event])},_onMouseOut:function(a){this.callEvent("onMouseOut",[a||event])},_mouseEvent:function(a,b,c){for(var a=a||event,d=a.target||a.srcElement,e="",f=null,g=!1;d&&d.parentNode;){if(!g&&d.getAttribute&&(f=d.getAttribute(this._id))){d.getAttribute("userdata")&&this.callEvent("onLocateData",[f,d]);if(!this.callEvent("on"+c,[f,a,d]))return;g=!0}if(e=d.className)if(e=e.split(" "),e=e[0]||e[1],b[e])return b[e].call(this,a,f||dhx.html.locate(a,
this._id),d);d=d.parentNode}return g}};
dhtmlx.Settings={_init:function(){this._settings=this.config={}},define:function(a,b){return typeof a=="object"?this._parseSeetingColl(a):this._define(a,b)},_define:function(a,b){var c=this[a+"_setter"];return this._settings[a]=c?c.call(this,b):b},_parseSeetingColl:function(a){if(a)for(var b in a)this._define(b,a[b])},_parseSettings:function(a,b){var c=dhtmlx.extend({},b);typeof a=="object"&&!a.tagName&&dhtmlx.extend(c,a);this._parseSeetingColl(c)},_mergeSettings:function(a,b){for(var c in b)switch(typeof a[c]){case "object":a[c]=
this._mergeSettings(a[c]||{},b[c]);break;case "undefined":a[c]=b[c]}return a},_parseContainer:function(a,b,c){if(typeof a=="object"&&!a.tagName)a=a.container;this._obj=dhtmlx.toNode(a);if(!this._obj&&c)this._obj=c(a);this._obj.className+=" "+b;this._obj.onselectstart=function(){return!1};this._dataobj=this._obj},_set_type:function(a){if(typeof a=="object")return this.type_setter(a);this.type=dhtmlx.extend({},this.types[a]);this.customize()},customize:function(a){a&&dhtmlx.extend(this.type,a);this.type._item_start=
dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type._item_end=this.template_item_end(this.type);this.render()},type_setter:function(a){this._set_type(typeof a=="object"?dhtmlx.Type.add(this,a):a);return a},template_setter:function(a){return this.type_setter({template:a})},css_setter:function(a){this._obj.className+=" "+a;return a}};dhtmlx.compat=function(a,b){if(dhtmlx.compat[a])dhtmlx.compat[a](b)};
(function(){if(!window.dhtmlxError){var a=function(){};window.dhtmlxError={catchError:a,throwError:a};window.convertStringToBoolean=function(a){return!!a};window.dhtmlxEventable=function(a){dhtmlx.extend(a,dhtmlx.EventSystem)};var b={getXMLTopNode:function(){},doXPath:function(a){return dhtmlx.DataDriver.xml.xpath(this.xml,a)},xmlDoc:{responseXML:!0}};dhtmlx.compat.dataProcessor=function(a){var d="_sendData",e="_in_progress",f="_tMode",g="_waitMode";a[d]=function(a,c){if(a){c&&(this[e][c]=(new Date).valueOf());
if(!this.callEvent("onBeforeDataSending",c?[c,this.getState(c)]:[]))return!1;var d=this,k=this.serverProcessor;this[f]!="POST"?dhtmlx.ajax().get(k+(k.indexOf("?")!=-1?"&":"?")+this.serialize(a,c),"",function(a,c){b.xml=dhtmlx.DataDriver.xml.checkResponse(a,c);d.afterUpdate(d,null,null,null,b)}):dhtmlx.ajax().post(k,this.serialize(a,c),function(a,c){b.xml=dhtmlx.DataDriver.xml.checkResponse(a,c);d.afterUpdate(d,null,null,null,b)});this[g]++}}}}})();if(!dhtmlx.attaches)dhtmlx.attaches={};
dhtmlx.attaches.attachAbstract=function(a,b){var c=document.createElement("DIV");c.id="CustomObject_"+dhtmlx.uid();c.style.width="100%";c.style.height="100%";c.cmp="grid";document.body.appendChild(c);this.attachObject(c.id);b.container=c.id;var d=this.vs[this.av];d.grid=new window[a](b);d.gridId=c.id;d.gridObj=c;d.grid.setSizes=function(){this.resize?this.resize():this.render()};var e="_viewRestore";return this.vs[this[e]()].grid};
dhtmlx.attaches.attachDataView=function(a){return this.attachAbstract("dhtmlXDataView",a)};dhtmlx.attaches.attachChart=function(a){return this.attachAbstract("dhtmlXChart",a)};dhtmlx.compat.layout=function(){};
dhtmlx.DataDriver.dhtmlxgrid={_grid_getter:"_get_cell_value",toObject:function(a){return this._grid=a},getRecords:function(a){return a.rowsBuffer},getDetails:function(a){for(var b={},c=0;c<this._grid.getColumnsNum();c++)b["data"+c]=this._grid[this._grid_getter](a,c);return b},getInfo:function(){return{_size:0,_from:0}}};
dhtmlx.Canvas={_init:function(){this._canvas_labels=[]},_prepareCanvas:function(a){this._canvas=dhtmlx.html.create("canvas",{width:a.offsetWidth,height:a.offsetHeight});a.appendChild(this._canvas);!this._canvas.getContext&&dhtmlx._isIE&&(dhtmlx.require("thirdparty/excanvas/excanvas.js"),G_vmlCanvasManager.init_(document),G_vmlCanvasManager.initElement(this._canvas));return this._canvas},getCanvas:function(a){return(this._canvas||this._prepareCanvas(this._obj)).getContext(a||"2d")},_resizeCanvas:function(){this._canvas&&
(this._canvas.setAttribute("width",this._canvas.parentNode.offsetWidth),this._canvas.setAttribute("height",this._canvas.parentNode.offsetHeight))},renderText:function(a,b,c,d,e){if(c){var f=dhtmlx.html.create("DIV",{"class":"dhx_canvas_text"+(d?" "+d:""),style:"left:"+a+"px; top:"+b+"px;"},c);this._obj.appendChild(f);this._canvas_labels.push(f);if(e)f.style.width=e+"px";return f}},renderTextAt:function(a,b,c,d,e,f,g){var h=this.renderText.call(this,c,d,e,f,g);if(h){if(a)h.style.top=a=="middle"?parseInt(d-
h.offsetHeight/2,10)+"px":d-h.offsetHeight+"px";if(b)h.style.left=b=="left"?c-h.offsetWidth+"px":parseInt(c-h.offsetWidth/2,10)+"px"}return h},clearCanvas:function(){for(var a=0;a<this._canvas_labels.length;a++)this._obj.removeChild(this._canvas_labels[a]);this._canvas_labels=[];if(this._obj._htmlmap)this._obj._htmlmap.parentNode.removeChild(this._obj._htmlmap),this._obj._htmlmap=null;this.getCanvas().clearRect(0,0,this._canvas.offsetWidth,this._canvas.offsetHeight)}};
dhtmlXChart=function(a){this.name="Chart";this.version="3.0";dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_chart");dhtmlx.extend(this,dhtmlx.AtomDataLoader);dhtmlx.extend(this,dhtmlx.DataLoader);this.data.provideApi(this,!0);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.Destruction);dhtmlx.extend(this,dhtmlx.Canvas);dhtmlx.extend(this,dhtmlx.Group);dhtmlx.extend(this,dhtmlx.AutoTooltip);for(var b in dhtmlx.chart)dhtmlx.extend(this,
dhtmlx.chart[b]);a.preset&&this.definePreset(a);this._parseSettings(a,this.defaults);this._series=[this._settings];this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render()},this));this.attachEvent("onLocateData",this._switchSerie)};
dhtmlXChart.prototype={_id:"dhx_area_id",on_click:{},on_dblclick:{},on_mouse_move:{},bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},resize:function(){this._resizeCanvas();this.render()},view_setter:function(a){if(typeof this._settings.offset=="undefined")this._settings.offset=!(a=="area"||a=="stackedArea");a=="radar"&&!this._settings.yAxis&&this.define("yAxis",{});a=="scatter"&&(this._settings.yAxis||this.define("yAxis",
{}),this._settings.xAxis||this.define("xAxis",{}));return a},render:function(){if(this.callEvent("onBeforeRender",[this.data])){this.clearCanvas();this._settings.legend&&this._drawLegend(this.getCanvas(),this.data.getRange(),this._obj.offsetWidth);for(var a=this._getChartBounds(this._obj.offsetWidth,this._obj.offsetHeight),b=new dhtmlx.ui.Map(this._id),c=this._settings,d=0;d<this._series.length;d++)this._settings=this._series[d],this["pvt_render_"+this._settings.view](this.getCanvas(),this.data.getRange(),
a.start,a.end,d,b);b.render(this._obj);this._settings=c}},value_setter:dhtmlx.Template.obj_setter,xValue_setter:dhtmlx.Template.obj_setter,yValue_setter:function(a){this.define("value",a)},alpha_setter:dhtmlx.Template.obj_setter,label_setter:dhtmlx.Template.obj_setter,lineColor_setter:dhtmlx.Template.obj_setter,pieInnerText_setter:dhtmlx.Template.obj_setter,gradient_setter:function(a){typeof a!="function"&&a&&a===!0&&(a="light");return a},colormap:{RAINBOW:function(a){var b=Math.floor(this.indexById(a.id)/
this.dataCount()*1536);b==1536&&(b-=1);return this._rainbow[Math.floor(b/256)](b%256)}},color_setter:function(a){return this.colormap[a]||dhtmlx.Template.obj_setter(a)},fill_setter:function(a){return!a||a==0?!1:dhtmlx.Template.obj_setter(a)},definePreset:function(a){this.define("preset",a.preset);delete a.preset},preset_setter:function(a){var b,c,d;this.defaults=dhtmlx.extend({},this.defaults);if(typeof dhtmlx.presets.chart[a]=="object"){d=dhtmlx.presets.chart[a];for(b in d)if(typeof d[b]=="object")if(!this.defaults[b]||
typeof this.defaults[b]!="object")this.defaults[b]=dhtmlx.extend({},d[b]);else for(c in this.defaults[b]=dhtmlx.extend({},this.defaults[b]),d[b])this.defaults[b][c]=d[b][c];else this.defaults[b]=d[b];return a}return!1},legend_setter:function(a){if(!a){if(this.legendObj)this.legendObj.innerHTML="",this.legendObj=null;return!1}typeof a!="object"&&(a={template:a});this._mergeSettings(a,{width:150,height:18,layout:"y",align:"left",valign:"bottom",template:"",marker:{type:"square",width:15,height:15,radius:3},
margin:4,padding:3});a.template=dhtmlx.Template.setter(a.template);return a},defaults:{color:"RAINBOW",alpha:"1",label:!1,value:"{obj.value}",padding:{},view:"pie",lineColor:"#ffffff",cant:0.5,width:30,labelWidth:100,line:{width:2,color:"#1293f8"},item:{radius:3,borderColor:"#636363",borderWidth:1,color:"#ffffff",alpha:1,type:"r",shadow:!1},shadow:!0,gradient:!1,border:!0,labelOffset:20,origin:"auto"},item_setter:function(a){typeof a!="object"&&(a={color:a,borderColor:a});this._mergeSettings(a,dhtmlx.extend({},
this.defaults.item));a.alpha=dhtmlx.Template.setter(a.alpha);a.borderColor=dhtmlx.Template.setter(a.borderColor);a.color=dhtmlx.Template.setter(a.color);a.radius=dhtmlx.Template.setter(a.radius);return a},line_setter:function(a){typeof a!="object"&&(a={color:a});dhtmlx.extend(this.defaults.line,a);a=dhtmlx.extend({},this.defaults.line);a.color=dhtmlx.Template.setter(a.color);return a},padding_setter:function(a){typeof a!="object"&&(a={left:a,right:a,top:a,bottom:a});this._mergeSettings(a,{left:50,
right:20,top:35,bottom:40});return a},xAxis_setter:function(a){if(!a)return!1;typeof a!="object"&&(a={template:a});this._mergeSettings(a,{title:"",color:"#000000",lineColor:"#cfcfcf",template:"{obj}",lines:!0});var b=["lineColor","template","lines"];this._converToTemplate(b,a);this._settings.configXAxis=dhtmlx.extend({},a);return a},yAxis_setter:function(a){this._mergeSettings(a,{title:"",color:"#000000",lineColor:"#cfcfcf",template:"{obj}",lines:!0,bg:"#ffffff"});var b=["lineColor","template","lines",
"bg"];this._converToTemplate(b,a);this._settings.configYAxis=dhtmlx.extend({},a);return a},_converToTemplate:function(a,b){for(var c=0;c<a.length;c++)b[a[c]]=dhtmlx.Template.setter(b[a[c]])},_drawScales:function(a,b,c,d,e,f,g){var h=this._drawYAxis(a,b,c,d,e,f);this._drawXAxis(a,b,c,d,g,h);return h},_drawXAxis:function(a,b,c,d,e,f){if(this._settings.xAxis){var g=c.x-0.5,h=parseInt(f?f:d.y,10)+0.5,i=d.x,j,k=!0;this._drawLine(a,g,h,i,h,this._settings.xAxis.color,1);for(var m=0;m<b.length;m++){this._settings.offset===
!0?j=g+e/2+m*e:(j=m==b.length-1?d.x:g+m*e,k=!!m);j=parseInt(j,10)-0.5;var l=this._settings.origin!="auto"&&this._settings.view=="bar"&&parseFloat(this._settings.value(b[m]))<this._settings.origin;this._drawXAxisLabel(j,h,b[m],k,l);(this._settings.offset||m)&&this._settings.xAxis.lines.call(this,b[m])&&this._drawXAxisLine(a,j,d.y,c.y,b[m])}this.renderTextAt(!0,!1,g,d.y+this._settings.padding.bottom-3,this._settings.xAxis.title,"dhx_axis_title_x",d.x-c.x);this._settings.xAxis.lines.call(this,{})&&this._settings.offset&&
this._drawLine(a,i+0.5,d.y,i+0.5,c.y+0.5,this._settings.xAxis.color,0.2)}},_drawYAxis:function(a,b,c,d,e,f){var g,h={};if(this._settings.yAxis){var i=c.x-0.5,j=d.y,k=c.y,m=d.y;this._settings.yAxis.step&&(g=parseFloat(this._settings.yAxis.step));if(typeof this._settings.configYAxis.step=="undefined"||typeof this._settings.configYAxis.start=="undefined"||typeof this._settings.configYAxis.end=="undefined")h=this._calculateScale(e,f),e=h.start,f=h.end,g=h.step,this._settings.yAxis.end=f,this._settings.yAxis.start=
e;this._setYAxisTitle(c,d);if(g!==0){if(f==e)return j;for(var l=(j-k)*g/(f-e),n=0,o=e;o<=f;o+=g){h.fixNum&&(o=parseFloat((new Number(o)).toFixed(h.fixNum)));var p=Math.floor(j-n*l)+0.5;!(o==e&&this._settings.origin=="auto")&&this._settings.yAxis.lines(o)&&this._drawLine(a,i,p,d.x,p,this._settings.yAxis.lineColor(o),1);o==this._settings.origin&&(m=p);var r=o;if(g<1)var q=Math.min(this._log10(g),e<=0?0:this._log10(e)),s=Math.pow(10,-q),o=r=Math.round(o*s)/s;this.renderText(0,p-5,this._settings.yAxis.template(r.toString()),
"dhx_axis_item_y",c.x-5);n++}this._drawLine(a,i,j+1,i,k,this._settings.yAxis.color,1);return m}}},_setYAxisTitle:function(a,b){var c="dhx_axis_title_y"+(dhtmlx._isIE&&dhtmlx._isIE!=9?" dhx_ie_filter":""),d=this.renderTextAt("middle",!1,0,parseInt((b.y-a.y)/2+a.y,10),this._settings.yAxis.title,c);if(d)d.style.left=(dhtmlx.env.transform?(d.offsetHeight-d.offsetWidth)/2:0)+"px"},_calculateScale:function(a,b){if(this._settings.origin!="auto"&&this._settings.origin<a)a=this._settings.origin;var c,d,e;
c=(b-a)/8||1;var f=Math.floor(this._log10(c)),g=Math.pow(10,f),h=c/g,h=h>5?10:5;c=parseInt(h,10)*g;if(c>Math.abs(a))d=a<0?-c:0;else{var i=Math.abs(a),j=Math.floor(this._log10(i)),k=i/Math.pow(10,j);d=Math.ceil(k*10)/10*Math.pow(10,j)-c;for(i>1&&c>0.1&&(d=Math.ceil(d));a<0?d<=a:d>=a;)d-=c;a<0&&(d=-d-2*c)}for(e=d;e<b;)e+=c,e=parseFloat((new Number(e)).toFixed(Math.abs(f)));return{start:d,end:e,step:c,fixNum:Math.abs(f)}},_getLimits:function(a,b){var c,d,e=arguments.length&&a=="h"?this._settings.configXAxis:
this._settings.configYAxis;if(e&&typeof e.end!="undefined"&&typeof e.start!="undefined"&&e.step)c=parseFloat(e.end),d=parseFloat(e.start);else if(c=this.max(this._series[0][b||"value"]),d=e&&typeof e.start!="undefined"?parseFloat(e.start):this.min(this._series[0][b||"value"]),this._series.length>1)for(var f=1;f<this._series.length;f++){var g=this.max(this._series[f][b||"value"]),h=this.min(this._series[f][b||"value"]);g>c&&(c=g);h<d&&(d=h)}return{max:c,min:d}},_log10:function(a){var b="log";return Math.floor(Math[b](a)/
Math.LN10)},_drawXAxisLabel:function(a,b,c,d,e){if(this._settings.xAxis){var f=this.renderTextAt(e,d,a,b-(e?2:0),this._settings.xAxis.template(c));f&&(f.className+=" dhx_axis_item_x")}},_drawXAxisLine:function(a,b,c,d,e){this._settings.xAxis&&this._settings.xAxis.lines&&this._drawLine(a,b,c,b,d,this._settings.xAxis.lineColor.call(this,e),1)},_drawLine:function(a,b,c,d,e,f,g){a.strokeStyle=f;a.lineWidth=g;a.beginPath();a.moveTo(b,c);a.lineTo(d,e);a.stroke();a.lineWidth=1},_getRelativeValue:function(a,
b){var c,d,e=1;if(b!=a){d=b-a;if(Math.abs(c)<1)for(;Math.abs(c)<1;)e*=10,d=c*e;c=d}else c=a;return[c,e]},_rainbow:[function(a){return"#FF"+dhtmlx.math.toHex(a/2,2)+"00"},function(a){return"#FF"+dhtmlx.math.toHex(a/2+128,2)+"00"},function(a){return"#"+dhtmlx.math.toHex(255-a,2)+"FF00"},function(a){return"#00FF"+dhtmlx.math.toHex(a,2)},function(a){return"#00"+dhtmlx.math.toHex(255-a,2)+"FF"},function(a){return"#"+dhtmlx.math.toHex(a,2)+"00FF"}],addSeries:function(a){var b=this._settings;this._settings=
dhtmlx.extend({},b);this._parseSettings(a,{});this._series.push(this._settings);this._settings=b},_switchSerie:function(a,b){var c;this._active_serie=b.getAttribute("userdata");if(this._series[this._active_serie]){for(var d=0;d<this._series.length;d++)(c=this._series[d].tooltip)&&c.disable();(c=this._series[this._active_serie].tooltip)&&c.enable()}},_drawLegend:function(a,b){var c,d,e,f,g,h,i,j=0,k=0;d=this._settings.legend;i=this._settings.legend.layout!="x"?"width:"+d.width+"px":"";if(this.legendObj)this.legendObj.innerHTML=
"";e=dhtmlx.html.create("DIV",{"class":"dhx_chart_legend",style:"left:"+j+"px; top:"+k+"px;"+i},"");if(d.padding)e.style.padding=d.padding+"px";this.legendObj=e;this._obj.appendChild(e);g=[];if(d.values)for(c=0;c<d.values.length;c++)g.push(this._drawLegendText(e,d.values[c].text));else for(c=0;c<b.length;c++)g.push(this._drawLegendText(e,d.template(b[c])));h=e.offsetWidth;f=e.offsetHeight;h<this._obj.offsetWidth&&(d.layout=="x"&&d.align=="center"&&(j=(this._obj.offsetWidth-h)/2),d.align=="right"&&
(j=this._obj.offsetWidth-h),d.margin&&d.align!="center"&&(j+=(d.align=="left"?1:-1)*d.margin));f<this._obj.offsetHeight&&(d.valign=="middle"&&d.align!="center"&&d.layout!="x"?k=(this._obj.offsetHeight-f)/2:d.valign=="bottom"&&(k=this._obj.offsetHeight-f),d.margin&&d.valign!="middle"&&(k+=(d.valign=="top"?1:-1)*d.margin));e.style.left=j+"px";e.style.top=k+"px";a.save();for(c=0;c<g.length;c++){var m=g[c],l=d.values?d.values[c].color:this._settings.color.call(this,b[c]);this._drawLegendMarker(a,m.offsetLeft+
j,m.offsetTop+k,l,m.offsetHeight)}a.restore();g=null},_drawLegendText:function(a,b){var c="";this._settings.legend.layout=="x"&&(c="float:left;");var d=dhtmlx.html.create("DIV",{style:c+"padding-left:"+(10+this._settings.legend.marker.width)+"px","class":"dhx_chart_legend_item"},b);a.appendChild(d);return d},_drawLegendMarker:function(a,b,c,d,e){var f=this._settings.legend.marker;a.strokeStyle=a.fillStyle=d;a.beginPath();if(f.type=="round"||!f.radius){a.lineWidth=f.height;a.lineCap=f.type;b+=a.lineWidth/
2+5;c+=e/2;a.moveTo(b,c);var g=b+f.width-f.height+1;a.lineTo(g,c)}else{a.lineWidth=1;var h,i;b+=5;c+=e/2-f.height/2;h=b+f.width/2;i=c+f.height/2;a.arc(b+f.radius,c+f.radius,f.radius,Math.PI,3*Math.PI/2,!1);a.lineTo(b+f.width-f.radius,c);a.arc(b+f.width-f.radius,c+f.radius,f.radius,-Math.PI/2,0,!1);a.lineTo(b+f.width,c+f.height-f.radius);a.arc(b+f.width-f.radius,c+f.height-f.radius,f.radius,0,Math.PI/2,!1);a.lineTo(b+f.radius,c+f.height);a.arc(b+f.radius,c+f.height-f.radius,f.radius,Math.PI/2,Math.PI,
!1);a.lineTo(b,c+f.radius)}a.stroke();a.fill()},_getChartBounds:function(a,b){var c,d,e,f;c=this._settings.padding.left;d=this._settings.padding.top;e=a-this._settings.padding.right;f=b-this._settings.padding.bottom;if(this._settings.legend){var g=this._settings.legend,h=this._settings.legend.width,i=this._settings.legend.height;g.layout=="x"?g.valign=="center"?g.align=="right"?e-=h:g.align=="left"&&(c+=h):g.valign=="bottom"?f-=i:d+=i:g.align=="right"?e-=h:g.align=="left"&&(c+=h)}return{start:{x:c,
y:d},end:{x:e,y:f}}},_getStackedLimits:function(a){var b,c,d,e,f;if(this._settings.yAxis&&typeof this._settings.yAxis.end!="undefined"&&typeof this._settings.yAxis.start!="undefined"&&this._settings.yAxis.step)d=parseFloat(this._settings.yAxis.end),e=parseFloat(this._settings.yAxis.start);else{for(b=0;b<a.length;b++){a[b].$sum=0;a[b].$min=Infinity;for(c=0;c<this._series.length;c++)if(f=parseFloat(this._series[c].value(a[b])||0),!isNaN(f)&&(a[b].$sum+=f,f<a[b].$min))a[b].$min=f}d=-Infinity;e=Infinity;
for(b=0;b<a.length;b++){if(a[b].$sum>d)d=a[b].$sum;if(a[b].$min<e)e=a[b].$min}e>0&&(e=0)}return{max:d,min:e}},_setBarGradient:function(a,b,c,d,e,f,g,h){var i,j,k,m,l;f=="light"?(i=h=="x"?a.createLinearGradient(b,c,d,c):a.createLinearGradient(b,c,b,e),i.addColorStop(0,"#FFFFFF"),i.addColorStop(0.9,g),i.addColorStop(1,g),j=2):f=="falling"||f=="rising"?(i=h=="x"?a.createLinearGradient(b,c,d,c):a.createLinearGradient(b,c,b,e),k=dhtmlx.math.toRgb(g),m=dhtmlx.math.rgbToHsv(k[0],k[1],k[2]),m[1]*=0.5,l="rgb("+
dhtmlx.math.hsvToRgb(m[0],m[1],m[2])+")",f=="falling"?(i.addColorStop(0,l),i.addColorStop(0.7,g),i.addColorStop(1,g)):f=="rising"&&(i.addColorStop(0,g),i.addColorStop(0.3,g),i.addColorStop(1,l)),j=0):(a.globalAlpha=0.37,j=0,i=h=="x"?a.createLinearGradient(b,e,b,c):a.createLinearGradient(b,c,d,c),i.addColorStop(0,"#9d9d9d"),i.addColorStop(0.3,"#e8e8e8"),i.addColorStop(0.45,"#ffffff"),i.addColorStop(0.55,"#ffffff"),i.addColorStop(0.7,"#e8e8e8"),i.addColorStop(1,"#9d9d9d"));return{gradient:i,offset:j}},
_getPositionByAngle:function(a,b,c,d){a*=-1;b+=Math.cos(a)*d;c-=Math.sin(a)*d;return{x:b,y:c}}};dhtmlx.compat("layout");window.dhtmlx||(dhtmlx={});dhtmlx.version="3.0";dhtmlx.codebase="./";dhtmlx.copy=function(a){var b=dhtmlx.copy._function;b.prototype=a;return new b};dhtmlx.copy._function=function(){};dhtmlx.extend=function(a,b){for(var c in b)a[c]=b[c];b._init&&a._init();return a};
dhtmlx.proto_extend=function(){for(var a=arguments,b=a[0],c=[],d=a.length-1;d>0;d--){if(typeof a[d]=="function")a[d]=a[d].prototype;for(var e in a[d])e=="_init"?c.push(a[d][e]):b[e]||(b[e]=a[d][e])}a[0]._init&&c.push(a[0]._init);b._init=function(){for(var a=0;a<c.length;a++)c[a].apply(this,arguments)};b.base=a[1];var f=function(a){this._init(a);this._parseSettings&&this._parseSettings(a,this.defaults)};f.prototype=b;b=a=null;return f};dhtmlx.bind=function(a,b){return function(){return a.apply(b,arguments)}};
dhtmlx.require=function(a){dhtmlx._modules[a]||(dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase+a).responseText),dhtmlx._modules[a]=!0)};dhtmlx._modules={};dhtmlx.exec=function(a){window.execScript?window.execScript(a):window.eval(a)};dhtmlx.methodPush=function(a,b){return function(){var c=!1;return c=a[b].apply(a,arguments)}};dhtmlx.isNotDefined=function(a){return typeof a=="undefined"};dhtmlx.delay=function(a,b,c,d){setTimeout(function(){var d=a.apply(b,c);a=b=c=null;return d},d||1)};
dhtmlx.uid=function(){if(!this._seed)this._seed=(new Date).valueOf();this._seed++;return this._seed};dhtmlx.toNode=function(a){return typeof a=="string"?document.getElementById(a):a};dhtmlx.toArray=function(a){return dhtmlx.extend(a||[],dhtmlx.PowerArray)};dhtmlx.toFunctor=function(a){return typeof a=="string"?eval(a):a};dhtmlx._events={};
dhtmlx.event=function(a,b,c,d){var a=dhtmlx.toNode(a),e=dhtmlx.uid();dhtmlx._events[e]=[a,b,c];d&&(c=dhtmlx.bind(c,d));a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c);return e};dhtmlx.eventRemove=function(a){if(a){var b=dhtmlx._events[a];b[0].removeEventListener?b[0].removeEventListener(b[1],b[2],!1):b[0].detachEvent&&b[0].detachEvent("on"+b[1],b[2]);delete this._events[a]}};
dhtmlx.EventSystem={_init:function(){this._events={};this._handlers={};this._map={}},block:function(){this._events._block=!0},unblock:function(){this._events._block=!1},mapEvent:function(a){dhtmlx.extend(this._map,a)},callEvent:function(a,b){if(this._events._block)return!0;var a=a.toLowerCase(),c=this._events[a.toLowerCase()],d=!0;if(c)for(var e=0;e<c.length;e++)if(c[e].apply(this,b||[])===!1)d=!1;this._map[a]&&!this._map[a].callEvent(a,b)&&(d=!1);return d},attachEvent:function(a,b,c){var a=a.toLowerCase(),
c=c||dhtmlx.uid(),b=dhtmlx.toFunctor(b),d=this._events[a]||dhtmlx.toArray();d.push(b);this._events[a]=d;this._handlers[c]={f:b,t:a};return c},detachEvent:function(a){if(this._handlers[a]){var b=this._handlers[a].t,c=this._handlers[a].f,d=this._events[b];d.remove(c);delete this._handlers[a]}}};
dhtmlx.PowerArray={removeAt:function(a,b){a>=0&&this.splice(a,b||1)},remove:function(a){this.removeAt(this.find(a))},insertAt:function(a,b){if(!b&&b!==0)this.push(a);else{var c=this.splice(b,this.length-b);this[b]=a;this.push.apply(this,c)}},find:function(a){for(i=0;i<this.length;i++)if(a==this[i])return i;return-1},each:function(a,b){for(var c=0;c<this.length;c++)a.call(b||this,this[c])},map:function(a,b){for(var c=0;c<this.length;c++)this[c]=a.call(b||this,this[c]);return this}};dhtmlx.env={};
if(navigator.userAgent.indexOf("Opera")!=-1)dhtmlx._isOpera=!0;else{dhtmlx._isIE=!!document.all;dhtmlx._isFF=!document.all;dhtmlx._isWebKit=navigator.userAgent.indexOf("KHTML")!=-1;if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat")dhtmlx._isIE=8;if(navigator.appVersion.indexOf("MSIE 9.0")!=-1&&document.compatMode!="BackCompat")dhtmlx._isIE=9}dhtmlx.env={};
(function(){dhtmlx.env.transform=!1;dhtmlx.env.transition=!1;for(var a={names:["transform","transition"],transform:["transform","WebkitTransform","MozTransform","oTransform","msTransform"],transition:["transition","WebkitTransition","MozTransition","oTransition"]},b=document.createElement("DIV"),c,d=0;d<a.names.length;d++)for(;p=a[a.names[d]].pop();)typeof b.style[p]!="undefined"&&(dhtmlx.env[a.names[d]]=!0)})();
dhtmlx.env.transform_prefix=function(){var a;dhtmlx._isOpera?a="-o-":(a="",dhtmlx._isFF&&(a="-moz-"),dhtmlx._isWebKit&&(a="-webkit-"));return a}();dhtmlx.env.svg=function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}();dhtmlx.zIndex={drag:1E4};
dhtmlx.html={create:function(a,b,c){var b=b||{},d=document.createElement(a),e;for(e in b)d.setAttribute(e,b[e]);if(b.style)d.style.cssText=b.style;if(b["class"])d.className=b["class"];if(c)d.innerHTML=c;return d},getValue:function(a){a=dhtmlx.toNode(a);return!a?"":dhtmlx.isNotDefined(a.value)?a.innerHTML:a.value},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else a&&a.parentNode&&a.parentNode.removeChild(a)},insertBefore:function(a,b,c){a&&(b?b.parentNode.insertBefore(a,
b):c.appendChild(a))},locate:function(a,b){for(var a=a||event,c=a.target||a.srcElement;c;){if(c.getAttribute){var d=c.getAttribute(b);if(d)return d}c=c.parentNode}return null},offset:function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{y:Math.round(i),
x:Math.round(j)}}else{for(j=i=0;a;)i+=parseInt(a.offsetTop,10),j+=parseInt(a.offsetLeft,10),a=a.offsetParent;return{y:i,x:j}}},pos:function(a){a=a||event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};var b=dhtmlx._isIE&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:a.clientX+b.scrollLeft-b.clientLeft,y:a.clientY+b.scrollTop-b.clientTop}},preventEvent:function(a){a&&a.preventDefault&&a.preventDefault();dhtmlx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=
!0;return!1},addCss:function(a,b){a.className+=" "+b},removeCss:function(a,b){a.className=a.className.replace(RegExp(b,"g"),"")}};(function(){var a=document.getElementsByTagName("SCRIPT");if(a.length)a=(a[a.length-1].getAttribute("src")||"").split("/"),a.splice(a.length-1,1),dhtmlx.codebase=a.slice(0,a.length).join("/")+"/"})();if(!dhtmlx.ui)dhtmlx.ui={};
dhtmlx.Template={_cache:{},empty:function(){return""},setter:function(a){return dhtmlx.Template.fromHTML(a)},obj_setter:function(a){var b=dhtmlx.Template.setter(a),c=this;return function(){return b.apply(c,arguments)}},fromHTML:function(a){if(typeof a=="function")return a;if(this._cache[a])return this._cache[a];a=(a||"").toString();a=a.replace(/[\r\n]+/g,"\\n");a=a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');a=a.replace(/\{common\.([^}\(]*)\}/g,'"+common.$1+"');a=a.replace(/\{common\.([^\}\(]*)\(\)\}/g,
'"+(common.$1?common.$1(obj):"")+"');a=a.replace(/\{obj\.([^}]*)\}/g,'"+obj.$1+"');a=a.replace(/#([a-z0-9_]+)#/gi,'"+obj.$1+"');a=a.replace(/\{obj\}/g,'"+obj+"');a=a.replace(/\{-obj/g,"{obj");a=a.replace(/\{-common/g,"{common");a='return "'+a+'";';return this._cache[a]=Function("obj","common",a)}};
dhtmlx.Type={add:function(a,b){if(!a.types&&a.prototype.types)a=a.prototype;var c=b.name||"default";this._template(b);this._template(b,"edit");this._template(b,"loading");a.types[c]=dhtmlx.extend(dhtmlx.extend({},a.types[c]||this._default),b);return c},_default:{css:"default",template:function(){return""},template_edit:function(){return""},template_loading:function(){return"..."},width:150,height:80,margin:5,padding:0},_template:function(a,b){var b="template"+(b?"_"+b:""),c=a[b];if(c&&typeof c=="string"){if(c.indexOf("->")!=
-1)switch(c=c.split("->"),c[0]){case "html":c=dhtmlx.html.getValue(c[1]).replace(/\"/g,'\\"');break;case "http":c=(new dhtmlx.ajax).sync().get(c[1],{uid:(new Date).valueOf()}).responseText}a[b]=dhtmlx.Template.fromHTML(c)}}};
dhtmlx.Settings={_init:function(){this._settings=this.config={}},define:function(a,b){return typeof a=="object"?this._parseSeetingColl(a):this._define(a,b)},_define:function(a,b){var c=this[a+"_setter"];return this._settings[a]=c?c.call(this,b):b},_parseSeetingColl:function(a){if(a)for(var b in a)this._define(b,a[b])},_parseSettings:function(a,b){var c=dhtmlx.extend({},b);typeof a=="object"&&!a.tagName&&dhtmlx.extend(c,a);this._parseSeetingColl(c)},_mergeSettings:function(a,b){for(var c in b)switch(typeof a[c]){case "object":a[c]=
this._mergeSettings(a[c]||{},b[c]);break;case "undefined":a[c]=b[c]}return a},_parseContainer:function(a,b,c){if(typeof a=="object"&&!a.tagName)a=a.container;this._obj=dhtmlx.toNode(a);if(!this._obj&&c)this._obj=c(a);this._obj.className+=" "+b;this._obj.onselectstart=function(){return!1};this._dataobj=this._obj},_set_type:function(a){if(typeof a=="object")return this.type_setter(a);this.type=dhtmlx.extend({},this.types[a]);this.customize()},customize:function(a){a&&dhtmlx.extend(this.type,a);this.type._item_start=
dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type._item_end=this.template_item_end(this.type);this.render()},type_setter:function(a){this._set_type(typeof a=="object"?dhtmlx.Type.add(this,a):a);return a},template_setter:function(a){return this.type_setter({template:a})},css_setter:function(a){this._obj.className+=" "+a;return a}};
dhtmlx.Destruction={_init:function(){dhtmlx.destructors.push(this)},destructor:function(){this.destructor=function(){};this._htmlrows=this._htmlmap=null;this._html&&document.body.appendChild(this._html);this._html=null;if(this._obj)this._obj.innerHTML="",this._obj._htmlmap=null;this.data=this._obj=this._dataobj=null;this._events=this._handlers={}}};dhtmlx.destructors=[];
dhtmlx.event(window,"unload",function(){for(var a=0;a<dhtmlx.destructors.length;a++)dhtmlx.destructors[a].destructor();dhtmlx.destructors=[];for(var b in dhtmlx._events){var c=dhtmlx._events[b];c[0].removeEventListener?c[0].removeEventListener(c[1],c[2],!1):c[0].detachEvent&&c[0].detachEvent("on"+c[1],c[2]);delete dhtmlx._events[b]}});
dhtmlx.ui.pager=function(a){this.name="Pager";dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this._parseSettings(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this._settings;this.refresh()};
dhtmlx.ui.pager.prototype={_id:"dhx_p_id",on_click:{dhx_pager_item:function(a,b){this.select(b)}},select:function(a){switch(a){case "next":a=this._settings.page+1;break;case "prev":a=this._settings.page-1;break;case "first":a=0;break;case "last":a=this._settings.limit-1}a<0&&(a=0);a>=this.data.limit&&(a=this.data.limit-1);if(this.callEvent("onBeforePageChange",[this._settings.page,a]))this.data.page=a*1,this.refresh(),this.callEvent("onAfterPageChange",[a])},types:{"default":{template:dhtmlx.Template.fromHTML("{common.pages()}"),
pages:function(a){var b="";if(a.page==-1)return"";a.min=a.page-Math.round((a.group-1)/2);a.max=a.min+a.group-1;if(a.min<0)a.max+=a.min*-1,a.min=0;if(a.max>=a.limit)a.min-=Math.min(a.min,a.max-a.limit+1),a.max=a.limit-1;for(var c=a.min||0;c<=a.max;c++)b+=this.button({id:c,index:c+1,selected:c==a.page?"_selected":""});return b},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" &lt;&lt; ",selected:""})},last:function(){return this.button({id:"last",index:" &gt;&gt; ",
selected:""})},prev:function(){return this.button({id:"prev",index:"&lt;",selected:""})},next:function(){return this.button({id:"next",index:"&gt;",selected:""})},button:dhtmlx.Template.fromHTML("<div dhx_p_id='{obj.id}' class='dhx_pager_item{obj.selected}'>{obj.index}</div>")}},refresh:function(){var a=this._settings;a.limit=Math.ceil(a.count/a.size);if(a.limit&&a.limit!=a.old_limit)a.page=Math.min(a.limit-1,a.page);var b=a.page;if(b!=-1&&b!=a.old_page||a.limit!=a.old_limit)this.render(),this.callEvent("onRefresh",
[]),a.old_limit=a.limit,a.old_page=a.page},template_item_start:dhtmlx.Template.fromHTML("<div>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.SingleRender={_init:function(){},_toHTML:function(a){return this.type._item_start(a,this.type)+this.type.template(a,this.type)+this.type._item_end},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data)this._dataobj.innerHTML=this._toHTML(this.data);this.callEvent&&this.callEvent("onAfterRender",[])}}};
dhtmlx.ui.Tooltip=function(a){this.name="Tooltip";this.version="3.0";typeof a=="string"&&(a={template:a});dhtmlx.extend(this,dhtmlx.Settings);dhtmlx.extend(this,dhtmlx.SingleRender);this._parseSettings(a,{type:"default",dy:0,dx:20});this._dataobj=this._obj=document.createElement("DIV");this._obj.className="dhx_tooltip";dhtmlx.html.insertBefore(this._obj,document.body.firstChild)};
dhtmlx.ui.Tooltip.prototype={show:function(a,b){if(!this._disabled){if(this.data!=a)this.data=a,this.render(a);this._obj.style.top=b.y+this._settings.dy+"px";this._obj.style.left=b.x+this._settings.dx+"px";this._obj.style.display="block"}},hide:function(){this.data=null;this._obj.style.display="none"},disable:function(){this._disabled=!0},enable:function(){this._disabled=!1},types:{"default":dhtmlx.Template.fromHTML("{obj.id}")},template_item_start:dhtmlx.Template.empty,template_item_end:dhtmlx.Template.empty};
dhtmlx.AutoTooltip={tooltip_setter:function(a){var b=new dhtmlx.ui.Tooltip(a);this.attachEvent("onMouseMove",function(a,d){b.show(this.get(a),dhtmlx.html.pos(d))});this.attachEvent("onMouseOut",function(){b.hide()});this.attachEvent("onMouseMoving",function(){b.hide()});return b}};dhtmlx.compat=function(a,b){if(dhtmlx.compat[a])dhtmlx.compat[a](b)};
(function(){if(!window.dhtmlxError){var a=function(){};window.dhtmlxError={catchError:a,throwError:a};window.convertStringToBoolean=function(a){return!!a};window.dhtmlxEventable=function(a){dhtmlx.extend(a,dhtmlx.EventSystem)};var b={getXMLTopNode:function(){},doXPath:function(a){return dhtmlx.DataDriver.xml.xpath(this.xml,a)},xmlDoc:{responseXML:!0}};dhtmlx.compat.dataProcessor=function(a){var d="_sendData",e="_in_progress",f="_tMode",g="_waitMode";a[d]=function(a,c){if(a){c&&(this[e][c]=(new Date).valueOf());
if(!this.callEvent("onBeforeDataSending",c?[c,this.getState(c)]:[]))return!1;var d=this,k=this.serverProcessor;this[f]!="POST"?dhtmlx.ajax().get(k+(k.indexOf("?")!=-1?"&":"?")+this.serialize(a,c),"",function(a,c){b.xml=dhtmlx.DataDriver.xml.checkResponse(a,c);d.afterUpdate(d,null,null,null,b)}):dhtmlx.ajax().post(k,this.serialize(a,c),function(a,c){b.xml=dhtmlx.DataDriver.xml.checkResponse(a,c);d.afterUpdate(d,null,null,null,b)});this[g]++}}}}})();
dhtmlx.DataProcessor={_dp_init:function(a){var b="_methods";a[b]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(b){a.setUpdated(b,!0,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(a,b){a.getUserData&&a.getUserData(b,this._userdata)},this));this.attachEvent("onBeforeDelete",function(b){var d=a.getState(b);if(d=="inserted")return a.setUpdated(b,!1),!0;if(d=="deleted")return!1;if(d=="true_deleted")return!0;a.setUpdated(b,!0,"deleted");return!1});
this.attachEvent("onAfterEditStop",function(b){a.setUpdated(b,!0,"updated")});this.attachEvent("onBindUpdate",function(b){window.setTimeout(function(){a.setUpdated(b.id,!0,"updated")},1)});b="_getRowData";a[b]=function(a){var b=this.obj.data.get(a),e={},f;for(f in b)f.indexOf("_")!==0&&(e[f]=b[f]);return e};b="_clearUpdateFlag";a[b]=function(){};this._userdata={};a.attachEvent("insertCallback",this._dp_callback);a.attachEvent("updateCallback",this._dp_callback);a.attachEvent("deleteCallback",function(a,
b){this.obj.setUserData(b,this.action_param,"true_deleted");this.obj.remove(b)});dhtmlx.compat("dataProcessor",a)},_dp_callback:function(a,b){this.obj.data.set(b,dhtmlx.DataDriver.xml.getDetails(a.firstChild));this.obj.data.refresh(b)},setItemStyle:function(a,b){var c=this._locateHTML(a);c&&(c.style.cssText+=";"+b)},changeId:function(a,b){this.data.changeId(a,b);this.refresh()},setUserData:function(a,b,c){a?this.data.get(a)[b]=c:this._userdata[b]=c},getUserData:function(a,b){return a?this.data.get(a)[b]:
this._userdata[b]}};(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor._dp_init})();
dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var a="_dragged",b=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(a,c,d){b.apply(this,arguments);if(!d){var e=dhtmlx.DragControl._drag_context=dhtmlx.DragControl._drag_context||{};if(!e.from)e.from=this.dragStartObject;dhtmlx.DragControl._checkLand(a,c,!0)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(a,b,e){if(!e&&dhtmlx.DragControl._last)dhtmlx.DragControl._active=
d.dragStartNode,dhtmlx.DragControl._stopDrag(a,!0);c.apply(this,arguments)};var d=new dhtmlDragAndDropObject,e=dhtmlx.DragControl._startDrag;dhtmlx.DragControl._startDrag=function(){e.apply(this,arguments);var b=dhtmlx.DragControl._drag_context;if(b){for(var c=[],f=[],g=0;g<b.source.length;g++)c[g]={idd:b.source[g]},f.push(b.source[g]);d.dragStartNode={parentNode:{},parentObject:{idd:c,id:f.length==1?f[0]:f,treeNod:{object:b.from}}};d.dragStartNode.parentObject.treeNod[a]=c;d.dragStartObject=b.from}};
var f=dhtmlx.DragControl._checkLand;dhtmlx.DragControl._checkLand=function(a,b,c){f.apply(this,arguments);!this._last&&!c&&(a=d.checkLanding(a,b,!0))};var g=dhtmlx.DragControl._stopDrag;dhtmlx.DragControl._stopDrag=function(a,b){g.apply(this,arguments);d.lastLanding&&!b&&d.stopDrag(a,!1,!0)};var h=dhtmlx.DragControl.getMaster;dhtmlx.DragControl.getMaster=function(b){var c=null;b&&(c=h.apply(this,arguments));if(!c){for(var c=d.dragStartObject,e=[],f=c[a],g=0;g<f.length;g++)e.push(f[g].idd||f[g].id);
dhtmlx.DragControl._drag_context.source=e}return c}}};
dhtmlx.DataMove={_init:function(){},copy:function(a,b,c,d){var e=this.get(a);if(e)return c&&(e=c.externalData(e)),c=c||this,c.add(c.externalData(e,d),b)},move:function(a,b,c,d){if(a instanceof Array)for(var e=0;e<a.length;e++){var f=(c||this).indexById(this.move(a[e],b,c,dhtmlx.uid()));a[e+1]&&(b=f+(this.indexById(a[e+1])<f?0:1))}else if(nid=a,!(b<0)){var g=this.get(a);if(g)return!c||c==this?this.data.move(this.indexById(a),b):(nid=c.add(c.externalData(g,d),b),this.remove(a)),nid}},moveUp:function(a,
b){return this.move(a,this.indexById(a)-(b||1))},moveDown:function(a,b){return this.moveUp(a,(b||1)*-1)},moveTop:function(a){return this.move(a,0)},moveBottom:function(a){return this.move(a,this.data.dataCount()-1)},externalData:function(a,b){var c=dhtmlx.extend({},a);c.id=b||dhtmlx.uid();c.$selected=c.$template=null;return c}};
dhtmlx.DragControl={_drag_masters:dhtmlx.toArray(["dummy"]),addDrop:function(a,b,c){a=dhtmlx.toNode(a);a.dhx_drop=this._getCtrl(b);if(c)a.dhx_master=!0},_getCtrl:function(a){var a=a||dhtmlx.DragControl,b=this._drag_masters.find(a);if(b<0)b=this._drag_masters.length,this._drag_masters.push(a);return b},addDrag:function(a,b){a=dhtmlx.toNode(a);a.dhx_drag=this._getCtrl(b);dhtmlx.event(a,"mousedown",this._preStart,a)},_preStart:function(a){dhtmlx.DragControl._active&&(dhtmlx.DragControl._preStartFalse(),
dhtmlx.DragControl.destroyDrag());dhtmlx.DragControl._active=this;dhtmlx.DragControl._start_pos={x:a.pageX,y:a.pageY};dhtmlx.DragControl._dhx_drag_mm=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl._startDrag);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl._preStartFalse);dhtmlx.DragControl._dhx_drag_sc=dhtmlx.event(this,"scroll",dhtmlx.DragControl._preStartFalse);a.cancelBubble=!0;return!1},_preStartFalse:function(){dhtmlx.DragControl._dhx_drag_mm=
dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mm);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mu);dhtmlx.DragControl._dhx_drag_sc=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_sc)},_startDrag:function(a){var b={x:a.pageX,y:a.pageY};if(!(Math.abs(b.x-dhtmlx.DragControl._start_pos.x)<5&&Math.abs(b.y-dhtmlx.DragControl._start_pos.y)<5)&&(dhtmlx.DragControl._preStartFalse(),dhtmlx.DragControl.createDrag(a)))dhtmlx.DragControl.sendSignal("start"),dhtmlx.DragControl._dhx_drag_mm=
dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl._moveDrag),dhtmlx.DragControl._dhx_drag_mu=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl._stopDrag),dhtmlx.DragControl._moveDrag(a)},_stopDrag:function(a){dhtmlx.DragControl._dhx_drag_mm=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mm);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mu);dhtmlx.DragControl._last&&(dhtmlx.DragControl.onDrop(dhtmlx.DragControl._active,dhtmlx.DragControl._last,this._landing,
a),dhtmlx.DragControl.onDragOut(dhtmlx.DragControl._active,dhtmlx.DragControl._last,null,a));dhtmlx.DragControl.destroyDrag();dhtmlx.DragControl.sendSignal("stop")},_moveDrag:function(a){var b=dhtmlx.html.pos(a);dhtmlx.DragControl._html.style.top=b.y+dhtmlx.DragControl.top+"px";dhtmlx.DragControl._html.style.left=b.x+dhtmlx.DragControl.left+"px";dhtmlx.DragControl._skip?dhtmlx.DragControl._skip=!1:dhtmlx.DragControl._checkLand(a.srcElement||a.target,a);a.cancelBubble=!0;return!1},_checkLand:function(a,
b){for(;a&&a.tagName!="BODY";){if(a.dhx_drop){if(this._last&&(this._last!=a||a.dhx_master))this.onDragOut(this._active,this._last,a,b);if(!this._last||this._last!=a||a.dhx_master)if(this._last=null,this._landing=this.onDragIn(dhtmlx.DragControl._active,a,b))this._last=a;return}a=a.parentNode}if(this._last)this._last=this._landing=this.onDragOut(this._active,this._last,null,b)},sendSignal:function(a){dhtmlx.DragControl.active=a=="start"},getMaster:function(a){return this._drag_masters[a.dhx_drag||
a.dhx_drop]},getContext:function(){return this._drag_context},createDrag:function(a){var b=dhtmlx.DragControl._active,c=this._drag_masters[b.dhx_drag],d;if(c.onDragCreate)d=c.onDragCreate(b,a),d.style.position="absolute",d.style.zIndex=dhtmlx.zIndex.drag,d.onmousemove=dhtmlx.DragControl._skip_mark;else{var e=dhtmlx.DragControl.onDrag(b,a);if(!e)return!1;d=document.createElement("DIV");d.innerHTML=e;d.className="dhx_drag_zone";d.onmousemove=dhtmlx.DragControl._skip_mark;document.body.appendChild(d)}dhtmlx.DragControl._html=
d;return!0},_skip_mark:function(){dhtmlx.DragControl._skip=!0},destroyDrag:function(){var a=dhtmlx.DragControl._active,b=this._drag_masters[a.dhx_drag];if(b&&b.onDragDestroy)b.onDragDestroy(a,dhtmlx.DragControl._html);else dhtmlx.html.remove(dhtmlx.DragControl._html);dhtmlx.DragControl._landing=dhtmlx.DragControl._active=dhtmlx.DragControl._last=dhtmlx.DragControl._html=null},top:5,left:5,onDragIn:function(a,b,c){var d=this._drag_masters[b.dhx_drop];if(d.onDragIn&&d!=this)return d.onDragIn(a,b,c);
b.className+=" dhx_drop_zone";return b},onDragOut:function(a,b,c,d){var e=this._drag_masters[b.dhx_drop];if(e.onDragOut&&e!=this)return e.onDragOut(a,b,c,d);b.className=b.className.replace("dhx_drop_zone","");return null},onDrop:function(a,b,c,d){var e=this._drag_masters[b.dhx_drop];dhtmlx.DragControl._drag_context.from=dhtmlx.DragControl.getMaster(a);if(e.onDrop&&e!=this)return e.onDrop(a,b,c,d);b.appendChild(a)},onDrag:function(a,b){var c=this._drag_masters[a.dhx_drag];if(c.onDrag&&c!=this)return c.onDrag(a,
b);dhtmlx.DragControl._drag_context={source:a,from:a};return"<div style='"+a.style.cssText+"'>"+a.innerHTML+"</div>"}};
dhtmlx.DragItem={_init:function(){if(!this._settings||this._settings.drag)dhtmlx.DragItem._initHandlers(this);else if(this._settings)this.drag_setter=function(a){a&&(this._initHandlers(this),delete this.drag_setter);return a};this.dragMarker&&(this.attachEvent("onBeforeDragIn",this.dragMarker),this.attachEvent("onDragOut",this.dragMarker))},_initHandlers:function(a){dhtmlx.DragControl.addDrop(a._obj,a,!0);dhtmlx.DragControl.addDrag(a._obj,a)},onDragIn:function(a,b,c){var d=this.locate(c)||null,e=
dhtmlx.DragControl._drag_context,f=dhtmlx.DragControl.getMaster(a),g=this._locateHTML(d)||this._obj;if(g==dhtmlx.DragControl._landing)return g;e.target=d;e.to=f;if(!this.callEvent("onBeforeDragIn",[e,c]))return e.id=null;dhtmlx.html.addCss(g,"dhx_drag_over");return g},onDragOut:function(a,b,c,d){var e=this.locate(d)||null;c!=this._dataobj&&(e=null);var f=this._locateHTML(e)||(c?dhtmlx.DragControl.getMaster(c)._obj:window.undefined);if(f==dhtmlx.DragControl._landing)return null;var g=dhtmlx.DragControl._drag_context;
dhtmlx.html.removeCss(dhtmlx.DragControl._landing,"dhx_drag_over");g.target=g.to=null;this.callEvent("onDragOut",[g,d]);return null},onDrop:function(a,b,c,d){var e=dhtmlx.DragControl._drag_context;e.to=this;e.index=e.target?this.indexById(e.target):this.dataCount();e.new_id=dhtmlx.uid();this.callEvent("onBeforeDrop",[e,d])&&(e.from==e.to?this.move(e.source,e.index):e.from&&e.from.move(e.source,e.index,e.to,e.new_id),this.callEvent("onAfterDrop",[e,d]))},onDrag:function(a,b){var c=this.locate(b),d=
[c];if(c){if(this.getSelected){var e=this.getSelected();dhtmlx.PowerArray.find.call(e,c)!=-1&&(d=e)}var f=dhtmlx.DragControl._drag_context={source:d,start:c};f.from=this;if(this.callEvent("onBeforeDrag",[f,b]))return f.html||this._toHTML(this.get(c))}return null}};
dhtmlx.EditAbility={_init:function(){this._edit_bind=this._edit_id=null;this.attachEvent("onEditKeyPress",function(a,b,c){a==13&&!c?this.stopEdit():a==27&&this.stopEdit(!0)});this.attachEvent("onBeforeRender",function(){this.stopEdit()})},isEdit:function(){return this._edit_id},edit:function(a){if(this.stopEdit(!1,a)&&this.callEvent("onBeforeEditStart",[a])){var b=this.data.get(a);if(!b.$template)b.$template="edit",this.data.refresh(a),this._edit_id=a,this._save_binding(a),this._edit_bind(!0,b),this.callEvent("onAfterEditStart",
[a])}},stopEdit:function(a,b){if(!this._edit_id)return!0;if(this._edit_id==b)return!1;var c={};a?c=null:this._edit_bind(!1,c);if(!this.callEvent("onBeforeEditStop",[this._edit_id,c]))return!1;var d=this.data.get(this._edit_id);d.$template=null;a||this._edit_bind(!1,d);var e=this._edit_id;this._edit_bind=this._edit_id=null;this.data.refresh(e);this.callEvent("onAfterEditStop",[e,c]);return!0},_save_binding:function(a){var b=this._locateHTML(a),c="",d="",e=[];if(b){for(var f=b.getElementsByTagName("*"),
g="",h=0;h<f.length;h++)if(f[h].nodeType==1&&(g=f[h].getAttribute("bind")))c+="els["+e.length+"].value="+g+";",d+=g+"=els["+e.length+"].value;",e.push(f[h]),f[h].className+=" dhx_allow_selection",f[h].onselectstart=this._block_native;f=null}c=Function("obj","els",c);d=Function("obj","els",d);this._edit_bind=function(a,b){a?(c(b,e),e.length&&e[0].select&&e[0].select()):d(b,e)}},_block_native:function(a){return(a||event).cancelBubble=!0}};
dhtmlx.KeyEvents={_init:function(){dhtmlx.event(this._obj,"keypress",this._onKeyPress,this)},_onKeyPress:function(a){var a=a||event,b=a.which||a.keyCode;this.callEvent(this._edit_id?"onEditKeyPress":"onKeyPress",[b,a.ctrlKey,a.shiftKey,a])}};
dhtmlx.MouseEvents={_init:function(){this.on_click&&(dhtmlx.event(this._obj,"click",this._onClick,this),dhtmlx.event(this._obj,"contextmenu",this._onContext,this));this.on_dblclick&&dhtmlx.event(this._obj,"dblclick",this._onDblClick,this);this.on_mouse_move&&(dhtmlx.event(this._obj,"mousemove",this._onMouse,this),dhtmlx.event(this._obj,dhtmlx._isIE?"mouseleave":"mouseout",this._onMouse,this))},_onClick:function(a){return this._mouseEvent(a,this.on_click,"ItemClick")},_onDblClick:function(a){return this._mouseEvent(a,
this.on_dblclick,"ItemDblClick")},_onContext:function(a){var b=dhtmlx.html.locate(a,this._id);if(b&&!this.callEvent("onBeforeContextMenu",[b,a]))return dhtmlx.html.preventEvent(a)},_onMouse:function(a){dhtmlx._isIE&&(a=document.createEventObject(event));this._mouse_move_timer&&window.clearTimeout(this._mouse_move_timer);this.callEvent("onMouseMoving",[a]);this._mouse_move_timer=window.setTimeout(dhtmlx.bind(function(){a.type=="mousemove"?this._onMouseMove(a):this._onMouseOut(a)},this),500)},_onMouseMove:function(a){this._mouseEvent(a,
this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[a||event])},_onMouseOut:function(a){this.callEvent("onMouseOut",[a||event])},_mouseEvent:function(a,b,c){for(var a=a||event,d=a.target||a.srcElement,e="",f=null,g=!1;d&&d.parentNode;){if(!g&&d.getAttribute&&(f=d.getAttribute(this._id))){d.getAttribute("userdata")&&this.callEvent("onLocateData",[f,d]);if(!this.callEvent("on"+c,[f,a,d]))return;g=!0}if(e=d.className)if(e=e.split(" "),e=e[0]||e[1],b[e])return b[e].call(this,a,f||dhx.html.locate(a,
this._id),d);d=d.parentNode}return g}};
dhtmlx.SelectionModel={_init:function(){this._selected=dhtmlx.toArray();this.data.attachEvent("onStoreUpdated",dhtmlx.bind(this._data_updated,this));this.data.attachEvent("onStoreLoad",dhtmlx.bind(this._data_loaded,this));this.data.attachEvent("onAfterFilter",dhtmlx.bind(this._data_filtered,this));this.data.attachEvent("onIdChange",dhtmlx.bind(this._id_changed,this))},_id_changed:function(a,b){for(var c=this._selected.length-1;c>=0;c--)this._selected[c]==a&&(this._selected[c]=b)},_data_filtered:function(){for(var a=
this._selected.length-1;a>=0;a--){if(this.data.indexById(this._selected[a])<0)var b=this._selected[a];var c=this.item(b);c&&delete c.$selected;this._selected.splice(a,1);this.callEvent("onSelectChange",[b])}},_data_updated:function(a,b,c){if(c=="delete")this._selected.remove(a);else if(!this.data.dataCount()&&!this.data._filter_order)this._selected=dhtmlx.toArray()},_data_loaded:function(){this._settings.select&&this.data.each(function(a){a.$selected&&this.select(a.id)},this)},_select_mark:function(a,
b,c){if(!c&&!this.callEvent("onBeforeSelect",[a,b]))return!1;this.data.item(a).$selected=b;c?c.push(a):(b?this._selected.push(a):this._selected.remove(a),this._refresh_selection(a));return!0},select:function(a,b,c){if(!a)return this.selectAll();if(a instanceof Array)for(var d=0;d<a.length;d++)this.select(a[d],b,c);else if(this.data.exists(a)){if(c&&this._selected.length)return this.selectAll(this._selected[this._selected.length-1],a);if(!b&&(this._selected.length!=1||this._selected[0]!=a))this._silent_selection=
!0,this.unselectAll(),this._silent_selection=!1;this.isSelected(a)?b&&this.unselect(a):this._select_mark(a,!0)&&this.callEvent("onAfterSelect",[a])}},unselect:function(a){if(!a)return this.unselectAll();this.isSelected(a)&&this._select_mark(a,!1)},selectAll:function(a,b){var c,d=[];c=a||b?this.data.getRange(a||null,b||null):this.data.getRange();c.each(function(a){var b=this.data.item(a.id);b.$selected||(this._selected.push(a.id),this._select_mark(a.id,!0,d));return a.id},this);this._refresh_selection(d)},
unselectAll:function(){var a=[];this._selected.each(function(b){this._select_mark(b,!1,a)},this);this._selected=dhtmlx.toArray();this._refresh_selection(a)},isSelected:function(a){return this._selected.find(a)!=-1},getSelected:function(a){switch(this._selected.length){case 0:return a?[]:"";case 1:return a?[this._selected[0]]:this._selected[0];default:return[].concat(this._selected)}},_is_mass_selection:function(a){return a.length>100||a.length>this.data.dataCount/2},_refresh_selection:function(a){typeof a!=
"object"&&(a=[a]);if(a.length){if(this._is_mass_selection(a))this.data.refresh();else for(var b=0;b<a.length;b++)this.render(a[b],this.data.item(a[b]),"update");this._silent_selection||this.callEvent("onSelectChange",[a])}}};
dhtmlx.RenderStack={_init:function(){this._html=document.createElement("DIV")},_toHTML:function(a){this.callEvent("onItemRender",[a]);return this.type._item_start(a,this.type)+(a.$template?this.type["template_"+a.$template]:this.type.template)(a,this.type)+this.type._item_end},_toHTMLObject:function(a){this._html.innerHTML=this._toHTML(a);return this._html.firstChild},_locateHTML:function(a){if(this._htmlmap)return this._htmlmap[a];this._htmlmap={};for(var b=this._dataobj.childNodes,c=0;c<b.length;c++){var d=
b[c].getAttribute(this._id);d&&(this._htmlmap[d]=b[c])}return this._locateHTML(a)},locate:function(a){return dhtmlx.html.locate(a,this._id)},show:function(a){var b=this._locateHTML(a);if(b)this._dataobj.scrollTop=b.offsetTop-this._dataobj.offsetTop},render:function(a,b,c){if(a){var d=this._locateHTML(a);switch(c){case "update":if(!d)return;var e=this._htmlmap[a]=this._toHTMLObject(b);dhtmlx.html.insertBefore(e,d);dhtmlx.html.remove(d);break;case "delete":if(!d)return;dhtmlx.html.remove(d);delete this._htmlmap[a];
break;case "add":e=this._htmlmap[a]=this._toHTMLObject(b);dhtmlx.html.insertBefore(e,this._locateHTML(this.data.next(a)),this._dataobj);break;case "move":this.render(a,b,"delete"),this.render(a,b,"add")}}else if(this.callEvent("onBeforeRender",[this.data]))this._dataobj.innerHTML=this.data.getRange().map(this._toHTML,this).join(""),this._htmlmap=null;this.callEvent("onAfterRender",[])},pager_setter:function(a){this.attachEvent("onBeforeRender",function(){var a=this._settings.pager._settings;if(a.page==
-1)return!1;this.data.min=a.page*a.size;this.data.max=(a.page+1)*a.size-1;return!0});var b=new dhtmlx.ui.pager(a),c=dhtmlx.bind(function(){this.data.refresh()},this);b.attachEvent("onRefresh",c);this.data.attachEvent("onStoreUpdated",function(){var a=this.dataCount();if(a!=b._settings.count){b._settings.count=a;if(b._settings.page==-1)b._settings.page=0;b.refresh()}});return b},height_setter:function(a){a=="auto"&&(this.attachEvent("onAfterRender",this._correct_height),dhtmlx.event(window,"resize",
dhtmlx.bind(this._correct_height,this)));return a},_correct_height:function(){this._dataobj.style.overflow="hidden";this._dataobj.style.height="1px";var a=this._dataobj.scrollHeight;this._dataobj.style.height=a+"px";if(dhtmlx._isFF){var b=this._dataobj.scrollHeight;if(b!=a)this._dataobj.style.height=b+"px"}this._obj.style.height=this._dataobj.style.height},_getDimension:function(){var a=this.type,b=(a.border||0)+(a.padding||0)*2+(a.margin||0)*2;return{x:a.width+b,y:a.height+b}},x_count_setter:function(a){var b=
this._getDimension();this._dataobj.style.width=b.x*a+(this._settings.height!="auto"?18:0)+"px";return a},y_count_setter:function(a){var b=this._getDimension();this._dataobj.style.height=b.y*a+"px";return a}};
dhtmlx.VirtualRenderStack={_init:function(){this._htmlmap={};this._dataobj.style.overflowY="scroll";dhtmlx.event(this._dataobj,"scroll",dhtmlx.bind(this._render_visible_rows,this));dhtmlx.event(window,"resize",dhtmlx.bind(function(){this.render()},this));this.data._unrendered_area=[];this.data.getIndexRange=this._getIndexRange},_locateHTML:function(a){return this._htmlmap[a]},show:function(a){range=this._getVisibleRange();var b=this.data.indexById(a),c=Math.floor(b/range._dx)*range._y;this._dataobj.scrollTop=
c},_getIndexRange:function(a,b){b!==0&&(b=Math.min(b||Infinity,this.dataCount()-1));for(var c=dhtmlx.toArray(),d=a||0;d<=b;d++){var e=this.item(this.order[d]);this.order.length>d&&(e?e.$template=="loading"&&this._unrendered_area.push(this.order[d]):(this.order[d]=dhtmlx.uid(),e={id:this.order[d],$template:"loading"},this._unrendered_area.push(this.order[d])),c.push(e))}return c},render:function(a,b,c){if(a){var d=this._locateHTML(a);switch(c){case "update":if(!d)break;var e=this._htmlmap[a]=this._toHTMLObject(b);
dhtmlx.html.insertBefore(e,d);dhtmlx.html.remove(d);break;default:this._render_delayed()}}else if(this.callEvent("onBeforeRender",[this.data]))this._htmlmap={},this._render_visible_rows(null,!0),this._wait_for_render=!1,this.callEvent("onAfterRender",[])},_render_delayed:function(){if(!this._wait_for_render)this._wait_for_render=!0,window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)},_create_placeholder:function(a){var b=document.createElement("DIV");b.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";
return b},_render_visible_rows:function(a,b){this.data._unrendered_area=[];var c=this._getVisibleRange();if(!this._dataobj.firstChild||b)this._dataobj.innerHTML="",this._dataobj.appendChild(this._create_placeholder(c._max)),this._htmlrows=[this._dataobj.firstChild];for(var d=c._from,e=this.data.max||this.data.max===0?this.data.max:Infinity;d<=c._height;){for(;this._htmlrows[d]&&this._htmlrows[d]._filled&&d<=c._height;)d++;if(d>c._height)break;for(var f=d;!this._htmlrows[f];)f--;var g=this._htmlrows[f],
h=d*c._dx+(this.data.min||0);if(h>e)break;var i=Math.min(h+c._dx-1,e),j=this._create_placeholder(c._y),k=this.data.getIndexRange(h,i);if(!k.length)break;j.innerHTML=k.map(this._toHTML,this).join("");for(var m=0;m<k.length;m++)this._htmlmap[this.data.idByIndex(h+m)]=j.childNodes[m];var l=parseInt(g.style.height,10),n=(d-f)*c._y,o=l-n-c._y;dhtmlx.html.insertBefore(j,n?g.nextSibling:g,this._dataobj);this._htmlrows[d]=j;j._filled=!0;if(n<=0&&o>0)g.style.height=o+"px",this._htmlrows[d+1]=g;else if(n<0?
dhtmlx.html.remove(g):g.style.height=n+"px",o>0){var p=this._htmlrows[d+1]=this._create_placeholder(o);dhtmlx.html.insertBefore(p,j.nextSibling,this._dataobj)}d++}if(this.data._unrendered_area.length){var r=this.indexById(this.data._unrendered_area[0]),q=this.indexById(this.data._unrendered_area.pop())+1;if(q>r){if(!this.callEvent("onDataRequest",[r,q-r]))return!1;this.data.feed.call(this,r,q-r)}}if(dhtmlx._isIE){var s=this._getVisibleRange();s._from!=c._from&&this._render_visible_rows()}},_getVisibleRange:function(){var a=
this._dataobj.scrollTop,b=Math.max(this._dataobj.scrollWidth,this._dataobj.offsetWidth)-18,c=this._dataobj.offsetHeight,d=this.type,e=this._getDimension(),f=Math.floor(b/e.x)||1,g=Math.floor(a/e.y),h=Math.ceil((c+a)/e.y)-1,i=this.data.max?this.data.max-this.data.min:this.data.dataCount(),j=Math.ceil(i/f)*e.y;return{_from:g,_height:h,_top:a,_max:j,_y:e.y,_dx:f}}};
dhtmlx.ajax=function(a,b,c){if(arguments.length!==0){var d=new dhtmlx.ajax;if(c)d.master=c;d.get(a,null,b)}return!this.getXHR?new dhtmlx.ajax:this};
dhtmlx.ajax.prototype={getXHR:function(){return dhtmlx._isIE?new ActiveXObject("Microsoft.xmlHTTP"):new XMLHttpRequest},send:function(a,b,c){var d=this.getXHR();typeof c=="function"&&(c=[c]);if(typeof b=="object"){var e=[],f;for(f in b){var g=b[f];if(g===null||g===dhtmlx.undefined)g="";e.push(f+"="+encodeURIComponent(g))}b=e.join("&")}b&&!this.post&&(a=a+(a.indexOf("?")!=-1?"&":"?")+b,b=null);d.open(this.post?"POST":"GET",a,!this._sync);this.post&&d.setRequestHeader("Content-type","application/x-www-form-urlencoded");
var h=this;d.onreadystatechange=function(){if(!d.readyState||d.readyState==4){if(c&&h)for(var a=0;a<c.length;a++)c[a]&&c[a].call(h.master||h,d.responseText,d.responseXML,d);c=h=h.master=null}};d.send(b||null);return d},get:function(a,b,c){this.post=!1;return this.send(a,b,c)},post:function(a,b,c){this.post=!0;return this.send(a,b,c)},sync:function(){this._sync=!0;return this}};
dhtmlx.AtomDataLoader={_init:function(a){this.data={};if(a)this._settings.datatype=a.datatype||"json",this._after_init.push(this._load_when_ready)},_load_when_ready:function(){this._ready_for_data=!0;this._settings.url&&this.url_setter(this._settings.url);this._settings.data&&this.data_setter(this._settings.data)},url_setter:function(a){if(!this._ready_for_data)return a;this.load(a,this._settings.datatype);return a},data_setter:function(a){if(!this._ready_for_data)return a;this.parse(a,this._settings.datatype);
return!0},load:function(a,b,c){this.callEvent("onXLS",[]);typeof b=="string"?(this.data.driver=dhtmlx.DataDriver[b],b=c):this.data.driver=dhtmlx.DataDriver.xml;dhtmlx.ajax(a,[this._onLoad,b],this)},parse:function(a,b){this.callEvent("onXLS",[]);this.data.driver=dhtmlx.DataDriver[b||"xml"];this._onLoad(a,null)},_onLoad:function(a,b){var c=this.data.driver,d=c.getRecords(c.toObject(a,b))[0];this.data=c?c.getDetails(d):a;this.callEvent("onXLE",[])},_check_data_feed:function(a){if(!this._settings.dataFeed||
this._ignore_feed||!a)return!0;var b=this._settings.dataFeed;if(typeof b=="function")return b.call(this,a.id||a,a);b=b+(b.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(a.id||a);this.callEvent("onXLS",[]);dhtmlx.ajax(b,function(a){this._ignore_feed=!0;this.setValues(dhtmlx.DataDriver.json.toObject(a)[0]);this._ignore_feed=!1;this.callEvent("onXLE",[])},this);return!1}};dhtmlx.DataDriver={};
dhtmlx.DataDriver.json={toObject:function(a){a||(a="[]");return typeof a=="string"?(eval("dhtmlx.temp="+a),dhtmlx.temp):a},getRecords:function(a){return a&&!(a instanceof Array)?[a]:a},getDetails:function(a){return a},getInfo:function(a){return{_size:a.total_count||0,_from:a.pos||0,_key:a.dhx_security}}};
dhtmlx.DataDriver.json_ext={toObject:function(a){a||(a="[]");if(typeof a=="string"){var b;eval("temp="+a);dhtmlx.temp=[];for(var c=b.header,d=0;d<b.data.length;d++){for(var e={},f=0;f<c.length;f++)typeof b.data[d][f]!="undefined"&&(e[c[f]]=b.data[d][f]);dhtmlx.temp.push(e)}return dhtmlx.temp}return a},getRecords:function(a){return a&&!(a instanceof Array)?[a]:a},getDetails:function(a){return a},getInfo:function(a){return{_size:a.total_count||0,_from:a.pos||0}}};
dhtmlx.DataDriver.html={toObject:function(a){if(typeof a=="string"){var b=null;a.indexOf("<")==-1&&(b=dhtmlx.toNode(a));if(!b)b=document.createElement("DIV"),b.innerHTML=a;return b.getElementsByTagName(this.tag)}return a},getRecords:function(a){return a.tagName?a.childNodes:a},getDetails:function(a){return dhtmlx.DataDriver.xml.tagToObject(a)},getInfo:function(){return{_size:0,_from:0}},tag:"LI"};
dhtmlx.DataDriver.jsarray={toObject:function(a){return typeof a=="string"?(eval("dhtmlx.temp="+a),dhtmlx.temp):a},getRecords:function(a){return a},getDetails:function(a){for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{_size:0,_from:0}}};
dhtmlx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(a){for(var a=this.stringToArray(a),b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{_size:0,_from:0}},stringToArray:function(a){for(var a=a.split(this.cell),b=0;b<a.length;b++)a[b]=a[b].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"");return a},row:"\n",cell:","};
dhtmlx.DataDriver.xml={toObject:function(a,b){return b&&(b=this.checkResponse(a,b))?b:typeof a=="string"?this.fromString(a):a},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(a){return{_size:a.documentElement.getAttribute("total_count")||0,_from:a.documentElement.getAttribute("pos")||0,_key:a.documentElement.getAttribute("dhx_security")}},xpath:function(a,b){if(window.XPathResult){var c=a;if(a.nodeName.indexOf("document")==
-1)a=a.ownerDocument;for(var d=[],e=a.evaluate(b,c,null,XPathResult.ANY_TYPE,null),f=e.iterateNext();f;)d.push(f),f=e.iterateNext();return d}else{var g=!0;try{typeof a.selectNodes=="undefined"&&(g=!1)}catch(h){}if(g)return a.selectNodes(b);else{var i=b.split("/").pop();return a.getElementsByTagName(i)}}},tagToObject:function(a,b){var b=b||{},c=!1,d=a.attributes;if(d&&d.length){for(var e=0;e<d.length;e++)b[d[e].name]=d[e].value;c=!0}for(var f=a.childNodes,g={},e=0;e<f.length;e++)if(f[e].nodeType==
1){var h=f[e].tagName;typeof b[h]!="undefined"?(b[h]instanceof Array||(b[h]=[b[h]]),b[h].push(this.tagToObject(f[e],{}))):b[f[e].tagName]=this.tagToObject(f[e],{});c=!0}if(!c)return this.nodeValue(a);b.value=this.nodeValue(a);return b},nodeValue:function(a){return a.firstChild?a.firstChild.data:""},fromString:function(a){if(window.DOMParser&&!dhtmlx._isIE)return(new DOMParser).parseFromString(a,"text/xml");if(window.ActiveXObject){var b=new ActiveXObject("Microsoft.xmlDOM");b.loadXML(a);return b}},
checkResponse:function(a,b){if(b&&b.firstChild&&b.firstChild.tagName!="parsererror")return b;var c=this.fromString(a.replace(/^[\s]+/,""));if(c)return c}};
dhtmlx.DataLoader={_init:function(a){a=a||"";this.name="DataStore";this.data=a.datastore||new dhtmlx.DataStore;this._readyHandler=this.data.attachEvent("onStoreLoad",dhtmlx.bind(this._call_onready,this))},load:function(a,b){dhtmlx.AtomDataLoader.load.apply(this,arguments);if(!this.data.feed)this.data.feed=function(b,d){if(this._load_count)return this._load_count=[b,d];else this._load_count=!0;this.load(a+(a.indexOf("?")==-1?"?":"&")+"posStart="+b+"&count="+d,function(){var a=this._load_count;this._load_count=
!1;typeof a=="object"&&this.data.feed.apply(this,a)})}},_onLoad:function(a,b){this.data._parse(this.data.driver.toObject(a,b));this.callEvent("onXLE",[]);if(this._readyHandler)this.data.detachEvent(this._readyHandler),this._readyHandler=null},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhtmlx.bind(function(a,c){if(this._settings.dataFeed){var d={};if(a||d){if(typeof a=="function"){if(!c)return;a(c,d)}else d={text:c};this.clearAll();var e=this._settings.dataFeed;if(typeof e==
"function")return e.call(this,c,d);var f=[],g;for(g in d)f.push("dhx_filter["+g+"]="+encodeURIComponent(d[g]));this.load(e+(e.indexOf("?")<0?"?":"&")+f.join("&"),this._settings.datatype);return!1}}},this));return a},_call_onready:function(){if(this._settings.ready){var a=dhtmlx.toFunctor(this._settings.ready);a&&a.call&&a.apply(this,arguments)}}};dhtmlx.DataStore=function(){this.name="DataStore";dhtmlx.extend(this,dhtmlx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhtmlx.toArray()};
dhtmlx.DataStore.prototype={setDriver:function(a){this.driver=dhtmlx.DataDriver[a]},_parse:function(a){this.callEvent("onParse",[this.driver,a]);this._filter_order&&this.filter();var b=this.driver.getInfo(a);if(b._key)dhtmlx.security_key=b._key;var c=this.driver.getRecords(a),d=(b._from||0)*1;if(d===0&&this.order[0])d=this.order.length;for(var e=0,f=0;f<c.length;f++){var g=this.driver.getDetails(c[f]),h=this.id(g);this.pull[h]||(this.order[e+d]=h,e++);this.pull[h]=g;this.extraParser&&this.extraParser(g);
this._scheme&&(this._scheme.$init?this._scheme.$update(g):this._scheme.$update&&this._scheme.$update(g))}for(f=0;f<b._size;f++)this.order[f]||(h=dhtmlx.uid(),g={id:h,$template:"loading"},this.pull[h]=g,this.order[f]=h);this.callEvent("onStoreLoad",[this.driver,a]);this.refresh()},id:function(a){return a.id||(a.id=dhtmlx.uid())},changeId:function(a,b){this.pull[b]=this.pull[a];this.pull[b].id=b;this.order[this.order.find(a)]=b;this._filter_order&&(this._filter_order[this._filter_order.find(a)]=b);
this.callEvent("onIdChange",[a,b]);this._render_change_id&&this._render_change_id(a,b)},get:function(a){return this.item(a)},set:function(a,b){return this.update(a,b)},item:function(a){return this.pull[a]},update:function(a,b){this._scheme&&this._scheme.$update&&this._scheme.$update(b);if(this.callEvent("onBeforeUpdate",[a,b])===!1)return!1;this.pull[a]=b;this.refresh(a)},refresh:function(a){this._skip_refresh||(a?this.callEvent("onStoreUpdated",[a,this.pull[a],"update"]):this.callEvent("onStoreUpdated",
[null,null,null]))},silent:function(a){this._skip_refresh=!0;a.call(this);this._skip_refresh=!1},getRange:function(a,b){a=a?this.indexById(a):this.startOffset||0;b?b=this.indexById(b):(b=Math.min(this.endOffset||Infinity,this.dataCount()-1),b<0&&(b=0));if(a>b)var c=b,b=a,a=c;return this.getIndexRange(a,b)},getIndexRange:function(a,b){for(var b=Math.min(b||Infinity,this.dataCount()-1),c=dhtmlx.toArray(),d=a||0;d<=b;d++)c.push(this.item(this.order[d]));return c},dataCount:function(){return this.order.length},
exists:function(a){return!!this.pull[a]},move:function(a,b){if(!(a<0||b<0)){var c=this.idByIndex(a),d=this.item(c);this.order.removeAt(a);this.order.insertAt(c,Math.min(this.order.length,b));this.callEvent("onStoreUpdated",[c,d,"move"])}},scheme:function(a){this._scheme=a},sync:function(a,b,c){typeof b!="function"&&(c=b,b=null);if(dhtmlx.debug_bind)this.debug_sync_master=a;var d=a;if(a.name!="DataStore")a=a.data;var e=dhtmlx.bind(function(d,e,h){if(h!="update"||b)d=null;if(!d)this.order=dhtmlx.toArray([].concat(a.order)),
this._filter_order=null,this.pull=a.pull,b&&this.silent(b),this._on_sync&&this._on_sync();c?c=!1:this.refresh(d)},this);a.attachEvent("onStoreUpdated",e);this.feed=function(a,b){d.loadNext(b,a)};e()},add:function(a,b){if(this._scheme){var a=a||{},c;for(c in this._scheme)a[c]=a[c]||this._scheme[c];this._scheme&&(this._scheme.$init?this._scheme.$update(a):this._scheme.$update&&this._scheme.$update(a))}var d=this.id(a),e=this.dataCount();if(dhtmlx.isNotDefined(b)||b<0)b=e;b>e&&(b=Math.min(this.order.length,
b));if(this.callEvent("onBeforeAdd",[d,a,b])===!1)return!1;if(this.exists(d))return null;this.pull[d]=a;this.order.insertAt(d,b);if(this._filter_order){var f=this._filter_order.length;!b&&this.order.length&&(f=0);this._filter_order.insertAt(d,f)}this.callEvent("onafterAdd",[d,b]);this.callEvent("onStoreUpdated",[d,a,"add"]);return d},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else{if(this.callEvent("onBeforeDelete",[a])===!1)return!1;if(!this.exists(a))return null;
var c=this.item(a);this.order.remove(a);this._filter_order&&this._filter_order.remove(a);delete this.pull[a];this.callEvent("onafterdelete",[a]);this.callEvent("onStoreUpdated",[a,c,"delete"])}},clearAll:function(){this.pull={};this.order=dhtmlx.toArray();this._filter_order=this.feed=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){return this.order[a]},indexById:function(a){var b=this.order.find(a);return b},next:function(a,b){return this.order[this.indexById(a)+(b||1)]},
first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(a,b){return this.order[this.indexById(a)-(b||1)]},sort:function(a,b,c){var d=a;typeof a=="function"?d={as:a,dir:b}:typeof a=="string"&&(d={by:a,dir:b,as:c});var e=[d.by,d.dir,d.as];if(this.callEvent("onbeforesort",e)){if(this.order.length){var f=dhtmlx.sort.create(d),g=this.getRange(this.first(),this.last());g.sort(f);this.order=g.map(function(a){return this.id(a)},this)}this.refresh();
this.callEvent("onaftersort",e)}},filter:function(a,b){if(this.callEvent("onBeforeFilter",[a,b])){if(this._filter_order)this.order=this._filter_order,delete this._filter_order;if(this.order.length){if(a){var c=a,b=b||"";typeof a=="string"&&(a=dhtmlx.Template.fromHTML(a),b=b.toString().toLowerCase(),c=function(b,c){return a(b).toLowerCase().indexOf(c)!=-1});for(var d=dhtmlx.toArray(),e=0;e<this.order.length;e++){var f=this.order[e];c(this.item(f),b)&&d.push(f)}this._filter_order=this.order;this.order=
d}this.refresh();this.callEvent("onAfterFilter",[])}}},each:function(a,b){for(var c=0;c<this.order.length;c++)a.call(b||this,this.item(this.order[c]))},provideApi:function(a,b){this.debug_bind_master=a;b&&this.mapEvent({onbeforesort:a,onaftersort:a,onbeforeadd:a,onafteradd:a,onbeforedelete:a,onafterdelete:a,onbeforeupdate:a});for(var c="get,set,sort,add,remove,exists,idByIndex,indexById,item,update,refresh,dataCount,filter,next,previous,clearAll,first,last,serialize".split(","),d=0;d<c.length;d++)a[c[d]]=
dhtmlx.methodPush(this,c[d])},serialize:function(){for(var a=this.order,b=[],c=0;c<a.length;c++)b.push(this.pull[a[c]]);return b}};
dhtmlx.sort={create:function(a){return dhtmlx.sort.dir(a.dir,dhtmlx.sort.by(a.by,a.as))},as:{"int":function(a,b){a*=1;b*=1;return a>b?1:a<b?-1:0},string_strict:function(a,b){a=a.toString();b=b.toString();return a>b?1:a<b?-1:0},string:function(a,b){a=a.toString().toLowerCase();b=b.toString().toLowerCase();return a>b?1:a<b?-1:0}},by:function(a,b){if(!a)return b;typeof b!="function"&&(b=dhtmlx.sort.as[b||"string"]);a=dhtmlx.Template.fromHTML(a);return function(c,d){return b(a(c),a(d))}},dir:function(a,
b){return a=="asc"?b:function(a,d){return b(a,d)*-1}}};if(!dhtmlx.attaches)dhtmlx.attaches={};dhtmlx.attaches.attachAbstract=function(a,b){var c=document.createElement("DIV");c.id="CustomObject_"+dhtmlx.uid();c.style.width="100%";c.style.height="100%";c.cmp="grid";document.body.appendChild(c);this.attachObject(c.id);b.container=c.id;var d=this.vs[this.av];d.grid=new window[a](b);d.gridId=c.id;d.gridObj=c;d.grid.setSizes=function(){this.resize?this.resize():this.render()};var e="_viewRestore";return this.vs[this[e]()].grid};
dhtmlx.attaches.attachDataView=function(a){return this.attachAbstract("dhtmlXDataView",a)};dhtmlx.attaches.attachChart=function(a){return this.attachAbstract("dhtmlXChart",a)};dhtmlx.compat.layout=function(){};
dhtmlXDataView=function(a){this.name="DataView";this.version="3.0";dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_dataview");dhtmlx.extend(this,dhtmlx.AtomDataLoader);dhtmlx.extend(this,dhtmlx.DataLoader);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.RenderStack);dhtmlx.extend(this,dhtmlx.SelectionModel);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.KeyEvents);dhtmlx.extend(this,dhtmlx.EditAbility);dhtmlx.extend(this,dhtmlx.DataMove);dhtmlx.extend(this,
dhtmlx.DragItem);dhtmlx.extend(this,dhtmlx.DataProcessor);dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.Destruction);this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render.apply(this,arguments)},this));this._parseSettings(a,{drag:!1,edit:!1,select:"multiselect",type:"default"});this._settings.height!="auto"&&!this._settings.renderAll&&dhtmlx.extend(this,dhtmlx.VirtualRenderStack);this.data.provideApi(this,!0)};
dhtmlXDataView.prototype={bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},dragMarker:function(a){var b=this._locateHTML(a.target);if(this.type.drag_marker){if(this._drag_marker)this._drag_marker.style.backgroundImage="",this._drag_marker.style.backgroundRepeat="";if(b)b.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")",b.style.backgroundRepeat="no-repeat",this._drag_marker=b}if(b&&this._settings.auto_scroll){var c=
b.offsetTop,d=b.offsetHeight,e=this._obj.scrollTop,f=this._obj.offsetHeight;c-d>=0&&c-d*0.75<e?e=Math.max(c-d,0):c+d/0.75>e+f&&(e+=d);this._obj.scrollTop=e}return!0},_id:"dhx_f_id",on_click:{dhx_dataview_item:function(a,b){this.stopEdit(!1,b)&&this._settings.select&&(this._settings.select=="multiselect"?this.select(b,a.ctrlKey,a.shiftKey):this.select(b))}},on_dblclick:{dhx_dataview_item:function(a,b){this._settings.edit&&this.edit(b)}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>{obj.text}</div>"),
template_edit:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'><textarea style='width:100%; height:100%;' bind='obj.text'></textarea></div>"),template_loading:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>Loading...</div>"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("<div dhx_f_id='{-obj.id}' class='dhx_dataview_item dhx_dataview_{obj.css}_item{-obj.$selected?_selected:}' style='width:{obj.width}px; height:{obj.height}px; padding:{obj.padding}px; margin:{obj.margin}px; float:left; overflow:hidden;'>"),
template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.compat("layout");
function dataProcessor(a){this.serverProcessor=a;this.action_param="!nativeeditor_status";this.object=null;this.updatedRows=[];this.autoUpdate=!0;this.updateMode="cell";this._tMode="GET";this.post_delim="_";this._waitMode=0;this._in_progress={};this._invalid={};this.mandatoryFields=[];this.messages=[];this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",clear:"font-weight:normal;text-decoration:none;"};
this.enableUTFencoding(!0);dhtmlxEventable(this);return this}
dataProcessor.prototype={setTransactionMode:function(a,b){this._tMode=a;this._tSend=b},escape:function(a){return this._utf?encodeURIComponent(a):escape(a)},enableUTFencoding:function(a){this._utf=convertStringToBoolean(a)},setDataColumns:function(a){this._columns=typeof a=="string"?a.split(","):a},getSyncState:function(){return!this.updatedRows.length},enableDataNames:function(a){this._endnm=convertStringToBoolean(a)},enablePartialDataSend:function(a){this._changed=convertStringToBoolean(a)},setUpdateMode:function(a,
b){this.autoUpdate=a=="cell";this.updateMode=a;this.dnd=b},ignore:function(a,b){this._silent_mode=!0;a.call(b||window);this._silent_mode=!1},setUpdated:function(a,b,c){if(!this._silent_mode){var d=this.findRow(a),c=c||"updated",e=this.obj.getUserData(a,this.action_param);e&&c=="updated"&&(c=e);b?(this.set_invalid(a,!1),this.updatedRows[d]=a,this.obj.setUserData(a,this.action_param,c),this._in_progress[a]&&(this._in_progress[a]="wait")):this.is_invalid(a)||(this.updatedRows.splice(d,1),this.obj.setUserData(a,
this.action_param,""));b||this._clearUpdateFlag(a);this.markRow(a,b,c);b&&this.autoUpdate&&this.sendData(a)}},_clearUpdateFlag:function(){},markRow:function(a,b,c){var d="",e=this.is_invalid(a);e&&(d=this.styles[e],b=!0);if(this.callEvent("onRowMark",[a,b,c,e])&&(d=this.styles[b?c:"clear"]+d,this.obj[this._methods[0]](a,d),e&&e.details)){d+=this.styles[e+"_cell"];for(var f=0;f<e.details.length;f++)if(e.details[f])this.obj[this._methods[1]](a,f,d)}},getState:function(a){return this.obj.getUserData(a,
this.action_param)},is_invalid:function(a){return this._invalid[a]},set_invalid:function(a,b,c){c&&(b={value:b,details:c,toString:function(){return this.value.toString()}});this._invalid[a]=b},checkBeforeUpdate:function(){return!0},sendData:function(a){if(!this._waitMode||!(this.obj.mytype=="tree"||this.obj._h2)){this.obj.editStop&&this.obj.editStop();if(typeof a=="undefined"||this._tSend)return this.sendAllData();if(this._in_progress[a])return!1;this.messages=[];if(!this.checkBeforeUpdate(a)&&this.callEvent("onValidationError",
[a,this.messages]))return!1;this._beforeSendData(this._getRowData(a),a)}},_beforeSendData:function(a,b){if(!this.callEvent("onBeforeUpdate",[b,this.getState(b),a]))return!1;this._sendData(a,b)},serialize:function(a,b){if(typeof a=="string")return a;if(typeof b!="undefined")return this.serialize_one(a,"");else{var c=[],d=[],e;for(e in a)a.hasOwnProperty(e)&&(c.push(this.serialize_one(a[e],e+this.post_delim)),d.push(e));c.push("ids="+this.escape(d.join(",")));dhtmlx.security_key&&c.push("dhx_security="+
dhtmlx.security_key);return c.join("&")}},serialize_one:function(a,b){if(typeof a=="string")return a;var c=[],d;for(d in a)a.hasOwnProperty(d)&&c.push(this.escape((b||"")+d)+"="+this.escape(a[d]));return c.join("&")},_sendData:function(a,b){if(a){if(!this.callEvent("onBeforeDataSending",b?[b,this.getState(b),a]:[null,null,a]))return!1;b&&(this._in_progress[b]=(new Date).valueOf());var c=new dtmlXMLLoaderObject(this.afterUpdate,this,!0),d=this.serverProcessor+(this._user?getUrlSymbol(this.serverProcessor)+
["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&"):"");this._tMode!="POST"?c.loadXML(d+(d.indexOf("?")!=-1?"&":"?")+this.serialize(a,b)):c.loadXML(d,!0,this.serialize(a,b));this._waitMode++}},sendAllData:function(){if(this.updatedRows.length){this.messages=[];for(var a=!0,b=0;b<this.updatedRows.length;b++)a&=this.checkBeforeUpdate(this.updatedRows[b]);if(!a&&!this.callEvent("onValidationError",["",this.messages]))return!1;if(this._tSend)this._sendData(this._getAllData());
else for(b=0;b<this.updatedRows.length;b++)if(!this._in_progress[this.updatedRows[b]]&&!this.is_invalid(this.updatedRows[b])&&(this._beforeSendData(this._getRowData(this.updatedRows[b]),this.updatedRows[b]),this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)))break}},_getAllData:function(){for(var a={},b=!1,c=0;c<this.updatedRows.length;c++){var d=this.updatedRows[c];!this._in_progress[d]&&!this.is_invalid(d)&&this.callEvent("onBeforeUpdate",[d,this.getState(d)])&&(a[d]=this._getRowData(d,d+this.post_delim),
b=!0,this._in_progress[d]=(new Date).valueOf())}return b?a:null},setVerificator:function(a,b){this.mandatoryFields[a]=b||function(a){return a!=""}},clearVerificator:function(a){this.mandatoryFields[a]=!1},findRow:function(a){for(var b=0,b=0;b<this.updatedRows.length;b++)if(a==this.updatedRows[b])break;return b},defineAction:function(a,b){if(!this._uActions)this._uActions=[];this._uActions[a]=b},afterUpdateCallback:function(a,b,c,d){var e=a,f=c!="error"&&c!="invalid";f||this.set_invalid(a,c);if(this._uActions&&
this._uActions[c]&&!this._uActions[c](d))return delete this._in_progress[e];this._in_progress[e]!="wait"&&this.setUpdated(a,!1);var g=a;switch(c){case "inserted":case "insert":b!=a&&(this.obj[this._methods[2]](a,b),a=b);break;case "delete":case "deleted":return this.obj.setUserData(a,this.action_param,"true_deleted"),this.obj[this._methods[3]](a),delete this._in_progress[e],this.callEvent("onAfterUpdate",[a,c,b,d])}this._in_progress[e]!="wait"?(f&&this.obj.setUserData(a,this.action_param,""),delete this._in_progress[e]):
(delete this._in_progress[e],this.setUpdated(b,!0,this.obj.getUserData(a,this.action_param)));this.callEvent("onAfterUpdate",[a,c,b,d])},afterUpdate:function(a,b,c,d,e){e.getXMLTopNode("data");if(e.xmlDoc.responseXML){for(var f=e.doXPath("//data/action"),g=0;g<f.length;g++){var h=f[g],i=h.getAttribute("type"),j=h.getAttribute("sid"),k=h.getAttribute("tid");a.afterUpdateCallback(j,k,i,h)}a.finalizeUpdate()}},finalizeUpdate:function(){this._waitMode&&this._waitMode--;(this.obj.mytype=="tree"||this.obj._h2)&&
this.updatedRows.length&&this.sendData();this.callEvent("onAfterUpdateFinish",[]);this.updatedRows.length||this.callEvent("onFullSync",[])},init:function(a){this.obj=a;this.obj._dp_init&&this.obj._dp_init(this)},setOnAfterUpdate:function(a){this.attachEvent("onAfterUpdate",a)},enableDebug:function(){},setOnBeforeUpdateHandler:function(a){this.attachEvent("onBeforeDataSending",a)},setAutoUpdate:function(a,b){a=a||2E3;this._user=b||(new Date).valueOf();this._need_update=!1;this._loader=null;this._update_busy=
!1;this.attachEvent("onAfterUpdate",function(a,b,c,g){this.afterAutoUpdate(a,b,c,g)});this.attachEvent("onFullSync",function(){this.fullSync()});var c=this;window.setInterval(function(){c.loadUpdate()},a)},afterAutoUpdate:function(a,b){return b=="collision"?(this._need_update=!0,!1):!0},fullSync:function(){if(this._need_update==!0)this._need_update=!1,this.loadUpdate();return!0},getUpdates:function(a,b){if(this._update_busy)return!1;else this._update_busy=!0;this._loader=this._loader||new dtmlXMLLoaderObject(!0);
this._loader.async=!0;this._loader.waitCall=b;this._loader.loadXML(a)},_v:function(a){return a.firstChild?a.firstChild.nodeValue:""},_a:function(a){for(var b=[],c=0;c<a.length;c++)b[c]=this._v(a[c]);return b},loadUpdate:function(){var a=this,b=this.obj.getUserData(0,"version"),c=this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+b].join("&"),c=c.replace("editing=true&","");this.getUpdates(c,function(){var b=a._loader.doXPath("//userdata");a.obj.setUserData(0,
"version",a._v(b[0]));var c=a._loader.doXPath("//update");if(c.length){a._silent_mode=!0;for(var f=0;f<c.length;f++){var g=c[f].getAttribute("status"),h=c[f].getAttribute("id"),i=c[f].getAttribute("parent");switch(g){case "inserted":a.callEvent("insertCallback",[c[f],h,i]);break;case "updated":a.callEvent("updateCallback",[c[f],h,i]);break;case "deleted":a.callEvent("deleteCallback",[c[f],h,i])}}a._silent_mode=!1}a._update_busy=!1;a=null})}};
if(window.dhtmlXGridObject&&!dhtmlXGridObject.prototype._init_point_connector)dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point,dhtmlXGridObject.prototype._init_point=function(){this._con_f_used=[].concat(this._con_f_used);dhtmlXGridObject.prototype._con_f_used=[];var a=function(a){a=a.replace(/(\?|\&)connector[^\f]*/g,"");return a+(a.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length>0?"&dhx_no_header=1":"")},b=function(b){return a.call(this,b)+
(this._connector_sorting||"")+(this._connector_filter||"")},c=function(a,c,d){this._connector_sorting="&dhx_sort["+c+"]="+d;return b.call(this,a)},d=function(a,c,d){for(var h=[],i=0;i<c.length;i++)h[i]="dhx_filter["+c[i]+"]="+encodeURIComponent(d[i]);this._connector_filter="&"+h.join("&");return b.call(this,a)};this.attachEvent("onCollectValues",function(a){return this._con_f_used[a]?typeof this._con_f_used[a]=="object"?this._con_f_used[a]:!1:!0});this.attachEvent("onDynXLS",function(){this.xmlFileUrl=
b.call(this,this.xmlFileUrl);return!0});this.attachEvent("onBeforeSorting",function(a,b,d){if(b=="connector"){var h=this;this.clearAndLoad(c.call(this,this.xmlFileUrl,a,d),function(){h.setSortImgState(!0,a,d)});return!1}return!0});this.attachEvent("onFilterStart",function(a,b){var c=this.getSortingState();if(this._con_f_used.length){var h=this;this.clearAndLoad(d.call(this,this.xmlFileUrl,a,b));c.length&&h.setSortImgState(!0,c[0],c[1]);return!1}return!0});this.attachEvent("onXLE",function(){});this._init_point_connector&&
this._init_point_connector()},dhtmlXGridObject.prototype._con_f_used=[],dhtmlXGridObject.prototype._in_header_connector_text_filter=function(a,b){this._con_f_used[b]||(this._con_f_used[b]=1);return this._in_header_text_filter(a,b)},dhtmlXGridObject.prototype._in_header_connector_select_filter=function(a,b){this._con_f_used[b]||(this._con_f_used[b]=2);return this._in_header_select_filter(a,b)},dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load,dhtmlXGridObject.prototype.load=
function(a,b,c){if(!this._colls_loaded&&this.cellType){for(var d=[],e=0;e<this.cellType.length;e++)(this.cellType[e].indexOf("co")==0||this._con_f_used[e]==2)&&d.push(e);d.length&&(arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+d.join(","))}return this.load_connector.apply(this,arguments)},dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead,dhtmlXGridObject.prototype._parseHead=function(a,b,c){this._parseHead_connector.apply(this,
arguments);if(!this._colls_loaded){for(var d=this.xmlLoader.doXPath("./coll_options",arguments[0]),e=0;e<d.length;e++){var f=d[e].getAttribute("for"),g=[],h=null;this.cellType[f]=="combo"?h=this.getColumnCombo(f):this.cellType[f].indexOf("co")==0&&(h=this.getCombo(f));for(var i=this.xmlLoader.doXPath("./item",d[e]),j=[],k=0;k<i.length;k++){var m=i[k].getAttribute("value");if(h){var l=i[k].getAttribute("label")||m;h.addOption?j.push([m,l]):h.put(m,l);g[g.length]=l}else g[g.length]=m}j.length&&h.addOption(j);
this._con_f_used[f*1]&&(this._con_f_used[f*1]=g)}this._colls_loaded=!0}};if(window.dataProcessor&&!dataProcessor.prototype.init_original)dataProcessor.prototype.init_original=dataProcessor.prototype.init,dataProcessor.prototype.init=function(a){this.init_original(a);a._dataprocessor=this;this.setTransactionMode("POST",!0);this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true"};dhtmlxError.catchError("LoadXML",function(a,b,c){alert(c[0].responseText)});
window.dhx||(dhx={});dhx.version="3.0";dhx.codebase="./";dhx.name="Core";dhx.clone=function(a){var b=dhx.clone.xa;b.prototype=a;return new b};dhx.clone.xa=function(){};dhx.extend=function(a,b,c){if(a.q)return dhx.PowerArray.insertAt.call(a.q,b,1),a;for(var d in b)if(!a[d]||c)a[d]=b[d];b.defaults&&dhx.extend(a.defaults,b.defaults);b.$init&&b.$init.call(a);return a};
dhx.copy=function(a){if(arguments.length>1)var b=arguments[0],a=arguments[1];else b=dhx.isArray(a)?[]:{};for(var c in a)a[c]&&typeof a[c]=="object"&&!dhx.isDate(a[c])?(b[c]=dhx.isArray(a[c])?[]:{},dhx.copy(b[c],a[c])):b[c]=a[c];return b};dhx.single=function(a){var b=null,c=function(c){b||(b=new a({}));b.Ia&&b.Ia.apply(b,arguments);return b};return c};
dhx.protoUI=function(){var a=arguments,b=a[0].name,c=function(a){if(!c)return dhx.ui[b].prototype;var e=c.q;if(e){for(var f=[e[0]],g=1;g<e.length;g++)f[g]=e[g],f[g].q&&(f[g]=f[g].call(dhx,f[g].name)),f[g].prototype&&f[g].prototype.name&&(dhx.ui[f[g].prototype.name]=f[g]);dhx.ui[b]=dhx.proto.apply(dhx,f);if(c.r)for(g=0;g<c.r.length;g++)dhx.Type(dhx.ui[b],c.r[g]);c=e=null}return this!=dhx?new dhx.ui[b](a):dhx.ui[b]};c.q=Array.prototype.slice.call(arguments,0);return dhx.ui[b]=c};
dhx.proto=function(){for(var a=arguments,b=a[0],c=!!b.$init,d=[],e=a.length-1;e>0;e--){if(typeof a[e]=="function")a[e]=a[e].prototype;a[e].$init&&d.push(a[e].$init);if(a[e].defaults){var f=a[e].defaults;if(!b.defaults)b.defaults={};for(var g in f)dhx.isUndefined(b.defaults[g])&&(b.defaults[g]=f[g])}if(a[e].type&&b.type)for(g in a[e].type)b.type[g]||(b.type[g]=a[e].type[g]);for(var h in a[e])b[h]||(b[h]=a[e][h])}c&&d.push(b.$init);b.$init=function(){for(var a=0;a<d.length;a++)d[a].apply(this,arguments)};
var i=function(a){this.$ready=[];this.$init(a);this.$&&this.$(a,this.defaults);for(var b=0;b<this.$ready.length;b++)this.$ready[b].call(this)};i.prototype=b;b=a=null;return i};dhx.bind=function(a,b){return function(){return a.apply(b,arguments)}};
dhx.require=function(a,b,c,d,e){if(typeof a!="string"){var f=a.length||0,g=b;if(f)b=function(){if(f)f--,dhx.require(a[a.length-f-1],b,c);else return g.apply(this,arguments)},b();else{for(var h in a)f++;b=function(){f--;f==0&&g.apply(this,arguments)};for(h in a)dhx.require(h,b,c)}}else if(dhx.i[a]!==!0)if(a.substr(-4)==".css"){var i=dhx.html.create("LINK",{type:"text/css",rel:"stylesheet",href:dhx.codebase+a});document.head.appendChild(i);b&&b.call(c||window)}else{var j=e;b?dhx.i[a]?dhx.i[a].push([b,
c]):(dhx.i[a]=[[b,c]],dhx.ajax(dhx.codebase+a,function(b){dhx.exec(b);var c=dhx.i[a];dhx.i[a]=!0;for(var d=0;d<c.length;d++)c[d][0].call(c[d][1]||window,!d)})):(dhx.exec(dhx.ajax().sync().get(dhx.codebase+a).responseText),dhx.i[a]=!0)}};dhx.i={};dhx.exec=function(a){window.execScript?window.execScript(a):window.eval(a)};dhx.wrap=function(a,b){return!a?b:function(){var c=a.apply(this,arguments);b.apply(this,arguments);return c}};dhx.isUndefined=function(a){return typeof a=="undefined"};
dhx.delay=function(a,b,c,d){return window.setTimeout(function(){var d=a.apply(b,c||[]);a=b=c=null;return d},d||1)};dhx.uid=function(){if(!this.R)this.R=(new Date).valueOf();this.R++;return this.R};dhx.toNode=function(a){return typeof a=="string"?document.getElementById(a):a};dhx.toArray=function(a){return dhx.extend(a||[],dhx.PowerArray,!0)};dhx.toFunctor=function(a){return typeof a=="string"?eval(a):a};
dhx.isArray=function(a){return Array.isArray?Array.isArray(a):Object.prototype.toString.call(a)==="[object Array]"};dhx.isDate=function(a){return a instanceof Date};dhx.L={};dhx.event=function(a,b,c,d){var a=dhx.toNode(a),e=dhx.uid();d&&(c=dhx.bind(c,d));dhx.L[e]=[a,b,c];a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c);return e};
dhx.eventRemove=function(a){if(a){var b=dhx.L[a];b[0].removeEventListener?b[0].removeEventListener(b[1],b[2],!1):b[0].detachEvent&&b[0].detachEvent("on"+b[1],b[2]);delete this.L[a]}};
dhx.EventSystem={$init:function(){if(!this.e)this.e={},this.s={},this.M={}},blockEvent:function(){this.e.T=!0},unblockEvent:function(){this.e.T=!1},mapEvent:function(a){dhx.extend(this.M,a,!0)},on_setter:function(a){if(a)for(var b in a)typeof a[b]=="function"&&this.attachEvent(b,a[b])},callEvent:function(a,b){if(this.e.T)return!0;var a=a.toLowerCase(),c=this.e[a.toLowerCase()],d=!0;if(c)for(var e=0;e<c.length;e++)if(c[e].apply(this,b||[])===!1)d=!1;this.M[a]&&!this.M[a].callEvent(a,b)&&(d=!1);return d},
attachEvent:function(a,b,c){var a=a.toLowerCase(),c=c||dhx.uid(),b=dhx.toFunctor(b),d=this.e[a]||dhx.toArray();d.push(b);this.e[a]=d;this.s[c]={f:b,t:a};return c},detachEvent:function(a){if(this.s[a]){var b=this.s[a].t,c=this.s[a].f,d=this.e[b];d.remove(c);delete this.s[a]}},hasEvent:function(a){a=a.toLowerCase();return this.e[a]?!0:!1}};dhx.extend(dhx,dhx.EventSystem);
dhx.PowerArray={removeAt:function(a,b){a>=0&&this.splice(a,b||1)},remove:function(a){this.removeAt(this.find(a))},insertAt:function(a,b){if(!b&&b!==0)this.push(a);else{var c=this.splice(b,this.length-b);this[b]=a;this.push.apply(this,c)}},find:function(a){for(var b=0;b<this.length;b++)if(a==this[b])return b;return-1},each:function(a,b){for(var c=0;c<this.length;c++)a.call(b||this,this[c])},map:function(a,b){for(var c=0;c<this.length;c++)this[c]=a.call(b||this,this[c]);return this},filter:function(a,
b){for(var c=0;c<this.length;c++)a.call(b||this,this[c])||(this.splice(c,1),c--);return this}};dhx.env={};
(function(){if(navigator.userAgent.indexOf("Mobile")!=-1)dhx.env.mobile=!0;if(dhx.env.mobile||navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("Android")!=-1)dhx.env.touch=!0;navigator.userAgent.indexOf("Opera")!=-1?dhx.env.isOpera=!0:(dhx.env.isIE=!!document.all,dhx.env.isFF=!document.all,dhx.env.isWebKit=navigator.userAgent.indexOf("KHTML")!=-1,dhx.env.isSafari=dhx.env.isWebKit&&navigator.userAgent.indexOf("Mac")!=-1);if(navigator.userAgent.toLowerCase().indexOf("android")!=
-1)dhx.env.isAndroid=!0;dhx.env.transform=!1;dhx.env.transition=!1;for(var a={names:["transform","transition"],transform:["transform","WebkitTransform","MozTransform","OTransform","msTransform"],transition:["transition","WebkitTransition","MozTransition","OTransition","msTransition"]},b=document.createElement("DIV"),c=0;c<a.names.length;c++)for(var d=a[a.names[c]],e=0;e<d.length;e++)if(typeof b.style[d[e]]!="undefined"){dhx.env[a.names[c]]=d[e];break}b.style[dhx.env.transform]="translate3d(0,0,0)";
dhx.env.translate=b.style[dhx.env.transform]?"translate3d":"translate";var f="",g=!1;dhx.env.isOpera&&(f="-o-",g="O");dhx.env.isFF&&(f="-Moz-");dhx.env.isWebKit&&(f="-webkit-");dhx.env.isIE&&(f="-ms-");dhx.env.transformCSSPrefix=f;dhx.env.transformPrefix=g||dhx.env.transformCSSPrefix.replace(/-/gi,"");dhx.env.transitionEnd=dhx.env.transformCSSPrefix=="-Moz-"?"transitionend":dhx.env.transformPrefix+"TransitionEnd"})();
dhx.env.svg=function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}();
dhx.html={v:0,denySelect:function(){if(!dhx.v)dhx.v=document.onselectstart;document.onselectstart=dhx.html.stopEvent},allowSelect:function(){if(dhx.v!==0)document.onselectstart=dhx.v||null;dhx.v=0},index:function(a){for(var b=0;a=a.previousSibling;)b++;return b},ga:{},createCss:function(a){var b="",c;for(c in a)b+=c+":"+a[c]+";";var d=this.ga[b];d||(d="s"+dhx.uid(),this.addStyle("."+d+"{"+b+"}"),this.ga[b]=d);return d},addStyle:function(a){var b=document.createElement("style");b.setAttribute("type",
"text/css");b.setAttribute("media","screen");b.styleSheet?b.styleSheet.cssText=a:b.appendChild(document.createTextNode(a));document.getElementsByTagName("head")[0].appendChild(b)},create:function(a,b,c){var b=b||{},d=document.createElement(a),e;for(e in b)d.setAttribute(e,b[e]);if(b.style)d.style.cssText=b.style;if(b["class"])d.className=b["class"];if(c)d.innerHTML=c;return d},getValue:function(a){a=dhx.toNode(a);return!a?"":dhx.isUndefined(a.value)?a.innerHTML:a.value},remove:function(a){if(a instanceof
Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else a&&a.parentNode&&a.parentNode.removeChild(a)},insertBefore:function(a,b,c){a&&(b&&b.parentNode?b.parentNode.insertBefore(a,b):c.appendChild(a))},locate:function(a,b){if(a.tagName)var c=a;else a=a||event,c=a.target||a.srcElement;for(;c;){if(c.getAttribute){var d=c.getAttribute(b);if(d)return d}c=c.parentNode}return null},offset:function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=
window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{y:Math.round(i),x:Math.round(j)}}else{for(j=i=0;a;)i+=parseInt(a.offsetTop,10),j+=parseInt(a.offsetLeft,10),a=a.offsetParent;return{y:i,x:j}}},posRelative:function(a){a=a||event;return dhx.isUndefined(a.offsetX)?{x:a.layerX,y:a.layerY}:{x:a.offsetX,y:a.offsetY}},pos:function(a){a=a||event;if(a.pageX||a.pageY)return{x:a.pageX,
y:a.pageY};var b=dhx.env.isIE&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:a.clientX+b.scrollLeft-b.clientLeft,y:a.clientY+b.scrollTop-b.clientTop}},preventEvent:function(a){a&&a.preventDefault&&a.preventDefault();return dhx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=!0;return!1},addCss:function(a,b){a.className+=" "+b},removeCss:function(a,b){a.className=a.className.replace(RegExp(" "+b,"g"),"")}};
dhx.ready=function(a){this.Ga?a.call():this.D.push(a)};dhx.D=[];(function(){var a=document.getElementsByTagName("SCRIPT");if(a.length)a=(a[a.length-1].getAttribute("src")||"").split("/"),a.splice(a.length-1,1),dhx.codebase=a.slice(0,a.length).join("/")+"/";dhx.event(window,"load",function(){dhx.callEvent("onReady",[]);dhx.delay(function(){dhx.Ga=!0;for(var a=0;a<dhx.D.length;a++)dhx.D[a].call();dhx.D=[]})})})();dhx.locale=dhx.locale||{};
dhx.ready(function(){dhx.event(document.body,"click",function(a){dhx.callEvent("onClick",[a||event])})});
(function(){var a={},b=RegExp("(\\r\\n|\\n)","g"),c=RegExp('(\\")',"g");dhx.Template=function(d){if(typeof d=="function")return d;if(a[d])return a[d];d=(d||"").toString();if(d.indexOf("->")!=-1)switch(d=d.split("->"),d[0]){case "html":d=dhx.html.getValue(d[1]);break;case "http":d=(new dhx.ajax).sync().get(d[1],{uid:dhx.uid()}).responseText}d=(d||"").toString();d=d.replace(b,"\\n");d=d.replace(c,'\\"');d=d.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');d=d.replace(/\{common\.([^}\(]*)\}/g,
"\"+(common.$1||'')+\"");d=d.replace(/\{common\.([^\}\(]*)\(\)\}/g,'"+(common.$1?common.$1.apply(this, arguments):"")+"');d=d.replace(/\{obj\.([^}]*)\}/g,'"+(obj.$1)+"');d=d.replace("{obj}",'"+obj+"');d=d.replace(/#([^#'";, ]+)#/gi,'"+(obj.$1)+"');try{a[d]=Function("obj","common",'return "'+d+'";')}catch(e){}return a[d]};dhx.Template.empty=function(){return""};dhx.Template.bind=function(a){return dhx.bind(dhx.Template(a),this)};dhx.Type=function(a,b){if(a.q){if(!a.r)a.r=[];a.r.push(b)}else{if(typeof a==
"function")a=a.prototype;if(!a.types)a.types={"default":a.type},a.type.name="default";var c=b.name,g=a.type;c&&(g=a.types[c]=dhx.clone(b.baseType?a.types[b.baseType]:a.type));for(var h in b)g[h]=h.indexOf("template")===0?dhx.Template(b[h]):b[h];return c}}})();
dhx.Settings={$init:function(){this.a=this.config={}},define:function(a,b){return typeof a=="object"?this.Q(a):this.U(a,b)},U:function(a,b){var c=this[a+"_setter"];return this.a[a]=c?c.call(this,b,a):b},Q:function(a){if(a)for(var b in a)this.U(b,a[b])},$:function(a,b){var c={};b&&(c=dhx.extend(c,b));typeof a=="object"&&!a.tagName&&dhx.extend(c,a,!0);this.Q(c)},Ba:function(a,b){for(var c in b)switch(typeof a[c]){case "object":a[c]=this.Ba(a[c]||{},b[c]);break;case "undefined":a[c]=b[c]}return a}};
dhx.ajax=function(a,b,c){if(arguments.length!==0){var d=new dhx.ajax;if(c)d.master=c;return d.get(a,null,b)}return!this.getXHR?new dhx.ajax:this};dhx.ajax.count=0;
dhx.ajax.prototype={master:null,getXHR:function(){return dhx.env.isIE?new ActiveXObject("Microsoft.xmlHTTP"):new XMLHttpRequest},send:function(a,b,c){var d=this.getXHR();dhx.isArray(c)||(c=[c]);if(typeof b=="object"){var e=[],f;for(f in b){var g=b[f];if(g===null||g===dhx.undefined)g="";e.push(f+"="+encodeURIComponent(g))}b=e.join("&")}b&&this.request==="GET"&&(a=a+(a.indexOf("?")!=-1?"&":"?")+b,b=null);d.open(this.request,a,!this.Na);this.request==="POST"&&d.setRequestHeader("Content-type","application/x-www-form-urlencoded");
var h=this;d.onreadystatechange=function(){if(!d.readyState||d.readyState==4){dhx.ajax.count++;if(c&&h)for(var a=0;a<c.length;a++)if(c[a]){var b=c[a].success||c[a];if(d.status>=400||!d.status&&!d.responseText)b=c[a].error;b&&b.call(h.master||h,d.responseText,d.responseXML,d)}if(h)h.master=null;c=h=null}};d.send(b||null);return d},get:function(a,b,c){this.request="GET";return this.send(a,b,c)},post:function(a,b,c){this.request="POST";return this.send(a,b,c)},put:function(a,b,c){this.request="PUT";
return this.send(a,b,c)},del:function(a,b,c){this.request="DELETE";return this.send(a,b,c)},sync:function(){this.Na=!0;return this},bind:function(a){this.master=a;return this}};dhx.send=function(a,b,c,d){var e=dhx.html.create("FORM",{target:d||"_self",action:a,method:c||"POST"},""),f;for(f in b){var g=dhx.html.create("INPUT",{type:"hidden",name:f,value:b[f]},"");e.appendChild(g)}e.style.display="none";document.body.appendChild(e);e.submit();document.body.removeChild(e)};
dhx.AtomDataLoader={$init:function(a){this.data={};if(a)this.a.datatype=a.datatype||"json",this.$ready.push(this.Aa)},Aa:function(){this.aa=!0;this.a.url&&this.url_setter(this.a.url);this.a.data&&this.data_setter(this.a.data)},url_setter:function(a){if(!this.aa)return a;this.load(a,this.a.datatype);return a},data_setter:function(a){if(!this.aa)return a;this.parse(a,this.a.datatype);return!0},load:function(a,b,c){if(a.$proxy)a.load(this,typeof b=="string"?b:"json");else{this.callEvent("onXLS",[]);
if(typeof b=="string")this.data.driver=dhx.DataDriver[b],b=c;else if(!this.data.driver)this.data.driver=dhx.DataDriver.json;var d=[{success:this.P}];b&&(dhx.isArray(b)?d.push.apply(d,b):d.push(b));return dhx.ajax(a,d,this)}},parse:function(a,b){this.callEvent("onXLS",[]);this.data.driver=dhx.DataDriver[b||"json"];this.P(a,null)},P:function(a,b,c){var d=this.data.driver,e=d.toObject(a,b);if(e){var f=d.getRecords(e)[0];this.data=d?d.getDetails(f):a}else this.C(a,b,c);this.callEvent("onXLE",[])},C:function(a,
b,c){this.callEvent("onXLE",[]);this.callEvent("onLoadError",arguments);dhx.callEvent("onLoadError",[a,b,c,this])},z:function(a){if(!this.a.dataFeed||this.N||!a)return!0;var b=this.a.dataFeed;if(typeof b=="function")return b.call(this,a.id||a,a);b=b+(b.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(a.id||a);this.callEvent("onXLS",[]);dhx.ajax(b,function(a,b,e){this.N=!0;var f=dhx.DataDriver.toObject(a,b);f?this.setValues(f.getDetails(f.getRecords()[0])):this.C(a,b,e);this.N=!1;this.callEvent("onXLE",
[])},this);return!1}};dhx.DataDriver={};
dhx.DataDriver.json={toObject:function(a){a||(a="[]");if(typeof a=="string"){try{eval("dhx.temp="+a)}catch(b){return null}a=dhx.temp}if(a.data){var c=a.data.config={},d;for(d in a)d!="data"&&(c[d]=a[d]);a=a.data}return a},getRecords:function(a){return a&&!dhx.isArray(a)?[a]:a},getDetails:function(a){return typeof a=="string"?{id:dhx.uid(),value:a}:a},getInfo:function(a){var b=a.config;return!b?{}:{n:b.total_count||0,m:b.pos||0,Ea:b.parent||0,K:b.config,O:b.dhx_security}},child:"data"};
dhx.DataDriver.html={toObject:function(a){if(typeof a=="string"){var b=null;a.indexOf("<")==-1&&(b=dhx.toNode(a));if(!b)b=document.createElement("DIV"),b.innerHTML=a;return b.getElementsByTagName(this.tag)}return a},getRecords:function(a){for(var b=[],c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];d.nodeType==1&&b.push(d)}return b},getDetails:function(a){return dhx.DataDriver.xml.tagToObject(a)},getInfo:function(){return{n:0,m:0}},tag:"LI"};
dhx.DataDriver.jsarray={toObject:function(a){return typeof a=="string"?(eval("dhx.temp="+a),dhx.temp):a},getRecords:function(a){return a},getDetails:function(a){for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{n:0,m:0}}};
dhx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(a){for(var a=this.stringToArray(a),b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{n:0,m:0}},stringToArray:function(a){for(var a=a.split(this.cell),b=0;b<a.length;b++)a[b]=a[b].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"");return a},row:"\n",cell:","};
dhx.DataDriver.xml={Y:function(a){return!a||!a.documentElement?null:a.getElementsByTagName("parsererror").length?null:a},toObject:function(a){if(this.Y(b))return b;var b=typeof a=="string"?this.fromString(a.replace(/^[\s]+/,"")):a;return this.Y(b)?b:null},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",child:"item",config:"/*/config",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(a){var b=this.xpath(a,this.config),b=b.length?this.assignTypes(this.tagToObject(b[0],
{})):null;return{n:a.documentElement.getAttribute("total_count")||0,m:a.documentElement.getAttribute("pos")||0,Ea:a.documentElement.getAttribute("parent")||0,K:b,O:a.documentElement.getAttribute("dhx_security")||null}},xpath:function(a,b){if(window.XPathResult){var c=a;if(a.nodeName.indexOf("document")==-1)a=a.ownerDocument;for(var d=[],e=a.evaluate(b,c,null,XPathResult.ANY_TYPE,null),f=e.iterateNext();f;)d.push(f),f=e.iterateNext();return d}else{var g=!0;try{typeof a.selectNodes=="undefined"&&(g=
!1)}catch(h){}if(g)return a.selectNodes(b);else{var i=b.split("/").pop();return a.getElementsByTagName(i)}}},assignTypes:function(a){for(var b in a){var c=a[b];typeof c=="object"?this.assignTypes(c):typeof c=="string"&&c!==""&&(c=="true"?a[b]=!0:c=="false"?a[b]=!1:c==c*1&&(a[b]*=1))}return a},tagToObject:function(a,b){var b=b||{},c=!1,d=a.attributes;if(d&&d.length){for(var e=0;e<d.length;e++)b[d[e].name]=d[e].value;c=!0}for(var f=a.childNodes,g={},e=0;e<f.length;e++)if(f[e].nodeType==1){var h=f[e].tagName;
typeof b[h]!="undefined"?(dhx.isArray(b[h])||(b[h]=[b[h]]),b[h].push(this.tagToObject(f[e],{}))):b[f[e].tagName]=this.tagToObject(f[e],{});c=!0}if(!c)return this.nodeValue(a);b.value=b.value||this.nodeValue(a);return b},nodeValue:function(a){return a.firstChild?a.firstChild.data:""},fromString:function(a){try{if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");if(window.ActiveXObject){var b=new ActiveXObject("Microsoft.xmlDOM");b.loadXML(a);return b}}catch(c){return null}}};
dhx.DataLoader=dhx.proto({$init:function(a){a=a||"";this.o=dhx.toArray();this.data=new dhx.DataStore;this.data.attachEvent("onClearAll",dhx.bind(this.oa,this));this.data.attachEvent("onServerConfig",dhx.bind(this.na,this));this.data.feed=this.sa},sa:function(a,b,c){if(this.u)return this.u=[a,b,c];else this.u=!0;this.W=[a,b];this.ua.call(this,a,b,c)},ua:function(a,b,c){var d=this.data.url;a<0&&(a=0);this.load(d+(d.indexOf("?")==-1?"?":"&")+(this.dataCount()?"continue=true&":"")+"start="+a+"&count="+
b,[this.ta,c])},ta:function(){var a=this.u,b=this.W;this.u=!1;typeof a=="object"&&(a[0]!=b[0]||a[1]!=b[1])&&this.data.feed.apply(this,a)},load:function(a,b){var c=dhx.AtomDataLoader.load.apply(this,arguments);this.o.push(c);if(!this.data.url)this.data.url=a},loadNext:function(a,b,c,d,e){this.a.datathrottle&&!e?(this.ha&&window.clearTimeout(this.ha),this.ha=dhx.delay(function(){this.loadNext(a,b,c,d,!0)},this,0,this.a.datathrottle)):(!b&&b!==0&&(b=this.dataCount()),this.data.url=this.data.url||d,this.callEvent("onDataRequest",
[b,a,c,d])&&this.data.url&&this.data.feed.call(this,b,a,c))},Ra:function(a,b){var c=this.W;return this.u&&c&&c[0]<=b&&c[1]+c[0]>=a+b?!0:!1},P:function(a,b,c){this.o.remove(c);var d=this.data.driver.toObject(a,b);if(d)this.data.Fa(d);else return this.C(a,b,c);this.pa();this.callEvent("onXLE",[])},removeMissed_setter:function(a){return this.data.Ja=a},scheme_setter:function(a){this.data.scheme(a)},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhx.bind(function(a,c){if(this.a.dataFeed){var d=
{};if(a||c){if(typeof a=="function"){if(!c)return;a(c,d)}else d={text:c};this.clearAll();var e=this.a.dataFeed,f=[];if(typeof e=="function")return e.call(this,c,d);for(var g in d)f.push("dhx_filter["+g+"]="+encodeURIComponent(d[g]));this.load(e+(e.indexOf("?")<0?"?":"&")+f.join("&"),this.a.datatype);return!1}}},this));return a},pa:function(){if(this.a.ready&&!this.Ha){var a=dhx.toFunctor(this.a.ready);a&&dhx.delay(a,this,arguments);this.Ha=!0}},oa:function(){for(var a=0;a<this.o.length;a++)this.o[a].abort();
this.o=dhx.toArray()},na:function(a){this.Q(a)}},dhx.AtomDataLoader);dhx.DataStore=function(){this.name="DataStore";dhx.extend(this,dhx.EventSystem);this.setDriver("json");this.pull={};this.order=dhx.toArray();this.d={}};
dhx.DataStore.prototype={setDriver:function(a){this.driver=dhx.DataDriver[a]},Fa:function(a){this.callEvent("onParse",[this.driver,a]);this.c&&this.filter();var b=this.driver.getInfo(a);if(b.O)dhx.securityKey=b.O;b.K&&this.callEvent("onServerConfig",[b.K]);var c=this.driver.getRecords(a);this.za(b,c);this.ba&&this.ya&&this.ya(this.ba);this.da&&(this.blockEvent(),this.sort(this.da),this.unblockEvent());this.callEvent("onStoreLoad",[this.driver,a]);this.refresh()},za:function(a,b){var c=(a.m||0)*1,
d=!0,e=!1;if(c===0&&this.order[0]){if(this.Ja)for(var e={},f=0;f<this.order.length;f++)e[this.order[f]]=!0;d=!1;c=this.order.length}for(var g=0,f=0;f<b.length;f++){var h=this.driver.getDetails(b[f]),i=this.id(h);this.pull[i]?d&&this.order[g+c]&&g++:(this.order[g+c]=i,g++);this.pull[i]?(dhx.extend(this.pull[i],h,!0),this.H&&this.H(this.pull[i]),e&&delete e[i]):(this.pull[i]=h,this.G&&this.G(h))}if(e){this.blockEvent();for(var j in e)this.remove(j);this.unblockEvent()}if(!this.order[a.n-1])this.order[a.n-
1]=dhx.undefined},id:function(a){return a.id||(a.id=dhx.uid())},changeId:function(a,b){this.pull[a]&&(this.pull[b]=this.pull[a]);this.pull[b].id=b;this.order[this.order.find(a)]=b;this.c&&(this.c[this.c.find(a)]=b);this.d[a]&&(this.d[b]=this.d[a],delete this.d[a]);this.callEvent("onIdChange",[a,b]);this.Ka&&this.Ka(a,b);delete this.pull[a]},item:function(a){return this.pull[a]},update:function(a,b){dhx.isUndefined(b)&&(b=this.item(a));this.H&&this.H(b);if(this.callEvent("onBeforeUpdate",[a,b])===
!1)return!1;this.pull[a]=b;this.callEvent("onStoreUpdated",[a,b,"update"])},refresh:function(a){this.fa||(a?this.callEvent("onStoreUpdated",[a,this.pull[a],"paint"]):this.callEvent("onStoreUpdated",[null,null,null]))},silent:function(a,b){this.fa=!0;a.call(b||this);this.fa=!1},getRange:function(a,b){a=a?this.indexById(a):this.$min||this.startOffset||0;b?b=this.indexById(b):(b=Math.min(this.$max||this.endOffset||Infinity,this.dataCount()-1),b<0&&(b=0));if(a>b)var c=b,b=a,a=c;return this.getIndexRange(a,
b)},getIndexRange:function(a,b){for(var b=Math.min(b||Infinity,this.dataCount()-1),c=dhx.toArray(),d=a||0;d<=b;d++)c.push(this.item(this.order[d]));return c},dataCount:function(){return this.order.length},exists:function(a){return!!this.pull[a]},move:function(a,b){var c=this.idByIndex(a),d=this.item(c);this.order.removeAt(a);this.order.insertAt(c,Math.min(this.order.length,b));this.callEvent("onStoreUpdated",[c,d,"move"])},scheme:function(a){this.F={};this.G=a.$init;this.H=a.$update;this.ca=a.$serialize;
this.ba=a.$group;this.da=a.$sort;for(var b in a)b.substr(0,1)!="$"&&(this.F[b]=a[b])},sync:function(a,b,c){typeof a=="string"&&(a=$$("source"));typeof b!="function"&&(c=b,b=null);this.I=!1;if(a.name!="DataStore")a.data&&a.data.name=="DataStore"?a=a.data:this.I=!0;var d=dhx.bind(function(d,f,g){if(this.I){if(!d)return;if(d.indexOf("change")==0){if(d=="change")this.pull[f.id]=f.attributes,this.refresh(f.id);return}d=="reset"&&(g=f);this.order=[];this.pull={};this.c=null;for(var h=0;h<g.models.length;h++){var i=
g.models[h].id;this.order.push(i);this.pull[i]=g.models[h].attributes}}else this.c=null,this.order=dhx.toArray([].concat(a.order)),this.pull=a.pull;b&&this.silent(b);this.Z&&this.Z();this.callEvent("onSyncApply",[]);c?c=!1:this.refresh()},this);this.I?a.bind("all",d):this.w=[a.attachEvent("onStoreUpdated",d)];d()},add:function(a,b,c){if(this.F)for(var d in this.F)dhx.isUndefined(a[d])&&(a[d]=this.F[d]);this.G&&this.G(a);var e=this.id(a),f=c||this.order,g=f.length;if(dhx.isUndefined(b)||b<0)b=g;b>
g&&(b=Math.min(f.length,b));if(this.callEvent("onBeforeAdd",[e,a,b])===!1)return!1;this.pull[e]=a;f.insertAt(e,b);if(this.c){var h=this.c.length;!b&&this.order.length&&(h=0);this.c.insertAt(e,h)}this.callEvent("onAfterAdd",[e,b]);this.callEvent("onStoreUpdated",[e,a,"add"]);return e},remove:function(a){if(dhx.isArray(a))for(var b=0;b<a.length;b++)this.remove(a[b]);else{if(this.callEvent("onBeforeDelete",[a])===!1)return!1;var c=this.item(a);this.order.remove(a);this.c&&this.c.remove(a);delete this.pull[a];
this.d[a]&&delete this.d[a];this.callEvent("onAfterDelete",[a]);this.callEvent("onStoreUpdated",[a,c,"delete"])}},clearAll:function(){this.pull={};this.order=dhx.toArray();this.c=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){return this.order[a]},indexById:function(a){var b=this.order.find(a);return b},next:function(a,b){return this.order[this.indexById(a)+(b||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(a,
b){return this.order[this.indexById(a)-(b||1)]},sort:function(a,b,c){var d=a;typeof a=="function"?d={as:a,dir:b}:typeof a=="string"&&(d={by:a.replace(/#/g,""),dir:b,as:c});var e=[d.by,d.dir,d.as];this.callEvent("onBeforeSort",e)&&(this.Ma(d),this.refresh(),this.callEvent("onAfterSort",e))},Ma:function(a){if(this.order.length){var b=this.La.qa(a),c=this.getRange(this.first(),this.last());c.sort(b);this.order=c.map(function(a){return this.id(a)},this)}},wa:function(a){if(this.c&&!a)this.order=this.c,
delete this.c},va:function(a,b,c){for(var d=dhx.toArray(),e=0;e<this.order.length;e++){var f=this.order[e];a(this.item(f),b)&&d.push(f)}if(!c||!this.c)this.c=this.order;this.order=d},filter:function(a,b,c){if(this.callEvent("onBeforeFilter",[a,b])&&(this.wa(c),this.order.length)){if(a){var d=a,b=b||"";typeof a=="string"&&(a=a.replace(/#/g,""),b=b.toString().toLowerCase(),d=function(b,c){return(b[a]||"").toString().toLowerCase().indexOf(c)!=-1});this.va(d,b,c,this.Pa)}this.refresh();this.callEvent("onAfterFilter",
[])}},each:function(a,b){for(var c=0;c<this.order.length;c++)a.call(b||this,this.item(this.order[c]))},Ca:function(a,b){return function(){return a[b].apply(a,arguments)}},addMark:function(a,b,c,d){var e=this.d[a]||{};this.d[a]=e;if(!e[b]&&(e[b]=d||!0,c))this.item(a).$css=(this.item(a).$css||"")+" "+b,this.refresh(a);return e[b]},removeMark:function(a,b,c){var d=this.d[a];d&&d[b]&&delete d[b];if(c){var e=this.item(a).$css;e&&(e=this.item(a).$css.replace(b,""),this.refresh(a))}},hasMark:function(a,
b){var c=this.d[a];return c&&c[b]},provideApi:function(a,b){b&&this.mapEvent({onbeforesort:a,onaftersort:a,onbeforeadd:a,onafteradd:a,onbeforedelete:a,onafterdelete:a,onbeforeupdate:a});for(var c="sort,add,remove,exists,idByIndex,indexById,item,update,refresh,dataCount,filter,next,previous,clearAll,first,last,serialize,sync,addMark,removeMark,hasMark".split(","),d=0;d<c.length;d++)a[c[d]]=this.Ca(this,c[d])},serialize:function(){for(var a=this.order,b=[],c=0;c<a.length;c++){var d=this.pull[a[c]];
(!this.ca||!(d=this.ca(d),d===!1))&&b.push(d)}return b},La:{qa:function(a){return this.ra(a.dir,this.ma(a.by,a.as))},ja:{date:function(a,b){a-=0;b-=0;return a>b?1:a<b?-1:0},"int":function(a,b){a*=1;b*=1;return a>b?1:a<b?-1:0},string_strict:function(a,b){a=a.toString();b=b.toString();return a>b?1:a<b?-1:0},string:function(a,b){if(!b)return 1;if(!a)return-1;a=a.toString().toLowerCase();b=b.toString().toLowerCase();return a>b?1:a<b?-1:0}},ma:function(a,b){if(!a)return b;typeof b!="function"&&(b=this.ja[b||
"string"]);return function(c,d){return b(c[a],d[a])}},ra:function(a,b){return a=="asc"||!a?b:function(a,d){return b(a,d)*-1}}}};
dhx.BaseBind={bind:function(a,b,c){typeof a=="string"&&(a=dhx.ui.get(a));a.b&&a.b();this.b&&this.b();a.getBindData||dhx.extend(a,dhx.BindSource);if(!this.ka){var d=this.render;if(this.filter){var e=this.a.id;this.data.Z=function(){a.l[e]=!1}}this.render=function(){if(!this.X){this.X=!0;var a=this.callEvent("onBindRequest");this.X=!1;return d.apply(this,a===!1?arguments:[])}};if(this.getValue||this.getValues)this.save=function(){if(!this.validate||this.validate())a.setBindData(this.getValue?this.getValue:
this.getValues(),this.a.id)};this.ka=!0}a.addBind(this.a.id,b,c);var f=this.a.id;this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){return a.getBindData(f)});!this.a.dataFeed&&this.loadNext&&this.data.attachEvent("onStoreLoad",function(){a.l[f]=!1});this.isVisible(this.a.id)&&this.refresh()},g:function(a){a.removeBind(this.a.id);var b=this.w||(this.data?this.data.w:0);if(b&&a.data)for(var c=0;c<b.length;c++)a.data.detachEvent(b[c])}};
dhx.BindSource={$init:function(){this.p={};this.l={};this.A={};this.la(this)},saveBatch:function(a){this.V=!0;a.call(this);this.V=!1;this.k()},setBindData:function(a,b){b&&(this.A[b]=!0);if(this.setValue)this.setValue(a);else if(this.setValues)this.setValues(a);else{var c=this.getCursor();c&&(a=dhx.extend(this.item(c),a,!0),this.update(c,a))}this.callEvent("onBindUpdate",[a,b]);this.save&&this.save();b&&(this.A[b]=!1)},getBindData:function(a,b){if(this.l[a])return!1;var c=dhx.ui.get(a);c.isVisible(c.a.id)&&
(this.l[a]=!0,this.J(c,this.p[a][0],this.p[a][1]),b&&c.filter&&c.refresh())},addBind:function(a,b,c){this.p[a]=[b,c]},removeBind:function(a){delete this.p[a];delete this.l[a];delete this.A[a]},la:function(a){a.filter?dhx.extend(this,dhx.CollectionBind):a.setValue?dhx.extend(this,dhx.ValueBind):dhx.extend(this,dhx.RecordBind)},k:function(){if(!this.V)for(var a in this.p)this.A[a]||(this.l[a]=!1,this.getBindData(a,!0))},S:function(a,b,c){a.setValue?a.setValue(c?c[b]:c):a.filter?a.data.silent(function(){this.filter(b,
c)}):!c&&a.clear?a.clear():a.z(c)&&a.setValues(dhx.clone(c));a.callEvent("onBindApply",[c,b,this])}};dhx.DataValue=dhx.proto({name:"DataValue",isVisible:function(){return!0},$init:function(a){var b=(this.data=a)&&a.id?a.id:dhx.uid();this.a={id:b};dhx.ui.views[b]=this},setValue:function(a){this.data=a;this.callEvent("onChange",[a])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind);
dhx.DataRecord=dhx.proto({name:"DataRecord",isVisible:function(){return!0},$init:function(a){this.data=a||{};var b=a&&a.id?a.id:dhx.uid();this.a={id:b};dhx.ui.views[b]=this},getValues:function(){return this.data},setValues:function(a){this.data=a;this.callEvent("onChange",[a])},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind,dhx.AtomDataLoader,dhx.Settings);
dhx.DataCollection=dhx.proto({name:"DataCollection",isVisible:function(){return!this.data.order.length&&!this.data.c&&!this.a.dataFeed?!1:!0},$init:function(a){this.data.provideApi(this,!0);var b=a&&a.id?a.id:dhx.uid();this.a.id=b;dhx.ui.views[b]=this;this.data.attachEvent("onStoreLoad",dhx.bind(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},dhx.DataLoader,dhx.EventSystem,dhx.BaseBind,dhx.Settings);
dhx.ValueBind={$init:function(){this.attachEvent("onChange",this.k)},J:function(a,b,c){var d=this.getValue()||"";c&&(d=c(d));if(a.setValue)a.setValue(d);else if(a.filter)a.data.silent(function(){this.filter(b,d)});else{var e={};e[b]=d;a.z(d)&&a.setValues(e)}a.callEvent("onBindApply",[d,b,this])}};dhx.RecordBind={$init:function(){this.attachEvent("onChange",this.k)},J:function(a,b){var c=this.getValues()||null;this.S(a,b,c)}};
dhx.CollectionBind={$init:function(){this.h=null;this.attachEvent("onSelectChange",function(){var a=this.getSelected();this.setCursor(a?a.id||a:null)});this.attachEvent("onAfterCursorChange",this.k);this.data.attachEvent("onStoreUpdated",dhx.bind(function(a,b,c){a&&a==this.getCursor()&&c!="paint"&&this.k()},this));this.data.attachEvent("onClearAll",dhx.bind(function(){this.h=null},this));this.data.attachEvent("onIdChange",dhx.bind(function(a,b){if(this.h==a)this.h=b},this))},setCursor:function(a){if(!(a==
this.h||a!==null&&!this.item(a)))this.callEvent("onBeforeCursorChange",[this.h]),this.h=a,this.callEvent("onAfterCursorChange",[a])},getCursor:function(){return this.h},J:function(a,b){var c=this.item(this.getCursor())||this.a.defaultData||null;this.S(a,b,c)}};if(!dhx.ui)dhx.ui={};if(!dhx.ui.views)dhx.ui.views={},dhx.ui.get=function(a){return a.a?a:dhx.ui.views[a]};
dhtmlXDataStore=function(a){var b=new dhx.DataCollection(a),c="_dp_init";b[c]=function(a){var b="_methods";a[b]=["dummy","dummy","changeId","dummy"];this.data.Da={add:"inserted",update:"updated","delete":"deleted"};this.data.attachEvent("onStoreUpdated",function(b,c,e){b&&!a.ea&&a.setUpdated(b,!0,this.Da[e])});b="_getRowData";a[b]=function(a){var b=this.obj.data.item(a),c={id:a,"!nativeeditor_status":this.obj.getUserData(a)};if(b)for(var d in b)d.indexOf("_")!==0&&(c[d]=b[d]);return c};this.changeId=
function(b,c){this.data.changeId(b,c);a.ea=!0;this.data.callEvent("onStoreUpdated",[c,this.item(c),"update"]);a.ea=!1};b="_clearUpdateFlag";a[b]=function(){};this.ia={}};b.dummy=function(){};b.setUserData=function(a,b,c){this.ia[a]=c};b.getUserData=function(a){return this.ia[a]};b.dataFeed=function(a){this.define("dataFeed",a)};dhx.extend(b,dhx.BindSource);return b};
if(window.dhtmlXDataView)dhtmlXDataView.prototype.b=function(){this.isVisible=function(){return!this.data.order.length&&!this.data.c&&!this.a.dataFeed?!1:!0};var a="_settings";this.a=this.a||this[a];if(!this.a.id)this.a.id=dhx.uid();this.unbind=dhx.BaseBind.unbind;this.unsync=dhx.BaseBind.unsync;dhx.ui.views[this.a.id]=this};
if(window.dhtmlXChart)dhtmlXChart.prototype.b=function(){this.isVisible=function(){return!this.data.order.length&&!this.data.Qa&&!this.a.dataFeed?!1:!0};var a="_settings";this.a=this.a||this[a];if(!this.a.id)this.a.id=dhx.uid();this.unbind=dhx.BaseBind.unbind;this.unsync=dhx.BaseBind.unsync;dhx.ui.views[this.a.id]=this};dhx.BaseBind.unsync=function(a){return dhx.BaseBind.g.call(this,a)};dhx.BaseBind.unbind=function(a){return dhx.BaseBind.g.call(this,a)};
dhx.BaseBind.legacyBind=function(){return dhx.BaseBind.bind.apply(this,arguments)};
dhx.BaseBind.legacySync=function(a,b){this.b&&this.b();a.b&&a.b();this.attachEvent("onAfterEditStop",function(a){this.save(a);return!0});this.attachEvent("onDataRequest",function(b,d){for(var e=b;e<b+d;e++)if(!a.data.order[e])return a.loadNext(d,b),!1});this.save=function(b){b||(b=this.getCursor());var d=this.item(b),e=a.item(b),f;for(f in d)f.indexOf("$")!==0&&(e[f]=d[f]);a.refresh(b)};return a&&a.name=="DataCollection"?a.data.sync.apply(this.data,arguments):this.data.sync.apply(this.data,arguments)};
if(window.dhtmlXForm)dhtmlXForm.prototype.bind=function(a){dhx.BaseBind.bind.apply(this,arguments);a.getBindData(this.a.id)},dhtmlXForm.prototype.unbind=function(a){dhx.BaseBind.g.call(this,a)},dhtmlXForm.prototype.b=function(){if(dhx.isUndefined(this.a))this.a={id:dhx.uid(),dataFeed:this.j},dhx.ui.views[this.a.id]=this},dhtmlXForm.prototype.z=function(a){if(!this.a.dataFeed||this.N||!a)return!0;var b=this.a.dataFeed;if(typeof b=="function")return b.call(this,a.id||a,a);b=b+(b.indexOf("?")==-1?"?":
"&")+"action=get&id="+encodeURIComponent(a.id||a);this.load(b);return!1},dhtmlXForm.prototype.setValues=dhtmlXForm.prototype.setFormData,dhtmlXForm.prototype.getValues=function(){return this.getFormData(!1,!0)},dhtmlXForm.prototype.dataFeed=function(a){this.a?this.a.dataFeed=a:this.j=a},dhtmlXForm.prototype.refresh=dhtmlXForm.prototype.isVisible=function(){return!0};
if(window.scheduler){if(!window.Scheduler)window.Scheduler={};Scheduler.$syncFactory=function(a){a.sync=function(b,c){this.b&&this.b();b.b&&b.b();var d="_process_loading",e=function(){a.clearAll();for(var e=b.data.order,g=b.data.pull,h=[],i=0;i<e.length;i++)h[i]=c&&c.copy?dhx.clone(g[e[i]]):g[e[i]];a[d](h)};this.save=function(a){a||(a=this.getCursor());var c=this.item(a),d=b.item(a);this.callEvent("onStoreSave",[a,c,d])&&(dhx.extend(b.item(a),c,!0),b.update(a))};this.item=function(a){return this.getEvent(a)};
this.w=[b.data.attachEvent("onStoreUpdated",function(){e.call(this)}),b.data.attachEvent("onIdChange",function(a,b){combo.changeOptionId(a,b)})];this.attachEvent("onEventChanged",function(a){this.save(a)});this.attachEvent("onEventAdded",function(a,c){b.data.pull[a]||b.add(c)});this.attachEvent("onEventDeleted",function(a){b.data.pull[a]&&b.remove(a)});e()};a.unsync=function(a){dhx.BaseBind.g.call(this,a)};a.b=function(){if(!this.a)this.a={id:dhx.uid()}}};Scheduler.$syncFactory(window.scheduler)}
if(window.dhtmlXCombo)dhtmlXCombo.prototype.bind=function(){dhx.BaseBind.bind.apply(this,arguments)},dhtmlXCombo.unbind=function(a){dhx.BaseBind.g.call(this,a)},dhtmlXCombo.unsync=function(a){dhx.BaseBind.g.call(this,a)},dhtmlXCombo.prototype.dataFeed=function(a){this.a?this.a.dataFeed=a:this.j=a},dhtmlXCombo.prototype.sync=function(a){this.b&&this.b();a.b&&a.b();var b=this,c=function(){b.clearAll();b.addOption(this.serialize())};this.w=[a.data.attachEvent("onStoreUpdated",function(){c.call(this)}),
a.data.attachEvent("onIdChange",function(a,c){b.changeOptionId(a,c)})];c.call(a)},dhtmlXCombo.prototype.b=function(){if(dhx.isUndefined(this.a))this.a={id:dhx.uid(),dataFeed:this.j},dhx.ui.views[this.a.id]=this,this.data={silent:dhx.bind(function(a){a.call(this)},this)},dhtmlxEventable(this.data),this.attachEvent("onChange",function(){this.callEvent("onSelectChange",[this.getSelectedValue()])}),this.attachEvent("onXLE",function(){this.callEvent("onBindRequest",[])})},dhtmlXCombo.prototype.item=function(){return this.Sa},
dhtmlXCombo.prototype.getSelected=function(){return this.getSelectedValue()},dhtmlXCombo.prototype.isVisible=function(){return!this.optionsArr.length&&!this.a.dataFeed?!1:!0},dhtmlXCombo.prototype.refresh=function(){this.render(!0)},dhtmlXCombo.prototype.filter=function(){alert("not implemented")};
if(window.dhtmlXGridObject)dhtmlXGridObject.prototype.bind=function(a,b,c){dhx.BaseBind.bind.apply(this,arguments)},dhtmlXGridObject.prototype.unbind=function(a){dhx.BaseBind.g.call(this,a)},dhtmlXGridObject.prototype.unsync=function(a){dhx.BaseBind.g.call(this,a)},dhtmlXGridObject.prototype.dataFeed=function(a){this.a?this.a.dataFeed=a:this.j=a},dhtmlXGridObject.prototype.sync=function(a,b){this.b&&this.b();a.b&&a.b();var c=this,d="_parsing",e="_parser",f="_locator",g="_process_store_row",h="_get_store_data";
this.save=function(b){b||(b=this.getCursor());dhx.extend(a.item(b),this.item(b),!0);a.update(b)};var i=function(){var a=0;c.B?(a=c.B,c.B=!1):c.clearAll();var b=this.dataCount();if(b){c[d]=!0;for(var i=a;i<b;i++){var l=this.order[i];if(l&&(!a||!c.rowsBuffer[i]))c.rowsBuffer[i]={idd:l,data:this.pull[l]},c.rowsBuffer[i][e]=c[g],c.rowsBuffer[i][f]=c[h],c.rowsAr[l]=this.pull[l]}if(!c.rowsBuffer[b-1])c.rowsBuffer[b-1]=dhtmlx.undefined,c.xmlFileUrl=c.xmlFileUrl||!0;c.pagingOn?c.changePage():c.Ta&&c.Oa?c.Ua():
(c.render_dataset(),c.callEvent("onXLE",[]));c[d]=!1}};this.w=[a.data.attachEvent("onStoreUpdated",function(a,b,d){d=="delete"?(c.deleteRow(a),c.data.callEvent("onStoreUpdated",[a,b,d])):d=="update"?(c.callEvent("onSyncUpdate",[b,d]),c.update(a,b),c.data.callEvent("onStoreUpdated",[a,b,d])):d=="add"?(c.callEvent("onSyncUpdate",[b,d]),c.add(a,b,this.indexById(a)),c.data.callEvent("onStoreUpdated",[a,b,d])):i.call(this)}),a.data.attachEvent("onStoreLoad",function(b,d){c.xmlFileUrl=a.data.url;c.B=b.getInfo(d).m}),
a.data.attachEvent("onIdChange",function(a,b){c.changeRowId(a,b)})];c.attachEvent("onDynXLS",function(b,d){for(var e=b;e<b+d;e++)if(!a.data.order[e])return a.loadNext(d,b),!1;c.B=b;i.call(a.data)});i.call(a.data);c.attachEvent("onEditCell",function(a,b){a==2&&this.save(b);return!0});c.attachEvent("onClearAll",function(){var a="_f_rowsBuffer";this[a]=null});b&&b.sort&&c.attachEvent("onBeforeSorting",function(b,d,e){if(d=="connector")return!1;var f=this.getColumnId(b);a.sort("#"+f+"#",e=="asc"?"asc":
"desc",d=="int"?d:"string");c.setSortImgState(!0,b,e);return!1});if(b&&b.filter)c.attachEvent("onFilterStart",function(b,d){var e="_con_f_used";if(c[e]&&c[e].length)return!1;a.data.silent(function(){a.filter();for(var e=0;e<b.length;e++)if(d[e]!=""){var f=c.getColumnId(b[e]);a.filter("#"+f+"#",d[e],e!=0)}});a.refresh();return!1}),c.collectValues=function(b){var c=this.getColumnId(b);return function(a){var b=[],c={};this.data.each(function(d){var e=d[a];c[e]||(c[e]=!0,b.push(e))});return b}.call(a,
c)};b&&b.select&&c.attachEvent("onRowSelect",function(b){a.setCursor(b)});c.clearAndLoad=function(b){a.clearAll();a.load(b)}},dhtmlXGridObject.prototype.b=function(){if(dhx.isUndefined(this.a)){this.a={id:dhx.uid(),dataFeed:this.j};dhx.ui.views[this.a.id]=this;this.data={silent:dhx.bind(function(a){a.call(this)},this)};dhtmlxEventable(this.data);for(var a="_cCount",b=0;b<this[a];b++)this.columnIds[b]||(this.columnIds[b]="cell"+b);this.attachEvent("onSelectStateChanged",function(a){this.callEvent("onSelectChange",
[a])});this.attachEvent("onSelectionCleared",function(){this.callEvent("onSelectChange",[null])});this.attachEvent("onEditCell",function(a,b){a===2&&this.getCursor&&b&&b==this.getCursor()&&this.k();return!0});this.attachEvent("onXLE",function(){this.callEvent("onBindRequest",[])})}},dhtmlXGridObject.prototype.item=function(a){if(a===null)return null;var b=this.getRowById(a);if(!b)return null;var c="_attrs",d=dhx.copy(b[c]);d.id=a;for(var e=this.getColumnsNum(),f=0;f<e;f++)d[this.columnIds[f]]=this.cells(a,
f).getValue();return d},dhtmlXGridObject.prototype.update=function(a,b){for(var c=0;c<this.columnIds.length;c++){var d=this.columnIds[c];dhx.isUndefined(b[d])||this.cells(a,c).setValue(b[d])}var e="_attrs",f=this.getRowById(a)[e];for(d in b)f[d]=b[d];this.callEvent("onBindUpdate",[a])},dhtmlXGridObject.prototype.add=function(a,b,c){for(var d=[],e=0;e<this.columnIds.length;e++){var f=this.columnIds[e];d[e]=dhx.isUndefined(b[f])?"":b[f]}this.addRow(a,d,c);var g="_attrs";this.getRowById(a)[g]=dhx.copy(b)},
dhtmlXGridObject.prototype.getSelected=function(){return this.getSelectedRowId()},dhtmlXGridObject.prototype.isVisible=function(){var a="_f_rowsBuffer";return!this.rowsBuffer.length&&!this[a]&&!this.a.dataFeed?!1:!0},dhtmlXGridObject.prototype.refresh=function(){this.render_dataset()},dhtmlXGridObject.prototype.filter=function(a,b){if(this.a.dataFeed){var c={};if(!a&&!b)return;if(typeof a=="function"){if(!b)return;a(b,c)}else dhx.isUndefined(a)?c=b:c[a]=b;this.clearAll();var d=this.a.dataFeed;if(typeof d==
"function")return d.call(this,b,c);var e=[],f;for(f in c)e.push("dhx_filter["+f+"]="+encodeURIComponent(c[f]));this.load(d+(d.indexOf("?")<0?"?":"&")+e.join("&"));return!1}if(b===null)return this.filterBy(0,function(){return!1});this.filterBy(0,function(c,d){return a.call(this,d,b)})};
if(window.dhtmlXTreeObject)dhtmlXTreeObject.prototype.bind=function(){dhx.BaseBind.bind.apply(this,arguments)},dhtmlXTreeObject.prototype.unbind=function(a){dhx.BaseBind.g.call(this,a)},dhtmlXTreeObject.prototype.dataFeed=function(a){this.a?this.a.dataFeed=a:this.j=a},dhtmlXTreeObject.prototype.b=function(){if(dhx.isUndefined(this.a))this.a={id:dhx.uid(),dataFeed:this.j},dhx.ui.views[this.a.id]=this,this.data={silent:dhx.bind(function(a){a.call(this)},this)},dhtmlxEventable(this.data),this.attachEvent("onSelect",
function(a){this.callEvent("onSelectChange",[a])}),this.attachEvent("onEdit",function(a,b){a===2&&b&&b==this.getCursor()&&this.k();return!0})},dhtmlXTreeObject.prototype.item=function(a){return a===null?null:{id:a,text:this.getItemText(a)}},dhtmlXTreeObject.prototype.getSelected=function(){return this.getSelectedItemId()},dhtmlXTreeObject.prototype.isVisible=function(){return!0},dhtmlXTreeObject.prototype.refresh=function(){},dhtmlXTreeObject.prototype.filter=function(a,b){if(this.a.dataFeed){var c=
{};if(a||b){if(typeof a=="function"){if(!b)return;a(b,c)}else dhx.isUndefined(a)?c=b:c[a]=b;this.deleteChildItems(0);var d=this.a.dataFeed;if(typeof d=="function")return d.call(this,[data.id||data,data]);var e=[],f;for(f in c)e.push("dhx_filter["+f+"]="+encodeURIComponent(c[f]));this.loadXML(d+(d.indexOf("?")<0?"?":"&")+e.join("&"));return!1}}},dhtmlXTreeObject.prototype.update=function(a,b){dhx.isUndefined(b.text)||this.setItemText(a,b.text)};dhtmlx.skin="dhx_skyblue";
