	// configuration constants
		// adresses
		var imageFolder = "../images/";
		var imagePrefix = "m_";
		var imageSuffix = ".gif";
		if(typeof parent.DBarray != 'undefined') DBarray = parent.DBarray;	// location of the 'brain-file'	
				
		// cosmetics
		var markEnable = 1; 				//1 activates the text and background marking (slower)
		var borderWidth = 0;
		var gridLines = 1;
		var arrRecursionThemes =	new Array(
										/*
										new Array(intRecursionLevel,	
											new Array('strPassiveBorderClass','strActiveBorderClass'),
											new Array('strPassiveBackgroundClass','strActiveBackgroundClass'),
											new Array('strPassiveLinkClass','strActiveLinkClass'),
											new Array('strPassiveArrowImg','strActiveArrowImg')
										),
										*/
										new Array(0,	
											new Array('foborder0'),
											new Array('foback0','foback1'),
											new Array('fotext0','fotext1'),
											new Array(imageFolder+imagePrefix+'pijl_leeg'+imageSuffix, imageFolder+imagePrefix+'pijl'+imageSuffix)
										)
									);

		var booFadeRootOnly = true;
		var booFadeMarking = false;
		var fltFadeIn = 0.2;
		var fltFadeOut= 0.2;
		var booHorizontal = false;			// horizontal menu's

		// dimensions
		var menuMinWidth = 72; 				// minimal menu width
		var menuMaxWidth = "100%"; 			// maximal menu width "100%" for free-sizing menus
		var menuHeight = 16;
		var menuHeightRoot = 19;
		var iconWidth = 16;
		
		// position
		var menuAutoPos = true; 			// 'true' activates the menu position approximation (slower)
		var subMenuXShift = 4;
		var subMenuYShift = 4;
		var menuPosX = -1* menuMinWidth - subMenuXShift;
		var menuPosY = 0 - subMenuYShift;
		var scrollLock = true;
		var edgeCompensation = true;
		
		// operation
		var noDelay = 0;					// 1 disables some wait-loops
		var menuCloseDelay = 1024;
		var menuShowDelay = 256;
		var menuPositionFrequency = 1;		// Hz
		var reportToFrameSet = true;		// set this to 'true' when foldout_frameset.js is available in the parent frame. This will greatly reduce loading times.
		var showRoot = false;
		var booRedrawRelatedItems = false;	// call the function redrawMenuById(intIndex) for highlighting external menus and stuff
		var booSortMenu = false;			// use the order field to change the order of the menu-items during construction
		var booOnDemandRendering = true;	// render content for menu's on demand and not before.
		var booFormSelectsHandling = true	// hide drop-downs (<select>) to avoid overlaps when needed
		var booBackgroundClickable = true	// make the background clickable (a click on the item's text might register twice)

		// global operating constants (don't touch)
		var arrRendered = new Array();
		var inits = 0;
	
	
	// primary functions - functionality
		// find out if the menu was pre-rendered allready
		function wasRendered(intId){
			return (isInArrayOrCSV(intId,arrRendered) || !booOnDemandRendering);
		}
		
		// item highlighting functions
		function mark(markobj){
			if(markEnable!=0 && markobj!=0 && wasRendered(DBarray[markobj][1])){
				// amount of fading
				if(!booFadeMarking){fltFade=0}else{fltFade=fltFadeOut}
				// get the recursion level's style theme
				intRecursionTheme = getRecursionTheme(markobj);
				// execute style changes
				setClass('tb'+markobj,arrRecursionThemes[intRecursionTheme][2][1],fltFade);
				setClass('ta'+markobj,arrRecursionThemes[intRecursionTheme][3][1],fltFade);
			}
		}
		
		function unmark(unmarkobj){
			if(markEnable!=0 && unmarkobj!=0 && wasRendered(DBarray[unmarkobj][1])){
				// amount of fading
				if(!booFadeMarking){fltFade=0}else{fltFade=fltFadeOut}
				// get the recursion level's style theme
				intRecursionTheme = getRecursionTheme(unmarkobj);
				// execute style changes
				setClass('tb'+unmarkobj,arrRecursionThemes[intRecursionTheme][2][0],fltFade);
				setClass('ta'+unmarkobj,arrRecursionThemes[intRecursionTheme][3][0],fltFade);
			}
		}			
		
		// menu foldout/foldin functions
		// Shows a layer absolutely
		function show(obj) {	
			if (inits==1) {
				if(showRoot || obj>0){
					if(booFadeRootOnly&&obj>0){fltFade=0}else{fltFade=fltFadeIn}
					// check if the menu has been rendered before
					if(!wasRendered(obj)) setContent('blockDiv'+obj,generateMenu(obj));
					// show the menu
					setVisibility('blockDiv'+obj,true,fltFade);
				}
			}
		}
		
		// Hides a layer absolutely
		function hide(obj) {	
			if (inits==1) {
				if(booFadeRootOnly&&obj>0){fltFade=0}else{fltFade=fltFadeOut}
				setVisibility('blockDiv'+obj,false,fltFade);
			}
		}
		
		function getRecursionTheme(intId){
			// extrapolate the last 2 recursion level's settings if the chain gets too deep
			if(arrRecursionThemes.length>1){
				// get the recursion level when available
				intRecursionLevel = TraceBranch(intId).length - 2;
				// take the highest recursion theme available
				if(intRecursionLevel<arrRecursionThemes.length){
					return intRecursionLevel;
				}else{
					return arrRecursionThemes.length-1;
				}	
			}else{
				return 0
			}		
		}
	
	
	// secondary functions - construction
		function aproximateMenuPos(){
			// for every item
			for (var tellerA = 1 ; tellerA < DBarray.length ; tellerA++){
				intItemIndex = DBarray[tellerA][0];
				// if an item has sub-items
				if(hasChild(intItemIndex)>0){
					if(!booHorizontal){
					// X
						// determine the parent of the item
						intParentIndex = DBarray[intItemIndex][1];
						// it's horizontal position is the parent's position + the minimalwidth + default-offsets
						if(intParentIndex>0){
							if(DBarray[intItemIndex][6]==0) DBarray[intItemIndex][6] = DBarray[intParentIndex][6] + menuMinWidth + subMenuXShift;
						}else{
							if(DBarray[intItemIndex][6]==0) DBarray[intItemIndex][6] = menuMinWidth + subMenuXShift + menuPosX;
						}
					
					// Y
						// determine the parent of the item
						intParentIndex = DBarray[intItemIndex][1];
						// filter it's parent's children
						arrPeerItems = FilterContent(1,intParentIndex,0);
						// order the array
						arrContentOrder = FilterContent(1,intParentIndex,8);
						arrPeerItems = OrderContent(arrPeerItems,arrContentOrder);
						// count the position of the current child in the list
						intListPosition = isElementOfArray(intItemIndex,arrPeerItems);
						// it's vertical position is this position*lineheight + it's parent's position + default offset
						if(intParentIndex>0){
							if(DBarray[intItemIndex][7]==0) DBarray[intItemIndex][7] = intListPosition * menuHeight + DBarray[intParentIndex][7] + subMenuYShift;
						}else{
							if(DBarray[intItemIndex][7]==0) DBarray[intItemIndex][7] = intListPosition * menuHeightRoot + menuPosY +subMenuYShift;
						}
					}else{
					// X
						// determine the parent of the item
						intParentIndex = DBarray[intItemIndex][1];
						// it's horizontal position is the parent's position + the minimalwidth + default-offsets
						if(intParentIndex>0){
							if(DBarray[intItemIndex][6]==0) DBarray[intItemIndex][6] = DBarray[intParentIndex][6] + subMenuXShift;
						}else{
							if(DBarray[intItemIndex][6]==0) DBarray[intItemIndex][6] = subMenuXShift + menuPosX;
						}
					// Y
						// determine the parent of the item
						intParentIndex = DBarray[intItemIndex][1];
						// it's horizontal position is the parent's position + the minimalwidth + default-offsets
						if(intParentIndex>0){
							if(DBarray[intItemIndex][7]==0) DBarray[intItemIndex][7] = DBarray[intParentIndex][7] + menuHeight + subMenuYShift;
						}else{
							if(DBarray[intItemIndex][7]==0) DBarray[intItemIndex][7] = menuHeight + subMenuYShift + menuPosY;
						}
					}
				}
			}
		}

		// menu layers creation
		function storeMenus(strMenu){
			// where to dump 80KB of generated menus?
			if(reportToFrameSet) parent.strMenu = strMenu;
		}
		
		function retrieveMenus(){
		strMenu = -1;
			// where to retrieve 80KB of generated menus?
			if(reportToFrameSet) strMenu = parent.strMenu;
		return strMenu
		}
		
		function writeMenus(){
			strMenu = retrieveMenus();
			if(strMenu==-1){
				strMenu = generateMenus();
				storeMenus(strMenu);
			}
		document.writeln(strMenu);
		}
		
		function generateMenu(i){
			strMenu = '';
	
			// table in table for the border
			strMenu = strMenu+ "<table border=\"0\" cellspacing=\"0\" cellpadding=\""+borderWidth+"\" class=\""+arrRecursionThemes[0][1][0]+"\"><tr><td><table width=\""+menuMaxWidth+"\" border=\"0\" cellspacing=\""+gridLines+"\" cellpadding=\"0\">\n";
			if(booHorizontal){strMenu = strMenu + "<tr height=\""+menuHeight+"\">\n"}

			// filtering the needed items from the content_ini.js
			if(booSortMenu){
				menuOrder = FilterContent(1,i,8);
				menuIndex = OrderContent(FilterContent(1,i,0),menuOrder);
			}else{
				menuIndex = FilterContent(1,i,0);
			}
			
			// get the recursion level's style theme
			intRecursionTheme = getRecursionTheme(menuIndex[0]);
			
			//  writing all items in a block
			for(var tellerB=0; tellerB < menuIndex.length; tellerB++){ 
				if ( IsFirstLevel(i) ){
				// properties of the item to be written
				intItemID		= menuIndex[tellerB];
				strItemName		= DBarray[intItemID][10];
				strItemURL		= DBarray[intItemID][3];
				strItemTarget	= DBarray[intItemID][4];
				strItemIcon		= DBarray[intItemID][5];
				intSubMenus		= hasChild(intItemID);

				// (re)defining the building-blocks
					// general
					var lineMouseover 	= "onMouseOver=\"menuShouldNotclose();showExclusive("+intItemID+")\" onMouseOut=\"menuShouldClose()\"";
					var lineIcon      	= "<img src=\""+imageFolder+imagePrefix+strItemIcon+imageSuffix+"\" alt=\"\" align=\"left\" hspace=\"0\" vspace=\"0\" border=\"0\">\n";
					var lineItem      	= strItemName+"\n";
					var lineLinkend   	= "</a>";
					var lineCellEnd   	= "</nobr></td>\n";
					var strLinkClass	= arrRecursionThemes[intRecursionTheme][3][0];
					var strBackClass	= arrRecursionThemes[intRecursionTheme][2][0];

					// submenu indicators
					if(intSubMenus>0){
						lineArrow 	= "<img src=\""+arrRecursionThemes[intRecursionTheme][4][1]+"\" alt=\"\" border=\"0\" align=\"right\">\n";
					}else{
						lineArrow 	= "<img src=\""+arrRecursionThemes[intRecursionTheme][4][0]+"\" alt=\"\" border=\"0\" align=\"right\">\n";
					}

					// why god, why...				
					if(!booHorizontal){
						var lineStart 		= "<tr valign=\"middle\" height=\""+menuHeight+"\">\n";
						var lineEnd  		= "</tr>\n";
					}else{
						var lineStart 		= "";
						var lineEnd  		= "";
					}
					
					// link specific
					if(strItemTarget=="_blank"){
						var onClickEvent	= "onClick=\"w=window.open('"+strItemURL+"','pop"+tellerB+"','');w.focus()\"";
						if(!booBackgroundClickable) onClickEvent='';
						var lineCellStart 	= "<td nowrap "+onClickEvent+" "+lineMouseover+" class=\""+strBackClass+"\" id=\"tb"+intItemID+"\"><nobr>\n";
						var lineLinkstart 	= "<a href=\"javascript:w=window.open('"+strItemURL+"','pop"+tellerB+"','');w.focus()\" "+lineMouseover+" class=\""+strLinkClass+"\" id=\"ta"+intItemID+"\">\n";
					}else if(strItemURL=="javascript:{}"){
						var lineCellStart 	= "<td nowrap onclick=\"noclose=1\" "+lineMouseover+" class=\""+strBackClass+"\" id=\"tb"+intItemID+"\"><nobr>\n";
						var lineLinkstart 	= "<a href=\""+strItemURL+"\" onclick=\"noclose=1\" "+lineMouseover+" class=\""+strLinkClass+"\" id=\"ta"+intItemID+"\">\n";
					}else if(strItemURL.indexOf("javascript:{")>-1){
						var onClickEvent	= "onClick=\""+strItemURL+"\"";
						if(!booBackgroundClickable) onClickEvent='';
						var lineCellStart 	= "<td nowrap "+onClickEvent+" "+lineMouseover+" class=\""+strBackClass+"\" id=\"tb"+intItemID+"\"><nobr><nobr>\n";
						var lineLinkstart 	= "<a href=\""+strItemURL+"\" target=\""+strItemTarget+"\" "+lineMouseover+" class=\""+strLinkClass+"\" id=\"ta"+intItemID+"\">\n";
					}else{
						var onClickEvent	= "onClick=\"document.location.href='"+strItemURL+"'\"";
						if(!booBackgroundClickable) onClickEvent='';
						var lineCellStart 	= "<td nowrap "+onClickEvent+" "+lineMouseover+" class=\""+strBackClass+"\" id=\"tb"+intItemID+"\"><nobr>\n";
						var lineLinkstart 	= "<a href=\""+strItemURL+"\" target=\""+strItemTarget+"\" "+lineMouseover+" class=\""+strLinkClass+"\" id=\"ta"+intItemID+"\">\n";
					}


				// piecing together the items with the building-blocks
				strMenu = strMenu + ''
					+ lineStart
					//+ lineCellStart+lineLinkstart+lineArrow+lineIcon+lineItem+'&nbsp;&nbsp;&nbsp;'
					+ lineCellStart+lineLinkstart+lineArrow+'&nbsp;'+lineItem+'&nbsp;'
					+ lineLinkend+lineCellEnd
					+ lineEnd;
				}

			}
			// end table
			if(booHorizontal){strMenu = strMenu + "</tr>\n"}
			strMenu = strMenu+ "</table></td></tr></table>\n";
			
			// remember that this menu has been rendered
			arrRendered[arrRendered.length] = i;

			return strMenu;
		}
		
		function generateMenus(){
		if(menuAutoPos){aproximateMenuPos()}
		writeString = "\n";
	
			// writing all menu blocks
			for (var i=0 ;i<DBarray.length;i++){
				if(hasChild(i)>0){
					if(i>0){
						intMenuPosX = DBarray[i][6];
						intMenuPosY = DBarray[i][7];
					}else{
						intMenuPosX = menuPosX;
						intMenuPosY = menuPosY;
					}
					
					intZcounter = 20 + i;
					
					// floating layer
					if 		(ns)	{writeString = writeString+ "<layer name=\"blockDiv"+i+"\" pagex=\""+intMenuPosX+"\" pagey=\""+intMenuPosY+"\" z-index=\""+intZcounter+"\" visibility=\"hide\">\n";}
					else if	(ie || mo){writeString = writeString+ "<DIV ID=\"blockDiv"+i+"\" STYLE=\"position:absolute; left:"+intMenuPosX+"px; top:"+intMenuPosY+"px; z-index:"+intZcounter+"; visibility:hidden;\" class=\"fogeneral0\">\n";}
						
					if(!booOnDemandRendering) writeString += generateMenu(i);	
						
					// end floating layer
					if (ns){writeString = writeString+ "</LAYER>\n\n";}else if (ie || mo){writeString = writeString+ "</DIV>\n\n";}
				}
			}
		return writeString;
		}


	// ternary functions - control
		function handleFormSelects(booShow){
			if(ie && booFormSelectsHandling){
				if(!booShow){strVis='hidden'}else{strVis='visible'}
				for(var intA=0; intA<document.forms.length; intA++){
					for(var intB=0; intB<document.forms[intA].elements.length; intB++){
						document.forms[intA].elements[intB].style.visibility = strVis;
					}
				}
			}
		}	
	
		// item highlighting functions
		function unmarkAll(){
			if(!ns && markEnable!=0){
				for(var tellerA=1 ; tellerA < DBarray.length ; tellerA++){
					unmark(DBarray[tellerA][0]);
				}
			}
		}
		
		// don't unmark an item if it was highlighted prior
		function unmarkExclusive(unmarkItem){
			if(unmarkItem!=openMenu && noDelay==0){unmark(unmarkItem)}
		}
		
		// don't unmark an item if it was highlighted prior
		function markExclusive(markItem){
			if(noDelay==0){
				if(DBarray[markItem][1]==DBarray[openMenu][1]){unmark(openMenu)}
				mark(markItem);
			}
		}
		
		// locks layerblocks' vertical position
		function menuscrolllockinit() {
			// set "child-block"
			for (var tellerA=1; tellerA<DBarray.length; tellerA++){
				block = DBarray[tellerA][0];
				blockItems = hasChild(block);
				if (blockItems>0){
					// store the position in easylayer.js' cache
					intMenuWidth = menuMinWidth+(borderWidth*2);
					intMenuHeight = blockItems*menuHeight+(borderWidth*2);
					defineLayer("blockDiv"+block,true,DBarray[block][6],DBarray[block][7],21,intMenuWidth,intMenuHeight,1,'','',false,false,scrollLock,edgeCompensation);
					// update the position
					setPosition('blockDiv'+block,DBarray[block][6],DBarray[block][7],21,intMenuWidth,intMenuHeight,true,true);
				}
			}
			// set "home-block"
			blockItems = hasChild(0);
			// store the position in easylayer.js' cache
			intMenuWidth = menuMinWidth+(borderWidth*2);
			intMenuHeight = blockItems*menuHeight+(borderWidth*2);
			defineLayer("blockDiv0",true,menuPosX,menuPosY,20,intMenuWidth,intMenuHeight,1,'','',false,false,scrollLock,edgeCompensation);
			// update the position
			setPosition('blockDiv0',menuPosX,menuPosY,20,intMenuWidth,intMenuHeight,1,true,true);
			// report the menus functional
			inits=1;
			// activate easylayers.js' scroll-lock
			if(scrollLock){intRefreshrate=menuPositionFrequency;setScrollLock()}
		}		
		
		// menu foldout/foldin functions
		closeBranch = new Array(0,1); openMenu = 0;
		function showExclusive(showobj){
			// hide all form-elements which interfere with the layers
			handleFormSelects(false)
 			//trace the open menus back to the root
			openBranch = TraceBranch(showobj);
			//check if the menu's have changed
			if(openBranch[closeBranch.length-1] != closeBranch[closeBranch.length-1]){
				//close (only the changes to) the menu-branch
				for(tellerA = 0; tellerA < closeBranch.length; tellerA++){ 
					if(hasChild(closeBranch[tellerA])>0 && closeBranch[tellerA] != openBranch[tellerA])	{hide(closeBranch[tellerA])}
					if(closeBranch[tellerA] != 0 && closeBranch[tellerA] != openBranch[tellerA])		{unmark(closeBranch[tellerA])}
				}
			}
			//re-open the menu-branch
			for(tellerA = 0; tellerA < openBranch.length; tellerA++){ 
				//openMenu remembers the last opened menu
				if(hasChild(openBranch[tellerA])>0)	{show(openBranch[tellerA]);openMenu=openBranch[tellerA]}
				if(openBranch[tellerA] != 0)		{mark(openBranch[tellerA])}
			}
			// store the list of open menus for the next time
			closeBranch = openBranch;
			// lock the function up
			delayPoke = 1;
		}
	
		// Hides all a layer absolutely
		function hideall() {	
			for (var tellerA=1; tellerA<DBarray.length; tellerA++){
				var block = DBarray[tellerA][0];
				if(hasChild(block)>0){hide(block);}
			}
			hide(0);
			unmarkAll();
			closeBranch = Array(0,1);
		}
	
		var objTimeout0 = 0; var objTimeout1 = 0; var intPreviousRequest = -1;
		function menuShouldOpen(setblock){
			if(inits==1){
				// disable the menu closing
				menuShouldNotclose();
				// open the new item after a delay
				if(booRedrawRelatedItems) redrawMenuById(setblock);
				if(noDelay==1){
					showExclusive(setblock)
				}else{
					//do not reset timeouts of the same request
					if(intPreviousRequest!=setblock){
						intPreviousRequest = setblock;
						clearTimeout(objTimeout1);
						// reduce the delay if the menu also has to be rendered
						if(wasRendered(setblock)){
							setDelay = menuShowDelay;
						}else{
							setDelay = 0;
						}
						// delayed opening of the menu
						objTimeout1 = setTimeout('intPreviousRequest=-1;showExclusive('+setblock+')',menuShowDelay);
					}
				}
			}		
		}

		function menuShouldClose(){
			if(inits==1){
				// clear previous timeout
				clearTimeout(objTimeout0);
				// start new timeout
				objTimeout0 = setTimeout('menuWillClose()',menuCloseDelay);
			}
		}
		
		function menuShouldNotclose(){
			// clear current timeout
			clearTimeout(objTimeout0);
		}
		
		function menuWillClose(){
			// close all menus
			if(booRedrawRelatedItems) redrawMenuById(0);
			hideall();
			unmarkAll();
			// reporting back if possible
			if(reportToFrameSet)parent.imenuHasClosed();
			// show all previously hidden form-elements
			handleFormSelects(true)
		}
		
	
	// executed inline
		//closes the menu if you click anywhere but on it
		if (ns){ 
			document.captureEvents(Event.CLICK); 
			document.onClick = menuWillClose; 
		}else{
			document.onClick = menuWillClose;
		}
		// write the menus to the page
		writeMenus();
		document.close();
		menuscrolllockinit();
		unmarkAll();
