
function menuInit() {
	topMenus=document.getElementById('menu').getElementsByTagName('h2');
	//alert(topMenus.length);
	var browser=navigator.appVersion;
	brPos=browser.indexOf('MSIE');
	linkPos=0;
	if (brPos!=-1) {
		browserVer=browser.substring(brPos+5,brPos+6);
		if (browserVer<7) {
			linkPos=1;
		
			for (i=0;i<topMenus.length;i++) {
				topMenu=topMenus[i].parentNode.parentNode;
				//alert(topMenuH2.offsetWidth);
				topMenu.style.width="5px";
			}
		}
	}
	liElements=document.getElementById('menu').getElementsByTagName('li');
	for (i=0;i<liElements.length;i++) {
		if (liElements[i].getElementsByTagName('ul').length>0 && liElements[i].getElementsByTagName('h2').length==0) {
			liElements[i].getElementsByTagName('a')[0].className='x';
			//showing what menus are open
			liElements[i].onmouseover=function() {
				this.childNodes[0].className='x active';
			}
			liElements[i].onmouseout=function() {
				this.childNodes[0].className='x';
			}
		}
		if (liElements[i].getElementsByTagName('h2').length>0 && liElements[i].className!='notMenu') {
			liElements[i].onmouseover=function() {
				this.className='active';
			}
			liElements[i].onmouseout=function() {
				this.className='inactive';
			}
		}
	}
	links=document.getElementsByTagName('a');
	for (i=0;i<links.length;i++) {
		links[i].onclick=function() {
			//alert(this.parentNode.parentNode.parentNode.firstChild.className);
		}
	}
}
menuInit();
