Get element position relative to page bottom
<p>I use this function to get the y-coordinate of an element relative to the page:</p>

<pre><code>function getY(oElement)
{
  var curtop = 0;
  if (oElement.offsetParent) 
  {
    while (oElement.offsetParent) 
    {
      curtop += oElement.offsetTop;
      oElement = oElement.offsetParent;
    }
  }
  else if (oElement.y)
  {
    curtop += oElement.y;
  }

  return curtop;
}
</code></pre>

<p>Now I want to do the same thing but get the position relative to the bottom instead of the top, there doesn't seem to be something like 'offsetBottom'.</p>

<p>How can I do this?</p>

<p>Many thanks</p>
