setLeftNav = function() {
if (document.all&&document.getElementById) {
	navRoot = document.getElementById("leftNav");
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {node.onmouseover=function() {
			this.className+="over";
		}
		node.onmouseout=function() {
  			this.className=this.className.replace("over", "");
  	 	}
   	}

  }
 }
}

setTopNav = function() {
if (document.all&&document.getElementById) {
	navRoot = document.getElementById("topNav");
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {node.onmouseover=function() {
			this.className+="over";
		}
		node.onmouseout=function() {
  			this.className=this.className.replace("over", "");
  	 	}
   	}

  }
 
 }
}
function init() {
	setLeftNav();
	if (document.getElementById("topnav")) {
		setTopNav();		
	}
}
window.onload=init;

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



//tooltips scripts for glossary terms
function createTooltip(bodyText, searchTerm, definition ) {
	defStartTag = "<a href=\"#\" class=\"def\" title=\"" + definition + "\">";
	defEndTag = "</a>";

	var newText = "";
	var i = -1;
	var lcSearchTerm = searchTerm.toLowerCase();
	var lcBodyText = bodyText.toLowerCase();
    
	while (bodyText.length > 0) {
	    i = lcBodyText.indexOf(lcSearchTerm, i+1);
    	if (i < 0) {
    	  newText += bodyText;
    	  bodyText = "";
    	} else {
    	  // skip anything inside an HTML tag
    	  if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
    	    // skip anything inside a <script> block
    	    if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
		      newText += bodyText.substring(0, i) + defStartTag + bodyText.substr(i, searchTerm.length) + defEndTag;
    	      bodyText = bodyText.substr(i + searchTerm.length);
    	      lcBodyText = bodyText.toLowerCase();
    	    }
    	  }
    	}
  	}
	return newText;
}


function showDefinitions() {
    searchArray = termArray;
	if (!document.body || typeof(document.body.innerHTML) == "undefined") {
    	return false;
  	}
 	var bodyText = document.body.innerHTML;
  	for (var i = 0; i < searchArray.length; i++) {
  		bodyText = createTooltip(bodyText, searchArray[i], titletextArray[i]);
	}
  	document.body.innerHTML = bodyText;
  	return true;
}

//for faculty profile page
function section(name) {
	document.getElementById("contact").style.display = 'none';
	document.getElementById("clinical").style.display = 'none';
	document.getElementById("research").style.display = 'none';
	document.getElementById("awards").style.display = 'none';
	document.getElementById("statement").style.display = 'none';
	document.getElementById(name).style.display = 'block';
}

//for faculty search by division
function goto_URL(object) {
	//alert(object.options[object.selectedIndex].value)
    window.location.href = object.options[object.selectedIndex].value;
}
