function nodeGetElementById(node, elemId) {
  for (var c = node.firstChild; c; c = c.nextSibling) {
    if (c.id == elemId) {
      return c;
    }
    if (c.nodeType == DOM_ELEMENT_NODE) {
      var n = arguments.callee.call(this, c, elemId);
      if (n) {
        return n;
      }
    }
  }
  return null;
}
Traverses the element nodes in the DOM tree underneath the given
node and finds the first node with elemId, or null if there is no such
element.  Traversal is in depth-first order.

NOTE: The reason this is not combined with the elem() function is
that the implementations are different.
elem() is a wrapper for the built-in document.getElementById() function,
whereas this function performs the traversal itself.
Modifying elem() to take an optional root node is a possibility,
but the in-built function would perform better than using our own traversal.

@param {Element} node Root element of subtree to traverse.
@param {String} elemId The id of the element to search for.
@return {Element|Null} The corresponding element, or null if not found.