/* move_to_bottom moves the element with the given id
   to the bottom of the browser window.
   This script requires makeLayerObj form sticky.js. 
   (c) Ambitone Oy 2003 */

// Create browser-independent element object
function makeElement(eID){
  // Konqueror
  if(document.getElementById) return document.getElementById(eID);
  // NS 4
  if(document.layers) return document.layers[eID];
  // IE 4
  if(document.all) return document.all[eID]; }

function getElementHeight(eID) {
  e = makeElement(eID);
  if (e.offsetHeight) return e.offsetHeight;
  return e.document.height; }

function move_to_bottom(eID){
  layer = makeLayerObj(eID);
  // If the element has position: fixed, no need to do any tricks.
  // CSS2 takes care of fixed elements.
  if (layer.css.position == "fixed") return;
  var myHeight = 0;
  if (typeof(window.innerWidth) == 'number') {
    // Non-IE
    myHeight = window.innerHeight; }
  else {
    if(document.documentElement && document.documentElement.clientHeight) {
      //IE 6+ in 'standards compliant mode'
      myHeight = document.documentElement.clientHeight; } 
  else {
      if(document.body && document.body.clientHeight) {
        //IE 4 compatible
        myHeight = document.body.clientHeight; } } }
  layer.css.top = myHeight - getElementHeight(eID);
}


