function Debug()
{
	this.className = 'Debug';
}

Debug.prototype.startDiv = function()
{
	divObj = document.createElement('div');
	divObj.style.position = 'absolute';
	divObj.style.zIndex = '5';
	divObj.style.top = '5px';
	divObj.style.left = '5px';
	divObj.style.width = '700px';
	divObj.style.height = '400px';
	divObj.style.border = '2px solid #FF0033';
	divObj.style.backgroundColor = '#DEDEDE';
	divObj.style.display = '';
	divObj.style.overflow = "auto";
	divObj.style.fontFamily = 'Verdana';
	divObj.style.fontSize = '10px';
	divObj.setAttribute('id', 'debugDiv');
	
	body = document.getElementsByTagName('body')[0];
	body.appendChild(divObj);
	
	this.divObjId = 'debugDiv';
}

Debug.prototype.debugMessage = function(message)
{
	this.startDiv();
	divObj = document.getElementById(this.divObjId);
	divObj.innerHTML = message;
}

Debug.prototype.debugObjectById = function(objId)
{
	obj = document.getElementById(objId);
	this.debugObject(obj);
}

Debug.prototype.debugObject = function(obj)
{
	this.startDiv();
	divObj = document.getElementById(this.divObjId);	
	str = '';
	
	for (i in obj)
	{
		try
		{
			str += '<b>'+obj+'['+i+']</b> = '+obj[i]+'<br />';
		}
		catch(e)
		{
		}
	}
	
	divObj.innerHTML = str;
}

var oDebug = new Debug();