function showSectionTitleInBanner() {
	var target = document.getElementById("header_text");
	if (target == null) {
		return;
	}

	var MaestroMenu = document.getElementById("MaestroMenu");
	if (MaestroMenu == null) {
		return;
	}

	var divTags = MaestroMenu.getElementsByTagName("div");
	if (divTags == null) {
		return;
	}
	
	for (var i=0; i < divTags.length; i++) {
		if (divTags[i].attributes["class"].value == "Menu1Current") {
			if (divTags[i].firstChild.innerHTML != null) {
				target.innerHTML = divTags[i].firstChild.innerHTML;
			}
			else {
				target.innerHTML = divTags[i].innerHTML;
			}
			
			break;
		}
	}
}

function fixMenuStyles() {
// alert("entered routine");
var MaestroMenu = document.getElementById("MaestroMenu");
if (MaestroMenu == null) {
	return;
}

// alert(MaestroMenu);
var tables = MaestroMenu.getElementsByTagName("TABLE");
if (tables == null) {
	return;
}

// alert(tables);
var menuTable = tables[0];
if (menuTable == null) {
	return;
}

// alert(menuTable);
var display = "";

// find the lowest level current page
var lowestCurrentPageLevel = 0;
// alert(menuTable.rows.length);
for (i=0; i < menuTable.rows.length; i++) {
	// get the div node within the row
	target = menuTable.rows[i].cells[0].firstChild;

	// get the style class of the div node
	styleClass = target.attributes["class"].value;
	//display += getMenuLevel(styleClass) + "\n";

	if (isCurrentItem(styleClass)) {
		lowestCurrentPageLevel = getMenuLevel(styleClass);
	}
}
//alert(lowestCurrentPageLevel);

// set style of current pages
for (i=0; i < menuTable.rows.length; i++) {
	// get the div node within the row
	target = menuTable.rows[i].cells[0].firstChild;

	// get the style class of the div node
	styleClass = target.attributes["class"].value;

	// get the level of the div node
	level = getMenuLevel(styleClass);

	// set the style for the current item
	if (isCurrentItem(styleClass)) {
		extention = "";
		if (level == 1) {
			target.innerHTML = target.firstChild.innerHTML;
			continue;
		}
		if (level > 1 && level == lowestCurrentPageLevel) {
			extention += "_HL";
		}
		nextIdx = i + 1;
		hasChild = false;
		if (level > 1) {
			if (nextIdx < menuTable.rows.length) {
				nextTarget = menuTable.rows[nextIdx].cells[0].firstChild;
				nextStyleClass = nextTarget.attributes["class"].value;
				if (getMenuLevel(nextStyleClass) > level) {
					hasChild = true;
				}
			}
		}
		if (hasChild && level == 2) {
			extention += "_HC";
		}
		if (extention != "") {
			// alert(extention);
			target.attributes["class"].value = styleClass + extention;
		}
	}
}

}
function getMenuLevel(pStyleClass) {
	return pStyleClass.substring(4, 5);
}

function isCurrentItem(pStyleClass) {
	var rExp = new RegExp("Current", "g");
	return pStyleClass.match(rExp);
}

