  /**
  * Function : __debug()
  * Arguments: The data - array,hash(associative array),object
  *    The level - OPTIONAL
  * Returns  : The textual representation of the array.
  * This function was inspired by the print_r function of PHP.
  * This will accept some data as the argument and return a
  * text that will be a more readable version of the
  * array/hash/object that is given.
  */
  function __debug(arr,showalert) {
    var ret = '';
    var level = 0;
    showalert = (showalert!='undefined')?showalert:true;
    if(!name) name = '';

    //The padding given at the beginning of the line.
    var level_padding = "";
    
    if(!showalert){
      ret+= '<div style="margin:0px 0px 5px 0px;background:#ffcccc;overflow:hidden;border:1px solid #000000;color:#444444;">'+"\n";
      ret+= '<div style="font-style:italic">DEBUG-Output(JS)</div>'+"\n";
      ret+= '<div style="font-weight:bold">'+name+'</div>'+"\n";
      ret+= '<pre>'+"\n";
    }
    for(var j=0;j<=level;j++) level_padding += "  ";
    if(typeof(arr) == 'object') { //Array/Hashes/Objects
     for(var item in arr) {
      var value = arr[item];
      if(typeof(value) == 'object') { //If it is an array,
       ret += level_padding + "" + item + " ... ";
       ret += dump(value,level+1);
       ret += "\n";
      } else {
       ret += level_padding + "" + item + " => " + value + "\n";
      }
     }
    } else { //Strings/Chars/Numbers etc.
     ret+= "===>"+arr+"<===("+typeof(arr)+")"+"\n";
    }
    if(!showalert){
      ret+= '</pre>'+"\n";
      ret+= '</div>'+"\n";
    }
    
    if(!showalert){
      document.write(ret);
    }else{
      alert(ret);
    }
    
    return true;
  }


function errorMessage(meldung, url, zeile){
   var txt = "Es ist ein Fehler aufgetreten!\n\n"
   txt += "Meldung: " + meldung + "\n"
   txt += "URL: " + url + "\n"
   txt += "Zeile: " + zeile
   alert(txt)
   return true
}
//window.onerror = errorMessage;