function Debugueador(contenedor)
{
	this.contenedor=null;
	this.cabecera=null;
		this.boton_tam=null;
		this.boton_clear=null;
		this.boton_trans_mas=null;
		this.boton_trans_menos=null;
	this.cuerpo=null;
	this.trans=50;

	var aquello=this;

	this.montar_elemento=function()
	{
		aquello.contenedor=document.createElement('div');
		aquello.contenedor.style.position='fixed';
		aquello.contenedor.style.width='250px';
		aquello.contenedor.style.height='200px';
		aquello.contenedor.style.top='200px';
		aquello.contenedor.style.left='20px';
		aquello.contenedor.style.border='1px black solid';
		aquello.contenedor.style.backgroundColor='#FFFFFF';
		aquello.contenedor.style.textAlign='left';
		aquello.contenedor.style.fontSize='0.8em';																			

		aquello.cabecera=document.createElement('div');
		aquello.cabecera.style.height='20px';
		aquello.cabecera.style.textAlign='right';
		aquello.cabecera.style.border='1px black solid';		
	
			aquello.boton_clear=document.createElement('span');
			aquello.boton_clear.style.border='1px black solid';
			aquello.boton_clear.style.padding='1px';
			aquello.boton_clear.style.fontSize='0.7em';
			aquello.boton_clear.style.marginRight='2px';
			aquello.boton_clear.style.backgroundColor='#2266FF';
			aquello.boton_clear.style.cursor='pointer';
			aquello.boton_clear.innerHTML='Clear';			

			aquello.boton_clear.onclick=function ()
			{
				if(aquello.cuerpo.hasChildNodes)
				{
					while(aquello.cuerpo.hasChildNodes)
					{
						aquello.cuerpo.removeChild(aquello.cuerpo.childNodes[0]);
					}

				}
			}

			aquello.boton_tam=document.createElement('span');
			aquello.boton_tam.style.border='1px black solid';
			aquello.boton_tam.style.padding='1px';
			aquello.boton_tam.style.fontSize='0.7em';
			aquello.boton_tam.style.marginRight='2px';
			aquello.boton_tam.style.backgroundColor='#2266FF';
			aquello.boton_tam.style.cursor='pointer';
			aquello.boton_tam.innerHTML='Minimizar';			

			aquello.boton_tam.onclick=function (){aquello.minimizar();}

			aquello.boton_trans_menos=document.createElement('span');
			aquello.boton_trans_menos.style.border='1px black solid';
			aquello.boton_trans_menos.style.padding='1px';
			aquello.boton_trans_menos.style.fontSize='0.7em';
			aquello.boton_trans_menos.style.marginRight='2px';
			aquello.boton_trans_menos.style.backgroundColor='#2266FF';
			aquello.boton_trans_menos.style.cursor='pointer';
			aquello.boton_trans_menos.innerHTML='-';			
			aquello.boton_trans_menos.onclick=function(){aquello.transparencia(-10);}		

			aquello.boton_trans_mas=document.createElement('span');
			aquello.boton_trans_mas.style.border='1px black solid';
			aquello.boton_trans_mas.style.padding='1px';
			aquello.boton_trans_mas.style.fontSize='0.7em';
			aquello.boton_trans_mas.style.marginRight='2px';
			aquello.boton_trans_mas.style.backgroundColor='#2266FF';
			aquello.boton_trans_mas.style.cursor='pointer';
			aquello.boton_trans_mas.innerHTML='+';			
			aquello.boton_trans_mas.onclick=function (){aquello.transparencia(10);}		

		aquello.cuerpo=document.createElement('div');
		aquello.cuerpo.style.height='180px';
		aquello.cuerpo.style.overflowY='scroll';

		aquello.contenedor.appendChild(aquello.cabecera);

		aquello.cabecera.appendChild(aquello.boton_clear);
		aquello.cabecera.appendChild(aquello.boton_tam);
		aquello.cabecera.appendChild(aquello.boton_trans_menos);
		aquello.cabecera.appendChild(aquello.boton_trans_mas);
		aquello.contenedor.appendChild(aquello.cuerpo);
		contenedor.appendChild(aquello.contenedor);
	}

	this.transparencia=function(valor)
	{
		aquello.trans=aquello.trans+valor;

		if(aquello.trans<10) {aquello.trans=10;}
		else if(aquello.trans>100) {aquello.trans=100;}

		if(aquello.contenedor.innerText)
		{
			//aquello.contenedor.filters.alpha.opacity=aquello.trans
		}
		else
		{
			aquello.contenedor.style.opacity=aquello.trans/100;
		}	
	}

	this.minimizar=function()
	{
		aquello.cuerpo.style.display='none';
		aquello.contenedor.style.height='20px';
		aquello.boton_tam.innerHTML='Maximizar';			
		aquello.boton_tam.onclick=function (){aquello.maximizar();}		
	}

	this.maximizar=function()
	{
		aquello.cuerpo.style.display='block';
		aquello.contenedor.style.height='200px';
		aquello.boton_tam.innerHTML='Minimizar';			
		aquello.boton_tam.onclick=function (){aquello.minimizar();}
	}

	this.debug=function(texto)
	{
		var temp=document.createElement('div');
		temp.innerHTML=texto;
		aquello.cuerpo.appendChild(temp);
	}

	this.montar_elemento();
	this.transparencia(0);
}
