var pages = ['MindMapTitle.html', '1.html', '2.html', '3.html', '3-1.html', '3-2.html', '4.html', '4-1.html', '4-2.html', '4-3.html', '4-4.html', '5.html', '5-1.html', '5-2.html', '5-3.html', '5-4.html', '6.html', '7.html', '7-1.html', '7-2.html', '7-3.html', '7-4.html', '8.html', '8-1.html', '8-2.html', '8-3.html', '9.html', '10.html', '11.html', '12.html', '13.html', '13-1.html', '13-2.html', '13-3.html', '13-4.html', '14.html', '15.html', '16.html'];


function goPreviousPageFrom(currentPageName, usingFrames) {
	// We need to ensure that we are dealing with a string...
	var str = currentPageName+"";
	lastindex = str.lastIndexOf('/');
	str = str.substring(lastindex+1);
	found = false;
	pageNumber = 0;
	for (i = 0; i < pages.length; i++) {
		str2 = pages[i];
		lastindex = str2.lastIndexOf('/');
		str2 = str2.substring(lastindex+1);

		if (str2 == str) {
			found = true;
			pageNumber = i-1;
			if (pageNumber < 0) {
				pageNumber = pages.length-1;
			}
			if (usingFrames) {
				top.middle.content.location.href = pages[pageNumber];
			} else {
				location.href = pages[pageNumber];
			}
			break;
		}
	}
	if (!found) {
		if (usingFrames) {
			top.middle.content.location.href = pages[pageNumber];
		} else {
			location.href = pages[pageNumber];
		}
	}
}

function goNextPageFrom(currentPageName, usingFrames) {
	// We need to ensure that we are dealing with a string...
	var str = currentPageName+"";
	lastindex = str.lastIndexOf('/');
	str = str.substring(lastindex+1);
	found = false;
	pageNumber = 0;
	for (i = 0; i < pages.length; i++) {
		str2 = pages[i];
		lastindex = str2.lastIndexOf('/');
		str2 = str2.substring(lastindex+1);

		if (str2 == str) {
			found = true;
			pageNumber = i+1;
			if (pageNumber >= pages.length) {
				pageNumber = 0;
			}
			if (usingFrames) {
				top.middle.content.location.href = pages[pageNumber];
			} else {
				location.href = pages[pageNumber];
			}
			break;
		}
	}
	if (!found) {
		if (usingFrames) {
			top.middle.content.location.href = pages[pageNumber];
		} else {
			location.href = pages[pageNumber];
		}
	}
}

function goHomePage(usingFrames) {
	if (usingFrames) {
		top.middle.content.location.href = pages[0];
	} else {
		location.href = pages[0];
	}
}

function goOverviewPage(usingFrames) {
	if (usingFrames) {
		top.middle.content.location.href = "overview.html";
	} else {
		location.href = "overview.html";
	}
}

