
var UNKNOWN   = 0;
var NETSCAPE  = 1;
var MICROSOFT = 2;

var browser    = UNKNOWN;
var browserName = navigator.appName;

if ( browserName=="Microsoft Internet Explorer") { 
    browser = MICROSOFT;
} else if (browserName=="Netscape") {
    browser = NETSCAPE;
}

// Initialization
function onloadBody( path) {
    if (document.images) {
        chevronUp   = new Image();  chevronUp.src   = path + "/images/tile/chevronUp.gif"; 
        chevronDown = new Image();  chevronDown.src = path + "/images/tile/chevronDown.gif"; 
    }
}
    
function show_hide( name) {
    with ( document.getElementById( name).style) {
      if ( display == "none") {
          display = "block";
          eval('document.'+name + "_bn"+'.src=chevronUp.src');
          if ( document.getElementsByName(name+"Hidden")[0])
              document.getElementsByName(name+"Hidden")[0].value = null;
      } else {
          display = "none";
          eval('document.'+name + "_bn"+'.src=chevronDown.src');
          if ( document.getElementsByName(name+"Hidden")[0])
              document.getElementsByName(name+"Hidden")[0].value = "true";
      }
    }
}

function clearListOptions( multipleList) {
    for ( var i = 0; i < multipleList.options.length; i++)
        multipleList.options[i].selected = false;
}

function clearText( textInput) {
    textInput.value = "";
}

function clearPriorities() {
    document.getElementById( "priorityInputs").innerHTML="";
    document.getElementById( "priorities").innerHTML="";
}

var researchPrioritySelection = null;

function openPriority( baseUrl) {
   if ( null != researchPrioritySelection)
       researchPrioritySelection.close();
   researchPrioritySelection = window.open( baseUrl + '/priority.jsp', 'priorities', 'status=yes,resizable=yes,scrollbars=yes,height=480,width=640', false);
}
