
/**
*Classe qui gere le debug d'une application
*
*/
function CDebug ( divDebugName, state )
{
	this.divDebugName = divDebugName;	
	this.state = state;
	this.objDiv = null;
	this.collapse = 0;
	this.Init();
}	


CDebug.prototype.Init = function ()
{
	this.objDiv = document.getElementById ( this.divDebugName );
	this.SetState ( this.state );
}

CDebug.prototype.SetState = function ( state )
{
	this.state = state;
	if ( this.state == 1 )
	{
		this.objDiv.style.display = 'block';
	}
	else
		this.objDiv.style.display = 'none';
}

CDebug.prototype.Push = function ( trace )
{
	
	if ( this.state == 1 )
	{
		var inner = this.objDiv.innerHTML + ""+ trace+"<br/>";
		this.objDiv.innerHTML = inner;
		
	}
}

CDebug.prototype.Clear = function ()
{
	this.objDiv.innerHTML = "Onglet de debugage<br/><br/>";
}
	
CDebug.prototype.ExpandCollapse = function ()
{
if(this.collapse==0)
{
	this.objDiv.style.height = "20px";
	this.collapse = 1;
	}
	else
	{
	this.objDiv.style.height = "250px";
	this.collapse = 0;
	}
}
	

//document.body.write("<div id=\"divDebug\" class=\"divDebug\" onclick=\"objDebug.ExpandCollapse();\" >Onglet de debugage<br/><br/></div>");


