function skipEmptyTextNodes(node, forwards) {
				var orig = node;

				while (node && node.nodeType === 3 && node.length === 0) {
					node = forwards ? node.nextSibling : node.previousSibling;
				}

				return node || orig;
			}
Returns the currently selected element or the common ancestor element for both start and end of the selection.

@method getNode
@return {Element} Currently selected element or common ancestor element.
@example
// Alerts the currently selected elements node name
alert(tinymce.activeEditor.selection.getNode().nodeName);