var newWindow

function makeNewWindow(u,n,w,h) {
  newWindow = window.open(u,n,"height="+h+",width="+w+",scrollbars,screenX=50,screenY=50,left=50,top=50")
}

function subWrite(WinUrl,WindowName,WindowWidth,WindowHeight) 
{
  // make new window if none, else close it and prepare for next try
  if (newWindow){
    newWindow.close()
    newWindow = null
    makeNewWindow(WinUrl,WindowName,WindowWidth,WindowHeight)
  }
  else {
    makeNewWindow(WinUrl,WindowName,WindowWidth,WindowHeight)
  }
}

function setMsg(msg) 
{
  window.status = msg;
  return true
}
