Position = { 
  X:function(elem) {
    return this.findPos(elem)[0];
  },
  Y:function(elem) {
    return this.findPos(elem)[1];
  },  
  H:function(elem) {
    return this.getElementHeight(elem);
  },  
  W:function(elem) {
    return this.getElementWidth(elem);
  },  
  getElementHeight:function(elem) {
      xPos = elem.offsetHeight;
      return xPos;
  },  
  getElementWidth:function(elem) {
    xPos = elem.offsetWidth;
  
      return xPos;
  },   
  findPosX:function(obj)
  {
      var curleft = 0;
      if (obj.offsetParent)
      {
          while (obj.offsetParent)
          {
              curleft += obj.offsetLeft;
              obj = obj.offsetParent;
          }
      }
      else if (obj.x) 
      curleft += obj.x;// + this.X(obj.parentNode);
      return curleft;
  },  
  findPosY:function(obj)
  {
    var curtop = 0;
      if (obj.offsetParent)
      {
          while (obj.offsetParent)
          {
              curtop += obj.offsetTop
              obj = obj.offsetParent;
          }
      }
      else if (obj.y)
          curtop += obj.y;
      return curtop;
  },
  findPos:function(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
        curleft = obj.offsetLeft
        curtop = obj.offsetTop
        while (obj = obj.offsetParent) {
            curleft += obj.offsetLeft
            curtop += obj.offsetTop
        }
    }
    return [curleft,curtop];
  },
  realOffset: function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.scrollTop  || 0;
      valueL += element.scrollLeft || 0;
      element = element.parentNode;
    } while (element);
    return [valueL, valueT];
  },
  documentWidth:function() {
    if( typeof( window.innerWidth ) == 'number' ) {
      //Non-IE
      return window.innerWidth;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      return document.documentElement.clientWidth;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
      //IE 4 compatible
      return document.body.clientWidth;
    }
  },
  documentHeight:function() {
    if( typeof( window.innerWidth ) == 'number' ) {
      //Non-IE
      return window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      return document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
      //IE 4 compatible
      return document.body.clientHeight;
    }
  }
}