function getElementsByCondition(condition, container) {
	container = container || document;
	var all = container.all || container.getElementsByTagName('*');
	var list = [];
	for(var i = 0; i < all.length; i++) { 
		var elem = all[i];
		if(condition(elem)) {
			list[list.length] = elem;
		}
	}

	return list;
}

function attachActions(node) {
	node.onmouseover = function() {
		this.className += " over";
	}
	node.onmouseout = function() {
		this.className = this.className.replace(" over", "");
	}
}

function test(elem) {
	if('LI' == elem.nodeName) {
		return true;
	} else {
		return false;
	}
}

startList = function() {
	if(document.all && document.getElementById) {
		// attach mouse-over actions to the pop-out menus for IE
		var navRoot = document.getElementById("nav");
		var list = getElementsByCondition(test, navRoot);
		for(var j = 0; j < list.length; j++) {
			attachActions(list[j]);
		}
	}
}
window.onload=startList;
