
//dynamic navigation
initPage = function () {
	startList();
	initHome();
}

startList = function() {
	if (document.all && document.getElementById) 
	{
		var navRoot = document.getElementById("main-navigation");
		var lis = navRoot.getElementsByTagName("li");
		for (var i=0; i<lis.length; i++)
		{
			lis[i].onmouseover = function()
			{
				this.className += " over";
				this.style.zIndex ="1000";
			}
			lis[i].onmouseout = function()
			{
				this.className = this.className.replace(" over", "");
				this.style.zIndex ="0";
			}
		}
	}
}

var map = {"a-at":"red", "a-tc":"green", "a-pc":"blue", "a-solid":"yellow"}

initHome = function () {
	var c = document.getElementById("index-image");
	if (c)
	{
		var d = c.getElementsByTagName("div").item(0);
		if (d)
		{
			var lis = d.getElementsByTagName("a");
			for (var i=0; i<lis.length; i++)
			{
				lis[i].onmouseover = function()
				{
					document.getElementById(map[this.className]).className = "hover";
				}
				lis[i].onmouseout = function()
				{
					document.getElementById(map[this.className]).className = "";
				}
			}
		}
	}
}

window.onload = initPage;
