window.onload = function()
{
	menuMouseOver();
	nieuwsLayer();
}


function menuMouseOver()
{
	var navRoot = document.getElementById("hoofdmenu");
	for (i=0; i<navRoot.childNodes.length; i++) 
	{
		var node = navRoot.childNodes[i];
		if (node.nodeName == "LI") 
		{
			node.onmouseover=function() 
			{
				var imgName = '/images/home_'+this.childNodes[0].className+'_hover.gif';
				this.childNodes[0].childNodes[0].src = imgName;
			}
			
			node.onmouseout=function() 
			{
				var imgName = '/images/home_'+this.childNodes[0].className+'.gif';
				this.childNodes[0].childNodes[0].src = imgName;
			}
		}
	}		
}

function nieuwsLayer() 
{
	var openID = 0;
	var nieuwRoot = document.getElementById("nieuwbijentree");
	for (i=0; i<nieuwRoot.childNodes.length; i++) 
	{
		var node = nieuwRoot.childNodes[i];
		if (node.nodeName == "LI") 
		{
			if (node.className == "nieuwsitem") 
			{
				if(document.all)
				{
					//IE VIND DE A TAG DE EERSTE
					var node =  node.childNodes[0];
				}
				else
				{
					//FF VIND DE A TAG DE TWEEDE
					var node =  node.childNodes[1];
				}	
					
					nieuwsID = node.id; 
					
					//FUNCTION OPEN NIEUWS LAYER
					node.onclick=function() 
					{
						//Het is onmogelijk 2 items te openen
						if(openID == 0)
						{
                            document.getElementById('content_'+ this.id).style.display = 'block';
						    openID = this.id;
						    return (false);
						}
					    else
				        {
				            return (false);
				        }
					    
					}
					
					//FUNCTION CLOSE NIEUWS LAYER
					var closeLink = document.getElementById('close_'+ nieuwsID);
					
					closeLink.onclick = function()
					{
						document.getElementById('content_'+ openID).style.display = 'none';
						openID = 0;
					}
			}
		}
	}	
}
