
var AnswerWindow;

var answerWINopened = 0;

isNetscape = 1;
if (navigator.appName.indexOf('Netscape') == -1) {isNetscape=0};
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
function CloseAnswerWindow() { closeAnsWin(AnswerWindow,0) };
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

//---------------------------------------------------------------------------------------
var genWINopened = 0;

function closeAnsWin(winObj,prntclosemode) {

	if (typeof winObj =="object")
	{

	if (isOpen(winObj))
		 {
			var openerIsSelf = 0; var emailConfirmMode = 0; var openerNotFound = 0;

			if (	(typeof winObj.creator == "object" && winObj.creator && winObj.creator == self) ||	(typeof winObj.opener  == "object" && winObj.opener  && winObj.opener  == self)	)
				{openerIsSelf = 1}
			else 
			if (typeof winObj.havesubmitted == 'number' && typeof winObj.cgimaker!="undefined" )
				{emailConfirmMode = 1};
			
			if (openerIsSelf || emailConfirmMode) 
			{
				if (prntclosemode && typeof winObj.parentclosing=="number") winObj.parentclosing=1;
				winObj.close();
			}
		 };
	}
}
//-------------------------------------
function isOpen(winObj) {
	if (typeof winObj != 'object') {return 0};
	var thisWinOpen = 0;
	if (isNetscape)
		{ thisWinOpen = (winObj.closed)?0:1}
	else {
		thisWinOpen = ((typeof winObj.creator == "object" || typeof winObj.cgimaker!="undefined") &&!winObj.closed)?1:0;
	};
	return thisWinOpen
}
//-------------------------------------
CloseGenWinLoaded = 1;
//---------------------------------------------------------------------------------------
/*
function CloseAnswerWindow() {
  if (typeof(AnswerWindow)=="object")
  {

		if (navigator.appName.indexOf('Netscape') != -1)
		  { answerWINopened = (AnswerWindow.closed)?0:1}
	 else {
			answerWINopened = (typeof AnswerWindow.creator == "object" && AnswerWindow)?1:0;
		  };



	if (answerWINopened && typeof AnswerWindow.creator == "object" && AnswerWindow.creator && AnswerWindow.creator == self)
		 {
			top.AnswerWindow.close();
		 }
	}
}
*/

openwinLoaded = 1;


// -------
function NEWopenWin(url) {

if (typeof AnsWin0pParams != 'string')
{ AnsWin0pParams = 'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1' };

AnsWin0pParams += ',width='+ AnsWinWidth + ',height=' + AnsWinHeight;

AnswerWindow = window.open(url,'demoWin', AnsWin0pParams);

answerWINopened = 1;

if (navigator.appName.indexOf('Netscape') != -1)
{delayAssign();}
else
{ setTimeout("delayAssign()",800); };

}
// -------

if (typeof AnsWinWidth == 'undefined') {AnsWinWidth = 550};
if (typeof AnsWinHeight == 'undefined') {AnsWinHeight = 450};

if (typeof screen == 'object' && typeof screen.availWidth == 'number' && typeof screen.availHeight == 'number')
{
var maxW = parseInt(0.9 * screen.availWidth);
var maxH = parseInt(0.9 * screen.availHeight);
//alert(WindowWidth  + '   availW: ' + maxW)
//alert(WindowHeight + '   availH: ' + maxH)
if (AnsWinWidth  > maxW) {AnsWinWidth  = maxW};
if (AnsWinHeight > maxH) {AnsWinHeight = maxH}; // ; alert('resetting H')
}


self.name = "mainWindow";
self.focus();

function delayAssign() {
if (AnswerWindow && !AnswerWindow.closed) {
	AnswerWindow.creator=self;
	AnswerWindow.opener=self;
	};
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~  All JavaScript written by:  Erwin O. Fox Tree, 1999  ~~
//~~  foxtree@tiac.net                   okwa@hotmail.com  ~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~







