var wndZoom;
function OpenZoomWindow(URL) {
	var intWidth=10;
	var intHeight=10;

	var bolNewWindow=false;
	if (!wndZoom)
		bolNewWindow=true;
	else
		if (wndZoom.closed)
			bolNewWindow=true;
		
	if (bolNewWindow) {
		wndZoom=window.open(URL, 'wndZoom', 'width=' + intWidth + ',height=' + intHeight + ',location=0,menubar=0,resizable=1,scrollbars=1,status=1,titlebar=0,toolbar=0,hotkeys=0,left=0,top=0')
		wndZoom.focus()
	}
	else {
		wndZoom.document.location = URL
		wndZoom.focus()
	}
}

var intExtraWidth=0;
var intExtraHeight=0;
var intWindowWidth=0;
var intWindowHeight=0;

function ResizeZoomWindow(Width, Height) {
	tdImage.width=Width+4;
	tdImage.height=Height+4;

	var intMaxWidth=screen.width-10;
	var intMaxHeight=screen.height-40;

	Width+=40;
	Height+=110;
	
	Width+=intExtraWidth;
	Height+=intExtraHeight;

	if (Width>intMaxWidth)
		Width=intMaxWidth;

	if (Height>intMaxHeight)
		Height=intMaxHeight;

	intWindowWidth=Width;
	intWindowHeight=Height;
	
	window.resizeTo(Width,Height);
	window.moveTo(((screen.width - Width) / 2),((screen.height - Height) / 2)-15);
}

function ResizeWindow(Width, Height) {
	Width+=intExtraWidth;
	Height+=intExtraHeight;

	window.resizeTo(Width,Height);
}