function navselect (element) {
	var p = window.location.pathname;
	if(p == "/")
		p = "/index.htm";
	if(p.indexOf(element.id) == -1) {
		element.style.borderBottomColor = "#FF0000";
    element.style.borderRightColor = "#FF0000";
  }
}
function navdeselect (element) {
	var p = window.location.pathname;
	if(p == "/")
		p = "/index.htm";
	if(p.indexOf(element.id) == -1) {
    element.style.borderBottomColor = "#C0C0C0";
    element.style.borderRightColor = "#C0C0C0";
  }
}
function jump (url) {
	if(window.location.href.indexOf(url) == -1) {
		window.location.href=url
  }
}
function selectNav () {
	var parPos = window.location.href.indexOf("?");
	var id, urlParts, url;
	if(parPos == -1) {
		urlParts = window.location.href.split("/");
		id = urlParts[urlParts.length - 1];
	}
	else {
		url = window.location.href.substring(0, parPos);
		urlParts = url.split("/");
		id = urlParts[urlParts.length - 1];
	}
	/*
	var msg = "id=" + id + "\nlength=" + urlParts.length + "\n";
	for (var p in urlParts) {
		msg = msg + p + ":" + urlParts[p] + "\n";
	}
	alert(msg);
	*/
	if((urlParts.length == 4 && id == "") || urlParts.length < 4) {
		id = "index.htm";
	}
	else if((urlParts.length == 5 && urlParts[3] == "en" && id == "") || (urlParts.length == 4 && id == "en")) {
		id = "index.htm";
	}
	else if((urlParts.length == 5 && urlParts[3] == "blog" && id == "") || (urlParts.length == 4 && id == "blog")) {
		id = "index.php";
	}
	
	element = document.getElementById(id);
	if(element) {
		element.style.borderBottomColor = "#FF0000";
		element.style.borderRightColor = "#FF0000";
		element.style.cursor = "auto";
	}
}
