// How many charts are there in the menu
var totalNumberOfCharts = 2;

function chartMenu() {
	document.write('<li id="ChartMenu1"><a onclick="showChart(1);menuSetCurrent(1);">Bankroll vs. Time</a></li>');
	document.write('<li id="ChartMenu2"><a onclick="showChart(2);menuSetCurrent(2);">Earnings vs. Time</a></li>');
}

function menuSetCurrent(menuItem) {
	var n = 1;
	while (n <= totalNumberOfCharts) {
		if (n !== menuItem) {
			document.getElementById('ChartMenu' + n).className = "";
		} else {
			document.getElementById('ChartMenu' + n).className = "current";
		}
		n++;
	}
}

function showChart(selectedChart) {
	var n = 1;
	while (n <= totalNumberOfCharts) {
		if (n !== selectedChart) {
			document.getElementById('Chart' + n).style.display = 'none';
		} else {
			document.getElementById('Chart' + n).style.display = 'block';
		}
		n++;
	}
}