var openedNodeList = new Array();
var childZIndex = 100;
var preOveredElem = null;

/**
 * PopUp (mouseover/mouseout) show child node.
 */
/*
var ctPopUpChildNode = function (elem, onoff) {
	if (onoff && elem == preOveredElem) {
		return;
	}
	var cnode = elem.nextSibling;
	if (cnode.onmouseover == undefined) {
		cnode.onmouseover = function(){ctPopUpChildNode(elem, true);}
	}
	if (cnode.onmouseout == undefined) {
		cnode.onmouseout = function(){ctPopUpChildNode(elem, false);}
	}
	if (onoff) {
		var pos = getElementPosition(elem);
		pos.x = 80;
		pos.y += 10;
		var stl = { 'position': 'absolute', 'z-index': ++childZIndex, 'border': '#654321 solid 1px', 'width': 'auto' };
		setStyle(cnode, stl);
		setElementPosition(cnode, pos);
		showElement(cnode);
		preOveredElem = elem;
	} else {
		hideElement(cnode);
		childZIndex--;
		preOveredElem = null;
	}
};
*/

/**
 * Automatically show node(s).
 */
var ctAutoShowNode = function (targets) {
	if (targets) {
		var i, elem;
		try {
			for (i = 0; i < targets.length; i++) {
				elem = document.getElementById('ct-' + targets[i]);
				if (elem) {
					ctShowChildNode(elem);
				}
			}
		} catch (e) {
			return;
		}
	}
};

/**
 * Show child node.
 */
var ctShowChildNode = function (elem) {
	elem.nextSibling.style.display = 'block';
	elem.firstChild.style.display = 'none';
	elem.firstChild.nextSibling.style.display = 'inline';
	return false;
};

/**
 * Hide child node.
 */
var ctHideChildNode = function (elem) {
	elem.nextSibling.style.display = 'none';
	elem.firstChild.style.display = 'inline';
	elem.firstChild.nextSibling.style.display = 'none';
	return false;
};

