/** 
 * Mark every row in a table as odd or even. If iEventClass or iOddClass is not
 * provided, 'even' and 'odd' will be used.  Does not mark rows that have 
 * th (table header) elements in them.
 *
 * @param iTableId - id of a table in the document, a string, required.
 * @param iEvenClass - class name to add to an even row in the table, a string, optional.
 * @param iOddClass - class name to add to an odd row in the table, a string, optional.
 *
 * @return undefined
 */
function Table_MarkEvenOddRows(iTableId, iEvenClass, iOddClass) {
 
  //
  // Input checking
  //
  if ( 'string' != typeof(iTableId) ) {
    return;
  }
  if ( 'string' != typeof(iEvenClass) ) { iEvenClass = 'even'; }
  if ( 'string' != typeof(iOddClass) ) { iOddClass = 'odd'; }

  //
  // Setup
  //
  var aTable = document.getElementById(iTableId);
  if ( null == aTable ) {
    return;
  }

  if ( 'table' != aTable.nodeName.toLowerCase() ) {
    return;
  }

  // 
  // Go through each row and mark it as even or odd.  Don't mark rows that
  // have th (table header) elements in them.
  //
  var aCount = 0;
  for ( var i = 0; i < aTable.rows.length; i++ ) {
    var aRow = aTable.rows[i];

    // Look for header elements
    var aHasHeaderElements = false;
    for ( var j = 0; (aHasHeaderElements == false) && (j < aRow.cells.length); j++ ) {
      var aCell = aRow.cells[j];
      if ( 'th' == aCell.nodeName.toLowerCase() ) { 
	aHasHeaderElements = true;
      }
    }

    // Finally, mark the class
    if ( !aHasHeaderElements ) {
      YAHOO.util.Dom.removeClass(aRow, (0 == (aCount%2)) ? iOddClass : iEvenClass);
      YAHOO.util.Dom.addClass(aRow, (0 == (aCount%2)) ? iEvenClass : iOddClass); 
      aCount++;
    }	
  }  
}
