function resizeWindow(w,h)
{
	if (self.innerWidth)
	{
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}
	else return;

	//if (self.screen.width < frameWidth *2 || self.screen.height < frameHeight *2)
	{
	/*
		w = self.screen.width/2;
		h = self.screen.height/2;
		if (document.layers)
		{
			tmp1 = parent.outerWidth - parent.innerWidth;
			tmp2 = parent.outerHeight - parent.innerHeight;
			newWidth -= tmp1;
			newHeight -= tmp2;
		}
		*/
		parent.window.resizeTo(w,h);
		//parent.window.moveTo(self.screen.width/4,self.screen.height/4);
	}
	
}

function centerWindow()
{
	var leftPos = (screen.availWidth - getWindowWidth()) / 2;
	var topPos  = (screen.availHeight - getWindowHeight()) / 2;
	top.window.moveTo(leftPos,topPos);
}

function getWindowWidth()
{

	if (self.innerWidth)
	{
		return self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		return document.documentElement.clientWidth;
	}
	else if (document.body)
	{
		return document.body.clientWidth;
	}
	else return -1;
}

function getWindowHeight()
{

	if (self.innerWidth)
	{
		return self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	{
		return document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		return document.body.clientHeight;
	}
	else return -1;
}
