/****************************************************************************
*	
*	Class:		CWindowFrame
*
*	Purpose:	Window Frame
*
*	Author:		Sky Stebnicki, sky.stebnicki@aereus.com
*				Copyright (c) 2006 Aereus Corporation. All rights reserved.
*
*****************************************************************************/
function CWindowFrame(label, width, padding, context)
{
	// WFOuter
	this.m_div = ALib.m_document.createElement("div");
	ALib.Dom.styleSetClass(this.m_div, "CWindowFrameOuter");
	if (width)
		ALib.Dom.styleSet(this.m_div, "width", width);
	
	if (label)
	{
		// WFLabel
		var lbl_div = ALib.m_document.createElement("div");
		ALib.Dom.styleSetClass(lbl_div, "CWindowFrameLabel");
		lbl_div.innerHTML = label;
		this.m_div.appendChild(lbl_div);
	}

	// Context content is displayed to the right of the label - commonly used for pagination
	var con_div = ALib.m_document.createElement("div");
	ALib.Dom.styleSetClass(con_div, "CWindowFrameContext");
	this.m_context_div = con_div;
	lbl_div.appendChild(con_div);
	if (context && lbl_div)
	{
		// WFLabel
		con_div.innerHTML = context;
	}
	
	// Content
	var cell_pad = (padding) ? padding : '3px';
	this.m_con_div = ALib.m_document.createElement("div");
	ALib.Dom.styleSetClass(this.m_con_div, "CWindowFrameContent");
	ALib.Dom.styleSet(this.m_con_div, "padding", cell_pad);
	this.m_div.appendChild(this.m_con_div);
}

CWindowFrame.prototype.getCon = function ()
{
	return this.m_con_div;
}

CWindowFrame.prototype.getContextCon = function ()
{
	return this.m_context_div;
}

CWindowFrame.prototype.getFrame = function()
{
	return this.m_div;
}

CWindowFrame.prototype.print = function(div_parent)
{
	if (div_parent)
		div_parent.appendChild(this.getFrame());
	else
		document.write(this.m_div.outerHTML);
}

