	var bShowsidebars = new Array(true, true);  //show both sidebars initially.
	//var bShowmainbar = true;
	//var bShowsecondarybar = true;

function highlightCurpage () {
	var aLinks = document.getElementById("secondarybar").getElementsByTagName("a");
	if (aLinks) {
		for (var i =0; i <aLinks.length; i ++) {
			if (aLinks[i].href == document.URL && aLinks[i].parentNode.className != "cur-page") {
				aLinks[i].parentNode.className = "cur-page";
				break;
			}
		}
	}
}

function inspect(elm){
	var str = "";
	for (var i in elm){
    	if (elm.getAttribute(i) != null) str += i + ": " + elm.getAttribute(i) + "\n";
	}
	alert(str);
}
function showHideSidebar (ibarId) {
	var scurbar = (ibarId == 0) ? "mainbar" : "secondarybar";
	var bCurDisplay = (ibarId == 0) ? bShowsidebars[0] : bShowsidebars[1] ;
	
	//get the current sidebar object and the content column object
	var ocurbar = document.getElementById(scurbar);
	//inspect(ocurbar);
	var ocontent = document.getElementById("content");
	//toggle display of curbar.
	var sDisplay = bCurDisplay ? "none" : "";
	ocurbar.style.display = sDisplay;
	
	//remember the state of the sidebar.
	if (ibarId == 0) bShowsidebars[0] = sDisplay;
	else bShowsidebars[1] = sDisplay;
	
	//alert (ocontent.getAttribute("id"));
	//inspect(document.getElementById("content"));
	//increase or decrease the content column based on the display.
	if (bCurDisplay)  {
		//if the sidebar is showing, hide the sidebar and add 200 to the width of content.
		ocontent.setAttribute("width") = "660px";
		//toggle the image here.
	} else {
		//subtract 200 otherwise.
		ocontent.width = ocontent.width - 200;
		//toggle the image here.
	}
	
}

