function GetXPosition(obj)
{
	if (null == obj)
	{
		return 0;
	}
	var x = obj.offsetLeft;
	while (obj = obj.offsetParent)
	{
		x += obj.offsetLeft;
	}
	
	return x;
}

function GetYPosition(obj)
{
	if (null == obj)
	{
		return 0;
	}
	
	var y = obj.offsetTop;
	while (obj = obj.offsetParent)
	{
		y += obj.offsetTop;
	}
	
	return y;
}

function CenterWindow(width, height)
{
	var x = screen.width - width;
	var y = screen.height - height;
	x /= 2;
	y /= 2;
	window.resizeTo(width, height);
	window.moveTo(x, y);
}
