function startList() 
{
	if(document.all&&document.getElementById) 
	{
		navRoot = document.getElementById("menulist");

		for(i=0; i < navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];

			if (node.nodeName == "LI")
			{
				node.onmouseover = function() 
				{
					this.className += " menuover";
  				}
  
  				node.onmouseout = function() 
  				{
  					this.className = this.className.replace(" menuover", "");
   				}
   			}
  		}
 	}
}

function getWindowHeight() 
{
	var windowHeight = 0;

	if(typeof(window.innerHeight) == 'number') 
	{
		windowHeight = window.innerHeight;
	}
	else 
	{
		if(document.documentElement && document.documentElement.clientHeight) 
		{
			windowHeight = document.documentElement.clientHeight;
		}
		else 
		{
			if(document.body && document.body.clientHeight) 
			{
				windowHeight = document.body.clientHeight;
			}
		}
	}

	return windowHeight;
}

function setFooter() 
{
	if(document.getElementById) 
	{
		var windowHeight = getWindowHeight();
		var scaleFaktor = 50;
		
		if(windowHeight > 0) 
		{
			var contentHeight = document.getElementById('main').offsetHeight;
			var footerElement = document.getElementById('gras');
			var footerHeight = footerElement.offsetHeight;
			
			if(windowHeight - (contentHeight + footerHeight) >= scaleFaktor) 
			{
				footerElement.style.position = 'absolute';								
			}
			else 
			{
				footerElement.style.position = 'static';
			}			
		}		
			
		footerElement.style.display = 'block';
	}		
}

function agendaTabs()
{
	if(document.getElementById)
	{
		if(document.getElementById('alsoseenieuwstab') && document.getElementById('alsoseeagendatab'))
		{
			// Fix voor IE6
			var nieuwsContent = document.getElementById('alsoseenieuwscontainer').innerHTML;
			var agendaContent = document.getElementById('alsoseeagendacontainer').innerHTML;			
			
			// Nieuws tab.
			document.getElementById('alsoseenieuwstab').onclick = function()
			{
				// IE6 Fix : Content nieuwstab terugplaatsen en agendatab legen.
				document.getElementById('alsoseenieuwscontainer').innerHTML = nieuwsContent;
				document.getElementById('alsoseeagendacontainer').innerHTML = '';			
				
				// juiste div aktief maken.
				document.getElementById('alsoseenieuwscontainer').style.display = 'block';
				document.getElementById('alsoseeagendacontainer').style.display = 'none';				
				
				// tab selecteren.
				document.getElementById('alsoseenieuwstab').className = 'tabactive';
				document.getElementById('alsoseeagendatab').className = '';
			}	
			
			// Agenda tab.
			document.getElementById('alsoseeagendatab').onclick = function()
			{
				// IE6 Fix : Content nieuwstab terugplaatsen en agendatab legen.
				document.getElementById('alsoseenieuwscontainer').innerHTML = '';
				document.getElementById('alsoseeagendacontainer').innerHTML = agendaContent;
				
				// juiste div aktief maken.
				document.getElementById('alsoseenieuwscontainer').style.display = 'none';
				document.getElementById('alsoseeagendacontainer').style.display = 'block';
				
				// tab selecteren.
				document.getElementById('alsoseenieuwstab').className = '';
				document.getElementById('alsoseeagendatab').className = 'tabactive';
			}		
		}
	}
}

function setMultimediaLightbox()
{
	if(document.getElementById('alsoseefotoalbumlink'))
	{
		var box = {};
			
		box = new MultiBox('medialink', {useOverlay: true, showControls: false});
	}
	
	if(document.getElementById('multimedia'))
	{
		var box = {};
			
		box = new MultiBox('medialink', {useOverlay: true, showControls: true});
	}
}

window.onload = function() 
{
 	setMultimediaLightbox();
 	setFooter(); 
 	startList();
 	agendaTabs(); 	
}

window.onresize = function() 
{
  	setFooter();
}



