code: function( array, newItem, nextSiblingId, recurse, nullIfNotFound ) {
  			if ( nextSiblingId ) {
  				for ( var i = 0, item;
  				( item = array[ i ] ); i++ ) {
  					if ( item.id == nextSiblingId ) {
  						array.splice( i, 0, newItem );
  						return newItem;
  					}
  
  					if ( recurse && item[ recurse ] ) {
  						var retval = addById( item[ recurse ], newItem, nextSiblingId, recurse, true );
  						if ( retval )
  							return retval;
  					}
  				}
  
  				if ( nullIfNotFound )
  					return null;
  			}
  
  			array.push( newItem );
  			return newItem;
  		}
docs: Tool function used to add an item into an array.