// when mouse over, change image to bold (except image for current page which is already bold)
function onHoverNavImage() {
	var image = this.childNodes[0].childNodes[0];
	if (this.className != "navImageCurrent") {
		image.src = image.src.replace("/navigation/", "/navigation/hover/");
	}
}

// when mouse out, change image back to normal (except if image for current page which is left as bold)
function onLeaveNavImage() {
	var image = this.childNodes[0].childNodes[0];
	if (this.className != "navImageCurrent") {
		image.src = image.src.replace("/navigation/hover/", "/navigation/");
	}
}

// implement hover functionality in header images
function implementHover() {
	// test for javascript compatibility
	if (document.getElementById) {
		
		// apply dynamics to NavImages
		menuRoot = document.getElementById("container");

		// for each menu item
		if (menuRoot != null) {
			for (i = 0; i < menuRoot.childNodes.length; i++) {
				node = menuRoot.childNodes[i];
				if (node.nodeName == "DIV") {
					// add the hover functionality
					// - when mouse over, change image to bold (except current page which is already bold)
					node.onmouseover = onHoverNavImage;
					// - when mouse out, change image back to normal (except if image for current page which is left as bold)
		  			node.onmouseout = onLeaveNavImage;
				}
			}
		}
	}
}


function openPopupWindow(path, width, height) {
	var w;
	w = window.open(path, "win", "statusbar=no, menubar=no, width=" + width + ", height=" + height + ", scrollbars=yes");
	w.focus();
}

window.onload = implementHover;

