//   - usage: <A HREF="subscribers.html" onclick="return outwin(this,'MAIN')">here</A>
function outwin(obj,target)
{
  url=obj.href
  if (target == "MAIN")
    W=window.open('',target,'status=yes,hotkeys=no,resizable=yes,scrollbars=yes')
  if (target == "HELP")
    W=window.open('',target,'status=yes,toolbar=yes,hotkeys=no,resizable=yes,scrollbars=yes')
  if (target == "SPENVIS_HOME")
    W=window.open('',target,'status=yes,menubar=yes,toolbar=yes,hotkeys=no,resizable=yes,scrollbars=yes')
  if (target == "RESULTS")
    W=window.open('',target,'status=yes,menubar=yes,hotkeys=no,resizable=yes,scrollbars=yes,width=840,height=640')
  if (target == "EXTERNAL")
    W=window.open('',target,'status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes')
  if (target == "ECSS")
    W=window.open('',target,'status=yes,toolbar=yes,hotkeys=no,resizable=yes,scrollbars=yes')
  if (target == "BUGS")
    W=window.open('',target,'width=640,height=400,scrollbars=yes,resizable=yes')
  if (target == "UPDATES")
    W=window.open('',target,'width=640,height=400,scrollbars=yes,resizable=yes')
  if (target == "MESSAGE")
    W=window.open('',target,'width=400,height=300,scrollbars=yes,resizable=yes')

  W.focus()
  window.open(url,target)
  return false
}

//   - usage: <A HREF="subscribers.html" TARGET=MAIN onclick="return focuswin(this)">here</A>
function focuswin(obj,target)
{
  target=obj.target
  url=obj.href

  if (target == "MAIN")
    W=window.open('',target,'status=yes,hotkeys=no,resizable=yes,scrollbars=yes')
  if (target == "HELP")
    W=window.open('',target,'status=yes,toolbar=yes,hotkeys=no,resizable=yes,scrollbars=yes')
  if (target == "SPENVIS_HOME")
    W=window.open('',target,'status=yes,menubar=yes,toolbar=yes,hotkeys=no,resizable=yes,scrollbars=yes')
  if (target == "SEARCH")
    W=window.open('',target,'status=yes,toolbar=yes,hotkeys=no,resizable=yes,scrollbars=yes')
  if (target == "RESULTS")
    W=window.open('',target,'status=yes,menubar=yes,hotkeys=no,resizable=yes,scrollbars=yes,width=840,height=640')
  if (target == "EXTERNAL")
    W=window.open('',target,'status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes')
  if (target == "ECSS")
    W=window.open('',target,'status=yes,toolbar=yes,hotkeys=no,resizable=yes,scrollbars=yes')
  if (target == "UPDATES")
    W=window.open('',target,'width=840,height=640,scrollbars=yes,resizable=yes')
  if (target == "MESSAGE")
    W=window.open('',target,'width=400,height=300,scrollbars=yes,resizable=yes')

  W.focus()
  window.open(url,target)
  return false
}

function focusmain()
{
    W=window.open('','MAIN','status=yes,hotkeys=no,resizable=yes,scrollbars=yes')
    W.focus()
    return true
}


function oldreportwin(model, report_url)
{
  W=window.open('','RESULTS','status=yes,menubar=yes,hotkeys=no,resizable=yes,scrollbars=yes,width=840,height=640')
  W.focus()
  W.document.open()
  W.document.write("<HEAD><TITLE>" + model +" status window</TITLE>")
  W.document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"./style/spenvis.css\" /></HEAD>")
  W.document.write('<BODY CLASS=\"statusWindow\">')
  W.document.write("<CENTER><H3>" + model +" status window</H3></CENTER>")
  W.document.write(model + " succesfully completed. ")
  W.document.write('Click <A href="' + report_url + '">here</A> ')
  W.document.write("to view the report file. View the main window ")
  W.document.write("for a list of all output files and to produce plots.")
  W.document.write("</BODY>")
  W.document.close()
  return false
}

function reportwin(model, report_url, logtxt)
{
  W=window.open('','RESULTS','status=yes,menubar=yes,hotkeys=no,resizable=yes,scrollbars=yes,width=840,height=640')
  W.focus()
  W.document.open()
  W.document.write("<head><title>" + model +" status window</title>")
  W.document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/s%70%65%6e%76%69s/style/spenvis.css\" /></head>")
  W.document.write('<body class=\"statusWindow\">')
  W.document.write("<center><h3>" + model +" status window</h3></center><p>")
  W.document.write(model + " succesfully completed. ")
  W.document.write('Click <a href="' + report_url + '">here</a> ')
  W.document.write("to view the report file. View the main window ")
  W.document.write("for a list of all output files and to produce plots.")
  W.document.write("</p><p>&nbsp;</p><p>" + logtxt)
  W.document.write("</p></body>")
  W.document.close()
  return false
}
