// JavaScript Document
<!--
//**********
// New: POPUP Blocker compatible, DR, 26/10/04
// Original custom popup code, DR, 9/10/03.
window.onerror=LPOnError

function LPOnError() {
   return true }

// On opening this window, reset Window trackers
// Allow one POPUP window (QTWin)
QTWin = null;   //global var


// GH_openPopupWindow()
// Used to popup windows. Only opens 1 window with 'winName' at a time.

  // New code Oct04 for popup blockers on Win98 + XP SP2.
  // This works GREAT on XP, but one reservation on Win98!
  // focus() on XP brings a window UP from minimised, or from behind.
  // focus() on Win98 leaves a window minimised, but brings it in front from behind.
  
  // Keep the function itself as LEAN as possible.
function GH_openPopupWindow(theURL,winName,features) {
  winHandle = window.open(theURL,winName,features);
  winHandle.focus();
}


function GH_openPopupWindowOld(theURL,winName,features) {
//
// Used to popup windows. Only opens 1 window at a time.
// Detect previous window & closes it, else Focus takes
// a while to work & user may wonder where new window is.
//

	// CD - Make all GH pop up windows go top left
	if ( features != "" )
		features = features + "," ;
	features = features + "top=0,left=0" ;

	//Is QTWin null, or have we opened a popup?
	popupWin = false;
	if (QTWin != null) {
		popupWin = true;
	}
	finished = false;

	if (popupWin) {
		if (!QTWin.closed) {
			// The window should still be open

			// GOOD CODE IF WE WANT TO REUSE EXISTING WINDOWS
//			// REUSE EXISTING WINDOW
//			QTWin.location = theURL;
//			// Bring it to the front, and up from minimised
//			QTWin.focus();
//			finished = true;
//			}

			// Close the window
			commstring = 'QTWin = null'; // in case already closed
			setTimeout(commstring,500);	  // 
			QTWin.close();		 // try closing it
			}
		}

	// Any window should now be closed

	// Open a New popup window
	// Delay to allow Macs to run close above
	commstring = 'QTWin = window.open("' + theURL + '","' + winName + '","' + features + '")';
	setTimeout(commstring,600);

	// In case lost window by changing to another main page..
	// give window focus
	commstring = 'QTWin.focus()';
	setTimeout(commstring,800);

}

function GH_closePopupWindow() {
//
// Used to close last popup window, if there is one.
//

	//Is QTWin null, or have we opened a popup?
	popupWin = false;
	if (QTWin != null) {
		popupWin = true;
		}
	finished = false;

	if (popupWin) {
		if (!QTWin.closed) {
			// The window should still be open

			// GOOD CODE IF WE WANT TO REUSE EXISTING WINDOWS
//			// REUSE EXISTING WINDOW
//			QTWin.location = theURL;
//			// Bring it to the front, and up from minimised
//			QTWin.focus();
//			finished = true;
//			}

			// Close the window
			commstring = 'QTWin = null'; // in case already closed
			setTimeout(commstring,500);	  // 
			QTWin.close();		 // try closing it
			}
		}

	// Any window should now be closed
}

function closethiswindow() { 
	   window.close()
}
//**********

