<!--
var bw = new lib_bwcheck();
var menu = new menuroot();

function menuroot()
{
	this.id = 0;
	this.imagepath = '../../layout/images/';
	this.subitems = new Array();
	this.width = 143;
    this.addmenu = new Function("newmenu", "this.subitems[this.subitems.length] = newmenu; newmenu.parent = this; return newmenu;")    
    this.placeholderpath = '../../layout/images/';
    this.currentexpanded = 0;
}

function menuitem(id, image, imageon, height, url, onclick, collapsing)
{
	var sTmp;

	this.id = id;
	this.imagename = image;
	this.imagename_on = imageon;
	this.collapsing = collapsing;	//true/false
	this.collapsed = true;			//default collapsed, see 'renderMenu() where this is changed'
	this.height = height;
	this.width = menu.width;
	this.url = url;	
	this.onclick = onclick;
	this.subitems = new Array();

	this.addmenu = new Function("newmenu", "this.subitems[this.subitems.length] = newmenu; newmenu.parent = this; return newmenu;")
		
	return this;
}

function menuitem_preload(m)
{
	// base images
	m.imagesrc = new Image;
	m.imagesrc.src = menu.imagepath + m.imagename + '.gif';
	
	sTmp = m.imagename_on;	
	if(sTmp == '')	
		sTmp = m.imagename + "_on";
	
	m.imageonsrc = new Image;
	m.imageonsrc.src = menu.imagepath + sTmp + '.gif';
	
	if(m.collapsing)
	{
		// images for expanded set.
		m.imagesrc_ex = new Image;
		m.imagesrc_ex.src = menu.imagepath + m.imagename + '_expanded.gif';
	
		sTmp = m.imagename_on;
		if(sTmp == '')	
			sTmp = m.imagename + "_on";
	
		m.imageonsrc_ex = new Image;
		m.imageonsrc_ex.src = menu.imagepath + sTmp + '_expanded.gif';
	}
}

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.moz= (this.agent.indexOf("Gecko/")>-1 && this.dom)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.moz || this.ns4 || this.ns6 || this.opera5 || this.dom)
	return this
}

function findmenuitem(arg_menu, id)
{
	var result;
	var i;
	
	if(arg_menu.id == id)
	{
		return(arg_menu);
	}
	
	for(i=0;i<arg_menu.subitems.length;i++)
	{
		result = findmenuitem(arg_menu.subitems[i], id)
		if(result != null)
		{
			return(result);	
		}
	}
	
	return(null);
}

function expand(arg_menu_id) {
	// find the item.
	var item;

	item = findmenuitem(menu, arg_menu_id)
	
	if(item.parent.currentexpanded != 0 && item.parent.currentexpanded != arg_menu_id)
	{
		findmenuitem(menu, item.parent.currentexpanded).collapsed = true;
		item.parent.currentexpanded = 0;
	} 
	
	if(item.collapsing)
	{		
		item.collapsed = !item.collapsed;
		
		item.parent.currentexpanded = (item.collapsed)?0:item.id;
		
		if(!bw.ns4)
		{
			var sel;
			var i;
			
			sel = (bw.ie4)?document.all.tags("SELECT"):document.getElementsByTagName("SELECT")			
		
			// make all form elements visible/invisible.
			
			for(i=0;i<sel.length;i++)
			{
				// todo: check if the form element is actually under the menu.
				if (bw.ie4) {
					sel[i].style.visibility=(item.collapsed)?"visible":"hidden"
				}
				if (bw.dom) {
				    sel[i].style.visibility=(item.collapsed)?"visible":"hidden"
				}		
			}
		}
		else
		{
			// handle hiding of form elements for NS4 (weet jij het?)
			if(menu.hideForm)
			{
				eval(menu.hideForm+".visibility=(item.collapsed)?'show':'hide'")
			}
		}
	}
	
	show_menu(menu);
}

function colorItem(item, newsrc) {
	if (bw.ns4) {
		var layer = "DIV" + item.id;
		var imgName = "IMG" + item.id;

		if (document.images && document.layers && layer!=null)
			eval('document.'+layer+'.document.images["' + imgName + '"].src = newsrc.src');
	}
	else {
		
		document.images["IMG" + item.id].src = newsrc.src;
	}
}

function hilite(astrHi) {
	var item = findmenuitem(menu, astrHi)

	if(item.collapsing && !item.collapsed)
		colorItem(item, item.imageonsrc_ex)
	else
		colorItem(item, item.imageonsrc)
}

function lolite(astrLo) {
	var item = findmenuitem(menu, astrLo)

	if (menu.active  == item) {
		if(item.collapsing && !item.collapsed)
			colorItem(item, item.imageonsrc_ex)
		else
			colorItem(item, item.imageonsrc)
	} else {
		if(item.collapsing && !item.collapsed)
			colorItem(item, item.imagesrc_ex)
		else
			colorItem(item, item.imagesrc)
	}
}

function setDivVisible(obj, visible)
{
	if(visible)
		showDiv(obj)
	else
		hideDiv(obj)
}

function hideDiv(obj) {
	if (bw.ns4) {
		eval("document.layers[\"DIV" + obj + "\"].visibility=\"hide\"")
	}
	if (bw.ie4) {
	    eval("document.all[\"DIV" + obj + "\"].style.visibility=\"hidden\"")
	}
	if (bw.dom) {
	    eval("document.getElementById(\"DIV" + obj + "\").style.visibility=\"hidden\"")
	}
}

function showDiv(obj) {
	if (bw.ns4) {
		eval("document.layers[\"DIV" + obj + "\"].visibility=\"show\"")
	}
	if (bw.ie4) {
	    eval("document.all[\"DIV" + obj + "\"].style.visibility=\"visible\"")
	}
	if (bw.dom) {
	    eval("document.getElementById(\"DIV" + obj + "\").style.visibility=\"visible\"")
	}
}

function getStyle(obj)
{
	if (bw.ns4) {
		return eval("document.layers[\"DIV" + obj + "\"]")
	}
	if (bw.ie4) {
	    return eval("document.all[\"DIV" + obj + "\"].style")
	}
	if (bw.dom) {
		return eval("document.getElementById(\"DIV" + obj + "\").style")
	}
}

function setDivTop(obj,aintY) {
	
	obj = getStyle(obj);
	obj.left = menu.left;
	obj.top = aintY;
}

function render_subitem(arg_menuitem) {
	var strTemp, strAction, strActionMouseover, strActionMouseout, strActionClick, strContent
	
	if (bw.ns4) {
		strActionMouseover = "hilite('" + arg_menuitem.id +"');";
	}
	else {
		strActionMouseover = "hilite('" + arg_menuitem.id +"');this.style.cursor='hand';";
	}
	strActionMouseout = "lolite('" + arg_menuitem.id +"');";
	
	strActionClick = "";
	if (arg_menuitem.collapsing && (arg_menuitem.subitems.length > 0)) {
		strActionClick = "expand(" + arg_menuitem.id + ");";
	}
	if (arg_menuitem.url != "") {
		strActionClick = strActionClick + "document.location.href='" + arg_menuitem.url + "';";
	}
	if (arg_menuitem.onclick != "") {
		strActionClick = strActionClick + arg_menuitem.onclick + "; ";
	}
	
	strActionClick = strActionClick + "return(false);"
	strAction = "";
	if (strActionMouseover != "") {
		strAction = strAction + " onMouseover=\"" + strActionMouseover + "\"";
	}
	if (strActionMouseout != "") {
		strAction = strAction + " onMouseout=\"" + strActionMouseout + "\"";
	}
	if (strActionClick != "") {
		strAction = strAction + " onClick=\"" + strActionClick + "\"";
	}

	var sTmp;
	sTmp = menu.imagepath + arg_menuitem.imagename;	
	if(arg_menuitem.collapsing && !arg_menuitem.collapsed)
		sTmp = sTmp & "_expanded";
	if(arg_menuitem == menu.active)
		sTmp = sTmp & "_on";

	strContent = "<IMG SRC=\"" + sTmp + ".gif\" alt=\"\" name=\"IMG" + arg_menuitem.id + "\" id=\"IMG" + arg_menuitem.id + "\" border=\"0\" width=\"" + arg_menuitem.width + "\" height=\"" + arg_menuitem.height + "\">";

	strTemp =  "<div name=\"DIV" + arg_menuitem.id + "\" id=\"DIV" + arg_menuitem.id + "\""
	if(arg_menuitem.parent.parent)
		strTemp += " class=\"menusubobject\"";
	else
		strTemp += " class=\"menuobject\"";
	
	if (bw.ns4) {
		strTemp =  strTemp + "><a href=\"#\"" + strAction + ">";
	} else {
		strTemp =  strTemp + strAction + ">";
	}
	
	strTemp = strTemp + strContent;
	
	if (bw.ns4) {
		strTemp =  strTemp + "</a>";
	}
	strTemp =  strTemp + "</div>\n";
	
	return strTemp;
}

function menu_get_current_size(arg_menu)
{
	// calculate initial size for menu.
	var lngtop = 0;
	var i;
	
	for(i=0; i < arg_menu.subitems.length; i++)
	{
		m = arg_menu.subitems[i]
		lngtop += m.height;		
		if(!m.collapsing || !m.collapsed || m.parent.currentexpanded == m.id)
		{
			for(j=0; j < m.subitems.length; j++) lngtop += m.subitems[j].height;
		}
	}		
	return(lngtop);
}

function render_menu(arg_menu)
{
	//document.open();

	// render placeholder here.
	menu.height = menu_get_current_size(arg_menu);
	
	document.write("<img id='menuplaceholder' name='menuplaceholder' width='" + menu.width + "' height='" + menu.height + "' src='" + menu.placeholderpath + "1pixel.gif' alt='placeholder'>");
	
	//document.close();
}

function render_menu2(arg_menu)
{
	var i;
	
	//document.open();
	
	// render the main layer.
	for(i=0; i < arg_menu.subitems.length; i++)
	{
		 render_menuitems(arg_menu.subitems[i]);
	}
	
	//document.close();
}

function render_menuitems(submenu)
{
	var i;
	
	if(submenu.parent.currentexpanded == submenu.id)
	{
		submenu.collapsed = false;
	}
	
	menuitem_preload(submenu);
	
	var sTmp;
	sTmp = render_subitem(submenu);
	document.write(sTmp);
		
	for(i=0; i < submenu.subitems.length; i++)
		 render_menuitems(submenu.subitems[i])
}

function show_menu(arg_menuitem)
{
	// determine visibility of all items in this menu.

	// first, locate the X/Y coordinates of the placeholder.
	menu.left = (bw.ns4 || bw.moz) ? document.images.menuplaceholder.x : GetOffsetX(document.all("menuplaceholder"));
	menu.top = (bw.ns4 || bw.moz) ? document.images.menuplaceholder.y : GetOffsetY(document.all("menuplaceholder"));

	lngtop = menu.top;
	
	var i;
	var lintSubItemYPos
	for(i=0; i < arg_menuitem.subitems.length; i++)
	{
		m = arg_menuitem.subitems[i]
		
		setDivTop(m.id, lngtop);
		setDivVisible(m.id, true)
		if(m.collapsing)
			colorItem(m, (!m.collapsed)?m.imagesrc_ex:m.imagesrc )
		lngtop += m.height;		
		lintSubItemYPos = lngtop;
		for(j=0; j < m.subitems.length; j++)
		{
			s = m.subitems[j];
				
			setDivTop(s.id, lngtop);
				
			if(!m.collapsing || !m.collapsed)
			{
				setDivTop(s.id, lngtop);
				setDivVisible(s.id, true);
				//colorItem(s, (s.collapsing && !s.collapsed)?s.imagesrc_ex:s.imagesrc )
				lngtop += s.height;		
			}
			else
			{
				setDivVisible(s.id, true)
				setDivTop(s.id, lngtop - s.height);
	

			}							
		}
		
	}
	
	// now hide all forms elements which are (partially) under the menu.
}
//-->