
menu = null;
items = null;

// horrible - it'll stop any other script running but at 
// time of writing it's the only script
window.onload = function() {

	menu = document.getElementById("menu");
	items = menu.getElementsByTagName("li");

	function removeAllCurrent() {
		for (i = 0, m = items.length; i < m; i++) {
			items[i].className = "";
		}
	}
	
	function resetCurrent() {
		for (i = 0, m = items.length; i < m; i++) {
			if (items[i].current) {
				items[i].className = "current";
			}
		}
	}

	for (i = 0, m = items.length; i < m; i++) {

		if (items[i].className == "current") {
			items[i].current = true;
		} else {
			items[i].current = false;
		}
	
		var a = items[i].getElementsByTagName("a")[0];

		a.onmouseover = function() {
			removeAllCurrent();
		}
		
		a.onmouseout = function() {
			resetCurrent();
		}
	
	}

};