// Change visibility of the given layer
function ChangeDisplay(theLayer) { 
	if (document.getElementById) {
		lay = document.getElementById(theLayer);
	} else {
		lay = eval("document.all."+theLayer);
	}
	if ((lay.style.display == "none") || (lay.style.display == "")) {
		lay.style.display = "block";
	} else {
		lay.style.display = "none";
	}
}

function showActive() {
 // Parse current filename for category and element
 var loc     = document.location.href;
 var parts   = loc.split('/');
 var current = parts[parts.length - 1];
 var elementID;
 var catID;
 var headID;

 var tmp   = current.split('.');
 current   = tmp[0];
 parts     = current.split('_');
 if (parts.length > 1) {
	 catID     = 'sub_' + parts[0];
	 headID    = 'li_' + parts[0];
	 elementID = current;
	
	 // Set style for active category and element
	 ChangeDisplay(catID);
	 active = document.getElementById(headID);
	 active.style.color           = '#fff';
	 active.style.backgroundColor = '#000';
	 active.style.borderLeftWidth = '5px';
	 active.style.borderLeftStyle = 'solid';
	 active.style.borderLeftColor = '#f60';
	 active.style.padding         = '5px';
	 
	/* active = document.getElementById(elementID);
	 active.style.display         = 'block';
	 active.style.color           = '#fff';
	 active.style.backgroundColor = '#000';
	 active.style.borderLeftWidth = '5px';
	 active.style.borderLeftStyle = 'solid';
	 active.style.borderLeftColor = '#f60';
	 active.style.padding         = '0px';*/
 }
}
