//
// debug.js -- Common JavaScript Debugging Functions
//
// by Ian Flanigan
// (C) 2001, All rights reserved.
//

// Dump Properties
function dumpProps(o)
{
  var s = "";
  for (p in o)
    {
      if (p.substr(0,2) == 'on')
	continue;

      var v;

      try
	{
	  v = o[p];
	  if (v instanceof Function)
	    continue;

	  if (v == '')
	    continue;
	}
      catch (e)
	{
	  v = "*ERROR("+e.message+")*";
	};

      v = escapeHTML(v + "");
      //      if (v.length > 120)
      //	v = v.substr(0,120)+"...";

      s += p + " = " + v + "\n";
    }
  return s;
}

// Dump to stderr
function debug(s)
{
  dump(s);
}

// Dump to stderr with predjudice
function warn(s)
{
  debug("**WARNING**: "+s+"\n");
}

