function findNextSibling(nextitem) {
	while (nextitem && nextitem.nodeType != 1) {
		nextitem = nextitem.nextSibling;
	}
	return nextitem;
}

function changeNav() {
	if (!document.getElementsByTagName || !document.getElementById) return false;
	var navigation = document.getElementById("main-sections");
	var listitems = navigation.getElementsByTagName("li");
	for(i = 0; i<listitems.length; i++) {
		listitem = listitems[i];
		activeclass = listitem.className;
		if (activeclass == "active") {
			nextitem = findNextSibling(listitem.nextSibling);
			if (nextitem != null) {
				nextitem.style.background = "none";
			}
		}
		listitem.onmouseover = function() {
			nextitem = findNextSibling(this.nextSibling);
			if (nextitem != null) {
				nextitem.style.background = "none";
			}
		}
		listitem.onmouseout = function() {
			nextitem = findNextSibling(this.nextSibling);
			if (nextitem != null) {
				nextitem.style.background = "transparent url(/hyatt/images/pure/spas/nav/nav-grey-line.gif) top right no-repeat";
			}
			activeclass = this.className;
			if (activeclass == "active") {
				nextitem = findNextSibling(this.nextSibling);
				if (nextitem != null) {
					nextitem.style.background = "none";
				}
			}
		}
	}
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

addLoadEvent(changeNav);
