function initLang() {
	var root, node;
	if (document.getElementById) {
		root = document.getElementById("lang");
		for (i=0; i<root.childNodes.length; i++) {
			node = root.childNodes[i];
			if (node.nodeName=="LI" && node.firstChild.nodeName == "A") {
				switch (node.id) {
					case "lang_hk":
						node.firstChild.href = window.location.href.replace(/\/\w\w\//, "/hk/");
						break;
					case "lang_en":
						node.firstChild.href = window.location.href.replace(/\/\w\w\//, "/en/");
						break;
				}
			}
		}
	}
}

function initNav() {<a href="../../config.php">config.php</a>
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("sitenav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

window.onload = function () {
	initNav();
	initLang();
}
