/*
 * Console
 *
 * Copyright (c) 2010 Boris Dinkevich (dinkevich.com)
 * Licensed under the GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2010-01-01 10:10:01 -0200 (Fri, 01 Jan 2010) $
 * $Rev: 0001 $
 */

var Console = function() {
  return {
    object: null,
    data: '',
    lines: 0,

    init: function()
    {
      this.object = $('#console');
    },

    clear: function() 
    {
      this.data = '';
      this.lines = 0;
    },

    add: function(message)
    {
      this.lines += 1;
      if (this.lines < 30)
        this.data += message + '<br/>';
    },

    show: function()
    {
      this.object.html(this.data);
    }
  } 
}();



