<!-- Here's a little javascript -->
var remote = null;

/* Give this window the name 'main' for future reference by other windows. */
window.name = "main"

/* Determine the browser version */
var browser = new Object();
browser.version = parseInt(navigator.appVersion);
browser.isIE = false;
browser.isNavigator = false;
if (navigator.appName.indexOf("Netscape") != -1)
  browser.isNavigator = true;
else if (navigator.appName.indexOf("Microsoft") != -1)
  browser.isIE = true;

// Opens a window somewhat smaller than the user's screen size, and
// moves it to the lower right corner of the screen.
function docWin(URL)
	{ var winWidth, winHeight;
		switch(screen.width)
			{	case 512:
				case 640:
					winWidth=350;
					winHeight=400;
					break;
					
				case 800:
				case 832:
					winWidth=500;
					winHeight=700;
					break;
					
				case 1024:
				case 1152:
				case 1280:
					winWidth=750;
					winHeight=700;
					break;
					
				default:
					// Something else.  Punt.
					winHeight = 520;
					winWidth = 400;
			}
			
		// Open the window.
		var docwin = OpenSecondaryWindow("docwin", winHeight, winWidth, URL);
		
		// Move it out of the way
		/*
		if (docwin != null)
			{ docwin.setTimeout("self.moveTo(screen.availWidth - " + winWidth + ", screen.availHeight - " + winHeight + ");", 50);
			}
		*/
	}

function glossWin(term)
  { var winWidth, winHeight;
		switch(screen.width)
			{	case 512:
				case 640:
					winWidth=144;
					winHeight=90;
					break;
					
				case 800:
				case 832:
					winWidth=116;
					winHeight=166;
					break;
					
				case 1024:
				case 1152:
				case 1280:
					winWidth=316;
					winHeight=195;
					break;
					
				default:
					// Something else.  Punt.
					winHeight = 144;
					winWidth = 90;
			}
			
		var URL = "glossterm.asp?t=" + term;
		var win=window.open(URL, "glossary", 'height=' + winHeight + ', width=' + winWidth + ', status=no, resizable=yes, scrollbars=yes, menubar=no, toolbar=no', true);
		win.focus();
	}
	
/* If the broswer can open a secondary window, do so.  Otherwise,
   load the page in the current window.
*/
function OpenSecondaryWindow(Name, Height, Width, URL, status)
  { if (browser.isIE && browser.version < 4)
      { // Load page in this window
        document.URL=URL;
      }
    else
      { // Open a new window
				var SecondaryWindow;
        SecondaryWindow = window.open(URL, Name, 'width=' + Width + ',height=' + Height + ',status=' + status + ',resizable,scrollbars,menubar,toolbar');
        if (SecondaryWindow != null)
          { if (SecondaryWindow.opener == null) SecondaryWindow.opener = self;
            SecondaryWindow.focus();
						return SecondaryWindow;
          }
        else
          { // Failed to open secondary window.  Redirect primary window.
            document.URL = URL;
						return null;
          }
      }
  }
