function generalMessageBox(top, boxClass, forceViewClass)
  {
  this.boxClass = boxClass;
  this.displaying = false;
  this.node = null;
  this.top = top
  this.forceView = false;
  this.forceViewClass = forceViewClass;

  this.forceViewNode = null
  var parent = this;
  var fn = function()
    {
    parent.resetPos();
    }
  setTimeout(fn, 100);
  }

generalMessageBox.prototype.isDisplaying = function()
  {
  return this.displaying;
  }

generalMessageBox.prototype.setForceView = function()
  {
  this.forceView = true;
  }

generalMessageBox.prototype.resetPos = function()
  {
  var parent = this;
  var fn = function()
    {
    parent.resetPos();
    }
  setTimeout(fn, 100);

  if (!this.displaying)
    {
    return;
    }

  var topDiff = document.body.scrollTop;

  if (topDiff == 0 && document.documentElement.scrollTop != null)
    {
    topDiff = document.documentElement.scrollTop;
    }

  if (this.node.style['top'] != (topDiff + this.top) + "px")
    {
    this.node.style['top'] = (topDiff + this.top) + "px";
    }
  }

generalMessageBox.prototype.set = function(node)
  {
  this.clear();
  this.displaying = true;
  this.node = document.createElement('div');
  this.node.appendChild(node);
  this.node.className = this.boxClass;
  this.node.style['top'] = (document.body.scrollTop + this.top) + "px";
  document.body.appendChild(this.node);
  if (this.forceView)
    {

    var docHeight = 0;
    var docWidth = 0;

    if (window.document.height != null)
      {
      docHeight = window.document.height;
      docWidth = window.document.width;
      }else if(docHeight == 0 && window.document.body.scrollHeight != null)
      {
      docHeight = window.document.body.scrollHeight;
      docWidth = window.document.body.scrollWidth;
      }else if (docHeight == 0 && window.document.documentElement.scrollHeight != null)
      {
      docHeight = window.document.documentElement.scrollHeight;
      docWidth = window.document.documentElement.scrollWidth;
      }

    this.forceViewNode = document.createElement('div');
    this.forceViewNode.className = this.forceViewClass;
    this.forceViewNode.style['height'] = docHeight+'px';
    this.forceViewNode.style['width'] = docWidth+'px';
    document.body.insertBefore(this.forceViewNode, document.body.childNodes[0]);
    }
  }

generalMessageBox.prototype.clear = function()
  {
  if (this.displaying == false)
    {
    return;
    }
  this.displaying = false;
  this.node.parentNode.removeChild(this.node);
  if (this.forceViewNode != null)
    {
    this.forceViewNode.parentNode.removeChild(this.forceViewNode);
    this.forceViewNode = null;
    }
  }
