R34915 - in /trunk/phpgwapi/js/dhtmlxtree/dhtmlxMenu: codebase/dhtmlxmenu.js sources/dhtmlxmenu.js

Author: igel457
New Revision: 34915

URL: http://www.egroupware.org/viewvc/egroupware?rev=34915&view=rev
Log:
Fixed problem with context menu opening into the wrong direction if a vertical scrollbar is available. Notified developers.

Modified:
trunk/phpgwapi/js/dhtmlxtree/dhtmlxMenu/codebase/dhtmlxmenu.js
trunk/phpgwapi/js/dhtmlxtree/dhtmlxMenu/sources/dhtmlxmenu.js

Modified: trunk/phpgwapi/js/dhtmlxtree/dhtmlxMenu/codebase/dhtmlxmenu.js
URL: http://www.egroupware.org/viewvc/egroupware/trunk/phpgwapi/js/dhtmlxtree/dhtmlxMenu/codebase/dhtmlxmenu.js?rev=34915&r1=34914&r2=34915&view=diff

— trunk/phpgwapi/js/dhtmlxtree/dhtmlxMenu/codebase/dhtmlxmenu.js (original)
+++ trunk/phpgwapi/js/dhtmlxtree/dhtmlxMenu/codebase/dhtmlxmenu.js Sun May 8 21:57:01 2011
@@ -21,7 +21,7 @@
case “dhx_web”:
this._topLevelBottomMargin = 2;this._topLevelRightMargin = 1;this._topLevelOffsetLeft = 1;this._arrowFFFix = (_isIE?(document.compatMode==“BackCompat”?0:-4):-4);break;case “dhx_web”:
this._arrowFFFix = 0;break;};if (this.base.autoSkinUpdate){this.base.className = this.base.className.replace("dhtmlxMenu"+oldSkin+“Middle", “”)+" dhtmlxMenu”+this.skin+"_Middle";};for (var a in this.idPull){this.idPull[a].className = String(this.idPull[a].className).replace(oldSkin, this.skin);}};this.setSkin(this.skin);this.dLoad = false;this.dLoadUrl = “”;this.dLoadSign = “?”;this.loaderIcon = false;this.limit = 0;this._scrollUpTM = null;this._scrollUpTMTime = 20;this._scrollUpTMStep = 3;this._scrollDownTM = null;this._scrollDownTMTime = 20;this._scrollDownTMStep = 3;this.context = false;this.contextZones = {};this.contextMenuZoneId = false;this.contextAutoShow = true;this.contextAutoHide = true;this.contextHideAllMode = true;this.sxDacProc = null;this.dacSpeed = 10;this.dacCycles = [];for (var q=0;q<10;q++){this.dacCycles[q] = q;};this.dacSpeedIE = 10;this.dacCyclesIE = [];for (var q=0;q<10;q++){this.dacCyclesIE[q] = q;};this._enableDacSupport = function(dac) {this.s
xDacProc = dac;};this._selectedSubItems = new Array();this._openedPolygons = new Array();this._addSubItemToSelected = function(item, polygon) {var t = true;for (var q=0;q<this._selectedSubItems.length;q++){if ((this._selectedSubItems[q][0] == item)&& (this._selectedSubItems[q][1] == polygon)) {t = false;}};if (t == true){this._selectedSubItems.push(new Array(item, polygon));};return t;};this._removeSubItemFromSelected = function(item, polygon) {var m = new Array();var t = false;for (var q=0;q<this._selectedSubItems.length;q++){if ((this._selectedSubItems[q][0] == item)&& (this._selectedSubItems[q][1] == polygon)) {t = true;}else {m[m.length] = this._selectedSubItems[q];}};if (t == true){this._selectedSubItems = m;};return t;};this._getSubItemToDeselectByPolygon = function(polygon) {var m = new Array();for (var q=0;q<this._selectedSubItems.length;q++){if (this._selectedSubItems[q][1] == polygon){m[m.length] = this._selectedSubItems[q][0];m = m.concat(this._getSubItemToDeselec
tByPolygon(this._selectedSubItems[q][0]));var t = true;for (var w=0;w<this._openedPolygons.length;w++){if (this.openedPolygons[w] == this.selectedSubItems[q][0]){t = false;}};if (t == true){this.openedPolygons[this.openedPolygons.length] = this.selectedSubItems[q][0];};this.selectedSubItems[q][0] = -1;this.selectedSubItems[q][1] = -1;}};return m;};this.hidePolygon = function(id) {if (this.idPull["polygon" + id] != null){if ((this.sxDacProc != null)&& (this.idPull["sxDac" + id] != null)) {this.idPull["sxDac"+id].hide();}else {if (this.idPull["polygon"+id].style.display == “none”)return;this.idPull["polygon"+id].style.display = “none”;if (this.idPull["arrowup"+id] != null){this.idPull["arrowup"+id].style.display = “none”;};if (this.idPull["arrowdown"+id] != null){this.idPull["arrowdown"+id].style.display = “none”;};this.updateItemComplexState(id, true, false);if (this.isIE6){if (this.idPull["polygon"+id+“ie6cover"] != null){this.idPull["polygon”+id+“ie6
cover"].style.display = “none”;}};id = String(id).replace(this.idPrefix, “”);if (id == this.topId)id = null;this.callEvent(“onHide”, [id]);}}};this.showPolygon = function(id, openType) {var itemCount = this.countVisiblePolygonItems(id);if (itemCount == 0)return;var pId = "polygon"+id;if ((this.idPull[pId] != null)&& (this.idPull[id] != null)) {if (this.menuModeTopLevelTimeout && this.menuMode == “web” && !this.context){if (!this.idPull[id].mouseOver && openType == this.dirTopLevel)return;};if (!this.fixedPosition)this.autoDetectVisibleArea();var arrUpH = 0;var arrDownH = 0;var arrowUp = null;var arrowDown = null;if (this.limit > 0 && this.limit < itemCount){var auId = "arrowup"+id;var adId = "arrowdown"+id;if (this.idPull["arrowup"+id] == null)this.addUpArrow(String(id).replace(this.idPrefix,""));if (this.idPull["arrowdown"+id] == null)this.addDownArrow(String(id).replace(this.idPrefix,""));arrowUp = this.idPull["arrowup"+id];arrowUp.style.visibility = “hidden”;a
rrowUp.style.display = “”;arrowUp.style.zIndex = this.zInd;arrUpH = arrowUp.offsetHeight;arrowDown = this.idPull["arrowdown
”+id];arrowDown.style.visibility = “hidden”;arrowDown.style.display = “”;arrowDown.style.zIndex = this.zInd;arrDownH = arrowDown.offsetHeight;};this.idPull[pId].style.visibility = “hidden”;this.idPull[pId].style.left = “0px”;this.idPull[pId].style.top = “0px”;this.idPull[pId].style.display = “”;this.idPull[pId].style.zIndex = this.zInd;if (this.limit > 0){if (this.limit < itemCount){this.idPull[pId].style.height = 24*this.limit+“px”;this.idPull[pId].scrollTop = 0;}else {this.idPull[pId].style.height = “”;}};this.zInd += this.zIndStep;if (this.itemPull[id] != null){var parPoly = "polygon
"+this.itemPull[id][“parent”];}else if (this.context){var parPoly = this.idPull[this.idPrefix+this.topId];};var srcX = (this.idPull[id].tagName != null ? getAbsoluteLeft(this.idPull[id]) : this.idPull[id][0]);var srcY = (this.idPull[id].tagName != null ? getAbsoluteTop(t
his.idPull[id]) : this.idPull[id][1]);var srcW = (this.idPull[id].tagName != null ? this.idPull[id].offsetWidth : 0);var srcH = (this.idPull[id].tagName != null ? this.idPull[id].offsetHeight + arrUpH + arrDownH : 0);var x = 0;var y = 0;var w = this.idPull[pId].offsetWidth;var h = this.idPull[pId].offsetHeight;if (openType == “bottom”){if (this._rtl){x = srcX + (srcW!=null?srcW:0) - w;}else {if (this._align == “right”){x = srcX + srcW - w;}else {x = srcX - 1 + (openType==this.dirTopLevel?this._topLevelRightMargin:0);}};y = srcY - 1 + srcH - arrUpH - arrDownH + this._topLevelBottomMargin;};if (openType == “right”){x = srcX + srcW - 1;y = srcY + 2;};if (openType == “left”){x = srcX - this.idPull[pId].offsetWidth + 2;y = srcY + 2;};if (openType == “top”){x = srcX - 1;y = srcY - h + 2;};if (this.fixedPosition){var mx = 65536;var my = 65536;}else {var mx = (this.menuX2!=null?this.menuX2:0);var my = (this.menuY2!=null?this.menuY2:0);if (mx == 0){if (window.innerWidth){mx = window.
innerWidth;my = window.innerHeight;}else {mx = document.body.offsetWidth;my = document.body.scrollHeight;}}};if (x+w > mx && !this._rtl){x = srcX - w + 2;};if (x < this.menuX1 && this.rtl){x = srcX + srcW - 2;};if (x < 0){x = 0;};if (y+h > my && this.menuY2 != null){var sy = Math.max((isIE?document.documentElement:document.getElementsByTagName(“html”)[0]).scrollTop,document.body.scrollTop);y = Math.max(srcY + srcH - h - sy + 2, 2) + sy;if(y<2)y=2;if (this.itemPull[id] != null && !this.context){if (this.itemPull[id][“parent”] == this.idPrefix+this.topId)y = y - this.base.offsetHeight;}};this.idPull[pId].style.left = x+“px”;this.idPull[pId].style.top = y+arrUpH+“px”;if ((this.sxDacProc != null)&& (this.idPull["sxDac" + id] != null)) {this.idPull["sxDac"+id]._show();}else {this.idPull[pId].style.visibility = “”;if (this.limit > 0 && this.limit < itemCount){arrowUp.style.left = x+“px”;arrowUp.style.top = y+“px”;arrowUp.style.width = w+this._arrowFFFix+“px”;arrowUp.style.visi
bility = “”;arrowDown.style.left = x+“px”;arrowDown.style.top = y+arrUpH+h+“px”;arrowDown.style.width = w+this._arrowFFFix+“px”;arrowDown.style.visibility = “”;this._checkArrowsState(id);};if (this._isIE6){var pIdIE6 = pId+“ie6cover";if (this.idPull[pIdIE6] == null){var ifr = document.createElement(“IFRAME”);ifr.className = "dhtmlxMenu_IE6CoverFix”+this.skin;ifr.frameBorder = 0;ifr.setAttribute(“src”, “javascript:false;”);document.body.insertBefore(ifr, document.body.firstChild);this.idPull[pIdIE6] = ifr;};this.idPull[pIdIE6].style.left = this.idPull[pId].style.left;this.idPull[pIdIE6].style.top = this.idPull[pId].style.top;this.idPull[pIdIE6].style.width = this.idPull[pId].offsetWidth+“px”;this.idPull[pIdIE6].style.height = this.idPull[pId].offsetHeight+“px”;this.idPull[pIdIE6].style.zIndex = this.idPull[pId].style.zIndex-1;this.idPull[pIdIE6].style.display = “”;};id = String(id).replace(this.idPrefix, “”);if (id == this.topId)id = null;this.callEvent(“onShow”, [id]);}}};
this._redistribSubLevelSelection = function(id, parentId) {while (this._openedPolygons.length > 0)this._openedPolygons.pop();var i = this._getSubItemToDeselectByPolygon(parentId);this._removeSubItemFromSelected(-1, -1);for (var q=0;q<i.length;q++){if ((this.idPull[i[q]] != null)&& (i[q] != id)) {if (this.itemPull[i[q]][“state”] == “enabled”){this.idPull[i[q]].className = “sub_item”;}}};for (var q=0;q<this._openedPolygons.length;q++){if (this._openedPolygons[q] != parentId){this._hidePolygon(this._openedPolygons[q]);}};if (this.itemPull[id][“state”] == “enabled”){this.idPull[id].className = “sub_item_selected”;if (this.itemPull[id][“complex”] && this.dLoad && (this.itemPull[id][“loaded”]==“no”)) {if (this.loaderIcon == true){this._updateLoaderIcon(id, true);};var xmlLoader = new dtmlXMLLoaderObject(this.xmlParser, window);this.itemPull[id][“loaded”] = “get”;this.callEvent(“onXLS”, []);xmlLoader.loadXML(this.dLoadUrl+this.dLoadSign+“action=loadMenu&parentId=”+id.replace(this.
idPrefix,"")+"&etc="+new Date().getTime());};if (this.itemPull[id][“complex”] || (this.dLoad && (this.itemPull[id][“loaded”] == “yes”))) {if ((this.itemPull[id][“complex”])&& (this.idPull["polygon
" + id] != null)) {this._updateItemComplexState(id, true, true);this._showPolygon(id, this.dirSubLevel);}};this._addSubItemToSelected(id, parentId);this.menuSelected = id;}};this._doOnClick = function(id, type, casState) {this.menuLastClicked = id;if (this.itemPull[this.idPrefix+id][“href_link”] != null){var form = document.createElement(“FORM”);var k = String(this.itemPull[this.idPrefix+id][“href_link”]).split("?");form.action = k[0];if (k[1] != null){var p = String(k[1]).split("&");for (var q=0;q<p.length;q++){var j = String(p[q]).split("=");var m = document.createElement(“INPUT”);m.type = “hidden”;m.name = (j[0]||"");m.value = (j[1]||"");form.appendChild(m);}};if (this.itemPull[this.idPrefix+id][“href_target”] != null){form.target = this.itemPull[this.idPrefix+id][“href_target”]
;};form.style.display = “none”;document.body.appendChild(form);form.submit();if (form != null){document.body.removeChild(form);form = null;};return;};if (type.charAt(0)==“c”) return;if (type.charAt(1)==“d”) return;if (type.charAt(2)==“s”) return;if (this.checkEvent(“onClick”)) {this._clearAndHide();if (this._isContextMenuVisible()&& this.contextAutoHide) this._hideContextMenu();this.callEvent(“onClick”, [id, this.contextMenuZoneId, casState]);}else {if ((type.charAt(1)== “d”) || (this.menuMode == “win” && type.charAt(2) == “t”)) return;this._clearAndHide();if (this._isContextMenuVisible()&& this.contextAutoHide) this._hideContextMenu();}};this._doOnTouchMenu = function(id) {if (this.menuTouched == false){this.menuTouched = true;if (this.checkEvent(“onTouch”)) {this.callEvent(“onTouch”, [id]);}}};this._searchMenuNode = function(node, menu) {var m = new Array();for (var q=0;q<menu.length;q++){if (typeof(menu[q])== “object”) {if (menu[q].length == 5){if (typeof(menu[q][0])!= “o
bject”) {if ((menu[q][0].replace(this.idPrefix, “”)== node) && (q == 0)) {m = menu;}}};var j = this._searchMenuNode(node, menu[q]);if (j.length > 0){m = j;}}};return m;};this._getMenuNodes = function(node) {var m = new Array;for (var a in this.itemPull){if (this.itemPull[a][“parent”] == node){m[m.length] = a;}};return m;};this._genStr = function(w) {var s = “”;var z = “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789”;for (var q=0;q<w;q++)s += z.charAt(Math.round(Math.random() * (z.length-1)));return s;};this.getItemType = function(id) {id = this.idPrefix+id;if (this.itemPull[id] == null){return null;};return this.itemPull[id][“type”];};this.forEachItem = function(handler) {for (var a in this.itemPull){handler(String(a).replace(this.idPrefix, “”));}};this._clearAndHide = function() {main_self.menuSelected = -1;main_self.menuLastClicked = -1;while (main_self._openedPolygons.length > 0){main_self._openedPolygons.pop();};for (var q=0;q<main_self._selectedSubItems.
length;q++){var id = main_self.selectedSubItems[q][0];if (main_self.idPull[id] != null){if (main_self.itemPull[id][“state”] == “enabled”){if (main_self.idPull[id].className == “sub_item_selected”)main_self.idPull[id].className = “sub_item”;if (main_self.idPull[id].className == "dhtmlxMenu"+main_self.skin+“TopLevel_Item_Selected"){if (main_self.itemPull[id][“cssNormal”] != null){main_self.idPull[id].className = main_self.itemPull[id][“cssNormal”];}else {main_self.idPull[id].className = "dhtmlxMenu”+main_self.skin+"_TopLevel_Item_Normal";}}}};main_self._hidePolygon(id);};main_self.menuTouched = false;if (main_self.context){if (main_self.contextHideAllMode){main_self._hidePolygon(main_self.idPrefix+main_self.topId);main_self.zInd = main_self.zIndInit;}else {main_self.zInd = main_self.zIndInit+main_self.zIndStep;}}};this._doOnLoad = function() {};this.loadXML = function(xmlFile, onLoadFunction) {if (onLoadFunction)this._doOnLoad = function() {onLoadFunction();};this.callEven
t(“onXLS”, []);this._xmlLoader.loadXML(xmlFile);};this.loadXMLString = function(xmlString, onLoadFunction) {if (onLoadFunction)this._doOnLoad = function() {onLoadFunction();};this._xmlLoader.loadXMLString(xmlString);};this.buildMenu = function(t, parentId) {var u = 0;for (var q=0;q<t.childNodes.length;q++){if (t.childNodes[q].tagName == this.itemTagName){var r = t.childNodes[q];var item = {};item[“id”] = this.idPrefix+(r.getAttribute(“id”)||this.genStr(24));item[“title”] = r.getAttribute(“text”)||"";item[“imgen”] = r.getAttribute(“img”)||"";item[“imgdis”] = r.getAttribute(“imgdis”)||"";item[“tip”] = “”;item[“hotkey”] = “”;if (r.getAttribute(“cssNormal”)!= null) {item[“cssNormal”] = r.getAttribute(“cssNormal”);};item[“type”] = r.getAttribute(“type”)||“item”;if (item[“type”] == “checkbox”){item[“checked”] = (r.getAttribute(“checked”)!=null);item[“imgen”] = "chbx"+(item[“checked”]?“1”:“0”);item[“imgdis”] = item[“imgen”];};if (item[“type”] == “radio”){item[“checked”] = (r.get
Attribute(“checked”)!=null);item[“imgen”] = "rdbt
"+(item[“checked”]?“1”:“0”);item[“imgdis”] = item[“imgen”];item[“group”] = r.getAttribute(“group”)||this._genStr(24);if (this.radio[item[“group”]]==null){this.radio[item[“group”]] = new Array();};this.radio[item[“group”]][this.radio[item[“group”]].length] = item[“id”];};item[“state”] = (r.getAttribute(“enabled”)!=null||r.getAttribute(“disabled”)!=null?(r.getAttribute(“enabled”)==“false”||r.getAttribute(“disabled”)==“true”?“disabled”:“enabled”):“enabled”);item[“parent”] = (parentId!=null?parentId:this.idPrefix+this.topId);item[“complex”] = (this.dLoad?(r.getAttribute(“complex”)!=null?true:false):(this.buildMenu(r,item[“id”])>0));if (this.dLoad && item[“complex”]){item[“loaded”] = “no”;};this.itemPull[item[“id”]] = item;for (var w=0;w<r.childNodes.length;w++){var tagNm = r.childNodes[w].tagName;if (tagNm != null){tagNm = tagNm.toLowerCase();};if (tagNm == this.userDataTagName){var d = r.childNodes[w];if (d.getAttribute(“name”)
!=null) {this.userData[item[“id”]+"
"+d.getAttribute(“name”)] = (d.firstChild.nodeValue!=null?d.firstChild.nodeValue:"");}};if (tagNm == this.itemTextTagName){item[“title”] = r.childNodes[w].firstChild.nodeValue;};if (tagNm == this.itemTipTagName){item[“tip”] = r.childNodes[w].firstChild.nodeValue;};if (tagNm == this.itemHotKeyTagName){item[“hotkey”] = r.childNodes[w].firstChild.nodeValue;};if (tagNm == this.itemHrefTagName && item[“type”] == “item”){item[“href_link”] = r.childNodes[w].firstChild.nodeValue;if (r.childNodes[w].getAttribute(“target”)!= null) {item[“href_target”] = r.childNodes[w].getAttribute(“target”);}}};u++;}};return u;};this._xmlParser = function() {if (main_self.dLoad){var t = this.getXMLTopNode(“menu”);parentId = (t.getAttribute(“parentId”)!=null?t.getAttribute(“parentId”):null);if (parentId == null){main_self._buildMenu(t, null);main_self._initTopLevelMenu();}else {main_self._buildMenu(t, main_self.idPrefix+parentId);main_self._addSubMenuPolygon(main_se
lf.idPrefix+parentId, main_self.idPrefix+parentId);if (main_self.menuSelected == main_self.idPrefix+parentId){var pId = main_self.idPrefix+parentId;var isTop = main_self.itemPull[main_self.idPrefix+parentId][“parent”]==main_self.idPrefix+main_self.topId;var level = ((isTop&&(!main_self.context))?main_self.dirTopLevel:main_self.dirSubLevel);var isShow = false;if (isTop && main_self.menuModeTopLevelTimeout && main_self.menuMode == “web” && !main_self.context){var item = main_self.idPull[main_self.idPrefix+parentId];if (item._mouseOver == true){var delay = main_self.menuModeTopLevelTimeoutTime - (new Date().getTime()-item._dynLoadTM);if (delay > 1){item._menuOpenTM = window.setTimeout(function(){main_self._showPolygon(pId, level);}, delay);isShow = true;}}};if (!isShow){main_self._showPolygon(pId, level);}};main_self.itemPull[main_self.idPrefix+parentId][“loaded”] = “yes”;if (main_self.loaderIcon == true){main_self._updateLoaderIcon(main_self.idPrefix+parentId, false);}};this.d
estructor();main_self.callEvent(“onXLE”,[]);}else {var t = this.getXMLTopNode(“menu”);main_self._buildMenu(t, null);main_self.init();main_self.callEvent(“onXLE”,[]);main_self.doOnLoad();}};this.xmlLoader = new dtmlXMLLoaderObject(this.xmlParser, window);this.showSubLevelItem = function(id,back) {if (document.getElementById("arrow" + this.idPrefix + id)!= null) {document.getElementById("arrow" + this.idPrefix + id).style.display = (back?“none”:"");};if (document.getElementById("image" + this.idPrefix + id)!= null) {document.getElementById("image" + this.idPrefix + id).style.display = (back?“none”:"");};if (document.getElementById(this.idPrefix + id)!= null) {document.getElementById(this.idPrefix + id).style.display = (back?"":“none”);}};this._hideSubLevelItem = function(id) {this._showSubLevelItem(id,true)

  • };this.idPrefix = this._genStr(12);this._bodyClick = function(e) {e = e||event;if (e.button == 2 || (_isOpera && e.ctrlKey == true)) return;if (main_self.context){if (main_self.contextAutoHide && (!_isOpera || (main_self._isContextMenuVisible()&& _isOpera))) main_self._hideContextMenu();}else {main_self._clearAndHide();}};this._bodyContext = function(e) {e = e||event;var t = (e.srcElement||e.target).className;if (t.search(“dhtmlxMenu”)!= -1 && t.search(“SubLevelArea”) != -1) return;var toHide = true;var testZone = e.target || e.srcElement;if (testZone.id != null)if (main_self.isContextZone(testZone.id)) toHide = false;if (testZone == document.body)toHide = false;if (toHide)main_self.hideContextMenu();};if (_isIE){document.body.attachEvent(“onclick”, this._bodyClick);document.body.attachEvent(“oncontextmenu”, this._bodyContext);}else {window.addEventListener(“click”, this._bodyClick, false);window.addEventListener(“contextmenu”, this._bodyContext, false);};this.UID = this.
    genStr(32);dhtmlxMenuObjectLiveInstances[this._UID] = this;dhtmlxEventable(this);return this;};dhtmlXMenuObject.prototype.init = function() {if (this._isInited == true)return;if (this.dLoad){this.callEvent(“onXLS”, []);this._xmlLoader.loadXML(this.dLoadUrl+this.dLoadSign+“action=loadMenu&etc=”+new Date().getTime());}else {this._initTopLevelMenu();this._isInited = true;}};dhtmlXMenuObject.prototype._countVisiblePolygonItems = function(id) {var count = 0;for (var a in this.itemPull){var par = this.itemPull[a][“parent”];var tp = this.itemPull[a][“type”];if (this.idPull[a] != null){if (par == id && (tp == “item” || tp == “radio” || tp == “checkbox”)&& this.idPull[a].style.display != “none”) {count++;}}};return count;};dhtmlXMenuObject.prototype.redefineComplexState = function(id) {if (this.idPrefix+this.topId == id){return;};if ((this.idPull["polygon"+id] != null)&& (this.idPull[id] != null)) {var u = this._countVisiblePolygonItems(id);if ((u > 0)&& (!this.itemPull[id][“comple
    x”])) {this._updateItemComplexState(id, true, false);};if ((u == 0)&& (this.itemPull[id][“complex”])) {this._updateItemComplexState(id, false, false);}}};dhtmlXMenuObject.prototype._updateItemComplexState = function(id, state, over) {if ((!this.context)&& (this._getItemLevelType(id.replace(this.idPrefix,"")) == “TopLevel”)) {this.itemPull[id][“complex”] = state;return;};if ((this.idPull[id] == null)|| (this.itemPull[id] == null)) {return;};this.itemPull[id][“complex”] = state;if (id == this.idPrefix+this.topId)return;var arrowObj = null;var item = this.idPull[id].childNodes[this.rtl?0:2];if (item.childNodes[0])if (String(item.childNodes[0].className).search(“complex_arrow”) === 0) arrowObj = item.childNodes[0];if (this.itemPull[id][“complex”]){if (arrowObj == null){arrowObj = document.createElement(“DIV”);arrowObj.className = “complex_arrow”;arrowObj.id = "arrow"+id;while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);item.appendChild(arrowObj);};if (this
    .dLoad && (this.itemPull[id][“loaded”] == “get”)&& this.loaderIcon) {if (arrowObj.className != “complex_arrow_loading”)arrowObj.className = “complex_arrow_loading”;}else {arrowObj.className = “complex_arrow”;};return;};if ((!this.itemPull[id][“complex”])&& (arrowObj!=null)) {item.removeChild(arrowObj);if (this.itemPull[id][“hotkey_backup”] != null && this.setHotKey){this.setHotKey(id.replace(this.idPrefix, “”), this.itemPull[id][“hotkey_backup”]);}}};dhtmlXMenuObject.prototype._getItemLevelType = function(id) {return (this.itemPull[this.idPrefix+id][“parent”]==this.idPrefix+this.topId?“TopLevel”:“SubLevelArea”);};dhtmlXMenuObject.prototype._redistribTopLevelSelection = function(id, parent) {var i = this._getSubItemToDeselectByPolygon(“parent”);this._removeSubItemFromSelected(-1, -1);for (var q=0;q<i.length;q++){if (i[q] != id){this.hidePolygon(i[q]);};if ((this.idPull[i[q]] != null)&& (i[q] != id)) {this.idPull[i[q]].className = this.idPull[i[q]].className.replace(/Selected
    /g, “Normal”);}};if (this.itemPull[this.idPrefix+id][“state”] == “enabled”){this.idPull[this.idPrefix+id].className = "dhtmlxMenu
    "+this.skin+"_TopLevel_Item_Selected";this._addSubItemToSelected(this.idPrefix+id, “parent”);this.menuSelected = (this.menuMode==“win”?(this.menuSelected!=-1?id:this.menuSelected):id);if ((this.itemPull[this.idPrefix+id][“complex”])&& (this.menuSelected != -1)) {this._showPolygon(this.idPrefix+id, this.dirTopLevel);}}};dhtmlXMenuObject.prototype._initTopLevelMenu = function() {this.dirTopLevel = “bottom”;this.dirSubLevel = (this._rtl?“left”:“right”);if (this.context){this.idPull[this.idPrefix+this.topId] = new Array(0,0);this._addSubMenuPolygon(this.idPrefix+this.topId, this.idPrefix+this.topId);}else {var m = this._getMenuNodes(this.idPrefix + this.topId);for (var q=0;q<m.length;q++){if (this.itemPull[m[q]][“type”] == “item”)this._renderToplevelItem(m[q], null);if (this.itemPull[m[q]][“type”] == “separator”)this.renderSeparator(m[q], null);}}};d
    htmlXMenuObject.prototype.renderToplevelItem = function(id, pos) {var main_self = this;var m = document.createElement(“DIV”);m.id = id;if (this.itemPull[id][“state”] == “enabled” && this.itemPull[id][“cssNormal”] != null){m.className = this.itemPull[id][“cssNormal”];}else {m.className = "dhtmlxMenu"+this.skin+“TopLevel_Item”+(this.itemPull[id][“state”]==“enabled”?“Normal”:“Disabled”);};if (this.itemPull[id][“title”] != “”){var t1 = document.createElement(“DIV”);t1.className = “top_level_text”;t1.innerHTML = this.itemPull[id][“title”];m.appendChild(t1);};if (this.itemPull[id][“tip”].length > 0)m.title = this.itemPull[id][“tip”];if ((this.itemPull[id][“imgen”]!="")||(this.itemPull[id][“imgdis”]!="")) {var imgTop=this.itemPull[id][(this.itemPull[id][“state”]==“enabled”)?“imgen”:“imgdis”];if (imgTop){var img = document.createElement(“IMG”);img.border = “0”;img.id = "image
    "+id;img.src= this.imagePath+imgTop;img.className = “dhtmlxMenu_TopLevel_Item_Icon”;if (m.childNodes.len
    gth > 0 && !this._rtl)m.insertBefore(img, m.childNodes[0]);else m.appendChild(img);}};m.onselectstart = function(e) {e = e || event;e.returnValue = false;return false;};m.oncontextmenu = function(e) {e = e || event;e.returnValue = false;return false;};if (!this.cont){this.cont = document.createElement(“DIV”);this.cont.dir = “ltr”;this.cont.className = (this._align==“right”?“align_right”:“align_left”);this.base.appendChild(this.cont);};if (pos != null){pos++;if (pos < 0)pos = 0;if (pos > this.cont.childNodes.length - 1)pos = null;};if (pos != null)this.cont.insertBefore(m, this.cont.childNodes[pos]);else this.cont.appendChild(m);this.idPull[m.id] = m;if (this.itemPull[id][“complex”] && (!this.dLoad)) this._addSubMenuPolygon(this.itemPull[id][“id”], this.itemPull[id][“id”]);m.onmouseover = function() {if (main_self.menuMode == “web”){window.clearTimeout(main_self.menuTimeoutHandler);};var i = main_self._getSubItemToDeselectByPolygon(“parent”);main_self._removeSubItemFromSelect
    ed(-1, -1);for (var q=0;q<i.length;q++){if (i[q] != this.id){main_self.hidePolygon(i[q]);};if ((main_self.idPull[i[q]] != null)&& (i[q] != this.id)) {if (main_self.itemPull[i[q]][“cssNormal”] != null){main_self.idPull[i[q]].className = main_self.itemPull[i[q]][“cssNormal”];}else {if (main_self.idPull[i[q]].className == “sub_item_selected”)main_self.idPull[i[q]].className = “sub_item”;main_self.idPull[i[q]].className = main_self.idPull[i[q]].className.replace(/Selected/g, “Normal”);}}};if (main_self.itemPull[this.id][“state”] == “enabled”){this.className = "dhtmlxMenu"+main_self.skin+"_TopLevel_Item_Selected";main_self._addSubItemToSelected(this.id, “parent”);main_self.menuSelected = (main_self.menuMode==“win”?(main_self.menuSelected!=-1?this.id:main_self.menuSelected):this.id);if (main_self.dLoad && (main_self.itemPull[this.id][“loaded”]==“no”)) {if (main_self.menuModeTopLevelTimeout && main_self.menuMode == “web” && !main_self.context){this._mouseOver = true;this._dynLoad
    TM = new Date().getTime();};var xmlLoader = new dtmlXMLLoaderObject(main_self._xmlParser, window);main_self.itemPull[this.id][“loaded”] = “get”;main_self.callEvent(“onXLS”, []);xmlLoader.loadXML(main_self.dLoadUrl+main_self.dLoadSign+“action=loadMenu&parentId=”+this.id.replace(main_self.idPrefix,"")+"&etc="+new Date().getTime());};if ((!main_self.dLoad)|| (main_self.dLoad && (main_self.itemPull[this.id][“loaded”]==“yes”))) {if ((main_self.itemPull[this.id][“complex”])&& (main_self.menuSelected != -1)) {if (main_self.menuModeTopLevelTimeout && main_self.menuMode == “web” && !main_self.context){this._mouseOver = true;var showItemId = this.id;this._menuOpenTM = window.setTimeout(function(){main_self._showPolygon(showItemId, main_self.dirTopLevel);}, main_self.menuModeTopLevelTimeoutTime);}else {main_self._showPolygon(this.id, main_self.dirTopLevel);}}}};main_self.doOnTouchMenu(this.id.replace(main_self.idPrefix, “”));};m.onmouseout = function() {if (!((main_self.itemPull[this.
    id][“complex”])&& (main_self.menuSelected != -1)) && (main_self.itemPull[this.id][“state”]==“enabled”)) {if (main_self.itemPull[this.id][“cssNormal”] != null){m.className = main_self.itemPull[this.id][“cssNormal”];}else {m.className = "dhtmlxMenu
    "+main_self.skin+"_TopLevel_Item_Normal";}};if (main_self.menuMode == “web”){window.clearTimeout(main_self.menuTimeoutHandler);main_self.menuTimeoutHandler = window.setTimeout(function(){main_self._clearAndHide();}, main_self.menuTimeoutMsec, “JavaScript”);};if (main_self.menuModeTopLevelTimeout && main_self.menuMode == “web” && !main_self.context){this._mouseOver = false;window.clearTimeout(this._menuOpenTM);}};m.onclick = function(e) {if (main_self.menuMode == “web”){window.clearTimeout(main_self.menuTimeoutHandler);};if (main_self.menuMode != “web” && main_self.itemPull[this.id][“state”] == “disabled”){return;};e = e || event;e.cancelBubble = true;e.returnValue = false;if (main_self.menuMode == “win”){if (main_self.itemPull[this.
    id][“complex”]){if (main_self.menuSelected == this.id){main_self.menuSelected = -1;var s = false;}else {main_self.menuSelected = this.id;var s = true;};if (s){main_self._showPolygon(this.id, main_self.dirTopLevel);}else {main_self._hidePolygon(this.id);}}};var tc = (main_self.itemPull[this.id][“complex”]?“c”:"-");var td = (main_self.itemPull[this.id][“state”]!=“enabled”?“d”:"-");var cas = {“ctrl”: e.ctrlKey, “alt”: e.altKey, “shift”: e.shiftKey};main_self.doOnClick(this.id.replace(main_self.idPrefix, “”), tc+td+“t”, cas);return false;}};dhtmlXMenuObject.prototype.setImagePath = function() {};dhtmlXMenuObject.prototype.setIconsPath = function(path) {this.imagePath = path;};dhtmlXMenuObject.prototype.setIconPath = dhtmlXMenuObject.prototype.setIconsPath;dhtmlXMenuObject.prototype.updateItemImage = function(id, levelType) {id = this.idPrefix+id;var isTopLevel = (this.itemPull[id][“parent”] == this.idPrefix+this.topId && !this.context);var imgObj = null;if (isTopLevel){for (va
    r q=0;q<this.idPull[id].childNodes.length;q++){try {if (this.idPull[id].childNodes[q].className == “dhtmlxMenu_TopLevel_Item_Icon”)imgObj = this.idPull[id].childNodes[q];}catch(e) {}}}else {try {var imgObj = this.idPull[id].childNodes[this.rtl?2:0].childNodes[0];}catch(e) {}};if (this.itemPull[id][“type”] == “radio”){var imgSrc = this.itemPull[id][(this.itemPull[id][“state”]==“enabled”?“imgen”:“imgdis”)];}else {var imgSrc = this.itemPull[id][(this.itemPull[id][“state”]==“enabled”?“imgen”:“imgdis”)];};if (imgSrc.length > 0){if (imgObj != null){imgObj.src = this.imagePath+imgSrc;}else {if (isTopLevel){var imgObj = document.createElement(“IMG”);imgObj.className = “dhtmlxMenu_TopLevel_Item_Icon”;imgObj.src = this.imagePath+imgSrc;imgObj.border = “0”;imgObj.id = "image"+id;if (!this.rtl && this.idPull[id].childNodes.length > 0)this.idPull[id].insertBefore(imgObj,this.idPull[id].childNodes[0]);else this.idPull[id].appendChild(imgObj);}else {var imgObj = document.createElement(“
    IMG”);imgObj.className = “sub_icon”;imgObj.src = this.imagePath+imgSrc;imgObj.border = “0”;imgObj.id = "image
    "+id;var item = this.idPull[id].childNodes[this.rtl?2:0];while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);item.appendChild(imgObj);}}}else {if (imgObj != null)imgObj.parentNode.removeChild(imgObj);}};dhtmlXMenuObject.prototype.removeItem = function(id, isTId, recCall) {if (!isTId)id = this.idPrefix + id;var pId = null;if (id != this.idPrefix+this.topId){if (this.itemPull[id] == null)return;var t = this.itemPull[id][“type”];if (t == “separator”){var item = this.idPull["separator"+id];if (this.itemPull[id][“parent”] == this.idPrefix+this.topId){item.onclick = null;item.onselectstart = null;item.id = null;item.parentNode.removeChild(item);}else {item.childNodes[0].childNodes[0].onclick = null;item.childNodes[0].childNodes[0].onselectstart = null;item.childNodes[0].childNodes[0].id = null;item.childNodes[0].removeChild(item.childNodes[0].childN
    odes[0]);item.removeChild(item.childNodes[0]);item.parentNode.removeChild(item);};this.idPull["separator
    "+id] = null;this.itemPull[id] = null;delete this.idPull["separator
    "+id];delete this.itemPull[id];item = null;}else {pId = this.itemPull[id][“parent”];var item = this.idPull[id];item.onclick = null;item.oncontextmenu = null;item.onmouseover = null;item.onmouseout = null;item.onselectstart = null;item.id = null;while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);item.parentNode.removeChild(item);this.idPull[id] = null;this.itemPull[id] = null;delete this.idPull[id];delete this.itemPull[id];item = null;};t = null;};for (var a in this.itemPull)if (this.itemPull[a][“parent”] == id)this.removeItem(a, true, true);var p2 = new Array(id);if (pId != null && !recCall){if (this.idPull["polygon"+pId] != null){if (this.idPull["polygon
    "+pId].tbd.childNodes.length == 0){p2.push(pId);this.updateItemComplexState(pId, false, false);}}};for (var q=0;q<p2.length;q++){
    if (this.idPull["polygon
    "+p2[q]]){var p = this.idPull["polygon
    "+p2[q]];p.onclick = null;p.oncontextmenu = null;p.tbl.removeChild(p.tbd);p.tbd = null;p.removeChild(p.tbl);p.tbl = null;p.id = null;p.parentNode.removeChild§;p = null;if (this.isIE6){var pc = "polygon"+p2[q]+“ie6cover";if (this.idPull[pc] != null){document.body.removeChild(this.idPull[pc]);delete this.idPull[pc];}};if (this.idPull["arrowup”+id] != null && this.removeArrow)this.removeArrow("arrowup"+id);if (this.idPull["arrowdown"+id] != null && this.removeArrow)this.removeArrow("arrowdown"+id);this.idPull["polygon"+p2[q]] = null;delete this.idPull["polygon
    "+p2[q]];}};p2 = null;};dhtmlXMenuObject.prototype._getAllParents = function(id) {var parents = new Array();for (var a in this.itemPull){if (this.itemPull[a][“parent”] == id){parents[parents.length] = this.itemPull[a][“id”];if (this.itemPull[a][“complex”]){var t = this._getAllParents(this.itemPull[a][“id”]);for (var q=0;q<t.length;q++){parents[p
    arents.length] = t[q];}}}};return parents;};dhtmlXMenuObject.prototype.renderAsContextMenu = function() {this.context = true;if (this.base.autoSkinUpdate == true){this.base.className = this.base.className.replace("dhtmlxMenu"+this.skin+"_Middle","");this.base._autoSkinUpdate = false;};if (this.addBaseIdAsContextZone != null){this.addContextZone(this.addBaseIdAsContextZone);}};dhtmlXMenuObject.prototype.addContextZone = function(zoneId) {if (zoneId == document.body){zoneId = “document.body.”+this.idPrefix;var zone = document.body;}else {var zone = document.getElementById(zoneId);};var zoneExists = false;for (var a in this.contextZones){zoneExists = zoneExists || (a == zoneId) || (this.contextZones[a] == zone);};if (zoneExists == true)return false;this.contextZones[zoneId] = zone;var main_self = this;if (_isOpera){this.operaContext = function(e){main_self._doOnContextMenuOpera(e, main_self);};zone.addEventListener(“mouseup”, this.operaContext, false);}else {if (zone.oncontex
    tmenu != null && !zone._oldContextMenuHandler)zone._oldContextMenuHandler = zone.oncontextmenu;zone.oncontextmenu = function(e) {for (var q in dhtmlxMenuObjectLiveInstances){if (q != main_self._UID){if (dhtmlxMenuObjectLiveInstances[q].context){dhtmlxMenuObjectLiveInstances[q]._hideContextMenu();}}};e = e||event;e.cancelBubble = true;e.returnValue = false;main_self._doOnContextBeforeCall(e, this);return false;}}};dhtmlXMenuObject.prototype._doOnContextMenuOpera = function(e, main_self) {for (var q in dhtmlxMenuObjectLiveInstances){if (q != main_self._UID){if (dhtmlxMenuObjectLiveInstances[q].context){dhtmlxMenuObjectLiveInstances[q]._hideContextMenu();}}};e.cancelBubble = true;e.returnValue = false;if (e.button == 0 && e.ctrlKey == true){main_self._doOnContextBeforeCall(e, this);};return false;};dhtmlXMenuObject.prototype.removeContextZone = function(zoneId) {if (!this.isContextZone(zoneId)) return false;if (zoneId == document.body)zoneId = “document.body.”+this.idPrefix;var
    zone = this.contextZones[zoneId];if (_isOpera){zone.removeEventListener(“mouseup”, this.operaContext, false);}else {zone.oncontextmenu = (zone._oldContextMenuHandler!=null?zone._oldContextMenuHandler:null);zone.oldContextMenuHandler = null;};try {this.contextZones[zoneId] = null;delete this.contextZones[zoneId];}catch(e){};return true;};dhtmlXMenuObject.prototype.isContextZone = function(zoneId) {if (zoneId == document.body && this.contextZones[“document.body.”+this.idPrefix] != null)return true;var isZone = false;if (this.contextZones[zoneId] != null){if (this.contextZones[zoneId] == document.getElementById(zoneId)) isZone = true;};return isZone;};dhtmlXMenuObject.prototype.isContextMenuVisible = function() {if (this.idPull["polygon"+this.idPrefix+this.topId] == null)return false;return (this.idPull["polygon"+this.idPrefix+this.topId].style.display == “”);};dhtmlXMenuObject.prototype._showContextMenu = function(x, y, zoneId) {this.clearAndHide();if (this.idPull["polyg
    on
    "+this.idPrefix+this.topId] == null)return false;window.clearTimeout(this.menuTimeoutHandler);this.idPull[this.idPrefix+this.topId] = new Array(x, y);this._showPolygon(this.idPrefix+this.topId, “bottom”);this.callEvent(“onContextMenu”, [zoneId]);};dhtmlXMenuObject.prototype.hideContextMenu = function() {if (this.idPull["polygon"+this.idPrefix+this.topId] == null)return false;this._clearAndHide();this._hidePolygon(this.idPrefix+this.topId);this.zInd = this.zIndInit;};dhtmlXMenuObject.prototype._doOnContextBeforeCall = function(e, cZone) {this.contextMenuZoneId = cZone.id;this._clearAndHide();this._hideContextMenu();var p = (e.srcElement||e.target);var px = (_isIE||_isOpera||_KHTMLrv?e.offsetX:e.layerX);var py = (_isIE||_isOpera||_KHTMLrv?e.offsetY:e.layerY);var mx = getAbsoluteLeft§+px;var my = getAbsoluteTop§+py;if (this.checkEvent(“onBeforeContextMenu”)) {if (this.callEvent(“onBeforeContextMenu”, [cZone.id])) {if (this.contextAutoShow){this._showContextMenu(mx, my)
    ;this.callEvent(“onAfterContextMenu”, [cZone.id]);}}}else {if (this.contextAutoShow){this._showContextMenu(mx, my);this.callEvent(“onAfterContextMenu”, [cZone.id]);}}};dhtmlXMenuObject.prototype.showContextMenu = function(x, y) {this._showContextMenu(x, y, false);};dhtmlXMenuObject.prototype.hideContextMenu = function() {this.hideContextMenu();};dhtmlXMenuObject.prototype.autoDetectVisibleArea = function() {if (this.isVisibleArea)return;this.menuX1 = document.body.scrollLeft;this.menuX2 = this.menuX1+(window.innerWidth||document.body.clientWidth);this.menuY1 = Math.max((isIE?document.documentElement:document.getElementsByTagName(“html”)[0]).scrollTop, document.body.scrollTop);this.menuY2 = this.menuY1+(isIE?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight);};dhtmlXMenuObject.prototype.getItemPosition = function(id) {id = this.idPrefix+id;var pos = -1;if (this.itemPull[id] == null
    )return pos;var parent = this.itemPull[id][“parent”];var obj = (this.idPull["polygon
    "+parent]!=null?this.idPull["polygon
    "+parent].tbd:this.cont);for (var q=0;q<obj.childNodes.length;q++){if (obj.childNodes[q]==this.idPull["separator
    "+id]||obj.childNodes[q]==this.idPull[id]){pos = q;}};return pos;};dhtmlXMenuObject.prototype.setItemPosition = function(id, pos) {id = this.idPrefix+id;if (this.idPull[id] == null){return;};var isOnTopLevel = (this.itemPull[id][“parent”] == this.idPrefix+this.topId);var itemData = this.idPull[id];var itemPos = this.getItemPosition(id.replace(this.idPrefix,""));var parent = this.itemPull[id][“parent”];var obj = (this.idPull["polygon
    "+parent]!=null?this.idPull["polygon
    "+parent].tbd:this.cont);obj.removeChild(obj.childNodes[itemPos]);if (pos < 0)pos = 0;if (isOnTopLevel && pos < 1){pos = 1;};if (pos < obj.childNodes.length){obj.insertBefore(itemData, obj.childNodes[pos]);}else {obj.appendChild(itemData);}};dhtmlXMenuObject.prototype.getParentId
    = function(id) {id = this.idPrefix+id;if (this.itemPull[id] == null){return null;};return ((this.itemPull[id][“parent”]!=null?this.itemPull[id][“parent”]:this.topId).replace(this.idPrefix,""));};dhtmlXMenuObject.prototype.addNewSibling = function(nextToId, itemId, itemText, disabled, imgEnabled, imgDisabled) {var id = this.idPrefix+(itemId!=null?itemId:this._genStr(24));var parentId = this.idPrefix+(nextToId!=null?this.getParentId(nextToId):this.topId);this._addItemIntoGlobalStrorage(id, parentId, itemText, “item”, disabled, imgEnabled, imgDisabled);if ((parentId == this.idPrefix+this.topId)&& (!this.context)) {this._renderToplevelItem(id, this.getItemPosition(nextToId));}else {this._renderSublevelItem(id, this.getItemPosition(nextToId));}};dhtmlXMenuObject.prototype.addNewChild = function(parentId, pos, itemId, itemText, disabled, imgEnabled, imgDisabled) {if (parentId == null){if (this.context){parentId = this.topId;}else {this.addNewSibling(parentId, itemId, itemText, di
    sabled, imgEnabled, imgDisabled);if (pos != null)this.setItemPosition(itemId, pos);return;}};itemId = this.idPrefix+(itemId!=null?itemId:this._genStr(24));if (this.setHotKey)this.setHotKey(parentId, “”);parentId = this.idPrefix+parentId;this.addItemIntoGlobalStrorage(itemId, parentId, itemText, “item”, disabled, imgEnabled, imgDisabled);if (this.idPull["polygon"+parentId] == null){this._renderSublevelPolygon(parentId, parentId);};this._renderSublevelItem(itemId, pos-1);this._redefineComplexState(parentId);};dhtmlXMenuObject.prototype._addItemIntoGlobalStrorage = function(itemId, itemParentId, itemText, itemType, disabled, img, imgDis) {var item = {id: itemId,
  • };this.idPrefix = this._genStr(12);this._bodyClick = function(e) {e = e||event;if (e.button == 2 || (_isOpera && e.ctrlKey == true)) return;if (main_self.context){if (main_self.contextAutoHide && (!_isOpera || (main_self._isContextMenuVisible()&& _isOpera))) main_self._hideContextMenu();}else {main_self._clearAndHide();}};this._bodyContext = function(e) {e = e||event;var t = (e.srcElement||e.target).className;if (t.search(“dhtmlxMenu”)!= -1 && t.search(“SubLevelArea”) != -1) return;var toHide = true;var testZone = e.target || e.srcElement;if (testZone.id != null)if (main_self.isContextZone(testZone.id)) toHide = false;if (testZone == document.body)toHide = false;if (toHide)main_self.hideContextMenu();};if (_isIE){document.body.attachEvent(“onclick”, this._bodyClick);document.body.attachEvent(“oncontextmenu”, this._bodyContext);}else {window.addEventListener(“click”, this._bodyClick, false);window.addEventListener(“contextmenu”, this._bodyContext, false);};this.UID = this.
    genStr(32);dhtmlxMenuObjectLiveInstances[this._UID] = this;dhtmlxEventable(this);return this;};dhtmlXMenuObject.prototype.init = function() {if (this._isInited == true)return;if (this.dLoad){this.callEvent(“onXLS”, []);this._xmlLoader.loadXML(this.dLoadUrl+this.dLoadSign+“action=loadMenu&etc=”+new Date().getTime());}else {this._initTopLevelMenu();this._isInited = true;}};dhtmlXMenuObject.prototype._countVisiblePolygonItems = function(id) {var count = 0;for (var a in this.itemPull){var par = this.itemPull[a][“parent”];var tp = this.itemPull[a][“type”];if (this.idPull[a] != null){if (par == id && (tp == “item” || tp == “radio” || tp == “checkbox”)&& this.idPull[a].style.display != “none”) {count++;}}};return count;};dhtmlXMenuObject.prototype.redefineComplexState = function(id) {if (this.idPrefix+this.topId == id){return;};if ((this.idPull["polygon"+id] != null)&& (this.idPull[id] != null)) {var u = this._countVisiblePolygonItems(id);if ((u > 0)&& (!this.itemPull[id][“comple
    x”])) {this._updateItemComplexState(id, true, false);};if ((u == 0)&& (this.itemPull[id][“complex”])) {this._updateItemComplexState(id, false, false);}}};dhtmlXMenuObject.prototype._updateItemComplexState = function(id, state, over) {if ((!this.context)&& (this._getItemLevelType(id.replace(this.idPrefix,"")) == “TopLevel”)) {this.itemPull[id][“complex”] = state;return;};if ((this.idPull[id] == null)|| (this.itemPull[id] == null)) {return;};this.itemPull[id][“complex”] = state;if (id == this.idPrefix+this.topId)return;var arrowObj = null;var item = this.idPull[id].childNodes[this.rtl?0:2];if (item.childNodes[0])if (String(item.childNodes[0].className).search(“complex_arrow”) === 0) arrowObj = item.childNodes[0];if (this.itemPull[id][“complex”]){if (arrowObj == null){arrowObj = document.createElement(“DIV”);arrowObj.className = “complex_arrow”;arrowObj.id = "arrow"+id;while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);item.appendChild(arrowObj);};if (this
    .dLoad && (this.itemPull[id][“loaded”] == “get”)&& this.loaderIcon) {if (arrowObj.className != “complex_arrow_loading”)arrowObj.className = “complex_arrow_loading”;}else {arrowObj.className = “complex_arrow”;};return;};if ((!this.itemPull[id][“complex”])&& (arrowObj!=null)) {item.removeChild(arrowObj);if (this.itemPull[id][“hotkey_backup”] != null && this.setHotKey){this.setHotKey(id.replace(this.idPrefix, “”), this.itemPull[id][“hotkey_backup”]);}}};dhtmlXMenuObject.prototype._getItemLevelType = function(id) {return (this.itemPull[this.idPrefix+id][“parent”]==this.idPrefix+this.topId?“TopLevel”:“SubLevelArea”);};dhtmlXMenuObject.prototype._redistribTopLevelSelection = function(id, parent) {var i = this._getSubItemToDeselectByPolygon(“parent”);this._removeSubItemFromSelected(-1, -1);for (var q=0;q<i.length;q++){if (i[q] != id){this.hidePolygon(i[q]);};if ((this.idPull[i[q]] != null)&& (i[q] != id)) {this.idPull[i[q]].className = this.idPull[i[q]].className.replace(/Selected
    /g, “Normal”);}};if (this.itemPull[this.idPrefix+id][“state”] == “enabled”){this.idPull[this.idPrefix+id].className = "dhtmlxMenu
    "+this.skin+"_TopLevel_Item_Selected";this._addSubItemToSelected(this.idPrefix+id, “parent”);this.menuSelected = (this.menuMode==“win”?(this.menuSelected!=-1?id:this.menuSelected):id);if ((this.itemPull[this.idPrefix+id][“complex”])&& (this.menuSelected != -1)) {this._showPolygon(this.idPrefix+id, this.dirTopLevel);}}};dhtmlXMenuObject.prototype._initTopLevelMenu = function() {this.dirTopLevel = “bottom”;this.dirSubLevel = (this._rtl?“left”:“right”);if (this.context){this.idPull[this.idPrefix+this.topId] = new Array(0,0);this._addSubMenuPolygon(this.idPrefix+this.topId, this.idPrefix+this.topId);}else {var m = this._getMenuNodes(this.idPrefix + this.topId);for (var q=0;q<m.length;q++){if (this.itemPull[m[q]][“type”] == “item”)this._renderToplevelItem(m[q], null);if (this.itemPull[m[q]][“type”] == “separator”)this._renderSeparator(m[q], null);}}};d
    htmlXMenuObject.prototype.renderToplevelItem = function(id, pos) {var main_self = this;var m = document.createElement(“DIV”);m.id = id;if (this.itemPull[id][“state”] == “enabled” && this.itemPull[id][“cssNormal”] != null){m.className = this.itemPull[id][“cssNormal”];}else {m.className = "dhtmlxMenu"+this.skin+“TopLevel_Item”+(this.itemPull[id][“state”]==“enabled”?“Normal”:“Disabled”);};if (this.itemPull[id][“title”] != “”){var t1 = document.createElement(“DIV”);t1.className = “top_level_text”;t1.innerHTML = this.itemPull[id][“title”];m.appendChild(t1);};if (this.itemPull[id][“tip”].length > 0)m.title = this.itemPull[id][“tip”];