function to_html(obj) {
	var str = obj.toString();

	//make HTML display properly
	str = str.replace(/"/g, "&quot;");
	str = str.replace(/</g, "&lt;");
	str = str.replace(/>/g, "&gt;");
	str = str.replace(/\n/g, "<br>");

	//make functions look nicer
	if (str.match(/.*function.*\(.*\).*/)) {
		str = '<pre>' + str + '</pre>';
	}
	str = str.replace(/\t/gi, "  ");

	return str;
}

function describe(variable) {
	var win, msg;
	win = window.open();
	win.document.open();

/* - Don't know how to make this work
	msg = "";
	for (prop in variable) {
		msg = msg
			+ '\n<a href="#' + prop + '">' + prop + '</a> | ';
	}
	msg = msg.replace(/ \| $/, "");
	win.document.write('<center><font size="-1">');
	win.document.write(msg);
	win.document.write('</center></font>');
	win.document.write('<br><br>');
*/

	msg = "";
	for(prop in variable) {
		msg = msg
			+ '\n<tr>'
			+ '\n\t<td>'
			+ '\n\t\t<a name="' + prop + '"></a>'
			+ '\n\t\t' + prop
			+ '\n\t</td><td>'
			+ '\n\t\t' + to_html(eval(variable)[prop])
			+ '\n\t</td>'
			+ '\n</tr>';
	}
	win.document.write('<table border="1">');
	win.document.write(msg)
	win.document.write('</table>');

	win.document.close();
}
