	
	function MenuNode (sId, sName, iLevel, sType, arrayNodes) {
		
		this.id = sId;
		this.name = sName;
		this.level = iLevel;
		this.type = sType;
		this.menuNodes = arrayNodes;
		this.selected = false;
		
		this.COLOR = '#345A80';
		this.COLORSEL = '#A97423';
		
	}
	

	MenuNode.prototype.init = function () {
		
		// Assign the HTML elements.
		this.nodesElem = document.getElementById ('subMenu' + this.id);
		this.iconElem = document.getElementById ('menuIcon' + this.id);
		this.nameElem = document.getElementById ('menuNaam' + this.id);
		
		// Initialize the child nodes.
		for (var i = 0; i < this.menuNodes.length; i++)
			this.menuNodes[i].init ();
		
		// The root node is always shown.
		if (this.type == 'root') {
			document.getElementById ('menuTable').style.display = 'block';
			this.selectNode (oPage.pageId);
		}
		
	}

	
	MenuNode.prototype.selectNode = function (sId) {
		
		if (this.id == sId) {
			
			this.drawSelectNode ();
			return true;
			
		} else {
			
			for (var i = 0; i < this.menuNodes.length; i++) {
				
				if (this.menuNodes[i].selectNode (sId))
					this.drawSelectNode ();
				
			}
			
			return false;
			
		}
		
	}

	
	MenuNode.prototype.drawSelectNode = function () {
		
		if (this.iconElem) {
			switch (this.type) {
				case 'home':
					this.iconElem.src = 'images/layout/menu_home_sel.gif';
					break;
				default:
					switch (this.level) {
						case 1:
							this.iconElem.src = 'images/layout/menu_pijl3.gif';
							break;
						default:
							this.iconElem.src = 'images/layout/menu_pijl2_sel.gif';
					}
			}
		}
		
		if (this.nameElem)
			this.nameElem.style.color = this.COLORSEL;
		
		if (this.nodesElem)
			this.nodesElem.style.display = 'block';
		
		this.selected = true;		
		
	}
	
	
	MenuNode.prototype.openNode = function (sId) {
		
		if (this.id == sId) {
			
			this.drawOpenNode ();
			return true;
			
		} else {
			
			for (var i = 0; i < this.menuNodes.length; i++) {
				
				if (this.menuNodes[i].openNode (sId))
					this.drawOpenNode ();
				
			}
			
			return false;
			
		}
		
	}

	
	MenuNode.prototype.drawOpenNode = function () {
		
		if (this.iconElem) {
			switch (this.level) {
				case 1:
					this.iconElem.src = 'images/layout/menu_pijl4.gif';
					break;
				default:
					this.iconElem.src = 'images/layout/menu_pijl2.gif';
			}
		}
		
		if (this.nodesElem)
			this.nodesElem.style.display = 'block';
		
		this.selected = true;		
		
	}
	
	
	MenuNode.prototype.getNode = function (sId) {
		
		if (this.id == sId) {
			
			return this;
			
		} else {
			
			for (var i = 0; i < this.menuNodes.length; i++) {
				
				if (this.menuNodes[i].getNode (sId))
					return this.menuNodes[i].getNode (sId);
				
			}
			
		}
		
	}
	
	
	MenuNode.prototype.mouseOver = function (sId) {
		
		var oNode = this.getNode (sId);
		
		if (oNode)
			oNode.nameElem.style.color = this.COLORSEL;
		
	}
	
	
	MenuNode.prototype.mouseOut = function (sId) {
		
		var oNode = this.getNode (sId);
		
		if (oNode && !oNode.selected)
			oNode.nameElem.style.color = this.COLOR;
		
	}
	
	MenuNode.prototype.followLink = function (sUrl) {
		
		location.href = sUrl;
		
	}