
function CHtmlLeaf()
{
	CHtmlLeaf_Constructor(this);
}

function CHtmlLeaf_Constructor(_this )
{
	CLeaf_Constructor(_this);

	_this.m_bExpanded = false;
	_this.m_bEnabled = false;
	_this.m_bCanExpand = false;
	_this.m_bIsLoading = false;
	_this.m_sTitle = 'no title';

	_this.Draw = CHtmlLeaf_Draw;
	_this.SetColor = CHtmlLeaf_SetColor;
	_this.SetCheck = CHtmlLeaf_SetCheck;
}

function CHtmlLeaf_SetCheck(doc)
{
	if(doc && doc.getElementById("check"+this.m_nId))
		doc.getElementById("check"+this.m_nId).checked = this.m_bEnabled;
}

function CHtmlLeaf_SetColor(doc, sColor)
{
	if(doc && doc.getElementById("leaf"+this.m_nId))
		doc.getElementById("leaf"+this.m_nId).style.color = sColor;
}

function CHtmlLeaf_Draw(bLast, sTreeLine, nAdminId)
{
	if(this.m_bCanExpand) s = this.m_bExpanded?"minus":"plus";
	else	s = "blank";
	if(bLast) s += "l";
	s = "<img src='History/Tree/Images/"+s+".gif' border=0 align=left>";
	if(this.m_bCanExpand) s = "<a href= '' onclick='parent.OnExpand("+this.m_nId+
					"); return false;'>"+s+"</a>";
	s = "<tr><td nowrap>"+sTreeLine+s+"<img src='History/Tree/Images/Folder.gif' align=left>";

	if(this.m_bIsLoading) s += "&nbsp;Loading ..."; 
		else s += "&nbsp;<a id=leaf"+this.m_nId+" href='' onclick='parent.OnTitle("+
				this.m_nId+"); return false;'>"+this.m_sTitle+"</a>"+
				" <b class=rtwTreeNumber> ("+ this.m_nCount +") </b>";;
	return s+"</td></tr>";
}
