function log(s)
{
  if (window.console != undefined && window.console.log != undefined)
    window.console.log(s);
}

function dump(obj, maxdepth, showFunctions)
{
  var str = "";
  
  if (maxdepth != undefined)
  {
    maxdepth--;
    if (maxdepth < 0) return str;
  }
  for (var i in obj)
  {
    if (typeof(obj[i]) == "function")
    {
      if (!showFunctions) continue;
      continue;
      str += i+"(), ";
    }
    else
    {
      var o = obj[i];
      if (typeof(o) == "object")
        str += " ["+i+"] " + dump(o,maxdepth) + " ~["+i+"] ";
      else
        str += i+": "+o+", ";
    }
  }
  return str;
}

