// JavaScript Document

var trailMenu = new Object();
trailMenu["idep"] = "IDEP";
trailMenu["a-z"] = "Reportable Diseases";
trailMenu["cancer"] = "Cancer Registery";
trailMenu["needlestick"] = "Needlestick Program";
trailMenu["training"] = "IDEP Training"


function makeTrailMenu() {
	var parseStart, volDelim, parseEnd;
	var output = "<span style='font-family:Verdana; font-size:10pt; font-weight:bold; " + "color:#0000ff; padding:4px'>";
	var linkStyle = "color:#008000";
	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.asp" || leaves[leaves.length-1] == "default.asp") {
		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 += "WVDHHR.ORG";
		}else if (i == parseEnd -1) {
			output += document.title;
			separator = "";
		}else{
			trail += leaves[i] + "/";
			output += "<a href='" + trail + "' style'" + linkStyle + "'>";
			output += trailMenu[leaves[i]];
		}
		output += "</a>" + separator;
	}
		output += "</span>";
		return output;
	}
		