function ComplexMenu(sContainerId, sIconPrefix, sIconOpen, sIconClose, bUnique) {
	this._container = getObject(sContainerId);
	if (this._container) {
		this._prefix = sIconPrefix;
		this._open = sIconOpen;
		this._close = sIconClose;
		this._unique = bUnique;
	} else {
		throw('ComplexMenu: container not found');
	}
}

ComplexMenu.prototype.toggle = function(sMenuId) {
	var oElem = getObject(sMenuId);
	try {
		var oIcon;
		for (var i = 0; i < this._container.childNodes.length; i++) {
			oElem = this._container.childNodes[i];
			if (oElem.nodeName == 'DD') {
				if (oElem.id.length > 0) {
					oIcon = getObject(this._prefix + oElem.id);
					if (oElem.id == sMenuId) {
						if (oElem.style.display == 'none') {
							oElem.style.display = 'block';
							oIcon.src = this._open;
						} else {
							oElem.style.display = 'none';
							oIcon.src = this._close;
						}
					} else if (this._unique) {
						oElem.style.display = 'none';
						oIcon.src = this._close;
					}
				}
			}
		}
	} catch (e) {}
};

