/* <script language="JavaScript" type="text/javascript">					  */
/*
	descr: create output window for debugging javascript
*/

/* debug window starts automatically */
function dbg(str)
{
	var b = document.getElementsByTagName("body").item(0);
	var d;

	window.g_dbg_lines = (window.g_dbg_lines == undefined) ? 1 : window.g_dbg_lines + 1;

	if (document.getElementById("dbg") == undefined)
	{
		d = document.createElement("div");
		d.id					= "dbg";
		d.style.position		= "absolute";
		d.style.right			= "5px";
		d.style.bottom			= "5px";
		d.style.width			= "250px";
		d.style.height			= "420px";
		d.style.padding			= "2px";
		d.style.borderWidth		= "1px";
		d.style.borderStyle		= "solid";
		d.style.borderColor		= "#ff8000";
		d.style.color			= "#000000";
		d.style.fontFamily		= "verdana";
		d.style.fontSize		= "9px";
		d.style.backgroundColor	= "#ffef00";
		d.style.textOverflow	= "clip";
		d.style.overflow		= "auto";
		b.appendChild(d);
		opacity_filter(d, 70);
	}
	else
	{
		d = document.getElementById("dbg");
	}
	
	d.innerHTML += window.g_dbg_lines + ": " + str + "<br/>";
}

/* xbrowser opacity styling */
function opacity_filter(obj, val)
{
	if (document.all)
		obj.style.filter	= "alpha(style=0, opacity=" + val + ")";
	else
		obj.style.opacity 		= (val / 100);
}
