
var white = '#ffffff';
var active_bold = '';
var active_td = '';
var active_sub = '';
var active_sub_bold = '';

//bold functions
function bold_iT(b){
//	document.getElementById(b).style.fontWeight='bold';
}
function debold_iT(b){
//	document.getElementById(b).style.fontWeight='normal';
}


//layer functions

function layer(id, color)
{
	var new_active_td = 'td_' + id;
	if (new_active_td != active_td)
	{
		document.getElementById(new_active_td).style.backgroundColor = color;
		if (active_td != '')
			document.getElementById(active_td).style.backgroundColor = white;
		active_td = new_active_td;
	}
	
	var new_active_sub = 'sub' + id;
	if (new_active_sub != active_sub)
	{
		sub_on (new_active_sub, color);
		if (active_sub != '')
			sub_off (active_sub);
		active_sub = new_active_sub;
	}
	
	highlight(id);
}

function sub_on (layer, color)
{
	document.getElementById(layer).style.backgroundColor = color;
	document.getElementById(layer).style.visibility = 'visible';
}

function sub_off (layer)
{
	document.getElementById(layer).style.visibility = 'hidden';
}

function highlight(id)
{
	var new_active_bold = 'b'+id;
	if (active_bold != new_active_bold)
	{
		bold_iT(new_active_bold);
		if (active_bold != '')
			debold_iT(active_bold);
		active_bold = new_active_bold;
	}
}

function choose_menu_entry(id, text)
{
	parent.document.title = text;
	var new_active_sub_bold = 'b_sub'+id;
	if (active_sub_bold != new_active_sub_bold)
	{
		bold_iT(new_active_sub_bold);
		if (active_sub_bold != '')
			debold_iT(active_sub_bold);
		active_sub_bold = new_active_sub_bold;
	}
}
