function getDiv(divName){
	HM_DOM = (document.getElementById) ? true : false;
	HM_IE = (document.all)? true : false;
	if ( HM_DOM ){
		eval("theDiv = document.getElementById('" + divName + "');");
	} else if (HM_IE) {
		eval("theDiv = document.all['" + divName + "'];");
	} else {
		eval("theDiv = document.layers('" + divName + "');");
	}
	return(theDiv);
}


function toggleDiv(divName){
// Toggle visibility of div divName
	theDiv = getDiv(divName);
	if (theDiv.style.display == "block"){
		theDiv.style.display = "none";
	} else {
		theDiv.style.display = "block";
	}
	adjHeight(); // WST command in http://umanitoba.ca/js/umhome/lib.js
}

function showDiv(divName){
	theDiv = getDiv(divName);
	if (arguments.length > 1)
		theDiv.style.display = arguments[1];
	else
		theDiv.style.display = "block";
}

function hideDiv(divName){
	theDiv = getDiv(divName);
	theDiv.style.display = "none";
}

function getDivStatus(divName){
 	var theDiv = getDiv(divName);
	return (theDiv.style.display);
}

function addListener(element, event, listener, bubble) {
  if(element.addEventListener) {
    if(typeof(bubble) == "undefined") bubble = false;
    element.addEventListener(event, listener, bubble);
  } else if(this.attachEvent) {
    element.attachEvent("on" + event, listener);
  }
}

function highlightMenu (menuID){
	var tmpDiv = getDiv(menuID);
	if (tmpDiv != null){
		tmpDiv.className = 'selected';
	}
	if (arguments.length > 1){
		var tmpDiv = getDiv(arguments[1]);
		if (tmpDiv != null){
			tmpDiv.className = 'parent';
		}
	}
}	

