// JavaScript Document


document.observe("dom:loaded", docLoadedHandler);

var docName = document.location.href.split("?")[0].split("/").slice(-1)[0];
if (docName == "") docName = "index.html";
function docLoadedHandler() {
	var links = $$(".navLink");
	for (var i = 0; i < links.length; i++) {
		var linkDocName = links[i].readAttribute("href").split("/").slice(-1)[0];
		if (linkDocName == "..") {
			linkDocName = "index.html";
			if (docName == "index.html") links[i].writeAttribute("href", ".")
		}
		if (linkDocName == docName) {
			links[i].addClassName("selected");
		}
	}
		
	var bottomNav = $("nav").clone(true);
	bottomNav.writeAttribute("id", "bottomNav");
	bottomNav.addClassName("mobileOnly");
	$("wrapper").insert(bottomNav);
}


