function logging (output_obj) {
  // Objects of this Class will produce a logging output to the output_obj given as argument
  // This Class depends on the prototype Framework
  
  this.output_obj = (output_obj && Object.isString(output_obj))?$(output_obj):output_obj;
  this.max_log_rows = 25
  this.line_nr = 0
  
  this.write = function(s) {
    var now = new Date()
    var std = now.getHours()
    var min = now.getMinutes()
    var sec = now.getSeconds()
    var msec = now.getMilliseconds()
    
    var logmessage = (this.line_nr<10?'0'+this.line_nr:this.line_nr)+': '+(std<10?'0'+std:std)+':'+(min<10?'0'+min:min)+':'+(sec<10?'0'+sec:sec)+':'+(msec<10?'00'+msec:(msec<100?'0'+msec:msec))+'# '+s
    this.line_nr++
    var e = new Element('p', {'class':'logging-line'}).update(logmessage)
    if (this.output_obj.childElements().length >= this.max_log_rows) {
      this.output_obj.update()
    }
    this.output_obj.appendChild(e)
  };
  
}
