function openw(x) {window.open(x,'DATA','toolbar=yes,location=no,resizable=yes,directories=no,status=no,menubar=no,scrollbars=yes,width=1030,height=800,top=25,left=10');}
function openw1(x) {window.open(x,'DATA1','toolbar=no,location=no,resizable=no,directories=no,status=no,menubar=no,scrollbars=no,width=400,height=200,top=100,left=50');}
function openwrep1(x) {window.open(x,'RPT1','toolbar=yes,location=no,resizable=yes,directories=no,status=no,menubar=no,scrollbars=yes,top=0,left=0');}
function openwnew(x,y) {window.open(x,y,'toolbar=yes,location=no,resizable=yes,directories=no,status=no,menubar=no,scrollbars=yes,width=1030,height=800,top=25,left=10');}
function openwvar(x,width,height) {window.open(x,'RDG','toolbar=yes,location=no,resizable=yes,directories=no,status=no,menubar=no,scrollbars=yes,width='&width&',height='&height&',top=25,left=10');}
function openwnewvar(x,width,height) {window.open(x,'CHGMFIN','toolbar=yes,location=no,resizable=yes,directories=no,status=no,menubar=no,scrollbars=yes,width='&width&',height='&height&',top=25,left=10');}
function openwTransInvoice(x,y) {window.open(x,y,'toolbar=no,location=no,resizable=yes,directories=no,status=no,menubar=no,scrollbars=no,width=400,height=400,top=200,left=200');}
function openwTransRec(x,y) {window.open(x,y,'toolbar=no,location=no,resizable=yes,directories=no,status=no,menubar=no,scrollbars=yes,width=1030,height=800,top=50,left=50');}

function OpenPopUpWnd (file, width, height, resize)
{
	var doCenter = false;
	{
		attribs = "";

		// assemble some params
		if(resize) size = "yes"; else size = "no";

		/*/
		/ / We want to center the pop-up; however, to do this we need to know the
		/ / screen size.  The screen object is only available in JavaScript 1.2 and
		/ / later (w/o Java and/or CGI helping), so we must check for the existance
		/ / of it in the window object to determine if we can get the screen size.
		/ /
		/ / It is safe to assume the window object exists because it was implemented
		/ / in the very first version of JavaScript (that's 1.0).
		/*/
		for(var item in window)
			{ if(item == "screen") { doCenter = true; break; } }

		if(doCenter)
		{	/*/ center the window /*/

			// if the screen is smaller than the window, override the resize setting
			if(screen.width <= width || screen.height <= height) size = "yes";

			WndTop  = (screen.height - height) / 2;
			WndLeft = (screen.width  - width)  / 2;

			// collect the attributes
			attribs = "width=" + width + ",height=" + height + ",resizable=" + size + ",scrollbars=" + size + "," + 
			"status=no,toolbar=no,directories=no,menubar=no,location=no,top=" + WndTop + ",left=" + WndLeft;
		}
		else
		{
			/*/
			/ / There is still one last thing we can do for JavaScrpt 1.1
			/ / users in Netscape.  Using the AWT in Java we can pull the
			/ / information we need, provided it is enabled.
			/*/
			if(navigator.appName=="Netscape" && navigator.javaEnabled())
			{	/*/ center the window /*/

				var toolkit = java.awt.Toolkit.getDefaultToolkit();
				var screen_size = toolkit.getScreenSize();

				// if the screen is smaller than the window, override the resize setting
				if(screen_size.width <= width || screen_size.height <= height) size = "yes";

				WndTop  = (screen_size.height - height) / 2;
				WndLeft = (screen_size.width  - width)  / 2;

				// collect the attributes
				attribs = "width=" + width + ",height=" + height + ",resizable=" + size + ",scrollbars=" + size + "," + 
				"status=no,toolbar=no,directories=no,menubar=no,location=no,top=" + WndTop + ",left=" + WndLeft;
			}
			else
			{	/*/ use the default window position /*/

				// override the resize setting
				size = "yes";

				// collect the attributes
				attribs = "width=" + width + ",height=" + height + ",resizable=" + size + ",scrollbars=" + size + "," + 
				"status=no,toolbar=no,directories=no,menubar=no,location=no";
			}
		}

		// create the window
		popup = open(file, "", attribs);
	}

}