/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
window.dhx||(dhx={});dhx.version="3.0";dhx.codebase="./";dhx.name="Core";dhx.copy=function(a){var b=dhx.copy.Sd;b.prototype=a;return new b};dhx.copy.Sd=function(){};dhx.extend=function(a,b,c){a.Ya&&(a=a.Ya[0]);for(var d in b)if(!a[d]||c)a[d]=b[d];b.defaults&&dhx.extend(a.defaults,b.defaults);b.$init&&b.$init.call(a);return a};
dhx.fullCopy=function(a){var b=a.length?[]:{};arguments.length>1&&(b=arguments[0],a=arguments[1]);for(var c in a)typeof a[c]=="object"?(b[c]=a[c].length?[]:{},dhx.fullCopy(b[c],a[c])):b[c]=a[c];return b};dhx.single=function(a){var b=null,c=function(c){b||(b=new a({}));b.Yc&&b.Yc.apply(b,arguments);return b};return c};
dhx.protoUI=function(){var a=arguments,b=a[0].name,c=function(d){if(a){for(var e=[a[0]],f=1;f<a.length;f++)e[f]=a[f],e[f].Ya&&(e[f]=e[f].call(dhx)),e[f].prototype&&e[f].prototype.name&&(dhx.ui[e[f].prototype.name]=e[f]);dhx.ui[b]=dhx.proto.apply(dhx,e);if(c.Ga)for(f=0;f<c.Ga.length;f++)dhx.Type(dhx.ui[b],c.Ga[f]);c=a=null}return this!=dhx?new dhx.ui[b](d):dhx.ui[b]};c.Ya=arguments;return dhx.ui[b]=c};
dhx.proto=function(){for(var a=arguments,b=a[0],c=!!b.$init,d=[],e=a.length-1;e>0;e--){if(typeof a[e]=="function")a[e]=a[e].prototype;a[e].$init&&d.push(a[e].$init);if(a[e].defaults){var f=a[e].defaults;if(!b.defaults)b.defaults={};for(var g in f)dhx.isNotDefined(b.defaults[g])&&(b.defaults[g]=f[g])}if(a[e].type&&b.type)for(g in a[e].type)b.type[g]||(b.type[g]=a[e].type[g]);for(var h in a[e])b[h]||(b[h]=a[e][h])}c&&d.push(b.$init);b.$init=function(){for(var a=0;a<d.length;a++)d[a].apply(this,arguments)};
var i=function(a){this.$ready=[];this.$init(a);this.Rb&&this.Rb(a,this.defaults);for(var b=0;b<this.$ready.length;b++)this.$ready[b].call(this)};i.prototype=b;b=a=null;return i};dhx.bind=function(a,b){return function(){return a.apply(b,arguments)}};dhx.require=function(a){dhx.Mc[a]||(dhx.exec(dhx.ajax().sync().get(dhx.codebase+a).responseText),dhx.Mc[a]=!0)};dhx.Mc={};dhx.exec=function(a){window.execScript?window.execScript(a):window.eval(a)};
dhx.wrap=function(a,b){return!a?b:function(){var c=a.apply(this,arguments);b.apply(this,arguments);return c}};dhx.methodPush=function(a,b){return function(){var c=!1;return c=a[b].apply(a,arguments)}};dhx.isNotDefined=function(a){return typeof a=="undefined"};dhx.delay=function(a,b,c,d){return window.setTimeout(function(){var d=a.apply(b,c||[]);a=b=c=null;return d},d||1)};dhx.uid=function(){if(!this.bc)this.bc=(new Date).valueOf();this.bc++;return this.bc};
dhx.toNode=function(a){return typeof a=="string"?document.getElementById(a):a};dhx.toArray=function(a){return dhx.extend(a||[],dhx.PowerArray,!0)};dhx.toFunctor=function(a){return typeof a=="string"?eval(a):a};dhx.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"};dhx.o={};dhx.event=function(a,b,c,d){var a=dhx.toNode(a),e=dhx.uid();d&&(c=dhx.bind(c,d));dhx.o[e]=[a,b,c];a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c);return e};
dhx.eventRemove=function(a){if(a){var b=dhx.o[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.o[a]}};
dhx.EventSystem={$init:function(){this.o={};this.ka={};this.Mb={}},blockEvent:function(){this.o.oc=!0},unblockEvent:function(){this.o.oc=!1},mapEvent:function(a){dhx.extend(this.Mb,a,!0)},on_setter:function(a){if(a)for(var b in a)typeof a[b]=="function"&&this.attachEvent(b,a[b])},callEvent:function(a,b){if(this.o.oc)return!0;var a=a.toLowerCase(),c=this.o[a.toLowerCase()],d=!0;if(c)for(var e=0;e<c.length;e++)if(c[e].apply(this,b||[])===!1)d=!1;this.Mb[a]&&!this.Mb[a].callEvent(a,b)&&(d=!1);return d},
attachEvent:function(a,b,c){var a=a.toLowerCase(),c=c||dhx.uid(),b=dhx.toFunctor(b),d=this.o[a]||dhx.toArray();d.push(b);this.o[a]=d;this.ka[c]={f:b,t:a};return c},detachEvent:function(a){if(this.ka[a]){var b=this.ka[a].t,c=this.ka[a].f,d=this.o[b];d.remove(c);delete this.ka[a]}},hasEvent:function(a){a=a.toLowerCase();return this.o[a]?!0:!1}};dhx.extend(dhx,dhx.EventSystem);
dhx.PowerArray={removeAt:function(a,b){a>=0&&this.splice(a,b||1)},remove:function(a){this.removeAt(this.find(a))},insertAt:function(a,b){if(!b&&b!==0)this.push(a);else{var c=this.splice(b,this.length-b);this[b]=a;this.push.apply(this,c)}},find:function(a){for(var b=0;b<this.length;b++)if(a==this[b])return b;return-1},each:function(a,b){for(var c=0;c<this.length;c++)a.call(b||this,this[c])},map:function(a,b){for(var c=0;c<this.length;c++)this[c]=a.call(b||this,this[c]);return this}};dhx.env={};
(function(){if(navigator.userAgent.indexOf("Mobile")!=-1)dhx.env.mobile=!0;if(dhx.env.mobile||navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("Android")!=-1)dhx.env.touch=!0;navigator.userAgent.indexOf("Opera")!=-1?dhx.env.isOpera=!0:(dhx.env.isIE=!!document.all,dhx.env.isFF=!document.all,dhx.env.isWebKit=navigator.userAgent.indexOf("KHTML")!=-1,dhx.env.isSafari=dhx.env.isWebKit&&navigator.userAgent.indexOf("Mac")!=-1);if(navigator.userAgent.toLowerCase().indexOf("android")!=
-1)dhx.env.isAndroid=!0;dhx.env.transform=!1;dhx.env.transition=!1;for(var a={names:["transform","transition"],transform:["transform","WebkitTransform","MozTransform","oTransform","msTransform"],transition:["transition","WebkitTransition","MozTransition","oTransition","msTransition"]},b=document.createElement("DIV"),c=0;c<a.names.length;c++)for(var d=a[a.names[c]],e=0;e<d.length;e++)if(typeof b.style[d[e]]!="undefined"){dhx.env[a.names[c]]=d[e];break}b.style[dhx.env.transform]="translate3d(0,0,0)";
dhx.env.translate=b.style[dhx.env.transform]?"translate3d":"translate";dhx.env.transformCSSPrefix=function(){var a;dhx.env.isOpera?a="-o-":(a="",dhx.env.isFF&&(a="-Moz-"),dhx.env.isWebKit&&(a="-webkit-"),dhx.env.isIE&&(a="-ms-"));return a}();dhx.env.transformPrefix=dhx.env.transformCSSPrefix.replace(/-/gi,"");dhx.env.transitionEnd=dhx.env.transformCSSPrefix=="-Moz-"?"transitionend":dhx.env.transformPrefix+"TransitionEnd"})();
dhx.env.svg=function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}();
dhx.html={create:function(a,b,c){var b=b||{},d=document.createElement(a),e;for(e in b)d.setAttribute(e,b[e]);if(b.style)d.style.cssText=b.style;if(b["class"])d.className=b["class"];if(c)d.innerHTML=c;return d},getValue:function(a){a=dhx.toNode(a);return!a?"":dhx.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?b.parentNode.insertBefore(a,
b):c.appendChild(a))},locate:function(a,b){if(a.tagName)var c=a;else a=a||event,c=a.target||a.srcElement;for(;c;){if(c.getAttribute){var d=c.getAttribute(b);if(d)return d}c=c.parentNode}return null},offset:function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-
h;return{y:Math.round(i),x:Math.round(j)}}else{for(j=i=0;a;)i+=parseInt(a.offsetTop,10),j+=parseInt(a.offsetLeft,10),a=a.offsetParent;return{y:i,x:j}}},pos:function(a){a=a||event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};var b=dhx.env.isIE&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:a.clientX+b.scrollLeft-b.clientLeft,y:a.clientY+b.scrollTop-b.clientTop}},preventEvent:function(a){a&&a.preventDefault&&a.preventDefault();return dhx.html.stopEvent(a)},stopEvent:function(a){(a||
event).cancelBubble=!0;return!1},addCss:function(a,b){a.className+=" "+b},removeCss:function(a,b){a.className=a.className.replace(RegExp(" "+b,"g"),"")}};dhx.ready=function(a){this.ze?a.call():this.ob.push(a)};dhx.ob=[];
(function(){var a=document.getElementsByTagName("SCRIPT");if(a.length)a=(a[a.length-1].getAttribute("src")||"").split("/"),a.splice(a.length-1,1),dhx.codebase=a.slice(0,a.length).join("/")+"/";dhx.event(window,"load",function(){dhx.callEvent("onReady",[]);dhx.delay(function(){dhx.ze=!0;for(var a=0;a<dhx.ob.length;a++)dhx.ob[a].call();dhx.ob=[]})})})();dhx.ui={};dhx.ui.zIndex=function(){return dhx.ui.hc++};dhx.ui.hc=1;
dhx.ready(function(){dhx.event(document.body,"click",function(a){dhx.callEvent("onClick",[a||event])})});
(function(){var a={};dhx.Template=function(b){if(typeof b=="function")return b;if(a[b])return a[b];b=(b||"").toString();if(b.indexOf("->")!=-1)switch(b=b.split("->"),b[0]){case "html":b=dhx.html.getValue(b[1]);break;case "http":b=(new dhx.ajax).sync().get(b[1],{uid:dhx.uid()}).responseText}b=(b||"").toString();b=b.replace(/(\r\n|\n)/g,"\\n");b=b.replace(/(\")/g,'\\"');b=b.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');b=b.replace(/\{common\.([^}\(]*)\}/g,"\"+(common.$1||'')+\"");
b=b.replace(/\{common\.([^\}\(]*)\(\)\}/g,'"+(common.$1?common.$1(obj,common):"")+"');b=b.replace(/\{obj\.([^}]*)\}/g,"\"+(obj.$1||'')+\"");b=b.replace(/#([$a-z0-9_\[\]]+)#/gi,"\"+(obj.$1||'')+\"");b=b.replace(/\{obj\}/g,'"+obj+"');b=b.replace(/\{-obj/g,"{obj");b=b.replace(/\{-common/g,"{common");b='return "'+b+'";';try{Function("obj","common",b)}catch(c){}return a[b]=Function("obj","common",b)};dhx.Template.empty=function(){return""};dhx.Template.bind=function(a){return dhx.bind(dhx.Template(a),
this)};dhx.Type=function(a,c){if(a.Ya){if(!a.Ga)a.Ga=[];a.Ga.push(c)}else{if(typeof a=="function")a=a.prototype;if(!a.types)a.types={"default":a.type},a.type.name="default";var d=c.name,e=a.type;d&&(e=a.types[d]=dhx.copy(a.type));for(var f in c)e[f]=f.indexOf("template")===0?dhx.Template(c[f]):c[f];return d}}})();
dhx.AtomRender={xa:function(a){return this.a.template(a,this)},render:function(){if(this.isVisible(this.a.id)){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data)this.d.innerHTML=this.xa(this.data);this.callEvent&&this.callEvent("onAfterRender",[])}return!0}return!1},template_setter:dhx.Template};
dhx.SingleRender=dhx.proto({xa:function(a){return this.type.templateStart(a,this.type)+this.type.template(a,this.type)+this.type.templateEnd(a,this.type)},customize:function(a){dhx.Type(this,a)}},dhx.AtomRender);
dhx.Destruction={$init:function(){dhx.destructors.push(this)},destructor:function(){this.destructor=function(){};if(this.c)for(var a=0;a<this.c.length;a++)this.c[a].destructor();delete dhx.ui.views[this.a.id];this.af=this.B=null;this.F&&document.body.appendChild(this.F);this.F=null;if(this.g)this.g.innerHTML="",this.g.B=null;this.g=this.d=null;this.a.container&&this.b.parentNode?this.b.parentNode.parentNode.removeChild(this.b.parentNode):this.b&&this.b.parentNode&&this.b.parentNode.removeChild(this.b);
this.data=null;this.o=this.ka={}}};dhx.destructors=[];dhx.event(window,"unload",function(){for(var a=0;a<dhx.destructors.length;a++)dhx.destructors[a].destructor();dhx.destructors=[];for(var b in dhx.o){var c=dhx.o[b];c[0].removeEventListener?c[0].removeEventListener(c[1],c[2],!1):c[0].detachEvent&&c[0].detachEvent("on"+c[1],c[2]);delete dhx.o[b]}});
dhx.Settings={$init:function(){this.a=this.config={}},define:function(a,b){return typeof a=="object"?this.Uc(a):this.xc(a,b)},xc:function(a,b){var c=this[a+"_setter"];return this.a[a]=c?c.call(this,b,a):b},Uc:function(a){if(a)for(var b in a)this.xc(b,a[b])},Rb:function(a,b){var c={};b&&(c=dhx.extend(c,b));typeof a=="object"&&!a.tagName&&dhx.extend(c,a,!0);this.Uc(c)},Ia:function(a,b){for(var c in b)switch(typeof a[c]){case "object":a[c]=this.Ia(a[c]||{},b[c]);break;case "undefined":a[c]=b[c]}return a}};
dhx.ajax=function(a,b,c){if(arguments.length!==0){var d=new dhx.ajax;if(c)d.master=c;d.get(a,null,b)}return!this.getXHR?new dhx.ajax:this};
dhx.ajax.prototype={getXHR:function(){return dhx.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===dhx.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.Te);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.Te=!0;return this}};
dhx.AtomDataLoader={$init:function(a){this.data={};if(a)this.a.datatype=a.datatype||"json",this.$ready.push(this.fe)},fe:function(){this.Xc=!0;this.a.url&&this.url_setter(this.a.url);this.a.data&&this.data_setter(this.a.data)},url_setter:function(a){if(!this.Xc)return a;this.load(a,this.a.datatype);return a},data_setter:function(a){if(!this.Xc)return a;this.parse(a,this.a.datatype);return!0},load:function(a,b,c){this.callEvent("onXLS",[]);typeof b=="string"?(this.data.driver=dhx.DataDriver[b],b=c):
this.data.driver=dhx.DataDriver.json;dhx.ajax(a,[this.mb,b],this)},parse:function(a,b){this.callEvent("onXLS",[]);this.data.driver=dhx.DataDriver[b||"json"];this.mb(a,null)},mb: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",[])},sc:function(a){if(!this.a.dataFeed||this.Gc||!a)return!0;var b=this.a.dataFeed,b=b+(b.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(a.id||a);this.callEvent("onXLS",[]);dhx.ajax(b,
function(a){this.Gc=!0;this.setValues(dhx.DataDriver.json.toObject(a)[0]);this.Gc=!1;this.callEvent("onXLE",[])},this);return!1}};dhx.DataDriver={};dhx.DataDriver.json={toObject:function(a){a||(a="[]");if(typeof a=="string")eval("dhx.temp="+a),a=dhx.temp;if(a.data){var b=a.data;b.pos=a.pos;b.total_count=a.total_count;a=b}return a},getRecords:function(a){return a&&!dhx.isArray(a)?[a]:a},getDetails:function(a){return a},getInfo:function(a){return{da:a.total_count||0,ia:a.pos||0}}};
dhx.DataDriver.json_ext={toObject:function(a){a||(a="[]");if(typeof a=="string"){var b;eval("temp="+a);dhx.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]);dhx.temp.push(e)}return dhx.temp}return a},getRecords:function(a){return a&&!dhx.isArray(a)?[a]:a},getDetails:function(a){return a},getInfo:function(a){return{da:a.total_count||0,ia:a.pos||0}}};
dhx.DataDriver.html={toObject:function(a){if(typeof a=="string"){var b=null;a.indexOf("<")==-1&&(b=dhx.toNode(a));if(!b)b=document.createElement("DIV"),b.innerHTML=a;return b.getElementsByTagName(this.tag)}return a},getRecords:function(a){return a.tagName?a.childNodes:a},getDetails:function(a){return dhx.DataDriver.xml.tagToObject(a)},getInfo:function(){return{da:0,ia:0}},tag:"LI"};
dhx.DataDriver.jsarray={toObject:function(a){return typeof a=="string"?(eval("dhx.temp="+a),dhx.temp):a},getRecords:function(a){return a},getDetails:function(a){for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{da:0,ia:0}}};
dhx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(a){for(var a=this.stringToArray(a),b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{da:0,ia:0}},stringToArray:function(a){for(var a=a.split(this.cell),b=0;b<a.length;b++)a[b]=a[b].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"");return a},row:"\n",cell:","};
dhx.DataDriver.xml={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{da:a.documentElement.getAttribute("total_count")||0,ia: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"?
(dhx.isArray(b[h])||(b[h]=[b[h]]),b[h].push(this.tagToObject(f[e],{}))):b[f[e].tagName]=this.tagToObject(f[e],{});c=!0}if(!c)return this.nodeValue(a);b.value=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}};
dhx.DataLoader=dhx.proto({$init:function(a){a=a||"";name="DataStore";this.data=a.datastore||new dhx.DataStore;this.Ub=this.data.attachEvent("onStoreLoad",dhx.bind(this.Ed,this))},load:function(a,b){dhx.AtomDataLoader.load.apply(this,arguments);if(!this.data.feed)this.data.url=a,this.data.feed=function(b,d){if(this.ib)return this.ib=[b,d];else this.ib=!0;this.load(a+(a.indexOf("?")==-1?"?":"&")+"start="+b+"&count="+d,function(){var a=this.ib;this.ib=!1;typeof a=="object"?this.data.feed.apply(this,
a):this.showItem&&this.dataCount()>b+1&&this.showItem(this.idByIndex(b+1))})}},loadNext:function(a,b){this.data.feed&&this.data.feed.call(this,b||this.dataCount(),a)},mb:function(a,b){this.data.ue(this.data.driver.toObject(a,b));this.callEvent("onXLE",[]);if(this.Ub)this.data.detachEvent(this.Ub),this.Ub=null},scheme_setter:function(a){this.data.scheme(a)},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhx.bind(function(a,c){if(this.a.dataFeed){var d={};if(a||d){if(typeof a=="function"){if(!c)return;
a(c,d)}else d={text:c};this.clearAll();var e=this.a.dataFeed,f=[],g;for(g in d)f.push("dhx_filter["+g+"]="+encodeURIComponent(d[g]));this.load(e+(e.indexOf("?")<0?"?":"&")+f.join("&"),this.a.datatype);return!1}}},this));return a},Ed:function(){if(this.a.ready){var a=dhx.toFunctor(this.a.ready);a&&a.call&&a.apply(this,arguments)}}},dhx.AtomDataLoader).prototype;dhx.DataStore=function(){this.name="DataStore";dhx.extend(this,dhx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhx.toArray()};
dhx.DataStore.prototype={setDriver:function(a){this.driver=dhx.DataDriver[a]},ue:function(a){this.callEvent("onParse",[this.driver,a]);this.p&&this.filter();var b=this.driver.getInfo(a),c=this.driver.getRecords(a),d=(b.ia||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.sb&&(this.tb?this.tb(g):this.ta&&this.ta(g))}if(!this.order[b.da-
1])this.order[b.da-1]=dhx.undefined;this.callEvent("onStoreLoad",[this.driver,a]);this.refresh()},id:function(a){return a.id||(a.id=dhx.uid())},changeId:function(a,b){this.pull[b]=this.pull[a];this.pull[b].id=b;this.order[this.order.find(a)]=b;this.p&&(this.p[this.p.find(a)]=b);this.callEvent("onIdChange",[a,b]);this.Zb&&this.Zb(a,b);delete this.pull[a]},item:function(a){return this.pull[a]},update:function(a,b){this.ta&&this.ta(b);if(this.callEvent("onBeforeUpdate",[a,b])===!1)return!1;this.pull[a]=
b;this.refresh(a)},refresh:function(a){this.hd||(a?this.callEvent("onStoreUpdated",[a,this.pull[a],"update"]):this.callEvent("onStoreUpdated",[null,null,null]))},silent:function(a,b){this.hd=!0;a.call(b||this);this.hd=!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=dhx.toArray(),d=a||0;d<=b;d++)c.push(this.item(this.order[d]));return c},dataCount:function(){return this.order.length},exists:function(a){return!!this.pull[a]},move:function(a,b){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.sb=a;this.tb=a.$init;this.ta=a.$update;this.ad=a.$serialize;delete a.$init;delete a.$update;delete a.$serialize},
sync:function(a,b,c){typeof b!="function"&&(c=b,b=null);if(dhx.debug_bind)this.debug_sync_master=a;if(a.name!="DataStore")a=a.data;var d=dhx.bind(function(){this.order=dhx.toArray([].concat(a.order));this.p=null;this.pull=a.pull;b&&this.silent(b);this.Tc&&this.Tc();c?c=!1:this.refresh()},this);a.attachEvent("onStoreUpdated",d);d()},add:function(a,b){if(this.sb){var a=a||{},c;for(c in this.sb)a[c]=a[c]||this.sb[c];this.tb?this.tb(a):this.ta&&this.ta(a)}var d=this.id(a),e=this.dataCount();if(dhx.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.p){var f=this.p.length;!b&&this.order.length&&(f=0);this.p.insertAt(d,f)}this.callEvent("onafterAdd",[d,b]);this.callEvent("onStoreUpdated",[d,a,"add"]);return d},remove:function(a){if(dhx.isArray(a))for(var b=0;b<a.length;b++)this.remove(a[b]);else{if(this.callEvent("onBeforeDelete",[a])===!1)return!1;if(!this.exists(a))return null;
var c=this.item(a);this.order.remove(a);this.p&&this.p.remove(a);delete this.pull[a];this.callEvent("onafterdelete",[a]);this.callEvent("onStoreUpdated",[a,c,"delete"])}},clearAll:function(){this.pull={};this.order=dhx.toArray();this.p=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=dhx.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,c){if(this.callEvent("onBeforeFilter",[a,
b])){if(this.p&&!c)this.order=this.p,delete this.p;if(this.order.length){if(a){var d=a,b=b||"";typeof a=="string"&&(a=dhx.Template(a),b=b.toString().toLowerCase(),d=function(b,c){return a(b).toLowerCase().indexOf(c)!=-1});for(var e=dhx.toArray(),f=0;f<this.order.length;f++){var g=this.order[f];d(this.item(g),b)&&e.push(g)}if(!c)this.p=this.order;this.order=e}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="sort,add,remove,exists,idByIndex,indexById,item,update,refresh,dataCount,filter,next,previous,clearAll,first,last,serialize,sync".split(","),d=0;d<c.length;d++)a[c[d]]=dhx.methodPush(this,c[d])},serialize:function(){for(var a=this.order,b=[],c=0;c<a.length;c++){var d=this.pull[a[c]];if(this.ad&&(d=this.ad(d),d===
!1))continue;b.push(d)}return b}};
dhx.sort={create:function(a){return dhx.sort.dir(a.dir,dhx.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=dhx.sort.as[b||"string"]);a=dhx.Template(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}}};
dhx.BaseBind={bind:function(a,b,c){typeof a=="string"&&(a=dhx.ui.get(a));a.Lb&&a.Lb();this.Lb&&this.Lb();a.getBindData||dhx.extend(a,dhx.BindSource);if(!this.zd){var d=this.render;if(this.filter){var e=this.a.id;this.data.Tc=function(){a.Va[e]=!1}}this.render=function(){if(!this.Hc)return this.Hc=!0,this.callEvent("onBindRequest"),this.Hc=!1,d.call(this)};if(this.getValue||this.getValues)this.save=function(){if(!this.validate||this.validate())a.setBindData(this.getValue?this.getValue:this.getValues(),
this.a.id)};this.zd=!0}a.addBind(this.a.id,b,c);this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){a.getBindData(this.a.id)});this.isVisible(this.a.id)&&this.refresh()}};
dhx.BindSource={$init:function(){this.Ua={};this.Va={};this.Kb={};this.Ad(this)},setBindData:function(a,b){b&&(this.Kb[b]=!0);if(this.setValue)this.setValue(a);else if(this.setValues)this.setValues(a);else{var c=this.getCursor();c&&(a=dhx.extend(this.item(c),a,!0),this.update(c,a))}this.callEvent("onBindUpdate",[a,b]);this.save&&this.save();b&&(this.Kb[b]=!1)},getBindData:function(a,b){if(!this.Va[a]){var c=dhx.ui.get(a);c.isVisible(c.a.id)&&(this.Va[a]=!0,this.Ab(c,this.Ua[a][0],this.Ua[a][1]),b&&
c.filter&&c.refresh())}},addBind:function(a,b,c){this.Ua[a]=[b,c]},Ad:function(a){a.filter?dhx.extend(this,dhx.CollectionBind):a.setValue?dhx.extend(this,dhx.ValueBind):dhx.extend(this,dhx.RecordBind)},vb:function(){for(var a in this.Ua)this.Kb[a]||(this.Va[a]=!1,this.getBindData(a,!0))},nc:function(a,b,c){a.setValue?a.setValue(c?c[b]:c):a.filter?a.data.silent(function(){this.filter(b,c)}):!c&&a.clear?a.clear():a.sc(c)&&a.setValues(dhx.copy(c))}};
dhx.DataValue=dhx.proto({name:"DataValue",isVisible:function(){return!0},$init:function(a){var b=(this.data=a)&&a.id?a.id:dhx.uid();this.a={id:b};dhx.ui.views[b]=this},setValue:function(a){this.data=a;this.callEvent("onChange",[a])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind);
dhx.DataRecord=dhx.proto({name:"DataRecord",isVisible:function(){return!0},$init:function(a){this.data=a||{};var b=a&&a.id?a.id:dhx.uid();this.a={id:b};dhx.ui.views[b]=this},getValues:function(){return this.data},setValues:function(a){this.data=a;this.callEvent("onChange",[a])},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind);
dhx.DataCollection=dhx.proto({name:"DataCollection",isVisible:function(){return!this.data.order.length&&!this.data.p&&!this.a.dataFeed?!1:!0},$init:function(a){this.data.provideApi(this,!0);var b=a&&a.id?a.id:dhx.uid();this.a.id=b;dhx.ui.views[b]=this;this.data.attachEvent("onStoreLoad",dhx.bind(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},dhx.EventSystem,dhx.DataLoader,dhx.BaseBind,dhx.Settings);
dhx.ValueBind={$init:function(){this.attachEvent("onChange",this.vb)},Ab:function(a,b,c){var d=this.getValue()||"";c&&(d=c(d));if(a.setValue)a.setValue(d);else if(a.filter)a.data.silent(function(){this.filter(b,d)});else{var e={};e[b]=d;a.sc(d)&&a.setValues(e)}}};dhx.RecordBind={$init:function(){this.attachEvent("onChange",this.vb)},Ab:function(a,b){var c=this.getValues()||null;this.nc(a,b,c)}};
dhx.CollectionBind={$init:function(){this.X=null;this.attachEvent("onSelectChange",function(){this.setCursor(this.getSelected())});this.attachEvent("onAfterCursorChange",this.vb);this.data.attachEvent("onStoreUpdated",dhx.bind(function(a){a&&a==this.getCursor()&&this.vb()},this));this.data.attachEvent("onClearAll",dhx.bind(function(){this.X=null},this));this.data.attachEvent("onIdChange",dhx.bind(function(a,b){if(this.X==a)this.X=b},this))},setCursor:function(a){if(!(a==this.X||a!==null&&!this.item(a)))this.callEvent("onBeforeCursorChange",
[this.X]),this.X=a,this.callEvent("onAfterCursorChange",[a])},getCursor:function(){return this.X},Ab:function(a,b){var c=this.item(this.getCursor())||null;this.nc(a,b,c)}};
dhx.DragControl={N:dhx.toArray(["dummy"]),addDrop:function(a,b,c){a=dhx.toNode(a);a.dhx_drop=this.zc(b);if(c)a.dhx_master=!0},zc:function(a){var a=a||dhx.DragControl,b=this.N.find(a);if(b<0)b=this.N.length,this.N.push(a);return b},addDrag:function(a,b){a=dhx.toNode(a);a.dhx_drag=this.zc(b);dhx.event(a,"mousedown",this.ve,a)},ve:function(a){dhx.DragControl.O&&(dhx.DragControl.Sb(),dhx.DragControl.destroyDrag());dhx.DragControl.O=this;dhx.DragControl.jd={x:a.pageX,y:a.pageY};dhx.DragControl.$c=a;dhx.DragControl.Ea=
dhx.event(document.body,"mousemove",dhx.DragControl.Pe);dhx.DragControl.Fa=dhx.event(document.body,"mouseup",dhx.DragControl.Sb);a.cancelBubble=!0;return!1},Sb:function(){dhx.DragControl.Ea=dhx.eventRemove(dhx.DragControl.Ea);dhx.DragControl.Fa=dhx.eventRemove(dhx.DragControl.Fa)},Pe:function(a){var b={x:a.pageX,y:a.pageY};if(!(Math.abs(b.x-dhx.DragControl.jd.x)<5&&Math.abs(b.y-dhx.DragControl.jd.y)<5)&&(dhx.DragControl.Sb(),dhx.DragControl.createDrag(dhx.DragControl.$c)))dhx.DragControl.sendSignal("start"),
dhx.DragControl.Ea=dhx.event(document.body,"mousemove",dhx.DragControl.Oc),dhx.DragControl.Fa=dhx.event(document.body,"mouseup",dhx.DragControl.Qe),dhx.DragControl.Oc(a)},Qe:function(a){dhx.DragControl.Ea=dhx.eventRemove(dhx.DragControl.Ea);dhx.DragControl.Fa=dhx.eventRemove(dhx.DragControl.Fa);dhx.DragControl.$c=null;dhx.DragControl.C&&(dhx.DragControl.onDrop(dhx.DragControl.O,dhx.DragControl.C,this.gb,a),dhx.DragControl.onDragOut(dhx.DragControl.O,dhx.DragControl.C,null,a));dhx.DragControl.destroyDrag();
dhx.DragControl.sendSignal("stop")},Oc:function(a){var b=dhx.html.pos(a);dhx.DragControl.F.style.top=b.y+dhx.DragControl.top+"px";dhx.DragControl.F.style.left=b.x+dhx.DragControl.left+"px";dhx.DragControl.gd?dhx.DragControl.gd=!1:dhx.DragControl.Fd(a.srcElement||a.target,a);a.cancelBubble=!0;return!1},Fd:function(a,b){for(;a&&a.tagName!="BODY";){if(a.dhx_drop){if(this.C&&(this.C!=a||a.dhx_master))this.onDragOut(this.O,this.C,a,b);if(!this.C||this.C!=a||a.dhx_master)if(this.C=null,this.gb=this.onDragIn(dhx.DragControl.O,
a,b))this.C=a;return}a=a.parentNode}if(this.C)this.C=this.gb=this.onDragOut(this.O,this.C,null,b)},sendSignal:function(a){dhx.DragControl.active=a=="start"},getMaster:function(a){return this.N[a.dhx_drag||a.dhx_drop]},getContext:function(){return this.Za},getNode:function(){return this.F},createDrag:function(a){var b=dhx.DragControl.O;dhx.DragControl.Za={};var c=this.N[b.dhx_drag],d;if(c.onDragCreate){d=c.onDragCreate(b,a);if(!d)return!1;d.style.position="absolute";d.style.zIndex=dhx.ui.zIndex()}else{var e=
dhx.DragControl.onDrag(b,a);if(!e)return!1;d=document.createElement("DIV");d.innerHTML=e;d.className="dhx_drag_zone";document.body.appendChild(d)}d.onmousemove=dhx.DragControl.Ne;if(!dhx.DragControl.Za.from)dhx.DragControl.Za={source:b,from:b};dhx.DragControl.F=d;return!0},Ne:function(){dhx.DragControl.gd=!0},destroyDrag:function(){var a=dhx.DragControl.O,b=this.N[a.dhx_drag];if(b&&b.onDragDestroy)b.onDragDestroy(a,dhx.DragControl.F);else dhx.html.remove(dhx.DragControl.F);dhx.DragControl.gb=dhx.DragControl.O=
dhx.DragControl.C=dhx.DragControl.F=null},top:5,left:5,onDragIn:function(a,b,c){var d=this.N[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.N[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.N[b.dhx_drop];dhx.DragControl.Za.from=dhx.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.N[a.dhx_drag];return c.onDrag&&c!=this?c.onDrag(a,b):"<div style='"+a.style.cssText+"'>"+a.innerHTML+"</div>"}};
dhx.DataMove={$init:function(){},copy:function(a,b,c,d){var e=this.item(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(dhx.isArray(a))for(var e=0;e<a.length;e++){var f=(c||this).indexById(this.move(a[e],b,c,d?d[e]:null));a[e+1]&&(b=f+(this.indexById(a[e+1])<f?0:1))}else{var g=a;if(!(b<0)){var h=this.item(a);if(h){if(!c||c==this)this.data.move(this.indexById(a),b);else{if(!d||c.item(d))d=dhx.uid();g=c.add(c.externalData(h,d),b);this.remove(a)}return g}}}},
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=dhx.extend({},a);c.id=b||dhx.uid();c.$selected=c.$template=null;return c}};
dhx.Movable={move_setter:function(a){if(a)this.kb=dhx.copy(this.kb),this.kb.master=this,dhx.DragControl.addDrag(this.eb,this.kb)},kb:{onDragCreate:function(a,b){var c=dhx.html.offset(a),d=dhx.html.pos(b);dhx.DragControl.top=c.y-d.y;dhx.DragControl.left=c.x-d.x;return dhx.toNode(this.master.b)},onDragDestroy:function(){dhx.DragControl.top=dhx.DragControl.left=5}}};
dhx.Scrollable={$init:function(a){if(a&&!a.scroll&&this.se)return this.d=this.d||this.g;(this.d||this.g).appendChild(dhx.html.create("DIV",{"class":"dhx_scroll_cont"},""));this.d=(this.d||this.g).firstChild},scrollSize:dhx.Touch?0:18,scroll_setter:function(a){if(!a)return!1;dhx.Touch?(a=a=="x"?"x":a=="xy"?"xy":"y",this.d.setAttribute("touch_scroll",a),this.attachEvent&&this.attachEvent("onAfterRender",dhx.bind(this.Ae,this)),this.a.touch_scroll=!0):this.d.parentNode.style.overflowY=a?"scroll":"";
return a},scrollState:function(){if(dhx.Touch){var a=dhx.Touch.Hb(this.d);return{x:-a.e,y:-a.f}}else return{x:this.d.parentNode.scrollLeft,y:this.d.parentNode.scrollTop}},scrollTo:function(a,b){dhx.Touch?(b=Math.max(0,Math.min(b,this.d.offsetHeight-this.m)),a=Math.max(0,Math.min(a,this.d.offsetWidth-this.j)),dhx.Touch.wa(this.d,-a,-b,this.a.scrollSpeed||"100ms")):(this.d.parentNode.scrollLeft=a,this.d.parentNode.scrollTop=b)},Ae:function(){if(this.a.scroll.indexOf("x")!=-1&&!this.Yd)this.d.style.width=
this.j+"px",this.d.style.width=this.d.scrollWidth+"px";dhx.Touch&&this.a.touch_scroll&&(dhx.Touch.Ca(),dhx.Touch.ua(),dhx.Touch.wa(this.d,0,0,0))}};
dhx.ActiveContent={$init:function(a){if(a.activeContent){this.$ready.push(this.be);this.Qa={};this.Ra={};this.za={};this.yb={};for(var b in a.activeContent)if(this[b]=this.yd(b),a.activeContent[b].earlyInit){var c=dhx.D;dhx.D=null;this[b].call(this,{},this,a.activeContent);dhx.D=c}}},be:function(){if(this.filter){for(var a in this.a.activeContent)this.type[a]=this[a],this[a]=this.ge(a);this.type.masterUI=this}},ge:function(a){return function(b){for(var c=this.yb[a],d=c.a.id,e=this.pa(b).getElementsByTagName("DIV"),
f=0;f<e.length;f++)if(e[f].getAttribute("view_id")==d){c.b=c.d=e[f];break}return c}},Vd:function(a,b,c){return function(d){if(d)for(var e=d.target||d.srcElement;e;){if(e.getAttribute&&e.getAttribute("view_id")){a.d=a.b=e;if(c.locate){var f=c.locate(e.parentNode),g=c.za[b][f];a.a.value=g}return e}e=e.parentNode}return a.b}},Ke:function(a,b){return function(c){var d=b.data;if(b.filter){var e=b.locate(this.b.parentNode),d=b.item(e);b.Ra[a][e]=this.b.outerHTML||(new XMLSerializer).serializeToString(this.b);
b.za[a][e]=c}d[a]=c}},yd:function(a){return function(b,c,d){var e=c.Qa?c:c.masterUI;if(!e.Qa[a]){var f=document.createElement("DIV"),d=d||e.a.activeContent,g=dhx.ui(d[a],f);g.getNode=e.Vd(g,a,e);g.attachEvent("onChange",e.Ke(a,e));e.yb[a]=g;e.Qa[a]=f.innerHTML;e.Ra[a]={};e.za[a]={}}e.filter&&b[a]!=e.za[a]&&!dhx.isNotDefined(b[a])&&(g=e.yb[a],g.blockEvent(),g.setValue(b[a]),g.unblockEvent(),e.za[a][b.id]=b[a],e.Ra[a][b.id]=g.b.outerHTML||(new XMLSerializer).serializeToString(g.b));return e.Ra[a][b.id]||
e.Qa[a]}}};dhx.IdSpace={$init:function(){var a=dhx.ja;this.elements={};dhx.ja=this;this.od={};this.getTopParent=dhx.bind(function(){return this},this);this.$ready.push(function(){dhx.ja=a;for(var b in this.elements)this.elements[b].mapEvent&&!this.elements[b].touchable&&this.elements[b].mapEvent({onbeforetabclick:this,onaftertabclick:this,onitemclick:this}),this.elements[b].getTopParent=this.getTopParent})},$$:function(a){return this.elements[a]},innerId:function(a){return this.od[a]}};
(function(){var a=[],b=dhx.ui=function(c,d,e){dhx.qd=!0;var f=c,f=dhx.toNode(c.container||d||document.body),g=c.a||f.c&&!e?c:b.Oa(c);f.appendChild?(f.appendChild(g.b),!g.setPosition&&f==document.body&&a.push(g),c.skipResize||g.resize()):f.ac&&(g.getParent&&g.getParent()&&g.getParent().Zc(g),f.ac(g,e));dhx.qd=!1;return g};dhx.ui.rd=function(a){return a+(this.Pc[a]=(this.Pc[a]||0)+1)};dhx.ui.Pc={};dhx.ui.resize=function(){if(!dhx.ui.yc)for(var b=0;b<a.length;b++)a[b].resize()};dhx.event(window,"resize",
dhx.ui.resize);b.Eb={};b.delay=function(a){dhx.ui.Eb[a.id]=a};dhx.ui.zIndex=function(){return dhx.ui.hc++};dhx.ui.hc=1;b.Oa=function(a){if(a.view){var d=a.view;delete a.view;return new b[d](a)}else return a.rows||a.cols?new b.layout(a):a.cells?new b.multiview(a):new b.template(a)};b.views={};b.get=function(a){if(!a)return null;if(b.views[a])return b.views[a];if(b.Eb[a])return dhx.ui(b.Eb[a]);var d=a;if(typeof a=="object"){if(a.a)return a;d=a.target||a.srcElement||a}return b.views[dhx.html.locate({target:dhx.toNode(d)},
"view_id")]};if(dhx.isNotDefined(window.$$))$$=b.get;dhx.protoUI({name:"baseview",$init:function(a){if(!a.id)a.id=dhx.ui.rd(this.name);this.D=dhx.D;dhx.D=null;this.$view=this.g=this.b=dhx.html.create("DIV",{"class":"dhx_view"})},defaults:{width:-1,height:-1,gravity:1},getNode:function(){return this.b},getParent:function(){return this.D||null},isVisible:function(a){if(this.a.hidden&&a){if(!this.la)this.la=[],this.Jb={};this.Jb[a]||(this.Jb[a]=!0,this.la.push(a));return!1}var b=this.getParent();return b?
b.isVisible(a,this.a.id):!0},container_setter:function(){return!0},css_setter:function(a){this.b.className+=" "+a;return a},id_setter:function(a){if(dhx.ja&&dhx.ja!=this){var b=a;dhx.ja.elements[a]=this;a=dhx.ui.rd(this.name);dhx.ja.od[a]=b}dhx.ui.views[a]=this;this.b.setAttribute("view_id",a);return a},$setSize:function(a,b){if(this.$&&this.$[0]==a&&this.$[1]==b)return!1;this.$=[a,b];this.j=a;this.j=a-(this.a.scroll?dhx.Scrollable.scrollSize:0);this.m=b;this.$width=this.j;this.$height=this.m;this.b.style.width=
a+"px";this.b.style.height=b+"px";return!0},$getSize:function(){var a=this.a.width,b=this.a.height,e,f;e=f=this.a.gravity;a==-1?a=0:(e=0,a+=this.a.scroll?dhx.Scrollable.scrollSize:0);b==-1?b=0:f=0;return[e,a,f,b]},show:function(a){if(this.getParent()){var b=this.getParent();!a&&this.a.animate&&b.a.animate&&(a=dhx.extend(b.a.animate?dhx.extend({},b.a.animate):{},this.a.animate,!0));var e=arguments.length<2;if(e?b.Ma:b.Ha)(e?b.Ma:b.Ha).call(b,this,a)}},hidden_setter:function(a){a&&this.hide();return this.a.hidden},
hide:function(){this.show(null,!0)},resize:function(){var a=this.b;if(!this.D)a=a.parentNode;if(!this.b.parentNode)return!1;var b=this.b.parentNode.offsetWidth,e=this.b.parentNode.offsetHeight,f=this.$getSize(),b=f[0]?Math.max(b,f[1]):Math.max(f[1],b),e=f[2]?Math.max(e,f[3]):Math.max(f[3],e);this.$setSize(b,e)}},dhx.Settings,dhx.Destruction,dhx.BaseBind);dhx.protoUI({name:"view",$init:function(){this.g.style.border="1px solid #AEAEAE"},$getSize:function(){var a=this.a.k,b=dhx.ui.baseview.prototype.$getSize.call(this);
if(!a)return b;var e=(a.left?0:1)+(a.right?0:1),f=(a.top?0:1)+(a.bottom?0:1);b[1]&&e&&(b[1]+=e);b[3]&&f&&(b[3]+=f);return b},$setSize:function(a,b){var e=this.a.k;e?(a-=(e.left?0:1)+(e.right?0:1),b-=(e.top?0:1)+(e.bottom?0:1)):this.g.style.border="0px solid #AEAEAE";return dhx.ui.baseview.prototype.$setSize.call(this,a,b)}},dhx.ui.baseview)})();dhx.ui.view.call(dhx);
dhx.protoUI({name:"baselayout",$init:function(){this.$ready.push(this.T);this.d=this.g},rows_setter:function(a){this.r=1;this.wc="";this.Q=a},cols_setter:function(a){this.r=0;this.wc="left";this.Q=a},Zc:function(a){dhx.PowerArray.removeAt.call(this.c,dhx.PowerArray.find.call(this.c,a));this.resizeChildren(!0)},ac:function(a,b){if(dhx.isNotDefined(b)){for(var c=0;c<this.c.length;c++)this.c[c].destructor();this.Q=a;this.T()}else{if(typeof b=="number"){if(b<0||b>this.c.length)b=this.c.length;var d=(this.c[b]||
{}).b;dhx.PowerArray.insertAt.call(this.c,a,b);dhx.html.insertBefore(a.b,d,this.d)}else{var e=dhx.ui.get(b),b=dhx.PowerArray.find.call(this.c,e);e.b.parentNode.insertBefore(a.b,e.b);e.destructor();this.c[b]=a}a.b.style.cssFloat=a.b.style.styleFloat=this.wc;this.c[b].D=this}this.resizeChildren()},reconstruct:function(){for(var a=0;a<this.c.length;a++)dhx.html.remove(this.c[a].b);this.T();this.$setSize(this.$[0],this.$[1])},Ha:function(a,b,c){if(!a.a.hidden)a.a.hidden=!0,dhx.html.remove(a.b),this.fb++,
!c&&!dhx.qd&&this.resizeChildren(!0)},resizeChildren:function(){if(this.hb){var a=this.$getSize(),b=this.hb[0],c=this.hb[1];this.va(b,c)}},index:function(a){if(a.a)a=a.a.id;for(var b=0;b<this.c.length;b++)if(this.c[b].a.id==a)return b;return-1},Ma:function(a,b,c){if(a.a.hidden)a.a.hidden=!1,dhx.html.insertBefore(a.b,(this.c[this.index(a)+1]||{}).b,this.d||this.b),this.fb--,c||this.resizeChildren(!0)},showBatch:function(a){if(this.a.visibleBatch!=a){this.a.visibleBatch=a;for(var b=[],c=0;c<this.c.length;c++)this.c[c].a.batch||
b.push(this.c[c]),this.c[c].a.batch==a?b.push(this.c[c]):this.Ha(this.c[c],null,!0);for(c=0;c<b.length;c++)this.Ma(b[c],null,!0);this.resizeChildren()}},T:function(a){a=this.Q||a;this.Q=null;this.c=[];this.b.style.verticalAlign="top";for(var b=0;b<a.length;b++){dhx.D=this;this.c[b]=dhx.ui.Oa(a[b],this);if(!this.r)this.c[b].b.style.cssFloat=this.c[b].b.style.styleFloat="left";if(this.a.visibleBatch&&this.a.visibleBatch!=this.c[b].a.batch&&this.c[b].a.batch)this.c[b].a.hidden=!0;this.c[b].a.hidden||
(this.d||this.g).appendChild(this.c[b].b)}},$getSize:function(){var a=0,b=0,c=0,d=0;this.U=[];for(var e=0;e<this.c.length;e++)if(!this.c[e].a.hidden){var f=this.U[e]=this.c[e].$getSize();this.r?(a=Math.max(a,f[1]),c=Math.max(c,f[0]),b+=f[3],d+=f[2]):(b=Math.max(b,f[3]),d=Math.max(d,f[2]),a+=f[1],c+=f[0])}this.jb=[c,a,d,b];if(this.a.height>-1)b=this.a.height,d=0;if(this.a.width>-1)a=this.a.width,c=0;this.r?(a&&(c=0),d&&(b=0)):(b&&(d=0),c&&(a=0));return[c,a,d,b]},$setSize:function(a,b){this.hb=[a,b];
dhx.ui.baseview.prototype.$setSize.call(this,a,b);this.va(a,b)},va:function(a,b){for(var c=a-this.jb[1],d=b-this.jb[3],e=this.jb[0],f=this.jb[2],g=this.c.length-1,h=0;h<this.c.length;h++)if(!this.c[h].a.hidden){if(this.r){var i=a,j;this.U[h][2]?(j=Math.round(this.U[h][2]*d/f),d-=j,f-=this.U[h][2]):(j=this.U[h][3],h==g&&d>0&&(j+=d))}else j=b,this.U[h][0]?(i=Math.round(this.U[h][0]*c/e),c-=i,e-=this.U[h][0]):(i=this.U[h][1],h==g&&c>0&&(i+=c));this.c[h].$setSize(i,j)}},ef:function(a,b){var c=this.index(a);
return c==-1?null:this.c[c+b]},first:function(){return this.c[0]}},dhx.ui.baseview);
dhx.protoUI({name:"layout",$init:function(){this.fb=0},T:function(){this.b.className+=" dhx_layout_"+(this.a.type||"");if(this.a.margin)this.S=this.a.margin;if(this.a.padding)this.u=this.a.padding;var a=this.Q;if(!this.a.k)this.a.k={top:!0,left:!0,right:!0,bottom:!0};this.mc(a);dhx.ui.baselayout.prototype.T.call(this,a);this.kc(a)},$getSize:function(){var a=dhx.ui.baselayout.prototype.$getSize.call(this),b=this.S*(this.c.length-this.fb-1);this.r?a[3]&&(a[3]+=b):a[1]&&(a[1]+=b);if(this.u&&(a[1]&&(a[1]+=
this.u*2),a[3]&&(a[3]+=this.u*2),this.S>-1)){var c=this.a.k;if(c){var d=(c.left?0:1)+(c.right?0:1),e=(c.top?0:1)+(c.bottom?0:1);a[1]&&d&&(a[1]+=d);a[3]&&e&&(a[3]+=e)}}return a},$setSize:function(a,b){this.hb=[a,b];this.u&&this.S>0?dhx.ui.view.prototype.$setSize.call(this,a,b):dhx.ui.baseview.prototype.$setSize.call(this,a,b);this.va(this.j,this.m)},va:function(a,b){var c=this.S*(this.c.length-this.fb-1);this.r?(b-=c+this.u*2,a-=this.u*2):(a-=c+this.u*2,b-=this.u*2);return dhx.ui.baselayout.prototype.va.call(this,
a,b)},resizeChildren:function(a){if(a&&this.type!="clean"){for(var b=[],c=0;c<this.c.length;c++){var d=this.c[c];b[c]=d.a;d.b.style.borderTopWidth=d.b.style.borderBottomWidth=d.b.style.borderLeftWidth=d.b.style.borderRightWidth="1px"}this.mc(b);this.kc(this.c)}dhx.ui.baselayout.prototype.resizeChildren.call(this)},mc:function(a){if(this.u&&this.S)for(var b=0;b<a.length;b++)a[b].k={top:!1,left:!1,right:!1,bottom:!1};else{for(b=0;b<a.length;b++)a[b].k=dhx.copy(this.a.k);var c=!1;this.a.type=="clean"&&
(c=!0);if(this.r){for(b=1;b<a.length-1;b++)a[b].k.top=a[b].k.bottom=c;if(a.length>1){if(this.a.type!="head")a[0].k.bottom=c;a[a.length-1].k.top=c}}else{for(b=1;b<a.length-1;b++)a[b].k.left=a[b].k.right=c;if(a.length>1){if(this.a.type!="head")a[0].k.right=c;a[a.length-1].k.left=c}}}},kc:function(a){for(var b=1,c=0;c<a.length;c++){var d=this.c[c];if(d.a.hidden&&this.c[c+1])this.c[c+1].a.k=d.a.k,c<b&&b++;var e=d.a.k;if(e.top)d.b.style.borderTopWidth="0px";if(e.left)d.b.style.borderLeftWidth="0px";if(e.right)d.b.style.borderRightWidth=
"0px";if(e.bottom)d.b.style.borderBottomWidth="0px"}if(this.u){for(var f=this.r?"marginLeft":"marginTop",g=this.r?"marginTop":"marginLeft",c=0;c<a.length;c++)this.c[c].b.style[f]=this.u+"px";this.c[0].b.style[g]=this.u+"px"}for(var f=this.r?"marginTop":"marginLeft",h=0;h<b;h++)this.c[h].b.style[f]="0px";for(;h<a.length;h++)this.c[h].b.style[f]=this.S+"px"},type_setter:function(a){this.S=this.je[a];if((this.u=this.te[a])&&this.S>0)this.g.style.border="1px solid #AEAEAE";return a},je:{space:10,wide:4,
clean:0,head:4,line:-1},te:{space:10,wide:0,clean:0,head:0,line:0},S:-1,u:0},dhx.ui.baselayout);dhx.ui.layout.call(dhx);
dhx.protoUI({name:"template",$init:function(){this.attachEvent("onXLE",this.render)},setValues:function(a){this.data=a;this.render()},defaults:{template:dhx.Template.empty,loading:!0},Wc:function(){this.Pb||this.render()},src_setter:function(a){this.Pb=!0;this.callEvent("onXLS",[]);dhx.ajax(a,dhx.bind(function(a){this.a.template=dhx.Template(a);this.Pb=!1;this.Wc();this.callEvent("onXLE",[])},this));return a},content_setter:function(a){if(a)this.Pb=!0,this.d.appendChild(dhx.toNode(a))},refresh:function(){this.render()},
waitMessage_setter:function(a){dhx.extend(this,dhx.ui.overlay);return a},$setSize:function(a,b){dhx.ui.view.prototype.$setSize.call(this,a,b)&&this.Wc()},se:!0},dhx.Scrollable,dhx.AtomDataLoader,dhx.AtomRender,dhx.EventSystem,dhx.ui.view);
dhx.protoUI({name:"iframe",defaults:{loading:!0},$init:function(){this.d=this.g;this.g.innerHTML="<iframe style='width:100%; height:100%' frameborder='0' src='about:blank'></iframe>"},load:function(a){this.src_setter(a)},src_setter:function(a){this.g.childNodes[0].src=a;this.callEvent("onXLS",[]);dhx.delay(this.Je,this);return a},Je:function(){try{dhx.event(this.getWindow(),"load",dhx.bind(function(){this.callEvent("onXLS",[])},this))}catch(a){this.callEvent("onXLE",[])}},getWindow:function(){return this.g.childNodes[0].contentWindow},
waitMessage_setter:function(a){dhx.extend(this,dhx.ui.overlay);return a}},dhx.ui.view,dhx.EventSystem);
dhx.ui.overlay={$init:function(){if(dhx.isNotDefined(this.ba)&&this.attachEvent)this.attachEvent("onXLS",this.showOverlay),this.attachEvent("onXLE",this.hideOverlay),this.ba=null},showOverlay:function(){if(!this.ba)this.ba=dhx.html.create("DIV",{"class":"dhx_loading_overlay"},""),dhx.html.insertBefore(this.ba,this.b.firstChild,this.b)},hideOverlay:function(){if(this.ba)dhx.html.remove(this.ba),this.ba=null}};
dhx.protoUI({name:"scrollview",defaults:{scroll:"x",scrollSpeed:"0ms"},$init:function(){this.b.className+=" dhx_scrollview"},content_setter:function(a){this.ha=dhx.ui.Oa(a);this.ha.D=this;this.d.appendChild(this.ha.b)},body_setter:function(a){return this.content_setter(a)},$getSize:function(){this.ga=this.ha.$getSize();if(this.a.scroll=="x"&&this.ga[3]>0)this.a.height=this.ga[3];else if(this.a.scroll=="y"&&this.ga[1]>0)this.a.width=this.ga[1];return dhx.ui.view.prototype.$getSize.call(this)},$setSize:function(a,
b){if(dhx.ui.view.prototype.$setSize.call(this,a,b))this.ha.$setSize(Math.max(this.ga[1],this.j),Math.max(this.ga[3],this.m)),this.d.style.width=this.ha.j+"px",this.d.style.height=this.ha.m+"px"}},dhx.Scrollable,dhx.ui.view);dhx.CanvasMgr=function(a){var b=dhx.CanvasMgr.prototype.qc;!b[a]&&document.getCSSCanvasContext&&(b[a]=!0,dhx.CanvasMgr.prototype[a](b))};
dhx.CanvasMgr.prototype={buttonGrd:["#fefefe","#e0e0e0","#e5e5e5","#e0e0e0",32],qc:[],Pa:function(a,b,c,d,e){var f=document.getCSSCanvasContext("2d",d,18,c),g=f.createLinearGradient(0,0,0,c);g.addColorStop(0,a);g.addColorStop(1,b);f.fillStyle=g;f.strokeStyle="#93B0BA";f.lineWidth=2;e?(f.moveTo(0,0.5),f.lineTo(17.5,c/2+0.5),f.lineTo(0,c-0.5),f.lineTo(0,0.5)):(f.moveTo(18,0.5),f.lineTo(0.5,c/2+0.5),f.lineTo(18,c-0.5),f.lineTo(18,0.5));f.stroke();f.fill()},dhxArrowLeftT:function(){this.Pa(this.buttonGrd[2],
this.buttonGrd[3],this.buttonGrd[4],"dhxArrowLeftT")},dhxArrowRightT:function(){this.Pa(this.buttonGrd[2],this.buttonGrd[3],this.buttonGrd[4],"dhxArrowRightT",!0)},dhxArrowLeft:function(){this.Pa(this.buttonGrd[0],this.buttonGrd[1],this.buttonGrd[4],"dhxArrowLeft");dhx.CanvasMgr("dhxArrowLeftT")},dhxArrowRight:function(){this.Pa(this.buttonGrd[0],this.buttonGrd[1],this.buttonGrd[4],"dhxArrowRight",!0);dhx.CanvasMgr("dhxArrowRightT")}};
dhx.attachEvent("onClick",function(a){var b=dhx.ui.get(a);if(b&&b.touchable){b.getNode(a);var c=a.target||a.srcElement,d="",e=null,f=!1;if(!(c.className&&c.className.indexOf("dhx_view")===0)){for(;c&&c.parentNode;){if(c.getAttribute){if(c.getAttribute("view_id"))break;if(d=c.className)if(d=d.split(" "),d=d[0]||d[1],b.on_click[d]){var g=b.on_click[d].call(b,a,b.a.id,c);if(g===!1)return}}c=c.parentNode}if(b.a.click){var h=dhx.toFunctor(b.a.click);h&&h.call&&h.call(b,b.a.id,a)}if(b.a.multiview){var i=
dhx.ui.get(b.a.multiview);i&&i.show&&i.show()}if(b.a.popup){var j=dhx.ui.get(b.a.popup);j.a.master=b.a.id;j.show(b.getInput()||b.getNode(),j.h.a.align||"bottom",!0)}b.callEvent("onItemClick",[b.a.id,a])}}});
dhx.protoUI({name:"button",touchable:!0,defaults:{template:"<div class='dhx_el_button'><input type='button' style='width:100%;' value='#label#'></div>",height:42,label:"label",s:10},$init:function(a){this.data=this.a;this.d=this.b;dhx.sa&&(dhx.sa.elements[a.name||a.id]=this,this.mapEvent({onbeforetabclick:dhx.sa,onaftertabclick:dhx.sa,onitemclick:dhx.sa}));a.type=="prev"&&dhx.CanvasMgr("dhxArrowLeft");a.type=="next"&&dhx.CanvasMgr("dhxArrowRight")},type_setter:function(a){this.a.template=dhx.Template(this.pd[a][0]);
var b=this.pd[a][1];if(b)this.a.s=b},pd:{round:["<div class='dhx_el_roundbutton'><input type='button' style='width:100%;' value='#label#'></div>"],"default":["<div class='dhx_el_defaultbutton'><input type='button' style='width:100%;' value='#label#'></div>"],form:[function(a){return"<div class='dhx_el_formbutton'><div style='width:100%;text-align:"+a.align+"'><input type='button' class='dhx_inp_form_button' style='text-align: "+a.inputAlign+"; width: "+(a.inputWidth?a.inputWidth+"px":"100%")+";' value='"+
(a.label||a.value)+"' /></div></div>"}],prev:["<div class='dhx_el_prevbutton'><div class='dhx_el_prevbutton_arrow'></div><div class='dhx_el_prevbutton_input_cont'><input type='button' value='#label#' /></div></div>",28],next:["<div class='dhx_el_nextbutton'><div class='dhx_el_nextbutton_input_cont'><input type='button' value='#label#' /></div><div class='dhx_el_nextbutton_arrow'></div></div>",28],big:["<div class='dhx_el_bigbutton'><input type='button' value='#label#'></div>",28],biground:["<div class='dhx_el_bigroundbutton'><input type='button' value='#label#'></div>",
28]},$setSize:function(a,b){dhx.ui.view.prototype.$setSize.call(this,a,b)&&this.render()},K:function(a){this.a.label=a;this.getInput().value=a},getValue:function(){return this.d.childNodes.length>0?this.ab():this.a.value},setValue:function(a){var b=this.a.value;this.a.value=a;if(this.d.childNodes.length>0)this.Md=a,this.K(a),this.callEvent("onChange",[a,b])},focus:function(){this.getInput().focus()},ab:function(){return this.a.label||""},getInput:function(){return this.d.getElementsByTagName("input")[0]},
J:function(){return this.getInput()},Z:function(){this.a.inputWidth?this.J().style.width=this.a.inputWidth-this.a.s+"px":this.J().style.width=this.j-this.a.s+"px"},render:function(){if(dhx.AtomRender.render.call(this)){this.Z();if(this.a.align)switch(this.a.align){case "right":this.d.firstChild.style.cssFloat=this.d.firstChild.style.styleFloat="right";break;case "center":this.d.firstChild.style.display="inline-block";this.d.firstChild.parentNode.style.textAlign="center";break;case "middle":this.d.firstChild.style.marginTop=
Math.round((this.m-40)/2)+"px";break;case "bottom":this.d.firstChild.style.marginTop=this.m-40+"px";break;case "left":this.d.firstChild.parentNode.style.textAlign="left"}this.Aa&&this.Aa(this.data);this.Md!=this.a.value&&this.setValue(this.a.value)}},refresh:function(){this.render()},on_click:{Ib:function(a,b){var c=dhx.html.locate(a,"button_id");if(c&&this.callEvent("onBeforeTabClick",[b,c])){this.a.selected=c;this.refresh();if(this.a.multiview){var d=dhx.ui.get(c);d&&d.show&&d.show()}this.callEvent("onAfterTabClick",
[b,c])}},dhx_el_segmented:function(a,b){this.on_click.Ib.call(this,a,b)},dhx_el_tabbar:function(a,b){this.on_click.Ib.call(this,a,b)},dhx_inp_counter_next:function(){this.next(this.a.step,this.a.min,this.a.max)},dhx_inp_counter_prev:function(){this.prev(this.a.step,this.a.min,this.a.max)},dhx_inp_toggle_left_off:function(){var a=this.a.options;this.setValue(a[0].value)},dhx_inp_toggle_right_off:function(){var a=this.a.options;this.setValue(a[1].value)},dhx_inp_combo:function(a,b,c){c.focus()},dhx_inp_checkbox_border:function(){this.toggle()},
dhx_inp_checkbox_label:function(){this.toggle()},dhx_inp_radio_border:function(a){var b=dhx.html.locate(a,"radio_id");this.setValue(b)},dhx_inp_radio_label:function(a,b,c){c=c.parentNode.getElementsByTagName("input")[0];return this.on_click.dhx_inp_radio_border.call(this,c,b,c)}},Ba:function(a){for(var b=0;b<a.length;b++)if(typeof a[b]=="string")a[b]={value:a[b],label:a[b]};else if(a[b].value){if(!a[b].label)a[b].label=a[b].value}else a[b].value=a[b].label}},dhx.ui.view,dhx.AtomRender,dhx.Settings,
dhx.EventSystem);dhx.protoUI({name:"imagebutton",defaults:{template:"<div class='dhx_el_imagebutton'><span><img src='#src#'/>&nbsp;#label#</span></div>",label:""},Z:function(){}},dhx.ui.button);dhx.protoUI({name:"label",defaults:{template:"<div class='dhx_el_label'>#label#</div>"},focus:function(){return!1},J:function(){return this.d.firstChild},K:function(a){this.a.label=a;this.d.firstChild.innerHTML=a}},dhx.ui.button);
dhx.protoUI({name:"icon",defaults:{template:"<div class='dhx_el_icon'><div class='dhx_el_icon_#icon#'></div></div>",width:42},Z:function(){}},dhx.ui.button);
dhx.protoUI({name:"segmented",defaults:{template:function(a,b){var c=a.options,d="",e;b.Ba(c);if(!a.selected)a.selected=c[0].value;for(var f=0;f<c.length;f++)e=c[f].width||a.inputWidth?"width: "+((c[f].width||Math.round(a.inputWidth/c.length))-b.a.s)+"px;":"",d+="<div style='"+e+"' class='"+(a.selected==c[f].value?"selected ":"")+"segment_"+(f==c.length-1?"N":f>0?1:0)+"' button_id='"+c[f].value+"'>"+c[f].label+"</div>";return"<div class='dhx_el_segmented'>"+d+"</div>"},s:28,nb:0},K:function(a){if(this.d&&
this.d.firstChild)for(var b=this.d.firstChild.childNodes,c=0;c<b.length;c++)if(dhx.html.locate(b[c],"button_id")==a)return this.on_click.Ib.call(this,b[c],this.a.options[c]),!0},getValue:function(){return this.a.selected},Z:function(){}},dhx.ui.button);
dhx.protoUI({name:"tabbar",defaults:{height:49,template:function(a,b){var c=a.options;b.Ba(c);for(var d="",e,f=0;f<c.length;f++){var g="",h=c[f].src;c[f].value==a.selected&&(g="selected",h=c[f].srcSelected||c[f].src);c[f].css&&(g+=" "+c[f].css);e=a.optionWidth||c[f].width||a.inputWidth?"width: "+(c[f].width||Math.ceil(a.inputWidth/c.length)-b.a.s)+"px;":"";d+="<div class='"+g+"' button_id='"+c[f].value+"' style='"+e+"'>";d+=h?"<img src='"+h+"'/><span>"+c[f].label+"</span>":"<div style='height:26px'></div><span>"+
c[f].label+"</span>";d+="</div>"}return"<div class='dhx_el_tabbar'>"+d+"</div>"},s:4}},dhx.ui.segmented);
dhx.protoUI({name:"text",wd:!0,$b:function(a,b,c){c.labelPosition=="left"?a+=b:a=b+a;return"<div class='dhx_el_"+this.name+"'>"+a+"</div>"},pb:function(a,b,c,d){var e=a.inputAlign||"left",f=a.labelAlign||"left",g=dhx.uid(),h="<div class='dhx_inp_text_border'>";h+="<div class='dhx_inp_text_label' style='width: "+this.a.labelWidth+"px; text-align: "+f+";'><label onclick='' for='"+g+"' class='dhx_inp_label_for_text'>"+(a.label||"")+"</label></div>";var i=this.a.inputWidth-this.a.labelWidth-18;i<0&&(i=
0);h+=d?"<div class='dhx_inp_"+b+"' onclick='' style='width: "+i+"px; text-align: "+e+";' >"+(a.text||a.value||"")+"</div>":"<input id='"+g+"' type='"+(a.type||this.name)+"' value='"+(a.text||a.value||"")+"' "+(c||a.readonly?"readonly='true' ":"")+(a.maxlength?"maxlength='"+a.maxlength+"' ":"")+(a.placeholder?"placeholder='"+a.placeholder+"' ":"")+" class='dhx_inp_"+b+"' style='width: "+i+"px; text-align: "+e+";' />";h+="</div>";return"<div class='dhx_el_"+this.name+"'>"+h+"</div>"},qb:function(a,
b){if(!a.label)return"";var c=a.labelAlign||"left";return"<div class='dhx_inp_"+b+"_label' style='width: "+a.labelWidth+"px; text-align: "+c+";'>"+a.label+"</div>"},defaults:{template:function(a,b){return b.pb(a,"text")},labelWidth:80,s:28,nb:0},type_setter:function(a){return a},Z:function(){this.a.inputWidth?this.J().style.width=this.a.inputWidth-this.a.labelWidth-this.a.s+"px":this.J().style.width=this.j-this.a.labelWidth-this.a.s-this.a.nb+"px"},focus:function(){var a=this.d.getElementsByTagName("input")[0];
a&&a.focus()},K:function(a){this.getInput().value=a},ab:function(){return this.getInput().value}},dhx.ui.button);
dhx.protoUI({name:"toggle",defaults:{template:function(a,b){var c=a.options;b.Ba(c);var d=b.a.inputWidth/2||"auto",e=[c[0].width||d,c[1].width||d],f=b.qb(a,"toggle"),g="<input type='button' style='width: "+e[0]+"px;' value='"+a.options[0].label+"' />";g+="<input type='button' style='width: "+e[1]+"px;' value='"+a.options[1].label+"'  />";return b.$b(f,g,a)},label:"",labelWidth:0,s:20},Z:function(){},Aa:function(a){this.setValue(a.value)},$a:function(){return this.d.getElementsByTagName("input")},
K:function(a){var b=this.$a(),c=this.a.options;a==c[1].value?(b[0].className="dhx_inp_toggle_left_off",b[1].className="dhx_inp_toggle_right_on"):(b[0].className="dhx_inp_toggle_left_on",b[1].className="dhx_inp_toggle_right_off")},ab:function(){var a=this.$a(),b=this.a.options;return a[0].className=="dhx_inp_toggle_left_on"?b[0].value:b[1].value}},dhx.ui.text);
dhx.protoUI({name:"input",defaults:{attributes:["maxlength","disabled","placeholder"],template:function(a,b){for(var c="<input",d=b.a.attributes,e=0;e<d.length;e++)a[d[e]]&&(c+=" "+d[e]+"='"+a[d[e]]+"'");c+=" type='"+(a.type||"text")+"'";c+="/>";return"<div class='dhx_el_input'>"+c+"</div>"},s:28,labelWidth:0}},dhx.ui.text);
dhx.protoUI({name:"select",defaults:{template:function(a,b){var c=a.options;b.Ba(c);var d="<select";a.disabled&&(d+=" disabled='true'");d+=">";for(var e=0;e<c.length;e++)d+="<option"+(c[e].selected?" selected='true'":"")+(c[e].value?" value='"+c[e].value+"'":"")+">"+c[e].label+"</option>";d+="</select>";return"<div class='dhx_el_select'>"+d+"</div>"},labelWidth:0,nb:0,s:10},getInput:function(){return this.d.firstChild.firstChild}},dhx.ui.text);
dhx.protoUI({name:"textarea",defaults:{template:function(a){return"<div class='dhx_el_textarea'><textarea class='dhx_inp_textarea' placeholder='"+(a.label||"")+"' style=''>"+(a.value||"")+"</textarea></div>"},cssContant:28},Z:function(){this.a.inputWidth?this.J().style.width=this.a.inputWidth-this.a.cssContant+"px":this.J().style.width=this.j-this.a.nb-this.a.cssContant+"px";this.a.inputHeight?this.J().style.height=this.a.inputHeight+"px":this.J().style.height=this.m-9+"px"},getInput:function(){return this.d.firstChild.firstChild},
K:function(a){this.getInput().value=a},ab:function(){return this.getInput().value}},dhx.ui.text);
dhx.protoUI({name:"counter",defaults:{template:function(a,b){var c=a.value||0,d=b.qb(a,"counter"),e="<input type='button' class='dhx_inp_counter_prev' value='\u25ac' />";e+="<div class='dhx_inp_counter_value' >"+c+"</div>";e+="<input type='button' class='dhx_inp_counter_next' value='+' />";return b.$b(d,e,a)},min:1,step:1,labelWidth:0,label:"",s:145},J:function(){return this.getInput().parentNode},getLabel:function(){return this.getInput().previousSibling||this.getInput().parentNode.lastChild},Z:function(){if(this.a.label&&
!this.a.labelWidth){var a=this.getLabel();if(a)a.style.width=(this.a.inputWidth||this.j)-this.a.s+"px"}},K:function(a){this.getInput().nextSibling.innerHTML=a},getValue:function(){return(this.a.value||0)*1},next:function(a,b,c){a=a||1;this.kd(a,b,c)},prev:function(a,b,c){a=-1*(a||1);this.kd(a,b,c)},kd:function(a,b,c){var b=typeof b=="undefined"?-Infinity:b,c=typeof c=="undefined"?Infinity:c,d=this.getValue()+a;d>=b&&d<=c&&this.setValue(d)}},dhx.ui.text);
dhx.protoUI({name:"checkbox",defaults:{template:function(a,b){var c=a.value?"dhx_inp_checkbox_on":"dhx_inp_checkbox_on hidden",d="<div class='dhx_inp_checkbox_border'><input type='button' class='"+c+"' value='' /></div>",e=b.qb(a,"checkbox");return b.$b(e,d,a)}},K:function(a){var b=this.getInput();b.className=a?"dhx_inp_checkbox_on":"dhx_inp_checkbox_on hidden"},toggle:function(){this.setValue(!this.getValue())},getLabel:function(){var a=this.getInput().parentNode;return a.nextSibling||a.previousSibling},
getValue:function(){return this.a.value?1:0},J:function(){return this.getInput().parentNode.parentNode}},dhx.ui.counter);
dhx.protoUI({name:"radio",defaults:{template:function(a,b){b.Ba(a.options);for(var c=[],d=0;d<a.options.length;d++){a.options[d].newline&&c.push("<div style='clear:both;'></div>");var e="<div radio_id='"+a.options[d].value+"' class='dhx_inp_radio_border'><input type='button' class='"+(a.options[d].value==a.value?"dhx_inp_radio_on":"dhx_inp_radio_on hidden")+"' value='' /></div>";a.label=a.options[d].label;var f=b.qb(a,"radio");a.labelPosition=="left"?c.push(f+e):c.push(e+f)}return"<div class='dhx_el_radio'><div>"+
c.join("</div><div>")+"</div></div>"}},$getSize:function(){var a=dhx.ui.button.prototype.$getSize.call(this);if(this.a.options){for(var b=1,c=0;c<this.a.options.length;c++)this.a.options[c].newline&&b++;a[3]=Math.max(a[3],this.defaults.height*b)}return a},$a:function(){return this.d.getElementsByTagName("input")},K:function(a){for(var b=this.$a(),c=0;c<b.length;c++)b[c].className=b[c].parentNode.getAttribute("radio_id")==a?"dhx_inp_radio_on":"dhx_inp_radio_on hidden"},getValue:function(){return this.a.value}},
dhx.ui.text);
dhx.protoUI({name:"richselect",defaults:{template:function(a,b){return b.pb(a,"list",!0,!0)}},Y:function(a){a.popup||this.Cb("list",a);this.dc();this.Y=function(){}},options_setter:function(a){for(var b=this.a.data=[],c=0;c<a.length;c++){var d=a[c].value||a[c].label||a[c],e=a[c].label||a[c].value||a[c];b.push({id:d,value:e})}return a},Aa:function(a){this.Y(a);if(!dhx.isNotDefined(a.value)){this.setValue(a.value,{},a);var b=dhx.ui.get(a.popup.toString()),c=b.h,d=this;c.attachEvent("onXLE",dhx.bind(function(){this.setValue(this.a.value,
{},a)},this))}},Cb:function(a,b){var c=dhx.extend({},b);delete c.align;delete c.height;delete c.width;delete c.template;c.view=a;c.id=(b.id||b.name)+"_"+a;c.width=c.popupWidth||290;var d=dhx.uid(),e={id:d,view:"popup",body:c};dhx.ui(e).hide();b.popup=d;this.dc()},dc:function(){var a=dhx.ui.get(this.a.popup);a.h.attachEvent("onItemClick",function(a){var c=dhx.ui.get(this.getParent().a.master);this.getParent().hide();c.setValue(a)})},getInput:function(){return this.d.firstChild.childNodes[0].childNodes[1]},
K:function(a){var b=dhx.ui.get(this.a.popup).h,c=b.type?b.type.template(b.item(a)||a,b.type):a;this.a.value=a;this.a.text=c;this.name=="combo"?this.getInput().value=c.replace(/<[^>]*>/g,""):this.getInput().innerHTML=c},getValue:function(){return this.a.value}},dhx.ui.text);
dhx.protoUI({name:"combo",defaults:{template:function(a,b){return b.pb(a,"combo")},filter:function(a,b){return a.value.toString().toLowerCase().indexOf(b.toLowerCase())===0?!0:!1}},Y:function(a){a.popup||this.Cb("list",a);this.dc();dhx.event(this.d,"keydown",function(b){var b=b||event,c=b.target||b.srcElement,d=dhx.ui.get(a.popup);window.clearTimeout(d.key_timer);var e=this;d.key_timer=window.setTimeout(function(){d.h.filter(function(a){return e.a.filter.apply(e,[a,c.value])});var a=dhx.ui.get(d.a.master);
a.a.value=d.h.dataCount()==1&&d.h.type.template(d.h.item(d.h.first()))==c.value?d.h.first():""},200);d.show(c,d.h.a.align||"bottom",!0)},this);this.Y=function(){}},Aa:function(a){this.Y(a);dhx.isNotDefined(a.value)||this.setValue(a.value)}},dhx.ui.richselect);
dhx.protoUI({name:"datepicker",defaults:{template:function(a,b){return b.pb(a,"list",!0,!0)}},Y:function(a){a.popup||this.Cb("calendar",a);var b=dhx.ui.get(a.popup);b.h.attachEvent("onDateSelect",function(a){var b=dhx.ui.get(this.getParent().a.master);this.getParent().hide();b.setValue(a)});this.Y=function(){}},Aa:function(a){this.Y(a);dhx.isNotDefined(a.value)||this.setValue(a.value)},K:function(a){var b=dhx.ui.get(this.a.popup.toString()),c=b.h;typeof a=="string"&&a&&(a=(this.a.dateFormat||dhx.i18n.dateFormatDate)(a));
c.selectDate(a,!0);this.a.value=a?c.config.date:"";this.getInput().innerHTML=a?(this.a.dateFormatStr||dhx.i18n.dateFormatStr)(this.a.value):""},dateFormat_setter:function(a){this.a.dateFormatStr=dhx.Date.dateToStr(a);return dhx.Date.strToDate(a)},getValue:function(){return this.a.value||null}},dhx.ui.richselect);
dhx.ValidateData={validate:function(a){var b=!0,c=this.a.rules;if(c){var d=c.$obj;!a&&this.getValues&&(a=this.getValues());if(d&&!d.call(this,a))return!1;var e=c.$all,f;for(f in c)f.indexOf("$")!==0&&(c[f].call(this,a[f],a,f)&&(!e||e.call(this,a[f],a,f))?this.callEvent("onValidationSuccess",[f,a])&&this.tc&&this.tc(f,a):(b=!1,this.callEvent("onValidationError",[f,a])&&this.Lc&&this.Lc(f,a)))}return b}};
dhx.rules={isNumber:function(a){return parseFloat(a)==a},isNotEmpty:function(a){return a=="0"||a}};
dhx.RenderStack={$init:function(){this.F=document.createElement("DIV");this.data.attachEvent("onIdChange",dhx.bind(this.Zb,this));this.attachEvent("onItemClick",this.Dd);if(!this.types)this.types={"default":this.type},this.type.name="default";this.type=dhx.copy(this.types[this.type.name])},customize:function(a){dhx.Type(this,a)},type_setter:function(a){this.types[a]?(this.type=dhx.copy(this.types[a]),this.type.css&&(this.g.className+=" "+this.type.css)):this.customize(a);return a},template_setter:function(a){this.type.template=
dhx.Template(a)},xa:function(a){this.callEvent("onItemRender",[a]);return this.type.templateStart(a,this.type)+(a.$template?this.type["template"+a.$template]:this.type.template)(a,this.type)+this.type.templateEnd(a,this.type)},ld:function(a){this.F.innerHTML=this.xa(a);return this.F.firstChild},Zb:function(a,b){var c=this.pa(a);c&&(c.setAttribute(this.ma,b),this.B[b]=this.B[a],delete this.B[a])},Dd:function(){if(this.a.click){var a=dhx.toFunctor(this.a.click);a&&a.call&&a.apply(this,arguments)}},
pa:function(a){if(this.B)return this.B[a];this.B={};for(var b=this.d.childNodes,c=0;c<b.length;c++){var d=b[c].getAttribute(this.ma);d&&(this.B[d]=b[c])}return this.pa(a)},locate:function(a){return dhx.html.locate(a,this.ma)},showItem:function(a){var b=this.pa(a);if(b&&this.scrollTo){var c=Math.max(0,b.offsetLeft-this.d.offsetLeft),d=Math.max(0,b.offsetTop-this.d.offsetTop);this.scrollTo(c,d);this.bd&&this.bd(a)}},render:function(a,b,c){if(this.isVisible(this.a.id))if(a){var d=this.pa(a);switch(c){case "update":if(!d)break;
var e=this.B[a]=this.ld(b);dhx.html.insertBefore(e,d);dhx.html.remove(d);break;case "delete":if(!d)break;dhx.html.remove(d);delete this.B[a];break;case "add":e=this.B[a]=this.ld(b);dhx.html.insertBefore(e,this.pa(this.data.next(a)),this.d);break;case "move":this.render(a,b,"delete"),this.render(a,b,"add")}}else if(this.callEvent("onBeforeRender",[this.data]))(this.De||this.d).innerHTML=this.data.getRange().map(this.xa,this).join(""),this.B=null,this.callEvent("onAfterRender",[])}};
dhx.protoUI({name:"proto",$init:function(){this.data.provideApi(this,!0);this.d=this.g;this.data.attachEvent("onStoreUpdated",dhx.bind(function(){this.render.apply(this,arguments)},this))},$setSize:function(){dhx.ui.view.prototype.$setSize.apply(this,arguments)&&this.render()}},dhx.RenderStack,dhx.DataLoader,dhx.ui.view,dhx.EventSystem,dhx.Settings);
dhx.Values={$init:function(){this.elements={}},focus:function(a){a?this.elements[a].focus():this.first().focus()},setValues:function(a){if(this.isVisible(this.a.id)){this.sd=dhx.copy(a);for(var b in this.elements)this.elements[b]&&!dhx.isNotDefined(a[b])&&this.elements[b].setValue(a[b]);this.callEvent("onChange",[])}else this.fc=a},getValues:function(){var a=this.sd?dhx.copy(this.sd):{},b;for(b in this.elements)a[b]=this.elements[b].getValue();return a},clear:function(){var a={},b;for(b in this.elements)this.elements[b].wd&&
(a[b]=this.elements[b].a.defaultValue||"");this.setValues(a)},mb:function(a,b){var c=this.data.driver,d=c.getRecords(c.toObject(a,b))[0];this.setValues(c?c.getDetails(d):a);this.callEvent("onXLE",[])},Lc:function(a){dhx.html.addCss(this.elements[a].d.firstChild,"invalid")},tc:function(a){dhx.html.removeCss(this.elements[a].d.firstChild,"invalid")}};
dhx.protoUI({name:"toolbar",defaults:{type:"MainBar"},Ce:!0,Db:44,$init:function(a){this.g.style.border="1px solid #AEAEAE";this.Vc(a)},Vc:function(a){this.g.className+=" dhx_toolbar";if(a.elements)this.Q=a.elements,this.r=!1;delete a.elements;dhx.sa=this},$getSize:function(){var a=dhx.ui.baselayout.prototype.$getSize.call(this);if(a[3]>0&&(!this.r||!this.a.scroll))this.a.height=a[3];if(a[1]>0&&(this.r||!this.a.scroll))this.a.width=a[1];a=dhx.ui.view.prototype.$getSize.call(this);if(a[3]<=0&&this.Db>
0)a[3]=this.Db,a[2]=0;return a},$setSize:function(a,b){dhx.ui.view.prototype.$setSize.apply(this,arguments);dhx.ui.baselayout.prototype.$setSize.call(this,this.j,this.m)},render:function(){if(this.isVisible(this.a.id)&&this.fc)this.setValues(this.fc),this.fc=null},refresh:function(){this.render()},type_setter:function(a){this.g.className+=" dhx_"+a.toLowerCase()}},dhx.Scrollable,dhx.AtomDataLoader,dhx.Values,dhx.ui.baselayout,dhx.EventSystem,dhx.ValidateData);
dhx.protoUI({name:"form",defaults:{scroll:!0},Db:-1,Vc:function(a){this.g.className+=" dhx_form";if(a.elements)this.Q=a.elements,this.r=!0;delete a.elements;dhx.sa=this},type_setter:function(){}},dhx.ui.toolbar);
dhx.MouseEvents={$init:function(){this.on_click&&dhx.event(this.g,"click",this.me,this);this.on_context&&dhx.event(this.g,"contextmenu",this.ne,this);this.on_dblclick&&dhx.event(this.g,"dblclick",this.oe,this);this.on_mouse_move&&(dhx.event(this.g,"mousemove",this.Rc,this),dhx.event(this.g,dhx.env.isIE?"mouseleave":"mouseout",this.Rc,this))},me:function(a){return this.Ja(a,this.on_click,"ItemClick")},oe:function(a){return this.Ja(a,this.on_dblclick,"ItemDblClick")},ne:function(a){if(this.Ja(a,this.on_context,
"BeforeContextMenu"))return this.Ja(a,{},"AfterContextMenu"),dhx.html.preventEvent(a)},Rc:function(a){dhx.env.isIE&&(a=document.createEventObject(event));this.Nc&&window.clearTimeout(this.Nc);this.callEvent("onMouseMoving",[a]);this.Nc=window.setTimeout(dhx.bind(function(){a.type=="mousemove"?this.pe(a):this.qe(a)},this),500)},pe:function(a){this.Ja(a,this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[a||event])},qe:function(a){this.callEvent("onMouseOut",[a||event])},Ja: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.ma))){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]){var h=b[e].call(this,a,f||dhx.html.locate(a,this.ma),d);if(typeof h!="undefined"&&h!==!0)return}d=d.parentNode}return g}};
dhx.SelectionModel={$init:function(){this.i=dhx.toArray();this.data.attachEvent("onStoreUpdated",dhx.bind(this.Pd,this));this.data.attachEvent("onStoreLoad",dhx.bind(this.Od,this));this.data.attachEvent("onAfterFilter",dhx.bind(this.Nd,this));this.data.attachEvent("onChangeId",dhx.bind(this.Zd,this))},Zd:function(a,b){for(var c=this.i.length-1;c>=0;c--)this.i[c]==a&&(this.i[c]=b)},Nd:function(){for(var a=this.i.length-1;a>=0;a--){if(this.data.indexById(this.i[a])<0)var b=this.i[a];var c=this.item(b);
c&&delete c.$selected;this.i.splice(a,1);this.callEvent("onSelectChange",[b])}},Pd:function(a,b,c){if(c=="delete")this.i.remove(a);else if(!this.data.dataCount()&&!this.data.p)this.i=dhx.toArray()},Od:function(){this.a.select&&this.data.each(function(a){a.$selected&&this.select(a.id)},this)},ub: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.i.push(a):this.i.remove(a),this.Vb(a));return!0},select:function(a,b,c){if(!a)return this.selectAll();
if(dhx.isArray(a))for(var d=0;d<a.length;d++)this.select(a[d],b,c);else if(this.data.exists(a)){if(c&&this.i.length)return this.selectAll(this.i[this.i.length-1],a);if(!b&&(this.i.length!=1||this.i[0]!=a))this.fd=!0,this.unselectAll(),this.fd=!1;this.isSelected(a)?b&&this.unselect(a):this.ub(a,!0)&&this.callEvent("onAfterSelect",[a])}},unselect:function(a){if(!a)return this.unselectAll();this.isSelected(a)&&this.ub(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.i.push(a.id),this.ub(a.id,!0,d));return a.id},this);this.Vb(d)},unselectAll:function(){var a=[];this.i.each(function(b){this.ub(b,!1,a)},this);this.i=dhx.toArray();this.Vb(a)},isSelected:function(a){return this.i.find(a)!=-1},getSelected:function(a){switch(this.i.length){case 0:return a?[]:"";case 1:return a?[this.i[0]]:this.i[0];default:return[].concat(this.i)}},ee:function(a){return a.length>100||a.length>this.data.dataCount/
2},Vb:function(a){typeof a!="object"&&(a=[a]);if(a.length){if(this.ee(a))this.data.refresh();else for(var b=0;b<a.length;b++)this.render(a[b],this.data.item(a[b]),"update");this.fd||this.callEvent("onSelectChange",[a])}}};
dhx.TreeStore={$init:function(){this.branch={0:[]}},clearAll:function(){this.branch={0:[]};dhx.DataStore.prototype.clearAll.call(this)},prevSibling:function(a){var b=this.branch[this.item(a).$parent],c=dhx.PowerArray.find.call(b,a)-1;return c>=0?b[c]:null},nextSibling:function(a){var b=this.branch[this.item(a).$parent],c=dhx.PowerArray.find.call(b,a)+1;return c<b.length?b[c]:null},parent:function(a){return this.item(a).$parent},firstChild:function(a){var b=this.branch[a];return b&&b.length?b[0]:null},
hasChild:function(a,b){var c=this.branch[a];if(c&&c.length)for(var d=0;d<c.length;d++){if(c[d]==b)return!0;if(this.hasChild(c[d],b))return!0}return!1},branchIndex:function(a,b){var c=this.branch[a];return dhx.PowerArray.find.call(c,b)},extraParser:function(a,b,c){a.$parent=b||0;a.$level=c||1;this.branch[a.$parent]||(this.branch[a.$parent]=[]);this.branch[a.$parent].push(a.id);if(!a.item)return a.$count=0;dhx.isArray(a.item)?a.$count=a.item.length:(a.item=[a.item],a.$count=1);for(var d=0;d<a.item.length;d++){var e=
a.item[d];this.pull[this.id(e)]=e;this.extraParser(e,a.id,a.$level+1)}delete a.item},provideApi:function(a,b){for(var c="prevSibling,nextSibling,parent,firstChild,hasChild,branchIndex".split(","),d=0;d<c.length;d++)a[c[d]]=dhx.methodPush(this,c[d]);dhx.DataStore.prototype.provideApi.call(this,a,b)},getTopRange:function(){return dhx.toArray([].concat(this.branch[0])).map(function(a){return this.item(a)},this)},eachChild:function(a,b){if(this.branch[a])return dhx.PowerArray.each.call(this.branch[a],
b)},add:function(a,b,c){this.branch[c||0]=this.order=dhx.toArray(this.branch[c||0]);(c=this.item(c||0))&&c.$count++;a.$count=0;a.$level=c?c.$level+1:1;a.$parent=c?c.id:0;return dhx.DataStore.prototype.add.call(this,a,b)},remove:function(a){var b=this.item(a),c=b.$parent||0;this.branch[c]=this.order=dhx.toArray(this.branch[c]);c&&this.item(c).$count--;return dhx.DataStore.prototype.remove.call(this,a)},serialize:function(a){for(var b=this.branch[a||0],c=[],d=0;d<b.length;d++){var e=this.pull[b[d]];
if(e.$count)e=dhx.copy(e),e.item=this.serialize(b[d]);c.push(e)}return c},groupBy:function(a,b,c,d,e){if(c===!0){var f={},g=dhx.copy(a),h=g.pop(),i={},j;for(j in b){var k=b[j],o=k[h];if(typeof i[o]==="undefined"){j=dhx.uid();var m={id:j,text:o,$count:0,$level:e,$parent:d};i[o]=j;f[j]=[];this.pull[j]=m;this.branch[d].push(j);this.branch[j]=[]}else j=i[o];f[j].push(k);g.length===0&&this.branch[j].push(k.id)}for(var l in f)this.pull[l].$count=f[l].length,g.length>0&&this.groupBy(g,f[l],!0,l,e+1)}else{var n=
arguments,g=[];this.branch={0:[]};for(l=n.length-1;l>=0;l--)g.push(n[l]);this.groupBy(g,this.pull,!0,"0",0);this.refresh()}}};dhx.animate=function(a,b){if(dhx.isArray(a))for(var c=0;c<a.length;c++){if(b.type=="slide"){if(b.subtype=="out"&&c===0)continue;if(b.subtype=="in"&&c==1)continue}if(b.type=="flip"){var d=dhx.copy(b);if(c===0)d.type="flipback";if(c==1)d.callback=null;dhx.animate(a[c],d)}else dhx.animate(a[c],b)}else{var e=dhx.toNode(a);e.cb?dhx.animate.end(e,b):dhx.animate.start(e,b)}};
dhx.animate.end=function(a,b){a.style[dhx.env.transformPrefix+"TransitionDuration"]="1ms";a.cb=null;dhx.td&&window.clearTimeout(dhx.td);dhx.td=dhx.delay(dhx.animate,dhx,[a,b],10)};dhx.animate.isSupported=function(){return dhx.env.transform&&dhx.env.transition};
dhx.animate.formLine=function(a,b,c){var d=c.direction;b.parentNode.style.position="relative";b.style.position="absolute";a.style.position="absolute";d=="top"||d=="bottom"?(a.style.left="0px",a.style.top=(d=="top"?1:-1)*b.offsetHeight+"px"):(a.style.top="0px",a.style.left=(d=="left"?1:-1)*b.offsetWidth+"px");b.parentNode.appendChild(a);if(c.type=="slide"&&c.subtype=="out")a.style.left=0,a.style.top=0,b.parentNode.removeChild(b),a.parentNode.appendChild(b);return[a,b]};
dhx.animate.breakLine=function(a){dhx.html.remove(a[1]);dhx.animate.clear(a[0]);dhx.animate.clear(a[1]);a[0].style.position=""};dhx.animate.clear=function(a){a.style[dhx.env.transformPrefix+"Transform"]="";a.style[dhx.env.transformPrefix+"Transition"]="";a.style.top=a.style.left=""};
dhx.animate.start=function(a,b){typeof b=="string"&&(b={type:b});var b=dhx.Settings.Ia(b,{type:"slide",delay:"0",duration:"500",timing:"ease-in-out",x:0,y:0}),c=dhx.env.transformPrefix,d=a.cb=b;switch(d.type=="slide"&&d.direction){case "right":d.x=a.offsetWidth;break;case "left":d.x=-a.offsetWidth;break;case "top":d.y=-a.offsetHeight;break;default:d.y=a.offsetHeight}if(d.type=="flip"||d.type=="flipback"){var e=[0,0],f="scaleX";d.subtype=="vertical"?(e[0]=20,f="scaleY"):e[1]=20;if(d.direction=="right"||
d.direction=="bottom")e[0]*=-1,e[1]*=-1}var g=d.duration+"ms "+d.timing+" "+d.delay+"ms",h=c+"TransformStyle: preserve-3d;",i="",j="";switch(d.type){case "fade":i="opacity "+g;h="opacity: 0;";break;case "show":i="opacity "+g;h="opacity: 1;";break;case "flip":g=d.duration/2+"ms "+d.timing+" "+d.delay+"ms";j="skew("+e[0]+"deg, "+e[1]+"deg) "+f+"(0.00001)";i="all "+g;break;case "flipback":d.delay+=d.duration/2;g=d.duration/2+"ms "+d.timing+" "+d.delay+"ms";a.style[c+"Transform"]="skew("+-1*e[0]+"deg, "+
-1*e[1]+"deg) "+f+"(0.00001)";a.style.left="0";j="skew(0deg, 0deg) "+f+"(1)";i="all "+g;break;case "slide":var k=d.x+"px",o=d.y+"px",j=dhx.env.translate+"("+k+", "+o+(dhx.env.translate=="translate3d"?", 0":"")+")",i=dhx.env.transformCSSPrefix+"transform "+g}dhx.delay(function(){a.style[c+"Transition"]=i;dhx.delay(function(){h&&(a.style.cssText+=h);j&&(a.style[c+"Transform"]=j);var b=!1,e=dhx.event(a,dhx.env.transitionEnd,function(c){a.cb=null;d.callback&&d.callback.call(d.master||window,a,d,c);b=
!0;dhx.eventRemove(e)});window.setTimeout(function(){if(!b)a.cb=null,d.callback&&d.callback.call(d.master||window,a,d),b=!0,dhx.eventRemove(e)},(d.duration*1+d.delay*1)*1.3)})})};
dhx.CarouselPanel={Wb:function(){var a,b,c,d;a=this.a.panel;dhx.html.remove(this.P);b="z-index:"+dhx.ui.zIndex()+";";if(a.align=="bottom"||a.align=="top")b+="height:"+a.size+"px; left:0px;",c=0,a.align=="bottom"&&(c=this.m-this.a.panel.size),b+="top:"+c+"px";else if(a.align=="right"||a.align=="left")b+="width:"+a.size+"px;top:0px;",d=0,a.align=="right"&&(d=this.j-this.a.panel.size),b+="left:"+d+"px";this.P=dhx.html.create("DIV",{"class":"dhx_carousel_panel",style:b},"");this.b.appendChild(this.P);
this.Xb()},Xb:function(){var a,b;b=this.a.panel;this.P?this.Hd():this.Wb();var c=this.c?this.c.length:this.data.order.length;if(c>1){for(var d=0;d<c;d++)a=dhx.html.create("DIV",{"class":"dhx_item dhx_carousel_"+(d==this.l?"active":"inactive"),style:b.align=="left"||b.align=="right"?"float:none;":""},""),this.P.appendChild(a);var e=c*this.a.panel.itemSize;b.align=="bottom"||b.align=="top"?(this.P.style.left=(this.j-e)/2+this.b.scrollLeft+"px",this.P.style.width=e+"px"):this.P.style.top=(this.m-e)/
2+this.b.scrollTop+"px"}},Hd:function(){if(this.P)for(var a=this.P.childNodes,b=a.length-1;b>=0;b--)dhx.html.remove(a[b])}};
dhx.protoUI({name:"list",$init:function(){this.data.provideApi(this,!0)},defaults:{select:!1,scroll:!0},ma:"dhx_l_id",on_click:{dhx_list_item:function(a,b){if(this.a.select)this.ra=!0,this.a.select=="multiselect"?this.select(b,a.ctrlKey,a.shiftKey):this.select(b),this.ra=!1}},$getSize:function(){if(this.type.width!="auto")this.a.width=this.type.width+(this.type.padding+this.type.margin)*2;if(this.a.yCount)this.a.height=(this.type.height+(this.type.padding+this.type.margin)*2+1)*(this.a.yCount=="auto"?
this.dataCount():this.a.yCount);return dhx.ui.view.prototype.$getSize.call(this)},$setSize:function(){dhx.ui.view.prototype.$setSize.apply(this,arguments)},type:{css:"",widthSize:function(a,b){return b.width+(b.width>-1?"px":"")},heightSize:function(a,b){return b.height+(b.height>-1?"px":"")},template:dhx.Template("#value#"),width:"auto",height:22,margin:0,padding:10,border:1,templateStart:dhx.Template("<div dhx_l_id='#id#' class='dhx_list_item dhx_list_{common.css}_item{obj.$selected?_selected:}' style='width:{common.widthSize()}; height:{common.heightSize()}; padding:{common.padding}px; margin:{common.margin}px; overflow:hidden;'>"),
templateEnd:dhx.Template("</div>")}},dhx.MouseEvents,dhx.SelectionModel,dhx.Scrollable,dhx.ui.proto);
dhx.protoUI({name:"grouplist",defaults:{animate:{}},$init:function(){dhx.extend(this.data,dhx.TreeStore,!0);this.data.provideApi(this,!0);this.data.attachEvent("onClearAll",dhx.bind(this.Qc,this));this.b.className+=" dhx_grouplist";this.Qc()},Qc:function(){this.aa=[];this.z=[]},on_click:{dhx_list_item:function(a,b){if(this.oa)return!1;for(var c=0;c<this.z.length;c++)if(this.z[c]==b){for(var d=c;d<this.z.length;d++)this.data.item(this.z[d]).$template="";c?(this.aa=this.data.branch[this.z[c-1]],this.z.splice(c)):
(this.aa=this.data.branch[0],this.z=[]);this.Ic=!1;return this.render()}var e=this.item(b);if(e.$count)return this.Ic=!0,this.z.push(b),e.$template="Back",this.aa=this.data.branch[e.id],this.render();else if(this.a.select)this.ra=!0,this.a.select=="multiselect"?this.select(b,a.ctrlKey,a.shiftKey):this.select(b),this.ra=!1}},render:function(a,b,c,d){if(this.oa)return dhx.delay(this.render,this,arguments,100);for(var e=0;e<this.aa.length;e++)this.data.item(this.aa[e]).$template="";this.data.order=this.z.length?
dhx.toArray([].concat(this.z).concat(this.aa)):dhx.toArray([].concat(this.data.branch[0]));if(this.callEvent("onBeforeRender",[this.data])){if(this.ra||!this.d.innerHTML||!dhx.animate.isSupported()||!this.a.animate||this.xe==this.z.length)dhx.RenderStack.render.apply(this,arguments);else{var f=this.d.cloneNode(!1);f.innerHTML=this.data.getRange().map(this.xa,this).join("");var g=dhx.extend({},this.a.animate);g.direction=this.Ic?"left":"right";var h=dhx.animate.formLine(f,this.d,g);g.master=this;g.callback=
function(){this.d=f;dhx.animate.breakLine(h);this.B=g.master=g.callback=null;this.oa=!1;this.callEvent("onAfterRender",[])};this.oa=!0;dhx.animate(h,g)}this.xe=this.z.length}},templateBack_setter:function(a){this.type.templateBack=dhx.Template(a)},templateItem_setter:function(a){this.type.templateItem=dhx.Template(a)},templateGroup_setter:function(a){this.type.templateGroup=dhx.Template(a)},type:{template:function(a,b){return a.$count?b.templateGroup(a,b):b.templateItem(a,b)},css:"group",templateStart:dhx.Template("<div dhx_l_id='#id#' class='dhx_list_item dhx_list{obj.$count?_group:_item}{obj.$template?_back:}{obj.$selected?_selected:}' style='width:{common.width}px; height:{common.height}px; padding:{common.padding}px; margin:{common.margin}px; overflow:hidden;'>"),
templateBack:dhx.Template("&lt; #value#"),templateItem:dhx.Template("#value#"),templateGroup:dhx.Template("#value#"),templateEnd:function(a){var b="";a.$count&&(b+="<div class='dhx_arrow_icon'></div>");b+="</div>";return b}},showItem:function(a){var b,c;if(a&&(b=this.item(a),c=b.$parent,b.$count))c=b.id;this.aa=this.data.branch[c||0];for(this.z=[];c;)this.item(c).$template="Back",this.z.unshift(c),c=this.item(c).$parent;this.ra=!0;this.render();this.ra=!1;dhx.RenderStack.showItem.call(this,a)}},dhx.ui.list);
dhx.Type(dhx.ui.grouplist,{});
dhx.protoUI({name:"pagelist",defaults:{scroll:"x",panel:!1,scrollOffset:0},Yd:!0,$init:function(a){this.b.className+=" dhx_pagelist";a.scroll=a.scroll=="y"?"y":"x";this.type.layout=a.scroll;this.attachEvent("onAfterRender",this.Ie);this.$ready.push(this.zb);this.l=0},zb:function(){if(this.a.scroll=="x")this.d.style.height="100%";this.type.layout=this.a.scroll;this.attachEvent("onAfterScroll",this.Ld)},Ie:function(){if(this.a.scroll=="x")this.d.style.width=(this.type.width+(this.type.padding+this.type.margin)*
2+this.type.border)*this.dataCount()+"px";this.a.panel&&this.Wb()},panel_setter:function(a){a&&(this.b.className+=" hidden_scroll",a===!0&&(a={}),this.Ia(a,{size:16,itemSize:16,align:"bottom"}));return a},bd:function(a){var b=this.indexById(a);if(typeof b!="undefined"&&this.a.panel)this.l=b,this.Xb()},getActive:function(){return this.l?this.data.order[this.l]:this.first()},Ld:function(a){var b=(this.a.scroll=="y"?this.type.height:this.type.width)+(this.type.padding+this.type.margin)*2+this.type.border,
c=this.a.scroll=="y"?this.d.scrollHeight-this.m:this.d.scrollWidth-this.j,d;this.a.scroll=="y"?(d=Math.round(a.f/b),a.f=d*b,a.f=this.uc(a.f,c)):(d=Math.round(a.e/b),a.e=d*b,a.e=this.uc(a.e,c));this.l=-d;this.a.panel&&this.Xb();return!0},uc:function(a,b){var c=this.a.scrollOffset;if(c&&Math.abs(a)>c){var d=dhx.Touch.A[dhx.Touch.H]>dhx.Touch.w[dhx.Touch.H];a+=d?c:1-c}Math.abs(a)>b&&(a=-b);return a},$getSize:function(){if(this.a.scroll=="y"){if(this.type.width!="auto")this.a.width=this.type.width+(this.type.padding+
this.type.margin)*2+this.type.border;if(this.a.yCount)this.a.height=(this.type.height+(this.type.padding+this.type.margin)*2+this.type.border)*(this.a.yCount=="auto"?this.dataCount():this.a.yCount)}else if(this.type.height!="auto")this.a.height=this.type.height+(this.type.padding+this.type.margin)*2+this.type.border;return dhx.ui.view.prototype.$getSize.call(this)},$setSize:function(a,b){if(dhx.ui.view.prototype.$setSize.apply(this,arguments)){if(this.type.fullScreen)this.type.width=this.j,this.type.height=
this.m,this.type.padding=0,this.render();this.a.panel&&this.Wb()}},type:{templateStart:function(a,b){var c="dhx_list_item dhx_list_"+b.css+"_item"+(a.$selected?"_selected":""),d="width:"+b.width+"px; height:"+b.height+"px; padding:"+b.padding+"px; margin:"+b.margin+"px; overflow:hidden;"+(b.layout&&b.layout=="x"?"float:left;":"");return"<div dhx_l_id='"+a.id+"' class='"+c+"' style='"+d+"'>"}}},dhx.ui.list,dhx.CarouselPanel);
dhx.protoUI({name:"multiview",defaults:{animate:{}},$init:function(){this.l=0;this.r=1;this.b.style.position="relative";this.b.className+=" dhx_multiview";this.M=[]},xd:function(a,b){var c=dhx.ui.get(a);if(!c.La)c.rb=[],c.La={};c.La[b]||(c.La[b]=!0,c.rb.push(b))},Yb:function(a){var b=dhx.ui.get(a);this.M[this.M.length-2]!=a?(this.M.length==10&&this.M.splice(0,1),this.M.push(a)):this.M.splice(this.M.length-1,1);if(b.La){for(var c=0;c<b.rb.length;c++)dhx.ui.get(b.rb[c]).render();b.rb=[];b.La={}}},T:function(a){for(var a=
a||this.Q,b=0;b<a.length;b++)a[b].k=this.a.k||{top:1,bottom:1,left:1,right:1};dhx.ui.baselayout.prototype.T.call(this,a);for(b=1;b<this.c.length;b++)dhx.html.remove(this.c[b].b);for(b=0;b<a.length;b++){var c=this.c[b];if(!c.c||c.Ce){var d=c.a.k;if(d.top)c.b.style.borderTopWidth="0px";if(d.left)c.b.style.borderLeftWidth="0px";if(d.right)c.b.style.borderRightWidth="0px";if(d.bottom)c.b.style.borderBottomWidth="0px"}}this.Yb(this.getActive())},cells_setter:function(a){this.Q=a},Ud:function(a,b){return a<
b?"right":"left"},Ma:function(a,b){if(this.oa)return dhx.delay(this.Ma,this,[a],100);for(var c=-1,d=0;d<this.c.length;d++)if(this.c[d]==a){c=d;break}if(!(c<0||c==this.l)){var e=this.c[this.l]?this.c[this.l].config.id:null,f=this.c[c]?this.c[c].config.id:null;if((b||typeof b=="undefined")&&dhx.animate.isSupported()&&this.a.animate){var g=dhx.extend({},this.a.animate);g.direction=this.Ud(c,this.l);var g=dhx.Settings.Ia(b||{},g),h=dhx.animate.formLine(this.c[c].b,this.c[this.l].b,g);this.c[c].$getSize();
this.c[c].$setSize(this.j,this.m);g.callback=function(){dhx.animate.breakLine(h);this.oa=!1;g.master=g.callback=null};g.master=this;this.l=c;this.Yb(this.getActive());dhx.animate(h,g);this.oa=!0}else dhx.html.remove(this.c[this.l].b),this.l=c,this.c[this.l].$getSize(),this.c[this.l].$setSize(this.j,this.m),this.Yb(this.getActive()),this.b.appendChild(this.c[d].b);this.callEvent("onViewChange",[e,f])}},$getSize:function(){var a=this.c[this.l].$getSize();if(this.a.height>-1)a[3]=this.a.height,a[2]=
0;if(this.a.width>-1)a[1]=this.a.width,a[0]=0;a[0]&&(a[1]=0);a[2]&&(a[3]=0);return a},$setSize:function(a,b){dhx.ui.baseview.prototype.$setSize.call(this,a,b);this.c[this.l].$setSize(a,b)},isVisible:function(a,b){return b&&b!=this.getActive()?(a&&this.xd(b,a),!1):dhx.ui.view.prototype.isVisible.call(this,a,this.a.id)},getActive:function(){return this.c.length?this.c[this.l].a.id:null},back:function(a){a=a||1;if(this.callEvent("onBeforeBack",[this.getActive(),a])&&this.M.length>a){var b=this.M[this.M.length-
a-1];dhx.ui.get(b).show();return b}return null}},dhx.ui.baselayout,dhx.EventSystem);dhx.html.addMeta=function(a,b){document.getElementsByTagName("head").item(0).appendChild(dhx.html.create("meta",{name:a,content:b}))};
(function(){var a=function(){var a=!!(window.orientation%180);if(dhx.ui.orientation!==a)dhx.ui.orientation=a,dhx.callEvent("onRotate",[a])};dhx.ui.orientation=!!((dhx.isNotDefined(window.orientation)?90:window.orientation)%180);dhx.event(window,"onorientationchange"in window?"orientationchange":"resize",a);dhx.ui.fullScreen=function(){dhx.html.addMeta("apple-mobile-web-app-capable","yes");dhx.html.addMeta("viewport","initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no");if(dhx.env.touch){var b=
document.body.offsetHeight,c=navigator.userAgent.indexOf("iPhone")!=-1,d=c&&(b==356||b==208||b==306||b==158),e=function(){if(c)dhx.ui.orientation?(b=480,e=d?268:300):(b=320,e=d?416:460);else{document.body.style.width=document.body.style.height="1px";document.body.style.overflow="hidden";var a=window.outerWidth/window.innerWidth,b=window.outerWidth/a,e=window.outerHeight/a}document.body.style.height=e+"px";document.body.style.width=b+"px";dhx.ui.yc=!1;dhx.ui.resize();dhx.delay(function(){window.scrollTo(0,
1)})},f=function(){dhx.ui.yc=!0;dhx.env.isSafari?e():dhx.delay(e,null,[],500)};dhx.attachEvent("onClick",function(a){a.target.tagName=="INPUT"||a.target.tagName=="TEXTAREA"||a.target.tagName=="SELECT"||(d&&window.innerHeight<416||!d&&window.innerHeight<window.outerHeight)&&window.scrollTo(0,1)});dhx.attachEvent("onRotate",f);a();dhx.delay(f)}}})();dhx.math={};dhx.math.Ve="0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F".split(",");
dhx.math.toHex=function(a,b){for(var a=parseInt(a,10),c="";a>0;)c=this.Ve[a%16]+c,a=Math.floor(a/16);for(;c.length<b;)c="0"+c;return c};dhx.math.toFixed=function(a){return a<10?"0"+a:a};
dhx.i18n={dateFormat:"%d.%m.%Y",timeFormat:"%H:%i",longDateFormat:"%l, %d %F %Y",fullDateFormat:"%d-%m-%Y %H:%i",groupDelimiter:".",groupSize:3,decimalDelimeter:",",decimalSize:2,setLocale:function(){for(var a=["fullDateFormat","timeFormat","dateFormat","longDateFormat"],b=0;b<a.length;b++){var c=a[b];dhx.i18n[c+"Str"]=dhx.Date.dateToStr(dhx.i18n[c]);dhx.i18n[c+"Date"]=dhx.Date.strToDate(dhx.i18n[c])}}};
dhx.Number={format:function(a,b){var b=b||dhx.i18n,a=parseFloat(a),c=a.toFixed(b.decimalSize).toString(),c=c.split("."),d="",e=b.groupSize,f=c[0].length;do{f-=e;var g=f>0?c[0].substr(f,e):c[0].substr(0,e+f),d=g+(d?b.groupDelimiter+d:"")}while(f>0);return d+b.decimalDelimeter+c[1]},numToStr:function(a){return function(b){return dhx.Number.format(b,a)}}};
dhx.Date={Locale:{month_full:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),month_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),day_full:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},weekStart:function(a){var b=a.getDay();this.config.start_on_monday&&(b===0?b=6:b--);return this.date_part(this.add(a,-1*b,"day"))},monthStart:function(a){a.setDate(1);return this.date_part(a)},
yearStart:function(a){a.setMonth(0);return this.month_start(a)},dayStart:function(a){return this.date_part(a)},dateToStr:function(a,b){a=a.replace(/%[a-zA-Z]/g,function(a){switch(a){case "%d":return'"+dhx.math.toFixed(date.getDate())+"';case "%m":return'"+dhx.math.toFixed((date.getMonth()+1))+"';case "%j":return'"+date.getDate()+"';case "%n":return'"+(date.getMonth()+1)+"';case "%y":return'"+dhx.math.toFixed(date.getFullYear()%100)+"';case "%Y":return'"+date.getFullYear()+"';case "%D":return'"+dhx.Date.Locale.day_short[date.getDay()]+"';
case "%l":return'"+dhx.Date.Locale.day_full[date.getDay()]+"';case "%M":return'"+dhx.Date.Locale.month_short[date.getMonth()]+"';case "%F":return'"+dhx.Date.Locale.month_full[date.getMonth()]+"';case "%h":return'"+dhx.math.toFixed((date.getHours()+11)%12+1)+"';case "%g":return'"+((date.getHours()+11)%12+1)+"';case "%G":return'"+date.getHours()+"';case "%H":return'"+dhx.math.toFixed(date.getHours())+"';case "%i":return'"+dhx.math.toFixed(date.getMinutes())+"';case "%a":return'"+(date.getHours()>11?"pm":"am")+"';
case "%A":return'"+(date.getHours()>11?"PM":"AM")+"';case "%s":return'"+dhx.math.toFixed(date.getSeconds())+"';case "%W":return'"+dhx.math.toFixed(dhx.Date.getISOWeek(date))+"';default:return a}});b===!0&&(a=a.replace(/date\.get/g,"date.getUTC"));return new Function("date",'return "'+a+'";')},strToDate:function(a,b){for(var c="var temp=date.split(/[^0-9a-zA-Z]+/g);",d=a.match(/%[a-zA-Z]/g),e=0;e<d.length;e++)switch(d[e]){case "%j":case "%d":c+="set[2]=temp["+e+"]||1;";break;case "%n":case "%m":c+=
"set[1]=(temp["+e+"]||1)-1;";break;case "%y":c+="set[0]=temp["+e+"]*1+(temp["+e+"]>50?1900:2000);";break;case "%g":case "%G":case "%h":case "%H":c+="set[3]=temp["+e+"]||0;";break;case "%i":c+="set[4]=temp["+e+"]||0;";break;case "%Y":c+="set[0]=temp["+e+"]||0;";break;case "%a":case "%A":c+="set[3]=set[3]%12+((temp["+e+"]||'').toLowerCase()=='am'?0:12);";break;case "%s":c+="set[5]=temp["+e+"]||0;"}var f="set[0],set[1],set[2],set[3],set[4],set[5]";b&&(f=" Date.UTC("+f+")");return new Function("date",
"var set=[0,0,1,0,0,0]; "+c+" return new Date("+f+");")},getISOWeek:function(a){if(!a)return!1;var b=a.getDay();b===0&&(b=7);var c=new Date(a.valueOf());c.setDate(a.getDate()+(4-b));var d=c.getFullYear(),e=Math.floor((c.getTime()-(new Date(d,0,1)).getTime())/864E5),f=1+Math.floor(e/7);return f},getUTCISOWeek:function(a){return this.getISOWeek(a)},add:function(a,b,c){var d=new Date(a.valueOf());switch(c){case "day":d.setDate(d.getDate()+b);break;case "week":d.setDate(d.getDate()+7*b);break;case "month":d.setMonth(d.getMonth()+
b);break;case "year":d.setYear(d.getFullYear()+b);break;case "hour":d.setHours(d.getHours()+b);break;case "minute":d.setMinutes(d.getMinutes()+b)}return d},datePart:function(a){var b=this.copy(a);b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);return b},timePart:function(a){var b=this.copy(a);return(b.valueOf()/1E3-b.getTimezoneOffset()*60)%86400},copy:function(a){return new Date(a.valueOf())}};dhx.i18n.setLocale("en");dhx.format=function(a){a=a||{};this.$init(a)};
dhx.format.prototype={$init:function(a){this.a={};this.a.groupDelimiter=a.groupDelimiter||" ";this.a.groupNumber=a.groupNumber||3;this.a.decimalPoint=a.decimalPoint||",";this.a.fractNumber=a.fractNumber||5;this.a.dateFormat=a.dateFormat||"%Y/%m/%d";this.a.stringTemplate=a.stringTemplate||"{value}";this.ff=dhx.Date.str_to_date(this.a.dateFormat);this.Qd=dhx.Date.date_to_str(this.a.dateFormat)},define:function(a,b){this.a[a]=b},format:function(a,b){b=b||this.formatAutoDefine(a);return this["format__"+
b]?this["format__"+b](a):a},formatAutoDefine:function(a){return typeof a=="number"||a instanceof Number?"number":a instanceof Date?"date":typeof a=="string"||a instanceof String?isNaN(parseFloat(a))?"string":"number":!1},format__number:function(a){var b="";typeof a=="number"||a instanceof Number||(a=parseFloat(a));var c=a.toFixed(this.a.fractNumber).toString(),c=c.split("."),d=this.add_delimiter_to_int(c[0]),e=this.str_reverse(this.add_delimiter_to_int(this.str_reverse(c[1])));return b=d+this.a.decimalPoint+
e},add_delimiter_to_int:function(a){for(var b=0,c="",d=a.length-1;d>=0;d--)c=a[d]+c,b++,b==this.a.groupNumber&&(c=this.a.groupDelimiter+c,b=0);return c},str_reverse:function(a){for(var b="",c=a.length-1;c>=0;c--)b+=a[c];return b},format__date:function(a){var b=this.Qd(a);return b},attachFormat:function(a,b){this["format__"+a]=b},format__string:function(a){var b=this.a.stringTemplate.replace("{value}",a);return b},format__bold:function(a){return typeof a=="string"||a instanceof String?a.bold():a}};
dhx.i18n.setLocale();
dhx.protoUI({name:"calendar",defaults:{date:null,startOnMonday:!0,navigation:!0,weekHeader:!1,weekNumber:!1,timeSelect:!1,skipEmptyWeeks:!0,cellHeight:36,minuteStep:15,hourStart:6,hourEnd:24,hourFormat:"%H",calendarHeader:"%F %Y",calendarDay:"%d",calendarWeekHeader:"W#",calendarWeek:"%W",width:300,height:300,selectedCss:"dhx_cal_selected_day"},skin:{monthHeaderHeight:40,weekHeaderHeight:20,timeSelectHeight:32},hourFormat_setter:dhx.Date.dateToStr,calendarHeader_setter:dhx.Date.dateToStr,calendarDay_setter:dhx.Date.dateToStr,
calendarWeekHeader_setter:dhx.Date.dateToStr,calendarWeek_setter:dhx.Date.dateToStr,date_setter:function(a){typeof a=="string"&&(a=dhx.i18n.fullDateFormatDate(a));this.L=this.L||a;return a},$init:function(){this.fa={};this.ec=[];var a="%Y-%m-%d";this.rc=dhx.Date.dateToStr(a);this.Cd=dhx.Date.strToDate(a)},$getSize:function(){var a=this.a;if(a.cellHeight>0)a.height=this.Xd();return dhx.ui.view.prototype.$getSize.call(this)},cellHeight_setter:function(a){return a=="auto"?0:a},$setSize:function(a,b){dhx.ui.view.prototype.$setSize.call(this,
a,b)&&this.render()},Ac:function(){var a=this.a;if(!this.L)this.L=new Date;var b=new Date(this.L);b.setDate(1);var c=b.getDay();this.ke=new Date(b);this.vd=a.startOnMonday?1:0;this.lb=(c-this.vd+7)%7;this.Nb=32-(new Date(b.getFullYear(),b.getMonth(),32)).getDate();var d=42-this.lb-this.Nb;this.df=new Date(b.setDate(this.Nb));this.G=a.skipEmptyWeeks?6-Math.floor(d/7):6;this.Ob=this.G*7-this.lb-this.Nb;this.cf=new Date(b.setDate(b.getDate()+d));this.Dc=this.skin.monthHeaderHeight+(a.weekHeader?this.skin.weekHeaderHeight:
0)+(a.timeSelect?this.skin.timeSelectHeight:0)},Xd:function(){this.Ac();return this.Dc+this.G*this.a.cellHeight},Td:function(){this.Ac();var a=this.a;this.Da=[];this.W=[];var b=this.j;b+=1;for(var c=this.m,d=a.weekNumber?8:7,e=0;e<d;e++)this.W[e]=Math.ceil(b/(d-e)),b-=this.W[e];if(a.cellHeight<=0)for(var f=0;f<this.G;f++)this.Da[f]=Math.ceil((c-this.Dc)/(this.G-f)),c-=this.Da[f];else for(var g=0;g<this.G;g++)this.Da[g]=a.cellHeight},selectDate:function(a,b){this.define("date",a);var c=this.a;b&&this.showCalendar(c.date);
var d=c.selectedCss;if(this.fa[this.i])dhx.html.removeCss(this.fa[this.i],d),this.i=null;var e=this.rc(c.date);if(this.fa[e])dhx.html.addCss(this.fa[e],d),this.i=e;c.timeSelect&&this.Ee(a)},Ee:function(a){var b=this.a,c=this.ec,a=a||b.date;c[0].value=Math.min(b.hourEnd,Math.max(a.getHours(),b.hourStart));c[1].value=Math.floor(a.getMinutes()/b.minuteStep)*b.minuteStep},getSelectedDate:function(){var a=this.a;return a.date?new Date(a.date):null},getVisibleDate:function(){return new Date(this.L)},setValue:function(a){this.selectDate(a,
!0)},getValue:function(){return this.getSelectedDate()},showCalendar:function(a){typeof a=="string"&&(a=dhx.i18m.fullDateFormatDate(a));if(!a||!(a.getFullYear()==this.L.getFullYear()&&a.getMonth()==this.L.getMonth())){this.L=a||this.L;this.render();var b=this.getParent();b&&b.resize()}},refresh:function(){this.render()},render:function(){var a=this.a;if(this.isVisible(a.id)){this.callEvent("onBeforeRender",[]);this.Td();var b="<div class='dhx_mini_calendar'><div class='dhx_cal_month'>"+a.calendarHeader(this.L);
a.navigation&&(b+=this.le());b+="</div>";a.weekHeader&&(b+="<div class='dhx_cal_header' style='height:"+this.skin.weekHeaderHeight+"px'>"+this.Xe()+"</div>");b+="<div class='dhx_cal_body'>"+this.Bd()+"</div>";a.timeSelect&&(b+="<div class='dhx_cal_time_select'>"+this.Ue()+"</div>");b+="</div></div>";this.g.innerHTML=b;if(a.timeSelect){for(var c=this.g.getElementsByTagName("select"),d=this.ec,e=0;e<c.length;e++)d[e]=c[e];d[0].onchange=function(){a.date.setHours(this.value)};d[1].onchange=function(){a.date.setMinutes(this.value)}}this.fa=
{};for(var f=this.g.getElementsByTagName("table"),g=f[f.length-1].getElementsByTagName("div"),e=0;e<g.length;e++)this.fa[g[e].getAttribute("date")]=g[e];a.date&&this.selectDate(a.date,!1);this.callEvent("onAfterRender",[])}},Xe:function(){var a=this.a,b="",c=a.startOnMonday?1:0,d=0,e=0;if(a.weekNumber){var e=1,f=a.calendarWeekHeader();b+="<div class='dhx_cal_week_header' style='width: "+(this.W[0]-1)+"px; left: "+d+"px;' >"+f+"</div>";d+=this.W[0]}for(var g=0;g<7;g++){var h=(c+g)%7,i=dhx.Date.Locale.day_short[h],
j="dhx_cal_day_name",k=this.W[g+e]-1;g==6&&(j+=" dhx_cal_day_name_last",k+=1);h===0&&(j+=" dhx_sunday");h==6&&(j+=" dhx_saturday");b+="<div class='"+j+"' style='width: "+k+"px; left: "+d+"px;' >"+i+"</div>";d+=this.W[g+e]}return b},Bd:function(){var a=this.a,b=0,c=dhx.Date.add(this.ke,-this.lb,"day"),c=dhx.Date.datePart(c),d=0,e="";if(a.weekNumber){var d=1,f=dhx.Date.add(c,(this.vd+1)%2,"day");e+='<table class="dhx_week_numbers" cellspacing="0" cellpadding="0" style="float: left;"><tbody>';for(var g=
0;g<this.G;g++){var h=this.Da[g]-2,i=this.W[0]-2,j=a.calendarWeek(f),k="dhx_cal_week_num";if(!a.skipEmptyWeeks&&(g==this.G-1&&this.Ob>=7||g==this.G-2&&this.Ob==14))k="dhx_next_month",j="";g==this.G-1&&(k+=" dhx_cal_day_num_bborder",h+=1);e+="<tr><td>";e+="<div class='"+k+"' style='width:"+i+"px; height:"+h+"px; line-height:"+h+"px;' >"+j+"</div>";e+="</td></tr>";f=dhx.Date.add(f,7,"day")}e+="</tbody></table>"}var o=dhx.Date.datePart(new Date);e+='<table cellspacing="0" cellpadding="0"><tbody>';for(var m=
this.G*7-1,g=0;g<this.G;g++){e+="<tr>";for(var l=0;l<7;l++){var n=a.calendarDay(c),p=this.rc(c),k="dhx_cal_day_num";b<this.lb&&(k="dhx_prev_month",p=n="");b>m-this.Ob&&(k="dhx_next_month",p=n="");h=this.Da[g]-2;i=this.W[l+d]-2;l==6&&(k+=" dhx_cal_day_num_rborder",i+=1);g==this.G-1&&(k+=" dhx_cal_day_num_bborder",h+=1);e+="<td>";o.valueOf()==c.valueOf()&&(k+=" dhx_cal_current_day");e+="<div class='"+k+"' style='width:"+i+"px; height:"+h+"px; line-height:"+h+"px;' date='"+p+"'>"+n+"</div>";e+="</td>";
c=dhx.Date.add(c,1,"day");b++}e+="</tr>"}e+="</tbody></table>";return e},Ue:function(){for(var a=this.a,b="<select class='dhx_hour_select' onclick=''>",c=a.hourStart,d=a.hourEnd,e=dhx.Date.datePart(new Date),f=c;f<d;f++)e.setHours(f),b+="<option value='"+f+"'>"+a.hourFormat(e)+"</option>";b+="</select>";b+="<select class='dhx_minute_select' onclick=''>";for(var g=0;g<60;g+=a.minuteStep)b+="<option value='"+g+"'>"+dhx.math.toFixed(g)+"</option>";b+="</select>";return b},le:function(){var a="<div class='dhx_cal_arrow dhx_cal_",
b="_button'><div></div></div>";return a+"prev"+b+a+"next"+b},on_click:{dhx_cal_arrow:function(a,b,c){var d=c.className.match(/prev/i)?-1:1,e=new Date(this.L),f=new Date(e);f.setDate(1);f=dhx.Date.add(f,d,"month");this.callEvent("onBeforeMonthChange",[e,f])&&(this.showCalendar(f),this.selectDate(this.a.date,!1),this.callEvent("onAfterMonthChange",[f,e]))},dhx_cal_day_num:function(a,b,c){var d=c.getAttribute("date"),e=this.Cd(d);if(this.a.timeSelect){var f=this.ec;e.setMinutes(f[0].value*60+f[1].value*
1)}this.selectDate(e);this.callEvent("onDateSelect",[e]);this.callEvent("onChange",[e])}}},dhx.MouseEvents,dhx.Settings,dhx.EventSystem,dhx.Movable,dhx.ui.view);dhx.Modality={modal_setter:function(a){if(a){if(!this.qa)this.qa=dhx.html.create("div",{"class":a=="rich"?"dhx_modal_rich":"dhx_modal"}),this.qa.style.zIndex=dhx.ui.zIndex(),this.b.style.zIndex=dhx.ui.zIndex(),document.body.appendChild(this.qa)}else this.qa&&dhx.html.remove(this.qa),this.qa=null;return a}};
dhx.protoUI({name:"window",$init:function(a){this.b.innerHTML="<div class='dhx_win_content'><div class='dhx_win_head'></div><div class='dhx_win_body'></div></div>";this.g=this.b.firstChild;this.eb=this.g.childNodes[0];this.pc=this.g.childNodes[1];this.b.className+=" dhx_window";this.R=this.h=null;this.a.k={top:!1,left:!1,right:!1,bottom:!1};if(!a.id)a.id=dhx.uid()},Zc:function(){this.h={destructor:function(){}}},ac:function(a){this.h.destructor();this.h=a;this.h.D=this;this.pc.appendChild(this.h.b);
this.resize()},show:function(a,b,c){this.a.hidden=!1;this.b.style.zIndex=dhx.ui.zIndex();this.a.modal&&this.modal_setter(!0);var d,e,f;if(a){typeof a=="object"&&!a.tagName?(d={x:a.clientX-this.$[0]/2,y:a.clientY},e=document.body.offsetWidth,f=1):a=dhx.toNode(a);var g=document.body.offsetWidth,h=document.body.offsetHeight;e=e||a.offsetWidth;f=f||a.offsetHeight;var i=this.$;d=d||dhx.html.offset(a);var j=6,k=6,o=6,c="top",m=0,l=0,n=0,p=0;b=="right"?(p=d.x+j+e,k=-f,c="left",m=Math.round(d.y+f/2),l=p-
o):b=="left"?(p=d.x-j-i[0]-1,k=-f,c="right",m=Math.round(d.y+f/2),l=p+i[0]+1):(p=g-d.x>i[0]?d.x:g-j-i[0],l=Math.round(d.x+e/2),l>p+i[0]&&(l=p+i[0]/2));h-f-d.y-k>i[1]?(n=f+d.y+k,m||(c="top",m=n-o)):(n=d.y-k-i[1],n<0?(n=0,c=!1):m||(c="bottom",n--,m=n+i[1]+1));this.setPosition(p,n);c&&this.cd&&this.cd(c,l,m)}this.Le=new Date;this.b.style.display="block";if(this.la){for(var q=0;q<this.la.length;q++)dhx.ui.get(this.la[q]).render();this.la=[];this.Jb={}}this.callEvent("onShow",[])},hidden_setter:function(a){a?
this.hide():this.show();return!!a},hide:function(){!this.a.hidden&&!(new Date-this.Le<100)&&(this.a.modal&&this.modal_setter(!1),this.a.position=="top"?dhx.animate(this.b,{type:"slide",x:0,y:0,duration:300,callback:this.Ec,master:this}):this.Ec())},Ec:function(){this.b.style.display="none";this.a.hidden=!0;this.callEvent("onHide",[])},close:function(){this.define("modal",!1);dhx.html.remove(this.b);this.destructor()},body_setter:function(a){typeof a!="object"&&(a={template:a});this.h=dhx.ui.Oa(a);
this.h.D=this;this.pc.appendChild(this.h.b);return a},head_setter:function(a){if(a===!1)return a;typeof a!="object"&&(a={template:a,css:"dhx_alert_template"});this.R=dhx.ui.Oa(a);this.R.D=this;this.eb.appendChild(this.R.b);return a},getBody:function(){return this.h},getHead:function(){return this.R},resize:function(){var a=this.$getSize();this.$setSize(a[1]||this.a.width,a[3]||this.a.height);this.cc(this.a.left,this.a.top)},cc:function(a,b){if(this.a.position){var c=Math.round((document.body.offsetWidth-
this.a.width)/2),d=Math.round((document.body.offsetHeight-this.a.height)/2);this.a.position=="top"&&(d=dhx.animate.isSupported()?-1*this.a.height:10);this.setPosition(c,d);this.a.position=="top"&&dhx.animate(this.b,{type:"slide",x:0,y:this.a.height,duration:300})}else this.setPosition(a,b)},setPosition:function(a,b){this.b.style.top=b+"px";this.b.style.left=a+"px";this.a.left=a;this.a.top=b},$getSize:function(){var a=this.h.$getSize();if(this.R){var b=this.R.$getSize();if(b[3])this.a.headHeight=b[3]}if(a[3])a[3]+=
this.a.head!==!1?this.a.headHeight:0,this.a.height=a[3];if(a[1])this.a.width=a[1];if(a[0]||a[2])this.a.gravity=Math.max(a[0],a[2]);return dhx.ui.view.prototype.$getSize.call(this)},$setSize:function(a,b){if(dhx.ui.view.prototype.$setSize.call(this,a,b))a=this.j,b=this.m,this.a.head===!1?(this.eb.style.display="none",this.h.$setSize(a,b)):(this.R.$setSize(a,this.a.headHeight),this.h.$setSize(a,b-this.a.headHeight))},defaults:{headHeight:43,width:300,height:200,top:100,left:100,body:"",head:""}},dhx.ui.view,
dhx.Movable,dhx.Modality,dhx.EventSystem);
dhx.protoUI({name:"popup",$init:function(){this.a.head=!1;dhx.event(this.g,"click",dhx.bind(this.Id,this));dhx.attachEvent("onClick",dhx.bind(this.Ha,this));this.attachEvent("onHide",this.Fc)},Id:function(){this.Me=new Date},Ha:function(){new Date-(this.Me||0)>250&&this.hide()},$getSize:function(){var a=this.h.$getSize();if(a[3])this.a.height=a[3]+this.a.padding*2;if(a[1])this.a.width=a[1]+this.a.padding*2;if(a[0]||a[2])this.a.gravity=Math.max(a[0],a[2]);return dhx.ui.view.prototype.$getSize.call(this)},
$setSize:function(a,b){if(dhx.ui.view.prototype.$setSize.call(this,a,b))a=this.j-this.a.padding*2,b=this.m-this.a.padding*2,this.g.style.padding=this.a.padding+"px",this.eb.style.display="none",this.h.$setSize(a,b)},body_setter:function(a){a=dhx.ui.window.prototype.body_setter.call(this,a);this.h.a.k={top:!1,left:!1,right:!1,bottom:!1};return a},defaults:{padding:8},head_setter:null,cd:function(a,b,c){this.Fc();document.body.appendChild(this.Ka=dhx.html.create("DIV",{"class":"dhx_point_"+a},""));
this.Ka.style.zIndex=dhx.ui.zIndex();this.Ka.style.top=c+"px";this.Ka.style.left=b+"px"},Fc:function(){this.Ka=dhx.html.remove(this.Ka)}},dhx.ui.window);
dhx.protoUI({name:"alert",defaults:{position:"center",head:{template:"Info",css:"dhx_alert_template"},height:170,modal:!0,callback:null,body:{type:"clean",rows:[{template:"<div class='dhx_alert_text'>#text#</div>",data:{text:"You have forgot to define the text :) "}},{view:"button",height:60,id:"dhx_alert_ok",type:"big",label:"Ok",click:function(){this.getParent().getParent().Bb(!0)}}]}},$init:function(){(!this.b.parentNode||!this.b.parentNode.tagName)&&document.body.appendChild(this.b);this.$ready.push(this.resize)},
Yc:function(a){typeof a=="string"&&(a={title:this.defaults.head.template,message:a});dhx.extend(a,this.defaults);delete a.head;delete a.body;this.Rb(a,{});this.resize();this.show()},title_setter:function(a){this.R.define("template",a);this.R.render()},message_setter:function(a){var b=this.h.c[0];b.data={text:a};b.render()},labelOk_setter:function(a){var b=this.h.c[1];b.config.label=a;b.render()},labelCancel_setter:function(a){var b=this.h.c[2];b.config.label=a;b.render()},Bb:function(a){this.hide();
this.a.callback&&dhx.toFunctor(this.a.callback).call(this,a,this.a.details)}},dhx.ui.window);dhx.alert=dhx.single(dhx.ui.alert);
dhx.protoUI({name:"confirm",defaults:{height:210,body:{type:"clean",rows:[{id:"dhx_confirm_message",template:"<div class='dhx_alert_text'>#text#</div>",data:{text:"You have forgot to define the text :) "}},{height:53,view:"button",type:"big",id:"dhx_confirm_ok",label:"Ok",click:function(){this.getParent().getParent().Bb(!0)}},{height:55,view:"button",type:"biground",id:"dhx_confirm_cancel",label:"Cancel",click:function(){this.getParent().getParent().Bb(!1)}}]}}},dhx.ui.alert);dhx.confirm=dhx.single(dhx.ui.confirm);
dhx.dp=function(a){if(typeof a=="object"&&a.a)a=a.a.id;if(dhx.dp.Tb[a])return dhx.dp.Tb[a];if(typeof a=="string"||typeof a=="number")a={master:dhx.ui.get(a)};var b=new dhx.DataProcessor(a);return dhx.dp.Tb[b.a.master.a.id]=b};dhx.dp.Tb={};
dhx.DataProcessor=dhx.proto({defaults:{autoupdate:!0,mode:"post"},$init:function(){this.V=[];this.bf=[];this.X=null;this.na=!1;this.name="DataProcessor";this.$ready.push(this.zb)},master_setter:function(a){var b=a;if(a.name!="DataStore")b=a.data;this.a.store=b;return a},zb:function(){this.a.store.attachEvent("onStoreUpdated",dhx.bind(this.Sc,this))},ignore:function(a,b){var c=this.na;this.na=!0;a.call(b||this);this.na=c},off:function(){this.na=!0},on:function(){this.na=!1},Kd:function(a){var b={},
c;for(c in a)c.indexOf("$")!==0&&(b[c]=a[c]);return b},save:function(a,b){b=b||"update";this.Sc(a,this.a.store.item(a),b)},Sc:function(a,b,c){if(this.na===!0||!c)return!0;var d={id:a,data:this.Kd(b)};switch(c){case "update":d.operation="update";break;case "add":d.operation="insert";break;case "delete":d.operation="delete";break;default:return!0}if(d.operation!="delete"&&!this.validate(d.data))return!1;this.Gd(d)&&this.V.push(d);this.a.autoupdate&&this.send();return!0},Gd:function(a){for(var b=0;b<
this.V.length;b++){var c=this.V[b];if(c.id==a.id){if(a.operation=="delete")c.operation=="insert"?this.V.splice(b,1):c.operation="delete";c.data=a.data;return!1}}return!0},send:function(){this.Ge()},Ge:function(){if(this.a.url){for(var a=this.V,b=[],c=0;c<a.length;c++){var d=a[c].id,e=a[c].operation;if(this.a.store.exists(d))a[c].data=this.a.store.item(d);this.callEvent("onBefore"+e,[d,a[c].data])&&b.push(a[c])}b.length&&this.callEvent("onBeforeDataSend",[b])&&this.Fe(this.a.url,this.We(b),this.a.mode)}},
We:function(a){for(var b={},c=[],d=0;d<a.length;d++){var e=a[d];c.push(e.id);b[e.id+"_!nativeeditor_status"]=e.operation;for(var f in e.data)f.indexOf("$")!==0&&(b[e.id+"_"+f]=e.data[f])}b.ids=c.join(",");return b},Fe:function(a,b,c){if(typeof a=="function")return a(b);a+=a.indexOf("?")==-1?"?":"&";a+="editing=true";dhx.ajax()[c](a,b,dhx.bind(this.ye,this))},ye:function(a,b,c){this.callEvent("onBeforeSync",[f,a,b,c]);for(var d=dhx.DataDriver.xml,b=d.toObject(a,d),e=d.xpath(b,"//action"),f=[],g=0;g<
e.length;g++){var h=d.tagToObject(e[g]);f.push(h);for(var i=-1,j=0;j<this.V.length;){this.V[j].id==h.sid&&(i=j);break}if(!(h.type=="error"||h.type=="invalid")||this.callEvent("onDBError",[h,this.V[i]]))i>=0&&this.V.splice(i,1),h.tid!=h.sid&&this.a.store.changeId(h.sid,h.tid),this.callEvent("onAfter"+h.type,[h])}this.callEvent("onAfterSync",[f,a,b,c])},escape:function(a){return this.a.escape?this.a.escape(a):encodeURIComponent(a)}},dhx.Settings,dhx.EventSystem,dhx.ValidateData);
(function(){var a=dhx.Touch={config:{longTouchDelay:1E3,scrollDelay:150,gravity:500,deltaStep:30,speed:"0ms",finish:1500},disable:function(){a.Fb=!0},enable:function(){a.Fb=!1},$init:function(){dhx.env.touch?(dhx.event(document.body,"touchstart",a.nd),dhx.event(document.body,"touchmove",a.gc),dhx.event(document.body,"touchend",a.md)):(a.bb=a.Wd,dhx.event(document.body,"mousedown",a.nd),dhx.event(document.body,"mousemove",a.gc),dhx.event(document.body,"mouseup",a.md),document.body.style.overflowX=
document.body.style.overflowY="hidden");dhx.event(document.body,"dragstart",function(a){return dhx.html.preventEvent(a)});dhx.event(document.body,"touchstart",function(b){if(!a.Fb&&dhx.env.isSafari)return b.srcElement.tagName=="SELECT"?!0:dhx.html.preventEvent(b)});a.Ca()},Ca:function(){a.A=a.w=a.ca=null;a.H=a.v=a.n=null;a.I={wb:0,xb:0,Na:0};if(a.Xa)dhx.html.removeCss(a.Xa,"dhx_touch"),a.Xa=null;window.clearTimeout(a.Kc);a.ud=!0;a.Sa=!0;a.Ta=!0;a.ic||a.ua()},md:function(b){if(a.A){if(a.H){var c=a.Hb(a.v),
d=c.e,e=c.f,f=a.config.finish,g=a.Bc(b,!0);if(g.Na){var h=d+a.config.gravity*g.wb/g.Na,i=e+a.config.gravity*g.xb/g.Na,j=a.q[0]?a.Wa(h,!1,!1,a.n.dx,a.n.px):d,k=a.q[1]?a.Wa(i,!1,!1,a.n.dy,a.n.py):e,o=Math.max(Math.abs(j-d),Math.abs(k-e));o<150&&(f=f*o/150);if(j!=d||k!=e)f=Math.round(f*Math.max((j-d)/(h-d),(k-e)/(i-e)));var m={e:j,f:k},l=dhx.ui.get(a.v);l&&l.callEvent&&l.callEvent("onAfterScroll",[m]);f=Math.max(100,f);d!=m.e||e!=m.f?(a.wa(a.v,m.e,m.f,f+"ms"),a.dd(m.e,m.f,f+"ms")):a.ua()}else a.ua()}else if(a.Ta&&
!a.Sa)a.ya("onSwipeX");else if(a.Sa&&!a.Ta)a.ya("onSwipeY");else if(dhx.env.isSafari){var n=a.A.target;dhx.delay(function(){var a=document.createEvent("MouseEvents");a.initEvent("click",!0,!0);n.dispatchEvent(a)})}a.ya("onTouchEnd");a.Ca()}},gc:function(b){if(a.A){var c=a.Bc(b);a.ya("onTouchMove");if(a.H)a.ed(c);else if(a.Sa=a.lc(c.Ye,"x",a.Sa),a.Ta=a.lc(c.Ze,"y",a.Ta),a.H){var d=a.Cc("onBeforeScroll");if(d){var e={};d.callEvent("onBeforeScroll",[e]);if(e.update)a.config.speed=e.speed,a.config.scale=
e.scale}a.ce(c)}return dhx.html.preventEvent(b)}},ed:function(){if(a.v){var b=a.Hb(a.v),c=b.e,d=b.f,e=a.ca||a.A;if(a.q[0])b.e=a.Wa(b.e-e.x+a.w.x,!0,b.e,a.n.dx,a.n.px);if(a.q[1])b.f=a.Wa(b.f-e.y+a.w.y,!0,b.f,a.n.dy,a.n.py);a.wa(a.v,b.e,b.f,"0ms");a.dd(b.e,b.f,"0ms")}},dd:function(b,c,d){var e=a.n.px/a.n.dx*-b,f=a.n.py/a.n.dy*-c;a.q[0]&&a.wa(a.q[0],e,0,d);a.q[1]&&a.wa(a.q[1],0,f,d)},wa:function(b,c,d,e){a.ic=!0;b.style[dhx.env.transformPrefix+"Transform"]=dhx.env.translate+"("+Math.round(c)+"px, "+
Math.round(d)+"px"+(dhx.env.translate=="translate3d"?", 0":"")+")";b.style[dhx.env.transformPrefix+"TransitionDuration"]=e},Hb:function(a){var c=window.getComputedStyle(a)[dhx.env.transformPrefix+"Transform"];if(c=="none")return{e:0,f:0};else{if(window.WebKitCSSMatrix)return new WebKitCSSMatrix(c);for(var d=c.replace(/(matrix\()(.*)(\))/gi,"$2"),d=d.replace(/\s/gi,""),d=d.split(","),e={},f="a,b,c,d,e,f".split(","),g=0;g<f.length;g++)e[f[g]]=parseInt(d[g],10);return e}},Wa:function(a,c,d,e,f){if(a===
d)return a;var g=Math.abs(a-d),h=g/(a-d);if(a>0)return c?d+h*Math.sqrt(g):0;var i=e-f;return i+a<0?c?d-Math.sqrt(-(a-d)):-i:a},ce:function(){a.H.indexOf("x")!=-1&&(a.q[0]=a.vc("x",a.n.dx,a.n.px,"width"));a.H.indexOf("y")!=-1&&(a.q[1]=a.vc("y",a.n.dy,a.n.py,"height"));if(!a.v.scroll_enabled){a.v.scroll_enabled=!0;a.v.parentNode.style.position="relative";var b=dhx.env.transformCSSPrefix;a.v.style.cssText+=b+"transition: "+b+"transform; "+b+"user-select:none; "+b+"transform-style:flat;";a.v.addEventListener(dhx.env.transitionEnd,
a.ua,!1)}window.setTimeout(a.ed,1)},vc:function(b,c,d,e){if(c-d<2)return a.H="";var f=dhx.html.create("DIV",{"class":"dhx_scroll_"+b},"");f.style[e]=d*d/c-7+"px";a.v.parentNode.appendChild(f);return f},lc:function(b,c,d){if(b>a.config.deltaStep){if(a.ud&&(a.he(c),(a.H||"").indexOf(c)==-1))a.H="";return!1}return d},ua:function(){if(!a.H)dhx.html.remove(a.q),a.q=[null,null];a.ic=!1},he:function(b){window.clearTimeout(a.Kc);a.ud=!1;a.Jc(b)},nd:function(b){if(!a.Fb){a.A=a.bb(b);a.ya("onTouchStart");a.q[0]||
a.q[1]?a.Re(b,a.q[0]?"x":"y"):a.Kc=window.setTimeout(a.ie,a.config.longTouchDelay);var c=dhx.ui.get(b);if(c&&c.touchable&&(!b.target.className||b.target.className.indexOf("dhx_view")!==0))a.Xa=c.getNode(b),dhx.html.addCss(a.Xa,"dhx_touch")}},ie:function(){a.ya("onLongTouch");dhx.callEvent("onClick",[a.A]);a.Ca()},Re:function(b,c){a.Jc(c);var d=a.q[0]||a.q[1];if(d&&(!a.v||d.parentNode!=a.v.parentNode))a.Ca(),a.ua(),a.A=a.bb(b);a.gc(b)},Bc:function(b){a.ca=a.w;a.w=a.bb(b);a.I.Ye=Math.abs(a.A.x-a.w.x);
a.I.Ze=Math.abs(a.A.y-a.w.y);if(a.ca)a.w.time-a.ca.time<a.config.scrollDelay?(a.I.wb=a.I.wb/1.3+a.w.x-a.ca.x,a.I.xb=a.I.xb/1.3+a.w.y-a.ca.y):a.I.xb=a.I.wb=0,a.I.Na=a.I.Na/1.3+(a.w.time-a.ca.time);return a.I},Jc:function(b){var c=a.A.target;if(dhx.env.touch||dhx.env.transition||dhx.env.transform)for(;c&&c.tagName!="BODY";){if(c.getAttribute){var d=c.getAttribute("touch_scroll");if(d&&(!b||d.indexOf(b)!=-1)){a.H=d;a.v=c;a.n={dx:c.offsetWidth,dy:c.offsetHeight,px:c.parentNode.offsetWidth,py:c.parentNode.offsetHeight};
break}}c=c.parentNode}},ya:function(b){dhx.callEvent(b,[a.A,a.w]);var c=a.Cc(b);c&&c.callEvent(b,[a.A,a.w])},Cc:function(b){var c=dhx.ui.get(a.A);if(!c)return null;for(;c;){if(c.hasEvent&&c.hasEvent(b))return c;c=c.getParent()}return null},bb:function(b){if(!b.touches[0]){var c=a.w;c.time=new Date;return c}return{target:b.target,x:b.touches[0].pageX,y:b.touches[0].pageY,time:new Date}},Wd:function(a){return{target:a.target,x:a.pageX,y:a.pageY,time:new Date}}};dhx.TouchEvents={$init:function(){this.attachEvent("onSwipeX",
this.Se);this.attachEvent("onBeforeSelect",this.unSwipe);this.attachEvent("onAfterDelete",this.unSwipe)},Se:function(a){var c=this.locate(a);c&&c!=this.ea&&(this.unSwipe(),this.swipe(c))},swipe:function(a){this.ea=a;this.item(this.ea).$template="Swipe";this.refresh(this.ea)},unSwipe:function(){if(this.ea){var a=this.item(this.ea);if(a)a.$template="",this.refresh(this.ea);this.ea=null}}};dhx.ready(function(){a.$init()})})();
dhx.protoUI({name:"googlemap",$init:function(a){if(!a.id)a.id=dhx.uid();this.b.innerHTML="<div class='dhx_map_content' style='width:100%;height:100%'></div>";this.g=this.b.firstChild;this.map=null;this.$ready.push(this.render)},render:function(){var a=this.a,b={zoom:a.zoom,center:a.center,mapTypeId:a.mapType};this.map=new google.maps.Map(this.g,b)},center_setter:function(a){typeof a!="object"&&(a={});this.Ia(a,{x:48.724,y:8.215});a=new google.maps.LatLng(a.x,a.y);this.map&&this.map.setCenter(a);return a},
mapType_setter:function(a){a=google.maps.MapTypeId[a];this.map&&this.map.setMapTypeId(a);return a},zoom_setter:function(a){this.map&&this.map.setZoom(a);return a},defaults:{zoom:5,center:{},mapType:"ROADMAP"},$setSize:function(){dhx.ui.view.prototype.$setSize.apply(this,arguments);google.maps.event.trigger(this.map,"resize")}},dhx.ui.view);if(!window.scheduler)window.scheduler={config:{},templates:{},xy:{},locale:{}};if(!scheduler.locale)scheduler.locale={};
scheduler.locale.labels={list_tab:"List",day_tab:"Day",month_tab:"Month",icon_today:"Today",icon_save:"Save",icon_delete:"Delete event",icon_cancel:"Cancel",icon_edit:"Edit",icon_back:"Back",icon_close:"Close form",icon_yes:"Yes",icon_no:"No",confirm_closing:"Your changes will be lost, are your sure ?",confirm_deleting:"Event will be deleted permanently, are you sure?",label_event:"Event",label_start:"Start",label_end:"End",label_details:"Notes",label_from:"from",label_to:"to"};
scheduler.config={init_date:new Date,form_date:"%d-%m-%Y %H:%i",xml_date:"%Y-%m-%d %H:%i",item_date:"%d.%m.%Y",header_date:"%d.%m.%Y",hour_date:"%H:%i",scale_hour:"%H",calendar_date:"%F %Y"};scheduler.config.form_rules={end_date:function(a,b){return b.start_date.valueOf()<a.valueOf()}};scheduler.xy={confirm_height:231,confirm_width:250,scale_width:45,scale_height:15,list_tab:54,day_tab:54,month_tab:68,icon_today:72,icon_save:100,icon_cancel:100,icon_edit:100,icon_back:100,list_height:42,month_list_height:42};
scheduler.templates={selected_event:function(a){var b="";if(!a.start_date)return b;b+="<div  class='selected_event'>";b+="<div class='event_title'>"+a.text+"</div>";if(dhx.Date.datePart(a.start_date).valueOf()==dhx.Date.datePart(a.end_date).valueOf()){var c=dhx.i18n.dateFormatStr(a.start_date),d=dhx.i18n.timeFormatStr(a.start_date),e=dhx.i18n.timeFormatStr(a.end_date);b+="<div class='event_text'>"+c+"</div>";b+="<div class='event_text'>"+scheduler.locale.labels.label_from+" "+d+" "+scheduler.locale.labels.label_to+
" "+e+"</div>"}else{var f=dhx.i18n.longDateFormatStr(a.start_date),g=dhx.i18n.longDateFormatStr(a.end_date),d=dhx.i18n.timeFormatStr(a.start_date),e=dhx.i18n.timeFormatStr(a.end_date);b+="<div class='event_text'>"+scheduler.locale.labels.label_from+" "+d+" "+f+"</div>";b+="<div class='event_text'>"+scheduler.locale.labels.label_to+" "+e+" "+g+"</div>"}a.details&&a.details!==""&&(b+="<div class='event_title'>"+scheduler.locale.labels.label_details+"</div>",b+="<div class='event_text'>"+a.details+"</div>");
b+="</div>";return b},calendar_event:function(a){return a+"<div class='day_with_events'></div>"},event_date:function(a){return dhx.i18n.dateFormatStr(a)},event_long_date:function(a){return dhx.i18n.longDateFormatStr(a)},event_time:function(a){return dhx.i18n.timeFormatStr(a)},event_color:function(a){return a.color?"background-color:"+a.color:""},event_marker:function(a,b){return"<div class='dhx_event_marker' style='"+b.color(a)+"'></div>"},event_title:function(a,b){return"<div class='dhx_day_title'>"+
b.dateStart(a.start_date)+"</div><div style='margin:10px'><div class='dhx_event_time'>"+b.timeStart(a.start_date)+"</div>"+b.marker(a,b)+"<div class='dhx_event_text'>"+a.text+"</div></div>"},month_event_title:function(a,b){return b.marker(a,b)+"<div class='dhx_event_time'>"+b.timeStart(a.start_date)+"</div><div class='dhx_event_text'>"+a.text+"</div>"},day_event:function(a){return a.text}};scheduler.config.views=[];
dhx.ready(function(){if(scheduler.locale&&scheduler.locale.date)dhx.Date.Locale=scheduler.locale.date;if(!scheduler.config.form)scheduler.config.form=[{view:"text",label:scheduler.locale.labels.label_event,name:"text"},{view:"datepicker",label:scheduler.locale.labels.label_start,name:"start_date",timeSelect:1,dateFormat:scheduler.config.form_date},{view:"datepicker",label:scheduler.locale.labels.label_end,name:"end_date",timeSelect:1,dateFormat:scheduler.config.form_date},{view:"textarea",label:scheduler.locale.labels.label_details,
name:"details",width:300,height:150},{view:"button",label:scheduler.locale.labels.icon_delete,id:"delete",type:"form",css:"delete"}];if(!scheduler.config.bottom_toolbar)scheduler.config.bottom_toolbar=[{view:"button",id:"today",label:scheduler.locale.labels.icon_today,inputWidth:scheduler.xy.icon_today,align:"left",width:scheduler.xy.icon_today+6},{view:"segmented",id:"buttons",selected:"list",align:"center",multiview:!0,options:[{value:"list",label:scheduler.locale.labels.list_tab,width:scheduler.xy.list_tab},
{value:"day",label:scheduler.locale.labels.day_tab,width:scheduler.xy.day_tab},{value:"month",label:scheduler.locale.labels.month_tab,width:scheduler.xy.month_tab}]},{view:"button",css:"add",id:"add",align:"right",label:"",inputWidth:42,width:50},{view:"label",label:"",inputWidth:42,width:50,batch:"readonly"}];if(!scheduler.config.day_toolbar)scheduler.config.day_toolbar=[{view:"label",id:"prev",align:"left",label:"<div class='dhx_cal_prev_button'><div></div></div>"},{view:"label",id:"date",align:"center",
width:200},{view:"label",id:"next",align:"right",label:"<div class='dhx_cal_next_button'><div></div></div>"}];if(!scheduler.config.selected_toolbar)scheduler.config.selected_toolbar=[{view:"button",inputWidth:scheduler.xy.icon_back,type:"prev",id:"back",align:"left",label:scheduler.locale.labels.icon_back},{view:"button",inputWidth:scheduler.xy.icon_edit,id:"edit",align:"right",label:scheduler.locale.labels.icon_edit}];if(!scheduler.config.form_toolbar)scheduler.config.form_toolbar=[{view:"button",
inputWidth:scheduler.xy.icon_cancel,id:"cancel",css:"cancel",align:"left",label:scheduler.locale.labels.icon_cancel},{view:"button",inputWidth:scheduler.xy.icon_save,id:"save",align:"right",label:scheduler.locale.labels.icon_save}];scheduler.types={event_list:{name:"EventsList",css:"events",cssNoEvents:"no_events",padding:0,height:scheduler.xy.list_height,width:"auto",dateStart:scheduler.templates.event_date,timeStart:scheduler.templates.event_time,color:scheduler.templates.event_color,marker:scheduler.templates.event_marker,
template:scheduler.templates.event_title},day_event_list:{name:"DayEventsList",css:"day_events",cssNoEvents:"no_events",padding:0,height:scheduler.xy.month_list_height,width:"auto",timeStart:scheduler.templates.event_time,color:scheduler.templates.event_color,marker:scheduler.templates.event_marker,template:scheduler.templates.month_event_title}};dhx.Type(dhx.ui.list,scheduler.types.event_list);dhx.Type(dhx.ui.list,scheduler.types.day_event_list);dhx.DataDriver.scheduler={records:"/*/event"};dhx.extend(dhx.DataDriver.scheduler,
dhx.DataDriver.xml);var a=[{id:"list",view:"list",type:"EventsList",startDate:new Date},{id:"day",rows:[{id:"dayBar",view:"toolbar",css:"dhx_topbar",elements:scheduler.config.day_toolbar},{id:"dayList",view:"dayevents"}]},{id:"month",rows:[{id:"calendar",view:"calendar",dayWithEvents:scheduler.templates.calendar_event,calendarHeader:scheduler.config.calendar_date},{id:"calendarDayEvents",view:"list",type:"DayEventsList"}]},{id:"event",animate:{type:"slide",subtype:"in",direction:"top"},rows:[{id:"eventBar",
view:"toolbar",type:"TopBar",css:"single_event",elements:scheduler.config.selected_toolbar},{id:"eventTemplate",view:"template",template:scheduler.templates.selected_event}]},{id:"form",rows:[{id:"editBar",view:"toolbar",type:"TopBar",elements:scheduler.config.form_toolbar},{id:"editForm",view:"form",elements:scheduler.config.form,rules:scheduler.config.form_rules}]}].concat(scheduler.config.views);dhx.protoUI({name:"scheduler",defaults:{rows:[{view:"multiview",id:"views",cells:a},{view:"toolbar",
id:"bottomBar",type:"SchedulerBar",visibleBatch:"default",elements:scheduler.config.bottom_toolbar}],color:"#color#",textColor:"#textColor#"},$init:function(){this.name="Scheduler";this.b.className+=" dhx_scheduler";dhx.i18n.dateFormat=scheduler.config.item_date;dhx.i18n.timeFormat=scheduler.config.hour_date;dhx.i18n.fullDateFormat=scheduler.config.xml_date;dhx.i18n.headerFormatStr=dhx.Date.dateToStr(scheduler.config.header_date);dhx.i18n.setLocale();this.data.provideApi(this);this.data.extraParser=
dhx.bind(function(a){a.start_date=dhx.i18n.fullDateFormatDate(a.start_date);a.end_date=dhx.i18n.fullDateFormatDate(a.end_date)},this);this.$ready.push(this.$d);this.data.attachEvent("onStoreUpdated",dhx.bind(this.Oe,this))},$d:function(){this.ae();this.de();this.coreData=new dhx.DataValue;this.coreData.setValue(scheduler.config.init_date);this.$$("dayList").define("date",this.coreData);this.selectedEvent=new dhx.DataRecord;this.config.readonly?this.define("readonly",this.config.readonly):scheduler.config.readonly&&
this.define("readonly",!0);if(this.config.save){var a=new dhx.DataProcessor({master:this,url:this.config.save});a.attachEvent("onBeforeDataSend",this.re)}this.$$("date")&&this.$$("date").bind(this.coreData,null,dhx.i18n.headerFormatStr);this.$$("list").sync(this);this.$$("list").bind(this.coreData,function(a,b){return b<a.end_date});this.$$("dayList").sync(this,!0);this.$$("dayList").bind(this.coreData,function(a,b){var e=dhx.Date.datePart(b);return e<a.end_date&&dhx.Date.add(e,1,"day")>a.start_date});
this.$$("calendar").bind(this.coreData);this.$$("calendarDayEvents").sync(this,!0);this.$$("calendarDayEvents").bind(this.coreData,function(a,b){var e=dhx.Date.datePart(b);return e<a.end_date&&dhx.Date.add(e,1,"day")>a.start_date});this.$$("eventTemplate").bind(this);this.$$("editForm").bind(this);this.$$("list").attachEvent("onItemClick",dhx.bind(this.Qb,this));this.$$("dayList").attachEvent("onItemClick",dhx.bind(this.Qb,this));this.$$("calendarDayEvents").attachEvent("onItemClick",dhx.bind(this.Qb,
this))},Qb:function(a){this.setCursor(a);this.$$("event").show()},Oe:function(){this.data.blockEvent();this.data.sort(function(a,b){return a.start_date<b.start_date?1:-1});this.data.unblockEvent();this.Gb={};for(var a=this.data.getRange(),c=0;c<a.length;c++)this.He(a[c])},He:function(a){var c=dhx.Date.datePart(a.start_date),d=dhx.Date.datePart(a.end_date);for(a.end_date.valueOf()!=d.valueOf()&&(d=dhx.Date.add(d,1,"day"));c<d;)this.Gb[c.valueOf()]=!0,c=dhx.Date.add(c,1,"day")},de:function(){this.$$("calendar").attachEvent("onDateSelect",
dhx.bind(function(a){this.setDate(a)},this));this.$$("calendar").attachEvent("onAfterMonthChange",dhx.bind(function(a){var b=new Date;a.getMonth()===b.getMonth()&&a.getYear()===b.getYear()?a=b:a.setDate(1);this.setDate(a)},this));var a=this.$$("calendar").config.calendarDay;this.$$("calendar").config.calendarDay=dhx.bind(function(c){var d=a(c);return this.Gb&&this.Gb[c.valueOf()]?this.$$("calendar").config.dayWithEvents(d):d},this)},setDate:function(a,c,d){a||(a=this.coreData.getValue());c&&(a=dhx.Date.add(a,
c,d));this.coreData.setValue(a)},ae:function(){this.attachEvent("onItemClick",function(a){var c=this.innerId(a);switch(c){case "today":this.setDate(new Date);break;case "add":if(this.innerId(this.$$("views").getActive())=="form"){var d=this;dhx.confirm({height:scheduler.xy.confirm_height,width:scheduler.xy.confirm_width,title:scheduler.locale.labels.icon_close,message:scheduler.locale.labels.confirm_closing,callback:function(a){a&&d.jc()},labelOk:scheduler.locale.labels.icon_yes,labelCancel:scheduler.locale.labels.icon_no,
css:"confirm"})}else this.jc();break;case "prev":this.setDate(null,-1,"day");break;case "next":this.setDate(null,1,"day");break;case "edit":this.$$("delete")&&this.$$("delete").show();this.define("editEvent",!0);this.$$("form").show();break;case "back":this.$$("views").back();break;case "cancel":this.callEvent("onAfterCursorChange",[this.getCursor()]);this.$$("views").back();break;case "save":if(this.$$("editForm").validate()){if(this.a.editEvent)this.$$("editForm").save();else{var e=this.$$("editForm").getValues();
e.id=dhx.uid();this.add(e);this.setCursor(e.id)}dhx.dp(this).save();this.setDate();this.$$("views").back()}break;case "delete":this.Rd()}});this.attachEvent("onAfterTabClick",function(a,c){this.$$(c).show()});this.attachEvent("onBeforeTabClick",function(a,c){return this.Jd(c)})},readonly_setter:function(a){this.$$("add")&&(a?(this.$$("bottomBar").showBatch("readonly"),this.$$("add").hide(),this.$$("edit").hide()):(this.$$("bottomBar").showBatch("default"),this.$$("add").show(),this.$$("edit").show()));
return a},$e:function(){this.dataCount()?this.b.className=this.b.className.replace(RegExp(this.type.cssNoEvents,"g"),""):this.b.className+=" "+this.type.cssNoEvents},Rd:function(){var a=this;dhx.confirm({height:scheduler.xy.confirm_height,width:scheduler.xy.confirm_width,title:scheduler.locale.labels.icon_delete,message:scheduler.locale.labels.confirm_deleting,callback:function(c){c&&(a.remove(a.getCursor()),a.$$("views").back(2))},labelOk:scheduler.locale.labels.icon_yes,labelCancel:scheduler.locale.labels.icon_no,
css:"confirm",header:!1})},jc:function(){this.$$("delete")&&this.$$("delete").hide();this.define("editEvent",!1);this.$$("form").show();var a=dhx.Date.add(new Date,1,"hour"),c=new Date(a.setMinutes(0)),d=dhx.Date.add(c,1,"hour");this.$$("editForm").clear();this.$$("editForm").setValues({start_date:c,end_date:d})},Jd:function(a){if(this.innerId(this.$$("views").getActive())=="form"){var c=this;a!="today"&&dhx.confirm({height:scheduler.xy.confirm_height,width:scheduler.xy.confirm_width,title:scheduler.locale.labels.icon_close,
message:scheduler.locale.labels.confirm_closing,callback:function(d){d&&(c.$$(a).show(),c.$$("buttons").setValue(a))},labelOk:scheduler.locale.labels.icon_yes,labelCancel:scheduler.locale.labels.icon_no,css:"confirm"});return!1}return!0},re:function(a){var c=a[0].data=dhx.copy(a[0].data);c.start_date=dhx.i18n.fullDateFormatStr(c.start_date);c.end_date=dhx.i18n.fullDateFormatStr(c.end_date)}},dhx.IdSpace,dhx.DataLoader,dhx.ui.layout,dhx.EventSystem,dhx.Settings)});
dhx.protoUI({name:"dayevents",defaults:{hourFormat:"%H",hourClock:12,firstHour:0,lastHour:24,timeScaleWidth:45,timeScaleHeight:30,scroll:!0,scaleBorder:1,eventOffset:5,width:"auto",date:new Date},$init:function(a){this.name="DayEvents";this.d.style.position="relative";this.data.provideApi(this,!0);this.data.attachEvent("onStoreUpdated",dhx.bind(this.render,this));this.attachEvent("onBeforeRender",function(){this.Be();this.type.color=this.config.color;this.type.textColor=this.config.textColor;this.De=
this.d.firstChild;this.we();if(window.scheduler)this.type.template=scheduler.templates.day_event});if(window.scheduler)a.hourFormat=scheduler.config.scale_hour,a.timeScaleWidth=scheduler.xy.scale_width,a.timeScaleHeight=scheduler.xy.scale_height*2},Be:function(){for(var a="<div></div>",b=this.config.firstHour;b<this.config.lastHour;b++)a+=this.hourScaleItem(b);this.d.innerHTML=a},ma:"dhx_l_id",on_click:{},hourScaleItem:function(a){var b=scheduler.config.hour_date.toLowerCase().indexOf("a")!=-1,c=
"00",d="30";b&&(a===0&&(c="AM"),a==12&&(c="PM"),a=(a+11)%12+1);this.config.hourFormat.indexOf("H")!=-1&&(a=dhx.math.toFixed(a));var e="",f=this.config.timeScaleWidth,g=this.config.timeScaleHeight,h=Math.floor(this.config.timeScaleWidth/2),i=Math.floor(g/2),j=i-this.config.scaleBorder,k=this.j-this.config.scaleBorder-this.config.timeScaleWidth;e+="<div style='width: 100%; height:"+g+"px;' class='dhx_dayevents_scale_item'>";e+="<div class='dhx_dayevents_scale_hour' style='width:"+h+"px; height:"+g+
"px;line-height:"+g+"px;'>"+a+"</div>";e+="<div class='dhx_dayevents_scale_minute'  style='width:"+h+"px'>";e+="<div class='dhx_dayevents_scale_top' style='width:"+h+"px;line-height:"+i+"px'>"+c+"</div>";e+="<div class='dhx_dayevents_scale_bottom' style='width:"+h+"px;line-height:"+j+"px'>"+d+"</div>";e+="</div>";e+="<div class='dhx_dayevents_scale_event'  style='width:"+k+"px'>";e+="<div class='dhx_dayevents_scale_top' style='height:"+i+"px;width:"+k+"px'></div>";e+="<div class='dhx_dayevents_scale_bottom' style='width: "+
k+"px;height:"+j+"px; '></div>";e+="</div>";e+="</div>";return e},type:{templateStart:dhx.Template("<div dhx_l_id='#id#' class='dhx_dayevents_event_item {common.templateCss()}' style='left:#$left#px;top:#$top#px;width:#$width#px;height:#$height#px;padding:{common.padding}px;overflow:hidden; background-color:{common.templateColor()} ;color:{common.templateTextColor()};'>"),template:scheduler.templates.day_event,templateEnd:dhx.Template("</div>"),templateCss:dhx.Template(""),templateColor:dhx.Template("#color#"),
templateTextColor:dhx.Template("#textColor#"),padding:2},we:function(){var a=this.data.getRange(),b=[],c,d,e,f,g;for(d=0;d<a.length;d++){c=a[d];for(c.$inner=!1;b.length&&b[b.length-1].end_date.valueOf()<=c.start_date.valueOf();)b.splice(b.length-1,1);g=!1;for(e=0;e<b.length;e++)if(b[e].end_date.valueOf()<=c.start_date.valueOf()){g=!0;c.$sorder=b[e].$sorder;b.splice(e,1);c.$inner=!0;break}if(b.length)b[b.length-1].$inner=!0;if(!g)if(b.length)if(b.length<=b[b.length-1].$sorder){if(b[b.length-1].$sorder)for(e=
0;e<b.length;e++){g=!1;for(f=0;f<b.length;f++)if(b[f].$sorder==e){g=!0;break}if(!g){c.$sorder=e;break}}else c.$sorder=0;c.$inner=!0}else{g=b[0].$sorder;for(e=1;e<b.length;e++)if(b[e].$sorder>g)g=b[e].$sorder;c.$sorder=g+1;c.$inner=!1}else c.$sorder=0;b.push(c);if(b.length>(b.max_count||0))b.max_count=b.length}for(d=0;d<a.length;d++)a[d].$count=b.max_count,this.cc(a[d])},cc:function(a){var b=this.config.date.getValue?this.config.date.getValue():this.config.date,c=dhx.Date.copy(a.start_date),d=dhx.Date.copy(a.end_date),
e=c.getHours(),f=d.getHours();dhx.Date.datePart(c).valueOf()>dhx.Date.datePart(d).valueOf()&&(d=c);dhx.Date.datePart(c).valueOf()<dhx.Date.datePart(b).valueOf()&&(c=dhx.Date.datePart(b));dhx.Date.datePart(d).valueOf()>dhx.Date.datePart(b).valueOf()&&(d=dhx.Date.datePart(b),d.setMinutes(0),d.setHours(this.config.lastHour));if(e<this.config.firstHour||f>=this.config.lastHour)e<this.config.firstHour&&(d.setHours(this.config.firstHour),a.start_date.setMinutes(0)),f>=this.config.lastHour&&(d.setMinutes(0),
d.setHours(this.config.lastHour));var g=Math.floor((this.j-this.config.timeScaleWidth-this.config.eventOffset-8)/a.$count);a.$left=a.$sorder*g+this.config.timeScaleWidth+this.config.eventOffset;a.$inner||(g*=a.$count-a.$sorder);a.$width=g-this.config.eventOffset-this.type.padding*2;var h=c.getHours()*60+c.getMinutes(),i=d.getHours()*60+d.getMinutes()||this.config.lastHour*60;a.$top=Math.round((h-this.config.firstHour/60)*(this.config.timeScaleHeight+1)/60);a.$height=Math.max(10,(i-h)*(this.config.timeScaleHeight+
1)/60-2)-this.type.padding*2}},dhx.MouseEvents,dhx.SelectionModel,dhx.Scrollable,dhx.RenderStack,dhx.DataLoader,dhx.ui.view,dhx.EventSystem,dhx.Settings);
