// code to change the Table of Contents selector to current page
function changeTOCSelected(towhich) {
	addLoadEvent(
		function() { parent.toc.changepicture( towhich ); }
	);
}

// strip off the file part of the URL
function findURLDir(url) {
	var loc = url.lastIndexOf('/');
	if(loc > 0) return url.substr(0, loc + 1);
	loc = url.lastIndexOf('\\');
	if(loc > 0) return url.substr(0, loc + 1);
	return url;
}
function addheadingimage(name, alink) {
	name = name.replace(/ /g,"_").toLowerCase();
	if(alink != "" && alink != null) document.write('<a name="' + alink + '" class="subtitle">');
	document.write('<img src="images/headline_' + name + '.jpg">');
	if(alink != "" && alink != null) document.write('</a>');
	document.write('<br>');
}