function chap(url, name) {
	var html;
	if (location.href.indexOf(url) >= 0) {
		html = name;
	} else {
		html = '<a href="#" onclick="location.href = ' + "'"+url+"'" + ';">' + name + '</a>';
	}
	document.write(' | ' + html);
}

chap("basics.html", "Basics");
chap("techniques.html", "Techniques");
chap("stage1.html", "Stage 1");
chap("stage2.html", "Stage 2");
chap("misc.html", "Miscellaneous");
chap("discussion.html", "Discussion");
