/*
Copyright Dinamenta, UAB http://www.dhtmlx.com
You allowed to use this component or parts of it under GPL terms
To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com
*/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.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;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(_isIE&&!this._retry){var e=this.xmlDoc.responseText,b=this.xmlDoc;this._retry=!0;this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=!1;this.xmlDoc.loadXML(e);return this.getXMLTopNode(a,
b)}dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]);return document.createElement("DIV")};
dtmlXMLLoaderObject.prototype.loadXMLString=function(a){if(_isIE)this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDoc.async=this.async,this.xmlDoc.onreadystatechange=function(){},this.xmlDoc.loadXML(a);else{var b=new DOMParser;this.xmlDoc=b.parseFromString(a,"text/xml")}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);
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):navigator.userAgent.indexOf("Opera")!=-1?(_isOpera=!0,_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))):navigator.appName.indexOf("Microsoft")!=-1?(_isIE=!0,navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat"&&
(_isIE=8),navigator.appVersion.indexOf("MSIE 9.0")!=-1&&document.compatMode!="BackCompat"&&(_isIE=8)):(_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]}};
(function(){var a=dhtmlx.message=function(b,c,d,e){if(!a.area)a.area=document.createElement("DIV"),a.area.style.cssText="position:absolute;right:5px;width:250px;z-index:100;",a.area.className="dhtmlx_message_area",a.area.style[a.defPosition]="5px",document.body.appendChild(a.area);typeof b!="object"&&(b={text:b,type:c,lifetime:d,id:e});b.type=b.type||"info";b.id=b.id||a.uid();b.lifetime=b.lifetime||a.defTimeout;a.hide(b.id);var f=document.createElement("DIV");f.style.cssText="border-radius:4px; padding:4px 4px 4px 20px;background-color:#FFFFCC;font-size:12px;font-family:Tahoma;color:navy;z-index: 10000;margin:5px;border:1px solid lightgrey;";
f.innerHTML=b.text;f.className=b.type;a.defPosition=="bottom"&&a.area.firstChild?a.area.insertBefore(f,a.area.firstChild):a.area.appendChild(f);a.timers[b.id]=window.setTimeout(function(){a.hide(b.id)},b.lifetime);a.pull[b.id]=f;return b.id};a.defTimeout=4E3;a.defPosition="top";a.pull={};a.timers={};a.seed=(new Date).valueOf();a.uid=function(){return a.seed++};a.hideAll=function(){for(var b in a.pull)a.hide(b)};a.hide=function(b){var c=a.pull[b];c&&c.parentNode&&(c.parentNode.removeChild(c),window.clearTimeout(a.timers[b]),
delete a.pull[b])}})();function dhtmlXAccordionItem(){}
function dhtmlXAccordion(a,b){if(window.dhtmlXContainer){var c=this;this.skin=b!=null?b:"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}};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.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){var d=document.createElement("DIV");d.className="dhx_acc_item";d.dir="ltr";d._isAcc=!0;d.skin=this.skin;this.base.appendChild(d);if(this.multiMode)d.h=this.itemH;var h=document.createElement("DIV");h._idd=a;h.className="dhx_acc_item_label";h.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>";h.onselectstart=
function(a){a=a||event;a.returnValue=!1};h.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.checkEvent("onBeforeActive")?c.callEvent("onBeforeActive",[this._idd,"open"])&&c.openItem(this._idd,"dhx_accord_outer_event"):c.openItem(this._idd,"dhx_accord_outer_event")};h.onmouseover=function(){this.className="dhx_acc_item_label dhx_acc_item_lavel_hover"};h.onmouseout=function(){this.className="dhx_acc_item_label"};d.appendChild(h);var i=document.createElement("DIV");i.className="dhxcont_global_content_area";d.appendChild(i);var j=new dhtmlXContainer(d);j.setContent(i);d.adjustContent(d,this.sk.cell_height+
this.sk.content_offset);d._id=a;this.idPull[a]=d;d.getId=function(){return this._id};d.setText=function(a){c.setText(this._id,a)};d.getText=function(){return c.getText(this._id)};d.open=function(){c.openItem(this._id)};d.isOpened=function(){return c.isActive(this._id)};d.close=function(){c.closeItem(this._id)};d.setIcon=function(a){c.setIcon(this._id,a)};d.clearIcon=function(){c.clearIcon(this._id)};d.dock=function(){c.dockItem(this._id)};d.undock=function(){c.undockItem(this._id)};d.show=function(){c.showItem(this._id)};
d.hide=function(){c.hideItem(this._id)};d.setHeight=function(a){c.setItemHeight(this._id,a)};d.moveOnTop=function(){c.moveOnTop(this._id)};d._doOnAttachMenu=function(){c._reopenItem()};d._doOnAttachToolbar=function(){c._reopenItem()};d._doOnAttachStatusBar=function(){c._reopenItem()};this.openItem(a);this.multiMode||this._defineLastItem();return d};this.openItem=function(a,b,c){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._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)+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&&!isNaN(b))this.idPull[a].h=b,this._reopenItem()};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--)if(this.base.childNodes[b].className.search("last_item")>=0){if(this.base.childNodes[b]._isHidden||
a)this.base.childNodes[b].className=String(this.base.childNodes[b].className).replace(/last_item/gi,"")}else!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()}})})();
function dhtmlXContainer(a){var b=this;this.obj=a;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}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.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()};this.obj._init=function(){this.vs[this.av].dhxcont.innerHTML="<div ida='dhxMainCont' style='position: relative; left: 0px; top: 0px; overflow: hidden;'></div><div ida='dhxContBlocker' 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]):(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"]),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)a.cv==a.av?a.vs[a.av].dhxcont.insertBefore(document.getElementById(this.vs[b].menuId),a.vs[a.av].dhxcont.childNodes[0]):a._getSt().appendChild(document.getElementById(this.vs[b].menuId)),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]):a._getSt().appendChild(document.getElementById(this.vs[b].toolbarId)),
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)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]):a._getSt().appendChild(document.getElementById(this.vs[b].sbId)),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 g=this.vs[b].dhxcont.mainCont[b],h=a.vs[b].dhxcont.mainCont[b];g.childNodes.length>0;)h.appendChild(g.childNodes[0])}a.view(this.av).setActive()};
this.obj.adjustContent=function(a,b,c,g,h){this.vs[this.av].dhxcont.style.left=(this._offsetLeft||0)+"px";this.vs[this.av].dhxcont.style.top=(this._offsetTop||0)+b+"px";var i=a.clientWidth+(this._offsetWidth||0);if(g!==!0)this.vs[this.av].dhxcont.style.width=Math.max(0,i)+"px";if(g!==!0&&this.vs[this.av].dhxcont.offsetWidth>i)this.vs[this.av].dhxcont.style.width=Math.max(0,i*2-this.vs[this.av].dhxcont.offsetWidth)+"px";var j=a.clientHeight+(this._offsetHeight||0);this.vs[this.av].dhxcont.style.height=
Math.max(0,j-b)+(c!=null?c:0)+"px";if(this.vs[this.av].dhxcont.offsetHeight>j-b)this.vs[this.av].dhxcont.style.height=Math.max(0,(j-b)*2-this.vs[this.av].dhxcont.offsetHeight)+"px";if(h&&!isNaN(h))this.vs[this.av].dhxcont.style.height=Math.max(0,parseInt(this.vs[this.av].dhxcont.style.height)-h)+"px";if(this.vs[this.av]._minDataSizeH!=null&&parseInt(this.vs[this.av].dhxcont.style.height)<this.vs[this.av]._minDataSizeH)this.vs[this.av].dhxcont.style.height=this.vs[this.av]._minDataSizeH+"px";if(this.vs[this.av]._minDataSizeW!=
null&&parseInt(this.vs[this.av].dhxcont.style.width)<this.vs[this.av]._minDataSizeW)this.vs[this.av].dhxcont.style.width=this.vs[this.av]._minDataSizeW+"px";if(g!==!0&&(this.vs[this.av].dhxcont.mainCont[this.av].style.width=this.vs[this.av].dhxcont.clientWidth+"px",this.vs[this.av].dhxcont.mainCont[this.av].offsetWidth>this.vs[this.av].dhxcont.clientWidth))this.vs[this.av].dhxcont.mainCont[this.av].style.width=Math.max(0,this.vs[this.av].dhxcont.clientWidth*2-this.vs[this.av].dhxcont.mainCont[this.av].offsetWidth)+
"px";var k=this.vs[this.av].menu!=null?!this.vs[this.av].menuHidden?this.vs[this.av].menuHeight:0:0,m=this.vs[this.av].toolbar!=null?!this.vs[this.av].toolbarHidden?this.vs[this.av].toolbarHeight:0:0,l=this.vs[this.av].sb!=null?!this.vs[this.av].sbHidden?this.vs[this.av].sbHeight:0:0;this.vs[this.av].dhxcont.mainCont[this.av].style.height=this.vs[this.av].dhxcont.clientHeight+"px";if(this.vs[this.av].dhxcont.mainCont[this.av].offsetHeight>this.vs[this.av].dhxcont.clientHeight)this.vs[this.av].dhxcont.mainCont[this.av].style.height=
Math.max(0,this.vs[this.av].dhxcont.clientHeight*2-this.vs[this.av].dhxcont.mainCont[this.av].offsetHeight)+"px";this.vs[this.av].dhxcont.mainCont[this.av].style.height=Math.max(0,parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)-k-m-l)+"px"};this.obj.coverBlocker=function(){return this.vs[this.av].dhxcont.childNodes[this.vs[this.av].dhxcont.childNodes.length-1]};this.obj.showCoverBlocker=function(){this.coverBlocker().style.display=""};this.obj.hideCoverBlocker=function(){this.coverBlocker().style.display=
"none"};this.obj.updateNestedObjects=function(){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.vs[this.av].dhxcont._isAcc||this.vs[this.av].dhxcont._isTabbarCell)&&
this.vs[this.av].dhxcont.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=this.skin=="dhx_web"?41:c.offsetHeight+(this._isLayout&&this.skin=="dhx_skyblue"?2:0);this.vs[this.av].toolbarId=
c.id;this._doOnAttachToolbar&&this._doOnAttachToolbar("init");this.adjust();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);this.vs[this.av].grid=new dhtmlXGridObject(a.id);this.vs[this.av].grid.setSkin(this.skin);if(this.skin!="dhx_web")this.vs[this.av].grid.entBox.style.border="0px solid white",
this.vs[this.av].grid._sizeFix=0;this.vs[this.av].gridId=a.id;this.vs[this.av].gridObj=a;return this.vs[this._viewRestore()].grid};this.obj.attachScheduler=function(a,b){var c=document.createElement("DIV");c.id="dhxSchedObj_"+this._genStr(12);c.innerHTML='<div id="'+c.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><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></div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div></div>';
document.body.appendChild(c.firstChild);this.attachObject(c.id,!1,!0);this.vs[this.av].sched=scheduler;this.vs[this.av].schedId=c.id;scheduler.setSizes=scheduler.update_view;scheduler.destructor=function(){};scheduler.init(c.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);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;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";document.body.appendChild(b);this.attachObject(b.id,!1,!0);this.className=="dhtmlxLayoutSinglePoly"&&this.hideHeader();this.vs[this.av].tabbar=new dhtmlXTabBar(b.id,a||"top",20);if(!this._isWindow)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;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);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.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"):(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);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;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();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);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;return this.vs[this._viewRestore()].layout};this.obj.attachEditor=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="dhxEditorObj_"+this._genStr(12);a.style.position="relative";a.style.display="none";a.style.overflow="hidden";a.style.width="100%";a.style.height="100%";a.cmp="editor";document.body.appendChild(a);this.attachObject(a.id,!1,!0);this.vs[this.av].editor=new dhtmlXEditor(a.id,this.skin);this.vs[this.av].editorId=a.id;this.vs[this.av].editorObj=a;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);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){typeof a=="string"&&(a=document.getElementById(a));if(b){a.style.visibility="hidden";a.style.display="";var g=a.offsetWidth,h=a.offsetHeight}this._attachContent("obj",a);if(b&&this._isWindow)a.style.visibility="",this._adjustToContent(g,h);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"}};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,"");window.execScript?window.execScript(g):
window.eval(g)}};this.obj.attachURL=function(a,b){this._attachContent(b==!0?"urlajax":"url",a,!1);this._viewRestore()};this.obj.adjust=function(){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")}if(this.vs[this.av].toolbar){if(this._isWindow||this._isLayout)document.getElementById(this.vs[this.av].toolbarId).style.height="29px",this.vs[this.av].toolbarHeight=document.getElementById(this.vs[this.av].toolbarId).offsetHeight,this._doOnAttachToolbar&&this._doOnAttachToolbar("show");
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.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].parentNode.removeChild(this.vs[c].dhxcont.mainCont[c]),
this.vs[c].dhxcont.mainCont[c]=null;this.vs[this.dv].dhxcont.mainCont=null;this.vs[this.dv].dhxcont.parentNode.removeChild(this.vs[this.dv].dhxcont);for(c in this.vs)this.vs[c].dhxcont=null;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.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.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]}
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||"dhx_skyblue";this.setSkin=function(a){this.skin=a;this.base.className="dhtmlxcalendar_container dhtmlxcalendar_skin_"+this.skin};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;h._drawMonth(new Date(h._activeMonth.getFullYear(),h._activeMonth.getMonth()+c,1,0,0,0,0))}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();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 e=!1;h._activeDate=new Date(b._date.getFullYear(),b._date.getMonth(),b._date.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);e&&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.hideTime=function(){String(this.base.className).search("dhtmlxcalendar_time_hidden")<
0&&(this.base.className+=" dhtmlxcalendar_time_hidden")};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){a===""&&(a=new Date);a instanceof Date||(a=this._strToDate(a,!1));var b=a.getTime();if(!(this._rangeActive&&
(b<this._rangeFrom||b>this._rangeTo)||this._rangeSet[b]==!0))this._activeDate=new Date(b),this._drawMonth(this._activeDate),this._updateVisibleHours(),this._updateVisibleMinutes()};this.getDate=function(a){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 u=t.getDay(),w=t.getTime();this.contDates.childNodes[h].childNodes[j]._date=
new Date(w);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=w==f;this.contDates.childNodes[h].childNodes[j]._css_weekend=i>=6;this.contDates.childNodes[h].childNodes[j]._css_dis=this._rangeActive&&(w<this._rangeFrom||w>this._rangeTo)||this._rangeSet[w]==!0;this.contDates.childNodes[h].childNodes[j]._css_holiday=this._holidays[w]==
!0;this._updateCellStyle(h,j);if(w==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._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 "m":case "d":case "H":case "i":case "s":return"\\d{2}";case "Y":return"\\d{4}"}return a}))};this.setDateFormat("%Y-%m-%d");this._strToDate=function(a,b,
c){var d={Y:!1,m:!1,d:!1,H:!1,i:!1,s:!1},e=String(a).match(/[0-9]{1,}/g),f=(c||this._dateFormat).match(/%[a-zA-Z]/g);if(!e)return"Invalid Date";for(var g=0;g<f.length;g++){var h=f[g].replace(/%/g,"");typeof d[h]!="undefined"&&(d[h]=Number(e[g]))}if(b)return d;for(e in d)d[e]===!1&&(d[e]=0);return new Date(d.Y,d.m-1,d.d,d.H,d.i,d.s,0)};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 date.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,!0),c=new Date(this._activeMonth.getFullYear(),
this._activeMonth.getMonth(),this._activeDate.getDate(),this._activeDate.getHours(),this._activeDate.getMinutes(),this._activeDate.getSeconds());b.Y!==!1&&b.Y!=c.getFullYear()&&this._activeDate.setFullYear(b.Y);b.m!==!1&&(b.m--,b.m!=c.getMonth()&&this._activeDate.setMonth(b.m));b.d!==!1&&b.d!=c.getDate()&&this._activeDate.setDate(b.d);b.H!==!1&&b.H!=c.getHours()&&this._activeDate.setHours(b.H);b.i!==!1&&b.i!=c.getMinutes()&&this._activeDate.setMinutes(b.i);b.s!==!1&&b.s!=c.getSeconds()&&this._activeDate.setSeconds(b.s);
this._drawMonth(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,!1,a);if(d)return e;this.setDate(e)};this.getFormatedDate=function(a,b){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.draw=function(){this.show()};this.close=function(){this.hide()};this._activeInp=null;this.pos="bottom";this.setPosition=function(a,b){if(a=="right"||a=="bottom")this.pos=a;else if(!this._hasParent){if(typeof a!="undefined"&&!isNaN(a))this.base.style.left=a+"px";if(typeof b!="undefined"&&
!isNaN(b))this.base.style.top=b+"px"}};this._show=function(a,b){b===!0&&this._activeInp==a&&this._isVisible()?this._hide():(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.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._activeInp=a):(this.base.style.left="0px",this.base.style.top="0px"),this._hideSelector(),this.base.style.display=
"")};this._hide=function(){this._hideSelector();this.base.style.display="none";this._activeInp=null};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.setSensitive=function(a,b){var c=!1;if(a!=null&&b!=null){a instanceof
Date||(a=this._strToDate(a,!1));b instanceof Date||(b=this._strToDate(b,!1));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();c=this._rangeActive=!0}if(!c&&a!=null&&typeof b=="undefined"){for(var d=this._extractDates(a),e=0;e<d.length;e++)this._rangeSet[(new Date(d[e].getFullYear(),d[e].getMonth(),d[e].getDate(),0,0,0,0)).getTime()]=!0;c=!0}!c&&
a==null&&typeof a!="undefined"&&b==null&&typeof b!="undefined"&&(this._clearRange(),c=!0);!c&&a==null&&typeof a!="undefined"&&typeof b=="undefined"&&(this._clearRangeSet(),c=!0);!c&&typeof a=="undefined"&&typeof b=="undefined"&&(this._clearRange(),this._clearRangeSet(),c=!0);c&&this._drawMonth(this._activeDate)};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._activeDate)};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],!1));else a[c]instanceof Date&&b.push(a[c]);return b};this._clearRange=function(){this._rangeActive=!1;this._rangeTo=this._rangeFrom=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._doOnClick=function(a){var a=a||event,b=a.target||a.srcElement;if(b._dhtmlxcalendar_uid&&b._dhtmlxcalendar_uid!=h._activeInp&&h._isVisible())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;a.keyCode==27&&(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._updateDateStr(b.value),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._updateDateStr(b.value)};this._doOnUnload=function(){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){var b=this.uid();this.i[b]=a;this._attachEventsToObject(b)};this.detachObj=function(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._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;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,delete this.i[a]._dhtmlxcalendar_uid,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.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.setDateFormat=this.setDate=this.hideTime=this.hide=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._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=dhtmlXCalendarObject;window.dhtmlx||(dhtmlx={});dhtmlx.version="3.0";
dhtmlx.codebase="./";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=8}dhtmlx.env={};
(function(){dhtmlx.env.transform=!1;dhtmlx.env.transition=!1;for(var a={names:["transform","transition"],transform:["transform","WebkitTransform","MozTransform","oTransform"],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("/")+"/"})();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.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.area={pvt_render_area:function(a,b,c,d,e,f){var g=this._calculateParametersOfLineChart(a,b,c,d,e),h=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]);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]);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=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]);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]);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){var f=this._calculateParametersOfLineChart(a,b,c,d,e),g=Math.floor(f.cellWidth/2),g=this._settings.eventRadius||g,h=[];if(b.length){for(var i=this._settings.offset?c.x+f.cellWidth*0.5:c.x,j=0;j<b.length;j++){var k=!j?i:Math.floor(f.cellWidth*j)-0.5+i,m=this._getYPointOfLineChart(b[j],c,d,f);h.push({x:k,y:m})}for(var l=this._getSplineParameters(h),j=0;j<h.length-1;j++){for(var n=h[j].x,o=h[j].y,p=h[j+1].x,r=h[j+1].y,q=n;q<p;q++)this._drawLine(a,
q,this._getSplineYPoint(q,n,j,l.a,l.b,l.c,l.d),q+1,this._getSplineYPoint(q+1,n,j,l.a,l.b,l.c,l.d),this._settings.line.color(b[j]),this._settings.line.width);this._drawLine(a,p-1,this._getSplineYPoint(q,n,j,l.a,l.b,l.c,l.d),p,r,this._settings.line.color(b[j]),this._settings.line.width);this._drawItemOfLineChart(a,n,o,b[j],this._settings.label(b[j]))}this._drawItemOfLineChart(a,p,r,b[j],this._settings.label(b[j]))}},_getSplineParameters:function(a){var b,c,d,e,f,g,h,i,j;b=[];m=[];j=a.length;for(var k=
0;k<j-1;k++)b[k]=a[k+1].x-a[k].x,m[k]=(a[k+1].y-a[k].y)/b[k];c=[];d=[];c[0]=0;c[1]=2*(b[0]+b[1]);d[0]=0;d[1]=6*(m[1]-m[0]);for(k=2;k<j-1;k++)c[k]=2*(b[k-1]+b[k])-b[k-1]*b[k-1]/c[k-1],d[k]=6*(m[k]-m[k-1])-b[k-1]*d[k-1]/c[k-1];e=[];e[j-1]=e[0]=0;for(k=j-2;k>=1;k--)e[k]=(d[k]-b[k]*e[k+1])/c[k];f=[];g=[];h=[];i=[];for(k=0;k<j-1;k++)f[k]=a[k].y,g[k]=-b[k]*e[k+1]/6-b[k]*e[k]/3+(a[k+1].y-a[k].y)/b[k],h[k]=e[k]/2,i[k]=(e[k+1]-e[k])/(6*b[k]);return{a:f,b:g,c:h,d:i}},_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 y=Math.floor((o-s*this._series.length)/2),t=typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(s/5),u=!1,w=this._settings.gradient;w&&typeof w!="function"?(u=w,w=!1):w&&(w=a.createLinearGradient(c.x,c.y,d.x,c.y),this._settings.gradient(w));var B=0;m||this._drawLine(a,c.x-0.5,c.y,c.x-0.5,d.y,"#000000",1);for(var v=0;v<b.length;v++){var z=parseFloat(this._settings.value(b[v]||0));z>g&&(z=g);z-=h;z*=i;var A=c.x,x=c.y+y+v*o+(s+1)*e;if(z<0&&this._settings.origin==
"auto"||this._settings.xAxis&&z===0&&!(this._settings.origin!="auto"&&this._settings.origin>h))this.renderTextAt("middle","right",A+10,x+s/2+y,this._settings.label(b[v]));else{z<0&&this._settings.origin!="auto"&&this._settings.origin>h&&(z=0);m||(z+=q/r);var C=w||this._settings.color.call(this,b[v]);this._settings.border&&this._drawBarHBorder(a,A,x,s,h,t,r,z,C);a.globalAlpha=this._settings.alpha.call(this,b[v]);var D=this._drawBarH(a,c,A,x,s,h,t,r,z,C,w,u);a.globalAlpha=1;u!=!1&&this._drawBarHGradient(a,
A,x,s,h,t,r,z,C,u);D[3]==x?(this.renderTextAt("middle","left",D[0]-5,D[3]+Math.floor(s/2),this._settings.label(b[v])),f.addRect(b[v].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[v])),f.addRect(b[v].id,[D[0],x,D[2],D[3]],e))}}},_setBarHPoints:function(a,b,c,d,e,f,g,h){var i=0;if(e>f*g)var j=(e-f*g)/e,i=-Math.asin(j)+Math.PI/2;a.moveTo(b,c+h);var k=b+f*g-e-(e?0:h);e<f*g&&a.lineTo(k,c+h);var m=c+e;e&&a.arc(k,m,e-h,-Math.PI/2+i,0,!1);
var l=c+d-e-(e?0:h),n=k+e-(e?h:0);a.lineTo(n,l);var o=k;e&&a.arc(o,l,e-h,0,Math.PI/2-i,!1);var p=c+d-h;a.lineTo(b,p);a.lineTo(b,c+h);return[n,p]},_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=parseInt(f?f:c.x,10)-0.5,h=d.y+0.5,i=c.y;this._drawLine(a,g,h,g,i,this._settings.yAxis.color,1);for(var j=0;j<b.length;j++){var k=this._settings.origin!="auto"&&this._settings.view=="barH"&&
parseFloat(this._settings.value(b[j]))<this._settings.origin;this.renderTextAt("middle",k?!1:"left",k?g+5:g-5,i+e/2+j*e,this._settings.yAxis.template(b[j]),"dhx_axis_item_y",k?0:g-10)}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 i.step=="undefined"||typeof i.start=="undefined"||typeof i.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&&this._drawLine(a,r,j,r,c.y,this._settings.xAxis.color,0.2);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();a.fillStyle=i;this._setBarHPoints(a,
j.x0,j.y0,d,f,g,j.value,0);a.lineTo(b,0);a.fill();a.fillStyle="#000000";a.globalAlpha=0.37;a.beginPath();this._setBarHPoints(a,j.x0,j.y0,d,f,g,j.value,0);a.fill();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._settings.xAxis,n=this._getStackedLimits(b);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+4>o&&(s=o-4);var y=Math.floor((o-
s)/2),t=0,u=!1,w=this._settings.gradient,u=!1;(w=this._settings.gradient)&&(u=!0);var B=0;m||this._drawLine(a,c.x-0.5,c.y,c.x-0.5,d.y,"#000000",1);for(var v=0;v<b.length;v++){if(!e)b[v].$startX=c.x;var z=parseFloat(this._settings.value(b[v]||0));z>g&&(z=g);z-=h;z*=i;var A=c.x,x=c.y+y+v*o;if(e)A=b[v].$startX;if(z<0||this._settings.yAxis&&z===0)this.renderTextAt("middle",!0,A+10,x+s/2,this._settings.label(b[v]));else{m||(z+=q/r);var C=this._settings.color.call(this,b[v]);if(this._settings.border)a.beginPath(),
a.fillStyle=C,this._setBarHPoints(a,A,x,s,t,r,z,0),a.lineTo(A,0),a.fill(),a.fillStyle="#000000",a.globalAlpha=0.37,a.beginPath(),this._setBarHPoints(a,A,x,s,t,r,z,0),a.fill();a.globalAlpha=1;a.globalAlpha=this._settings.alpha.call(this,b[v]);a.fillStyle=this._settings.color.call(this,b[v]);a.beginPath();var D=this._setBarHPoints(a,A,x,s,t,r,z,this._settings.border?1:0);w&&!u&&a.lineTo(c.x+k,x+(this._settings.border?1:0));a.fill();if(u!=!1){var F=this._setBarGradient(a,A,x+s,A,x,u,C,"x");a.fillStyle=
F.gradient;a.beginPath();D=this._setBarHPoints(a,A,x,s,t,r,z,0);a.fill();a.globalAlpha=1}this.renderTextAt("middle",!0,b[v].$startX+(D[0]-b[v].$startX)/2-1,x+(D[1]-x)/2,this._settings.label(b[v]));f.addRect(b[v].id,[b[v].$startX,x,D[0],D[1]],e);b[v].$startX=D[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),y=this._settings.gradient?
this._settings.gradient:!1,t=0;l||this._drawLine(a,c.x,d.y+0.5,d.x,d.y+0.5,"#000000",1);for(var u=0;u<b.length;u++){var w=parseFloat(this._settings.value(b[u]||0));if(w){e||(w-=h);w*=i;var B=c.x+s+u*o,v=d.y;if(e)v=b[u].$startY;if(!(v<c.y+1))if(w<0||this._settings.yAxis&&w===0)this.renderTextAt(!0,!0,B+Math.floor(q/2),v,this._settings.label(b[u]));else{var z=this._settings.color.call(this,b[u]);if(this._settings.border)a.beginPath(),a.fillStyle=z,this._setStakedBarPoints(a,B-1,v,q+2,r,w,0,c.y),a.lineTo(B,
v),a.fill(),a.fillStyle="#000000",a.globalAlpha=0.37,a.beginPath(),this._setStakedBarPoints(a,B-1,v,q+2,r,w,0,c.y),a.fill();a.globalAlpha=this._settings.alpha.call(this,b[u]);a.fillStyle=this._settings.color.call(this,b[u]);a.beginPath();var A=this._setStakedBarPoints(a,B,v,q,r,w,this._settings.border?1:0,c.y);a.fill();a.globalAlpha=1;if(y){var x=this._setBarGradient(a,B,v,B+q,A[1],y,z,"y");a.fillStyle=x.gradient;a.beginPath();A=this._setStakedBarPoints(a,B+x.offset,v,q-x.offset*2,r,w,this._settings.border?
1:0,c.y);a.fill();a.globalAlpha=1}this.renderTextAt(!1,!0,B+Math.floor(q/2),A[1]+(v-A[1])/2-7,this._settings.label(b[u]));f.addRect(b[u].id,[B,A[1],A[0],b[u].$startY||v],e);b[u].$startY=this._settings.border?A[1]+1:A[1]}}else if(!b[u].$startY)b[u].$startY=d.y}},_setStakedBarPoints:function(a,b,c,d,e,f,g,h){a.moveTo(b,c);var i=c-e*f+g;i<h&&(i=h);a.lineTo(b,i);var j=b+d,k=i;a.lineTo(j,k);var m=i,l=b+d;a.lineTo(l,c);a.lineTo(b,c);return[l,k-2*g]}};
dhtmlx.chart.line={pvt_render_line: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)for(var i=this._getYPointOfLineChart(b[0],c,d,g),j=this._settings.offset?c.x+g.cellWidth*0.5:c.x,k=j,m=1;m<=b.length;m++){var l=Math.floor(g.cellWidth*m)-0.5+k;if(b.length!=m){var n=this._getYPointOfLineChart(b[m],c,d,g);this._drawLine(a,j,i,l,n,this._settings.line.color(b[m-1]),this._settings.line.width)}this._drawItemOfLineChart(a,
j,i,b[m-1],!!this._settings.offset);f.addRect(b[m-1].id,[j-h,i-h,j+h,i+h],e);i=n;j=l}},_drawItemOfLineChart:function(a,b,c,d,e){var f=parseInt(this._settings.item.radius,10);a.lineWidth=parseInt(this._settings.item.borderWidth,10);a.fillStyle=this._settings.item.color(d);a.strokeStyle=this._settings.item.borderColor(d);a.beginPath();a.arc(b,c,f,0,Math.PI*2,!0);a.fill();a.stroke();e&&this.renderTextAt(!1,!0,b,c-f-this._settings.labelOffset,this._settings.label(d))},_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.xAxis,j=this._settings.view.indexOf("stacked")!=-1?this._getStackedLimits(b):
this._getLimits();f.maxValue=j.max;f.minValue=j.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 k=this._getRelativeValue(f.minValue,f.maxValue);g=k[0];f.valueFactor=k[1];f.unit=g?f.totalHeight/g:10;f.startValue=0;if(!h)f.startValue=f.unit>10?f.unit:10,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=o/this._series.length-4);var y=Math.floor((o-s*this._series.length)/2),t=typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(s/5),u=!1,w=this._settings.gradient;w&&typeof w!="function"?(u=w,w=!1):w&&(w=a.createLinearGradient(0,d.y,0,c.y),this._settings.gradient(w));var B=0;l||this._drawLine(a,
c.x,d.y+0.5,d.x,d.y+0.5,"#000000",1);for(var v=0;v<b.length;v++){var z=parseFloat(this._settings.value(b[v]||0));z>g&&(z=g);z-=h;z*=i;var A=c.x+y+v*o+(s+1)*e,x=d.y;if(z<0||this._settings.yAxis&&z===0&&!(this._settings.origin!="auto"&&this._settings.origin>h))this.renderTextAt(!0,!0,A+Math.floor(s/2),x,this._settings.label(b[v]));else{!m&&!(this._settings.origin!="auto"&&l)&&(z+=q/r);var C=w||this._settings.color.call(this,b[v]);this._settings.border&&this._drawBarBorder(a,A,x,s,h,t,r,z,C);a.globalAlpha=
this._settings.alpha.call(this,b[v]);var D=this._drawBar(a,c,A,x,s,h,t,r,z,C,w,u);a.globalAlpha=1;u&&this._drawBarGradient(a,A,x,s,h,t,r,z,C,u);D[0]!=A?this.renderTextAt(!1,!0,A+Math.floor(s/2),D[1],this._settings.label(b[v])):this.renderTextAt(!0,!0,A+Math.floor(s/2),D[3],this._settings.label(b[v]));f.addRect(b[v].id,[A,D[3],D[2],D[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:b,y0:c,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]},_drawBarBorder:function(a,
b,c,d,e,f,g,h,i){a.save();var j=this._correctBarParams(a,b,c,h,g,d,e);a.fillStyle=i;this._setBarPoints(a,j.x0,j.y0,d,f,g,j.value,0);a.lineTo(j.x0,0);a.fill();a.fillStyle="#000000";a.globalAlpha=0.37;this._setBarPoints(a,j.x0,j.y0,d,f,g,j.value,0);a.fill();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");a.fillStyle=m.gradient;this._setBarPoints(a,k.x0+m.offset,k.y0,d-
m.offset*2,f,g,k.value,m.offset);a.fill();a.restore()},_setBarPoints:function(a,b,c,d,e,f,g,h){a.beginPath();var i=0;if(e>f*g)var j=(e-f*g)/e,i=-Math.acos(j)+Math.PI/2;a.moveTo(b+h,c);var k=c-Math.floor(f*g)+e+(e?0:h);e<f*g&&a.lineTo(b+h,k);var m=b+e;e&&a.arc(m,k,e-h,-Math.PI+i,-Math.PI/2,!1);var l=b+d-e-(e?0:h),n=k-e+(e?h:0);a.lineTo(l,n);var o=k;e&&a.arc(l,o,e-h,-Math.PI/2,0-i,!1);var p=b+d-h;a.lineTo(p,c);a.lineTo(b+h,c);return[p,n]}};
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){for(var g=0,h=this._getPieParameters(c,d),i=this._settings.radius?this._settings.radius:h.radius,j=this.max(this._settings.value),k=[],m=[],l=0,n=0;n<b.length;n++)g+=parseFloat(this._settings.value(b[n])||0);for(n=0;n<b.length;n++)m[n]=parseFloat(this._settings.value(b[n])),k[n]=Math.PI*2*(g?(m[n]+l)/g:1/b.length),l+=m[n];var o=this._settings.x?this._settings.x:h.x,p=
this._settings.y?this._settings.y:h.y;e==1&&this._settings.shadow&&this._addShadow(a,o,p,i);p/=e;var r=-Math.PI/2;a.scale(1,e);for(n=0;n<b.length;n++)if(m[n]){a.lineWidth=2;a.beginPath();a.moveTo(o,p);alpha1=-Math.PI/2+k[n]-1.0E-4;a.arc(o,p,i,r,alpha1,!1);a.lineTo(o,p);var q=this._settings.color.call(this,b[n]);a.fillStyle=q;a.strokeStyle=this._settings.lineColor(b[n]);a.stroke();a.fill();this._settings.pieInnerText&&this._drawSectorLabel(o,p,5*i/6,r,alpha1,e,this._settings.pieInnerText(b[n],g),!0);
this._settings.label&&this._drawSectorLabel(o,p,i+this._settings.labelOffset,r,alpha1,e,this._settings.label(b[n]));if(e!=1)this._createLowerSector(a,o,p,r,alpha1,i,!0),a.fillStyle="#000000",a.globalAlpha=0.2,this._createLowerSector(a,o,p,r,alpha1,i,!1),a.globalAlpha=1,a.fillStyle=q;f.addSector(b[n].id,r,alpha1,o,p,i,e);r=alpha1}if(this._settings.gradient){var s=e!=1?o+i/3:o,y=e!=1?p+i/3:p;this._showRadialGradient(a,o,p,i,s,y)}a.scale(1,1/e)}},_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||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){for(var e="#676767,#7b7b7b,#a0a0a0,#bcbcbc,#d1d1d1,#d6d6d6".split(","),f=e.length-1;f>-1;f--)a.beginPath(),a.fillStyle=e[f],a.arc(b+2,c+2,d+f,0,Math.PI*2,!0),a.fill()},_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.globalAlpha=
0.3;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=1},_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=8;h&&(k=j/1.8);var m=d+(e-d)/2;c-=(k-8)/2;var l=-k,n=-8,o="left";m>=Math.PI/2&&m<Math.PI&&(l=-j-l+1,o="right");m<=3*Math.PI/2&&m>=
Math.PI&&(l=-j-l+1,o="right");var p=(b+Math.floor(c*Math.sin(m)))*f+n,r=a+Math.floor((c+k/2)*Math.cos(m))+l,q=e<Math.PI/2+0.01,s=m<Math.PI/2;s&&q?r=Math.max(r,a+3):!s&&!q&&(r=Math.min(r,a-j));!h&&f<1&&p>b*f&&(p+=this._settings.height||Math.floor(c/4));i.style.top=p+"px";i.style.left=r+"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.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.env.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,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}}};
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}},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)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||"";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,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),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;if(a.name!="DataStore")a=a.data;var d=dhx.bind(function(d,f,g){if(g!="update"||b)d=null;if(!d)this.order=dhx.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",d);d()},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)},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,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]);this._parseSettings(a,{color:"RAINBOW",alpha:"1",label:!1,value:"{obj.value}",padding:{},view:"pie",lineColor:"#ffffff",cant:0.5,width:15,labelWidth:100,line:{},item:{},shadow:!0,gradient:!1,border:!0,labelOffset:20,origin:"auto"});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"?!1:!0;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,this._obj.offsetHeight);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,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){if(typeof a!="function"&&a&&(a===!0||a!="3d"))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)},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:25,height:15}});a.template=dhtmlx.Template.setter(a.template);return a},item_setter:function(a){typeof a!="object"&&(a={color:a,borderColor:a});this._mergeSettings(a,{radius:4,color:"#000000",borderColor:"#000000",borderWidth:2});a.color=dhtmlx.Template.setter(a.color);a.borderColor=dhtmlx.Template.setter(a.borderColor);
return a},line_setter:function(a){typeof a!="object"&&(a={color:a});this._mergeSettings(a,{width:3,color:"#d4d4d4"});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",template:"{obj}",lines:!1});if(a.template)a.template=dhtmlx.Template.setter(a.template);
return a},yAxis_setter:function(a){this._mergeSettings(a,{title:"",color:"#000000",template:"{obj}",lines:!0});if(a.template)a.template=dhtmlx.Template.setter(a.template);return a},_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=g+m*e,k=!!m);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.view_setter!="bar"&&this._drawXAxisLine(a,j,d.y,c.y)}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&&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._drawLine(a,i,j,i,k,this._settings.yAxis.color,1);this._settings.yAxis.step&&(g=parseFloat(this._settings.yAxis.step));if(typeof this._settings.yAxis.step=="undefined"||typeof this._settings.yAxis.start=="undefined"||typeof this._settings.yAxis.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&&this._drawLine(a,i,p,d.x,p,this._settings.yAxis.color,0.2);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),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++}return m}}},_setYAxisTitle:function(a,b){var c=this.renderTextAt("middle",!1,0,parseInt((b.y-a.y)/2+a.y,10),this._settings.yAxis.title,"dhx_axis_title_y");if(c)c.style.left=(dhtmlx.env.transform?(c.offsetHeight-c.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;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){var b,c,d=arguments.length&&a=="h"?this._settings.xAxis:this._settings.yAxis;if(d&&typeof d.end!="undefined"&&typeof d.start!="undefined"&&d.step)b=parseFloat(d.end),c=parseFloat(d.start);else if(b=this.max(this._series[0].value),c=this.min(this._series[0].value),
this._series.length>1)for(var e=1;e<this._series.length;e++){var f=this.max(this._series[e].value),g=this.min(this._series[e].value);f>b&&(b=f);g<c&&(c=g)}return{max:b,min:c}},_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,this._settings.xAxis.template(c));f&&(f.className+=" dhx_axis_item_x")}},_drawXAxisLine:function(a,b,c,d){this._settings.xAxis&&this._settings.xAxis.lines&&this._drawLine(a,
b,c,b,d,this._settings.xAxis.color,0.2)},_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()},_getRelativeValue:function(a,b){var c,d=1;if(b!=a){if(c=b-a,Math.abs(c)<1)for(;Math.abs(c)<1;)d*=10,c*=d}else c=a;return[c,d]},_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){this._active_serie=b.getAttribute("userdata");if(this._series[this._active_serie]){for(var c=0;c<this._series.length;c++){var d=this._series[c].tooltip;d&&d.disable()}(d=this._series[this._active_serie].tooltip)&&
d.enable()}},_drawLegend:function(a,b){var c=0,d=0,e=this._settings.legend,f,g,h=this._settings.legend.layout!="x"?"width:"+e.width+"px":"";if(this.legendObj)this.legendObj.innerHTML="";var i=dhtmlx.html.create("DIV",{"class":"dhx_chart_legend",style:"left:"+c+"px; top:"+d+"px;"+h},"");this.legendObj=i;this._obj.appendChild(i);var j=[];if(e.values)for(k=0;k<e.values.length;k++)j.push(this._drawLegendText(i,e.values[k].text));else for(var k=0;k<b.length;k++)j.push(this._drawLegendText(i,e.template(b[k])));
g=i.offsetWidth;f=i.offsetHeight;this._settings.legend.width=g;this._settings.legend.height=f;g<this._obj.offsetWidth&&(e.layout=="x"&&e.align=="center"&&(c=(this._obj.offsetWidth-g)/2),e.align=="right"&&(c=this._obj.offsetWidth-g));f<this._obj.offsetHeight&&(e.valign=="middle"&&e.align!="center"&&e.layout!="x"?d=(this._obj.offsetHeight-f)/2:e.valign=="bottom"&&(d=this._obj.offsetHeight-f));i.style.left=c+"px";i.style.top=d+"px";for(k=0;k<j.length;k++){var m=j[k],l=e.values?e.values[k].color:this._settings.color.call(this,
b[k]);this._drawLegendMarker(a,m.offsetLeft+c,m.offsetTop+d,l)}j=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){var e=this._settings.legend;a.strokeStyle=a.fillStyle=d;a.lineWidth=e.marker.height;a.lineCap=e.marker.type;a.beginPath();b+=a.lineWidth/2+
5;c+=a.lineWidth/2+3;a.moveTo(b,c);var f=b+e.marker.width-e.marker.height+1;a.lineTo(f,c);a.stroke()},_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;if(this._settings.yAxis&&typeof this._settings.yAxis.end!="undefied"&&typeof this._settings.yAxis.start!="undefied"&&this._settings.yAxis.step)b=parseFloat(this._settings.yAxis.end),c=parseFloat(this._settings.yAxis.start);else{for(var d=0;d<a.length;d++){a[d].$sum=0;a[d].$min=Infinity;for(var e=0;e<this._series.length;e++){var f=parseFloat(this._series[e].value(a[d]));if(!isNaN(f)&&(a[d].$sum+=
f,f<a[d].$min))a[d].$min=f}}b=-Infinity;c=Infinity;for(d=0;d<a.length;d++){if(a[d].$sum>b)b=a[d].$sum;if(a[d].$min<c)c=a[d].$min}c>0&&(c=0)}return{max:b,min:c}},_setBarGradient:function(a,b,c,d,e,f,g,h){var i,j;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):(a.globalAlpha=0.37,j=0,i=h=="x"?a.createLinearGradient(b,e,b,c):a.createLinearGradient(b,c,d,c),i.addColorStop(0,"#000000"),i.addColorStop(0.5,
"#FFFFFF"),i.addColorStop(0.6,"#FFFFFF"),i.addColorStop(1,"#000000"));return{gradient:i,offset:j}}};dhtmlx.compat("layout");
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;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){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;if(a.keyCode!=9)a.cancelBubble=!0;if(a.keyCode>=48&&a.keyCode<=57||a.keyCode>=65&&a.keyCode<=90){for(var b=0;b<c.optionsArr.length;b++){var f=c.optionsArr[b].text;if(f.toString().toUpperCase().indexOf(String.fromCharCode(a.keyCode))==0){c.selectOption(b);break}}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._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);var a=dhx_glbSelectAr;this.DOMParent=this.DOMlist=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(_isChrome){if(!b)b=document.body;for(var c=a,d=0,e=0;c&&c!=b;)d+=c.offsetLeft-c.scrollLeft,e+=c.offsetTop-c.scrollTop,c=c.offsetParent;b==document.body&&(_isIE&&_isIE<8?(document.documentElement.scrollTop&&(e+=document.documentElement.scrollTop),document.documentElement.scrollLeft&&(d+=document.documentElement.scrollLeft)):_isFF||(d+=document.body.offsetLeft,e+=document.body.offsetTop));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._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._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){if(arguments.length==0){var c=this.getOptionByLabel(this.DOMelem_input.value),a=c?c.value:this.DOMelem_input.value,b=c==null;if(a==this.getActualValue())return}this.DOMelem_input.focus();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._positList();this.DOMlist.style.display="block";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.filterSelf=function(a){var b=this.getComboText();if(this._xml)this._lkmode=a,this._fetchOptions(0,b);var c=RegExp("^"+b.replace(/([\[\]\{\}\(\)\+\*\\\?\.])/g,"\\$1"),"i");this.filterAny=!1;for(var d=0;d<this.optionsArr.length;d++){var e=c.test(this.optionsArr[d].content?this.optionsArr[d].data()[1]:this.optionsArr[d].text);this.filterAny|=e;this.optionsArr[d].hide(!e)}this.filterAny?(this.DOMlist.style.display!="block"&&this.openSelect(),_isIE&&this._IEFix(!0)):(this.closeAll(),
this._activeMode=!0);a?this.unSelectOption():this._correctSelection()};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};
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}};
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=_isIE?this.content.innerText:this.content.textContent}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){a.DOMelem_image.style.visibility="visible";a.DOMelem_image.src=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);(c||event).cancelBubble=!0};a.DOMelem.appendChild(b);a.DOMelem_checkbox=b};dhtmlXCombo_checkboxOption.prototype.RedrawHeader=function(a){a.DOMelem_checkbox.style.visibility="";a.DOMelem_checkbox.checked=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};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()};
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);if(this.autoHeight=convertStringToBoolean(a)){if(this.ahOnOpen=this.attachEvent("onOpen",function(){this._setOptionAutoHeight(a,b);_isIE&&this._setOptionAutoHeight(a,b)}),!this.awOnOpen)this.ahOnXLE=this.attachEvent("onXLE",function(){var a=this;window.setTimeout(function(){a.callEvent("onOpen",[])},
1)})}else typeof this.ahOnOpen!="undefined"&&(this.detachEvent(this.ahOnOpen),this.detachEvent(this.ahOnXLE),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(/\?\&/,"?")};window.dhtmlx||(dhtmlx={});dhtmlx.version="3.0";dhtmlx.codebase="./";
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=8}dhtmlx.env={};
(function(){dhtmlx.env.transform=!1;dhtmlx.env.transition=!1;for(var a={names:["transform","transition"],transform:["transform","WebkitTransform","MozTransform","oTransform"],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("/")+"/"})();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||{};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=[],g=[],f=0;f<b.source.length;f++)c[f]={idd:b.source[f]},g.push(b.source[f]);d.dragStartNode={parentNode:{},parentObject:{idd:c,id:g.length==1?g[0]:g,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=[],g=c[a],f=0;f<g.length;f++)e.push(g[f].idd||g[f].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,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;if(!this.callEvent("onBeforeEditStop",[this._edit_id]))return!1;var c=this.data.get(this._edit_id);c.$template=null;a||this._edit_bind(!1,c);var d=this._edit_id;this._edit_bind=this._edit_id=null;this.data.refresh(d);this.callEvent("onAfterEditStop",[d]);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,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._unrendered_area=[];this.attachEvent("onItemRender",function(a){a.$template=="loading"&&this._unrendered_area.push(this.data.id(a))})},_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},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._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._unrendered_area.length){var r=this.indexById(this._unrendered_area[0]),q=this.indexById(this._unrendered_area.pop())+1;if(q>r){if(!this.callEvent("onDataRequest",
[r,q-r]))return!1;this.data.feed.call(this,r,q-r)}}},_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.env.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,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}}};
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}},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)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||"";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,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),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;if(a.name!="DataStore")a=a.data;var d=dhx.bind(function(d,f,g){if(g!="update"||b)d=null;if(!d)this.order=dhx.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",d);d()},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"&&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 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; 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; 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;} 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: 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 g=a.duplicate(),f=a.duplicate();g.collapse(!0);f.moveToElementText(g.parentElement());f.setEndPoint("EndToStart",g);c=g.parentElement();g=a.duplicate();f=a.duplicate();f.collapse(!1);g.moveToElementText(f.parentElement());g.setEndPoint("StartToEnd",f);d=f.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,""):this.edDoc.body.innerHTML:""};this.setContent=function(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):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"};this.apos_css={"label-left":"item_label_left","label-right":"item_label_right","label-top":"item_label_top",absolute:"item_absolute"};this.align_css={left:"align_left",center:"align_center",right:"align_right"};var c=this;this.skin="dhx_skyblue";this.setSkin=function(a){this.skin=a;this.cont.className="dhxlist_obj_"+this.skin;this.cont.style.fontSize=
this.skin=="dhx_web"?"13px":"13px"};this._type="checkbox";this._rGroup="default";this.cont=typeof a=="object"?a:document.getElementById(a);if(!a._isNestedForm)this._parentForm=!0,this.cont.style.fontSize=this.skin=="dhx_web"?"13px":"13px",this.cont.className="dhxlist_obj_"+this.skin,this.setFontSize=function(a){this.cont.style.fontSize=a},this.getForm=function(){return this};this.b=null;this.base=[];this._prepare=function(a){this.b==null?this.b=0:this.b++;this.base[this.b]=document.createElement("DIV");
this.base[this.b].className="dhxlist_base";typeof a=="string"&&(a=parseInt(a));if(typeof a=="number")this.base[this.b].style.marginLeft=a+"px";this.cont.appendChild(this.base[this.b])};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(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.objPull={};this.itemPull={};this._ic=0;this._addItem=function(a,b,d,h,i){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].appendChild(j));j._idd=b;if(typeof d.offsetLeft=="number")j.style.paddingLeft=d.offsetLeft+
"px";if(typeof d.offsetTop=="number")j.style.paddingTop=d.offsetTop+"px";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}[a]!==!0)j.onselectstart=function(a){a=a||event;return a.returnValue=!1};if(a=="label"&&this._ic++==0)d._isTopmost=!0;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;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;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(){c._autoCheck()};if(d.validate)j._validate=String(d.validate).split(",");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(a[b].type=="settings")for(var c in a[b])this.i[c]=a[b][c];for(b=0;b<a.length;b++){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._xmlSubItems={item:"list",option:"options"};this._xmlToObject=function(a,b){if(b===!0)var c=[];else{var c={},d;for(d in this._xmlSubItems)c[this._xmlSubItems[d]]=[]}for(var i=0;i<a.childNodes.length;i++)if(typeof a.childNodes[i].nodeName!="undefiend"&&this._xmlSubItems[a.childNodes[i].nodeName]!=null){for(var j=
this._xmlSubItems[a.childNodes[i].nodeName],k={},m=0;m<a.childNodes[i].attributes.length;m++){k[a.childNodes[i].attributes[m].name]=a.childNodes[i].attributes[m].value;var l=this._xmlToObject(a.childNodes[i],!1);for(d in this._xmlSubItems)l[this._xmlSubItems[d]].length>0&&(k[this._xmlSubItems[d]]=l[this._xmlSubItems[d]])}b===!0?c.push(k):c[j].push(k)}return c};this._xmlParser=function(){c._initObj(c._xmlToObject(this.getXMLTopNode("items"),!0));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){if(typeof b=="string"){if(b.toLowerCase()=="json"){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){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);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||(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){return this.getItemType(a)=="radio"?this.getCheckedValue(a):this.doWithItem(a,"getValue",b)};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._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(a){if(!(a!="nestedFormCall"&&this.callEvent("onBeforeValidate",[])==!1)){var b=!0,c;for(c in this.itemPull){if(this.itemPull[c]._validate){for(var d=this.itemPull[c]._idd,i=this.getItemValue(d),j=!0,k=0;k<this.itemPull[c]._validate.length;k++){var m=dhtmlxValidation["is"+this.itemPull[c]._validate[k]];typeof m!=
"function"&&typeof this.itemPull[c]._validate[k]=="function"&&(m=this.itemPull[c]._validate[k]);typeof m!="function"&&typeof window[this.itemPull[c]._validate[k]]=="function"&&(m=window[this.itemPull[c]._validate[k]]);j=j&&(typeof m=="function"?m(i):RegExp(this.itemPull[c]._validate[k]).test(i));m=null}b=b&&j;this.callEvent("onValidate"+(j?"Success":"Error"),[d,i,j])!==!1&&this.setValidateCss(d,j)}if(this.itemPull[c]._list)for(k=0;k<this.itemPull[c]._list.length;k++)b=this.itemPull[c]._list[k].validate("nestedFormCall")&&
b}a!="nestedFormCall"&&this.callEvent("onAfterValidate",[b]);return b}};this.setReadonly=function(a,b){this.doWithItem(a,"setReadonly",b)};this.isReadonly=function(a){return this.doWithItem(a,"isReadonly")};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=="ta"||this.itemPull[b]._type=="editor"||this.itemPull[b]._type=="calendar")&&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._xmlLoader.destructor();this._subSelectId=this._subSelect=this.idPrefix=this.skin=this.i=
this.b=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.className="";this.cont=null};for(var d in this.items){this.items[d].t=d;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};this.items[d].getType=function(){return this.t};this.items[d].isExist=function(){return!0}}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};dhtmlxEventable(this);this.attachEvent("_onButtonClick",function(a,b){this.callEvent("onButtonClick",[a,b])});b!=null&&typeof b=="object"&&this._initObj(b)}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=String(b.value);a._ro=b.readonly==!0;var c=document.createElement("DIV");c.className="dhxlist_img chbx0";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";this.doAddLabel(a,b);var d=document.createElement("INPUT");d.type="HIDDEN";d.value=String(b.value);a.appendChild(d);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="dhxlist_txt "+b.labelAlign;a.appendChild(c);c.innerHTML="<span class='nav_link' 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+"</span>";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"},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[0].onmousedown=null;a.childNodes[0].ontouchstart=null;a.childNodes[1].onmousedown=null;a.childNodes[1].ontouchstart=null;a.childNodes[1].childNodes[0].onkeypress=null;a.childNodes[1].childNodes[0].ontouchstart=null;for(a.childNodes[1].removeChild(a.childNodes[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[0][_dhxForm_isIPad?"ontouchstart":"onmousedown"]=function(a){a=a||event;a.preventDefault&&a.preventDefault();if(!this.parentNode._enabled||this.parentNode._ro)return a.cancelBubble=!0,a.returnValue=!1;b.doClick(this.parentNode)};a.childNodes[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;b.doClick(this.parentNode.parentNode)}},doClick:function(a){a.childNodes[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[2].setAttribute("name",String(a._idd)):a.childNodes[2].removeAttribute("name")},setChecked:function(a,
b){a._checked=b===!0?!0:!1;a.childNodes[0].className="dhxlist_img "+(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[1].childNodes[0].tabIndex=0;a.childNodes[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[1].childNodes[0].tabIndex=-1;a.childNodes[1].childNodes[0].setAttribute("disabled","true");this.doCheckValue(a)},isEnabled:function(a){return a._enabled},setText:function(a,b){a.childNodes[1].childNodes[0].innerHTML=b},getText:function(a){return a.childNodes[1].childNodes[0].innerHTML},setValue:function(a,b){this.setChecked(a,b===!0||a._value===b)},getValue:function(a){return a._value},setReadonly:function(a,b){a._ro=b===!0},isReadonly:function(a){return a._ro},
setValue:function(a,b){a._value=b;a.childNodes[2].value=a._value},getValue:function(a){return a._value}};
dhtmlXForm.prototype.items.radio={input:{},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;var d=document.createElement("DIV");d.className="dhxlist_img rdbt0";a.appendChild(d);if(!isNaN(b.inputLeft))d.style.left=parseInt(b.inputLeft)+"px";if(!isNaN(b.inputTop))d.style.top=parseInt(b.inputTop)+"px";this.doAddLabel(a,b);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.childNodes[a.childNodes.length-1]==this.input[a._group]){for(var b=a.parentNode,c=!1,d=0;d<b.childNodes.length;d++){var e=b.childNodes[d];e._idd!=a._idd&&e._group==a._group&&e._type=="ra"&&!c&&(e.appendChild(this.input[a._group]),
c=!0);e=null}c==!1&&(this.input[a._group].parentNode.removeChild(this.input[a._group]),this.input[a._group]=null,this.firstValue[a._group]=null)}var f=a._idd;this.doUnloadNestedLists(a);this.doDestruct(a);return f},doClick:function(a){a.childNodes[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._autoCheck(),a.callEvent("onChange",b))}},doCheckValue:function(a){for(var b=
null,c=a.parentNode.parentNode,d=0;d<c.childNodes.length;d++){for(var e=0;e<c.childNodes[d].childNodes.length;e++){var f=c.childNodes[d].childNodes[e];if(f._type=="ra"&&f._group==a._group&&f._checked&&f._enabled)b=f._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){for(var b=b===!0,c=a._group,d=a.parentNode.parentNode,e=0;e<d.childNodes.length;e++)for(var f=0;f<d.childNodes[e].childNodes.length;f++)if(d.childNodes[e].childNodes[f]._group==c&&d.childNodes[e].childNodes[f]._type=="ra"){var g=!1,h=d.childNodes[e].childNodes[f];if(h._idd==a._idd){if(h._checked!=b)h._checked=b,g=!0}else if(h._checked)h._checked=!1,g=!0;if(g)h.childNodes[0].className="dhxlist_img "+(h._checked?"rdbt1":"rdbt0");h=null}this.doCheckValue(a)},getChecked:function(a){return this.input[a._group]._value},
_getFirstValue:function(a){return this.firstValue[a._group]},setValue:function(){},setValue:function(a,b){a._value=b;if(a._checked)this.input[a._group].value=b},getValue:function(a){return a._value}};(function(){for(var a in{doAddLabel: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;this.doAddLabel(a,b);this.doAddInput(a,b,"SELECT",null,!0,!0,"dhxlist_txt_select");this.doAttachEvents(a);this.doLoadOpts(a,b);if(b.connector){var c=this;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)})}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[1].childNodes[0].onclick=null;a.childNodes[1].childNodes[0].onkeydown=null;a.childNodes[1].childNodes[0].onchange=null;a.childNodes[1].childNodes[0].onblur=null;for(a.childNodes[1].removeChild(a.childNodes[1].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="dhxlist_txt_label "+b.labelAlign;c.innerHTML="<label for='"+b.uid+"'>"+b.label+"</label>";a.appendChild(c);if(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"},doAddInput:function(a,b,c,d,e,f,g){var h=document.createElement("DIV");h.className="dhxlist_cont";a.appendChild(h);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;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)},doAttachEvents:function(a){var b=a.childNodes[1].childNodes[0],c=this;b.onclick=function(){c.doOnChange(this)};b.onkeydown=function(){c.doOnChange(this)};b.onchange=function(){c.doOnChange(this)}},doLoadOpts:function(a,b,c){for(var d=
a.childNodes[1].childNodes[0],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=e[f].value}c===!0&&a.callEvent("onOptionsLoaded",[a._idd])},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[0].childNodes[0].innerHTML=b;a.childNodes[0].style.display=b.length==0||b==null?"none":""},getText:function(a){return a.childNodes[0].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[1].childNodes[0].removeAttribute("disabled")},disable:function(a){String(a.className).search("disabled")<0&&(a.className+=" disabled");a._enabled=!1;a.childNodes[1].childNodes[0].setAttribute("disabled",!0)},getOptions:function(a){return a.childNodes[1].childNodes[0].options},setValue:function(a,b){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[1].childNodes[0].style.width=b+"px"},getSelect:function(a){return a.childNodes[1].childNodes[0]}};(function(){for(var a in{doUnloadNestedLists:1})dhtmlXForm.prototype.items.select[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.multiselect={doLoadOpts:function(a,b){var c=a.childNodes[1].childNodes[0];c.multiple=!0;if(!isNaN(b.size))c.size=Number(b.size);a._value=[];a._newValue=[];for(var d=b.options,e=0;e<d.length;e++){var f=new Option(d[e].text||d[e].label,d[e].value);c.options.add(f);if(d[e].selected==!0||d[e].selected=="true")f.selected=!0,a._value.push(d[e].value)}},doAttachEvents:function(a){var b=a.childNodes[1].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},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,"dhxlist_txt_textarea");this.doAttachEvents(a);if(c)a.childNodes[1].childNodes[0].rows=b.rows;this.setValue(a,b.value);return this},doAttachEvents:function(a){a.childNodes[1].childNodes[0].onblur=function(){if(a._value!=this.value)a.checkEvent("onBeforeChange")&&a.callEvent("onBeforeChange",[this._idd,a._value,this.value])!==
!0?this.value=a._value:(a._value=this.value,a.callEvent("onChange",[this._idd,this.value]))}},setValue:function(a,b){a._value=b;a.childNodes[1].childNodes[0].value=a._value||""},getValue:function(a){return a._value},setReadonly:function(a,b){a._ro=b===!0;a._ro?a.childNodes[1].childNodes[0].setAttribute("readOnly","true"):a.childNodes[1].childNodes[0].removeAttribute("readOnly")},isReadonly:function(a){if(!a._ro)a._ro=!1;return a._ro},setFocus:function(a){a.childNodes[1].childNodes[0].focus()},getInput:function(a){return a.childNodes[1].childNodes[0]}};
(function(){for(var a in{doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,setWidth: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,"dhxlist_txt_textarea");this.doAttachEvents(a);a._value=b.value||"";a.childNodes[1].childNodes[0].value=a._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,enable:1,disable: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,"dhxlist_txt_textarea");a.childNodes[1].childNodes[0].onchange=function(){a.callEvent("onChange",[a._idd,this.value])};return this}};(function(){for(var a in{doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,setWidth:1})dhtmlXForm.prototype.items.file[a]=dhtmlXForm.prototype.items.input[a]})();
dhtmlXForm.prototype.items.label={render:function(a,b){a._type="lb";a._enabled=!0;a._checked=!0;var c=document.createElement("DIV");c.className="dhxlist_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},isEnabled:function(a){return a._enabled},
setText:function(a,b){a.firstChild.innerHTML=b},getText:function(a){return a.firstChild.innerHTML}};(function(){for(var a in{doUnloadNestedLists: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._cmd=b.command;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,0);a.innerHTML='<div class="dhx_list_btn" role="link" tabindex="0" dir="ltr" onkeypress="e=event||window.arguments[0];if((e.keyCode==32||e.charCode==32)&&!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"><tr><td class="btn_l"><div class="btn_l">&nbsp;</div></td><td class="btn_m"><div class="btn_txt"'+
(c!=null?' style="width:'+c+'px;"':"")+">"+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);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="dhx_list_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="dhx_list_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?"dhx_list_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")},isEnabled:function(a){return a._enabled},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})dhtmlXForm.prototype.items.button[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.hidden={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")},isEnabled:function(a){return a._enabled},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}};(function(){for(var a in{doUnloadNestedLists:1})dhtmlXForm.prototype.items.hidden[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.list={render:function(a){a._type="list";a._enabled=!0;a._isNestedForm=!0;a.className="dhxlist_base_nested";return[this,new dhtmlXForm(a)]},destruct:function(){}};
dhtmlXForm.prototype.items.fieldset={render:function(a,b){a._type="fs";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="dhxlist_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")},isEnabled:function(a){return a._enabled},
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})dhtmlXForm.prototype.items.fieldset[a]=dhtmlXForm.prototype.items.checkbox[a]})();
dhtmlXForm.prototype.items.block={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="dhxlist_block";if(b.style)c.style.cssText=b.style;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}};(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={};
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,"dhxlist_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,enable:1,disable: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));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,command,width,style,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);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;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){if(!this._userdata)this._userdata={};this._userdata[a]=this._userdata[a]||{};this._userdata[a][b]=c};dhtmlXForm.prototype.getUserData=function(a,b){return this._userdata?(this._userdata[a]||{})[b]||"":""};
dhtmlXForm.prototype.setRTL=function(a){this._rtl=a===!0?!0:!1;this.base.className=this._rtl?"dhxform_rtl":""};_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 "hidden":case "template":case "combo":case "calendar":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){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)?1: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,calendar:1,combo:1,editor:1}&&(c[f]=this.getItemValue(f,a));this["getFormData_"+g]&&(c[f]=this["getFormData_"+g](f));if(this.itemPull[e]._list)for(var h=0;h<this.itemPull[e]._list.length;h++){var i=this.itemPull[e]._list[h].getFormData(b),
j;for(j in i)c[j]=i[j]}}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};_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 for(var g=e.doXPath("//data/*"),h=0;h<g.length;h++)f[g[h].tagName]=g[h].firstChild?g[h].firstChild.nodeValue:"";var i=a.match(/(\?|\&)id\=([a-z0-9_]*)/i);i&&i[0]&&(i=i[0].split("=")[1]);if(d.callEvent("onBeforeDataLoad",[i,f]))d.formId=i,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){typeof b=="function"&&(c=b,b="post");if(this.validate()){var d=this.getFormData(),e=[],f;for(f in d)e.push(f+"="+encodeURIComponent(d[f]));var g=function(a){c&&c.call(this,a,a.xmlDoc.responseText)};b=="get"?dhtmlxAjax.get(a+(a.indexOf("?")==-1?"?":"&")+e.join("&"),g):dhtmlxAjax.post(a,e.join("&"),g)}};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();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();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)};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={ev:!1,inp:null,calendar:{},f:{},f0:{},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,"dhxlist_txt_textarea");this.f[a._idd]=b.dateFormat||"%d-%m-%Y";this.f0[a._idd]=b.serverDateFormat||this.f[a._idd];a._value=b.value?b.value instanceof Date?b.value:this.strToDate(a,b.value):"";a.childNodes[1].childNodes[0].value=this.getFValue(a,a._value,this.f[a._idd]);this.calendar[a._idd]=new dhtmlXCalendarObject(a.childNodes[1].childNodes[0]);
this.calendar[a._idd].setSkin(b.skin||"dhx_skyblue");this.calendar[a._idd].setDateFormat(this.f[a._idd]);b.enableTime||this.calendar[a._idd].hideTime();typeof b.calendarPosition!="undefined"&&this.calendar[a._idd].setPosition(b.calendarPosition);this.calendar[a._idd]._itemIdd=a._idd;this.calendar[a._idd].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});a.childNodes[1].childNodes[0]._idd=a._idd;return this},getCalendar:function(a){return this.calendar[a._idd]},getFValue:function(a,b,c){if(b instanceof Date)var d=function(a){return String(a).length==1?"0"+String(a):a},e=function(a){switch(a){case "%Y":return b.getFullYear();case "%m":return d(b.getMonth()+1);case "%n":return date.getMonth()+1;case "%d":return d(b.getDate());case "%j":return b.getDate();case "%y":return d(b.getYear()%100);case "%D":return{0:"Su",
1:"Mo",2:"Tu",3:"We",4:"Th",5:"Fr",6:"Sa"}[b.getDay()];case "%l":return{0:"Sunday",1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday"}[b.getDay()];case "%M":return{0:"Jan",1:"Feb",2:"Mar",3:"Apr",4:"May",5:"Jun",6:"Jul",7:"Aug",8:"Sep",9:"Oct",10:"Nov",11:"Dec"}[b.getMonth()];case "%F":return{0:"January",1:"February",2:"March",3:"April",4:"May",5:"June",6:"July",7:"August",8:"September",9:"October",10:"November",11:"December"}[b.getMonth()];case "%H":return d(b.getHours());
case "%h":return d((b.getHours()+11)%12+1);case "%i":return d(b.getMinutes());case "%s":return d(b.getSeconds());case "%a":return b.getHours()>11?"pm":"am";case "%A":return b.getHours()>11?"PM":"AM";default:return a}},f=String(c).replace(/%[a-zA-Z]/g,e);return f||String(b)},strToDate:function(a,b){for(var c={Y:0,m:0,d:0,H:0,i:0,s:0},d=String(b).match(/[0-9]{1,}/g),e=this.f0[a._idd].match(/%[a-zA-Z]/g),f=0;f<e.length;f++){var g=e[f].replace(/%/g,"");typeof c[g]!="undefined"&&(c[g]=Number(d[f]))}return new Date(c.Y,
c.m-1,c.d,c.H,c.i,c.s,0)},setValue:function(a,b){a._value=b instanceof Date?b:this.strToDate(a,b);a.childNodes[1].childNodes[0].value=this.getFValue(a,a._value,this.f[a._idd])},getValue:function(a,b){return b===!0?this.getFValue(a,a._value,this.f0[a._idd]):a._value},destruct:function(a){this.calendar[a._idd].unload();this.calendar[a._idd]=null;try{delete this.calendar[a._idd]}catch(b){}this.f[a._idd]=null;try{delete this.f[a._idd]}catch(c){}this.cz[a._idd].parentNode.removeChild(this.cz[a._idd]);
this.cz[a._idd]=null;try{delete this.cz[a._idd]}catch(d){}var e=0,f;for(f in this.calendar)e++;if(e==0)_isIE?document.body.detachEvent("onclick",this.clickEvent):window.removeEventListener("click",this.clickEvent,!1),this.ev=!1;a.childNodes[1].childNodes[0]._idd=null;a.childNodes[1].childNodes[0].onkeypress=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,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1})dhtmlXForm.prototype.items.calendar[a]=dhtmlXForm.prototype.items.input[a]})();dhtmlXForm.prototype.items.calendar.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getCalendar=function(a){return this.doWithItem(a,"getCalendar")};
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,"dhxlist_txt_textarea");a._value=b.value||"";a.childNodes[1].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=1;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[1].childNodes[0]._idd=
a._idd;a.childNodes[1].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[1].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,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.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,"dhxlist_txt_select");this.doAttachEvents(a);this.doLoadOpts(a,b);a.childNodes[1].childNodes[0].opt_type=b.comboType||"";a._combo=new dhtmlXComboFromSelect(a.childNodes[1].childNodes[0]);a._combo._currentComboValue=a._combo.getSelectedValue();a._combo.DOMelem_input.id=b.uid;b.connector&&a._combo.loadXML(b.connector);b.filtering&&
a._combo.enableFilteringMode(!0);b.readonly==!0&&this.setReadonly(a,!0);b.style&&(a._combo.DOMelem_input.style.cssText+=b.style);return this},destruct:function(a){a._combo._currentComboValue=null;a._combo.destructor();a._combo=null;a._apiChange=null;this.d2(a);a=null},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()}},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)},disable:function(a){String(a.className).search("disabled")<0&&(a.className+=" disabled");a._enabled=!1;a._combo.disable(!0)},
getCombo:function(a){return a._combo},setValue:function(a,b){a._apiChange=!0;a._combo.setComboValue(b);a._combo._currentComboValue=a._combo.getSelectedValue();a._apiChange=!1},getValue:function(a){return a._combo.getSelectedValue()},setWidth:function(a,b){a.childNodes[1].childNodes[0].style.width=b+"px"},setReadonly:function(a,b){a._combo_ro=b;a._combo.readonly(a._combo_ro)},isReadonly:function(a){return a._combo_ro||!1}};
(function(){for(var a in{doAddLabel:1,doAddInput:1,doAttachEvents:1,doLoadOpts:1,doUnloadNestedLists:1,setText:1,getText: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,"dhxlist_item_template");a._value=b.value||"";a.childNodes[1].childNodes[0].className+=" dhxeditor_inside";var d=this;this.editor[a._idd]=new dhtmlXEditor(a.childNodes[1].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()])});a.childNodes[0].childNodes[0].removeAttribute("for");a.childNodes[0].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)},getEditor:function(a){return this.editor[a._idd]||null},destruct:function(a){a.childNodes[0].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})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")};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){}a?typeof a=="object"?(this.entBox=a,this.entBox.id="cgrid2_"+this.uid()):this.entBox=document.getElementById(a):(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;this.entBox.className="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);this.entBox.style.position="relative";this.skin_h_correction=20;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"?
25:22;break;case "mt":this._srdh=_isIE&&document.compatMode!="BackCompat"?25:22;break;case "gray":if(_isIE&&document.compatMode!="BackCompat")this._srdh=22}if(_isIE&&this.hdr){var b=this.hdr.parentNode;b.removeChild(this.hdr);b.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;d<this._cCount;d++)this.initCellWidth[d]=="*"&&!this._hrrar[d]?(this._awdth=
!1,c.push(d)):(this.cellWidthType=="%"?(typeof this.cellWidthPC[d]=="undefined"&&(this.cellWidthPC[d]=this.initCellWidth[d]),this.cellWidthPX[d]=Math.floor(a*this.cellWidthPC[d]/100)||0):typeof this.cellWidthPX[d]=="undefined"&&(this.cellWidthPX[d]=this.initCellWidth[d]),this._hrrar[d]||(b+=this.cellWidthPX[d]*1));if(c.length){var i=Math.floor((a-b)/c.length);i<0&&(i=1);for(d=0;d<c.length;d++){var j=Math.max(this._drsclmW?this._drsclmW[c[d]]||0:0,i);this.cellWidthPX[c[d]]=j;b+=j}if(a>b){var k=c[c.length-
1];this.cellWidthPX[k]+=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.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.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.entBox.cmp||this._delta_x)&&(this.skin_name||"").indexOf("dhx")==0&&!a?
2:0,j=(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,y=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);y=Math.min(Math.max(p+(k?m:0),this._awdth[2]),this._awdth[1])+(this._correction_x||0);this._fake&&(y-=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;this.entBox.style.width=Math.max(0,y+(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 u=
this["setSizes_"+this.skin_name];u&&u.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=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!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}this.editStop();if(typeof a.parentNode.idd=="undefined")return!0;if(!r&&!a.parentNode._sRow)if(this.callEvent("onBeforeSelect",[a.parentNode.idd,i])){if(d==0){if(this.getSelectedRowId()==a.parentNode.idd)return this.cell=a;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 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 y=this.row.idd,t=this.cell;b&&typeof y!="undefined"&&t&&!r?c.onRowSelectTime=setTimeout(function(){c.callEvent&&c.callEvent("onRowSelect",[y,t._cellIndex])},100):this.callEvent("onRowSelectRSOnly",[y]);if(this.checkEvent("onSelectStateChanged")){var u=this.getSelectedId();j!=u&&this.callEvent("onSelectStateChanged",[u,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]);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){this._hrrar[a]||(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._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()};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);(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,_isOpera?"keypress":"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;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)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){a._attrs={};for(var c=0;c<a.childNodes.length;c++)a.childNodes[c]._attrs={};this._fillRow(a,this._c_order?this._swapColumns(b.data):b.data);return a},_get_json_data:function(a,b){return a.data[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,this._c_order?this._swapColumns(c):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.toLowerCase()==this.xml.top){this._parseHead(c);var d=a.doXPath(this.xml.row,c),e=parseInt(a.doXPath("//"+this.xml.top)[0].getAttribute("pos")||0),f=parseInt(a.doXPath("//"+this.xml.top)[0].getAttribute("total_count")||0),g=!1;f&&(this.rowsBuffer[f-1]||(this.rowsBuffer.length&&(g=!0),this.rowsBuffer[f-1]=null),f<this.rowsBuffer.length&&(this.rowsBuffer.splice(f,this.rowsBuffer.length-f),g=!0));if(this.isTreeGrid())return this._process_tree_xml(a);
for(var h=0;h<d.length;h++)if(!this.rowsBuffer[h+e]){var i=d[h].getAttribute("id")||h+e+1;this.rowsBuffer[h+e]={idd:i,data:d[h],_parser:this._process_xml_row,_locator:this._get_xml_data};this.rowsAr[i]=d[h]}if(g&&this._srnd){var j=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=j}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_json:function(a){this._parsing=!0;if(a&&a.xmlDoc)eval("dhtmlx.temp="+a.xmlDoc.responseText+";"),a=dhtmlx.temp;
for(var b=0;b<a.rows.length;b++){var c=a.rows[b].id;this.rowsBuffer.push({idd:c,data:a.rows[b],_parser:this._process_json_row,_locator:this._get_json_data});this.rowsAr[c]=a[b]}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)this._fillers=[this._add_filler(b,this.rowsBuffer.length-b)];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],!0));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)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("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].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);if(_isFF&&!window._KHTMLrv&&(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};_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.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,g=0;g<e.length;g++)if(e[g].text.indexOf(d)==0)return e[g].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=1;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],i;for(i in c)c[i]===!0&&d.push(h?
h.get(i)||i: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]))d=f.values._dhx_find(e),e=d==-1?e:f.keys[d];a.push(e)}this.callEvent("onFilterStart",[b,a])&&(this.filterBy(b,a),this._cssEven&&this._fixAlterCss(),
this.callEvent("onFilterEnd",[this.filters]))};
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.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){var d=[],a=a.toString().toLowerCase();typeof c!="number"&&(c=c?1:0);if(!this.rowsBuffer.length)return d;for(var e=b||0;e<this._cCount;e++){if(this._h2)this._h2.forEachChild(0,function(b){if(c&&d.length==c)return d;this._get_cell_value(b.buff,e).toString().toLowerCase().indexOf(a)!=-1&&d.push([b.id,e])},this);else for(var f=0;f<this.rowsBuffer.length;f++)if(this._get_cell_value(this.rowsBuffer[f],e).toString().toLowerCase().indexOf(a)!=-1&&(d.push([this.rowsBuffer[f].idd,
e]),c&&d.length==c))return d;if(typeof b!="undefined")break}return d};dhtmlXGridObject.prototype.makeSearch=function(a,b){typeof a!="object"&&(a=document.getElementById(a));if(a){var c=this;if(a.tagName=="INPUT")a.onkeypress=function(){this._timer&&window.clearTimeout(this._timer);this._timer=window.setTimeout(function(){if(a.value!=""){var d=c.findCell(a.value,b,!0);d.length&&(c._h2&&c.openItem(d[0][0]),c.selectCell(c.getRowIndex(d[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){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' style='width:90%; font-size:8pt; font-family:Tahoma; -moz-user-select: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' style='width:90%; font-size:8pt; font-family:Tahoma; -moz-user-select: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 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)};
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);a.firstChild._filter=function(){return!a.firstChild.value?"":function(b){return a.firstChild.value.toLowerCase()==""?!0:b.toString().toLowerCase()==a.firstChild.value.toLowerCase()}};this._filters_ready()};
dhtmlXGridObject.prototype._in_header_combo_filter=function(a,b){a.innerHTML="<div style='width:100%; padding-left:2px; overflow:hidden; font-size:8pt; font-family:Tahoma; -moz-user-select:text;' 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._in_header_text_search=function(a,b){a.innerHTML="<input type='text' style='width:90%; font-size:8pt; font-family:Tahoma; -moz-user-select:text;'>";a.onclick=a.onmousedown=function(a){return(a||event).cancelBubble=!0};a.onselectstart=function(){return event.cancelBubble=!0};this.makeSearch(a.firstChild,b)};
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])});(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,g=0;g<d.length;g++)e*=parseFloat(this._get_cell_value(this.rowsBuffer[c],d[g]));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.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 0;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());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);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].split(c,2);d[e].push(m[0]);e++;d[e]=[];i[j]=m[1];j--}else(i[j]||
j!=i.length-1)&&d[e].push(i[j]);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 y=this.cells4(this.rowsCol[e]._expanded.ctrl);c+=y.getSubGrid?'<tr><td colspan="'+g+'">'+y.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,f=a.clientY-d[1]+document.body.scrollTop;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){for(var a=a||50,b=0;b<this.rowsBuffer.length;b++)if(!this.rowsBuffer[b]){if(this.callEvent("onDynXLS",[b,a])){var c=this;this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+b+"&count="+a,function(){window.setTimeout(function(){c.forceFullLoading(a)},100)},this._data_type)}break}};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)this._current_load=[d,this._dpref?this._dpref:
b-d],this.callEvent("onDynXLS",[d,this._current_load[1]])&&this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+d+"&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));a.className="";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));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")||"");b&&b(g);for(var j=d.rows[0],k="",m="",l="",n="",o="",p=0;p<j.cells.length;p++){k+=(k?",":"")+j.cells[p].innerHTML;var r=j.cells[p].getAttribute("width")||j.cells[p].offsetWidth||
(window.getComputedStyle?window.getComputedStyle(j.cells[p],null).width:j.cells[p].currentStyle?j.cells[p].currentStyle.width:0);m+=(m?",":"")+(r=="*"?r:parseInt(r));l+=(l?",":"")+(j.cells[p].getAttribute("align")||"left");n+=(n?",":"")+(j.cells[p].getAttribute("type")||"ed");o+=(o?",":"")+(j.cells[p].getAttribute("sort")||"str");var q=j.cells[p].getAttribute("format");if(q)j.cells[p].getAttribute("type").toLowerCase().indexOf("calendar")!=-1?g._dtmask=q:g.setNumberFormat(q,p)}g.setHeader(k);g.setInitWidths(m);
g.setColAlign(l);g.setColTypes(n);g.setColSorting(o);a.getAttribute("gridHeight")=="auto"&&g.enableAutoHeigth(!0);a.getAttribute("multiline")&&g.enableMultiline(!0);var s=d.getAttribute("lightnavigation");s&&g.enableLightMouseNavigation(s);var y=d.getAttribute("evenrow"),t=d.getAttribute("unevenrow");(y||t)&&g.enableAlterCss(y,t);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])});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-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-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){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(!1,!1,{isYearEditable:!0});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){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._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(){return this.cell.firstChild.getAttribute?this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href"):""};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 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":"dhx_skyblue"};this.skin=c!=null?c: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=200;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;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)}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}};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]),y=isNaN(q[0])?parseInt(d.polyObj[q[0]].style.width):0,t=0;t<a.length;t++)for(var u=0;u<a[t].length;u++)if(a[t][u]==r){if(!s){for(var s=!0,w=d.base.offsetWidth-c[r][0]*d.skinParams[d.skin].ver_sep_width,B=0;B<
a[t].length;B++)isNaN(a[t][B])||(w-=a[t][B],q[0]-=1);y=Math.ceil(w/q[0])}a[t][u]=y}p.style.width=y+"px";for(var s=isNaN(q[1]),v=isNaN(q[1])?parseInt(d.polyObj[q[1]].style.height):0,t=0;t<b.length;t++)for(u=0;u<b[t].length;u++)if(b[t][u]==r){if(!s){for(var s=!0,z=d.base.offsetHeight-c[r][1]*d.skinParams[d.skin].hor_sep_height,B=0;B<b.length;B++)isNaN(b[B][u])||(z-=b[B][u],q[1]-=1);v=Math.ceil(z/q[1])}b[t][u]=v}p.style.height=v+"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 A=String(o.getAttribute("neighbors")).split(";"),x=0;x<A.length;x++){var C=String(A[x]).split(",");C.length>1&&(A[x]=C)}p._rowData=A;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 F=o.getAttribute("top").split(";"),x=0;x<F.length;x++)C=String(F[x]).split(","),C.length>1&&(F[x]=C);p._top=F;for(var I=o.getAttribute("bottom").split(";"),x=0;x<I.length;x++)C=String(I[x]).split(","),C.length>1&&(I[x]=C);p._bottom=I;d.sepHor[d.sepHor.length]=p}else{p.className="dhtmlxLayoutPolySplitterVer";p._dir="ver";for(var J=o.getAttribute("left").split(";"),x=0;x<J.length;x++)C=String(J[x]).split(","),C.length>1&&(J[x]=C);p._left=J;for(var K=
o.getAttribute("right").split(";"),x=0;x<K.length;x++)C=String(K[x]).split(","),C.length>1&&(K[x]=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"),B=String(M).split(";"),t=0;t<B.length;t++){a[t]=[];b[t]=[];for(var G=String(B[t]).split(","),u=0;u<G.length;u++)a[t][u]=G[u],b[t][u]=G[u],c[G[u]]==null&&(c[G[u]]=[0,0])}for(var H in c){s=
!1;for(t=0;t<a.length;t++)for(u=0;u<a[t].length;u++)if(a[t][u]==H&&!s){for(var s=!0,E=0;E<a[t].length;E++)a[t][E]!=H&&c[H][0]++;for(E=0;E<a.length;E++)a[E][u]!=H&&c[H][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){Number(a)&&e._setWidth(this._idd,a)},d.getWidth=function(){return parseInt(this.style.width)},d.setHeight=function(a){Number(a)&&e._setHeight(this._idd,a)},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},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._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 g=e.polyObj[e._anyExpR[0]];e._resXMaxWidthRight=parseInt(g.style.width)-
e._minWidth;if(e._alterSizes.length>0)for(var h=0;h<e._alterSizes.length;h++){for(var f=0;f<e._anyExpL.length;f++)if(e._alterSizes[h][0]==e._anyExpL[f]){var i=e._resXMaxWidthLeft=parseInt(d.style.width)-e._alterSizes[h][1];if(i<e._resXMaxWidthLeft)e._resXMaxWidthLeft=i}for(f=0;f<e._anyExpR.length;f++)if(e._alterSizes[h][0]==e._anyExpR[f]&&(i=parseInt(g.style.width)-e._alterSizes[h][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 g=e.polyObj[e._anyExpB[0]];e._resYMaxHeightBottom=parseInt(g.style.height)-
e._minHeight;if(e._alterSizes.length>0)for(var h=0;h<e._alterSizes.length;h++){for(var f=0;f<e._anyExpT.length;f++)if(e._alterSizes[h][0]==e._anyExpT[f]){var i=parseInt(d.style.height)-e._alterSizes[h][2]-(d.childNodes[0].style.display!="none"?e.skinParams[e.skin].cpanel_height:0);if(i<e._resYMaxHeightTop)e._resYMaxHeightTop=i}for(f=0;f<e._anyExpB.length;f++)if(e._alterSizes[h][0]==e._anyExpB[f]&&(i=parseInt(g.style.height)-e._alterSizes[h][2]-(g.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.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){for(var b in a)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.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 y=[],s=0;s<q.length;s++)if(typeof q[s]=="object")for(var t=0;t<q[s].length;t++)y[y.length]=this.polyObj[q[s][t]];
else y[y.length]=this.polyObj[q[s]];for(s=0;s<y.length;s++)y[s].updateNestedObjects();this.callEvent("onPanelResizeFinish",[])}};this._showCovers=function(){for(var a in this.polyObj)this._effects.highlight&&this._isResizable(a)&&this.polyObj[a].showCoverBlocker()};this._hideCovers=function(){for(var a in this.polyObj)this.polyObj[a].hideCoverBlocker()};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.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.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.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.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.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 y=65536;for(n in e)e[n]<y&&(y=e[n]);y-=d._minWidth;y=c[0]-y;y<d._dimension[0]&&!b&&(y=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["",y,t];a.setMinDimension(y,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._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.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.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();
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;c=null}};
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})}};
function dhtmlXMenuObject(a,b){var c=this;this.addBaseIdAsContextZone=null;this.isDhtmlxMenuObject=!0;this.skin=b!=null?b:"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.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}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.sxDacProc=null;this.dacSpeed=10;this.dacCycles=[];for(g=0;g<10;g++)this.dacCycles[g]=g;this.dacSpeedIE=10;this.dacCyclesIE=[];for(g=0;g<10;g++)this.dacCyclesIE[g]=g;this._enableDacSupport=function(a){this.sxDacProc=a};
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(this.sxDacProc!=null&&this.idPull["sxDac_"+a]!=null)this.idPull["sxDac_"+a]._hide();else if(this.idPull["polygon_"+a].style.display!="none"){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])}};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;if(this.limit>0&&this.limit<c){var p="arrowup_"+a,r="arrowdown_"+a;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}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.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 q="polygon_"+this.itemPull[a].parent;else this.context&&(q=this.idPull[this.idPrefix+this.topId]);var s=this.idPull[a].tagName!=null?getAbsoluteLeft(this.idPull[a]):this.idPull[a][0],
y=this.idPull[a].tagName!=null?getAbsoluteTop(this.idPull[a]):this.idPull[a][1],t=this.idPull[a].tagName!=null?this.idPull[a].offsetWidth:0,u=this.idPull[a].tagName!=null?this.idPull[a].offsetHeight+e+f:0,w=0,B=0,v=this.idPull[d].offsetWidth,z=this.idPull[d].offsetHeight;b=="bottom"&&(w=this._rtl?s+(t!=null?t:0)-v:this._align=="right"?s+t-v:s-1+(b==this.dirTopLevel?this._topLevelRightMargin:0),B=y-1+u-e-f+this._topLevelBottomMargin);b=="right"&&(w=s+t-1,B=y+2);b=="left"&&(w=s-this.idPull[d].offsetWidth+
2,B=y+2);b=="top"&&(w=s-1,B=y-z+2);if(this.fixedPosition)var A=65536,x=65536;else if(A=this.menuX2!=null?this.menuX2:0,x=this.menuY2!=null?this.menuY2:0,A==0)window.innerWidth?(A=window.innerWidth,x=window.innerHeight):(A=document.body.offsetWidth,x=document.body.scrollHeight);w+v>A&&!this._rtl&&(w=s-v+2);w<this.menuX1&&this._rtl&&(w=s+t-2);w<0&&(w=0);B+z>x&&this.menuY2!=null&&(B=Math.max(y+u-z+2,2),this.itemPull[a]!=null&&!this.context&&this.itemPull[a].parent==this.idPrefix+this.topId&&(B-=this.base.offsetHeight));
this.idPull[d].style.left=w+"px";this.idPull[d].style.top=B+e+"px";if(this.sxDacProc!=null&&this.idPull["sxDac_"+a]!=null)this.idPull["sxDac_"+a]._show();else{this.idPull[d].style.visibility="";if(this.limit>0&&this.limit<c)g.style.left=w+"px",g.style.top=B+"px",g.style.width=v+this._arrowFFFix+"px",g.style.visibility="",o.style.left=w+"px",o.style.top=B+e+z+"px",o.style.width=v+this._arrowFFFix+"px",o.style.visibility="",this._checkArrowsState(a);if(this._isIE6){var C=d+"_ie6cover";if(this.idPull[C]==
null){var D=document.createElement("IFRAME");D.className="dhtmlxMenu_IE6CoverFix_"+this.skin;D.frameBorder=0;D.setAttribute("src","javascript:false;");document.body.insertBefore(D,document.body.firstChild);this.idPull[C]=D}this.idPull[C].style.left=this.idPull[d].style.left;this.idPull[C].style.top=this.idPull[d].style.top;this.idPull[C].style.width=this.idPull[d].offsetWidth+"px";this.idPull[C].style.height=this.idPull[d].offsetHeight+"px";this.idPull[C].style.zIndex=this.idPull[d].style.zIndex-
1;this.idPull[C].style.display=""}a=String(a).replace(this.idPrefix,"");a==this.topId&&(a=null);this.callEvent("onShow",[a])}}}};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 b.charAt(0)!="c"&&b.charAt(1)!="d"&&b.charAt(2)!="s"&&(this.checkEvent("onClick")?(this._clearAndHide(),
this._isContextMenuVisible()&&this.contextAutoHide&&this._hideContextMenu(),this.callEvent("onClick",[a,this.contextMenuZoneId,c])):b.charAt(1)=="d"||this.menuMode=="win"&&b.charAt(2)=="t"||(this._clearAndHide(),this._isContextMenuVisible()&&this.contextAutoHide&&this._hideContextMenu()))};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.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())};this._bodyContext=function(a){var a=a||event,b=(a.srcElement||a.target).className;if(!(b.search("dhtmlxMenu")!=-1&&b.search("SubLevelArea")!=-1)){var d=!0,e=a.target||a.srcElement;e.id!=null&&c.isContextZone(e.id)&&(d=!1);e==document.body&&(d=!1);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}}};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;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};
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;d.onselectstart=function(a){a=
a||event;return a.returnValue=!1};d.onmouseover=function(){c.menuMode=="web"&&window.clearTimeout(c.menuTimeoutHandler);c._redistribSubLevelSelection(this.id,this.parent)};if(c.menuMode=="web")d.onmouseout=function(){window.clearTimeout(c.menuTimeoutHandler);c.menuTimeoutHandler=window.setTimeout(function(){c._clearAndHide()},c.menuTimeoutMsec,"JavaScript")};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.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(!(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 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||e||0;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,ls:1,rs: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.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 dhtmlXTabBar(a,b,c){b=b||"top";dhtmlxEventable(this);this._hrefs={};this._s={};this._c={};this._s.mode=b;this._s.scrolls=!0;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_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;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 d=this._s._rendered;if(d)for(var e=0;e<d.length;e++)d[e].parentNode.removeChild(d[e]);var f=document.createElement("DIV");
f.className="dhx_tabbar_lineA";this._tabAll.appendChild(f);var g=document.createElement("DIV");g.className="dhx_tabbar_lineB";this._tabAll.appendChild(g);var h=document.createElement("DIV");h.className="dhx_tabbar_lineC";this._tabAll.appendChild(h);var i=document.createElement("DIV");i.className="dhx_tabbar_lineD";this._tabAll.appendChild(i);this._getCoverLine();this._s._rendered=[f,g,h,i];if(this._s.expand){this._conZone.style.borderWidth="0px 0px 0px 0px";this._tabZone.firstChild.style.borderWidth=
"0px 0px 0px 0px";h.style.borderWidth="0px 0px 0px 0px";i.style.left="0px";h.style.right="0px";f.style.borderWidth="0px 0px 0px 0px";if(this._s.mode=="top")this._lineA.style.borderWidth="1px 0px 0px 0px";g.style.left="1px"}var j=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||
(f.style[this._py]=parseInt(this._conZone.style[this._py])-3+"px",f.style[this._dx]=b-2+"px",g.style[this._py]=parseInt(this._conZone.style[this._py])-3+"px",g.style[this._dx]=b-(a?6:4)+(this._s.expand?2:0)+"px",h.style[this._dy]=parseInt(this._tabZone.style[this._dy])-3+"px",this._lineA.style[this._dx]=b-2+"px")};j.call(this);var k=this._checkScroll;this._checkScroll=function(){j.apply(this,arguments);k.apply(this,arguments)};var m=this._scrollTo;this._scrollTo=function(){m.apply(this,arguments);
j.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._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){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){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._vMode?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*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),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.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){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},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(/src=("|')([^"']+)("|')/);
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 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.selectPolygonOffsetLeft=this.selectPolygonOffsetTop=
0;this.setSkin=function(a){this.skin=a;if(this.skin=="dhx_skyblue")this.selectPolygonOffsetTop=2;if(this.skin=="dhx_web")this.selectPolygonOffsetLeft=this.selectPolygonOffsetTop=1;this.cont.className="dhx_toolbar_base_"+this.skin+(this.rtl?" rtl":"");for(var b in this.objPull){var c=this.objPull[b];if(c.type=="slider")c.pen._detectLimits(),c.pen._definePos(),c.label.className="dhx_toolbar_slider_label_"+this.skin+(this.rtl?" rtl":"");if(c.type=="buttonSelect")c.polygon.className="dhx_toolbar_poly_"+
this.skin+(this.rtl?" rtl":"")}};this.setSkin(b==null?"dhx_skyblue":b);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,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.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)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 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",a.polygon._ie6cover))a.polygon._ie6cover.style.display="none";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",b.polygon._ie6cover))b.polygon._ie6cover.style.display="none"}})};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)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}else 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}}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)}}};
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}};
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)};
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,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)};
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.openAll=c.openAll!=null;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 def";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.renderSelect=c.renderSelect!=null?c.renderSelect=="false"||c.renderSelect=="disabled"?!1:!0:!0;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 def";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){if(d.obj.className=d.obj.renderAs,d.arw.className=String(d.obj.renderAs).replace("btn","arw"),a.anyUsed="none",d.polygon.style.display="none",d.polygon._ie6cover)d.polygon._ie6cover.style.display="none"}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",c.polygon._ie6cover))c.polygon._ie6cover.style.display="none"}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="";d._fixMaxOpenHeight(d.maxOpen||null);a._autoDetectVisibleArea();var e=getAbsoluteTop(d.obj)+d.obj.offsetHeight+a.selectPolygonOffsetTop,f=d.polygon.offsetHeight;e+f>a.tY2&&d._fixMaxOpenHeight(Math.floor((a.tY2-e)/22));
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'>";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.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.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":"")):(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};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};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?this.state?"pres":"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.pressed)this.renderAs=this.className="dhx_toolbar_btn over"};this.obj._doOnMouseOut=function(){if(d.state!=!1&&a.anyUsed=="none"&&!this.pressed)this.renderAs=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]);this._doOnMouseOut();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.obj.renderAs="dhx_toolbar_btn over"):(this.obj.pressed=!1,this.obj.className="dhx_toolbar_btn def",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.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 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.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 y=this.onXLE;this.onXLE=function(a){this._onradh(b);y&&y(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);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),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){b=a.get("id");if(a.get("radio"))this.htmlNode._r_logic=!0;this.parsingOn=b;this.parsedArray=[];this.nodeAskingCall=this.setCheckList=""}var f=this._globalIdStorageFind(b);if(!f)return dhtmlxError.throwError("DataStructure","XML refers to not existing parent");this.parsCount=this.parsCount?this.parsCount+
1:1;this.XMLloadingWarning=1;var g=f.childsCount&&!d&&!this._edsbps&&!f._has_top?0:0;this.npl=0;a.each("item",function(a){f.XMLload=1;this._parseItem(a,f,0,g);this.npl++},this,d);if(!c){a.each("userdata",function(b){this.setUserData(a.get("id"),b.get("name"),b.content())},this);f.XMLload=1;if(this.waitUpdateXML){this.waitUpdateXML=!1;for(var h=f.childsCount-1;h>=0;h--)f.childNodes[h]._dmark&&this.deleteItem(f.childNodes[h].id)}for(var i=this._globalIdStorageFind(this.parsingOn),h=0;h<this.parsedArray.length;h++)f.htmlNode.childNodes[0].appendChild(this.parsedArray[h]);
this.parsedArray=[];this.lastLoadedXMLId=b;this.XMLloadingWarning=0;for(var j=this.setCheckList.split(this.dlmtr),k=0;k<j.length;k++)j[k]&&this.setCheck(j[k],1);this.XMLsource&&this.tscheck&&this.smcheck&&f.id!=this.rootId&&(f.checkstate===0?this._setSubChecked(0,f):f.checkstate===1&&this._setSubChecked(1,f));this._redrawFrom(this,null,d);a.get("order")&&a.get("order")!="none"&&this._reorderBranch(f,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 m=this;window.setTimeout(function(){m.callEvent("onXLE",[m,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();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);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));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};
(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){if(this._editCell&&(this.dADTempOff=this.dADTempOffEd,this._editCell.id!=a)){var b=!0,b=this.callEvent("onEdit",[2,this._editCell.id,this,this._editCell.span.childNodes[0].value]);if(b===!0)b=this._editCell.span.childNodes[0].value;else if(b===!1)b=this._editCell._oldValue;var c=b!=this._editCell._oldValue;this._editCell.span.innerHTML=b;this._editCell.label=this._editCell.span.innerHTML;var d=this._editCell.i_sel?"selectedTreeRow":"standartTreeRow";
this._editCell.span.className=d;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 e=this._editCell.id;this.childCalc&&this._fixChildCountLabel(this._editCell);this._editCell=null;this.callEvent("onEdit",[3,e,this,c]);this._enblkbrd&&(this.parentObject.lastChild.focus(),this.parentObject.lastChild.focus())}};
dhtmlXTreeObject.prototype._stopEditItem=function(a){this._stopEdit(a)};dhtmlXTreeObject.prototype.stopEdit=function(){this._editCell&&this._stopEdit(this._editCell.id+"_non")};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;if(this._xescapeEntities)for(var e=0;e<this._serEnts.length;e++)d=d.replace(this._serEnts[e][2],this._serEnts[e][1]);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 f=a._userdatalist.split(","),
g=[],e=0;e<f.length;e++)g.push('{ "name":"'+f[e]+'" , "content":"'+a.userData["t_"+f[e]]+'" }');b.push(g.join(","));b.push("]")}if(a.childsCount){b.push(', "item":[');g=[];for(e=0;e<a.childsCount;e++)g.push(this._serializeItemJSON(a.childNodes[e]));b.push(g.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 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="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.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._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(this.wins[a]),this._maximizeWindow(this.wins[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))document.body.className=this.vp._css,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._carcass)};this.attachViewportTo=function(a){if(this.autoViewport==!1)this.vp!=document.body&&this.vp.parentNode.removeChild(this.vp),this.vp=typeof a=="string"?document.getElementById(a):a,this.vp.autocreated=!1,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._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){this._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):b._maximizeWindow(c))};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)};i.maximize=function(){b._maximizeWindow(this)};i.close=function(){b._closeWindow(this)};i.park=function(){this._isParkedAllowed&&b._parkWindow(this)};i.stick=function(){b._stickWindow(this)};i.unstick=function(){b._unstickWindow(this)};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=="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.layout&&this.callEvent("_onBeforeTryResize",[this]);a=a||event}};this._addDefaultButtons(i);i.button=function(a){var 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._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._engineGetWindowButton(a,"stick");c.title=this.i18n.stick;c.isVisible=!1;c.style.display=
"none";c._isEnabled=!0;c.isPressed=!1;c.label="stick";c._doOnClick=function(){this.isPressed=!0;b._stickWindow(a)};var f=this._engineGetWindowButton(a,"sticked");f.title=this.i18n.unstick;f.isVisible=!1;f.style.display="none";f._isEnabled=!0;f.isPressed=!1;f.label="sticked";f._doOnClick=function(){this.isPressed=!1;b._unstickWindow(a)};var g=this._engineGetWindowButton(a,"help");g.title=this.i18n.help;g.isVisible=!1;g.style.display="none";g._isEnabled=!0;g.isPressed=!1;g.label="help";g._doOnClick=
function(){b._needHelp(a)};var h=this._engineGetWindowButton(a,"park");h.titleIfParked=this.i18n.parkdown;h.titleIfNotParked=this.i18n.parkup;h.title=h.titleIfNotParked;h.isVisible=!0;h._isEnabled=!0;h.isPressed=!1;h.label="park";h._doOnClick=function(){b._parkWindow(a)};var i=this._engineGetWindowButton(a,"minmax1");i.title=this.i18n.maximize;i.isVisible=!0;i._isEnabled=!0;i.isPressed=!1;i.label="minmax1";i._doOnClick=function(){b._maximizeWindow(a)};var j=this._engineGetWindowButton(a,"minmax2");
j.title=this.i18n.restore;j.isVisible=!1;j.style.display="none";j._isEnabled=!0;j.isPressed=!1;j.label="minmax2";j._doOnClick=function(){b._restoreWindow(a)};var k=this._engineGetWindowButton(a,"close");k.title=this.i18n.close;k.isVisible=!0;k._isEnabled=!0;k.isPressed=!1;k.label="close";k._doOnClick=function(){b._closeWindow(a)};var m=this._engineGetWindowButton(a,"dock");m.title=this.i18n.dock;m.style.display="none";m.isVisible=!1;m._isEnabled=!0;m.isPressed=!1;m.label="dock";m._doOnClick=function(){};
a._isSticked=!1;a._isParked=!1;a._isParkedAllowed=!0;a._isMaximized=!1;a._isDocked=!1;a.btns={};a.btns.stick=c;a.btns.sticked=f;a.btns.help=g;a.btns.park=h;a.btns.minmax1=i;a.btns.minmax2=j;a.btns.close=k;a.btns.dock=m;for(var l in a.btns)this._attachEventsOnButton(a,a.btns[l])};this._attachEventsOnButton=function(a,c){this._isIPad?(c.ontouchstart=function(a){a.cancelBubble=!0;return a.returnValue=!1},c.ontouchend=function(b){b.cancelBubble=!0;b.returnValue=!1;if(!this._isEnabled)return!1;this.checkEvent("onClick")?
this.callEvent("onClick",[a,this]):this._doOnClick();return!1}):(c.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"},c.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"},
c.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"},c.onmouseup=function(){if(this._isEnabled){var b=this.isPressed;this.isPressed=!1;this.className="dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_over_default";b&&(this.checkEvent("onClick")?this.callEvent("onClick",[a,this]):this._doOnClick())}else this.className="dhtmlx_wins_btns_button dhtmlx_button_"+
this.label+"_disabled"});c.show=function(){b._showButton(a,this.label)};c.hide=function(){b._hideButton(a,this.label)};c.enable=function(){b._enableButton(a,this.label)};c.disable=function(){b._disableButton(a,this.label)};c.isEnabled=function(){return this._isEnabled};c.isHidden=function(){return!this.isVisible};dhtmlxEventable(c)};this._parkWindow=function(a,b){if(a._isParkedAllowed||b)if(!this.enableParkEffect||!a.parkBusy)if(a._isParked)this.enableParkEffect&&!b?(a.parkBusy=!0,this._doParkDown(a)):
(a.h=a.lastParkH,this._engineRedrawWindowSize(a),this._engineDoOnWindowParkDown(a),a.updateNestedObjects(),a.btns.park.title=a.btns.park.titleIfNotParked,a._allowResizeGlobal==!0&&(this._enableButton(a,"minmax1"),this._enableButton(a,"minmax2")),a._isParked=!1,b||(a.checkEvent("onParkDown")?a.callEvent("onParkDown",[a]):this.callEvent("onParkDown",[a])));else if(this.enableParkEffect&&!b)if(a.lastParkH=String(a.h).search(/\%$/)==-1?a.h:a.offsetHeight,a._allowResizeGlobal==!0&&(this._disableButton(a,
"minmax1"),this._disableButton(a,"minmax2")),this.enableParkEffect)a.parkBusy=!0,this._doParkUp(a);else{var c=a._skinParams!=null?a._skinParams:this.skinParams[this.skin];a.h=c.header_height+c.border_bottom_height;a.btns.park.title=a.btns.park.titleIfParked}else a.lastParkH=String(a.h).search(/\%$/)==-1?a.h:a.offsetHeight,a.h=this._engineGetWindowParkedHeight(a),this._engineRedrawWindowSize(a),this._engineDoOnWindowParkUp(a),a.btns.park.title=a.btns.park.titleIfParked,a._isParked=!0,b||(a.checkEvent("onParkUp")?
a.callEvent("onParkUp",[a]):this.callEvent("onParkUp",[a]))};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"};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"};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){if(a._allowResizeGlobal!=!1){var b=a._isParked;b&&this._parkWindow(a,!0);a.lastMaximizeX=a.x;a.lastMaximizeY=a.y;a.lastMaximizeW=a.w;a.lastMaximizeH=a.h;a.maxW!="auto"&&a.maxW!="auto"?(a.x=Math.round(a.x+(a.w-a.maxW)/2),a.y=Math.round(a.y+(a.h-a.maxH)/2),a._allowMove=!0):(a.x=0,a.y=0,a._allowMove=!1);a._isMaximized=!0;a._allowResize=!1;a.w=a.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:a.maxW;a.h=a.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:a.maxH;this._hideButton(a,"minmax1");this._showButton(a,"minmax2");this._engineRedrawWindowPos(a);b?this._parkWindow(a,!0):(this._engineRedrawWindowSize(a),a.updateNestedObjects());a.checkEvent("onMaximize")?a.callEvent("onMaximize",[a]):this.callEvent("onMaximize",[a])}};
this._restoreWindow=function(a){if(a._allowResizeGlobal!=!1){a.layout&&a.layout._defineWindowMinDimension(a);var b=a._isParked;b&&this._parkWindow(a,!0);a.maxW!="auto"&&a.maxW!="auto"?(a.x=Math.round(a.x+(a.w-a.lastMaximizeW)/2),a.y=Math.round(a.y+(a.h-a.lastMaximizeH)/2)):(a.x=a.lastMaximizeX,a.y=a.lastMaximizeY);a.w=a.lastMaximizeW;a.h=a.lastMaximizeH;a._isMaximized=!1;a._allowMove=a._allowMoveGlobal;a._allowResize=!0;this._fixWindowDimensionInViewport(a);this._hideButton(a,"minmax2");this._showButton(a,
"minmax1");this._engineRedrawWindowPos(a);b?this._parkWindow(a,!0):(this._engineRedrawWindowSize(a),a.updateNestedObjects());a.checkEvent("onMinimize")?a.callEvent("onMinimize",[a]):this.callEvent("onMinimize",[a])}};this._showButton=function(a,b){var c=this._engineGetWindowButton(a,b);if(c)c.isVisible=!0,c.style.display="",c.style.visibility="visible",this._engineRedrawWindowTitle(a)};this._hideButton=function(a,b){var c=this._engineGetWindowButton(a,b);if(c)c.isVisible=!1,c.style.display="none",
c.style.visibility="hidden",this._engineRedrawWindowTitle(a)};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){if(this._focusFixIE)this._focusFixIE.style.top=(this.vp==document.body?0:getAbsoluteTop(this.vp))+a.y+"px",this._focusFixIE.focus();if(a.checkEvent("onClose")){if(!a.callEvent("onClose",[a]))return}else if(!this.callEvent("onClose",[a]))return;this._removeWindowGlobal(a);var b={zi:0},c;for(c in this.wins)this.wins[c].zi>b.zi&&(b=this.wins[c]);b!=null&&this._makeActive(b)};
this._needHelp=function(a){a.checkEvent("onHelp")?a.callEvent("onHelp",[a]):this.callEvent("onHelp",[a])};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){a._isSticked=
!0;this._hideButton(a,"stick");this._showButton(a,"sticked");this._bringOnTop(a)};this._unstickWindow=function(a){a._isSticked=!1;this._hideButton(a,"sticked");this._showButton(a,"stick");this._bringOnTopAnyStickedWindows()};this._addUserButton=function(a,b,c,g){var 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;h._doOnClick=function(){};this._attachEventsOnButton(a,h)};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(a.btns[b]){var c=a.btns[b];c.title=null;c.isVisible=null;c._isEnabled=null;c.isPressed=null;c.label=null;c._doOnClick=
null;c.attachEvent=null;c.callEvent=null;c.checkEvent=null;c.detachEvent=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.parentNode&&c.parentNode.removeChild(c);c=null;a.btns[b]=null}};this._removeWindowGlobal=function(a){this.modalWin==a&&this._setWindowModal(a,!1);var b=a.idd;a.coverBlocker().onselectstart=null;a._dhxContDestruct();this._engineDiableOnSelectInWindow(a,
!1);this._engineGetWindowHeader(a).onmousedown=null;this.resizingWin=this.movingWin=this._engineGetWindowHeader(a).ondblclick=null;for(var c in a.btns)this._removeButtonGlobal(a,c);a.btns=null;a._adjustToContent=null;a._doOnAttachMenu=null;a._doOnAttachStatusBar=null;a._doOnAttachToolbar=null;a._redraw=null;a.addUserButton=null;a.allowMove=null;a.allowPark=null;a.allowResize=null;a.attachEvent=null;a.bringToBottom=null;a.bringToTop=null;a.callEvent=null;a.center=null;a.centerOnScreen=null;a.checkEvent=
null;a.clearIcon=null;a.close=null;a.denyMove=null;a.denyPark=null;a.denyResize=null;a.detachEvent=null;a.eventCatcher=null;a.getDimension=null;a.getIcon=null;a.getId=null;a.getMaxDimension=null;a.getMinDimension=null;a.getPosition=null;a.getText=null;a.hide=null;a.hideHeader=null;a.isHidden=null;a.isMaximized=null;a.isModal=null;a.isMovable=null;a.isOnBottom=null;a.isOnTop=null;a.isParkable=null;a.isParked=null;a.isResizable=null;a.isSticked=null;a.keepInViewport=null;a.maximize=null;a.minimize=
null;a.park=null;a.progressOff=null;a.progressOn=null;a.removeUserButton=null;a.restoreIcon=null;a.setDimension=null;a.setIcon=null;a.setMaxDimension=null;a.setMinDimension=null;a.setModal=null;a.setPosition=null;a.setText=null;a.setToFullScreen=null;a.show=null;a.showHeader=null;a.stick=null;a.unstick=null;a.onmousemove=null;a.onmousedown=null;a.icons=null;a.button=null;a._dhxContDestruct=null;a.dhxContGlobal.obj=null;a.dhxContGlobal.setContent=null;a.dhxContGlobal.dhxcont=null;a.dhxContGlobal=null;
if(a._frame){for(;a._frame.childNodes.length>0;)a._frame.removeChild(a._frame.childNodes[0]);a._frame=null}this._parseNestedForEvents(a);a._content=null;a.innerHTML="";a.parentNode.removeChild(a);a=null;this.wins[b]=null;delete this.wins[b];b=null};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=""};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])};this._clearAll=function(){this._clearDocumentEvents();for(var a in this.wins)this._removeWindowGlobal(this.wins[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.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}[a]==1?"":a});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=wins=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}};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 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]);a.coverBlocker().onselectstart=function(a){a=a||event;a.returnValue=!1;a.cancelBubble=!0}};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};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 c=null,d="dhtmlx_button_"+String(b).toLowerCase()+"_",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)}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="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"}})();dhtmlx.skin="dhx_skyblue";
