/* =============================================================================
 * GRID UTILITITES
 * =============================================================================
 * version: 0.1
 * author: Hannes Kleindienst
 * requires: prototype, scriptaculous
 * =============================================================================
 */

/**
 * =============================================================================
 * CMS
 * =============================================================================
 */
var GridUtil = Class.create();
GridUtil.prototype = {

  /**
   * Constructor
   * 
   */
  initialize: function() {

    // define version
    this.version = '0.1';
    
    // log
    this.logger = new YAHOO.widget.LogReader(null, { 
      width: "400px", 
      height: "30em", 
      newestOnTop: true, 
      footerEnabled: false,
      draggable: true
    });
    this.logger.hide();

    // style initialisation
    this._initCSS();
    
  },

  /**
   * Initialise style definitions
   */  
  _initCSS: function() {

    // create log box
    //this.tLog.setStyle({background: '#ffffff', border: '1px solid black', opacity: 0.5, top: '50px', left: '50px', width: '200px', height: '200px'});

  },

  log: function (s) {
    //this.tLog.innerHTML += (s + "<br>");
    YAHOO.log(s);
  },
  
  showLog: function () {
    this.logger.show();
  },

  hideLog: function () {
    this.logger.hide();
  },


  getDomElement: function (id,type,hide) {
    // check, if DOM object exists
    var obj = $(id);
    if (!obj) {
      obj = $(document.createElement(type));
      obj.id = id;
      document.body.appendChild(obj);
    }
    if (hide) {
      obj.hide();    
    }
    return obj;
  },

  // =========================================================================
  // ABOUT METHODS
  // =========================================================================

  getVersion: function () {
    return this.version;
  }
  
};

