	var __imgClose = new Image();
	var __imgOpen = new Image();
	var __IdCount = -1;
	var __nrOfLevels = -1;
	
	var __levelsEntry = new Array;
	var __objectRef;
	var __styleRef;	
	
	__imgClose = "img/plus.gif";
	__imgOpen = "img/minus.gif";
		
	//-- constructer for each header level	--------------------------------------
	function level(sDescription, sUrlLink, sTarget){
		//-- variables	--
		this.description = sDescription;
		this.urlLink = sUrlLink;
		this.target = sTarget;
		this.id = __IdCount;
		this.levelEntry = __nrOfLevels;
		this.level = 0;
		this.subLevels = new Array;
		this.nrOfSubLevels = 0;
		this.display = false
		this.image = __imgClose
		
		//-- methods	--
		this.addSubLevel = _addSubLevel;
		this.drawLevel = _drawLevel;
		this.getObjectRef = _getObjectRef;
		this.getSubLevel = _getSubLevel;
		this.hideLevel = _hideLevel;
		this.hideLevels = _hideLevels;
		this.showLevel = _showLevel;
	}
	//---------------------------------------------------------------------------
	
	//---------------------------------------------------------------------------
	//-- functions/methods for classes	-----------------------------------------
	//---------------------------------------------------------------------------
	//-- _getObject()	-----------------------------------------------------------
	function _getObjectRef(){
		var isIE4 = false;
		var isNN4 = false;
		var isW3C = false;
	
		//-- find active browser	-----------------------------------------------
		isIE4 = document.all;
		if(!isIE4) {
			isNN4 = document.layers;
			isW3C = document.getElementsByTagName;
		}
	
		//-- set the oRef and styelRef	-----------------------------------------
		if(isNN4) {__objectRef='document.layers'; __styleRef=''}
		if(isIE4) {__objectRef='document.all'; __styleRef='.style'}
		if(isW3C) {__objectRef='document.getElementsByTagName("*")'; __styleRef='.style'}	
	}
	//---------------------------------------------------------------------------
	
	
	//-- _addSubLevel()	--------------------------------------------------------
	//-- Adds a subLevel to this level														--
	function _addSubLevel(oSubLevel){
		this.subLevels[this.nrOfSubLevels] = oSubLevel;
		this.nrOfSubLevels++;
		oSubLevel.level = this.level + 1;
		if(oSubLevel.level == 1)
			oSubLevel.display = true;
	}
	//---------------------------------------------------------------------------
	
	//-- _getSubLevel()	--------------------------------------------------------
	//-- gets all sublevels for this level													--
	function _getSubLevel(){
		var sHTML = "";
		var iIndex = 0;
		
		sHTML = this.drawLevel();
		if (this.nrOfSubLevels != 0){
			for(iIndex = 0; iIndex< this.nrOfSubLevels; iIndex++)
				sHTML = sHTML + (this.subLevels[iIndex].getSubLevel());
		}
		return sHTML;
	}
	//---------------------------------------------------------------------------
	
	//-- _drawLevel()	-----------------------------------------------------------
	//-- Draws this level on screen															--
	function _drawLevel(){
		var sHTML = "";
	
		//-- get correct image	--------------------------------------------------
		if(this.id != 0){
			sHTML = "";
			if(this.display)
				sHTML = sHTML + "<div id='level_"+ this.id +"' class='level' style='visibility=visible;display=block;'><table border='0' cellpadding='0' cellspacing='0'><tr><td>"
			else
				sHTML = sHTML + "<div id='level_"+ this.id +"' class='level' style='visibility=hidden;display=none;'><table border='0' cellpadding='0' cellspacing='0'><tr><td>"
	
			sHTML = sHTML + "<img src='img/pixel.gif' width='"+ 14 * (this.level -1) +"' height='1'></td><td><nobr>";	
	
			if(this.nrOfSubLevels != 0)
				sHTML = sHTML + "<img src='"+ this.image +"' id='image_"+ this.id +"' class='levelImage' onclick='changeDisplay("+this.levelEntry+");' hspace='0'>";
			else
				sHTML = sHTML + "<img src='img/pixel.gif' width='0' height='0' hspace='0'>";
						
			if(this.urlLink != "")
				sHTML = sHTML + "<a style='' href='"+ this.urlLink +"' target='"+ this.target +"' class='linklevel'>" + this.description + "</a>";
			else
				sHTML = sHTML + "<span class='level'><a style='text-decoration:none;' href='javascript:changeDisplay("+this.levelEntry+");'>" + this.description + "</a></span>";
			sHTML = sHTML + "</td></tr></table></div>"
		}
		sHTML = sHTML + "";
		return sHTML;
	}
	//---------------------------------------------------------------------------
	
	//-- _hideLevels()	--------------------------------------------------------
	function _hideLevels(){
		var iIndex;
		
		for(iIndex=0; iIndex < this.nrOfSubLevels; iIndex++){
			this.subLevels[iIndex].hideLevels();
		}
		this.hideLevel();
	}
	//---------------------------------------------------------------------------
	//-- _hideLevel()	-----------------------------------------------------------
	function _hideLevel(){
		eval(__objectRef + "['level_" + this.id + "']" + __styleRef + ".visibility='hidden'")
		eval(__objectRef + "['level_" + this.id + "']" + __styleRef + ".display='none'")			
		if(this.nrOfSubLevels != 0)
			eval(__objectRef + "['image_" + this.id + "'].src = '" + __imgClose + "'")	
		this.image = __imgClose;
		this.display = false;		
	}
	//---------------------------------------------------------------------------	
		
	//-- showLevel()	-----------------------------------------------------------
	function _showLevel(){
		eval(__objectRef + "['level_" + this.id + "']" + __styleRef + ".visibility='visible'")
		eval(__objectRef + "['level_" + this.id + "']" + __styleRef + ".display='block'")
		this.display = true;		
	}
	//---------------------------------------------------------------------------	


	//---------------------------------------------------------------------------
	//-- function for the webpage	-----------------------------------------------
	//---------------------------------------------------------------------------
	
	//-- createLevel	-----------------------------------------------------------
	//-- creates a new level and return the object back to page so it can be	--
	//-- inserted into another level.														--
	function createLevel(sDescription, sUrlLink, sTarget){
		var newLevel;
		
		__IdCount++;		
		__nrOfLevels++;
		newLevel = new level(sDescription, sUrlLink, sTarget);
		__levelsEntry[__nrOfLevels] = newLevel;
		return newLevel;
	}
	//---------------------------------------------------------------------------
	
	//-- addLevel	--------------------------------------------------------------
	//-- adds a level as a subLevel to another level									--
	function addLevel(oParentLevel, oLevel){
		oParentLevel.addSubLevel(oLevel);
		return oLevel;
	}
	//---------------------------------------------------------------------------	
	
	//-- drawMenu()	-----------------------------------------------------------
	function drawMenu(oMainLevel){
		_getObjectRef()
		var sOutputHTML = "";

		sOutputHTML = oMainLevel.drawLevel();
		sOutputHTML = sOutputHTML + oMainLevel.getSubLevel();
		return sOutputHTML;
	}
	//---------------------------------------------------------------------------
	
	//-- changeDisplay()	--------------------------------------------------------
	function changeDisplay(iLevelEntryId){
		var oLevel = __levelsEntry[iLevelEntryId];

		if(oLevel.image == __imgClose){
			eval(__objectRef + "['image_" + oLevel.id + "'].src = '" + __imgOpen + "'");	
			oLevel.image = __imgOpen;
			for(iIndex=0;iIndex<oLevel.nrOfSubLevels;iIndex++)
				oLevel.subLevels[iIndex].showLevel();
		}else{
			eval(__objectRef + "['image_" + oLevel.id + "'].src = '" + __imgClose + "'");	
			oLevel.image = __imgClose;		
			for(iIndex=0; iIndex < oLevel.nrOfSubLevels; iIndex++)
				oLevel.subLevels[iIndex].hideLevels();
		}
	}
	//---------------------------------------------------------------------------	


	
