﻿// nav submenu up and down routines
// declare a global variable to hold the inactive menu style
var gObj2Class = ""
function navMenuDown(objID, obj2ID) {
	// make the submenu visible
	var obj = document.getElementById(objID);
	obj.style.visibility = "visible";
	// make the moused over menu heading style change
	var obj2 = document.getElementById(obj2ID);
	gObj2Class = obj2.className;
	obj2.className = "linkOn";
	// place the submenu in the right place
		// find the height of the moused over menu
		curheight = obj2.offsetHeight;
		// code for finding the position of the menu from http://www.quirksmode.org/js/findpos.html, Peter-Paul Koch
		var curleft = curtop = 0;
			if (obj2.offsetParent) {
				curleft = obj2.offsetLeft
				curtop = obj2.offsetTop
				while (obj2 = obj2.offsetParent) {
					curleft += obj2.offsetLeft
					curtop += obj2.offsetTop
				}
			}
		// place the submenu directly below the moused over menu
		var menuPositionX = curleft + "px";
		var menuPositionY = (curtop + curheight) + "px";
		obj.style.left = menuPositionX;
		obj.style.top = menuPositionY;
}
function navMenuUp(objID, obj2ID) {
	// hide the submenu
	var obj = document.getElementById(objID);
	obj.style.visibility = "hidden";
	// change the menu style back to its inactive state
	var obj2 = document.getElementById(obj2ID);
	obj2.className = gObj2Class;
}


function thisYear() {
	// write the current year into the document
	var today = new Date();
	var todayYear = today.getFullYear();
	document.write(todayYear);
}