function detectBrowser()
{
	var agent = navigator.userAgent.toLowerCase();

	var browserIsClone =	((agent.indexOf('spoofer')!=-1) ||
				 (agent.indexOf('compatible')!=-1) ||
				 (agent.indexOf('opera')!=-1));
	
	this.nav =		((agent.indexOf('mozilla')!=-1) && (!browserIsClone));
	this.ie =		((agent.indexOf('msie')!=-1) && (browserIsClone));
	this.other =		!(this.nav || this.ie);

	this.version =	parseInt(navigator.appVersion);	// ignore the minor version number

	this.dom =		document.getElementById ? 1 : 0;
	this.layers =		document.layers ? 1 : 0;

	return this;
}

function measureViewport(browser)
{
	if ((browser.nav) && (browser.version>=4))
	{
		this.width = window.innerWidth;
		this.height = window.innerHeight;
	} else
	{
		if ((browser.ie) && (browser.version>=4))
		{
			this.width=document.body.offsetWidth;
			this.height=document.body.offsetHeight;
		} else
		{
			// don't know how to figure it out... shall guess some reasonable minumum values.
			this.width=620;
			this.height=300;
		}
	}

	this.xcentre=Math.floor(this.width/2);
	this.ycentre=Math.floor(this.height/2);

	return this;
}
