d = document;
window.onload = function() {
	prepareHover();
}

function prepareHover() {
	var topNav = d.getElementById("topNav");
	var navLi = topNav.getElementsByTagName('li');
	
	for (i=0; i<navLi.length; i++){
	if(navLi[i].lastChild.nodeName=='UL'){
		liUL = navLi[i].lastChild;
		navLi[i].onmouseover=function(){this.className='hover';}
		navLi[i].onmouseout=function(){this.className=' ';}	
		}
	}
}