// Netventure, http://www.netventure.pl/

menuColors = new Array();
// item 1, lev 1, not selected  bia造      bia造      czerwony   szary2 
menuColors[1] = new menuColor("#FFFFFF", "#FFFFFF", "#EF0800", "#AAAAAA");
// item 2, lev 1, selected      鄴速y      鄴速y      czerwony   czerwony 
menuColors[2] = new menuColor("#FDE108", "#FDE108", "#EF0800", "#EF0800");
// item 3, lev 2, not selected  szary1    szary1      鄴速y      szary0 
menuColors[3] = new menuColor("#747474", "#747474", "#FDE108", "#E5E5E5");
// item 4, lev 2, selected      czerwony   czerwony   鄴速y      鄴速y 
menuColors[4] = new menuColor("#EF0800", "#EF0800", "#FDE108", "#FDE108");

function menuColor(fontover, fontout, backover, backout) {
	this.fontover = fontover;
	this.fontout = fontout;
	this.backover = backover;
	this.backout = backout;
}

function setMenuColors() {
	if (document.all) {
		td_tags = document.all.tags("td");
		for (var i=0; i<td_tags.length; i++) if (td_tags[i].className.match(/^mi\d$/) != null) {
			td_tags[i].onmouseover = td_over;
			td_tags[i].onmouseout = td_out;
			td_tags[i].onclick = td_click;
		}
		function td_over() {
			this.style.backgroundColor = menuColors[this.className.substring(2)].backover;
			this.all.tags('a')[0].style.color = menuColors[this.className.substring(2)].fontover;
			this.style.cursor = "hand";
			if (this.all.tags('a')[0].onmouseover != null) {
				this.all.tags('a')[0].onmouseover();
			}
		}
		function td_out() {
			this.style.backgroundColor = menuColors[this.className.substring(2)].backout;
			this.all.tags('a')[0].style.color = menuColors[this.className.substring(2)].fontout;
		}
		function td_click() {
			if (this.all.tags('a')[0] != null) {
				this.all.tags('a')[0].click();
			}
		}
	}
}

function initMenu() {
	setMenuColors();
}

window.onload = initMenu;
