
function clsLog()
{
  this.window = null;
  this.width = 800;
  this.height = 600;
  this.enabled = false;
  
  var me = this;
  
  this.open = function()
  {
    me.window = window.open('','_blank','width=' + me.width + ',height=' + me.height + ',menubar=no,scrollbars=yes,resizable');
    return;
  };
  
  this.close = function()
  {
    if(me.window)
    {
      me.window.close();
    }
    return;
  };
  
  this.write = function(str)
  {
    if(!me.enabled){return;}
    if(!me.window)
    {
      me.open();
    }
    if(me.window.closed)
    {
      me.open();
    }
    me.window.document.writeln(str + "<br>");
    return;
  };
  
  this.showHide = function()
  {
    if(me.enabled)
    {
      me.close();
      me.enabled = false;
      return;
    }
    me.enabled = true;
  };
}