// JavaScript Document

// função de debug
function debuger(){
	this.DIVdebug = document.createElement("DIV");
	this.DIVdebug.setAttribute('id',"debugframe");	
	// insere o DIVdebug no incio do corpo do documento
	var targetElement = document.body.firstChild;
	var parent = targetElement.parentNode;
///	if (parent.lastChild == targetElement) {
//		parent.appendChild(this.DIVdebug);
//	} else {
		parent.insertBefore(this.DIVdebug,targetElement);
//	}
//	this.DIVdebug.setAttribute('style',"position:absolute; left:400px; top:100px; width:340px; height:200px; z-index:1000; border: 1px solid #F66; padding: 5px; font-size: 9px; font-family:Arial; background-color:#FFF;");

	this.DIVdebug.innerHTML = "\n [Quadro de debug]<br>\n ";
	this.DIVdebug.style.position = 'absolute';
	this.DIVdebug.style.left = '1%';	
	this.DIVdebug.style.top = '0px';	
	this.DIVdebug.style.width = '340px';	

	this.DIVdebug.style.float = 'left';	
	this.DIVdebug.style.zIndex = '1000';	
	this.DIVdebug.style.border = '1px solid #F66';	
	this.DIVdebug.style.padding = '5px';		
	this.DIVdebug.style.fontSize = '10px';		
	this.DIVdebug.style.fontFamily = 'Arial';		
	this.DIVdebug.style.backgroundColor = '#FFF';
	this.DIVdebug.style.display = 'none';

	this.show = function(conteudo) {
		this.DIVdebug.innerHTML += conteudo+"<br>\n";
		this.DIVdebug.style.display = 'block';		
	}
	this.show('');
}

//var debug = new debuger();