function OpWndw(URL, wTarget, wWidth, wHeight, resizable, scrollbars) {
	self.name = "mainwin"
	if (wWidth < window.screen.Width) {
		imagewidth = wWidth+15;
	} else {
		imagewidth = (window.screen.Width-100);
	}

	if (wHeight < window.screen.Height) {
		imageheight = wHeight+10;
	} else {
		imageheight = (window.screen.Height-100);
	}

	var winPosX = window.screen.Width/2-imagewidth/2;
	var winPosY = window.screen.Height/2-imageheight/2;

	var smallWindow=window.open(URL, ((wTarget)?wTarget:"_blank"), "height="+imageheight+", width="+imagewidth+", status=no, toolbar=no, menubar=no, location=no, resizable="+((resizable)?resizable:"yes")+", scrollbars="+ ((scrollbars)?scrollbars:"no"));

	if (smallWindow != null && smallWindow.opener == null) smallWindow.opener=window;
	smallWindow.focus();

	return smallWindow;
}