﻿///////////////////////////////////////////////////////////////////////////////
//
//  wcoWindowGeometry.js
//
// © 2007-2008 Wco iEnterprise Solutions. All Rights Reserved.
// This file is licensed as part of the DataPortal 2.0 Managed Web Presence Solution, for details look here: http://www.wco.com.au
//
///////////////////////////////////////////////////////////////////////////////

var windowGeometry = {};

if (window.innerWidth) { // all browsers but IE
  windowGeometry.getViewportWidth = function() {return window.innerWidth;};
  windowGeometry.getViewportHeight = function() {return window.innerHeight;};
  windowGeometry.getHorizontalScroll = function() {return window.pageXOffset;};
  windowGeometry.getVerticalScroll = function() {return window.pageYOffset;};
}
else if (document.documentElement && document.documentElement.clientWidth) {
  // these functions are for IE6 with a DOCTYPE
  windowGeometry.getViewportWidth = function() {return document.documentElement.clientWidth;};
  windowGeometry.getViewportHeight = function() {return document.documentElement.clientHeight;};
  windowGeometry.getHorizontalScroll = function() {return document.documentElement.scrollLeft;};
  windowGeometry.getVerticalScroll = function() {return document.documentElement.scrollTop;};
}
else {
  // and these are for IE4, IE5 and IE6 without a DOCTYPE
  windowGeometry.getViewportWidth = function() {return document.body.clientWidth;};
  windowGeometry.getViewportHeight = function() {return document.body.clientHeight;};
  windowGeometry.getHorizontalScroll = function() {return document.body.scrollLeft;};
  windowGeometry.getVerticalScroll = function() {return document.body.scrollTop;};
}
