function Debug () {
  var output = document.getElementById('debug-output');
  if (output != 'undefined') {
    output.style.display = 'block';
    output.value = '** Debug started... **\n';
  } else {
		window.alert('No element with debug-output id found !');
  }//if
  
  if (typeof Debug.initialized == 'undefined') {
    Debug.prototype.write = function (s) {
      output.value += s;
    };//writeLn

    Debug.prototype.writeLn = function (s) {
      Debug.write(s);
      output.value += '\n';
    };//writeLn

    Debug.prototype.clear = function () {
      output.value = '';
    };//clear

    Debug.initialized = true;
  }//if
} //Debug
