var trailMenu = new Object();
trailMenu["Horse-studs"] = "Horse studs";
trailMenu["Things-to-do"] = "Things to do";
trailMenu["Vineyards"] = "Vineyards";
trailMenu["Mayor-councillors"] = "Mayor and councillors";
trailMenu["Swimming-centres"] = "Swimming centres";
trailMenu["White-memorial-swimming-centre"] = "White Memorial Swimming Centre";
trailMenu["Denman-swimming-centre"] = "Denman Swimming Centre";
trailMenu["Sports-parks-recreation"] = "Sports, parks and recreation";
trailMenu["Council-services"] = "Council services";
trailMenu["Water-sewage"] = "Water and sewage";
trailMenu["Waste-recycling"] = "Waste removal and recycling";
trailMenu["Residential-waste-recycling"] = "Residential";
trailMenu["Waste-facilities"] = "Waste facilities";
trailMenu["Planning-development"] = "Planning, building and development";
trailMenu["Exempt-development"] = "General exempt development code";
trailMenu["Public-health"] = "Public health";
trailMenu["Environment"] = "Environment";
trailMenu["My-environment"] = "My environment";
trailMenu["State-of-environment-reports"] = "State of the environment reports";
trailMenu["Weeds"] = "Weeds";
trailMenu["Pets-animals"] = "Pets and animals";
trailMenu["Rates-charges"] = "Rates and charges";
trailMenu["Fees-charges-archive"] = "Archive";
trailMenu["Community-services"] = "Community services";
trailMenu["Grants"] = "Grants";
trailMenu["Contact-us"] = "Contact us";
trailMenu["About-Muswellbrook-Shire"] = "About Muswellbrook Shire";
trailMenu["About-council"] = "About council";
trailMenu["Committees"] = "Committees";
trailMenu["Books"] = "Books";
trailMenu["Muswellbrook-regional-arts-centre"] = "Muswellbrook regional arts centre";
trailMenu["Competitions"] = "Competitions";
trailMenu["Newsletters"] = "Newsletters";
trailMenu["Permanent-collections"] = "Permanent collections";
trailMenu["Roads-footpaths-drainage"] = "Roads, footpaths and drainage";
trailMenu["4730_WasteAsArt_exp250709"] = "Competition";
trailMenu["History"] = "History";
trailMenu["5030_expire200709"] = "Netball clinic";
trailMenu["Career-opportunities"] = "Career opportunities";
trailMenu["Expression-interest"] = "Expression of interest";
trailMenu["Local-government-history"] = "Local government history";
trailMenu["Organisational-structure"] = "Organisational structure";
trailMenu["Policies"] = "Policy register";
trailMenu["Plans"] = "Plans register";
trailMenu["Reports"] = "Reports";
trailMenu["Archive"] = "Archive";
trailMenu["Archived-plans"] = "Archive";
trailMenu["Business"] = "Business";
trailMenu["Residents"] = "Residents";
trailMenu["Collection-timetable"] = "Kerbside collection timetable";
trailMenu["Muswellbrook"] = "Muswellbrook";
trailMenu["Cemetaries"] = "Cemeteries";
trailMenu["Planning-reports-council"] = "Planning reports to Council";
trailMenu["Venues-for-hire"] = "Venues for hire";
trailMenu["5246-AustraliaDay2010"] = "Australia Day 2010 celebrations";
trailMenu["Newsletters"] = "Newsletters";







function makeTrailMenu() {
	var parseStart, volDelim, parseEnd;
	var output = "<span style='font-family: Trebuchet MS, Verdana, Arial; font-size:11px; color:#000000'>";
	var linkStyle = "color:#339966";
	var path = location.pathname;
	var separator = "&nbsp;&raquo;&nbsp;";
	var re = /\\/g;
	path = path.replace(re, "/");
	var trail = location.protocol + "//" + location.hostname;
	var leaves = path.split("/");
	if (location.protocol.indexOf("file") != -1) {
		parseStart = 1;
		volDelim = "/";
	} else {
		parseStart = 0;
		volDelim = "";
	}
	if (leaves[leaves.length-1] == "" || leaves[leaves.length-1] == "index.html" || leaves[leaves.length-1] == "Index.html") {
		parseEnd = leaves.length -1;
	} else {
		parseEnd = leaves.length;
	}
	for (var i = parseStart; i < parseEnd; i++) {
		if (i == parseStart) {
			trail += "/" + leaves[i] + volDelim;
			output += "<a href='" + trail + "' style='" + linkStyle + "'>";
			output += "Home" + "</a>" + separator;
		} else if (i == parseEnd - 1) {
			output += document.title;
		} 
		else {
			trail += leaves[i] + "/";
			output += "<a href='" + trail + "' style='" + linkStyle + "'>";
			output += trailMenu[leaves[i]] + "</a>" + separator;
		}
	}
	output += "</span>";
	return output;
}
