function mouseover(row, rownum){
  if (rownum % 2 == 0){
    setPointerClass(row, rownum, "over", "evenrow");
  } else {
    setPointerClass(row, rownum, "over", "oddrow");
  }
}
function mouseout(row, rownum){
  if (rownum % 2 == 0){
    setPointerClass(row, rownum, "out", "evenrow");
  } else {
    setPointerClass(row, rownum, "out", "oddrow");
  }
}
function mousedown(row, rownum){
  if (rownum % 2 == 0){
    setPointerClass(row, rownum, "click", "evenrow");
  } else {
    setPointerClass(row, rownum, "click", "oddrow");
  }
}

/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;
/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointerClass(theRow, theRowNum, theAction, theDefaultClass)
{
    // 3. Gets the current color...
    var currentClass = null;
    var newClass     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
     currentClass = theRow.className;

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentClass == ''
        || currentClass.toLowerCase() == theDefaultClass.toLowerCase()) {
        if (theAction == 'over') {
            newClass              = "pointerrow";
        }
        else if (theAction == 'click') {
            newClass              = "markrow";
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentClass.toLowerCase() ==  "pointerrow"
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newClass              = theDefaultClass;
        }
        else if (theAction == 'click') {
            newClass              = "markrow";
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentClass.toLowerCase() == "markrow") {
        if (theAction == 'click') {
            newClass              = "pointerrow";
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newClass) {
                theRow.className = newClass;
    } // end 5
    return true;
} // end of the 'setPointer()' function
