Desktop = function(b)
{
	this.browser = b;
	this.screenWidth = screen.width;
	this.screenHeight = screen.height;
	this.windows = new Object(); // should be an array containing windows objects
	this.popX = null;
	this.popY = null;
}
var o = Desktop.prototype;
o.getWindowSize = function()
{
	this.screenWidth = screen.width;
	this.screenHeight = screen.height;
	this.docWidth = this.browser.isIE ? document.body.offsetWidth : innerWidth;
	this.docHeight = this.browser.isIE ? document.body.offsetHeight : innerHeight;
};
o.setPopPosition = function(x, y)
{
	this.popX = x;
	this.popY = y;
};
o.popCentered = function()
{
	this.popX = null;
	this.popY = null;
};
o.popWindow = function(f, n, w, h, p)
{
	if(this.browser.isMac)
	{
		w -= 2;
		h -= 1;
	}
	var winLeft = this.popX != null ? this.popX : (this.screenWidth - w) / 2;
	var winTop = this.popY != null ? this.popY :  (this.screenHeight - h) / 2;
	var winProps = 'height=' + h + ',width=' + w + ',top=' + winTop + ',left=' + winLeft + ',' + p;

	this.windows[n] = window.open(f, n, winProps);
	return this.windows[n];
};