window.onscroll = moveFooter ;
// defining menus
otherMenu = new Array(6);
otherMenu[0] = "introduction";
otherMenu[1] = "performance" ;
otherMenu[2] = "summer";
otherMenu[3] = "schedule";
otherMenu[4] = "faculty";
otherMenu[5] = "special";
function submenuOn(item) {
	document.images[item].src = "images/menu_" + item + "_on.gif";
}
function submenuOff(item) {
	document.images[item].src = "images/menu_" + item + "_off.gif";
}
function menuOn(item) {
	// turn off all other submenus
	for(i in otherMenu) {
		if (item != otherMenu[i]) {
			menuOff(otherMenu[i]);
		}
	}
	thisMenu = document.getElementById("menu_" + item);
	if (thisMenu) {
		// position the menu correctly
		var thisX = 0;
		thisObj = document.getElementById('menu_item_' + item) ;
		thisObjOffset = thisObj.offsetParent;
		while (thisObj) {
			parentObj = thisObj.parentNode;
			if (thisObjOffset == thisObj) {
				thisX += parseInt(thisObj.offsetLeft);
				thisObjOffset = thisObjOffset.offsetParent;
			}
			thisObj = parentObj;
		}
		// alert(thisX);

		// set absolute position based on thisX
		thisMenu.style.left = thisX - 12;
		thisMenu.style.top = 46;
		thisMenu.style.position = "absolute";
		thisMenu.style.display = "block";
		thisMenu.style.opacity = .9;
		thisMenu.style.filter = "alpha(opacity=90)";
	}
}
function menuOff(item) {
	// turn off the drop-down
	thisMenu = document.getElementById("menu_" + item);
	if (thisMenu) {
		thisMenu.style.display = "none";
	}
}
function allOff() {
	// this function turns all drop-downs off
	for(i in otherMenu) {
		menuOff(otherMenu[i]);
	}
}
function moveFooter() {
	var footer = document.getElementById("footer");
	if (footer) {
		footer.style.left = 0;
		footer.style.top = parseInt(parseInt(posBottom()) - 46) + "px" ;
		footer.style.position = "absolute";
	}
}
function bodyOnload() {
	moveFooter() ;
}
function pageWidth() {
	return window.innerWidth != null? window.innerWidth: document.body != null? document.body.clientWidth:null;
}
function pageHeight() {
	// moz compliant browsers
	if ( window.innerHeight != null ) return window.innerHeight ;
	// IE 6 sucks, and 5-7 quirksmode seem to use this property as well
	if ( document.documentElement.clientHeight != null ) return document.documentElement.clientHeight ;
	// a failsafe for IE 5-7
	if ( document.body.clientHeight != null ) return document.body.clientHeight ;
	return null ;
	// original below:
	// return window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:null;
}
function posLeft() {
	return typeof window.pageXOffset != 'undefined' ? window.pageXOffset:document.documentElement.scrollLeft? document.documentElement.scrollLeft:document.body.scrollLeft? document.body.scrollLeft:0;
}
function posTop() {
	return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;
}
function posRight() {
	return posLeft()+pageWidth();
}
function posBottom() {
	return posTop()+pageHeight();
}
function rollover(img, color1, color2) {
	thisImg = document.getElementById(img) ;
	thisImg.src = thisImg.src.replace(color1,color2) ;
}
function rollout(img, color1, color2) {
	thisImg = document.getElementById(img) ;
	thisImg.src = thisImg.src.replace(color2,color1) ;
}
