var gmyWin = null;
var lastSelection = null;

function myOpenWindow(winURL, winName, winFeatures, winObj)
{
  var theWin; // this will hold our opened window
  if ( lastSelection != winURL )
  {
    // if the window is different the close it and
    // so a new window can be opened.
  	if ( winObj != null )
  	{
  		winObj.close();
  	}
  }
  lastSelection = winURL;			  

  // first check to see if the window already exists
  if (winObj != null)
  {
    // the window has already been created, but did the user close it?
    // if so, then reopen it. Otherwise make it the active window.
    if (!winObj.closed) {
      winObj.focus();
      return winObj;
    }
    // otherwise fall through to the code below to re-open the window
  }

  // if we get here, then the window hasn't been created yet, or it
  // was closed by the user.
  theWin = window.open(winURL, winName, winFeatures);
  return theWin;
}

function openwindow(id, winObj)
{
	return myOpenWindow("help.html#"+id, "tips", "menubar=0, resizable=0, width=320, height=300", winObj);
}