<!--

	// !Doc_Summary: Used to pop-up up new windows and submit forms to them.

	//* dgale 05.07.2001
	//* Two global variables used for saving and restoring the original target of any
	//* Form object sent to popFormSubmit.
	//*
	//* If we don't reset the form, unexpected behaviour can occur when attempting
	//* to reuse the form before the parent is reloaded.
	//* For example:  A child form is opened with frmTest and a target "winTest" is specified.
	//* If that child window tries to reload the parent using the same form it was opened with
	//* (opener.document.frmTest), the reload will occur in the *child* window.  This is because
	//* the "target" property of frmTest is still set to "winTest".
	//
	//* These two variables are made global (prefix of pfs for popFormSubmit to hopefully avoid
	//* collision) because of a problem with Netscape.  With Netscape, when I changed the target
	//* property of the form *after* submittig the form, it used the new target.  Which makes no
	//* sense.  To fix this, I put the code to reset the form's target inside of timeout.  This
	//* seems to give the form enough time to submit normally, then change it's target. 
	//* Still, so why global?  When the statement in the timeout was getting executed, the variables
	//* weren't recognized as defined.
	//* My guess was the statement was being executed outside the scope of this function.
	//* So to solve it, I used these two global variables.
	
	var pfs_objFormTimeout
	var pfs_strOriginalTarget
	
	function popFormSubmit(strAction, strTarget, objForm, strAttributes) {
	//*************************************************************************************************
	//* Author : Keawe Ng 8.6.2000
	//* Version: 2.01
	//* Editor: Kelly Berger; 1/2001
	//*         dgale 05.07.2001 - added Hungarian notation to variables
	//*
	//* Purpose: Determine to popUp a win directly or submitting a form to the popUp win
	//* Usage  : Need to pass 1)URL, 2)Target Win Name, 3)Object of the Form, 4)Feature of the Popup Win
	//*			1. If (1) passes in, it will set up the new URL for both submit and redirect
	//*			2. If (2) passes in, it will target to the new window for both submit and redirect
	//*			3. If (3) passes in, it will submit a form
	//*			4. If (4) passes in, it will generate a feature for the popup window
	//**************************************************************************************************

		// dgale 05.07.2001
		// Save the original target, so we can reset it after using the form
		pfs_strOriginalTarget = objForm.target;
		pfs_objFormTimeout = objForm
		
		var strURL = "";
		var winView;

		// Set the for target to the parent
		objForm.target = "_self";

		// Generate an action for submitting a form
		if (objForm != "") {
			if (strAction != "") {
				objForm.action = strAction;
			}
		} else {
			strURL = strAction;
		}

		// Generate a target for submitting a form to a popUp win
		if (objForm != "" && strTarget != "") {
			objForm.target = strTarget;
		}

		// Generate a feature list for popup window
		if (strAttributes == "") {
			strAttributes = "height=450,width=620,top=100,left=150,scrollbars=yes,toolbar=yes,menubar=no,resizable=no";
		}

		// Popup a new window
		if (strTarget != "") {
			winView = window.open(strURL, strTarget, strAttributes);
		}

		// Submitting a form if an object is passed
		if (objForm != "") {
			objForm.submit();

			// dgale 05.07.2001
			// Reset the target of the form used to open the child window.
			var tid = setTimeout("pfs_objFormTimeout.target = pfs_strOriginalTarget;", 20);
		}

		// Set focus to a new window
		// dgale 04.23.2001
		// The "unspecified error" when setting focus to the window
		// seems to be a bug in IE 5.0/5.5.  I'm going to try putting
		// the focus code into a try/catch block for IE and see if that at
		// least helps.  Nope.  Netscape chokes on the code
		if (strTarget != "") {
			
			//winView.focus();
			
		}

		// Open a new page in the same window
		if (objForm == "" && strTarget == "") {
			window.location = strURL;
		}
		
	}
	
//-->