startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		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", "");
				}
			}
		}
	}
       if (document.all&&document.getElementById) {
		MolbioNavRoot = document.getElementById("MolbioMenu");
		for (i=0; i<MolbioNavRoot.childNodes.length; i++) {
			MolbioNode = MolbioNavRoot.childNodes[i];
			if (MolbioNode.nodeName=="LI") {
				MolbioNode.onmouseover=function() {
					this.className+=" over";
				}
				MolbioNode.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
if (document.tabform != null){
       document.tabform.query.focus();
}
}

window.onload=startList;


function selectmenu (menuid, option) {

    if (menuid == 2){
      var tabs = new Array ("BIOINFORMATICTOOLS", "BIOINFORMATICARTICLES", "GENES", "PATHWAYS", "PROTOCOLS", "WEB");
    }

    else if (menuid == 3){
      var tabs = new Array ("BIOINFORMATICTOOLS", "BIOINFORMATICARTICLES", "GENES", "PATHWAYS", "PROTOCOLS", "FACULTY", "WEB");
    }
    else if (menuid == 4){
      var tabs = new Array ("DIAGNOSIS", "THERAPY", "PATIENTED");
    }
    else if (menuid == 5){
      var tabs = new Array ("MEDLINEPLUS", "PATIENTED", "SAFETY", "PITTCAT", "UNITEDWAY");
    }
    else if (menuid == 6){
      var tabs = new Array ("BIOINFORMATICTOOLS", "BIOINFORMATICARTICLES", "WEB");
    }
    else {
        var tabs = new Array ("RESOURCES", "ARTICLES", "EBOOKS");
    }

    var option_info;
    var query;
    var query_value;
    var previous_query;
    var previous_query_value;
             
    for (var i=0; i < tabs.length; i++) {
       document.getElementById(tabs[i]).className = "";
       option_info = tabs[i] + "_INFO";
       document.getElementById(option_info).className = "off";
    }
     
    document.getElementById(option).className = "active";
    option_info = option + "_INFO";
    document.getElementById(option_info).className = "on";
    query = option + "_QUERY"; 
    for (var i=0; i < tabs.length; i++) {
        if (option != tabs[i]) {
            previous_query = tabs[i] + "_QUERY";
            previous_query_value = document.getElementById(previous_query).value;
            if (previous_query_value != "") {
                  query_value = previous_query_value;
                  document.getElementById(query).value = query_value;
                  document.getElementById(previous_query).value = "";
            }
        }
    }
    document.getElementById(query).focus();
}


function inserticonOBRC(){
var icon = document.getElementById("searchiconOBRC");
icon.style.display="inline";
}

function inserticon(){
var icon = document.getElementById("searchicon");
icon.style.display="inline";
}

function nextresource(){
  var numString = document.getElementById("number");
  var num = parseInt(numString.value);
  if (num == 23){
    num = 0;
  }
  var order = num +1;
  new Ajax.Updater('featuredresource','changeresource',{method:'post', parameters: 'forder='+order});
}

function previousresource(){
  var numString = document.getElementById("number");
  var num = parseInt(numString.value);
  if (num == 1){
    num = 24;
  }
  var order = num - 1;
  new Ajax.Updater('featuredresource','changeresource',{method:'post', parameters: 'forder='+order});
}