// JavaScript Document
function GetInnerSize () {
	var x,y;
	if (self.innerHeight){
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body)	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return [x,y];
}

function ResizeToInner(w,h){
	ypos = window.screenTop || window.screenY;
	xpos = window.screenLeft || window.screenX;
	
	if((xpos+310) > screen.availWidth){
		xpos = screen.availWidth-310;
	}
	if((ypos+386) > screen.availHeight){
		ypos =screen.availHeight-556;
	}
	
	window.moveTo(xpos,ypos);
	window.resizeTo(310,386);
	var inner = GetInnerSize();
	var ox = 310-inner[0];
	var oy = 386-inner[1];
	window.resizeTo(w+ox, h+oy);
}