function sI(wid,hgt) {
	return '<IMG height=' + hgt + ' src="/img/spacer.gif" width=' + wid + '>';
} 

function RenderLocalNav() {
	var tdBg = '<TD bgColor=#f9edb1>';
	var td2Bg = '</TD><TD bgColor=#f9edb1>';
	document.write('<A href="' + Section.Link + '"><IMG height=22 alt="' + Section.AltText + '" src="' + Section.ImageURL + '" width=172 border=0></A><BR>');
	//document.write('<TABLE cellSpacing=0 cellPadding=3 width=172 border=0><TBODY>');
	document.write('<TR>' + tdBg + sI(1,1) + '</TD><TD bgColor=#f9edb1 colSpan=3><B>' + Category.Label + '</B></TD></TR>');
	var foundIndex = -1;  // Determine index of current page
	for (i=0;foundIndex<0;i++) {		
		if (Pages[i][0] == currentPageID) {
			foundIndex = i;
		}
	}
	var parentIndex = -1;  // Determine index of Page-level page
	if (Pages[foundIndex][1] == 'X') {
		parentIndex = foundIndex;
	} else {
		for (i=foundIndex-1;parentIndex<0;i--) {
			if (Pages[i][1] == 'X') {
				parentIndex = i;
			}
		}
	}
	for (i=0;i<Pages.length;i++) {  // Loop through each page in list for display
		iconType = 'bullet_black_arrowdn_3.gif';
		if (i == foundIndex) {  // Display the proper cell background color
			bgColor = '#FFFFFF';
		} else {
			bgColor = '#f9edb1';
		}
		if (i == parentIndex) {
			displaySubNavigation = true;  // Show Subpages for this Page's section
			iconType = 'bullet_black_arrow_3.gif';  // Show Open bullet box for current page
			if (i != foundIndex) {  // Display Page as bold if contained Subpage is Current Page
				Pages[i][2] = '<b>' + Pages[i][2] + '</b>';
			}
		} else {
			if (Pages[i][1] == 'X') {  // Hide Subpages for Other Sections
				displaySubNavigation = false;
			}
		}
		if (Pages[i][1] == 'X') {
			document.write('<TR>' + tdBg + sI(1,1) + '</TD>');
			document.write('<TD vAlign=top bgColor=' + bgColor + '><IMG height=11 src="/img/' + iconType + '" width=7></TD>');
			document.write('<TD vAlign=top bgColor=' + bgColor + ' colSpan=2><A class=subnav href="' + Pages[i][3] + '">'+ Pages[i][2] + '</A></TD></TR>');
		} else {
			if (displaySubNavigation == true) {
				document.write('<TR>' + tdBg + sI(1,1) + td2Bg + sI(1,1) + '</TD>');
				document.write('<TD vAlign=top bgColor=' + bgColor + '><IMG height=11 src="/img/bullet_gray_nav.gif" width=6></TD>');
				document.write('<TD vAlign=top bgColor=' + bgColor + '><A class=subnav href="' + Pages[i][3] + '">' + Pages[i][2] + '</A></TD></TR>');
			}
		}
	}
	document.write('<TR>' + tdBg + sI(1,6) + td2Bg + sI(7,6) + td2Bg + sI(6,6) + td2Bg + sI(134,6) + '</TD></TR></TBODY>');
}
RenderLocalNav();