// JScript File
// there should be a copy of this file in each directory
// set this to find the home directory
// eg if in /boats set it to "../" etc
var homeDirectory = "../../";

//		put the following html  in each page at the top of the <head> section
//		or at least before any references to other files
//		it will change the base for hrefs etc to home, ie the base of our tree
//
//	    <script type="text/javascript" language="javascript" src="directory.js"></script>
//		<script type="text/javascript" language="javascript">
//			setHome();
//		</script>	    

function setHome()
{
	var thisBase = document.location.href;
	var charPos = thisBase.length;
	var findChar = thisBase.substr(charPos, charPos);
	while ((findChar != "/") && (charPos > 0))
	{
		charPos = charPos - 1;
		findChar = thisBase.substr(charPos, 1);
	}
	thisBase = thisBase.substr(0, charPos + 1);
	thisBase = thisBase + homeDirectory;
	document.write("<base href='" + thisBase + "' />");
}
