/*******************************************************************************
Designed by Mike Wright of Page Maker Web Design (www.pagemaker.co.nz)
Copyright (c) 2002 Mike Wright (mike@pagemaker.co.nz)
This script can be used freely as long as all copyright messages are intact. 
*******************************************************************************/
var history = new Array ()
var siteName = "BCO"
var siteURLs = new Array ("bco.org.nz")
var databaseTitle = "Database"
var homepageTitle = "Welcome"
function makeTitle () {
	history.length = 0
	path = location.href
	for (i = 0; i < siteURLs.length; i++) {
		if (path.indexOf (siteURLs[i]) > -1) {
			siteURL = siteURLs[i]
			break
		}
	}
	root = path.substring (0, path.indexOf (siteURL) - 1)
	if (root.indexOf ("www") > -1) {
		root = root.substring (0, root.length - 4)
	}
	filename = path.substring (path.lastIndexOf ("/") + 1, path.length)
	path = path.substring (path.indexOf (siteURL), path.lastIndexOf ("/"))
	if (path == siteURL) {
		document.write (homepageTitle)
	}
	else {
		while (path.indexOf ("%20") > -1) {
			path = path.substring (0, path.indexOf ("%20")) + " " + path.substring (path.indexOf ("%20") + 3, path.length)
		}
		i = 0
		while (path.indexOf ("/") > -1) {
			history[i] = path.substring (0, path.indexOf ("/"))	
			path = path.substring (path.indexOf ("/") + 1, path.length)
			i++
		}
		history[i] = path
		document.write ("<a href='", root, "/", siteURL, "/index.htm'>", siteName, "</a> &middot; ")
		for (j = 1; j <= i; j++) {
			if (j < i) {
				document.write ("<a href='", root, "/")
				for (k = 0; k <= j; k++) {
					document.write (history[k], "/")
				}
				document.write ("index.htm'>")
			}
			if (history[j] == "cgi-bin") {
				document.write (databaseTitle)
			}
			else {
				document.write (history[j])
			}
			if (j < i) {
				document.write ("</a> &middot; ")
			}
		}
	}
}