function trace (message)
{
	hasDebugBox = true;
	if (message == undefined) message = '';
	
	try
	{
		outputBox = document.getElementById('outputBox');
		outputBox.value += message + '\n';
		outputBox.style.display = 'block';
	}
	catch (e) { hasDebugBox = false; }
	
	if (!hasDebugBox)
	{
		var outputBox  = document.createElement('textarea');
		outputBox.id   = 'outputBox';
		
		outputBox.style.width      = '100%';
		outputBox.style.height     = '250px';
		outputBox.style.position   = 'absolute';
		outputBox.style.backgroundColor = 'black';
		outputBox.style.color      = 'white';
		outputBox.style.bottom     = '0';
		outputBox.style.left       = '0';
		
		document.body.appendChild(outputBox);
		// Chama a funcao recursivamente
		trace (message);
	}
}