// GET ROUGH BREADCRUMBS
var http = 0;
if(location.href.match(/^http/))
	{
	http=1;
	}
var url = location.href.replace(/^http:\/\/.*?\//,"");

url = url.replace(/\?.*?$/,"");
url = url.replace(/php.*?$/,"php");
url = url.replace(/index\..*?$/,"");

var ind = 0; //different offsets for index and other files

if(url.match(/(.html)|(.php)$/))
	{
	ind=1;
	
	url = url.replace(/(.html)|(.php)$/,"");
	}

// MAKE HRELP SPECIFIC REPLACEMENTS

url = url.replace(/us\//ig," us\/");
url = url.replace(/archive\/resources/,"archive\/language resources");
url = url.replace(/documentation/,"language documentation");
url = url.replace(/grants/,"research grants");
url = url.replace(/languages/,"endangered languages");
url = url.replace(/inendangered languageswelive/,"in languages we live");
url = url.replace(/publiclecture/,"public lecture");
url = url.replace(/mediaarchive/,"media archive");
url = url.replace(/project_details/,"project details");
url = url.replace(/myhrelp/,"my hrelp");
url = url.replace(/_/," ");
url = url.replace(/whatisit/,"what is it?");
url = url.replace(/endangeredvoices/,"endangered voices");
url = url.replace(/apply/,"how to apply");
url = url.replace(/training/,"training ");
url = url.replace(/papers/,"books &amp\; papers");


// ADD LINKS
url = url.replace(/\/$/,"")+ " ";
var bits = url.split(/\//);

url = "";
for (i=0; i<bits.length-1; i++) 
	{
	var path = "./";
	for($j=i+ind;$j<bits.length-1;$j++)
		{
		path = path+  "../";
		}
	url = url + " <a href=\"" + path + "\">" + bits[i] + "</a> &gt\; ";
	}


// WRITE THE RESULT
if(http==1 && bits.length > 0 && location.href != "http://www.hrelp.org/")
	{
	document.write ("<a href=\"http://www.hrelp.org/\">home</a> &gt\; " + url + bits[bits.length-1]);
	}
else
	{
	document.write ("<a href=\"http://www.hrelp.org/\">home</a>");
	}
