/*
 * browser.js (V.1.0)
 * Several bits of information about the browser.
 * @author : Jean Semere (Baggage Claim)
 *
 * You have no right to use or redistribute this code unless Baggage Claim SARL
 * authorizes you to do so.
 *
 */

Browser = Class.create();
Browser.prototype =
{
	initialize: function(auto_refresh)
	{
		this.height = 0;
		this.width = 0;
		this.refresh();
		if (auto_refresh)
			Event.observe(window, 'resize', this.refresh.bindAsEventListener(this), false);
	},
	
	refresh: function()
	{
		if (Prototype.Browser.IE)
		{
			if (document.documentElement && document.documentElement.clientHeight)
			{
				this.height = parseInt(document.documentElement.clientHeight);
				this.width = parseInt(document.documentElement.clientWidth);
			}
			else
			{
				this.height = parseInt(document.body.clientHeight);
				this.width = parseInt(document.body.clientWidth);
			}
		}
		else
		{
			this.height = parseInt(window.innerHeight);
			this.width = parseInt(window.innerWidth);
		}
	}
};

