current_id = undefined

highlights = function(colors)
{
	if (current_id)
	{
		//my_parents  = parents[current_id];
		//my_children = children[current_id];
		my_neigh = neigh[current_id];
		my_ring = ring[current_id];
		//for (i in my_parents)
		//{
		//	document.getElementById(my_parents[i]).style.background = colors[0];
		//}
		//for (i in my_children)
		//{
		//	document.getElementById(my_children[i]).style.background = colors[1];
		//}
		for (i in my_neigh)
		{
			document.getElementById(my_neigh[i]).style.background = colors[i];
		}
		document.getElementById(current_id).style.background = colors[4];

		for (i in my_ring)
		{
			document.getElementById(my_ring[i]).style.border = colors[5];
		}
	}
}

mouseover = function(ev)
{
	var node = ev.target;
	var id = undefined;
	while (node != null && (id == undefined || id == ""))
	{
		id = node.id;
		node = node.parentNode;
	}
	if (id)
	{
		highlights(["","","","","",""]);
		current_id = id;
		highlights(["#fb7","#fbb","#bfb","#bbf", "#ddd", "1px solid black"]);
	}
}

onload = function()
{
	document.addEventListener('mouseover', mouseover, false)
	//document.addEventListener('mouseout',  clear_highlights, true)
}
