function setrowcolor(rownum,rowcolor) {
  if (!document.getElementById || !document.getElementsByTagName) return;
  cell_arr = document.getElementById("tr"+rownum).getElementsByTagName('td');
  for (i=0; i<cell_arr.length; i++) cell_arr[i].style.backgroundColor = rowcolor;
}

markedrows = new Array(); //global
function hlrow(rownum,hlmode,standardColor) {
  colorOut   = standardColor;
  colorOver  = "#a2af80";
  colorClick = "#a2af80";
  if (markedrows["tr"+rownum]==1 && hlmode!=3) return;

  switch(hlmode) {
  case 1: //on mouseover
    setrowcolor(rownum,colorOver);
    break;
  case 2: //on mouseout
    setrowcolor(rownum,colorOut);
    break;
  case 3: //on click
    if (markedrows["tr"+rownum]!=1) {
      setrowcolor(rownum,colorClick);
      markedrows["tr"+rownum]=1;
    }
    else {
      setrowcolor(rownum,colorOut);
      markedrows["tr"+rownum]=0;
    }
    break;
  }
}
