/*****************************************************************\
* Product:   JavaScript Framework                                 *
* File:      windowsize.js                                        *
* Author:    Ties Pull ter Gunne                                  *
* Copyright: (c) 2006 Ties Pull ter Gunne                         *
* License:   No Restrictions                                      *
\*****************************************************************/

//=================== class Screen =====================

function WindowSize() {
}

WindowSize.prototype.getWidth = function() {
  var bd = document.body;
  return bd.clientWidth > bd.scrollWidth ? bd.clientWidth : bd.scrollWidth;
}

WindowSize.prototype.getHeight = function() {
  var bd = document.body;
  return bd.clientHeight > bd.scrollHeight ? bd.clientHeight : bd.scrollHeight;
}

WindowSize.prototype.getXOffset = function() {
  return document.body.scrollLeft;
}

WindowSize.prototype.getYOffset = function() {
  return document.body.scrollTop;
}

WindowSize.prototype.getScrollWidth = function() {
  return document.body.clientWidth;
}

WindowSize.prototype.getScrollHeight = function() {
  return document.body.clientHeight;
}

var winsize = new WindowSize();
