/**
 * objectplanet.BrowserSize.js This module gets the size and 
 * geometry of the browser documetn and window.
 **/

/* Set up the name space */
var objectplanet;
if (!objectplanet) objectplanet = {};
objectplanet.BrowserSize = {};

/* This method gets the screen width */
objectplanet.BrowserSize.getWidth = function() {
	return window.innerWidth ? window.innerWidth : document.documentElement.clientWidth;
}

/* This method gets the screen height */
objectplanet.BrowserSize.getHeight = function() {
	return window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;
}

/* This method gets the horizontal scroll offset of the document */
objectplanet.BrowserSize.getOffsetX = function() {
	return window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft;
}

/* This method gets the vertical scroll offset of the document */
objectplanet.BrowserSize.getOffsetY = function() {
	return window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop;
}
	
/* This method gets the center X-position of the scrollable browser viewport */
objectplanet.BrowserSize.getCenterX = function() {
	return objectplanet.BrowserSize.getWidth() / 2 + objectplanet.BrowserSize.getOffsetX();
}
	
/* This method gets the center Y-position of the scrollable browser viewport */
objectplanet.BrowserSize.getCenterY = function() {
	return objectplanet.BrowserSize.getHeight() / 2 + objectplanet.BrowserSize.getOffsetY();
}
