if (typeof(Huxley) == 'undefined') {
  Huxley = {};
}

if (typeof(Huxley.Base) == 'undefined') {
  Huxley.Base = {};
}

Huxley.Base.NAME = "Huxley.Base";
Huxley.Base.update = function (self, obj/*, ... */) {
  if (self === null || self === undefined) {
    self = {};
  }
  for (var i = 1; i < arguments.length; i++) {
    var o = arguments[i];
    if (typeof(o) != 'undefined' && o !== null) {
      for (var k in o) {
        self[k] = o[k];
      }
    }
  }
  return self;
};

Huxley.Base.update(Huxley.Base, {
  getViewportSize: function () {
    var viewportWidth, viewportHeight;
    if (self.innerHeight) {	// all except Explorer
      viewportWidth = self.innerWidth;
      viewportHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
      viewportWidth = document.documentElement.clientWidth;
      viewportHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
      viewportWidth = document.body.clientWidth;
      viewportHeight = document.body.clientHeight;
    }	
    return [viewportWidth, viewportHeight];
  },

  getBody: function () {
    bodyElems = document.getElementsByTagName('BODY');
    return bodyElems[0];
  },

  getScrollTop: function () {
    var theTop;
    if (document.documentElement && document.documentElement.scrollTop)
      theTop = document.documentElement.scrollTop;
    else if (document.body)
      theTop = document.body.scrollTop;
    return theTop;
  }
});
