doMenu = function() {
	iWidth = (navigator.appName.indexOf("Microsoft") != -1)
	       ? document.body.offsetWidth
		   : window.innerWidth;
	posLeft = ((iWidth - 900) / 2) + 'px';
	// position active menu
	if (document.getElementById('active')) {
		activeMenu = document.getElementById('active');
		activeMenu.childNodes[2].style.left = posLeft;
		$(activeMenu).addClass('show');
	}


	rootMenu = document.getElementById('main');
	for (i = 0; i < rootMenu.childNodes.length; i++) {
		node = rootMenu.childNodes[i];
		if (node.nodeName == 'LI') {
			node.onmouseover = function() {
			$('.show').removeClass('show');
		// position active menu
	if (document.getElementById('active')) {
		activeMenu = document.getElementById('active');
		activeMenu.childNodes[2].style.left = posLeft;
	}
				$('#active').attr('id','');
				$(this).attr('id','active');
				$(this).addClass('show');
				if (this.childNodes[2].nodeName == 'UL') {
					this.childNodes[2].style.left = posLeft;
				}
			}
			/*
			node.onclick = function() {
				$(activeMenu).attr('id','');
				$(activeMenu).attr('class','');
				$(this).attr('id','active');
				
			}*/
		/*	node.onmouseout = function() {
				// position active menu
	if (document.getElementById('active')) {
		activeMenu = document.getElementById('active');
		activeMenu.childNodes[2].style.left = posLeft;
	}
			    $(this).removeClass('show');
				if (document.getElementById('active')) {
		        $(activeMenu).addClass('show');
				}
			}*/
		}
	}
}

window.onload = doMenu;
window.onresize = doMenu;

