
var yPosShift = 40;

function getRealTop(el) {
	yPos = el.offsetTop;
	syPos = yPos;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	// alert(el.pixelTop);
	return yPos+yPosShift+"px";
}

function getRealLeft(el) {
	xPos = el.offsetLeft;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	return xPos+"px";
}

function showMenu(menuNumber, eventObj) {
	// alert(eventObj);
    var menuId = 'menu' + menuNumber;
	menuStyle = findDOM(menuId,1);

	var parentId = 'top'+menuId;
	parentStyle = findDOM(parentId,0);

	menuStyle.left = getRealLeft(parentStyle);
	menuStyle.top = getRealTop(parentStyle);
    if(changeObjectVisibility(menuId, 'visible')) {
	// eval ('document.images.topnav' + (menuNumber)).src = navButtons[menuNumber-1].src;
	eventObj.cancelBubble = true;
	return true;
    } else {
	return false;
    }
}
function hideMenu(menuNumber) {
	changeObjectVisibility('menu' + menuNumber, 'hidden');
	// eval ('document.images.topnav' + (menuNumber)).src = navButtons[menuNumber+6].src;
}
// function for menu rollovers
function menuRoll(objectID, hex) {
	domStyle = findDOM(objectID,0);
	// alert('MenuRoll:'+domStyle);
	domStyle.className = hex;
}

<!-- --------------------- start from uwnyc_findDOM.js --------------------------- -->
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
var menuArea = "menuArea";
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[menuArea].layers[objectID]); }
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[menuArea].layers[objectID]); }
		};}
	}
}
<!-- --------------------- end from uwnyc_findDOM.js --------------------------- -->

<!-- ---------------------- start from uwnyc_utility.js --------------------- -->
// Copyright © 2000 by Apple Computer, Inc., All Rights Reserved.
//
// You may incorporate this Apple sample code into your own code
// without restriction. This Apple sample code has been provided "AS IS"
// and the responsibility for its operation is yours. You may redistribute
// this code, but you are not permitted to redistribute it as
// "Apple sample code" after having made changes.
//
// ************************
// layer utility routines *
// ************************

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility

function moveObject(objectId, newXCoordinate, newYCoordinate) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.left = newXCoordinate;
	styleObject.top = newYCoordinate;
	return true;
    } else {
	// we couldn't find the object, so we can't very well move it
	return false;
    }
} // moveObject

// JZ custom function to swap text. This needs fixin' for NS4
function changeText(objectId, newText) {
    if(document.getElementById && document.getElementById(objectId)) {
		document.getElementById(objectId).innerHTML = newText;
    } else if (document.all && document.all(objectId)) {
		document.all(objectId).innerHTML = newText;
    } else if (document.layers && document.layers[objectId]) {
		return document.layers[objectId].innerHTML = newText;
    } else {
	return false;
    }
}
<!-- ---------------------- end from uwnyc_utility.js --------------------- -->

