// 2D array of labels
labels = new Array(14);
labels[0] = new Array("Overview");
labels[1] = new Array("Getting Started", "Running Exponare Public", "Using Exponare Public", "Exponare Public Concepts");
labels[2] = new Array("Map Tools", "Navigation", "Information", "Selections");
labels[3] = new Array("Legend");
labels[4] = new Array("Searches");
labels[5] = new Array("Information Results");
labels[6] = new Array("Printing");
labels[7] = new Array("Finding Addresses");
labels[8] = new Array("Quick Views");
labels[9] = new Array("Layer Shortcuts");
labels[10] = new Array("Frequently Asked Questions");


// 2D array of links
url = new Array(14);
url[0] = new Array("Overview.html");
url[1] = new Array("GettingStarted.html", "RunningExponarePublic.html", "UsingExponarePublic.html", "Concepts.html");
url[2] = new Array("MapTools.html", "NavigationTools.html", "InformationTools.html", "SelectionTools.html");
url[3] = new Array("Legend.html");
url[4] = new Array("Searches.html");
url[5] = new Array("InfoResults.html");
url[6] = new Array("Printing.html");
url[7] = new Array("FindAddress.html");
url[8] = new Array("QuickViews.html");
url[9] = new Array("LayerSettingsShortcuts.html");
url[10] = new Array("FAQ.html");

function BuildNavPanel(curPage)
{
    var i;
	var a;
	var content;
	var br;
	
    // Get the navigation panel object
    var td = document.getElementById('NavPanel');
    
    // Create leading space text
	var nbsp = String.fromCharCode(160);
	var space = nbsp + nbsp + nbsp + nbsp + nbsp;

    // Add each defined page to the panel
    for(i in url)
	{
		for(j in url[i])
		{
			// Check if on current page
			if(curPage == url[i][j])
			{
				a = document.createElement('a');
				a.setAttribute('id', 'CurrentPage');
				content = document.createTextNode(labels[i][j]);
				a.appendChild(content);
				
			}
			else
			{
				// Create the link element
				a = document.createElement('a');
				a.setAttribute('href', url[i][j]);
				a.setAttribute('id', 'NotCurrent');
				// Create text for the link
				content = document.createTextNode(labels[i][j]);
				a.appendChild(content);
			}
			
			// Add a space to indent any sub-categories
			if(j>0)
			{
				sp = document.createTextNode(space);
				td.appendChild(sp);
			}
			td.appendChild(a);
					
			// Create a break
			br = document.createElement('br');
			td.appendChild(br);
		}
	}
}