// JavaScript Document


function getRelativeLeft(what) {
  eElement = $(what);
  nLeftPos = eElement.offsetLeft;
  return nLeftPos;
}

function getLeft(what) {
  eElement = $(what);
  nLeftPos = eElement.offsetLeft;
  eParElement = eElement.offsetParent;
  while (eParElement != null) {
    nLeftPos += eParElement.offsetLeft;
    eParElement = eParElement.offsetParent;
  }
  return nLeftPos;
}

function getRelativeTop(what) {
  eElement = $(what);
  nTopPos = eElement.offsetTop;
  return nTopPos;
}

function getTop(what) {
  eElement = $(what);
  nTopPos = eElement.offsetTop;
  eParElement = eElement.offsetParent;
  estr = what+" "+nTopPos+", ";
  while (eParElement != null) {
    nTopPos += eParElement.offsetTop;
    pid = eParElement.id;
    estr = estr+pid+" "+nTopPos+", ";
    eParElement = eParElement.offsetParent;
  }
  return nTopPos;
}

function getHeight(what) {
  nHeightPos = eElement.offsetHeight;
  return nHeightPos;
}

function getWidth(what) {
  eElement = $(what);
  nWidthPos = eElement.offsetWidth;
  return nWidthPos;
}

function getWindowHeight(w) {
	var height;
        w = w ? w : window;
        height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);
        
        return height;
}
