function showMenu(element) {
	if (element.lastChild.nodeName.toUpperCase() == 'UL') {
		element.lastChild.style.display = 'block';
	}
	fadeOthersOut(element);
}

function hideMenu(element) {
	if (element.lastChild.nodeName.toUpperCase() == 'UL') {
		element.lastChild.style.display = 'none';
	}
	fadeOthersIn(element);
}

function fadeOthersOut(element) {
	actNode = element.previousSibling;
	while (actNode != null) {
		if (actNode.lastChild.nodeName.toUpperCase() == 'UL') {
			fadeElement(actNode.lastChild, 10);
		}
		actNode = actNode.previousSibling;
	}
	actNode = element.nextSibling;
	while (actNode != null) {
		if (actNode.lastChild.nodeName.toUpperCase() == 'UL') {
			fadeElement(actNode.lastChild, 10);
		}
		actNode = actNode.nextSibling;
	}
}

function fadeOthersIn(element) {
	actNode = element.previousSibling;
	while (actNode != null) {
		if (actNode.lastChild.nodeName.toUpperCase() == 'UL') {
			fadeElement(actNode.lastChild, 100);
		}
		actNode = actNode.previousSibling;
	}
	actNode = element.nextSibling;
	while (actNode != null) {
		if (actNode.lastChild.nodeName.toUpperCase() == 'UL') {
			fadeElement(actNode.lastChild, 100);
		}
		actNode = actNode.nextSibling;
	}
}

function fadeElement(element, alpha) {
	element.style.opacity = alpha / 100;
	element.style.filter = 'alpha(opacity=' + alpha + ')';
}