function getComputedProp (prop, element, parent) {
  if (prop === 'left' || prop === 'right' || prop === 'top' || prop === 'bottom') {
    return parseInt(window.getComputedStyle(document.getElementById(element.id).parentNode)[prop])
  } else {
    return (
      (!parent)
        ? parseInt(window.getComputedStyle(document.getElementById(element.id))[prop])
        : (typeof element[prop] !== 'string')
          ? element[prop]
          : (typeof parent[prop] !== 'string')
            ? parent[prop] * parseInt(element[prop]) / 100
            : parseInt(window.getComputedStyle(document.getElementById(parent.id))[prop]) * parseInt(element[prop]) / 100
    )
  }
}
Calculates the computed prop of an element,
based on its own props and the parent props.

(Specially created to deal with percentage dimensions)

@param {object} element : The element to get the dimension for
@param {object} parent : The parent element of the 'element'
@param {string} prop : Property for which to extract the dimension (height/width)
@return {number} : The real dimension for the element (height/width)