function hide_all_menus () {
	var nav = document.getElementById('header');
	if (nav) {
		var c = nav.rows[1].cells;
		for (i=0; i<c.length; i++) {
			if (c[i].className == 'main') {
				//if (c[i].id != 'main_active') {
					c[i].style.borderLeftColor = 'white';
					nav.rows[3].cells[c[i].cellIndex-2].style.borderLeftColor = 'white';
					nav.rows[4].cells[c[i].cellIndex-2].style.borderLeftStyle = 'none';
				//}			
				
				var divs = c[i].childNodes;
				for (j=0; j<divs.length; j++) {
					if (divs[j].tagName == 'DIV') {
						divs[j].style.display = 'none';
					}
				}
			}
		}
	}
}

function show_menu (menu) {
	hide_all_menus();
	var nav = document.getElementById('header');
	
	menu.style.borderLeftColor = '#00A5E4';
	nav.rows[3].cells[menu.cellIndex-2].style.borderLeftColor = '#00A5E4';
	nav.rows[4].cells[menu.cellIndex-2].style.borderLeftStyle = 'solid';	
	nav.rows[4].cells[menu.cellIndex-2].style.borderLeftWidth = '1px';
	nav.rows[4].cells[menu.cellIndex-2].style.borderLeftColor = '#00A5E4';	
	
	var divs = menu.childNodes;
	for (i=0; i<divs.length; i++) {
		if (divs[i].tagName == 'DIV') {
			divs[i].style.display = 'block';
		}
	}
}

function hide_menus () {
	hide_all_menus();
	var td = document.getElementById('main_active');
	if (td) {
		show_menu(td);
	}
}
