// where I put js functions I wish to have work
//

// this helps getElementById work for all browsers
function returnObjById(id) {
     if (document.getElementById)
         var returnVar = document.getElementById(id);
     else if (document.all)
         var returnVar = document.all[id];
     else if (document.layers)
         var returnVar = document.layers[id];
     return returnVar;
}

// this opens course listings
function openCourse(course,row,colour) {
  if (returnObjById(course).style.display == "none") {
    returnObjById(course).style.display = "block";
    returnObjById(row).style.background = colour;
  } else {
    returnObjById(course).style.display = "none";
    returnObjById(row).style.background = colour;
  }
}

// this opens hidden divs
function showDiv(hiddiv) {
  if (returnObjById(hiddiv).style.display == "none") {
    returnObjById(hiddiv).style.display = "block";
  } else {
    returnObjById(hiddiv).style.display = "none";
  }
}

// this opens a new window with staff pictures (simplifies links)

function showStaff(staffname) {
  divwin = dhtmlwindow.open('divbox', 'div', staffname, 'Title', 'width=480,height=320,left=200px,top=150px,resize=0,scrolling=0'); 
  return false;

}
