// This script creates the breadcrumb trail
// The URL for the homepage is hardcoded and an absolute reference

var temp   = "";
var prefix = "";
var links  = "";
var title  = document.title;
var path   = "" + location.href;
var parts  = path.split("/");
var num    = parts.length;
    if  (title == "Adaptive Management: Public Website")
        { document.write("<strong>Adaptive Management Homepage</strong>") }
            else {
				document.write("<a href=\"http://www.gov.bc.ca\" title=\"B.C. Home\" >B.C. Home</a>&nbsp;&#187;&nbsp;");
				document.write("<a href=\"http://www.gov.bc.ca/for/\" title=\"Ministry of Forests and Range\">Forests &amp; Range</a>&nbsp;&#187;&nbsp;");
				document.write("<a href=\"http://www.for.gov.bc.ca/hfp/amhome/index.htm\" title=\"Adaptive Management\">Adaptive Management</a>&nbsp;&#187;&nbsp;");
                   for (i=0; i < num; i++)
                       { temp += parts[i] + "/";
                         if (parts[i].toUpperCase() == "HRA")
                         { prefix = temp;
                           for (j=(i+1); j < (num-1); j++)
                           { links += parts[j] + "/"
                             document.write("<a href='" + prefix + links + "index.htm'>" + parts[j]+ "</a>"); } } }
                   document.write(title) };