// JavaScript Document
function menuHighlight()
{
	var navUL = document.getElementById('menu').childNodes[1]; //child nodes 1 to get the ul - first node is html or text - something like that
	if(navUL.childNodes.length > 0)
		processMenuChildren(navUL.childNodes);
		
	navUL = document.getElementById('bpm-menu').childNodes[1];
	if(navUL.childNodes[1].childNodes.length > 0)
		processMenuChildren(navUL.childNodes);
		
	navUL = document.getElementById('bpmc-menu').childNodes[1];
	if(navUL.childNodes.length > 0)
		processMenuChildren(navUL.childNodes);
}

function processMenuChildren(navigationChildren)
{
	//var navigationChildren = navUL.childNodes;
	for(var i = 0; i < navigationChildren.length; i++)
	{
		if(navigationChildren[i].nodeName == 'LI')
		{
			navigationChildren[i].onmouseover=function() 
			{
				this.className+=' hover';
			}
			navigationChildren[i].onmouseout=function() 
			{
				this.className=this.className.replace(' hover', '');
			}
		}
		
		for(var j = 0; j < navigationChildren[i].childNodes.length; j++)
		{
			if(navigationChildren[i].childNodes[j].nodeName == 'UL')
			{
				processMenuChildren(navigationChildren[i].childNodes[j].childNodes);
			}
		}
	}		
}

function addUp()
{
	var checkboxes=document.getElementsByName("checkbox");
	
	var total = 0;
	
	for(var i = 0; i < checkboxes.length; i++)
	{
		if(checkboxes[i].checked) total++;
	}
	
	document.getElementById("total").value = total;
}
