<!--
var wndHandle_Arr = new Array();
var argsArr = null;

//Popup variable setting
var featuresSignup = "left=135,top=75,screenX=135,screenY=75,width=600,height=600,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,directories=no,location=no";

// Initiates launch of the window.
// Any old window is closed before the new window is re-opened under the same name; this has been done for browser-compatibility purposes.
// Netscape runs this function once whereas IE runs this function twice. IE uses a two-step
// process because it needs to pause after closing the old window (before opening the new
// window), otherwise the new window may never open.
// Maybe this happens in IE because maybe the old window's thread is still closing while the
// JavaScript may be allowed to continue (unsure). What is known is the pause allows enough
// time that IE does not exhibit the weird behaviour after the pause is completed.
// Not all IEs suffer from this open/close window phenomena, but for brevity purposes I make
// all IEs go through the two-step process because all of them can without error.
// this function stors windowhandle in the global array of handles by window name

function LaunchPopup(wndName,wndTarget,wndFeatures,url,iePart2) 
{
	if (!iePart2)
		argsArr = arguments;
		
	ClosePopup(argsArr[0]);
	if (iePart2 || !document.all) //IE browser in second phase, or another browser in first/only phase
	{
		// opening window
		var hWndPopup = window.open(argsArr[3], argsArr[0], argsArr[2]);
		// storing window handle (by name)
		wndHandle_Arr[argsArr[0]] = hWndPopup;
	}
	else //Pause after IE phase 1 (closing window) before phase 2 (opending window again) ...
		LaunchPopup(null,null,null,null,'Do_IE_Phase_2');
	
	return false;
}


// Only closes the window if it appears to be opened.
function ClosePopup(wndName)
{
	// loooking foe window handle in the global array
	if (wndHandle_Arr[wndName] && (!wndHandle_Arr[wndName].closed))
	{
		wndHandle_Arr[wndName].close();
		wndHandle_Arr[wndName] = null;
		//removing window handle from the array
		delete wndHandle_Arr[wndName];
	}
	return false;
}


// function that close all open windows
function CloseAll()
{
	for (var i in wndHandle_Arr)
		ClosePopup(i);

	return false;
}

// When called, Iterate through the multi-action array and perform all actions.
function BeforePageUnload()
{
	for (var AllFunc=0;AllFunc < ArrayUnloadFunctions.length; AllFunc++)
		ArrayUnloadFunctions[AllFunc]();
}

function CloseWindow() {
  self.alert('Javascript can not close this window.\n\nPlease use the [X] window control in the top right corner of this browser window.');
}

function CloseWindow() {
  self.close();
}

// function
function AfterPageLoad()
{
	// Attach the CloseAll function to the beggining of array of unload function
	ArrayUnloadFunctions[ArrayUnloadFunctions.length] = CloseAll;
	
	// Attach previus window.onunload to the end of array ArrayUnloadFunctions
	// IMPORTANT: previus window.onunload event has to be the last in this array.
	if (window.onunload)
		ArrayUnloadFunctions[ArrayUnloadFunctions.length] = window.onunload;
	
	// Attach the BeforePageUnload function to the window.onunload event.
	window.onunload = BeforePageUnload;
}

// Define the multi-action array if it doesn't already exist.
if (!window.ArrayUnloadFunctions)
	window.ArrayUnloadFunctions = new Array();
//-->