// Change the following variables as instructed
var url = "icsscontrols.com" //Enter your domain name here
var home = "Home" //Enter the word you want to use to describe the home page of your site
var divide = "&raquo;" //Enter the character(s) you want to use to separate your breadbrumbs
var ext = ".php" //Enter the extension you use for your pages
var root = "index" //Enter the default file name you use for the root file of your folders

// DO NOT TOUCH ANYTHING BELOW THIS LINE

divide = " " + divide + " ";
var a = "" + window.location;
var b = "";
var bar = divide + root;
var code = "";
var foo = root + ext;
var left = "";
var left2 = "";
var right2 = "";
var subdomain = "";

a = a.replace(ext,"");
left = a.lastIndexOf("/");
left2 = a.lastIndexOf("//");
right2 = a.lastIndexOf(url);
subdomain = a.substring(left2+2,right2);

if (a.substring(a.lastIndexOf("/")) == "/") {
	a = a + root;
}

b = a.substring(left+1);
b = b.replace(/_/g," ");
code = divide + b;
b = "/" + b
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," ");
		code = divide + "<a href=\"" + foo + "\">" + b + "</a>" + code;
		foo = "../" + foo;
		b = "/" + b
		b = b.replace(/ /g,"_");
		a = a.replace(b,"");
	} while (a.substring(left-1) != "/");
}
code = code.replace(subdomain,"");
code = code.replace(url,home);
code = code.replace(bar,"");
code = (code.substring(code.indexOf("<")));
document.getElementById('path').innerHTML = code;