function navMouseover () {
	if (this.haveSubNav) {
		this.haveSubNav.style.display = 'inline';
	}
}
function navMouseout () {
	if (this.haveSubNav) {
		this.haveSubNav.style.display = 'none';
	}
}
function createSubNavEvent (obj) {
	obj.onmouseover = function () {
		this.style.display = 'inline';
	}
	obj.onmouseout = function () {
		this.style.display = 'none';
	}
}
function createNavEvent (count) {
	var nav, subNav;
	for (var i=0;i<count;i++){
		nav = document.getElementById ('nav' + (i+1));
		subNav = document.getElementById ('nav' + (i+1) + 'submenu');
		if (subNav) {
			nav.haveSubNav = subNav;
			window.createSubNavEvent (subNav);
		}
		nav.onmouseover = window.navMouseover;
		nav.onmouseout = window.navMouseout;
	}
}
createNavEvent (6);