var elements = require('../elements');

/**
 * Returns the element's parent node
 * @param {HTMLElement} element
 * @return {HTMLElement}
 */
elements.parent = function(element) {
    return element.parentNode;
};

/**
 * Returns the element's child[number] node
 * @param {HTMLElement} element
 * @return {HTMLElement}
 */
elements.child = function(element, number) {
    return element.children[number || 0];
};

/**
 * Returns the element's next sibling
 * @param {HTMLElement} element
 * @return {HTMLElement}
 */
elements.next = function(element) {
    return element.nextElementSibling;
};

/**
 * Returns the element's previous sibling
 * @param {HTMLElement} element
 * @return {HTMLElement}
 */
elements.previous = function(element) {
    return element.previousElementSibling;
};
