public/javascripts/yui/dom/dom.js
function(newNode, referenceNode) {
            newNode = Y.Dom.get(newNode); 
            referenceNode = Y.Dom.get(referenceNode); 
            
            if (!newNode || !referenceNode || !referenceNode[PARENT_NODE]) {
                return null;
            }       

            return referenceNode[PARENT_NODE].insertBefore(newNode, referenceNode); 
        }
function(newNode, referenceNode) {
            newNode = Y.Dom.get(newNode); 
            referenceNode = Y.Dom.get(referenceNode); 
            
            if (!newNode || !referenceNode || !referenceNode[PARENT_NODE]) {
                return null;
            }       

            return referenceNode[PARENT_NODE].insertBefore(newNode, referenceNode); 
        }
function ( newNode , referenceNode ) { newNode = Y . Dom . get ( newNode ) ; referenceNode = Y . Dom . get ( referenceNode ) ; if ( ! newNode || ! referenceNode || ! referenceNode [ PARENT_NODE ] ) { return null ; } return referenceNode [ PARENT_NODE ] . insertBefore ( newNode , referenceNode ) ; }
Inserts the new node as the previous sibling of the reference node
@method insertBefore
@param {String | HTMLElement} newNode The node to be inserted
@param {String | HTMLElement} referenceNode The node to insert the new node before
@return {HTMLElement} The node that was inserted (or null if insert fails)
Inserts the new node as the previous sibling of the reference node