var IE4 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4);
var NN4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);

function _gObj(id)
{
	return document.getElementById(id);
}

/*µ¼º½*/
var timer;
function showMenu(id){
	var a = document.getElementById("all_tab").getElementsByTagName("li");
	for(i = 0; i < a.length; i++){
		a[i].onmouseenter = function() {
			clearInterval(timer);
  			showMainMenu(this.id);
  			showSubMenu(this.id + '_nav');
		}
		a[i].onmouseleave = function() {
			timer = setInterval("showMainMenu('" + id + "');showSubMenu('" + id + "_nav')", 400);
		}

		var e = document.getElementById(a[i].id + "_nav");
		e.onmouseenter = function(){
			clearInterval(timer);
   		tab_id = this.id.substring(0, this.id.length - 4);
  			showMainMenu(tab_id);
  			showSubMenu(this.id);
		}
		e.onmouseleave = function(){
			timer = setInterval("showMainMenu('" + id + "');showSubMenu('" + id + "_nav')", 400);
		}

		if(a[i].id == id) {
			a[i].className = "here";
			showSubMenu(id + '_nav');
		} else {
			a[i].className = "normal";
		}
	}
}

function showMainMenu(id) {
	var a = document.getElementById("all_tab").getElementsByTagName("li");
	for(var i=0;i<a.length;i++){
		if(a[i].id == id) {
			if(a[i].className != "here") a[i].className = "active";
		} else {
			if(a[i].className != "here") a[i].className = "normal";
		}
	}
   clearInterval(timer);
}

function showSubMenu(id) {
	var b = document.getElementById("all_nav").children;
	for(var i=0;i<b.length;i++){
		if(b[i].id == id) {
			b[i].className = "";
		} else {
			b[i].className = "hidden";
		}
	}
   clearInterval(timer);
}

