nextNode = function(node) { //...Code goes here to walk to the next node... if (node.firstChild) return node.firstChild; if (node.nextSibling) return node.nextSibling; while (!node.parentNode.nextSibling) node = node.parentNode; return node.parentNode.nextSibling;};