
// Enter your domain name here, 
var url = "www.angelo.edu";

// Enter the word you want to use to describe the home page of your site
var home = "Home";

// Enter the character(s) you want to use to separate your breadcrumbs
var divide = "&raquo;";

// Enter text you'd like to see.  You can make this blank as well - "";
var pre = "";

// Enter the extension you use for your pages
var ext = ".html";

// Enter the default file name you use for the root file of your folders
var root = "index";

//////////////////////////////////////////////////////////////////////////////
// DO NOT TOUCH ANYTHING BELOW THIS LINE                                    //
// unless done in accordance with the instructions at the top of the page.  //
//////////////////////////////////////////////////////////////////////////////

divide = " " + divide + " ";
var a = "" + window.location;
var b = "";
var bar = divide + root;
var code = "";
var foo = root + ext;
var left = "";

a = a.replace(ext,"");
left = a.lastIndexOf("/");

if (a.substring(a.lastIndexOf("/")) == "/") {
	a = a + root;
}

b = a.substring(left+1);
b = b.replace(/_/g," ");
b = b.replace(/#/g,divide);

// Alternative spacer: hyphen. Remove comment tags in the next line to activate
// b = b.replace(/-/g," ");

//code = divide + b;
b = "/" + b
b = b.replace(divide,"#");
b = b.replace(/ /g,"_");

// Alternative spacer: hyphen. Remove comment tags in the next line to activate
// b = b.replace(/ /g,"-");

a = a.replace(b,"");

if (a.substring(left-1) != "/") {
	do  {
		left = a.lastIndexOf("/");
		b = a.substring(left+1);
		b = b.replace(/_/g," ");
		
		// Alternative spacer: hyphen. Remove comment tags in the next line to activate
		// b = b.replace(/-/g," ");

		code = divide + "<a href=\"" + foo + "\">" + b + "</a>" + code;
		foo = "../" + foo;
		b = "/" + b;
		b = b.replace(/ /g,"_");
		
		// Alternative spacer: hyphen. Remove comment tags in the next line to activate
		// b = b.replace(/ /g,"-");

		a = a.replace(b,"");
	} while (a.substring(left-1) != "/");
}

code = code.replace(url,home);
code = code.replace(bar,"");
code = (code.substring(code.indexOf("<")));
code = pre + code;

// bread crumb title
var bread_title = document.title;
var title_length_MAX = 25;
if (bread_title.length > title_length_MAX) {
	bread_title = bread_title.substring(0, title_length_MAX - 3) + '...';
}
code = code + divide + bread_title;   // add document title to breadcrumb

document.getElementById('breadcrumbs').innerHTML = code;
