/*******************************************************************
*
* File    : xBrowser.js
*
* Created : 04/10/2006 14:52
*
* Author  : Barry Jones (barry.jones@screenpages.com)
*
* Purpose : To create a cross browser "Browser" object.
*		This library will allow scripts to query parameters
*		about the current browser window.
*
* History
* Date         		Version		Description
*
* 04/10/2006 14:52	1.0		Initial version
***********************************************************************/

function xBrowser()
{
	if(navigator.appName.indexOf("Netscape") != -1)
	{
		this.getCanvasWidth	= function() {return innerWidth;}
		this.getCanvasHeight	= function() {return innerHeight;}
		this.getWindowWidth 	= function() {return outerWidth;}
		this.getWindowHeight	= function() {return outerHeight;}
		this.getScreenWidth 	= function() {return screen.width;}
		this.getScreenHeight	= function() {return screen.height;}
		this.getMinX		= function() {return(pageXOffset);}
		this.getMinY		= function() {return(pageYOffset);}
		this.getMaxX		= function() {return(pageXOffset+innerWidth);}
		this.getMaxY		= function() {return(pageYOffset+innerHeight);}

		this.getYOffSet		= function() {return(0);}

		this.centerY		= function() {return parseFloat( parseFloat(pageYOffset) + (parseFloat(innerHeight) / 2 ));}
		this.centerX		= function() {return parseFloat(innerWidth) / 2 ;}

	}
	else
	if(document.all)
	{
		this.getCanvasWidth	= function() {return document.body.clientWidth;}
		this.getCanvasHeight	= function() {return document.body.clientHeight;}
		this.getScreenWidth	= function() {return screen.width;}
		this.getScreenHeight	= function() {return screen.height;}
		this.getMinX		= function() {return(document.body.scrollLeft);}
		this.getMinY		= function() {return(document.body.scrollTop);}
		this.getMaxX		= function() {
			return(document.body.scrollLeft
				+document.body.clientWidth);
		}
		this.getMaxY		= function() {
				return(document.body.scrollTop
					+document.body.clientHeight);
		}

		this.getYOffSet		= function() {return(document.documentElement.scrollTop);}

		this.centerY		= function() {return parseFloat( parseFloat(document.documentElement.scrollTop) + (parseFloat(document.documentElement.clientHeight) / 2 ));}
		this.centerX		= function() {return parseFloat(document.documentElement.clientWidth) / 2 ;}
	}
	return(this);
}
/*** End  - xBrowser a cross browser "Browser" object ***/
