/* window-geometry.js -- JavaScript code for detecting the window geometry.  */

/*
 * Copyright (C) 2003 Tudor Hulubei <tudor@hulubei.net>.
 * Distributed under the GNU General Public License.
 *
 * Heavily based on the JSFX_Browser.js code at JavaScript-FX.com,
 * authored by Roy Whittle www.Roy.Whittle.com.
 */


var GeometryInterface;

if (!window.GeometryInterface)
    window.GeometryInterface = new Object();

if (navigator.appName.indexOf('Netscape') != -1)
{
    GeometryInterface.getCanvasWidth = function() { return innerWidth; }
    GeometryInterface.getCanvasHeight = function() { return innerHeight; }
    GeometryInterface.getWindowWidth = function() { return outerWidth; }
    GeometryInterface.getWindowHeight = function() { return outerHeight; }
    GeometryInterface.getScreenWidth = function() { return screen.width; }
    GeometryInterface.getScreenHeight = function() { return screen.height; }
    GeometryInterface.getMinX = function() { return pageXOffset; }
    GeometryInterface.getMinY = function() { return pageYOffset; }
    GeometryInterface.getMaxX = function() { return pageXOffset + innerWidth; }
    GeometryInterface.getMaxY = function() { return pageYOffset + innerHeight; }
    GeometryInterface.getDocumentHeight = function() { return document.height; }
    GeometryInterface.getDocumentWidth = function() { return document.width; }
}
else
{
    if (document.all)
    {
        GeometryInterface.getCanvasWidth = function() {
            return document.body.clientWidth; }
        GeometryInterface.getCanvasHeight = function() {
            return document.body.clientHeight; }
        GeometryInterface.getWindowWidth = function() {
            return document.body.clientWidth; }
        GeometryInterface.getWindowHeight = function() {
            return document.body.clientHeight; }
        GeometryInterface.getScreenWidth = function() {
            return screen.width; }
        GeometryInterface.getScreenHeight = function() {
            return screen.height; }
        GeometryInterface.getMinX = function() {
            return document.body.scrollLeft; }
        GeometryInterface.getMinY = function() {
            return document.body.scrollTop; }
        GeometryInterface.getMaxX = function() {
            return document.body.scrollLeft + document.body.clientWidth; }
        GeometryInterface.getMaxY = function() {
            return document.body.scrollTop + document.body.clientHeight; }
        GeometryInterface.getDocumentHeight = function() {
            return document.body.scrollHeight; }
        GeometryInterface.getDocumentWidth = function() {
            return document.body.scrollWidth; }
    }
}


/* Local Variables: */
/* mode: C++ */
/* End: */

