title: Pop up window not appending text
body: <p>I am trying to implement a 'Trace Window' pop up window when I enter a website, and then send messages to that window throughout the website in Order to diagnose some of the more awkward issues i have with the site.
  The Problem is that the page changes, if The trace window already exists, all content is removed, before the new TraceText is added. 
  What I want is a Window that can be sent messages from any page inside the website.</p>
  
  <p>I have a javascript Script debugger.js which I include as a script in every screen (shown below) I would then call the sendToTraceWindow() function to send a message to it thoughout the website. this is currently Mostly done in vbscript at present, due to the issues i am currenctly investigating.
  I think it is because i am scripting in the debugger.js into every screen, which sets the traceWindow variable = null (see code below) but I do not know how to get around this!</p>
  
  <p>Any help much appreciated.
  Andrew</p>
  
  <p>code examples:</p>
  
  <p><strong>debugger.js</strong>:</p>
  
  <pre><code>var traceWindow = null
  
  function opentraceWindow()
  {
     traceWindow = window.open('traceWindow.asp','traceWindow','width=400,height=800')
  }
  
  function sendToTracewindow(sCaller, pMessage)
  {
  
     try
     {
        if (!traceWindow)
        {
           opentraceWindow()
        }
  
        if (!traceWindow.closed)
        {
           var currentTrace = traceWindow.document.getElementById('trace').value
           var newTrace = sCaller + ":" + pMessage + "\n" + currentTrace
           traceWindow.document.getElementById('trace').value = newTrace
        }
     }
     catch(e)
     {
           var currentTrace = traceWindow.document.getElementById('trace').value
           var newTrace = "error tracing:" + e.message + "\n" + currentTrace
           traceWindow.document.getElementById('trace').value = newTrace
     }
  
  }
  </code></pre>
  
  <p><strong>traceWindow.asp</strong> - just a textarea with id='trace':</p>
  
  <pre><code>&lt;HTML&gt;
     &lt;head&gt;
        &lt;title&gt;Debug Window&lt;/title&gt;
     &lt;/head&gt;
     &lt;body&gt;
        &lt;textarea id="trace" rows="50" cols="50"&gt;&lt;/textarea&gt;
     &lt;/body&gt;
  &lt;/HTML&gt;
  </code></pre>