
function loadWin(sWin,sUrl)
{
  var sPage = "";
  var sHeight = "";
  var sWidth = "";
  var sResize = "yes";

  //Set Variable values for loading window

  if (sWin == "NEW")
  {
	sPage = sUrl;
	sHeight = "275";
	sWidth = "400";
  }
  else if (sWin == "CHAT")
  {
	sPage = sUrl;
	sHeight = "425";
	sWidth = "400";
  }
  else if (sWin == "SETTINGS")
  {
	sPage = "glossary/glossary.htm";
	sHeight = "400";
	sWidth = "700";
	sResize = "yes";
  }

  if (sPage!="NONE")
  {
	// Create commands
	sOpenCommand = sWin + "=window.open('"+sPage+"','"+sWin+"','menubar=no,location=no,scrollbars=yes,statusbar=no,resizable=no,height="+sHeight+",width="+sWidth+",left=20,top=20');";
	sFocusCommand = "window."+sWin+".focus();";
	sCloseCommand = "window."+sWin+".close();";

	var sWin = "window."+sWin;
	// Check if window exists
	if (eval(sWin))
	{
		// If window exists open and then focus on it in NS
		if (document.layers)
		{
			eval(sOpenCommand);
			eval(sFocusCommand);
		}
		else
		// IE doesn't handle focus as desired, so have to close the window
		// first and then open again.  Need timeout to prevent IE from
		// closing the newly opened window.
		{
			eval(sCloseCommand);
			setTimeout("eval(sOpenCommand)",200);
		}
	}
	else
	{
		eval(sOpenCommand);
	}
  }
}
