DomainURL = new String("http://www.talis.com/");

URL = new String(document.URL);

URL = URL.replace(DomainURL, "");
DirectoryURL = URL.substring(0, URL.indexOf("/"));


// CSS

if (DirectoryURL != ''){
	UpLevel = "../";
}
else {
	UpLevel = "";
}


// Navigation

function hilightNav(){

URL = new String(document.URL);

URL = URL.replace(DomainURL, "");
DirectoryURL = URL.substring(0, URL.indexOf("/"));
			   
if (document.getElementById(DirectoryURL)){
document.getElementById(DirectoryURL).className = "selected";
}

}

//Sub menu

function hilightSub(){

URL = new String(document.URL);

URL = URL.replace(DomainURL, "");

DirectoryURL = URL.substring(0, URL.indexOf("/"));
PageURL = URL.substring(URL.indexOf("/")+1, URL.length);
PageURL = PageURL.substring(0, PageURL.indexOf("."));
if (document.getElementById(PageURL)){
	
if (document.getElementById(PageURL).className == "unselected" || document.getElementById(PageURL).className == "selected" || document.getElementById(PageURL).className == "top_item") {


if (PageURL == "index") {
document.getElementById(PageURL).className = "selected_top_item";
}
else {
document.getElementById(PageURL).className = "selected";
}


}
else {


if (PageURL == "index") {
document.getElementById(PageURL).className = "selected_indent_top_item";
}
else {
document.getElementById(PageURL).className = "selected_indent";
}
}

}
	
}
