function isIE50() { return isIE5() && !isIE55();}
function isIE55() { return navigator.userAgent.indexOf("MSIE 5.5") > -1;}
function isIE5() { return navigator.userAgent.indexOf("MSIE 5") > -1;}
function isIE6() { return ((navigator.userAgent.indexOf("MSIE 6") > -1 && navigator.userAgent.indexOf("Opera") == -1) || isIE7());}
function isIE7() { return navigator.userAgent.indexOf("MSIE 7") > -1;}
function isIE() { return isIE5() || isIE6();}
function isOpera() { return navigator.userAgent.indexOf("Opera") > -1;}
function isSafari() { return navigator.userAgent.indexOf("Safari") > -1;}
function getPageMode() { if (document.compatMode) { switch (document.compatMode) { case "BackCompat":
return 0; case "CSS1Compat":
return 1; case "QuirksMode":
return 0;}
}
else { if (ie5) { return 0;}
if (safari) { return 1;}
}
return 0;}
function getElmId(id) { return document.getElementById(id);}
function createElm(tagName) { return document.createElement(tagName);}
function getX(e) { if (!e) { var e = window.event;}
if (safari) { return e.clientX - getScrollLeft();}
else { return e.clientX;}
}
function getY(e) { if (!e) { var e = window.event;}
if (safari) { return e.clientY - getScrollTop();}
else { return e.clientY;}
}
function getScrollLeft() { switch (pageMode) { case 0:
return document.body.scrollLeft; case 1:
if (document.documentElement && document.documentElement.scrollLeft > 0) { return document.documentElement.scrollLeft;}
else { return document.body.scrollLeft;}
}
}
function getScrollTop() { switch (pageMode) { case 0:
return document.body.scrollTop; case 1:
if (document.documentElement && document.documentElement.scrollTop > 0) { return document.documentElement.scrollTop;}
else { return document.body.scrollTop;}
}
}
function getClientHeight() { switch (pageMode) { case 0:
return document.body.clientHeight; case 1:
if (safari) { return self.innerHeight;}
else { if (!opera && document.documentElement && document.documentElement.clientHeight > 0) { return document.documentElement.clientHeight;}
else { return document.body.clientHeight;}
}
}
}
function getClientWidth() { switch (pageMode) { case 0:
return document.body.clientWidth; case 1:
if (safari) { return self.innerWidth;}
else { if (!opera && document.documentElement && document.documentElement.clientWidth > 0) { return document.documentElement.clientWidth;}
else { return document.body.clientWidth;}
}
}
}
function toCamelCase(input) { var inputArray = input.split("-"); if (inputArray.length == 1) { return inputArray[0];}
else { var camelCase = inputArray[0]; for (var i = 1, len = inputArray.length; i < len; i++) { camelCase += inputArray[i].charAt(0).toUpperCase() + inputArray[i].substring(1);}
return camelCase;}
}
function getPropVal(obj, propertyName) { var propertyValue = obj.style[toCamelCase(propertyName)]; if (propertyValue) { return propertyValue;}
else { if (document.defaultView && document.defaultView.getComputedStyle) { return document.defaultView.getComputedStyle(obj, null).getPropertyValue(propertyName);}
else { if (obj.currentStyle) { return obj.currentStyle[toCamelCase(propertyName)];}
else { return null;}
}
}
}
function getPropIntVal(obj, propertyName) { return parseInt(getPropVal(obj, propertyName));}
function getMainMenuLeftPos(menuObj, x) { if (x + menuObj.offsetWidth <= getClientWidth()) { return x;}
else { return x - menuObj.offsetWidth;}
}
function getMainMenuTopPos(menuObj, y) { if (y + menuObj.offsetHeight <= getClientHeight()) { return y;}
else { return y - menuObj.offsetHeight;}
}
function getSubMenuLeftPos(menuObj, x, offset) { if (x + menuObj.offsetWidth - 2 <= getClientWidth()) { return x - 2;}
else { return x - menuObj.offsetWidth - offset;}
}
function getSubMenuTopPos(menuObj, y, offset) { var top = getPropIntVal(menuObj, btw); var bottom = getPropIntVal(menuObj, bbw); if (y + menuObj.offsetHeight <= getClientHeight()) { if (safari) { return y - top;}
else { return y;}
}
else { if (safari) { return y - menuObj.offsetHeight + offset + bottom;}
else { return y - menuObj.offsetHeight + offset + top + bottom;}
}
}
function popUpSubMenu(menuItemObj) { var parentMenuObj = menuItemObj.parent.menuObj; var menuObj = menuItemObj.subMenu.menuObj; var x; var y; if (parentMenuObj.style.position == "fixed") { x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth - getPropIntVal(parentMenuObj, brw); y = parentMenuObj.offsetTop + menuItemObj.offsetTop + getPropIntVal(parentMenuObj, btw) - getPropIntVal(menuObj, btw); menuObj.style.position = "absolute"; menuObj.style.left = getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + px; menuObj.style.top = getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight) + px; menuObj.style.position = "fixed";}
else { if (parentMenuObj.mode == "static" && !ie50) { x = menuItemObj.offsetLeft + parentMenuObj.offsetWidth - getPropIntVal(parentMenuObj, blw) - getPropIntVal(parentMenuObj, brw) - getScrollLeft(); y = menuItemObj.offsetTop - getPropIntVal(menuObj, btw) - getScrollTop(); if (ie55 || ie6) { x += getPropIntVal(parentMenuObj, blw); y += getPropIntVal(parentMenuObj, btw);}
if (safari) { x += 8; y += getPropIntVal(menuObj, btw) + 13;}
menuObj.style.left = (getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + getScrollLeft()) + px; menuObj.style.top = (getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight) + getScrollTop()) + px;}
else { x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth - getPropIntVal(parentMenuObj, brw) - getScrollLeft(); y = parentMenuObj.offsetTop + menuItemObj.offsetTop + getPropIntVal(parentMenuObj, btw) - getPropIntVal(menuObj, btw) - getScrollTop(); menuObj.style.left = (getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + getScrollLeft()) + px; menuObj.style.top = (getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight) + getScrollTop()) + px;}
}
if (ie && menuObj.mode == "fixed") { menuObj.initialLeft = parseInt(menuObj.style.left) - getScrollLeft(); menuObj.initialTop = parseInt(menuObj.style.top) - getScrollTop();}
menuObj.style.visibility = "visible";}
function popUpMainMenu(menuObj, e) { menuObj.style.left = (getMainMenuLeftPos(menuObj, getX(e)) + getScrollLeft()) + px; menuObj.style.top = (getMainMenuTopPos(menuObj, getY(e)) + getScrollTop()) + px; var display = popUpMenuObj.menuObj.style.display; popUpMenuObj.menuObj.style.display = "none"; popUpMenuObj.menuObj.style.visibility = "visible"; popUpMenuObj.menuObj.style.display = display;}
function refreshMenuItems(menuObj) { for (var i = 0, len = menuObj.childNodes.length; i < len; i++) { if (menuObj.childNodes[i].enabled) { menuObj.childNodes[i].className = menuObj.childNodes[i].itemClassName; if (menuObj.childNodes[i].subMenu) { menuObj.childNodes[i].arrowObj.className = menuObj.childNodes[i].arrowClassName;}
if (menuObj.childNodes[i].iconObj) { menuObj.childNodes[i].iconObj.className = menuObj.childNodes[i].iconClassName;}
}
}
}
function menuItemOver(e) { var previousItem = this.parent.previousItem; if (previousItem) { if (previousItem.className == previousItem.itemClassNameOver) { previousItem.className = previousItem.itemClassName;}
if (previousItem.subMenu) { previousItem.className = previousItem.itemClassName; previousItem.arrowObj.className = previousItem.arrowClassName; if (previousItem.iconObj) { previousItem.iconObj.className = previousItem.iconClassName;}
}
var menuObj = getElmId(this.parent.menuObj.id); for (var i = 0, len = menuObj.childNodes.length; i < len; i++) { if (menuObj.childNodes[i].enabled && menuObj.childNodes[i].subMenu) { hideMenus(menuObj.childNodes[i].subMenu.menuObj);}
}
}
if (this.enabled) { this.className = this.itemClassNameOver; if (this.subMenu) { this.arrowObj.className = this.arrowClassNameOver; popUpSubMenu(this);}
if (this.iconObj && this.iconClassNameOver) { this.iconObj.className = this.iconClassNameOver;}
}
this.parent.previousItem = this;}
function menuItemClick(e) { if (this.enabled && this.actionOnClick) { var action = this.actionOnClick; if (action.indexOf("link:") == 0) { location.href = action.substr(5);}
else { if (action.indexOf("code:") == 0) { eval(action.substr(5));}
else { location.href = action;}
}
}
if (!e) { var e = window.event; e.cancelBubble = true;}
if (e.stopPropagation) { e.stopPropagation();}
if (this.parent.menuObj.mode == "cursor") { hideCursorMenus();}
if (this.parent.menuObj.mode == "absolute" || this.parent.menuObj.mode == "fixed") { hideVisibleMenus(); if (typeof(hideMenuBarMenus) == "function") { hideMenuBarMenus();}
}
}
function menuItemOut() { if (this.enabled) { if (!(this.subMenu && this.subMenu.menuObj.style.visibility == "visible")) { this.className = this.itemClassName;}
if (this.subMenu) { if (this.subMenu.menuObj.style.visibility == "visible") { this.arrowObj.className = this.arrowClassNameOver; if (this.iconObj) { this.iconObj.className = this.iconClassNameOver;}
}
}
else { if (this.iconObj) { this.iconObj.className = this.iconClassName;}
}
}
}
function findMatch(tagName, tagId, filter) { for (var i = 0, len = filter.length; i < len; i++) { var filterArray = filter[i].toLowerCase().split("."); if ((filterArray[0] == "*" && filterArray[1] == "*") || (filterArray[0] == "*" && filterArray[1] == tagId) || (filterArray[0] == tagName && filterArray[1] == "*") || (filterArray[0] == tagName && filterArray[1] == tagId)) { return true;}
}
return false;}
function canShowMenu(tagName, tagId, allExcept, noneExcept) { return true; if (allExcept.length > 0) { return (!findMatch(tagName.toLowerCase(), tagId.toLowerCase(), allExcept));}
else { if (noneExcept.length > 0) { return findMatch(tagName.toLowerCase(), tagId.toLowerCase(), noneExcept);}
else { return true;}
}
}
function activatePopUpMenu(e) { if (!popUpMenuObj) { return;}
if (isIE)
{ e.cancelBubble=true; e.returnValue = false;}
var state = popUpMenuObj.menuObj.style.visibility; if (state == "visible") { for (var i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if (menuObj.mode == "cursor") { menuObj.style.visibility = "hidden"; menuObj.style.left = "0px"; menuObj.style.top = "0px"; menuObj.initialLeft = 0; menuObj.initialTop = 0; refreshMenuItems(menuObj);}
}
}
else { if (!e) { var e = window.event;}
var targetElm = (e.target) ? e.target : e.srcElement; if (targetElm.nodeType == 3) { targetElm = targetElm.parentNode;}
if (canShowMenu(targetElm.tagName, targetElm.id, popUpMenuObj.menuObj.allExceptFilter, popUpMenuObj.menuObj.noneExceptFilter)) { popUpMainMenu(popUpMenuObj.menuObj, e);}
}
}
function leftClickHandler(e) { if (getX(e) > getClientWidth() || getY(e) > getClientHeight()) { return;}
if (!e) { var e = window.event;}
if (e.button && e.button == 2) { return;}
hideVisibleMenus(); if (typeof(hideMenuBarMenus) == "function") { hideMenuBarMenus();}
if (popUpMenuObj) { var state = popUpMenuObj.menuObj.style.visibility; if (state == "visible" && (hideValue == 0 || hideValue == 2)) { activatePopUpMenu(e);}
if ((state == "hidden" || state == "") && (showValue == 0 || showValue == 2)) { activatePopUpMenu(e);}
}
}
function getPopupMenuName(id)
{ var idStr = new String(id); rExp = /webfx-tree-object-|-icon|-anchor|-plus|-indent-[0-9]+/gi; idStr = idStr.replace(rExp,""); return "menu_" + idStr.replace(/-/g,"");}
function rightClickHandler(e) { if (!e) var e= window.event; popUpMenuObj=null; var targetElm = (e.target) ? e.target : e.srcElement; if (targetElm.id==null)
return; webFXTreeHandler.currentNodeId = targetElm.id.replace('-anchor','').replace('-icon',''); var menuName=getPopupMenuName(targetElm.id); hideCursorMenus(); if (menuName==null)
return; eval("if(typeof(" + menuName + ") != 'undefined') setPopUpMenu("+menuName+");"); if (getX(e) > getClientWidth() || getY(e) > getClientHeight()) { return;}
hideVisibleMenus(); if (typeof(hideMenuBarMenus) == "function") { hideMenuBarMenus();}
if (popUpMenuObj) { var state = popUpMenuObj.menuObj.style.visibility; if (state == "visible" && (hideValue == 1 || hideValue == 2)) { activatePopUpMenu(e); return false;}
if ((state == "hidden" || state == "") && (showValue == 1 || showValue == 2)) { activatePopUpMenu(e); return false;}
}
}
function scrollHandler() { for (var i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if (ie && menuObj.mode == "fixed") { menuObj.style.left = (menuObj.initialLeft + getScrollLeft()) + px; menuObj.style.top = (menuObj.initialTop + getScrollTop()) + px;}
}
if (typeof(menuBarScrollHandler) == "function") { menuBarScrollHandler();}
}
function showMenuItemIcon() { var iconElm = createElm("span"); iconElm.id = this.id + "Icon"; iconElm.className = arguments[0]; this.insertBefore(iconElm, this.firstChild); var height; if (ie) { height = getPropIntVal(iconElm, "height");}
else { height = iconElm.offsetHeight;}
iconElm.style.top = Math.floor((this.offsetHeight - height) / 2) + px; if (ie) { var left = getPropIntVal(iconElm, "left"); if (ie55 || ie6) { iconElm.style.left = (left - getPropIntVal(this, "padding-left")) + px;}
else { iconElm.style.left = left + px;}
}
this.iconClassName = iconElm.className; if (arguments.length > 1 && arguments[1].length > 0) { this.iconClassNameOver = arguments[1];}
this.iconObj = iconElm; this.setIconClassName = function(className) { this.iconClassName = className; this.iconObj.className = this.iconClassName;}; this.setIconClassNameOver = function(classNameOver) { this.iconClassNameOver = classNameOver;};}
function setSubMenu(menuObj) { var arrowElm = createElm("div"); arrowElm.id = this.id + "Arrow"; arrowElm.className = this.arrowClassName; this.appendChild(arrowElm); var height; if (ie) { height = getPropIntVal(arrowElm, "height");}
else { height = arrowElm.offsetHeight;}
arrowElm.style.top = Math.floor((this.offsetHeight - height) / 2) + px; this.subMenu = menuObj; this.arrowObj = arrowElm; this.setArrowClassName = function(className) { this.arrowClassName = className; this.arrowObj.className = this.arrowClassName;}; this.setArrowClassNameOver = function(classNameOver) { this.arrowClassNameOver = classNameOver;}; menuObj.menuObj.style.zIndex = this.parent.menuObj.level + 1; menuObj.menuObj.level = this.parent.menuObj.level + 1;}
function addMenuItem(menuItemObj) { if (menuItemObj.displayText == "-") { var hrElm = createElm("hr"); var itemElm = createElm("div"); itemElm.appendChild(hrElm); itemElm.id = menuItemObj.id; if (menuItemObj.className.length > 0) { itemElm.sepClassName = menuItemObj.className;}
else { itemElm.sepClassName = menuItemObj.sepClassName;}
itemElm.className = itemElm.sepClassName; this.menuObj.appendChild(itemElm); itemElm.parent = this; itemElm.setClassName = function(className) { this.sepClassName = className; this.className = this.sepClassName;}; itemElm.onclick = function(e) { if (!e) { var e = window.event; e.cancelBubble = true;}
if (e.stopPropagation) { e.stopPropagation();}
}; itemElm.onmouseover = menuItemOver; if (menuItemObj.itemName.length > 0) { this.items[menuItemObj.itemName] = itemElm;}
else { this.items[this.items.length] = itemElm;}
}
else { var itemElm = createElm("div"); itemElm.id = menuItemObj.id; itemElm.actionOnClick = menuItemObj.actionOnClick; itemElm.enabled = menuItemObj.enabled; itemElm.itemClassName = menuItemObj.className; itemElm.itemClassNameOver = menuItemObj.classNameOver; itemElm.className = itemElm.itemClassName; itemElm.subMenu = null; itemElm.arrowClassName = arrowClassName; itemElm.arrowClassNameOver = arrowClassNameOver; var textNode = document.createTextNode(menuItemObj.displayText); itemElm.appendChild(textNode); this.menuObj.appendChild(itemElm); itemElm.parent = this; itemElm.setClassName = function(className) { this.itemClassName = className; this.className = this.itemClassName;}; itemElm.setClassNameOver = function(classNameOver) { this.itemClassNameOver = classNameOver;}; itemElm.setDisplayText = function(text) { if (this.childNodes[0].nodeType == 3) { this.childNodes[0].nodeValue = text;}
else { this.childNodes[1].nodeValue = text;}
}; itemElm.setSubMenu = setSubMenu; itemElm.showIcon = showMenuItemIcon; itemElm.onmouseover = menuItemOver; itemElm.onclick = menuItemClick; itemElm.onmouseout = menuItemOut; if (menuItemObj.itemName.length > 0) { this.items[menuItemObj.itemName] = itemElm;}
else { this.items[this.items.length] = itemElm;}
}
}
function menuItem() { this.displayText = arguments[0]; if (this.displayText == "-") { this.id = "menuSep" + (++sepCount); this.className = sepClassName;}
else { this.id = "menuItem" + (++menuItemCount); this.className = menuItemClassName;}
this.itemName = ""; this.actionOnClick = ""; this.enabled = true; this.classNameOver = menuItemClassNameOver; this.sepClassName = sepClassName; var len = arguments.length; if (len > 1 && arguments[1].length > 0) { this.itemName = arguments[1];}
if (len > 2 && arguments[2].length > 0) { this.actionOnClick = unescape(arguments[2]);}
if (len > 3 && typeof(arguments[3]) == "boolean") { this.enabled = arguments[3];}
if (len > 4 && arguments[4].length > 0) { if (arguments[4] == "-") { this.className = arguments[4]; this.sepClassName = arguments[4];}
else { this.className = arguments[4];}
}
if (len > 5 && arguments[5].length > 0) { this.classNameOver = arguments[5];}
}
function jsDOMenu() { this.items = new Array(); var menuElm; var len = arguments.length; if (len > 2 && arguments[2].length > 0 && arguments[1] == "static") { menuElm = getElmId(arguments[2]); if (!menuElm) { return;}
staticMenuId[staticMenuId.length] = arguments[2];}
else { menuElm = createElm("div"); menuElm.id = "DOMenu" + (++menuCount);}
menuElm.level = 10; menuElm.previousItem = null; menuElm.allExceptFilter = allExceptFilter; menuElm.noneExceptFilter = noneExceptFilter; menuElm.className = menuClassName; menuElm.mode = menuMode; menuElm.alwaysVisible = false; menuElm.initialLeft = 0; menuElm.initialTop = 0; if (len > 1 && arguments[1].length > 0) { switch (arguments[1]) { case "cursor":
menuElm.style.position = "absolute"; menuMode.mode = "cursor"; break; case "absolute":
menuElm.style.position = "absolute"; menuElm.mode = "absolute"; break; case "fixed":
if (ie) { menuElm.style.position = "absolute";}
else { menuElm.style.position = "fixed";}
menuElm.mode = "fixed"; break; case "static":
menuElm.style.position = "static"; menuElm.mode = "static"; break;}
}
if (len > 3 && typeof(arguments[3]) == "boolean") { menuElm.alwaysVisible = arguments[3];}
if (len > 4 && arguments[4].length > 0) { menuElm.className = arguments[4];}
menuElm.style.width = arguments[0] + px; menuElm.style.left = "0px"; menuElm.style.top = "0px"; if (menuElm.mode != "static") { document.body.appendChild(menuElm);}
if (!getPropVal(menuElm, blw)) { menuElm.style.borderWidth = menuBorderWidth + px;}
this.menuObj = menuElm; this.addMenuItem = addMenuItem; this.setClassName = function(className) { this.menuObj.className = className;}; this.setMode = function(mode) { switch (mode) { case "cursor":
this.menuObj.style.position = "absolute"; this.menuObj.mode = "cursor"; break; case "absolute":
this.menuObj.style.position = "absolute"; this.menuObj.mode = "absolute"; this.menuObj.initialLeft = parseInt(this.menuObj.style.left); this.menuObj.initialTop = parseInt(this.menuObj.style.top); break; case "fixed":
if (ie) { this.menuObj.style.position = "absolute"; this.menuObj.initialLeft = parseInt(this.menuObj.style.left); this.menuObj.initialTop = parseInt(this.menuObj.style.top);}
else { this.menuObj.style.position = "fixed";}
this.menuObj.mode = "fixed"; break;}
}; this.setAlwaysVisible = function(alwaysVisible) { if (typeof(alwaysVisible) == "boolean") { this.menuObj.alwaysVisible = alwaysVisible;}
}; this.show = function() { this.menuObj.style.visibility = "visible";}; this.hide = function() { this.menuObj.style.visibility = "hidden"; if (this.menuObj.mode == "cursor") { this.menuObj.style.left = "0px"; this.menuObj.style.top = "0px"; this.menuObj.initialLeft = 0; this.menuObj.initialTop = 0;}
}; this.setX = function(x) { this.menuObj.initialLeft = x; this.menuObj.style.left = x + px;}; this.setY = function(y) { this.menuObj.initialTop = y; this.menuObj.style.top = y + px;}; this.moveTo = function(x, y) { this.menuObj.initialLeft = x; this.menuObj.initialTop = y; this.menuObj.style.left = x + px; this.menuObj.style.top = y + px;}; this.moveBy = function(x, y) { var left = parseInt(this.menuObj.style.left); var top = parseInt(this.menuObj.style.top); this.menuObj.initialLeft = left + x; this.menuObj.initialTop = top + y; this.menuObj.style.left = (left + x) + px; this.menuObj.style.top = (top + y) + px;}; this.setAllExceptFilter = function(filter) { this.menuObj.allExceptFilter = filter; this.menuObj.noneExceptFilter = new Array();}; this.setNoneExceptFilter = function(filter) { this.menuObj.noneExceptFilter = filter; this.menuObj.allExceptFilter = new Array();}; this.setBorderWidth = function(width) { this.menuObj.style.borderWidth = width + px;};}
function activatePopUpMenuBy() { showValue = typeof(arguments[0]) == "number" && arguments[0] > -1 ? arguments[0] : 0; if (arguments.length > 1) { hideValue = typeof(arguments[1]) == "number" && arguments[1] > -1 ? arguments[1] : 0;}
else { hideValue = showValue;}
if (showValue == 1 || showValue == 2 || hideValue == 1 || hideValue == 2) { document.oncontextmenu = rightClickHandler;}
}
function hideAllMenus() { for (var i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if (!menuObj.alwaysVisible) { if (menuObj.style.position == "fixed") { menuObj.style.position == "absolute"; menuObj.style.visibility = "hidden"; menuObj.style.position == "fixed";}
else { menuObj.style.visibility = "hidden"; if (menuObj.mode == "cursor") { menuObj.style.left = "0px"; menuObj.style.top = "0px"; menuObj.initialLeft = 0; menuObj.initialTop = 0;}
}
}
refreshMenuItems(menuObj);}
for (var i = 0, len = staticMenuId.length; i < len; i++) { refreshMenuItems(getElmId(staticMenuId[i]));}
}
function hideCursorMenus() { for (var i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if (menuObj.mode == "cursor" && !menuObj.alwaysVisible) { menuObj.style.visibility = "hidden"; menuObj.style.left = "0px"; menuObj.style.top = "0px"; menuObj.initialLeft = 0; menuObj.initialTop = 0;}
if (menuObj.mode == "cursor") { refreshMenuItems(menuObj);}
}
}
function hideVisibleMenus() { for (var i = 1; i <= menuCount; i++) { var menuObj = getElmId("DOMenu" + i); if ((menuObj.mode == "absolute" || menuObj.mode == "fixed") && !menuObj.alwaysVisible) { if (menuObj.style.position == "fixed") { menuObj.style.position = "absolute"; menuObj.style.visibility = "hidden"; menuObj.style.position = "fixed";}
else { menuObj.style.visibility = "hidden"; menuObj.style.left = "0px"; menuObj.style.top = "0px"; menuObj.initialLeft = 0; menuObj.initialTop = 0;}
}
if (menuObj.mode == "absolute" || menuObj.mode == "fixed") { refreshMenuItems(menuObj);}
}
for (var i = 0, len = staticMenuId.length; i < len; i++) { refreshMenuItems(getElmId(staticMenuId[i]));}
if (typeof(staticMenuBarId) == "object") { for (var i = 0, len = staticMenuBarId.length; i < len; i++) { refreshMenuBarItems(getElmId(staticMenuBarId[i]));}
}
}
function hideMenus(menuObj) { refreshMenuItems(menuObj); for (var i = 0, len = menuObj.childNodes.length; i < len; i++) { if (menuObj.childNodes[i].enabled && menuObj.childNodes[i].subMenu) { hideMenus(menuObj.childNodes[i].subMenu.menuObj);}
}
if (menuObj.style.position == "fixed") { menuObj.style.position = "absolute"; menuObj.style.visibility = "hidden"; menuObj.style.position = "fixed";}
else { menuObj.style.visibility = "hidden"; menuObj.style.left = "0px"; menuObj.initialLeft = 0; menuObj.initialTop = 0;}
}
function setPopUpMenu(menuObj) { popUpMenuObj = null; var str = ''; if (typeof(menuObj.items) != "undefined")
{ for (var i=0; i<menuObj.items.length; i++)
{ str = str + '[' + menuObj.items[i].id + ']' + menuObj.items[i].displayText + '\n';}
popUpMenuObj = menuObj;}
}
function initjsDOMenu() { if (document.createElement && document.getElementById) { createjsDOMenu();}
}
if (typeof(allExceptFilter) == "undefined") { var allExceptFilter = new Array("A.*", "BUTTON.*", "IMG.*", "INPUT.*", "OBJECT.*", "OPTION.*", "SELECT.*", "TEXTAREA.*");}
if (typeof(noneExceptFilter) == "undefined") { var noneExceptFilter = new Array();}
if (typeof(menuClassName) == "undefined") { var menuClassName = "jsdomenudiv";}
if (typeof(menuItemClassName) == "undefined") { var menuItemClassName = "jsdomenuitem";}
if (typeof(menuItemClassNameOver) == "undefined") { var menuItemClassNameOver = "jsdomenuitemover";}
if (typeof(sepClassName) == "undefined") { var sepClassName = "jsdomenusep";}
if (typeof(arrowClassName) == "undefined") { var arrowClassName = "jsdomenuarrow";}
if (typeof(arrowClassNameOver) == "undefined") { var arrowClassNameOver = "jsdomenuarrowover";}
if (typeof(menuMode == "undefined")) { var menuMode = "cursor";}
if (typeof(menuBorderWidth) == "undefined") { var menuBorderWidth = 2;}
var ie50 = isIE50(); var ie55 = isIE55(); var ie5 = isIE5(); var ie6 = isIE6()
var ie = isIE(); var opera = isOpera(); var safari = isSafari(); var pageMode = getPageMode(); var px = "px"; var btw = "border-top-width"; var bbw = "border-bottom-width"; var blw = "border-left-width"; var brw = "border-right-width"; var menuCount = 0; var menuItemCount = 0; var sepCount = 0; var popUpMenuObj = null; var showValue = 0; var hideValue = 0; var staticMenuId = new Array(); document.onclick = leftClickHandler; window.onscroll = scrollHandler; ns4 = (document.layers); ns6 = (!document.all && document.getElementById); ie4 = (document.all && !document.getElementById && !window.opera); ie5 = (document.all && !document.fireEvent && !window.opera); op7 = (window.opera && document.createComment) ; w3dom = (document.getElementById || op7); function defineObjects() { page = new Object(); page.width = (ns4 || ns6 ||op7) ? innerWidth : document.body.clientWidth; page.height = (ns4 || ns6 ||op7) ? innerHeight : document.body.clientHeight;}
function layerSetup(parent,id,left,top,zindex,visibility) { if(ns4) { this.obj = (parent != null) ? parent.document[id] : document[id]; this.obj.htm = (parent != null) ? parent.document[id].document : document[id].document;} else if(ie4 ||ie5) { this.obj = document.all[id].style; this.obj.htm = document.all[id];} else if(w3dom) { this.obj = document.getElementById(id).style; this.obj.htm = document.getElementById(id);}
this.obj.left = (w3dom) ? left + "px" : left; this.obj.top = (w3dom) ? top + "px" : top; this.obj.zIndex = zindex; this.obj.visibility = visibility; return this.obj;}
function sizeAnimator(obj,width,height) { if(ns4) { obj.clip.right = width; obj.clip.bottom = height;} else { obj.width = (w3dom) ? width + "px" : width; obj.height = (w3dom) ? height + "px" : height;}
}
function actionManager() { alert('in actionmanager'); pageManager("load_page","ContentEditor.aspx");}
var page_timer = null; function pageManager()
{ alert('in PageManager new'); document.getElementById("frameData").src = pageManager.arguments[1];}
function pageManager2() { alert('in pageManager'); var args = pageManager.arguments; switch(args[0]) { case "load_page" :
if(ie4) { document.frames["frameData"].document.location = args[1];}
if(w3dom) { document.getElementById("frameData").src = args[1];}
if(ns4) { }
break; case "page_is_loaded" :
if(ns4) { sizeAnimator(content,page.width-300,content.htm.height);}
clearTimeout(page_timer); page_timer = setTimeout("pageManager('display_page')",500); break; case "display_page" :
if(ie4) { content.htm.innerHTML = document.frames['frameData'].document.body.innerHTML;} else if(w3dom) { content = document.getElementById('contentLYR'); content.innerHTML= window.frames.frameData.window.document.body.innerHTML; alert(content.left);}
break;}
}
var webFXTreeConfig = { rootIcon : '/sharedImages/icons/s/ab/folder_closed.png', openRootIcon : '/sharedImages/icons/s/ab/folder.png', folderIcon : '/sharedImages/icons/s/ab/folder_closed.png', openFolderIcon : '/sharedImages/icons/s/ab/folder.png', fileIcon : '/sharedImages/icons/s/op/clock.png', iIcon : '/common/treecontrol/images/I.png', lIcon : '/common/treecontrol/images/L.png', lMinusIcon : '/common/treecontrol/images/Lminus.png', lPlusIcon : '/common/treecontrol/images/Lplus.png', tIcon : '/common/treecontrol/images/T.png', tMinusIcon : '/common/treecontrol/images/Tminus.png', tPlusIcon : '/common/treecontrol/images/Tplus.png', blankIcon : '/common/treecontrol/images/blank.png', defaultText : 'Tree Item', defaultAction : 'javascript:void(0);', defaultBehavior : 'classic', usePersistence : false
}; var webFXTreeHandler = { idCounter : 0, idPrefix : "webfx-tree-object-", all : {}, behavior : null, selected : null, onSelect : null, getId : function() {return this.idPrefix;}, toggle : function (oItem) { this.all[oItem.id.replace('-plus','')].toggle();}, select : function (oItem) { this.all[oItem.id.replace('-icon','')].select();}, focus : function (oItem) { this.all[oItem.id.replace('-anchor','')].focus();}, blur : function (oItem) { this.all[oItem.id.replace('-anchor','')].blur();}, keydown : function (oItem, e) {return this.all[oItem.id].keydown(e.keyCode);}, cookies : new WebFXCookie(), currentNodeId : '', insertHTMLBeforeEnd : function (oElement, sHTML) { if (oElement.insertAdjacentHTML != null) { oElement.insertAdjacentHTML("BeforeEnd", sHTML)
return;}
var df; var r = oElement.ownerDocument.createRange(); r.selectNodeContents(oElement); r.collapse(false); df = r.createContextualFragment(sHTML); oElement.appendChild(df);}
}; function WebFXCookie() { if (document.cookie.length) { this.cookies = ' ' + document.cookie;}
}
WebFXCookie.prototype.setCookie = function (key, value) { document.cookie = key + "=" + escape(value);}
WebFXCookie.prototype.getCookie = function (key) { if (this.cookies) { var start = this.cookies.indexOf(' ' + key + '='); if (start == -1) { return null;}
var end = this.cookies.indexOf(";", start); if (end == -1) { end = this.cookies.length;}
end -= start; var cookie = this.cookies.substr(start,end); return unescape(cookie.substr(cookie.indexOf('=') + 1, cookie.length - cookie.indexOf('=') + 1));}
else { return null;}
}
function WebFXTreeAbstractNode(sText, sTreeType, sTreeID, sAction) { this.childNodes = []; if ( (sTreeType==null) || (sTreeID==null) || ((typeof(sTreeType) == 'undefined') && (typeof(sTreeID) == 'undefined')))
{ this.id = webFXTreeHandler.getId() + webFXTreeHandler.idCounter++;}
else
{ this.id = webFXTreeHandler.getId() + sTreeType.replace(/-/g,"") + '_' + sTreeID.replace(/-/g,"");}
this.text = sText || webFXTreeConfig.defaultText; if (sAction)
{ this.action = unescape(sAction);}
else
{ this.action = webFXTreeConfig.defaultAction;}
this._last = false; webFXTreeHandler.all[this.id] = this;}
WebFXTreeAbstractNode.prototype.add = function (node, bNoIdent) { node.parentNode = this; this.childNodes[this.childNodes.length] = node; var root = this; if (this.childNodes.length >= 2) { this.childNodes[this.childNodes.length - 2]._last = false;}
while (root.parentNode) { root = root.parentNode;}
if (root.rendered) { if (this.childNodes.length >= 2) { document.getElementById(this.childNodes[this.childNodes.length - 2].id + '-plus').src = ((this.childNodes[this.childNodes.length -2].folder)?((this.childNodes[this.childNodes.length -2].open)?webFXTreeConfig.tMinusIcon:webFXTreeConfig.tPlusIcon):webFXTreeConfig.tIcon); this.childNodes[this.childNodes.length - 2].plusIcon = webFXTreeConfig.tPlusIcon; this.childNodes[this.childNodes.length - 2].minusIcon = webFXTreeConfig.tMinusIcon; this.childNodes[this.childNodes.length - 2]._last = false;}
this._last = true; var foo = this; while (foo.parentNode) { for (var i = 0; i < foo.parentNode.childNodes.length; i++) { if (foo.id == foo.parentNode.childNodes[i].id) { break;}
}
if (i == foo.parentNode.childNodes.length - 1) { foo.parentNode._last = true;}
else { foo.parentNode._last = false;}
foo = foo.parentNode;}
webFXTreeHandler.insertHTMLBeforeEnd(document.getElementById(this.id + '-cont'), node.toString()); if ((!this.folder) && (!this.openIcon)) { this.icon = webFXTreeConfig.folderIcon; this.openIcon = webFXTreeConfig.openFolderIcon;}
if (!this.folder) { this.folder = true; this.collapse(true);}
if (!bNoIdent) { this.indent();}
}
return node;}
WebFXTreeAbstractNode.prototype.toggle = function() { if (this.folder) { if (this.open) { this.collapse();}
else { this.expand();}
} }
WebFXTreeAbstractNode.prototype.select = function() { document.getElementById(this.id + '-anchor').focus();}
WebFXTreeAbstractNode.prototype.deSelect = function() { document.getElementById(this.id + '-anchor').className = ''; webFXTreeHandler.selected = null;}
WebFXTreeAbstractNode.prototype.focus = function() { if ((webFXTreeHandler.selected) && (webFXTreeHandler.selected != this)) { webFXTreeHandler.selected.deSelect();}
webFXTreeHandler.selected = this; if ((this.openIcon) && (webFXTreeHandler.behavior != 'classic')) { document.getElementById(this.id + '-icon').src = this.openIcon;}
document.getElementById(this.id + '-anchor').className = 'selected'; document.getElementById(this.id + '-anchor').focus(); if (webFXTreeHandler.onSelect) { webFXTreeHandler.onSelect(this);}
}
WebFXTreeAbstractNode.prototype.blur = function() { }
WebFXTreeAbstractNode.prototype.doExpand = function() { if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.openIcon;}
if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'block';}
this.open = true; if (webFXTreeConfig.usePersistence) { webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '1');} }
WebFXTreeAbstractNode.prototype.doCollapse = function() { if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.icon;}
if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'none';}
this.open = false; if (webFXTreeConfig.usePersistence) { webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '0');} }
WebFXTreeAbstractNode.prototype.expandAll = function() { this.expandChildren(); if ((this.folder) && (!this.open)) { this.expand();}
}
WebFXTreeAbstractNode.prototype.expandChildren = function() { for (var i = 0; i < this.childNodes.length; i++) { this.childNodes[i].expandAll();} }
WebFXTreeAbstractNode.prototype.collapseAll = function() { this.collapseChildren(); if ((this.folder) && (this.open)) { this.collapse(true);}
}
WebFXTreeAbstractNode.prototype.collapseChildren = function() { for (var i = 0; i < this.childNodes.length; i++) { this.childNodes[i].collapseAll();} }
WebFXTreeAbstractNode.prototype.indent = function(lvl, del, last, level, nodesLeft) { if (lvl == null) { lvl = -2;}
var state = 0; for (var i = this.childNodes.length - 1; i >= 0 ; i--) { state = this.childNodes[i].indent(lvl + 1, del, last, level); if (state) { return;}
}
if (del) { if ((level >= this._level) && (document.getElementById(this.id + '-plus'))) { if (this.folder) { document.getElementById(this.id + '-plus').src = (this.open)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.lPlusIcon; this.plusIcon = webFXTreeConfig.lPlusIcon; this.minusIcon = webFXTreeConfig.lMinusIcon;}
else if (nodesLeft) { document.getElementById(this.id + '-plus').src = webFXTreeConfig.lIcon;}
return 1;} }
var foo = document.getElementById(this.id + '-indent-' + lvl); if (foo) { if ((foo._last) || ((del) && (last))) { foo.src = webFXTreeConfig.blankIcon;}
else { foo.src = webFXTreeConfig.iIcon;}
}
return 0;}
function WebFXTree(sText, sTreeType, sTreeID, sAction, sBehavior, sIcon, sOpenIcon) { this.base = WebFXTreeAbstractNode; this.base(sText, sTreeType, sTreeID, sAction); this.icon = sIcon || webFXTreeConfig.rootIcon; this.openIcon = sOpenIcon || webFXTreeConfig.openRootIcon; if (webFXTreeConfig.usePersistence) { this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '0')?false:true;} else { this.open = true;}
this.folder = true; this.rendered = false; this.onSelect = null; if (!webFXTreeHandler.behavior) { webFXTreeHandler.behavior = sBehavior || webFXTreeConfig.defaultBehavior;}
}
WebFXTree.prototype = new WebFXTreeAbstractNode; WebFXTree.prototype.setBehavior = function (sBehavior) { webFXTreeHandler.behavior = sBehavior;}; WebFXTree.prototype.getBehavior = function (sBehavior) { return webFXTreeHandler.behavior;}; WebFXTree.prototype.getSelected = function() { if (webFXTreeHandler.selected) { return webFXTreeHandler.selected;}
else { return null;}
}
WebFXTree.prototype.remove = function() { }
WebFXTree.prototype.expand = function() { this.doExpand();}
WebFXTree.prototype.collapse = function(b) { if (!b) { this.focus();}
this.doCollapse();}
WebFXTree.prototype.getFirst = function() { return null;}
WebFXTree.prototype.getLast = function() { return null;}
WebFXTree.prototype.getNextSibling = function() { return null;}
WebFXTree.prototype.getPreviousSibling = function() { return null;}
WebFXTree.prototype.keydown = function(key) { if (key == 39) { if (!this.open) { this.expand();}
else if (this.childNodes.length) { this.childNodes[0].select();}
return false;}
if (key == 37) { this.collapse(); return false;}
if ((key == 40) && (this.open) && (this.childNodes.length)) { this.childNodes[0].select(); return false;}
return true;}
WebFXTree.prototype.toString = function() { var str = "<div id=\"" + this.id + "\" ondblclick=\"webFXTreeHandler.toggle(this);\" class=\"webfx-tree-item\" onkeydown=\"return webFXTreeHandler.keydown(this, event)\">" + "<img id=\"" + this.id + "-icon\" class=\"webfx-tree-icon\" src=\"" + ((webFXTreeHandler.behavior == 'classic' && this.open)?this.openIcon:this.icon) + "\" onclick=\"webFXTreeHandler.select(this);\">" + "<a href=\"" + this.action + "\" id=\"" + this.id + "-anchor\" onfocus=\"webFXTreeHandler.currentNodeId ='" + this.id + "';webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\"" + (this.target ? " target=\"" + this.target + "\"" : "") + ">" + this.text + "</a></div>" + "<div id=\"" + this.id + "-cont\" class=\"webfx-tree-container\" style=\"display: " + ((this.open)?'block':'none') + ";\">"; var sb = []; for (var i = 0; i < this.childNodes.length; i++) { sb[i] = this.childNodes[i].toString(i, this.childNodes.length);}
this.rendered = true; return str + sb.join("") + "</div>";}; function WebFXTreeItem(sText, sTreeType, sTreeID, sAction, eParent, sIcon, sOpenIcon) { this.base = WebFXTreeAbstractNode; this.base(sText, sTreeType, sTreeID, sAction); if (webFXTreeConfig.usePersistence) { this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '1')?true:false;} else { this.open = false;}
if (sIcon) { this.icon = sIcon;}
if (sOpenIcon) { this.openIcon = sOpenIcon;}
if (eParent) { eParent.add(this);}
}
WebFXTreeItem.prototype = new WebFXTreeAbstractNode; WebFXTreeItem.prototype.remove = function() { var iconSrc = document.getElementById(this.id + '-plus').src; var parentNode = this.parentNode; var prevSibling = this.getPreviousSibling(true); var nextSibling = this.getNextSibling(true); var folder = this.parentNode.folder; var last = ((nextSibling) && (nextSibling.parentNode) && (nextSibling.parentNode.id == parentNode.id))?false:true; this.getPreviousSibling().focus(); this._remove(); if (parentNode.childNodes.length == 0) { document.getElementById(parentNode.id + '-cont').style.display = 'none'; parentNode.doCollapse(); parentNode.folder = false; parentNode.open = false;}
if (!nextSibling || last) { parentNode.indent(null, true, last, this._level, parentNode.childNodes.length);}
if ((prevSibling == parentNode) && !(parentNode.childNodes.length)) { prevSibling.folder = false; prevSibling.open = false; if (document.getElementById(prevSibling.id + '-plus')) { iconSrc = document.getElementById(prevSibling.id + '-plus').src; iconSrc = iconSrc.replace('minus', '').replace('plus', ''); document.getElementById(prevSibling.id + '-plus').src = iconSrc;}
}
if (document.getElementById(prevSibling.id + '-plus')) { if (parentNode == prevSibling.parentNode) { iconSrc = iconSrc.replace('minus', '').replace('plus', ''); document.getElementById(prevSibling.id + '-plus').src = iconSrc;} } }
WebFXTreeItem.prototype._remove = function() { for (var i = this.childNodes.length - 1; i >= 0; i--) { this.childNodes[i]._remove();}
for (var i = 0; i < this.parentNode.childNodes.length; i++) { if (this == this.parentNode.childNodes[i]) { for (var j = i; j < this.parentNode.childNodes.length; j++) { this.parentNode.childNodes[j] = this.parentNode.childNodes[j+1];}
this.parentNode.childNodes.length -= 1; if (i + 1 == this.parentNode.childNodes.length) { this.parentNode._last = true;}
break;} }
webFXTreeHandler.all[this.id] = null; var tmp = document.getElementById(this.id); if (tmp) { tmp.parentNode.removeChild(tmp);}
tmp = document.getElementById(this.id + '-cont'); if (tmp) { tmp.parentNode.removeChild(tmp);}
}
WebFXTreeItem.prototype.expand = function() { this.doExpand(); document.getElementById(this.id + '-plus').src = this.minusIcon;}
WebFXTreeItem.prototype.collapse = function(b) { if (!b) { this.focus();}
this.doCollapse(); document.getElementById(this.id + '-plus').src = this.plusIcon;}
WebFXTreeItem.prototype.getFirst = function() { return this.childNodes[0];}
WebFXTreeItem.prototype.getLast = function() { if (this.childNodes[this.childNodes.length - 1].open) { return this.childNodes[this.childNodes.length - 1].getLast();}
else { return this.childNodes[this.childNodes.length - 1];}
}
WebFXTreeItem.prototype.getNextSibling = function() { for (var i = 0; i < this.parentNode.childNodes.length; i++) { if (this == this.parentNode.childNodes[i]) { break;}
}
if (++i == this.parentNode.childNodes.length) { return this.parentNode.getNextSibling();}
else { return this.parentNode.childNodes[i];}
}
WebFXTreeItem.prototype.getPreviousSibling = function(b) { for (var i = 0; i < this.parentNode.childNodes.length; i++) { if (this == this.parentNode.childNodes[i]) { break;}
}
if (i == 0) { return this.parentNode;}
else { if ((this.parentNode.childNodes[--i].open) || (b && this.parentNode.childNodes[i].folder)) { return this.parentNode.childNodes[i].getLast();}
else { return this.parentNode.childNodes[i];}
} }
WebFXTreeItem.prototype.keydown = function(key) { if ((key == 39) && (this.folder)) { if (!this.open) { this.expand();}
else { this.getFirst().select();}
return false;}
else if (key == 37) { if (this.open) { this.collapse();}
else { this.parentNode.select();}
return false;}
else if (key == 40) { if (this.open) { this.getFirst().select();}
else { var sib = this.getNextSibling(); if (sib) { sib.select();}
}
return false;}
else if (key == 38) { this.getPreviousSibling().select(); return false;}
return true;}
WebFXTreeItem.prototype.toString = function (nItem, nItemCount) { var foo = this.parentNode; var indent = ''; if (nItem + 1 == nItemCount) { this.parentNode._last = true;}
var i = 0; while (foo.parentNode) { foo = foo.parentNode; indent = "<img id=\"" + this.id + "-indent-" + i + "\" src=\"" + ((foo._last)?webFXTreeConfig.blankIcon:webFXTreeConfig.iIcon) + "\">" + indent; i++;}
this._level = i; if (this.childNodes.length) { this.folder = 1;}
else { this.open = false;}
if ((this.folder) || (webFXTreeHandler.behavior != 'classic')) { if (!this.icon) { this.icon = webFXTreeConfig.folderIcon;}
if (!this.openIcon) { this.openIcon = webFXTreeConfig.openFolderIcon;}
}
else if (!this.icon) { this.icon = webFXTreeConfig.fileIcon;}
var label = this.text.replace(/</g, '&lt;').replace(/>/g, '&gt;'); var str = "<div id=\"" + this.id + "\" ondblclick=\"webFXTreeHandler.toggle(this);\" class=\"webfx-tree-item\" onkeydown=\"return webFXTreeHandler.keydown(this, event)\">" + indent + "<img id=\"" + this.id + "-plus\" src=\"" + ((this.folder)?((this.open)?((this.parentNode._last)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.tMinusIcon):((this.parentNode._last)?webFXTreeConfig.lPlusIcon:webFXTreeConfig.tPlusIcon)):((this.parentNode._last)?webFXTreeConfig.lIcon:webFXTreeConfig.tIcon)) + "\" onclick=\"webFXTreeHandler.toggle(this);\">" + "<img id=\"" + this.id + "-icon\" class=\"webfx-tree-icon\" src=\"" + ((webFXTreeHandler.behavior == 'classic' && this.open)?this.openIcon:this.icon) + "\" onclick=\"webFXTreeHandler.select(this);\">" + "<a href=\""+this.action+"\" id=\"" + this.id + "-anchor\" onfocus=\"webFXTreeHandler.currentNodeId ='" + this.id + "'; webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\"" + (this.target ? " target=\"" + this.target + "\"" : "") + ">" + label + "</a>" + "</div>" + "<div id=\"" + this.id + "-cont\" class=\"webfx-tree-container\" style=\"display: " + ((this.open)?'block':'none') + ";\">"; var sb = []; for (var i = 0; i < this.childNodes.length; i++) { sb[i] = this.childNodes[i].toString(i,this.childNodes.length);}
this.plusIcon = ((this.parentNode._last)?webFXTreeConfig.lPlusIcon:webFXTreeConfig.tPlusIcon); this.minusIcon = ((this.parentNode._last)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.tMinusIcon); return str + sb.join("") + "</div>";}
function getDomDocumentPrefix() { if (getDomDocumentPrefix.prefix)
return getDomDocumentPrefix.prefix; var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]; var o; for (var i = 0; i < prefixes.length; i++) { try { o = new ActiveXObject(prefixes[i] + ".DomDocument"); return getDomDocumentPrefix.prefix = prefixes[i];}
catch (ex) {};}
throw new Error("Could not find an installed XML parser");}
function getXmlHttpPrefix() { if (getXmlHttpPrefix.prefix)
return getXmlHttpPrefix.prefix; var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]; var o; for (var i = 0; i < prefixes.length; i++) { try { o = new ActiveXObject(prefixes[i] + ".XmlHttp"); return getXmlHttpPrefix.prefix = prefixes[i];}
catch (ex) {};}
throw new Error("Could not find an installed XML parser");}
function XmlHttp() {}
XmlHttp.create = function () { try { if (window.XMLHttpRequest) { var req = new XMLHttpRequest(); if (req.readyState == null) { req.readyState = 1; req.addEventListener("load", function () { req.readyState = 4; if (typeof req.onreadystatechange == "function")
req.onreadystatechange();}, false);}
return req;}
if (window.ActiveXObject) { return new ActiveXObject(getXmlHttpPrefix() + ".XmlHttp");}
}
catch (ex) {}
throw new Error("Your browser does not support XmlHttp objects");}; function XmlDocument() {}
XmlDocument.create = function () { try { if (document.implementation && document.implementation.createDocument) { var doc = document.implementation.createDocument("", "", null); if (doc.readyState == null) { doc.readyState = 1; doc.addEventListener("load", function () { doc.readyState = 4; if (typeof doc.onreadystatechange == "function")
doc.onreadystatechange();}, false);}
return doc;}
if (window.ActiveXObject)
return new ActiveXObject(getDomDocumentPrefix() + ".DomDocument");}
catch (ex) {}
throw new Error("Your browser does not support XmlDocument objects");}; if (window.DOMParser &&
window.XMLSerializer &&
window.Node && Node.prototype && Node.prototype.__defineGetter__) { XMLDocument.prototype.loadXML = Document.prototype.loadXML = function (s) { var doc2 = (new DOMParser()).parseFromString(s, "text/xml"); while (this.hasChildNodes())
this.removeChild(this.lastChild); for (var i = 0; i < doc2.childNodes.length; i++) { this.appendChild(this.importNode(doc2.childNodes[i], true));}
}; XMLDocument.prototype.__defineGetter__("xml", function () { return (new XMLSerializer()).serializeToString(this);}); Document.prototype.__defineGetter__("xml", function () { return (new XMLSerializer()).serializeToString(this);});}
var iconCt = 0; webFXTreeConfig.loadingText = "Loading..."; webFXTreeConfig.loadErrorTextTemplate = "Error loading \"%1%\""; webFXTreeConfig.emptyErrorTextTemplate = "Error \"%1%\" does not contain any tree items"; function WebFXLoadTree(sText, sXmlSrc, sTreeType, sTreeID, sAction, sBehavior, sIcon, sOpenIcon) { this.WebFXTree = WebFXTree; this.WebFXTree(sText, sTreeType, sTreeID, sAction, sBehavior, sIcon, sOpenIcon); this.src = sXmlSrc; this.loading = false; this.loaded = false; this.errorText = ""; if (this.open)
{ _startLoadXmlTree(this.src, this);}
else { this._loadingItem = new WebFXTreeItem(webFXTreeConfig.loadingText); this.add(this._loadingItem);}
}
WebFXLoadTree.prototype = new WebFXTree; WebFXLoadTree.prototype._webfxtree_expand = WebFXTree.prototype.expand; WebFXLoadTree.prototype.expand = function() { if (!this.loaded && !this.loading) { _startLoadXmlTree(this.src, this);}
this._webfxtree_expand();}; function WebFXLoadTreeItem(sText, sXmlSrc, sTreeType, sTreeID, sAction, eParent, sIcon, sOpenIcon) { this.WebFXTreeItem = WebFXTreeItem; this.WebFXTreeItem(sText, sTreeType, sTreeID, sAction, eParent, sIcon, sOpenIcon); this.src = sXmlSrc; this.loading = false; this.loaded = false; this.errorText = ""; if (this.open)
_startLoadXmlTree(this.src, this); else { this._loadingItem = new WebFXTreeItem(webFXTreeConfig.loadingText); this.add(this._loadingItem);}
}
WebFXLoadTreeItem.prototype = new WebFXTreeItem; WebFXLoadTreeItem.prototype._webfxtreeitem_expand = WebFXTreeItem.prototype.expand; WebFXLoadTreeItem.prototype.expand = function() { if (!this.loaded && !this.loading) { _startLoadXmlTree(this.src, this);}
this._webfxtreeitem_expand(); if ( (window.name == 'frameData'))
{ window.setTimeout("parent.setIframeHeight('frameData');",4000);}
}; WebFXLoadTree.prototype.reload = WebFXLoadTreeItem.prototype.reload = function () { if (this.loaded) { var open = this.open; while (this.childNodes.length > 0)
this.childNodes[this.childNodes.length - 1].remove(); this.loaded = false; this._loadingItem = new WebFXTreeItem(webFXTreeConfig.loadingText); this.add(this._loadingItem); if (open)
this.expand();}
else if (this.open && !this.loading)
_startLoadXmlTree(this.src, this);}; function _startLoadXmlTree(sSrc, jsNode) { if (jsNode.loading || jsNode.loaded)
return; jsNode.loading = true; var xmlHttp = XmlHttp.create(); var antiCache = Math.round(Math.random() * 10000); var antiCacheSrc = sSrc + "&" + antiCache; xmlHttp.open("GET", antiCacheSrc, true); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4) { _xmlFileLoaded(xmlHttp.responseXML, jsNode);}
}; window.setTimeout(function () { xmlHttp.send(null);}, 10);}
function _xmlTreeToJsTree(oNode) { var text = oNode.getAttribute("text"); var action = escape(oNode.getAttribute("action")); var parent = null; var icon = oNode.getAttribute("icon"); var openIcon = oNode.getAttribute("openIcon"); var src = oNode.getAttribute("src"); var target = oNode.getAttribute("target"); var treeType = oNode.getAttribute("tType"); var treeID = oNode.getAttribute("tID"); var jsNode; if (src != null && src != "")
jsNode = new WebFXLoadTreeItem(text, src, treeType, treeID, action, parent, icon, openIcon); else
jsNode = new WebFXTreeItem(text, treeType, treeID, action, parent, icon, openIcon); if (target != "")
jsNode.target = target; var cs = oNode.childNodes; var l = cs.length; var menuName; if (treeType == null)
menuName = null; else
menuName = "menu_" + treeType.replace(/-/g,"") + "_" + treeID.replace(/-/g,""); var contextMenuDeclared = false; var cssImageClass; var itemText; var itemName; var itemLink; var itemImage; var treeIDRExp = /\$\{id\}/gi; if (menuName != null)
{ for (var i = 0; i < l; i++) { iconCt = iconCt + 1; if (cs[i].tagName == "tree")
jsNode.add( _xmlTreeToJsTree(cs[i]), true ); else if (cs[i].tagName == "contextmenuitem") { if (!contextMenuDeclared)
{ eval( menuName + " = new jsDOMenu(120);"); contextMenuDeclared = true;}
itemText = cs[i].getAttribute("text"); itemLink = cs[i].getAttribute("link"); itemLink = itemLink.replace(treeIDRExp, treeID); itemImage = cs[i].getAttribute("image"); if ((itemLink != "") || (itemImage != ""))
{ itemName = "item" + iconCt; eval(menuName +".addMenuItem(new menuItem('" + itemText + "', '" + itemName + "','" + escape(itemLink) + "'));"); if (itemImage != "")
{ eval(menuName + ".items." + itemName + ".showIcon('" + itemImage + "','" + itemImage + "');");}
}
else
{ eval(menuName +".addMenuItem(new menuItem('" + itemText + "'));");}
}
}
if (contextMenuDeclared)
{ var nodeIDPrefix = "webfx-tree-object-" + treeType + "_" + treeID; eval(menuName +".setNoneExceptFilter(new Array('IMG." + nodeIDPrefix + "-icon', 'A." + nodeIDPrefix + "-anchor'));");}
}
return jsNode;}
function _xmlFileLoaded(oXmlDoc, jsParentNode) { if (jsParentNode.loaded)
return; var bIndent = false; var bAnyChildren = false; jsParentNode.loaded = true; jsParentNode.loading = false; if( oXmlDoc == null || oXmlDoc.documentElement == null) { jsParentNode.errorText = parseTemplateString(webFXTreeConfig.loadErrorTextTemplate, jsParentNode.src);}
else { var root = oXmlDoc.documentElement; var cs = root.childNodes; var l = cs.length; for (var i = 0; i < l; i++) { if (cs[i].tagName == "tree") { bAnyChildren = true; bIndent = true; jsParentNode.add( _xmlTreeToJsTree(cs[i]), true);}
}
}
if (jsParentNode._loadingItem != null) { jsParentNode._loadingItem.remove(); bIndent = true;}
if (bIndent) { jsParentNode.indent();}
if (jsParentNode.errorText != "")
window.status = jsParentNode.errorText;}
function parseTemplateString(sTemplate) { var args = arguments; var s = sTemplate; s = s.replace(/\%\%/g, "%"); for (var i = 1; i < args.length; i++)
s = s.replace( new RegExp("\%" + i + "\%", "g"), args[i] )
return s;}
