/* Product Name: dhtmlxSuite Version: 4.0.3 Edition: Professional License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com Copyright UAB Dinamenta http://www.dhtmlx.com */ if (typeof(window.dhx4) == "undefined") { window.dhx4 = { version: "4.0.3", skin: null, skinDetect: function(c) { var g = document.createElement("DIV"); g.className = c + "_skin_detect"; if (document.body.firstChild) { document.body.insertBefore(g, document.body.firstChild) } else { document.body.appendChild(g) } var a = g.offsetWidth; g.parentNode.removeChild(g); g = null; return { 10: "dhx_skyblue", 20: "dhx_web", 30: "dhx_terrace" }[a] || null }, lastId: 1, newId: function() { return this.lastId++ }, zim: { data: {}, step: 5, first: function() { return 100 }, last: function() { var g = this.first(); for (var c in this.data) { g = Math.max(g, this.data[c]) } return g }, reserve: function(a) { this.data[a] = this.last() + this.step; return this.data[a] }, clear: function(a) { if (this.data[a] != null) { this.data[a] = null; delete this.data[a] } } }, s2b: function(a) { return (a == true || a == 1 || a == "true" || a == "1" || a == "yes" || a == "y") }, trim: function(a) { return String(a).replace(/^\s{1,}/, "").replace(/\s{1,}$/, "") }, template: function(c, g, a) { return c.replace(/#([a-zA-Z0-9_-]{1,})#/g, function(l, h) { if (h.length > 0 && typeof(g[h]) != "undefined") { if (a == true) { return window.dhx4.trim(g[h]) } return String(g[h]) } return "" }) }, absLeft: function(a) { if (typeof(a) == "string") { a = document.getElementById(a) } return this._aOfs(a).left }, absTop: function(a) { if (typeof(a) == "string") { a = document.getElementById(a) } return this._aOfs(a).top }, _aOfsSum: function(a) { var g = 0, c = 0; while (a) { g = g + parseInt(a.offsetTop); c = c + parseInt(a.offsetLeft); a = a.offsetParent } return { top: g, left: c } }, _aOfsRect: function(h) { var n = h.getBoundingClientRect(); var o = document.body; var c = document.documentElement; var a = window.pageYOffset || c.scrollTop || o.scrollTop; var l = window.pageXOffset || c.scrollLeft || o.scrollLeft; var m = c.clientTop || o.clientTop || 0; var q = c.clientLeft || o.clientLeft || 0; var r = n.top + a - m; var g = n.left + l - q; return { top: Math.round(r), left: Math.round(g) } }, _aOfs: function(a) { if (a.getBoundingClientRect) { return this._aOfsRect(a) } else { return this._aOfsSum(a) } }, _isObj: function(a) { return (a != null && typeof(a) == "object" && typeof(a.length) == "undefined") }, _copyObj: function(h) { if (this._isObj(h)) { var g = {}; for (var c in h) { if (typeof(h[c]) == "object" && h[c] != null) { g[c] = this._copyObj(h[c]) } else { g[c] = h[c] } } } else { var g = []; for (var c = 0; c < h.length; c++) { if (typeof(h[c]) == "object" && h[c] != null) { g[c] = this._copyObj(h[c]) } else { g[c] = h[c] } } } return g }, screenDim: function() { var a = (navigator.userAgent.indexOf("MSIE") >= 0); var c = {}; c.left = document.body.scrollLeft; c.right = c.left + (window.innerWidth || document.body.clientWidth); c.top = Math.max((a ? document.documentElement : document.getElementsByTagName("html")[0]).scrollTop, document.body.scrollTop); c.bottom = c.top + (a ? Math.max(document.documentElement.clientHeight || 0, document.documentElement.offsetHeight || 0) : window.innerHeight); return c }, selectTextRange: function(h, m, c) { h = (typeof(h) == "string" ? document.getElementById(h) : h); var a = h.value.length; m = Math.max(Math.min(m, a), 0); c = Math.min(c, a); if (h.setSelectionRange) { try { h.setSelectionRange(m, c) } catch (l) {} } else { if (h.createTextRange) { var g = h.createTextRange(); g.moveStart("character", m); g.moveEnd("character", c - a); try { g.select() } catch (l) {} } } }, transData: null, transDetect: function() { if (this.transData == null) { this.transData = { transProp: false, transEv: null }; var g = { MozTransition: "transitionend", WebkitTransition: "webkitTransitionEnd", OTransition: "oTransitionEnd", msTransition: "transitionend", transition: "transitionend" }; for (var c in g) { if (this.transData.transProp == false && document.documentElement.style[c] != null) { this.transData.transProp = c; this.transData.transEv = g[c] } } g = null } return this.transData } }; window.dhx4.isIE = (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0); window.dhx4.isIE6 = (window.XMLHttpRequest == null && navigator.userAgent.indexOf("MSIE") >= 0); window.dhx4.isIE7 = (navigator.userAgent.indexOf("MSIE 7.0") >= 0 && navigator.userAgent.indexOf("Trident") < 0); window.dhx4.isOpera = (navigator.userAgent.indexOf("Opera") >= 0); window.dhx4.isChrome = (navigator.userAgent.indexOf("Chrome") >= 0); window.dhx4.isKHTML = (navigator.userAgent.indexOf("Safari") >= 0 || navigator.userAgent.indexOf("Konqueror") >= 0); window.dhx4.isFF = (navigator.userAgent.indexOf("Firefox") >= 0); window.dhx4.isIPad = (navigator.userAgent.search(/iPad/gi) >= 0) } if (typeof(window.dhx4.ajax) == "undefined") { window.dhx4.ajax = { cache: false, method: "post", get: function(a, c) { this._call("GET", a, null, true, c) }, getSync: function(a) { return this._call("GET", a, null, false) }, post: function(c, a, g) { if (arguments.length == 1) { a = "" } else { if (arguments.length == 2 && (typeof(a) == "function" || typeof(window[a]) == "function")) { g = a; a = "" } else { a = String(a) } } this._call("POST", c, a, true, g) }, postSync: function(c, a) { a = (a == null ? "" : String(a)); return this._call("POST", c, a, false) }, getLong: function(a, c) { this._call("GET", a, null, true, c, { url: a }) }, postLong: function(c, a, g) { if (arguments.length == 2 && (typeof(a) == "function" || typeof(window[a]))) { g = a; a = "" } this._call("POST", c, a, true, g, { url: c, postData: a }) }, _call: function(o, c, a, m, l, h) { var g = (window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP")); var n = (navigator.userAgent.match(/AppleWebKit/) != null && navigator.userAgent.match(/Qt/) != null && navigator.userAgent.match(/Safari/) != null); if (m == true) { g.onreadystatechange = function() { if ((g.readyState == 4 && g.status == 200) || (n == true && g.readyState == 3)) { window.setTimeout(function() { if (typeof(l) == "function") { l.apply(window, [{ xmlDoc: g }]) } if (h != null) { if (typeof(h.postData) != "undefined") { dhx4.ajax.postLong(h.url, h.postData, l) } else { dhx4.ajax.getLong(h.url, l) } } l = null; g = null }, 1) } } } if (o == "GET" && this.cache != true) { c += (c.indexOf("?") >= 0 ? "&" : "?") + "dhxr" + new Date().getTime() } g.open(o, c, m); if (o == "POST") { g.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); if (this.cache != true) { a += (a.length > 0 ? "&" : "") + "dhxr" + new Date().getTime() } } else { a = null } g.setRequestHeader("X-Requested-With", "XMLHttpRequest"); g.send(a); if (!m) { return { xmlDoc: g } } } } } if (typeof(window.dhx4._enableDataLoading) == "undefined") { window.dhx4._enableDataLoading = function(obj, initObj, xmlToJson, xmlRootTag, mode) { if (mode == "clear") { for (var a in obj._dhxdataload) { obj._dhxdataload[a] = null; delete obj._dhxdataload[a] } obj._loadData = null; obj._dhxdataload = null; obj.load = null; obj.loadStruct = null; obj = null; return } obj._dhxdataload = { initObj: initObj, xmlToJson: xmlToJson, xmlRootTag: xmlRootTag, onBeforeXLS: null }; obj._loadData = function(data, loadParams, onLoad) { if (arguments.length == 2) { onLoad = loadParams; loadParams = null } var obj = null; if (arguments.length == 3) { onLoad = arguments[2] } if (typeof(data) == "string") { var k = data.replace(/^\s{1,}/, "").replace(/\s{1,}$/, ""); var tag = new RegExp("^<" + this._dhxdataload.xmlRootTag); if (tag.test(k.replace(/^<\?xml[^\?]*\?>\s*/, ""))) { if (window.DOMParser) { obj = (new window.DOMParser()).parseFromString(data, "text/xml") } else { if (typeof(window.ActiveXObject) != "undefined") { obj = new window.ActiveXObject("Microsoft.XMLDOM"); obj.async = "false"; obj.loadXML(data) } } if (obj != null) { obj = this[this._dhxdataload.xmlToJson].apply(this, [obj]) } } if (obj == null && (k.match(/^\{.*\}$/) != null || k.match(/^\[.*\]$/) != null)) { try { eval("dhx4.temp=" + k) } catch (e) { dhx4.temp = null } obj = dhx4.temp; dhx4.temp = null } if (obj == null) { this.callEvent("onXLS", []); var params = []; if (typeof(this._dhxdataload.onBeforeXLS) == "function") { var k = this._dhxdataload.onBeforeXLS.apply(this, [data]); if (k != null && typeof(k) == "object") { if (k.url != null) { data = k.url } if (k.params != null) { for (var a in k.params) { params.push(a + "=" + encodeURIComponent(k.params[a])) } } } } var t = this; var callBack = function(r) { var obj = null; if ((r.xmlDoc.getResponseHeader("Content-Type") || "").search(/xml/gi) >= 0 || (r.xmlDoc.responseText.replace(/^\s{1,}/, "")).match(/^) != null) { obj = t[t._dhxdataload.xmlToJson].apply(t, [r.xmlDoc.responseXML]) } else { try { eval("dhx4.temp=" + r.xmlDoc.responseText) } catch (e) { dhx4.temp = null } obj = dhx4.temp; dhx4.temp = null } if (obj != null) { t[t._dhxdataload.initObj].apply(t, [obj, data]) } t.callEvent("onXLE", []); if (onLoad != null) { if (typeof(onLoad) == "function") { onLoad.apply(t, []) } else { if (typeof(window[onLoad]) == "function") { window[onLoad].apply(t, []) } } } callBack = onLoad = null; obj = r = t = null }; params = params.join("&") + (typeof(loadParams) == "string" ? "&" + loadParams : ""); if (dhx4.ajax.method == "post") { dhx4.ajax.post(data, params, callBack) } else { if (dhx4.ajax.method == "get") { dhx4.ajax.get(data + (data.indexOf("?") > 0 ? "" : "") + params, callBack) } } return } } else { if (typeof(data.documentElement) == "object" || (typeof(data.tagName) != "undefined" && typeof(data.getElementsByTagName) != "undefined" && data.getElementsByTagName(this._dhxdataload.xmlRootTag).length > 0)) { obj = this[this._dhxdataload.xmlToJson].apply(this, [data]) } else { obj = window.dhx4._copyObj(data) } } if (obj != null) { this[this._dhxdataload.initObj].apply(this, [obj]) } if (onLoad != null) { if (typeof(onLoad) == "function") { onLoad.apply(this, []) } else { if (typeof(window[onLoad]) == "function") { window[onLoad].apply(this, []) } } onLoad = null } }; if (mode != null) { var k = { struct: "loadStruct", data: "load" }; for (var a in mode) { if (mode[a] == true) { obj[k[a]] = function() { return this._loadData.apply(this, arguments) } } } } obj = null } } if (typeof(window.dhx4._eventable) == "undefined") { window.dhx4._eventable = function(a, c) { if (c == "clear") { a.detachAllEvents(); a.dhxevs = null; a.attachEvent = null; a.detachEvent = null; a.checkEvent = null; a.callEvent = null; a.detachAllEvents = null; a = null; return } a.dhxevs = { data: {} }; a.attachEvent = function(g, l) { g = String(g).toLowerCase(); if (!this.dhxevs.data[g]) { this.dhxevs.data[g] = {} } var h = window.dhx4.newId(); this.dhxevs.data[g][h] = l; return h }; a.detachEvent = function(m) { for (var h in this.dhxevs.data) { var l = 0; for (var g in this.dhxevs.data[h]) { if (g == m) { this.dhxevs.data[h][g] = null; delete this.dhxevs.data[h][g] } else { l++ } } if (l == 0) { this.dhxevs.data[h] = null; delete this.dhxevs.data[h] } } }; a.checkEvent = function(g) { g = String(g).toLowerCase(); return (this.dhxevs.data[g] != null) }; a.callEvent = function(h, m) { h = String(h).toLowerCase(); if (this.dhxevs.data[h] == null) { return true } var l = true; for (var g in this.dhxevs.data[h]) { l = this.dhxevs.data[h][g].apply(this, m) && l } return l }; a.detachAllEvents = function() { for (var h in this.dhxevs.data) { for (var g in this.dhxevs.data[h]) { this.dhxevs.data[h][g] = null; delete this.dhxevs.data[h][g] } this.dhxevs.data[h] = null; delete this.dhxevs.data[h] } }; a = null } } dhtmlx = function(g) { for (var c in g) { dhtmlx[c] = g[c] } return dhtmlx }; dhtmlx.extend_api = function(a, h, g) { var c = window[a]; if (!c) { return } window[a] = function(n) { if (n && typeof n == "object" && !n.tagName) { var m = c.apply(this, (h._init ? h._init(n) : arguments)); for (var l in dhtmlx) { if (h[l]) { this[h[l]](dhtmlx[l]) } } for (var l in n) { if (h[l]) { this[h[l]](n[l]) } else { if (l.indexOf("on") == 0) { this.attachEvent(l, n[l]) } } } } else { var m = c.apply(this, arguments) } if (h._patch) { h._patch(this) } return m || this }; window[a].prototype = c.prototype; if (g) { dhtmlXHeir(window[a].prototype, g) } }; dhtmlxAjax = { get: function(a, g) { var c = new dtmlXMLLoaderObject(true); c.async = (arguments.length < 3); c.waitCall = g; c.loadXML(a); return c }, post: function(a, g, h) { var c = new dtmlXMLLoaderObject(true); c.async = (arguments.length < 4); c.waitCall = h; c.loadXML(a, true, g); return c }, getSync: function(a) { return this.get(a, null, true) }, postSync: function(a, c) { return this.post(a, c, null, true) } }; function dtmlXMLLoaderObject(c, h, g, a) { this.xmlDoc = ""; if (typeof(g) != "undefined") { this.async = g } else { this.async = true } this.onloadAction = c || null; this.mainObject = h || null; this.waitCall = null; this.rSeed = a || false; return this } dtmlXMLLoaderObject.count = 0; dtmlXMLLoaderObject.prototype.waitLoadFunction = function(c) { var a = true; this.check = function() { if ((c) && (c.onloadAction != null)) { if ((!c.xmlDoc.readyState) || (c.xmlDoc.readyState == 4)) { if (!a) { return } a = false; dtmlXMLLoaderObject.count++; if (typeof c.onloadAction == "function") { c.onloadAction(c.mainObject, null, null, null, c) } if (c.waitCall) { c.waitCall.call(this, c); c.waitCall = null } } } }; return this.check }; dtmlXMLLoaderObject.prototype.getXMLTopNode = function(g, a) { if (typeof this.xmlDoc.status == "undefined" || this.xmlDoc.status < 400) { if (this.xmlDoc.responseXML) { var c = this.xmlDoc.responseXML.getElementsByTagName(g); if (c.length == 0 && g.indexOf(":") != -1) { var c = this.xmlDoc.responseXML.getElementsByTagName((g.split(":"))[1]) } var h = c[0] } else { var h = this.xmlDoc.documentElement } if (h) { this._retry = false; return h } if (!this._retry && _isIE) { this._retry = true; var a = this.xmlDoc; this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/, ""), true); return this.getXMLTopNode(g, a) } } dhtmlxError.throwError("LoadXML", "Incorrect XML", [(a || this.xmlDoc), this.mainObject]); return document.createElement("DIV") }; dtmlXMLLoaderObject.prototype.loadXMLString = function(c, a) { if (!_isIE) { var g = new DOMParser(); this.xmlDoc = g.parseFromString(c, "text/xml") } else { this.xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); this.xmlDoc.async = this.async; this.xmlDoc.onreadystatechange = function() {}; this.xmlDoc.loadXML(c) } if (a) { return } if (this.onloadAction) { this.onloadAction(this.mainObject, null, null, null, this) } if (this.waitCall) { this.waitCall(); this.waitCall = null } }; dtmlXMLLoaderObject.prototype.loadXML = function(g, c, a, h) { if (this.rSeed) { g += ((g.indexOf("?") != -1) ? "&" : "?") + "a_dhx_rSeed=" + (new Date()).valueOf() } this.filePath = g; if ((!_isIE) && (window.XMLHttpRequest)) { this.xmlDoc = new XMLHttpRequest() } else { this.xmlDoc = new ActiveXObject("Microsoft.XMLHTTP") } if (this.async) { this.xmlDoc.onreadystatechange = new this.waitLoadFunction(this) } this.xmlDoc.open(c ? "POST" : "GET", g, this.async); if (h) { this.xmlDoc.setRequestHeader("User-Agent", "dhtmlxRPC v0.1 (" + navigator.userAgent + ")"); this.xmlDoc.setRequestHeader("Content-type", "text/xml") } else { if (c) { this.xmlDoc.setRequestHeader("Content-type", (this.contenttype || "application/x-www-form-urlencoded")) } } this.xmlDoc.setRequestHeader("X-Requested-With", "XMLHttpRequest"); this.xmlDoc.send(null || a); if (!this.async) { (new this.waitLoadFunction(this))() } }; dtmlXMLLoaderObject.prototype.destructor = function() { this._filterXPath = null; this._getAllNamedChilds = null; this._retry = null; this.async = null; this.rSeed = null; this.filePath = null; this.onloadAction = null; this.mainObject = null; this.xmlDoc = null; this.doXPath = null; this.doXPathOpera = null; this.doXSLTransToObject = null; this.doXSLTransToString = null; this.loadXML = null; this.loadXMLString = null; this.doSerialization = null; this.xmlNodeToJSON = null; this.getXMLTopNode = null; this.setXSLParamValue = null; return null }; dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function(h) { var g = {}; for (var c = 0; c < h.attributes.length; c++) { g[h.attributes[c].name] = h.attributes[c].value } g._tagvalue = h.firstChild ? h.firstChild.nodeValue : ""; for (var c = 0; c < h.childNodes.length; c++) { var a = h.childNodes[c].tagName; if (a) { if (!g[a]) { g[a] = [] } g[a].push(this.xmlNodeToJSON(h.childNodes[c])) } } return g }; function callerFunction(a, c) { this.handler = function(g) { if (!g) { g = window.event } a(g, c); return true }; return this.handler } function getAbsoluteLeft(a) { return getOffset(a).left } function getAbsoluteTop(a) { return getOffset(a).top } function getOffsetSum(a) { var g = 0, c = 0; while (a) { g = g + parseInt(a.offsetTop); c = c + parseInt(a.offsetLeft); a = a.offsetParent } return { top: g, left: c } } function getOffsetRect(h) { var n = h.getBoundingClientRect(); var o = document.body; var c = document.documentElement; var a = window.pageYOffset || c.scrollTop || o.scrollTop; var l = window.pageXOffset || c.scrollLeft || o.scrollLeft; var m = c.clientTop || o.clientTop || 0; var q = c.clientLeft || o.clientLeft || 0; var r = n.top + a - m; var g = n.left + l - q; return { top: Math.round(r), left: Math.round(g) } } function getOffset(a) { if (a.getBoundingClientRect) { return getOffsetRect(a) } else { return getOffsetSum(a) } } function convertStringToBoolean(a) { if (typeof(a) == "string") { a = a.toLowerCase() } switch (a) { case "1": case "true": case "yes": case "y": case 1: case true: return true; break; default: return false } } function getUrlSymbol(a) { if (a.indexOf("?") != -1) { return "&" } else { return "?" } } function dhtmlDragAndDropObject() { if (window.dhtmlDragAndDrop) { return window.dhtmlDragAndDrop } this.lastLanding = 0; this.dragNode = 0; this.dragStartNode = 0; this.dragStartObject = 0; this.tempDOMU = null; this.tempDOMM = null; this.waitDrag = 0; window.dhtmlDragAndDrop = this; return this } dhtmlDragAndDropObject.prototype.removeDraggableItem = function(a) { a.onmousedown = null; a.dragStarter = null; a.dragLanding = null }; dhtmlDragAndDropObject.prototype.addDraggableItem = function(a, c) { a.onmousedown = this.preCreateDragCopy; a.dragStarter = c; this.addDragLanding(a, c) }; dhtmlDragAndDropObject.prototype.addDragLanding = function(a, c) { a.dragLanding = c }; dhtmlDragAndDropObject.prototype.preCreateDragCopy = function(a) { if ((a || window.event) && (a || event).button == 2) { return } if (window.dhtmlDragAndDrop.waitDrag) { window.dhtmlDragAndDrop.waitDrag = 0; document.body.onmouseup = window.dhtmlDragAndDrop.tempDOMU; document.body.onmousemove = window.dhtmlDragAndDrop.tempDOMM; return false } if (window.dhtmlDragAndDrop.dragNode) { window.dhtmlDragAndDrop.stopDrag(a) } window.dhtmlDragAndDrop.waitDrag = 1; window.dhtmlDragAndDrop.tempDOMU = document.body.onmouseup; window.dhtmlDragAndDrop.tempDOMM = document.body.onmousemove; window.dhtmlDragAndDrop.dragStartNode = this; window.dhtmlDragAndDrop.dragStartObject = this.dragStarter; document.body.onmouseup = window.dhtmlDragAndDrop.preCreateDragCopy; document.body.onmousemove = window.dhtmlDragAndDrop.callDrag; window.dhtmlDragAndDrop.downtime = new Date().valueOf(); if ((a) && (a.preventDefault)) { a.preventDefault(); return false } return false }; dhtmlDragAndDropObject.prototype.callDrag = function(g) { if (!g) { g = window.event } dragger = window.dhtmlDragAndDrop; if ((new Date()).valueOf() - dragger.downtime < 100) { return } if (!dragger.dragNode) { if (dragger.waitDrag) { dragger.dragNode = dragger.dragStartObject._createDragNode(dragger.dragStartNode, g); if (!dragger.dragNode) { return dragger.stopDrag() } dragger.dragNode.onselectstart = function() { return false }; dragger.gldragNode = dragger.dragNode; document.body.appendChild(dragger.dragNode); document.body.onmouseup = dragger.stopDrag; dragger.waitDrag = 0; dragger.dragNode.pWindow = window; dragger.initFrameRoute() } else { return dragger.stopDrag(g, true) } } if (dragger.dragNode.parentNode != window.document.body && dragger.gldragNode) { var a = dragger.gldragNode; if (dragger.gldragNode.old) { a = dragger.gldragNode.old } a.parentNode.removeChild(a); var c = dragger.dragNode.pWindow; if (a.pWindow && a.pWindow.dhtmlDragAndDrop.lastLanding) { a.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(a.pWindow.dhtmlDragAndDrop.lastLanding) } if (_isIE) { var l = document.createElement("Div"); l.innerHTML = dragger.dragNode.outerHTML; dragger.dragNode = l.childNodes[0] } else { dragger.dragNode = dragger.dragNode.cloneNode(true) } dragger.dragNode.pWindow = window; dragger.gldragNode.old = dragger.dragNode; document.body.appendChild(dragger.dragNode); c.dhtmlDragAndDrop.dragNode = dragger.dragNode } dragger.dragNode.style.left = g.clientX + 15 + (dragger.fx ? dragger.fx * (-1) : 0) + (document.body.scrollLeft || document.documentElement.scrollLeft) + "px"; dragger.dragNode.style.top = g.clientY + 3 + (dragger.fy ? dragger.fy * (-1) : 0) + (document.body.scrollTop || document.documentElement.scrollTop) + "px"; if (!g.srcElement) { var h = g.target } else { h = g.srcElement } dragger.checkLanding(h, g) }; dhtmlDragAndDropObject.prototype.calculateFramePosition = function(l) { if (window.name) { var g = parent.frames[window.name].frameElement.offsetParent; var h = 0; var c = 0; while (g) { h += g.offsetLeft; c += g.offsetTop; g = g.offsetParent } if ((parent.dhtmlDragAndDrop)) { var a = parent.dhtmlDragAndDrop.calculateFramePosition(1); h += a.split("_")[0] * 1; c += a.split("_")[1] * 1 } if (l) { return h + "_" + c } else { this.fx = h } this.fy = c } return "0_0" }; dhtmlDragAndDropObject.prototype.checkLanding = function(c, a) { if ((c) && (c.dragLanding)) { if (this.lastLanding) { this.lastLanding.dragLanding._dragOut(this.lastLanding) } this.lastLanding = c; this.lastLanding = this.lastLanding.dragLanding._dragIn(this.lastLanding, this.dragStartNode, a.clientX, a.clientY, a); this.lastLanding_scr = (_isIE ? a.srcElement : a.target) } else { if ((c) && (c.tagName != "BODY")) { this.checkLanding(c.parentNode, a) } else { if (this.lastLanding) { this.lastLanding.dragLanding._dragOut(this.lastLanding, a.clientX, a.clientY, a) } this.lastLanding = 0; if (this._onNotFound) { this._onNotFound() } } } }; dhtmlDragAndDropObject.prototype.stopDrag = function(c, g) { dragger = window.dhtmlDragAndDrop; if (!g) { dragger.stopFrameRoute(); var a = dragger.lastLanding; dragger.lastLanding = null; if (a) { a.dragLanding._drag(dragger.dragStartNode, dragger.dragStartObject, a, (_isIE ? event.srcElement : c.target)) } } dragger.lastLanding = null; if ((dragger.dragNode) && (dragger.dragNode.parentNode == document.body)) { dragger.dragNode.parentNode.removeChild(dragger.dragNode) } dragger.dragNode = 0; dragger.gldragNode = 0; dragger.fx = 0; dragger.fy = 0; dragger.dragStartNode = 0; dragger.dragStartObject = 0; document.body.onmouseup = dragger.tempDOMU; document.body.onmousemove = dragger.tempDOMM; dragger.tempDOMU = null; dragger.tempDOMM = null; dragger.waitDrag = 0 }; dhtmlDragAndDropObject.prototype.stopFrameRoute = function(g) { if (g) { window.dhtmlDragAndDrop.stopDrag(1, 1) } for (var a = 0; a < window.frames.length; a++) { try { if ((window.frames[a] != g) && (window.frames[a].dhtmlDragAndDrop)) { window.frames[a].dhtmlDragAndDrop.stopFrameRoute(window) } } catch (c) {} } try { if ((parent.dhtmlDragAndDrop) && (parent != window) && (parent != g)) { parent.dhtmlDragAndDrop.stopFrameRoute(window) } } catch (c) {} }; dhtmlDragAndDropObject.prototype.initFrameRoute = function(g, h) { if (g) { window.dhtmlDragAndDrop.preCreateDragCopy(); window.dhtmlDragAndDrop.dragStartNode = g.dhtmlDragAndDrop.dragStartNode; window.dhtmlDragAndDrop.dragStartObject = g.dhtmlDragAndDrop.dragStartObject; window.dhtmlDragAndDrop.dragNode = g.dhtmlDragAndDrop.dragNode; window.dhtmlDragAndDrop.gldragNode = g.dhtmlDragAndDrop.dragNode; window.document.body.onmouseup = window.dhtmlDragAndDrop.stopDrag; window.waitDrag = 0; if (((!_isIE) && (h)) && ((!_isFF) || (_FFrv < 1.8))) { window.dhtmlDragAndDrop.calculateFramePosition() } } try { if ((parent.dhtmlDragAndDrop) && (parent != window) && (parent != g)) { parent.dhtmlDragAndDrop.initFrameRoute(window) } } catch (c) {} for (var a = 0; a < window.frames.length; a++) { try { if ((window.frames[a] != g) && (window.frames[a].dhtmlDragAndDrop)) { window.frames[a].dhtmlDragAndDrop.initFrameRoute(window, ((!g || h) ? 1 : 0)) } } catch (c) {} } }; _isFF = false; _isIE = false; _isOpera = false; _isKHTML = false; _isMacOS = false; _isChrome = false; _FFrv = false; _KHTMLrv = false; _OperaRv = false; if (navigator.userAgent.indexOf("Macintosh") != -1) { _isMacOS = true } if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1) { _isChrome = true } if ((navigator.userAgent.indexOf("Safari") != -1) || (navigator.userAgent.indexOf("Konqueror") != -1)) { _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari") + 7, 5)); if (_KHTMLrv > 525) { _isFF = true; _FFrv = 1.9 } else { _isKHTML = true } } else { if (navigator.userAgent.indexOf("Opera") != -1) { _isOpera = true; _OperaRv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera") + 6, 3)) } else { if (navigator.appName.indexOf("Microsoft") != -1) { _isIE = true; if ((navigator.appVersion.indexOf("MSIE 8.0") != -1 || navigator.appVersion.indexOf("MSIE 9.0") != -1 || navigator.appVersion.indexOf("MSIE 10.0") != -1 || document.documentMode > 7) && document.compatMode != "BackCompat") { _isIE = 8 } } else { if (navigator.appName == "Netscape" && navigator.userAgent.indexOf("Trident") != -1) { _isIE = 8 } else { _isFF = true; _FFrv = parseFloat(navigator.userAgent.split("rv:")[1]) } } } } dtmlXMLLoaderObject.prototype.doXPath = function(g, l, h, q) { if (_isKHTML || (!_isIE && !window.XPathResult)) { return this.doXPathOpera(g, l) } if (_isIE) { if (!l) { if (!this.xmlDoc.nodeName) { l = this.xmlDoc.responseXML } else { l = this.xmlDoc } } if (!l) { dhtmlxError.throwError("LoadXML", "Incorrect XML", [(l || this.xmlDoc), this.mainObject]) } if (h != null) { l.setProperty("SelectionNamespaces", "xmlns:xsl='" + h + "'") } if (q == "single") { return l.selectSingleNode(g) } else { return l.selectNodes(g) || new Array(0) } } else { var a = l; if (!l) { if (!this.xmlDoc.nodeName) { l = this.xmlDoc.responseXML } else { l = this.xmlDoc } } if (!l) { dhtmlxError.throwError("LoadXML", "Incorrect XML", [(l || this.xmlDoc), this.mainObject]) } if (l.nodeName.indexOf("document") != -1) { a = l } else { a = l; l = l.ownerDocument } var n = XPathResult.ANY_TYPE; if (q == "single") { n = XPathResult.FIRST_ORDERED_NODE_TYPE } var m = new Array(); var c = l.evaluate(g, a, function(r) { return h }, n, null); if (n == XPathResult.FIRST_ORDERED_NODE_TYPE) { return c.singleNodeValue } var o = c.iterateNext(); while (o) { m[m.length] = o; o = c.iterateNext() } return m } }; function _dhtmlxError(c, a, g) { if (!this.catches) { this.catches = new Array() } return this } _dhtmlxError.prototype.catchError = function(c, a) { this.catches[c] = a }; _dhtmlxError.prototype.throwError = function(c, a, g) { if (this.catches[c]) { return this.catches[c](c, a, g) } if (this.catches.ALL) { return this.catches.ALL(c, a, g) } alert("Error type: " + arguments[0] + "\nDescription: " + arguments[1]); return null }; window.dhtmlxError = new _dhtmlxError(); dtmlXMLLoaderObject.prototype.doXPathOpera = function(g, a) { var l = g.replace(/[\/]+/gi, "/").split("/"); var h = null; var c = 1; if (!l.length) { return [] } if (l[0] == ".") { h = [a] } else { if (l[0] == "") { h = (this.xmlDoc.responseXML || this.xmlDoc).getElementsByTagName(l[c].replace(/\[[^\]]*\]/g, "")); c++ } else { return [] } } for (c; c < l.length; c++) { h = this._getAllNamedChilds(h, l[c]) } if (l[c - 1].indexOf("[") != -1) { h = this._filterXPath(h, l[c - 1]) } return h }; dtmlXMLLoaderObject.prototype._filterXPath = function(h, g) { var m = new Array(); var g = g.replace(/[^\[]*\[\@/g, "").replace(/[\[\]\@]*/g, ""); for (var l = 0; l < h.length; l++) { if (h[l].getAttribute(g)) { m[m.length] = h[l] } } return m }; dtmlXMLLoaderObject.prototype._getAllNamedChilds = function(h, g) { var n = new Array(); if (_isKHTML) { g = g.toUpperCase() } for (var m = 0; m < h.length; m++) { for (var l = 0; l < h[m].childNodes.length; l++) { if (_isKHTML) { if (h[m].childNodes[l].tagName && h[m].childNodes[l].tagName.toUpperCase() == g) { n[n.length] = h[m].childNodes[l] } } else { if (h[m].childNodes[l].tagName == g) { n[n.length] = h[m].childNodes[l] } } } } return n }; function dhtmlXHeir(h, g) { for (var l in g) { if (typeof(g[l]) == "function") { h[l] = g[l] } } return h } function dhtmlxEvent(c, g, a) { if (c.addEventListener) { c.addEventListener(g, a, false) } else { if (c.attachEvent) { c.attachEvent("on" + g, a) } } } dtmlXMLLoaderObject.prototype.xslDoc = null; dtmlXMLLoaderObject.prototype.setXSLParamValue = function(c, g, h) { if (!h) { h = this.xslDoc } if (h.responseXML) { h = h.responseXML } var a = this.doXPath("/xsl:stylesheet/xsl:variable[@name='" + c + "']", h, "http://www.w3.org/1999/XSL/Transform", "single"); if (a != null) { a.firstChild.nodeValue = g } }; dtmlXMLLoaderObject.prototype.doXSLTransToObject = function(h, c) { if (!h) { h = this.xslDoc } if (h.responseXML) { h = h.responseXML } if (!c) { c = this.xmlDoc } if (c.responseXML) { c = c.responseXML } if (!_isIE) { if (!this.XSLProcessor) { this.XSLProcessor = new XSLTProcessor(); this.XSLProcessor.importStylesheet(h) } var a = this.XSLProcessor.transformToDocument(c) } else { var a = new ActiveXObject("Msxml2.DOMDocument.3.0"); try { c.transformNodeToObject(h, a) } catch (g) { a = c.transformNode(h) } } return a }; dtmlXMLLoaderObject.prototype.doXSLTransToString = function(g, c) { var a = this.doXSLTransToObject(g, c); if (typeof(a) == "string") { return a } return this.doSerialization(a) }; dtmlXMLLoaderObject.prototype.doSerialization = function(c) { if (!c) { c = this.xmlDoc } if (c.responseXML) { c = c.responseXML } if (!_isIE) { var a = new XMLSerializer(); return a.serializeToString(c) } else { return c.xml } }; dhtmlxEventable = function(obj) { obj.attachEvent = function(name, catcher, callObj) { name = "ev_" + name.toLowerCase(); if (!this[name]) { this[name] = new this.eventCatcher(callObj || this) } return (name + ":" + this[name].addEvent(catcher)) }; obj.callEvent = function(name, arg0) { name = "ev_" + name.toLowerCase(); if (this[name]) { return this[name].apply(this, arg0) } return true }; obj.checkEvent = function(name) { return ( !! this["ev_" + name.toLowerCase()]) }; obj.eventCatcher = function(obj) { var dhx_catch = []; var z = function() { var res = true; for (var i = 0; i < dhx_catch.length; i++) { if (dhx_catch[i] != null) { var zr = dhx_catch[i].apply(obj, arguments); res = res && zr } } return res }; z.addEvent = function(ev) { if (typeof(ev) != "function") { ev = eval(ev) } if (ev) { return dhx_catch.push(ev) - 1 } return false }; z.removeEvent = function(id) { dhx_catch[id] = null }; return z }; obj.detachEvent = function(id) { if (id != false) { var list = id.split(":"); this[list[0]].removeEvent(list[1]) } }; obj.detachAllEvents = function() { for (var name in this) { if (name.indexOf("ev_") == 0) { this.detachEvent(name); this[name] = null } } }; obj = null }; if (!window.dhtmlx) { dhtmlx = {} } dhtmlx.assert = function(c, a) { if (!c) { dhtmlx.error(a) } }; dhtmlx.assert_enabled = function() { return false }; dhtmlx.assert_event = function(m, g) { if (!m._event_check) { m._event_check = {}; m._event_check_size = {} } for (var c in g) { m._event_check[c.toLowerCase()] = g[c]; var l = -1; for (var h in g[c]) { l++ } m._event_check_size[c.toLowerCase()] = l } }; dhtmlx.assert_method_info = function(l, c, h, m) { var a = []; for (var g = 0; g < m.length; g++) { a.push(m[g][0] + " : " + m[g][1] + "\n " + m[g][2].describe() + (m[g][3] ? "; optional" : "")) } return l.name + "." + c + "\n" + h + "\n Arguments:\n - " + a.join("\n - ") }; dhtmlx.assert_method = function(g, a) { for (var c in a) { dhtmlx.assert_method_process(g, c, a[c].descr, a[c].args, (a[c].min || 99), a[c].skip) } }; dhtmlx.assert_method_process = function(m, c, l, n, g, h) { var a = m[c]; if (!h) { m[c] = function() { if (arguments.length != n.length && arguments.length < g) { dhtmlx.log("warn", "Incorrect count of parameters\n" + m[c].describe() + "\n\nExpecting " + n.length + " but have only " + arguments.length) } else { for (var o = 0; o < n.length; o++) { if (!n[o][3] && !n[o][2](arguments[o])) { dhtmlx.log("warn", "Incorrect method call\n" + m[c].describe() + "\n\nActual value of " + (o + 1) + " parameter: {" + (typeof arguments[o]) + "} " + arguments[o]) } } } return a.apply(this, arguments) } } m[c].describe = function() { return dhtmlx.assert_method_info(m, c, l, n) } }; dhtmlx.assert_event_call = function(g, c, a) { if (g._event_check) { if (!g._event_check[c]) { dhtmlx.log("warn", "Not expected event call :" + c) } else { if (dhtmlx.isNotDefined(a)) { dhtmlx.log("warn", "Event without parameters :" + c) } else { if (g._event_check_size[c] != a.length) { dhtmlx.log("warn", "Incorrect event call, expected " + g._event_check_size[c] + " parameter(s), but have " + a.length + " parameter(s), for " + c + " event") } } } } }; dhtmlx.assert_event_attach = function(c, a) { if (c._event_check && !c._event_check[a]) { dhtmlx.log("warn", "Unknown event name: " + a) } }; dhtmlx.assert_property = function(c, a) { if (!c._settings_check) { c._settings_check = {} } dhtmlx.extend(c._settings_check, a) }; dhtmlx.assert_check = function(g, c) { if (typeof g == "object") { for (var a in g) { dhtmlx.assert_settings(a, g[a], c) } } }; dhtmlx.assert_settings = function(o, l, h) { h = h || this._settings_check; if (h) { if (!h[o]) { return dhtmlx.log("warn", "Unknown propery: " + o) } var n = ""; var c = ""; var a = false; for (var g = 0; g < h[o].length; g++) { var m = h[o][g]; if (typeof m == "string") { continue } if (typeof m == "function") { a = a || m(l) } else { if (typeof m == "object" && typeof m[1] == "function") { a = a || m[1](l); if (a && m[2]) { dhtmlx.assert_check(l, m[2]) } } } if (a) { break } } if (!a) { dhtmlx.log("warn", "Invalid configuration\n" + dhtmlx.assert_info(o, h) + "\nActual value: {" + (typeof l) + "} " + l) } } }; dhtmlx.assert_info = function(c, m) { var a = m[c]; var l = ""; var h = []; for (var g = 0; g < a.length; g++) { if (typeof rule == "string") { l = a[g] } else { if (a[g].describe) { h.push(a[g].describe()) } else { if (a[g][1] && a[g][1].describe) { h.push(a[g][1].describe()) } } } } return "Property: " + c + ", " + l + " \nExpected value: \n - " + h.join("\n - ") }; if (dhtmlx.assert_enabled()) { dhtmlx.assert_rule_color = function(a) { if (typeof a != "string") { return false } if (a.indexOf("#") !== 0) { return false } if (a.substr(1).replace(/[0-9A-F]/gi, "") !== "") { return false } return true }; dhtmlx.assert_rule_color.describe = function() { return "{String} Value must start from # and contain hexadecimal code of color" }; dhtmlx.assert_rule_template = function(a) { if (typeof a == "function") { return true } if (typeof a == "string") { return true } return false }; dhtmlx.assert_rule_template.describe = function() { return "{Function},{String} Value must be a function which accepts data object and return text string, or a sting with optional template markers" }; dhtmlx.assert_rule_boolean = function(a) { if (typeof a == "boolean") { return true } return false }; dhtmlx.assert_rule_boolean.describe = function() { return "{Boolean} true or false" }; dhtmlx.assert_rule_object = function(a, c) { if (typeof a == "object") { return true } return false }; dhtmlx.assert_rule_object.describe = function() { return "{Object} Configuration object" }; dhtmlx.assert_rule_string = function(a) { if (typeof a == "string") { return true } return false }; dhtmlx.assert_rule_string.describe = function() { return "{String} Plain string" }; dhtmlx.assert_rule_htmlpt = function(a) { return !!dhtmlx.toNode(a) }; dhtmlx.assert_rule_htmlpt.describe = function() { return "{Object},{String} HTML node or ID of HTML Node" }; dhtmlx.assert_rule_notdocumented = function(a) { return false }; dhtmlx.assert_rule_notdocumented.describe = function() { return "This options wasn't documented" }; dhtmlx.assert_rule_key = function(c) { var a = function(g) { return c[g] }; a.describe = function() { var h = []; for (var g in c) { h.push(g) } return "{String} can take one of next values: " + h.join(", ") }; return a }; dhtmlx.assert_rule_dimension = function(a) { if (a * 1 == a && !isNaN(a) && a >= 0) { return true } return false }; dhtmlx.assert_rule_dimension.describe = function() { return "{Integer} value must be a positive number" }; dhtmlx.assert_rule_number = function(a) { if (typeof a == "number") { return true } return false }; dhtmlx.assert_rule_number.describe = function() { return "{Integer} value must be a number" }; dhtmlx.assert_rule_function = function(a) { if (typeof a == "function") { return true } return false }; dhtmlx.assert_rule_function.describe = function() { return "{Function} value must be a custom function" }; dhtmlx.assert_rule_any = function(a) { return true }; dhtmlx.assert_rule_any.describe = function() { return "Any value" }; dhtmlx.assert_rule_mix = function(g, c) { var h = function(a) { if (g(a) || c(a)) { return true } return false }; h.describe = function() { return g.describe() }; return h } } dhtmlx.version = "3.0"; dhtmlx.codebase = "./"; dhtmlx.copy = function(c) { var a = dhtmlx.copy._function; a.prototype = c; return new a() }; dhtmlx.copy._function = function() {}; dhtmlx.extend = function(c, a) { for (var g in a) { c[g] = a[g] } if (dhtmlx.assert_enabled() && a._assert) { c._assert(); c._assert = null } dhtmlx.assert(c, "Invalid nesting target"); dhtmlx.assert(a, "Invalid nesting source"); if (a._init) { c._init() } return c }; dhtmlx.proto_extend = function() { var m = arguments; var g = m[0]; var c = []; for (var l = m.length - 1; l > 0; l--) { if (typeof m[l] == "function") { m[l] = m[l].prototype } for (var h in m[l]) { if (h == "_init") { c.push(m[l][h]) } else { if (!g[h]) { g[h] = m[l][h] } } } } if (m[0]._init) { c.push(m[0]._init) } g._init = function() { for (var n = 0; n < c.length; n++) { c[n].apply(this, arguments) } }; g.base = m[1]; var a = function(n) { this._init(n); if (this._parseSettings) { this._parseSettings(n, this.defaults) } }; a.prototype = g; g = m = null; return a }; dhtmlx.bind = function(c, a) { return function() { return c.apply(a, arguments) } }; dhtmlx.require = function(a) { if (!dhtmlx._modules[a]) { dhtmlx.assert(dhtmlx.ajax, "load module is required"); dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase + a).responseText); dhtmlx._modules[a] = true } }; dhtmlx._modules = {}; dhtmlx.exec = function(code) { if (window.execScript) { window.execScript(code) } else { window.eval(code) } }; dhtmlx.methodPush = function(a, g, c) { return function() { var h = false; h = a[g].apply(a, arguments); return h } }; dhtmlx.isNotDefined = function(c) { return typeof c == "undefined" }; dhtmlx.delay = function(h, c, g, a) { setTimeout(function() { var l = h.apply(c, g); h = c = g = null; return l }, a || 1) }; dhtmlx.uid = function() { if (!this._seed) { this._seed = (new Date).valueOf() } this._seed++; return this._seed }; dhtmlx.toNode = function(a) { if (typeof a == "string") { return document.getElementById(a) } return a }; dhtmlx.toArray = function(a) { return dhtmlx.extend((a || []), dhtmlx.PowerArray) }; dhtmlx.toFunctor = function(str) { return (typeof(str) == "string") ? eval(str) : str }; dhtmlx._events = {}; dhtmlx.event = function(h, g, a, c) { h = dhtmlx.toNode(h); var l = dhtmlx.uid(); dhtmlx._events[l] = [h, g, a]; if (c) { a = dhtmlx.bind(a, c) } if (h.addEventListener) { h.addEventListener(g, a, false) } else { if (h.attachEvent) { h.attachEvent("on" + g, a) } } return l }; dhtmlx.eventRemove = function(c) { if (!c) { return } dhtmlx.assert(this._events[c], "Removing non-existing event"); var a = dhtmlx._events[c]; if (a[0].removeEventListener) { a[0].removeEventListener(a[1], a[2], false) } else { if (a[0].detachEvent) { a[0].detachEvent("on" + a[1], a[2]) } } delete this._events[c] }; dhtmlx.log = function(c, g, a) { if (window.console && console.log) { c = c.toLowerCase(); if (window.console[c]) { window.console[c](g || "unknown error") } else { window.console.log(c + ": " + g) } if (a) { window.console.log(a) } } }; dhtmlx.log_full_time = function(a) { dhtmlx._start_time_log = new Date(); dhtmlx.log("Info", "Timing start [" + a + "]"); window.setTimeout(function() { var c = new Date(); dhtmlx.log("Info", "Timing end [" + a + "]:" + (c.valueOf() - dhtmlx._start_time_log.valueOf()) / 1000 + "s") }, 1) }; dhtmlx.log_time = function(a) { var g = "_start_time_log" + a; if (!dhtmlx[g]) { dhtmlx[g] = new Date(); dhtmlx.log("Info", "Timing start [" + a + "]") } else { var c = new Date(); dhtmlx.log("Info", "Timing end [" + a + "]:" + (c.valueOf() - dhtmlx[g].valueOf()) / 1000 + "s"); dhtmlx[g] = null } }; dhtmlx.error = function(c, a) { dhtmlx.log("error", c, a) }; dhtmlx.EventSystem = { _init: function() { this._events = {}; this._handlers = {}; this._map = {} }, block: function() { this._events._block = true }, unblock: function() { this._events._block = false }, mapEvent: function(a) { dhtmlx.extend(this._map, a) }, callEvent: function(g, l) { if (this._events._block) { return true } g = g.toLowerCase(); dhtmlx.assert_event_call(this, g, l); var h = this._events[g.toLowerCase()]; var a = true; if (dhtmlx.debug) { dhtmlx.log("info", "[" + this.name + "] event:" + g, l) } if (h) { for (var c = 0; c < h.length; c++) { if (h[c].apply(this, (l || [])) === false) { a = false } } } if (this._map[g] && !this._map[g].callEvent(g, l)) { a = false } return a }, attachEvent: function(c, a, h) { c = c.toLowerCase(); dhtmlx.assert_event_attach(this, c); h = h || dhtmlx.uid(); a = dhtmlx.toFunctor(a); var g = this._events[c] || dhtmlx.toArray(); g.push(a); this._events[c] = g; this._handlers[h] = { f: a, t: c }; return h }, detachEvent: function(h) { if (this._handlers[h]) { var c = this._handlers[h].t; var a = this._handlers[h].f; var g = this._events[c]; g.remove(a); delete this._handlers[h] } } }; dhtmlx.PowerArray = { removeAt: function(c, a) { if (c >= 0) { this.splice(c, (a || 1)) } }, remove: function(a) { this.removeAt(this.find(a)) }, insertAt: function(c, g) { if (!g && g !== 0) { this.push(c) } else { var a = this.splice(g, (this.length - g)); this[g] = c; this.push.apply(this, a) } }, find: function(a) { for (i = 0; i < this.length; i++) { if (a == this[i]) { return i } } return -1 }, each: function(a, g) { for (var c = 0; c < this.length; c++) { a.call((g || this), this[c]) } }, map: function(a, g) { for (var c = 0; c < this.length; c++) { this[c] = a.call((g || this), this[c]) } return this } }; dhtmlx.env = {}; if (navigator.userAgent.indexOf("Opera") != -1) { dhtmlx._isOpera = true } else { dhtmlx._isIE = !! document.all; dhtmlx._isFF = !document.all; dhtmlx._isWebKit = (navigator.userAgent.indexOf("KHTML") != -1); if (navigator.appVersion.indexOf("MSIE 8.0") != -1 && document.compatMode != "BackCompat") { dhtmlx._isIE = 8 } if (navigator.appVersion.indexOf("MSIE 9.0") != -1 && document.compatMode != "BackCompat") { dhtmlx._isIE = 9 } } dhtmlx.env = {}; (function() { dhtmlx.env.transform = false; dhtmlx.env.transition = false; var a = {}; a.names = ["transform", "transition"]; a.transform = ["transform", "WebkitTransform", "MozTransform", "oTransform", "msTransform"]; a.transition = ["transition", "WebkitTransition", "MozTransition", "oTransition"]; var h = document.createElement("DIV"); var g; for (var c = 0; c < a.names.length; c++) { while (p = a[a.names[c]].pop()) { if (typeof h.style[p] != "undefined") { dhtmlx.env[a.names[c]] = true } } } })(); dhtmlx.env.transform_prefix = (function() { var a; if (dhtmlx._isOpera) { a = "-o-" } else { a = ""; if (dhtmlx._isFF) { a = "-moz-" } if (dhtmlx._isWebKit) { a = "-webkit-" } } return a })(); dhtmlx.env.svg = (function() { return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") })(); dhtmlx.zIndex = { drag: 10000 }; dhtmlx.html = { create: function(c, a, g) { a = a || {}; var h = document.createElement(c); for (var l in a) { h.setAttribute(l, a[l]) } if (a.style) { h.style.cssText = a.style } if (a["class"]) { h.className = a["class"] } if (g) { h.innerHTML = g } return h }, getValue: function(a) { a = dhtmlx.toNode(a); if (!a) { return "" } return dhtmlx.isNotDefined(a.value) ? a.innerHTML : a.value }, remove: function(c) { if (c instanceof Array) { for (var a = 0; a < c.length; a++) { this.remove(c[a]) } } else { if (c && c.parentNode) { c.parentNode.removeChild(c) } } }, insertBefore: function(c, g, a) { if (!c) { return } if (g) { g.parentNode.insertBefore(c, g) } else { a.appendChild(c) } }, locate: function(c, h) { c = c || event; var a = c.target || c.srcElement; while (a) { if (a.getAttribute) { var g = a.getAttribute(h); if (g) { return g } } a = a.parentNode } return null }, offset: function(h) { if (h.getBoundingClientRect) { var n = h.getBoundingClientRect(); var o = document.body; var c = document.documentElement; var a = window.pageYOffset || c.scrollTop || o.scrollTop; var l = window.pageXOffset || c.scrollLeft || o.scrollLeft; var m = c.clientTop || o.clientTop || 0; var q = c.clientLeft || o.clientLeft || 0; var r = n.top + a - m; var g = n.left + l - q; return { y: Math.round(r), x: Math.round(g) } } else { var r = 0, g = 0; while (h) { r = r + parseInt(h.offsetTop, 10); g = g + parseInt(h.offsetLeft, 10); h = h.offsetParent } return { y: r, x: g } } }, pos: function(a) { a = a || event; if (a.pageX || a.pageY) { return { x: a.pageX, y: a.pageY } } var c = ((dhtmlx._isIE) && (document.compatMode != "BackCompat")) ? document.documentElement : document.body; return { x: a.clientX + c.scrollLeft - c.clientLeft, y: a.clientY + c.scrollTop - c.clientTop } }, preventEvent: function(a) { if (a && a.preventDefault) { a.preventDefault() } dhtmlx.html.stopEvent(a) }, stopEvent: function(a) { (a || event).cancelBubble = true; return false }, addCss: function(c, a) { c.className += " " + a }, removeCss: function(c, a) { c.className = c.className.replace(RegExp(a, "g"), "") } }; (function() { var a = document.getElementsByTagName("SCRIPT"); dhtmlx.assert(a.length, "Can't locate codebase"); if (a.length) { a = (a[a.length - 1].getAttribute("src") || "").split("/"); a.splice(a.length - 1, 1); dhtmlx.codebase = a.slice(0, a.length).join("/") + "/" } })(); if (!dhtmlx.ui) { dhtmlx.ui = {} } dhtmlx.Destruction = { _init: function() { dhtmlx.destructors.push(this) }, destructor: function() { this.destructor = function() {}; this._htmlmap = null; this._htmlrows = null; if (this._html) { document.body.appendChild(this._html) } this._html = null; if (this._obj) { this._obj.innerHTML = ""; this._obj._htmlmap = null } this._obj = this._dataobj = null; this.data = null; this._events = this._handlers = {}; if (this.render) { this.render = function() {} } } }; dhtmlx.destructors = []; dhtmlx.event(window, "unload", function() { if (dhtmlx.destructors) { for (var g = 0; g < dhtmlx.destructors.length; g++) { dhtmlx.destructors[g].destructor() } dhtmlx.destructors = [] } for (var c in dhtmlx._events) { var h = dhtmlx._events[c]; if (h[0].removeEventListener) { h[0].removeEventListener(h[1], h[2], false) } else { if (h[0].detachEvent) { h[0].detachEvent("on" + h[1], h[2]) } } delete dhtmlx._events[c] } }); dhtmlx.ajax = function(a, c, g) { if (arguments.length !== 0) { var h = new dhtmlx.ajax(); if (g) { h.master = g } h.get(a, null, c) } if (!this.getXHR) { return new dhtmlx.ajax() } return this }; dhtmlx.ajax.prototype = { getXHR: function() { if (dhtmlx._isIE) { return new ActiveXObject("Microsoft.xmlHTTP") } else { return new XMLHttpRequest() } }, send: function(l, q, n) { var c = this.getXHR(); if (typeof n == "function") { n = [n] } if (typeof q == "object") { var m = []; for (var g in q) { var o = q[g]; if (o === null || o === dhtmlx.undefined) { o = "" } m.push(g + "=" + encodeURIComponent(o)) } q = m.join("&") } if (q && !this.post) { l = l + (l.indexOf("?") != -1 ? "&" : "?") + q; q = null } c.open(this.post ? "POST" : "GET", l, !this._sync); if (this.post) { c.setRequestHeader("Content-type", "application/x-www-form-urlencoded") } var h = this; c.onreadystatechange = function() { if (!c.readyState || c.readyState == 4) { if (n && h) { for (var a = 0; a < n.length; a++) { if (n[a]) { n[a].call((h.master || h), c.responseText, c.responseXML, c) } } } h.master = null; n = h = null } }; c.send(q || null); return c }, get: function(a, g, c) { this.post = false; return this.send(a, g, c) }, post: function(a, g, c) { this.post = true; return this.send(a, g, c) }, sync: function() { this._sync = true; return this } }; dhtmlx.AtomDataLoader = { _init: function(a) { this.data = {}; if (a) { this._settings.datatype = a.datatype || "json"; this._after_init.push(this._load_when_ready) } }, _load_when_ready: function() { this._ready_for_data = true; if (this._settings.url) { this.url_setter(this._settings.url) } if (this._settings.data) { this.data_setter(this._settings.data) } }, url_setter: function(a) { if (!this._ready_for_data) { return a } this.load(a, this._settings.datatype); return a }, data_setter: function(a) { if (!this._ready_for_data) { return a } this.parse(a, this._settings.datatype); return true }, load: function(a, c) { this.callEvent("onXLS", []); if (typeof c == "string") { this.data.driver = dhtmlx.DataDriver[c]; c = arguments[2] } else { this.data.driver = dhtmlx.DataDriver.xml } dhtmlx.ajax(a, [this._onLoad, c], this) }, parse: function(c, a) { this.callEvent("onXLS", []); this.data.driver = dhtmlx.DataDriver[a || "xml"]; this._onLoad(c, null) }, _onLoad: function(l, c, a) { var g = this.data.driver; var h = g.getRecords(g.toObject(l, c))[0]; this.data = (g ? g.getDetails(h) : l); this.callEvent("onXLE", []) }, _check_data_feed: function(c) { if (!this._settings.dataFeed || this._ignore_feed || !c) { return true } var a = this._settings.dataFeed; if (typeof a == "function") { return a.call(this, (c.id || c), c) } a = a + (a.indexOf("?") == -1 ? "?" : "&") + "action=get&id=" + encodeURIComponent(c.id || c); this.callEvent("onXLS", []); dhtmlx.ajax(a, function(h, g) { this._ignore_feed = true; this.setValues(dhtmlx.DataDriver.json.toObject(h)[0]); this._ignore_feed = false; this.callEvent("onXLE", []) }, this); return false } }; dhtmlx.DataDriver = {}; dhtmlx.DataDriver.json = { toObject: function(data) { if (!data) { data = "[]" } if (typeof data == "string") { eval("dhtmlx.temp=" + data); return dhtmlx.temp } return data }, getRecords: function(a) { if (a && !(a instanceof Array)) { return [a] } return a }, getDetails: function(a) { return a }, getInfo: function(a) { return { _size: (a.total_count || 0), _from: (a.pos || 0), _key: (a.dhx_security) } } }; dhtmlx.DataDriver.json_ext = { toObject: function(data) { if (!data) { data = "[]" } if (typeof data == "string") { var temp; eval("temp=" + data); dhtmlx.temp = []; var header = temp.header; for (var i = 0; i < temp.data.length; i++) { var item = {}; for (var j = 0; j < header.length; j++) { if (typeof(temp.data[i][j]) != "undefined") { item[header[j]] = temp.data[i][j] } } dhtmlx.temp.push(item) } return dhtmlx.temp } return data }, getRecords: function(a) { if (a && !(a instanceof Array)) { return [a] } return a }, getDetails: function(a) { return a }, getInfo: function(a) { return { _size: (a.total_count || 0), _from: (a.pos || 0) } } }; dhtmlx.DataDriver.html = { toObject: function(c) { if (typeof c == "string") { var a = null; if (c.indexOf("<") == -1) { a = dhtmlx.toNode(c) } if (!a) { a = document.createElement("DIV"); a.innerHTML = c } return a.getElementsByTagName(this.tag) } return c }, getRecords: function(a) { if (a.tagName) { return a.childNodes } return a }, getDetails: function(a) { return dhtmlx.DataDriver.xml.tagToObject(a) }, getInfo: function(a) { return { _size: 0, _from: 0 } }, tag: "LI" }; dhtmlx.DataDriver.jsarray = { toObject: function(data) { if (typeof data == "string") { eval("dhtmlx.temp=" + data); return dhtmlx.temp } return data }, getRecords: function(a) { return a }, getDetails: function(g) { var a = {}; for (var c = 0; c < g.length; c++) { a["data" + c] = g[c] } return a }, getInfo: function(a) { return { _size: 0, _from: 0 } } }; dhtmlx.DataDriver.csv = { toObject: function(a) { return a }, getRecords: function(a) { return a.split(this.row) }, getDetails: function(g) { g = this.stringToArray(g); var a = {}; for (var c = 0; c < g.length; c++) { a["data" + c] = g[c] } return a }, getInfo: function(a) { return { _size: 0, _from: 0 } }, stringToArray: function(c) { c = c.split(this.cell); for (var a = 0; a < c.length; a++) { c[a] = c[a].replace(/^[ \t\n\r]*(\"|)/g, "").replace(/(\"|)[ \t\n\r]*$/g, "") } return c }, row: "\n", cell: "," }; dhtmlx.DataDriver.xml = { toObject: function(c, a) { if (a && (a = this.checkResponse(c, a))) { return a } if (typeof c == "string") { return this.fromString(c) } return c }, getRecords: function(a) { return this.xpath(a, this.records) }, records: "/*/item", getDetails: function(a) { return this.tagToObject(a, {}) }, getInfo: function(a) { return { _size: (a.documentElement.getAttribute("total_count") || 0), _from: (a.documentElement.getAttribute("pos") || 0), _key: (a.documentElement.getAttribute("dhx_security")) } }, xpath: function(h, q) { if (window.XPathResult) { var g = h; if (h.nodeName.indexOf("document") == -1) { h = h.ownerDocument } var n = []; var c = h.evaluate(q, g, null, XPathResult.ANY_TYPE, null); var o = c.iterateNext(); while (o) { n.push(o); o = c.iterateNext() } return n } else { var m = true; try { if (typeof(h.selectNodes) == "undefined") { m = false } } catch (l) {} if (m) { return h.selectNodes(q) } else { var a = q.split("/").pop(); return h.getElementsByTagName(a) } } }, tagToObject: function(g, q) { q = q || {}; var l = false; var h = g.attributes; if (h && h.length) { for (var n = 0; n < h.length; n++) { q[h[n].name] = h[n].value } l = true } var c = g.childNodes; var o = {}; for (var n = 0; n < c.length; n++) { if (c[n].nodeType == 1) { var m = c[n].tagName; if (typeof q[m] != "undefined") { if (!(q[m] instanceof Array)) { q[m] = [q[m]] } q[m].push(this.tagToObject(c[n], {})) } else { q[c[n].tagName] = this.tagToObject(c[n], {}) } l = true } } if (!l) { return this.nodeValue(g) } q.value = this.nodeValue(g); return q }, nodeValue: function(a) { if (a.firstChild) { return a.firstChild.wholeText || a.firstChild.data } return "" }, fromString: function(c) { if (window.DOMParser && !dhtmlx._isIE) { return (new DOMParser()).parseFromString(c, "text/xml") } if (window.ActiveXObject) { var a = new ActiveXObject("Microsoft.xmlDOM"); a.loadXML(c); return a } dhtmlx.error("Load from xml string is not supported") }, checkResponse: function(h, g) { if (g && (g.firstChild && g.firstChild.tagName != "parsererror")) { return g } var c = this.fromString(h.replace(/^[\s]+/, "")); if (c) { return c } dhtmlx.error("xml can't be parsed", h) } }; dhtmlx.DataLoader = { _init: function(a) { a = a || ""; this.name = "DataStore"; this.data = (a.datastore) || (new dhtmlx.DataStore()); this._readyHandler = this.data.attachEvent("onStoreLoad", dhtmlx.bind(this._call_onready, this)) }, load: function(a, c) { dhtmlx.AtomDataLoader.load.apply(this, arguments); if (!this.data.feed) { this.data.feed = function(h, g) { if (this._load_count) { return this._load_count = [h, g] } else { this._load_count = true } this.load(a + ((a.indexOf("?") == -1) ? "?" : "&") + "posStart=" + h + "&count=" + g, function() { var l = this._load_count; this._load_count = false; if (typeof l == "object") { this.data.feed.apply(this, l) } }) } } }, _onLoad: function(g, c, a) { this.data._parse(this.data.driver.toObject(g, c)); this.callEvent("onXLE", []); if (this._readyHandler) { this.data.detachEvent(this._readyHandler); this._readyHandler = null } }, dataFeed_setter: function(a) { this.data.attachEvent("onBeforeFilter", dhtmlx.bind(function(n, m) { if (this._settings.dataFeed) { var l = {}; if (!n && !l) { return } if (typeof n == "function") { if (!m) { return } n(m, l) } else { l = { text: m } } this.clearAll(); var c = this._settings.dataFeed; if (typeof c == "function") { return c.call(this, m, l) } var h = []; for (var g in l) { h.push("dhx_filter[" + g + "]=" + encodeURIComponent(l[g])) } this.load(c + (c.indexOf("?") < 0 ? "?" : "&") + h.join("&"), this._settings.datatype); return false } }, this)); return a }, _call_onready: function() { if (this._settings.ready) { var a = dhtmlx.toFunctor(this._settings.ready); if (a && a.call) { a.apply(this, arguments) } } } }; dhtmlx.DataStore = function() { this.name = "DataStore"; dhtmlx.extend(this, dhtmlx.EventSystem); this.setDriver("xml"); this.pull = {}; this.order = dhtmlx.toArray() }; dhtmlx.DataStore.prototype = { setDriver: function(a) { dhtmlx.assert(dhtmlx.DataDriver[a], "incorrect DataDriver"); this.driver = dhtmlx.DataDriver[a] }, _parse: function(l) { this.callEvent("onParse", [this.driver, l]); if (this._filter_order) { this.filter() } var m = this.driver.getInfo(l); if (m._key) { dhtmlx.security_key = m._key } var h = this.driver.getRecords(l); var o = (m._from || 0) * 1; if (o === 0 && this.order[0]) { o = this.order.length } var c = 0; for (var g = 0; g < h.length; g++) { var a = this.driver.getDetails(h[g]); var n = this.id(a); if (!this.pull[n]) { this.order[c + o] = n; c++ } this.pull[n] = a; if (this.extraParser) { this.extraParser(a) } if (this._scheme) { if (this._scheme.$init) { this._scheme.$update(a) } else { if (this._scheme.$update) { this._scheme.$update(a) } } } } for (var g = 0; g < m._size; g++) { if (!this.order[g]) { var n = dhtmlx.uid(); var a = { id: n, $template: "loading" }; this.pull[n] = a; this.order[g] = n } } this.callEvent("onStoreLoad", [this.driver, l]); this.refresh() }, id: function(a) { return a.id || (a.id = dhtmlx.uid()) }, changeId: function(c, a) { dhtmlx.assert(this.pull[c], "Can't change id, for non existing item: " + c); this.pull[a] = this.pull[c]; this.pull[a].id = a; this.order[this.order.find(c)] = a; if (this._filter_order) { this._filter_order[this._filter_order.find(c)] = a } this.callEvent("onIdChange", [c, a]); if (this._render_change_id) { this._render_change_id(c, a) } }, get: function(a) { return this.item(a) }, set: function(c, a) { return this.update(c, a) }, item: function(a) { return this.pull[a] }, update: function(c, a) { if (this._scheme && this._scheme.$update) { this._scheme.$update(a) } if (this.callEvent("onBeforeUpdate", [c, a]) === false) { return false } this.pull[c] = a; this.refresh(c) }, refresh: function(a) { if (this._skip_refresh) { return } if (a) { this.callEvent("onStoreUpdated", [a, this.pull[a], "update"]) } else { this.callEvent("onStoreUpdated", [null, null, null]) } }, silent: function(a) { this._skip_refresh = true; a.call(this); this._skip_refresh = false }, getRange: function(h, g) { if (h) { h = this.indexById(h) } else { h = this.startOffset || 0 } if (g) { g = this.indexById(g) } else { g = Math.min((this.endOffset || Infinity), (this.dataCount() - 1)); if (g < 0) { g = 0 } } if (h > g) { var c = g; g = h; h = c } return this.getIndexRange(h, g) }, getIndexRange: function(h, g) { g = Math.min((g || Infinity), this.dataCount() - 1); var a = dhtmlx.toArray(); for (var c = (h || 0); c <= g; c++) { a.push(this.item(this.order[c])) } return a }, dataCount: function() { return this.order.length }, exists: function(a) { return !!(this.pull[a]) }, move: function(a, h) { if (a < 0 || h < 0) { dhtmlx.error("DataStore::move", "Incorrect indexes"); return } var g = this.idByIndex(a); var c = this.item(g); this.order.removeAt(a); this.order.insertAt(g, Math.min(this.order.length, h)); this.callEvent("onStoreUpdated", [g, c, "move"]) }, scheme: function(a) { this._scheme = a }, sync: function(l, h, a) { if (typeof h != "function") { a = h; h = null } if (dhtmlx.debug_bind) { this.debug_sync_master = l; dhtmlx.log("[sync] " + this.debug_bind_master.name + "@" + this.debug_bind_master._settings.id + " <= " + this.debug_sync_master.name + "@" + this.debug_sync_master._settings.id) } var g = l; if (l.name != "DataStore") { l = l.data } var c = dhtmlx.bind(function(o, m, n) { if (n != "update" || h) { o = null } if (!o) { this.order = dhtmlx.toArray([].concat(l.order)); this._filter_order = null; this.pull = l.pull; if (h) { this.silent(h) } if (this._on_sync) { this._on_sync() } } if (dhtmlx.debug_bind) { dhtmlx.log("[sync:request] " + this.debug_sync_master.name + "@" + this.debug_sync_master._settings.id + " <= " + this.debug_bind_master.name + "@" + this.debug_bind_master._settings.id) } if (!a) { this.refresh(o) } else { a = false } }, this); l.attachEvent("onStoreUpdated", c); this.feed = function(n, m) { g.loadNext(m, n) }; c() }, add: function(l, a) { if (this._scheme) { l = l || {}; for (var c in this._scheme) { l[c] = l[c] || this._scheme[c] } if (this._scheme) { if (this._scheme.$init) { this._scheme.$update(l) } else { if (this._scheme.$update) { this._scheme.$update(l) } } } } var m = this.id(l); var h = this.dataCount(); if (dhtmlx.isNotDefined(a) || a < 0) { a = h } if (a > h) { dhtmlx.log("Warning", "DataStore:add", "Index of out of bounds"); a = Math.min(this.order.length, a) } if (this.callEvent("onBeforeAdd", [m, l, a]) === false) { return false } if (this.exists(m)) { return dhtmlx.error("Not unique ID") } this.pull[m] = l; this.order.insertAt(m, a); if (this._filter_order) { var g = this._filter_order.length; if (!a && this.order.length) { g = 0 } this._filter_order.insertAt(m, g) } this.callEvent("onafterAdd", [m, a]); this.callEvent("onStoreUpdated", [m, l, "add"]); return m }, remove: function(g) { if (g instanceof Array) { for (var a = 0; a < g.length; a++) { this.remove(g[a]) } return } if (this.callEvent("onBeforeDelete", [g]) === false) { return false } if (!this.exists(g)) { return dhtmlx.error("Not existing ID", g) } var c = this.item(g); this.order.remove(g); if (this._filter_order) { this._filter_order.remove(g) } delete this.pull[g]; this.callEvent("onafterdelete", [g]); this.callEvent("onStoreUpdated", [g, c, "delete"]) }, clearAll: function() { this.pull = {}; this.order = dhtmlx.toArray(); this.feed = null; this._filter_order = null; this.callEvent("onClearAll", []); this.refresh() }, idByIndex: function(a) { if (a >= this.order.length || a < 0) { dhtmlx.log("Warning", "DataStore::idByIndex Incorrect index") } return this.order[a] }, indexById: function(c) { var a = this.order.find(c); return a }, next: function(c, a) { return this.order[this.indexById(c) + (a || 1)] }, first: function() { return this.order[0] }, last: function() { return this.order[this.order.length - 1] }, previous: function(c, a) { return this.order[this.indexById(c) - (a || 1)] }, sort: function(m, c, a) { var g = m; if (typeof m == "function") { g = { as: m, dir: c } } else { if (typeof m == "string") { g = { by: m, dir: c, as: a } } } var l = [g.by, g.dir, g.as]; if (!this.callEvent("onbeforesort", l)) { return } if (this.order.length) { var n = dhtmlx.sort.create(g); var h = this.getRange(this.first(), this.last()); h.sort(n); this.order = h.map(function(o) { return this.id(o) }, this) } this.refresh(); this.callEvent("onaftersort", l) }, filter: function(l, h) { if (!this.callEvent("onBeforeFilter", [l, h])) { return } if (this._filter_order) { this.order = this._filter_order; delete this._filter_order } if (!this.order.length) { return } if (l) { var c = l; h = h || ""; if (typeof l == "string") { l = dhtmlx.Template.fromHTML(l); h = h.toString().toLowerCase(); c = function(o, n) { return l(o).toLowerCase().indexOf(n) != -1 } } var g = dhtmlx.toArray(); for (var a = 0; a < this.order.length; a++) { var m = this.order[a]; if (c(this.item(m), h)) { g.push(m) } } this._filter_order = this.order; this.order = g } this.refresh(); this.callEvent("onAfterFilter", []) }, each: function(g, c) { for (var a = 0; a < this.order.length; a++) { g.call((c || this), this.item(this.order[a])) } }, provideApi: function(h, c) { this.debug_bind_master = h; if (c) { this.mapEvent({ onbeforesort: h, onaftersort: h, onbeforeadd: h, onafteradd: h, onbeforedelete: h, onafterdelete: h, onbeforeupdate: h }) } var g = ["get", "set", "sort", "add", "remove", "exists", "idByIndex", "indexById", "item", "update", "refresh", "dataCount", "filter", "next", "previous", "clearAll", "first", "last", "serialize"]; for (var a = 0; a < g.length; a++) { h[g[a]] = dhtmlx.methodPush(this, g[a]) } if (dhtmlx.assert_enabled()) { this.assert_event(h) } }, serialize: function() { var g = this.order; var a = []; for (var c = 0; c < g.length; c++) { a.push(this.pull[g[c]]) } return a } }; dhtmlx.sort = { create: function(a) { return dhtmlx.sort.dir(a.dir, dhtmlx.sort.by(a.by, a.as)) }, as: { "int": function(g, c) { g = g * 1; c = c * 1; return g > c ? 1 : (g < c ? -1 : 0) }, string_strict: function(g, c) { g = g.toString(); c = c.toString(); return g > c ? 1 : (g < c ? -1 : 0) }, string: function(g, c) { g = g.toString().toLowerCase(); c = c.toString().toLowerCase(); return g > c ? 1 : (g < c ? -1 : 0) } }, by: function(c, a) { if (!c) { return a } if (typeof a != "function") { a = dhtmlx.sort.as[a || "string"] } c = dhtmlx.Template.fromHTML(c); return function(h, g) { return a(c(h), c(g)) } }, dir: function(c, a) { if (c == "asc") { return a } return function(h, g) { return a(h, g) * -1 } } }; dhtmlx.KeyEvents = { _init: function() { dhtmlx.event(this._obj, "keypress", this._onKeyPress, this) }, _onKeyPress: function(c) { c = c || event; var a = c.which || c.keyCode; this.callEvent((this._edit_id ? "onEditKeyPress" : "onKeyPress"), [a, c.ctrlKey, c.shiftKey, c]) } }; dhtmlx.MouseEvents = { _init: function() { if (this.on_click) { dhtmlx.event(this._obj, "click", this._onClick, this); dhtmlx.event(this._obj, "contextmenu", this._onContext, this) } if (this.on_dblclick) { dhtmlx.event(this._obj, "dblclick", this._onDblClick, this) } if (this.on_mouse_move) { dhtmlx.event(this._obj, "mousemove", this._onMouse, this); dhtmlx.event(this._obj, (dhtmlx._isIE ? "mouseleave" : "mouseout"), this._onMouse, this) } }, _onClick: function(a) { return this._mouseEvent(a, this.on_click, "ItemClick") }, _onDblClick: function(a) { return this._mouseEvent(a, this.on_dblclick, "ItemDblClick") }, _onContext: function(a) { var c = dhtmlx.html.locate(a, this._id); if (c && !this.callEvent("onBeforeContextMenu", [c, a])) { return dhtmlx.html.preventEvent(a) } }, _onMouse: function(a) { if (dhtmlx._isIE) { a = document.createEventObject(event) } if (this._mouse_move_timer) { window.clearTimeout(this._mouse_move_timer) } this.callEvent("onMouseMoving", [a]); this._mouse_move_timer = window.setTimeout(dhtmlx.bind(function() { if (a.type == "mousemove") { this._onMouseMove(a) } else { this._onMouseOut(a) } }, this), 500) }, _onMouseMove: function(a) { if (!this._mouseEvent(a, this.on_mouse_move, "MouseMove")) { this.callEvent("onMouseOut", [a || event]) } }, _onMouseOut: function(a) { this.callEvent("onMouseOut", [a || event]) }, _mouseEvent: function(m, l, c) { m = m || event; var a = m.target || m.srcElement; var g = ""; var n = null; var h = false; while (a && a.parentNode) { if (!h && a.getAttribute) { n = a.getAttribute(this._id); if (n) { if (a.getAttribute("userdata")) { this.callEvent("onLocateData", [n, a]) } if (!this.callEvent("on" + c, [n, m, a])) { return } h = true } } g = a.className; if (g) { g = g.split(" "); g = g[0] || g[1]; if (l[g]) { return l[g].call(this, m, n || dhtmlx.html.locate(m, this._id), a) } } a = a.parentNode } return h } }; dhtmlx.Settings = { _init: function() { this._settings = this.config = {} }, define: function(c, a) { if (typeof c == "object") { return this._parseSeetingColl(c) } return this._define(c, a) }, _define: function(c, a) { dhtmlx.assert_settings.call(this, c, a); var g = this[c + "_setter"]; return this._settings[c] = g ? g.call(this, a) : a }, _parseSeetingColl: function(g) { if (g) { for (var c in g) { this._define(c, g[c]) } } }, _parseSettings: function(g, a) { var c = dhtmlx.extend({}, a); if (typeof g == "object" && !g.tagName) { dhtmlx.extend(c, g) } this._parseSeetingColl(c) }, _mergeSettings: function(a, g) { for (var c in g) { switch (typeof a[c]) { case "object": a[c] = this._mergeSettings((a[c] || {}), g[c]); break; case "undefined": a[c] = g[c]; break; default: break } } return a }, _parseContainer: function(c, a, g) { if (typeof c == "object" && !c.tagName) { c = c.container } this._obj = this.$view = dhtmlx.toNode(c); if (!this._obj && g) { this._obj = g(c) } dhtmlx.assert(this._obj, "Incorrect html container"); this._obj.className += " " + a; this._obj.onselectstart = function() { return false }; this._dataobj = this._obj }, _set_type: function(a) { if (typeof a == "object") { return this.type_setter(a) } dhtmlx.assert(this.types, "RenderStack :: Types are not defined"); dhtmlx.assert(this.types[a], "RenderStack :: Inccorect type name", a); this.type = dhtmlx.extend({}, this.types[a]); this.customize() }, customize: function(a) { if (a) { dhtmlx.extend(this.type, a) } this.type._item_start = dhtmlx.Template.fromHTML(this.template_item_start(this.type)); this.type._item_end = this.template_item_end(this.type); this.render() }, type_setter: function(a) { this._set_type(typeof a == "object" ? dhtmlx.Type.add(this, a) : a); return a }, template_setter: function(a) { return this.type_setter({ template: a }) }, css_setter: function(a) { this._obj.className += " " + a; return a } }; dhtmlx.Template = { _cache: {}, empty: function() { return "" }, setter: function(a) { return dhtmlx.Template.fromHTML(a) }, obj_setter: function(c) { var a = dhtmlx.Template.setter(c); var g = this; return function() { return a.apply(g, arguments) } }, fromHTML: function(a) { if (typeof a == "function") { return a } if (this._cache[a]) { return this._cache[a] } a = (a || "").toString(); a = a.replace(/[\r\n]+/g, "\\n"); a = a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g, '"+(obj.$1?"$2":"$3")+"'); a = a.replace(/\{common\.([^}\(]*)\}/g, '"+common.$1+"'); a = a.replace(/\{common\.([^\}\(]*)\(\)\}/g, '"+(common.$1?common.$1(obj):"")+"'); a = a.replace(/\{obj\.([^}]*)\}/g, '"+obj.$1+"'); a = a.replace(/#([a-z0-9_]+)#/gi, '"+obj.$1+"'); a = a.replace(/\{obj\}/g, '"+obj+"'); a = a.replace(/\{-obj/g, "{obj"); a = a.replace(/\{-common/g, "{common"); a = 'return "' + a + '";'; return this._cache[a] = Function("obj", "common", a) } }; dhtmlx.Type = { add: function(g, c) { if (!g.types && g.prototype.types) { g = g.prototype } if (dhtmlx.assert_enabled()) { this.assert_event(c) } var a = c.name || "default"; this._template(c); this._template(c, "edit"); this._template(c, "loading"); g.types[a] = dhtmlx.extend(dhtmlx.extend({}, (g.types[a] || this._default)), c); return a }, _default: { css: "default", template: function() { return "" }, template_edit: function() { return "" }, template_loading: function() { return "..." }, width: 150, height: 80, margin: 5, padding: 0 }, _template: function(g, a) { a = "template" + (a ? ("_" + a) : ""); var c = g[a]; if (c && (typeof c == "string")) { if (c.indexOf("->") != -1) { c = c.split("->"); switch (c[0]) { case "html": c = dhtmlx.html.getValue(c[1]).replace(/\"/g, '\\"'); break; case "http": c = new dhtmlx.ajax().sync().get(c[1], { uid: (new Date()).valueOf() }).responseText; break; default: break } } g[a] = dhtmlx.Template.fromHTML(c) } } }; dhtmlx.SingleRender = { _init: function() {}, _toHTML: function(a) { return this.type._item_start(a, this.type) + this.type.template(a, this.type) + this.type._item_end }, render: function() { if (!this.callEvent || this.callEvent("onBeforeRender", [this.data])) { if (this.data) { this._dataobj.innerHTML = this._toHTML(this.data) } if (this.callEvent) { this.callEvent("onAfterRender", []) } } } }; dhtmlx.ui.Tooltip = function(a) { this.name = "Tooltip"; this.version = "3.0"; if (dhtmlx.assert_enabled()) { this._assert() } if (typeof a == "string") { a = { template: a } } dhtmlx.extend(this, dhtmlx.Settings); dhtmlx.extend(this, dhtmlx.SingleRender); this._parseSettings(a, { type: "default", dy: 0, dx: 20 }); this._dataobj = this._obj = document.createElement("DIV"); this._obj.className = "dhx_tooltip"; dhtmlx.html.insertBefore(this._obj, document.body.firstChild) }; dhtmlx.ui.Tooltip.prototype = { show: function(a, c) { if (this._disabled) { return } if (this.data != a) { this.data = a; this.render(a) } this._obj.style.top = c.y + this._settings.dy + "px"; this._obj.style.left = c.x + this._settings.dx + "px"; this._obj.style.display = "block" }, hide: function() { this.data = null; this._obj.style.display = "none" }, disable: function() { this._disabled = true }, enable: function() { this._disabled = false }, types: { "default": dhtmlx.Template.fromHTML("{obj.id}") }, template_item_start: dhtmlx.Template.empty, template_item_end: dhtmlx.Template.empty }; dhtmlx.AutoTooltip = { tooltip_setter: function(c) { var a = new dhtmlx.ui.Tooltip(c); this.attachEvent("onMouseMove", function(h, g) { a.show(this.get(h), dhtmlx.html.pos(g)) }); this.attachEvent("onMouseOut", function(h, g) { a.hide() }); this.attachEvent("onMouseMoving", function(h, g) { a.hide() }); return a } }; dhtmlx.compat = function(a, c) { if (dhtmlx.compat[a]) { dhtmlx.compat[a](c) } }; (function() { if (!window.dhtmlxError) { var c = function() {}; window.dhtmlxError = { catchError: c, throwError: c }; window.convertStringToBoolean = function(g) { return !!g }; window.dhtmlxEventable = function(g) { dhtmlx.extend(g, dhtmlx.EventSystem) }; var a = { getXMLTopNode: function(g) {}, doXPath: function(g) { return dhtmlx.DataDriver.xml.xpath(this.xml, g) }, xmlDoc: { responseXML: true } }; dhtmlx.compat.dataProcessor = function(m) { var g = "_sendData"; var h = "_in_progress"; var n = "_tMode"; var l = "_waitMode"; m[g] = function(q, r) { if (!q) { return } if (r) { this[h][r] = (new Date()).valueOf() } if (!this.callEvent("onBeforeDataSending", r ? [r, this.getState(r)] : [])) { return false } var o = this; var s = this.serverProcessor; if (this[n] != "POST") { dhtmlx.ajax().get(s + ((s.indexOf("?") != -1) ? "&" : "?") + this.serialize(q, r), "", function(w, u, v) { a.xml = dhtmlx.DataDriver.xml.checkResponse(w, u); o.afterUpdate(o, null, null, null, a) }) } else { dhtmlx.ajax().post(s, this.serialize(q, r), function(w, u, v) { a.xml = dhtmlx.DataDriver.xml.checkResponse(w, u); o.afterUpdate(o, null, null, null, a) }) } this[l]++ } } } })(); if (!dhtmlx.attaches) { dhtmlx.attaches = {} } dhtmlx.attaches.attachAbstract = function(c, a) { var l = document.createElement("DIV"); l.id = "CustomObject_" + dhtmlx.uid(); l.style.width = "100%"; l.style.height = "100%"; l.cmp = "grid"; document.body.appendChild(l); this.attachObject(l.id); a.container = l.id; var h = this.vs[this.av]; h.grid = new window[c](a); h.gridId = l.id; h.gridObj = l; h.grid.setSizes = function() { if (this.resize) { this.resize() } else { this.render() } }; var g = "_viewRestore"; return this.vs[this[g]()].grid }; dhtmlx.attaches.attachDataView = function(a) { return this.attachAbstract("dhtmlXDataView", a) }; dhtmlx.attaches.attachChart = function(a) { return this.attachAbstract("dhtmlXChart", a) }; dhtmlx.compat.layout = function() {}; function dataProcessor(a) { this.serverProcessor = a; this.action_param = "!nativeeditor_status"; this.object = null; this.updatedRows = []; this.autoUpdate = true; this.updateMode = "cell"; this._tMode = "GET"; this.post_delim = "_"; this._waitMode = 0; this._in_progress = {}; this._invalid = {}; this.mandatoryFields = []; this.messages = []; this.styles = { updated: "font-weight:bold;", inserted: "font-weight:bold;", deleted: "text-decoration : line-through;", invalid: "background-color:FFE0E0;", invalid_cell: "border-bottom:2px solid red;", error: "color:red;", clear: "font-weight:normal;text-decoration:none;" }; this.enableUTFencoding(true); dhtmlxEventable(this); return this } dataProcessor.prototype = { setTransactionMode: function(c, a) { this._tMode = c; this._tSend = a }, escape: function(a) { if (this._utf) { return encodeURIComponent(a) } else { return escape(a) } }, enableUTFencoding: function(a) { this._utf = convertStringToBoolean(a) }, setDataColumns: function(a) { this._columns = (typeof a == "string") ? a.split(",") : a }, getSyncState: function() { return !this.updatedRows.length }, enableDataNames: function(a) { this._endnm = convertStringToBoolean(a) }, enablePartialDataSend: function(a) { this._changed = convertStringToBoolean(a) }, setUpdateMode: function(c, a) { this.autoUpdate = (c == "cell"); this.updateMode = c; this.dnd = a }, ignore: function(c, a) { this._silent_mode = true; c.call(a || window); this._silent_mode = false }, setUpdated: function(h, g, l) { if (this._silent_mode) { return } var c = this.findRow(h); l = l || "updated"; var a = this.obj.getUserData(h, this.action_param); if (a && l == "updated") { l = a } if (g) { this.set_invalid(h, false); this.updatedRows[c] = h; this.obj.setUserData(h, this.action_param, l); if (this._in_progress[h]) { this._in_progress[h] = "wait" } } else { if (!this.is_invalid(h)) { this.updatedRows.splice(c, 1); this.obj.setUserData(h, this.action_param, "") } } if (!g) { this._clearUpdateFlag(h) } this.markRow(h, g, l); if (g && this.autoUpdate) { this.sendData(h) } }, _clearUpdateFlag: function(a) {}, markRow: function(m, g, l) { var h = ""; var c = this.is_invalid(m); if (c) { h = this.styles[c]; g = true } if (this.callEvent("onRowMark", [m, g, l, c])) { h = this.styles[g ? l : "clear"] + h; this.obj[this._methods[0]](m, h); if (c && c.details) { h += this.styles[c + "_cell"]; for (var a = 0; a < c.details.length; a++) { if (c.details[a]) { this.obj[this._methods[1]](m, a, h) } } } } }, getState: function(a) { return this.obj.getUserData(a, this.action_param) }, is_invalid: function(a) { return this._invalid[a] }, set_invalid: function(g, c, a) { if (a) { c = { value: c, details: a, toString: function() { return this.value.toString() } } } this._invalid[g] = c }, checkBeforeUpdate: function(a) { return true }, sendData: function(a) { if (this._waitMode && (this.obj.mytype == "tree" || this.obj._h2)) { return } if (this.obj.editStop) { this.obj.editStop() } if (typeof a == "undefined" || this._tSend) { return this.sendAllData() } if (this._in_progress[a]) { return false } this.messages = []; if (!this.checkBeforeUpdate(a) && this.callEvent("onValidationError", [a, this.messages])) { return false } this._beforeSendData(this._getRowData(a), a) }, _beforeSendData: function(a, c) { if (!this.callEvent("onBeforeUpdate", [c, this.getState(c), a])) { return false } this._sendData(a, c) }, serialize: function(h, l) { if (typeof h == "string") { return h } if (typeof l != "undefined") { return this.serialize_one(h, "") } else { var a = []; var g = []; for (var c in h) { if (h.hasOwnProperty(c)) { a.push(this.serialize_one(h[c], c + this.post_delim)); g.push(c) } } a.push("ids=" + this.escape(g.join(","))); if (dhtmlx.security_key) { a.push("dhx_security=" + dhtmlx.security_key) } return a.join("&") } }, serialize_one: function(h, c) { if (typeof h == "string") { return h } var a = []; for (var g in h) { if (h.hasOwnProperty(g)) { a.push(this.escape((c || "") + g) + "=" + this.escape(h[g])) } } return a.join("&") }, _sendData: function(c, g) { if (!c) { return } if (!this.callEvent("onBeforeDataSending", g ? [g, this.getState(g), c] : [null, null, c])) { return false } if (g) { this._in_progress[g] = (new Date()).valueOf() } var a = new dtmlXMLLoaderObject(this.afterUpdate, this, true); var h = this.serverProcessor + (this._user ? (getUrlSymbol(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + this.obj.getUserData(0, "version")].join("&")) : ""); if (this._tMode != "POST") { a.loadXML(h + ((h.indexOf("?") != -1) ? "&" : "?") + this.serialize(c, g)) } else { a.loadXML(h, true, this.serialize(c, g)) } this._waitMode++ }, sendAllData: function() { if (!this.updatedRows.length) { return } this.messages = []; var c = true; for (var a = 0; a < this.updatedRows.length; a++) { c &= this.checkBeforeUpdate(this.updatedRows[a]) } if (!c && !this.callEvent("onValidationError", ["", this.messages])) { return false } if (this._tSend) { this._sendData(this._getAllData()) } else { for (var a = 0; a < this.updatedRows.length; a++) { if (!this._in_progress[this.updatedRows[a]]) { if (this.is_invalid(this.updatedRows[a])) { continue } this._beforeSendData(this._getRowData(this.updatedRows[a]), this.updatedRows[a]); if (this._waitMode && (this.obj.mytype == "tree" || this.obj._h2)) { return } } } } }, _getAllData: function(h) { var c = {}; var a = false; for (var g = 0; g < this.updatedRows.length; g++) { var l = this.updatedRows[g]; if (this._in_progress[l] || this.is_invalid(l)) { continue } if (!this.callEvent("onBeforeUpdate", [l, this.getState(l)])) { continue } c[l] = this._getRowData(l, l + this.post_delim); a = true; this._in_progress[l] = (new Date()).valueOf() } return a ? c : null }, setVerificator: function(c, a) { this.mandatoryFields[c] = a || (function(g) { return (g != "") }) }, clearVerificator: function(a) { this.mandatoryFields[a] = false }, findRow: function(c) { var a = 0; for (a = 0; a < this.updatedRows.length; a++) { if (c == this.updatedRows[a]) { break } } return a }, defineAction: function(a, c) { if (!this._uActions) { this._uActions = [] } this._uActions[a] = c }, afterUpdateCallback: function(c, n, m, l) { var a = c; var h = (m != "error" && m != "invalid"); if (!h) { this.set_invalid(c, m) } if ((this._uActions) && (this._uActions[m]) && (!this._uActions[m](l))) { return (delete this._in_progress[a]) } if (this._in_progress[a] != "wait") { this.setUpdated(c, false) } var g = c; switch (m) { case "inserted": case "insert": if (n != c) { this.obj[this._methods[2]](c, n); c = n } break; case "delete": case "deleted": this.obj.setUserData(c, this.action_param, "true_deleted"); this.obj[this._methods[3]](c); delete this._in_progress[a]; return this.callEvent("onAfterUpdate", [c, m, n, l]); break } if (this._in_progress[a] != "wait") { if (h) { this.obj.setUserData(c, this.action_param, "") } delete this._in_progress[a] } else { delete this._in_progress[a]; this.setUpdated(n, true, this.obj.getUserData(c, this.action_param)) } this.callEvent("onAfterUpdate", [g, m, n, l]) }, afterUpdate: function(o, u, r, q, n) { n.getXMLTopNode("data"); if (!n.xmlDoc.responseXML) { return } var s = n.doXPath("//data/action"); for (var l = 0; l < s.length; l++) { var m = s[l]; var h = m.getAttribute("type"); var a = m.getAttribute("sid"); var g = m.getAttribute("tid"); o.afterUpdateCallback(a, g, h, m) } o.finalizeUpdate() }, finalizeUpdate: function() { if (this._waitMode) { this._waitMode-- } if ((this.obj.mytype == "tree" || this.obj._h2) && this.updatedRows.length) { this.sendData() } this.callEvent("onAfterUpdateFinish", []); if (!this.updatedRows.length) { this.callEvent("onFullSync", []) } }, init: function(a) { this.obj = a; if (this.obj._dp_init) { this.obj._dp_init(this) } }, setOnAfterUpdate: function(a) { this.attachEvent("onAfterUpdate", a) }, enableDebug: function(a) {}, setOnBeforeUpdateHandler: function(a) { this.attachEvent("onBeforeDataSending", a) }, setAutoUpdate: function(g, c) { g = g || 2000; this._user = c || (new Date()).valueOf(); this._need_update = false; this._loader = null; this._update_busy = false; this.attachEvent("onAfterUpdate", function(h, m, n, l) { this.afterAutoUpdate(h, m, n, l) }); this.attachEvent("onFullSync", function() { this.fullSync() }); var a = this; window.setInterval(function() { a.loadUpdate() }, g) }, afterAutoUpdate: function(a, g, h, c) { if (g == "collision") { this._need_update = true; return false } else { return true } }, fullSync: function() { if (this._need_update == true) { this._need_update = false; this.loadUpdate() } return true }, getUpdates: function(a, c) { if (this._update_busy) { return false } else { this._update_busy = true } this._loader = this._loader || new dtmlXMLLoaderObject(true); this._loader.async = true; this._loader.waitCall = c; this._loader.loadXML(a) }, _v: function(a) { if (a.firstChild) { return a.firstChild.nodeValue } return "" }, _a: function(a) { var g = []; for (var c = 0; c < a.length; c++) { g[c] = this._v(a[c]) } return g }, loadUpdate: function() { var c = this; var a = this.obj.getUserData(0, "version"); var g = this.serverProcessor + getUrlSymbol(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + a].join("&"); g = g.replace("editing=true&", ""); this.getUpdates(g, function() { var m = c._loader.doXPath("//userdata"); c.obj.setUserData(0, "version", c._v(m[0])); var h = c._loader.doXPath("//update"); if (h.length) { c._silent_mode = true; for (var n = 0; n < h.length; n++) { var l = h[n].getAttribute("status"); var q = h[n].getAttribute("id"); var o = h[n].getAttribute("parent"); switch (l) { case "inserted": c.callEvent("insertCallback", [h[n], q, o]); break; case "updated": c.callEvent("updateCallback", [h[n], q, o]); break; case "deleted": c.callEvent("deleteCallback", [h[n], q, o]); break } } c._silent_mode = false } c._update_busy = false; c = null }) } }; if (window.dhtmlXGridObject && !dhtmlXGridObject.prototype._init_point_connector) { dhtmlXGridObject.prototype._init_point_connector = dhtmlXGridObject.prototype._init_point; dhtmlXGridObject.prototype._init_point = function() { this._con_f_used = [].concat(this._con_f_used); dhtmlXGridObject.prototype._con_f_used = []; var a = function(l) { l = l.replace(/(\?|\&)connector[^\f]*/g, ""); return l + (l.indexOf("?") != -1 ? "&" : "?") + "connector=true" + (this.hdr.rows.length > 0 ? "&dhx_no_header=1" : "") }; var h = function(l) { return a.call(this, l) + (this._connector_sorting || "") + (this._connector_filter || "") }; var g = function(m, n, l) { this._connector_sorting = "&dhx_sort[" + n + "]=" + l; return h.call(this, m) }; var c = function(m, l, o) { var q = []; for (var n = 0; n < l.length; n++) { q[n] = "dhx_filter[" + l[n] + "]=" + encodeURIComponent(o[n]) } this._connector_filter = "&" + q.join("&"); return h.call(this, m) }; this.attachEvent("onCollectValues", function(l) { if (this._con_f_used[l]) { if (typeof(this._con_f_used[l]) == "object") { return this._con_f_used[l] } else { return false } } return true }); this.attachEvent("onDynXLS", function() { this.xmlFileUrl = h.call(this, this.xmlFileUrl); return true }); this.attachEvent("onBeforeSorting", function(o, n, m) { if (n == "connector") { var l = this; this.clearAndLoad(g.call(this, this.xmlFileUrl, o, m), function() { l.setSortImgState(true, o, m) }); return false } return true }); this.attachEvent("onFilterStart", function(m, l) { var o = this.getSortingState(); if (this._con_f_used.length) { var n = this; this.clearAndLoad(c.call(this, this.xmlFileUrl, m, l)); if (o.length) { n.setSortImgState(true, o[0], o[1]) } return false } return true }); this.attachEvent("onXLE", function(m, l, o, n) { if (!n) { return } }); if (this._init_point_connector) { this._init_point_connector() } }; dhtmlXGridObject.prototype._con_f_used = []; dhtmlXGridObject.prototype._in_header_connector_text_filter = function(c, a) { if (!this._con_f_used[a]) { this._con_f_used[a] = 1 } return this._in_header_text_filter(c, a) }; dhtmlXGridObject.prototype._in_header_connector_select_filter = function(c, a) { if (!this._con_f_used[a]) { this._con_f_used[a] = 2 } return this._in_header_select_filter(c, a) }; dhtmlXGridObject.prototype.load_connector = dhtmlXGridObject.prototype.load; dhtmlXGridObject.prototype.load = function(c, l, h) { if (!this._colls_loaded && this.cellType) { var a = []; for (var g = 0; g < this.cellType.length; g++) { if (this.cellType[g].indexOf("co") == 0 || this.cellType[g].indexOf("clist") == 0 || this._con_f_used[g] == 2) { a.push(g) } } if (a.length) { arguments[0] += (arguments[0].indexOf("?") != -1 ? "&" : "?") + "connector=true&dhx_colls=" + a.join(",") } } return this.load_connector.apply(this, arguments) }; dhtmlXGridObject.prototype._parseHead_connector = dhtmlXGridObject.prototype._parseHead; dhtmlXGridObject.prototype._parseHead = function(c, w, r) { this._parseHead_connector.apply(this, arguments); if (!this._colls_loaded) { var s = this.xmlLoader.doXPath("./coll_options", arguments[0]); for (var n = 0; n < s.length; n++) { var q = s[n].getAttribute("for"); var u = []; var h = null; if (this.cellType[q] == "combo") { h = this.getColumnCombo(q) } else { if (this.cellType[q].indexOf("co") == 0) { h = this.getCombo(q) } } var m = this.xmlLoader.doXPath("./item", s[n]); var a = []; for (var l = 0; l < m.length; l++) { var g = m[l].getAttribute("value"); if (h) { var o = m[l].getAttribute("label") || g; if (h.addOption) { a.push([g, o]) } else { h.put(g, o) } u[u.length] = o } else { u[u.length] = g } } if (a.length) { if (h) { h.addOption(a) } } else { if (u.length && !h) { if (this.registerCList) { this.registerCList(q * 1, u) } } } if (this._con_f_used[q * 1]) { this._con_f_used[q * 1] = u } } this._colls_loaded = true } } } if (window.dataProcessor && !dataProcessor.prototype.init_original) { dataProcessor.prototype.init_original = dataProcessor.prototype.init; dataProcessor.prototype.init = function(a) { this.init_original(a); a._dataprocessor = this; this.setTransactionMode("POST", true); this.serverProcessor += (this.serverProcessor.indexOf("?") != -1 ? "&" : "?") + "editing=true" } } dhtmlxError.catchError("LoadXML", function(h, g, l) { alert(l[0].responseText) }); function dhtmlXCellObject(g, a) { this.cell = document.createElement("DIV"); this.cell.className = "dhx_cell" + (a || ""); this._idd = g; this._isCell = true; this.conf = { borders: true, idx: {}, css: a || "", idx_data: { cont: "dhx_cell_cont", pr1: "dhx_cell_progress_bar", pr2: "dhx_cell_progress_img", menu: "dhx_cell_menu", toolbar: "dhx_cell_toolbar", ribbon: "dhx_cell_ribbon", sb: "dhx_cell_statusbar" }, ofs_nodes: { t: {}, b: {} } }; this.dataNodes = {}; this.views = {}; var c = document.createElement("DIV"); c.className = "dhx_cell_cont" + this.conf.css; this.cell.appendChild(c); c = null; this._updateIdx = function() { for (var h in this.conf.idx) { this.conf.idx[h] = null; delete this.conf.idx[h] } for (var n = 0; n < this.cell.childNodes.length; n++) { var l = this.cell.childNodes[n].className; for (var h in this.conf.idx_data) { var m = new RegExp(this.conf.idx_data[h]); if (l.match(m) != null) { this.conf.idx[h] = n } } } this.callEvent("_onIdxUpdated", []) }; this._adjustAttached = function() { for (var h in this.dataNodes) { if (this.dataNodes[h] != null && typeof(this.dataNodes[h].setSizes) == "function") { this.dataNodes[h].setSizes() } } if (this.dataObj != null && typeof(this.dataObj.setSizes) == "function") { this.dataObj.setSizes.apply(this.dataObj, arguments) } }; this._setSize = function(m, s, n, q, r, l, o) { if (!this.conf.size) { this.conf.size = {} } this.conf.size.x = m; this.conf.size.y = s; this.conf.size.w = n; this.conf.size.h = q; this.cell.style.left = m + "px"; this.cell.style.top = s + "px"; this.cell.style.width = n + "px"; this.cell.style.height = q + "px"; this.callEvent("_onSetSize", []); if (l !== true) { this._adjustCont(r, o) } else { this._adjustAttached(r) } this._adjustProgress() }; this._adjustCont = function(q, n) { var o = this.cell.childNodes[this.conf.idx.cont]; var m = 0; for (var h in this.conf.ofs_nodes.t) { var l = this.conf.ofs_nodes.t[h]; m += (l == "func" ? this[h]() : (l == true ? this.cell.childNodes[this.conf.idx[h]].offsetHeight : 0)) } var r = 0; for (var h in this.conf.ofs_nodes.b) { var l = this.conf.ofs_nodes.b[h]; r += (l == "func" ? this[h]() : (l == true ? this.cell.childNodes[this.conf.idx[h]].offsetHeight : 0)) } o.style.left = "0px"; o.style.top = m + "px"; if (!this.conf.cells_cont) { this.conf.cells_cont = {}; o.style.width = this.cell.offsetWidth + "px"; o.style.height = Math.max(this.cell.offsetHeight - m - r, 0) + "px"; this.conf.cells_cont.w = parseInt(o.style.width) - o.offsetWidth; this.conf.cells_cont.h = parseInt(o.style.height) - o.offsetHeight } o.style.left = "0px"; o.style.top = m + "px"; o.style.width = Math.max(this.cell.offsetWidth + this.conf.cells_cont.w, 0) + "px"; o.style.height = Math.max(this.conf.size.h - m - r + this.conf.cells_cont.h, 0) + "px"; o = null; this._adjustAttached(q); if (n == "expand" && this.dataType == "editor" && this.dataObj != null) { this.dataObj._prepareContent(true) } }; this._mtbUpdBorder = function() { var l = ["menu", "toolbar"]; for (var n = 0; n < l.length; n++) { if (this.conf.idx[l[n]] != null) { var o = this.cell.childNodes[this.conf.idx[l[n]]]; var m = "dhx_cell_" + l[n] + "_no_borders"; var h = "dhx_cell_" + l[n] + "_def"; o.className = o.className.replace(new RegExp(this.conf.borders ? m : h), this.conf.borders ? h : m); o = null } } }; this._resetSizeState = function() { this.conf.cells_cont = null }; this.conf.view = "def"; this.conf.views_loaded = {}; this.conf.views_loaded[this.conf.view] = true; this._viewSave = function(m) { this.views[m] = { borders: this.conf.borders, ofs_nodes: { t: {}, b: {} }, dataType: this.dataType, dataObj: this.dataObj, cellCont: [], dataNodes: {}, dataNodesCont: {} }; var n = this.cell.childNodes[this.conf.idx.cont]; while (n.childNodes.length > 0) { this.views[m].cellCont.push(n.firstChild); n.removeChild(n.firstChild) } this.dataType = null; this.dataObj = null; for (var l in this.dataNodes) { for (var h in this.conf.ofs_nodes) { if (typeof(this.conf.ofs_nodes[h][l]) != "undefined") { this.views[m].ofs_nodes[h][l] = this.conf.ofs_nodes[h][l]; this.conf.ofs_nodes[h][l] = null; delete this.conf.ofs_nodes[h][l] } } this.views[m].dataNodesCont[l] = this.cell.childNodes[this.conf.idx[l]]; this.cell.removeChild(this.cell.childNodes[this.conf.idx[l]]); this.views[m].dataNodes[l] = this.dataNodes[l]; this.dataNodes[l] = null; delete this.dataNodes[l]; this._updateIdx() } this.callEvent("_onViewSave", [m]) }; this._viewRestore = function(m) { if (this.views[m] == null) { return } this.dataObj = this.views[m].dataObj; this.dataType = this.views[m].dataType; for (var n = 0; n < this.views[m].cellCont.length; n++) { this.cell.childNodes[this.conf.idx.cont].appendChild(this.views[m].cellCont[n]) } for (var l in this.views[m].dataNodes) { this.dataNodes[l] = this.views[m].dataNodes[l]; if (l == "menu") { this.cell.insertBefore(this.views[m].dataNodesCont[l], this.cell.childNodes[this.conf.idx.toolbar || this.conf.idx.cont]) } if (l == "toolbar") { this.cell.insertBefore(this.views[m].dataNodesCont[l], this.cell.childNodes[this.conf.idx.cont]) } if (l == "sb") { this.cell.appendChild(this.views[m].dataNodesCont[l]) } this._updateIdx() } for (var l in this.views[m].ofs_nodes) { for (var h in this.views[m].ofs_nodes[l]) { this.conf.ofs_nodes[l][h] = this.views[m].ofs_nodes[l][h] } } if (this.conf.borders != this.views[m].borders) { this[this.views[m].borders ? "_showBorders" : "_hideBorders"](true) } this.callEvent("_onViewRestore", [m]); this._viewDelete(m) }; this._viewDelete = function(m) { if (this.views[m] == null) { return } this.views[m].borders = null; for (var l in this.views[m].ofs_nodes) { for (var h in this.views[m].ofs_nodes[l]) { this.views[m].ofs_nodes[l][h] = null } this.views[m].ofs_nodes[l] = null } this.views[m].dataType = null; this.views[m].dataObj = null; for (var n = 0; n < this.views[m].cellCont.length; n++) { this.views[m].cellCont[n] = null } this.views[m].cellCont = null; for (var l in this.views[m].dataNodes) { this.views[m].dataNodes[l] = null; this.views[m].dataNodesCont[l] = null } this.views[m].dataNodes = this.views[m].dataNodesCont = null; this.views[m] = null; delete this.views[m] }; window.dhx4._eventable(this); this._updateIdx(); return this } dhtmlXCellObject.prototype.showView = function(a) { if (this.conf.view == a) { return false } this._viewSave(this.conf.view); this._viewRestore(a); this._updateIdx(); this._adjustCont(); this.conf.view = a; var c = (typeof(this.conf.views_loaded[this.conf.view]) == "undefined"); this.conf.views_loaded[this.conf.view] = true; return c }; dhtmlXCellObject.prototype.getViewName = function() { return this.conf.view }; dhtmlXCellObject.prototype.unloadView = function(h) { if (h == this.conf.view) { var l = this.conf.unloading; this.conf.unloading = true; this.detachMenu(); this.detachToolbar(); this.detachStatusBar(); this.detachRibbon(); this._detachObject(null, true); this.conf.unloading = l; if (!this.conf.unloading) { this._adjustCont(this._idd) } return } if (this.views[h] == null) { return } var g = this.views[h]; for (var c in g.dataNodes) { if (typeof(g.dataNodes[c].unload) == "function") { g.dataNodes[c].unload() } g.dataNodes[c] = null; g.dataNodesCont[c] = null } if (g.dataType == "url") { if (g.cellCont != null && g.cellCont[0] != "null") { this._detachURLEvents(g.cellCont[0]) } } else { if (g.dataObj != null) { if (typeof(g.dataObj.unload) == "function") { g.dataObj.unload() } else { if (typeof(g.dataObj.destructor) == "function") { g.dataObj.destructor() } } g.dataObj = null } } g = null; this._viewDelete(h); if (typeof(this.conf.views_loaded[h]) != "undefined") { delete this.conf.views_loaded[h] } }; dhtmlXCellObject.prototype.getId = function() { return this._idd }; dhtmlXCellObject.prototype.progressOn = function() { if (this.conf.progress) { return } this.conf.progress = true; var c = document.createElement("DIV"); c.className = "dhx_cell_progress_bar"; this.cell.appendChild(c); var a = document.createElement("DIV"); a.className = "dhx_cell_progress_img"; this.cell.appendChild(a); c = a = null; this._updateIdx(); this._adjustProgress() }; dhtmlXCellObject.prototype.progressOff = function() { if (!this.conf.progress) { return } this.cell.childNodes[this.conf.idx.pr2].parentNode.removeChild(this.cell.childNodes[this.conf.idx.pr2]); this.cell.childNodes[this.conf.idx.pr1].parentNode.removeChild(this.cell.childNodes[this.conf.idx.pr1]); this.conf.progress = false; this._updateIdx() }; dhtmlXCellObject.prototype._adjustProgress = function() { if (this.conf.idx.pr1 == null) { return } if (!this.conf.pr) { this.conf.pr = {} } var c = this.cell.childNodes[this.conf.idx.pr1]; var a = this.cell.childNodes[this.conf.idx.pr2]; if (!this.conf.pr.ofs) { a.style.width = c.offsetWidth + "px"; a.style.height = c.offsetHeight + "px"; this.conf.pr.ofs = { w: a.offsetWidth - a.clientWidth, h: a.offsetHeight - a.clientHeight } } a.style.width = c.offsetWidth - this.conf.pr.ofs.w + "px"; a.style.height = c.offsetHeight - this.conf.pr.ofs.h + "px"; c = a = null }; dhtmlXCellObject.prototype._showBorders = function(a) { if (this.conf.borders) { return } this.conf.borders = true; this.cell.childNodes[this.conf.idx.cont].className = "dhx_cell_cont" + this.conf.css; this.conf.cells_cont = null; this._mtbUpdBorder(); this.callEvent("_onBorderChange", [true]); if (a !== true) { this._adjustCont(this._idd) } }; dhtmlXCellObject.prototype._hideBorders = function(a) { if (!this.conf.borders) { return } this.conf.borders = false; this.cell.childNodes[this.conf.idx.cont].className = "dhx_cell_cont" + this.conf.css + " dhx_cell_cont_no_borders"; this.conf.cells_cont = null; this._mtbUpdBorder(); this.callEvent("_onBorderChange", [false]); if (a !== true) { this._adjustCont(this._idd) } }; dhtmlXCellObject.prototype._getWidth = function() { return this.cell.offsetWidth }; dhtmlXCellObject.prototype._getHeight = function() { return this.cell.offsetHeight }; dhtmlXCellObject.prototype.showInnerScroll = function() { this.cell.childNodes[this.conf.idx.cont].style.overflow = "auto" }; dhtmlXCellObject.prototype._unload = function() { this.conf.unloading = true; this.callEvent("_onCellUnload", []); this.progressOff(); this.unloadView(this.conf.view); this.dataNodes = null; this.cell.parentNode.removeChild(this.cell); this.cell = null; window.dhx4._eventable(this, "clear"); for (var c in this.views) { this.unloadView(c) } this.conf = null; for (var c in this) { this[c] = null } }; dhtmlXCellObject.prototype.attachObject = function(l, g) { if (window.dhx4.s2b(g) && !(typeof(window.dhtmlXWindowsCell) != "undefined" && (this instanceof window.dhtmlXWindowsCell))) { g = false } if (typeof(l) == "string") { l = document.getElementById(l) } if (l.parentNode == this.cell.childNodes[this.conf.idx.cont]) { l = null; return } if (g) { l.style.display = ""; var a = l.offsetWidth; var c = l.offsetHeight } this._attachObject(l); this.dataType = "obj"; l.style.display = ""; l = null; if (g) { this._adjustByCont(a, c) } }; dhtmlXCellObject.prototype.appendObject = function(a) { if (typeof(a) == "string") { a = document.getElementById(a) } if (a.parentNode == this.cell.childNodes[this.conf.idx.cont]) { a = null; return } if (!this.conf.append_mode) { this.cell.childNodes[this.conf.idx.cont].style.overflow = "auto"; this.conf.append_mode = true } this._attachObject(a, null, null, true); this.dataType = "obj"; a.style.display = ""; a = null }; dhtmlXCellObject.prototype.detachObject = function(c, a) { this._detachObject(null, c, a) }; dhtmlXCellObject.prototype.getAttachedMenu = function() { return this.dataNodes.menu }; dhtmlXCellObject.prototype.getAttachedToolbar = function() { return this.dataNodes.toolbar }; dhtmlXCellObject.prototype.getAttachedRibbon = function() { return this.dataNodes.ribbon }; dhtmlXCellObject.prototype.getAttachedStatusBar = function() { return this.dataNodes.sb }; dhtmlXCellObject.prototype.getAttachedObject = function() { return this.dataObj }; dhtmlXCellObject.prototype.attachURL = function(c, r, g) { if (g == true) { g = {} } var h = (typeof(g) != "undefined" && g != false && g != null); if (!this.conf.url_data) { this.conf.url_data = {} } this.conf.url_data.url = c; this.conf.url_data.ajax = (r == true); this.conf.url_data.post_data = (g == true ? {} : (g || null)); if (r == true) { var q = this; if (h) { var l = ""; for (var o in g) { l += "&" + encodeURIComponent(o) + "=" + encodeURIComponent(g[o]) } dhx4.ajax.post(c, l, function(a) { q.attachHTMLString("