// ********************************
// application-specific functions *
// ********************************

function ken_showMenu(menuNumber, eventObj) {
    hideAllMenus();
    var menuId = 'menu' + menuNumber;
    if(changeObjectVisibility(menuId, 'visible')) {
	var menuTitle = getStyleObject('menuTitle' + menuNumber);
	menuTitle.backgroundColor = '#ff9900';
	eventObj.cancelBubble = true;
	return true;
    } else {
	return false;
    }
} 

var numMenus = 7;

function hideAllMenus() {
    for(counter = 1; counter <= numMenus; counter++) {
	changeObjectVisibility('menu' + counter, 'hidden');
	var menuTitle = getStyleObject('menuTitle' + counter);
	menuTitle.backgroundColor = '#000000';
    }
}


document.onmouseover = hideAllMenus;


var imgArray = new Array()
imgArray[0] = new Image()
imgArray[1] = new Image()
imgArray[2] = new Image()
imgArray[3] = new Image()
imgArray[4] = new Image()
imgArray[5] = new Image()
imgArray[6] = new Image()
imgArray[7] = new Image()
imgArray[8] = new Image()
imgArray[0].src = "images/on_p_students.gif"
imgArray[1].src = "images/on_c_students.gif"
imgArray[2].src = "images/on_alumni.gif"
imgArray[3].src = "images/on_staff.gif"
imgArray[4].src = "images/on_parents.gif"
imgArray[5].src = "images/on_news.gif"
imgArray[6].src = "images/on_business.gif"
imgArray[7].src = "images/on_about.gif"
imgArray[9] = new Image()
imgArray[10] = new Image()
imgArray[11] = new Image()
imgArray[12] = new Image()
imgArray[13] = new Image()
imgArray[14] = new Image()
imgArray[15] = new Image()
imgArray[16] = new Image()
imgArray[17] = new Image()
imgArray[18] = new Image()
imgArray[19] = new Image()
imgArray[8].src = "images/on_academics.gif"
imgArray[9].src = "images/on_athletics.gif"
imgArray[10].src = "images/on_entrep.gif"
imgArray[11].src = "images/on_BEE.gif"
imgArray[12].src = "images/on_global.gif"
imgArray[13].src = "images/on_jobs.gif"
imgArray[14].src = "images/on_library.gif"
imgArray[15].src = "images/on_presidents.gif"
imgArray[16].src = "images/on_research.gif"
imgArray[17].src = "images/on_visiting.gif"
imgArray[18].src = "images/on_women.gif"
imgArray[19].src = "images/on_cutler.gif"
function seeme_roll(i,img){
document.images[img].src=imgArray[i].src;
}
function seeme_roll2(i,img){
document.images[img].src=i;
}



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