function CButton(title, funct, args, scheme, width, mouseover, mouseout)
{
	scheme = (scheme) ? scheme : 'b1';

	switch (scheme)
	{
	case 'b1-pill-l':
		this.m_scheme = "b1";
		this.m_subscheme = scheme;
		break;
	case 'b1-pill-c':
		this.m_scheme = "b1";
		this.m_subscheme = scheme;
		break;
	case 'b1-pill-r':
		this.m_scheme = "b1";
		this.m_subscheme = scheme;
		break;
	default:
		this.m_scheme = scheme;
	}

	/*
	this.m_main = ALib.m_document.createElement("div");
	ALib.Dom.styleSet(this.m_main, "display", "inline-block");
	*/

	/*
	this.m_main = ALib.m_document.createElement("div");
	ALib.Dom.styleSet(this.m_main, "display", "inline-block");
	*/

	/*
	this.m_main = ALib.m_document.createElement("button");
	ALib.Dom.styleSet(this.m_main, "padding", "0px");
	ALib.Dom.styleSet(this.m_main, "margin", "0px");
	ALib.Dom.styleSet(this.m_main, "background-color", "transparent");
	ALib.Dom.styleSet(this.m_main, "border-style", "none");
	*/

	/*
	this.m_main = ALib.m_document.createElement("span");
	if (ALib.Dom.m_binfo.nav)
		ALib.Dom.styleSet(this.m_main, "display", "-moz-inline-stack");
	else 
		ALib.Dom.styleSet(this.m_main, "display", "inline-block");
	*/

	/*
	this.m_main = ALib.m_document.createElement("button");
	this.m_main.setAttribute("type","button");
	ALib.Dom.styleSetClass(this.m_main, "CButton-".this.m_scheme);
	ALib.Dom.styleSet(this.m_main, "padding", "0");
	if (ALib.Dom.m_binfo.gecko)
		ALib.Dom.styleSet(this.m_main, "margin", "0 -3px -5px -3px");
	else
		ALib.Dom.styleSet(this.m_main, "margin", "0");
	ALib.Dom.styleSet(this.m_main, "background-color", "transparent");
	ALib.Dom.styleSet(this.m_main, "border-width", "0");
	ALib.Dom.styleSet(this.m_main, "overflow", "visible");
	ALib.Dom.styleSet(this.m_main, "text-decoration", "none");
	ALib.Dom.styleSet(this.m_main, "display", "inline-block");
	*/

	/*
	var table = ALib.m_document.createElement("table");
	ALib.Dom.styleSet(table, "display", "inline-table");
	this.m_main.appendChild(table);
	ALib.Dom.styleSetClass(table, "CButton_" + scheme);
	table.setAttribute("cellpadding","0");
	table.cellPadding = "0";	
	table.setAttribute("cellspacing","0");
	table.cellSpacing = "0";
	var tbody = ALib.m_document.createElement("tbody");
	table.appendChild(tbody);
	
	// Top of button
	var tr = ALib.m_document.createElement("tr");
	this.m_tl = ALib.m_document.createElement("td");
	tr.appendChild(this.m_tl);
	this.m_tc = ALib.m_document.createElement("td");
	tr.appendChild(this.m_tc);
	this.m_tr = ALib.m_document.createElement("td");
	tr.appendChild(this.m_tr);
	tbody.appendChild(tr);

	// Button Body
	var tr = ALib.m_document.createElement("tr");
	this.m_l = ALib.m_document.createElement("td");
	tr.appendChild(this.m_l);
	this.m_c = ALib.m_document.createElement("td");
	this.m_c.innerHTML = title;
	tr.appendChild(this.m_c);
	this.m_r = ALib.m_document.createElement("td");
	tr.appendChild(this.m_r);
	tbody.appendChild(tr);

	// Bottom Row
	var tr = ALib.m_document.createElement("tr");
	this.m_bl = ALib.m_document.createElement("td");
	tr.appendChild(this.m_bl);
	this.m_bc = ALib.m_document.createElement("td");
	tr.appendChild(this.m_bc);
	this.m_br = ALib.m_document.createElement("td");
	tr.appendChild(this.m_br);
	tbody.appendChild(tr);
	*/

	this.m_main = ALib.m_document.createElement("button");
	this.m_main.setAttribute("type","button");
	ALib.Dom.styleSetClass(this.m_main, "CButton");
	ALib.Dom.styleAddClass(this.m_main, this.m_scheme);
	if (this.m_subscheme)
		ALib.Dom.styleAddClass(this.m_main, this.m_subscheme);
	/* Immediately below is a temporary hack to serve the 
	following margin values only to Gecko browsers
	Gecko browsers add an extra 3px of left/right 
	padding to button elements which can't be overriden.
	Thus, we use -3px of left/right margin to overcome this. */
	//if (ALib.Dom.m_binfo.gecko)
		//ALib.Dom.styleSet(this.m_main, "margin", "0 -3px");

	var table = ALib.Dom.createElement("span", this.m_main);
	var lbl = ALib.Dom.createElement("span", table);
	lbl.innerHTML = title;

	// Set actions for button
	this.m_main.m_btnh = this;
	this.m_main.onmouseover = function ()
	{
		this.m_btnh.changeState("over");
	}
	this.m_main.onmouseout = function ()
	{
		this.m_btnh.changeState("out");
	}
	this.m_main.m_funct = funct;
	this.m_main.m_args = args;
	this.m_main.onclick = function ()
	{
		if (typeof this.m_funct == "string")
			eval(this.m_funct);
		else
		{
			if (this.m_args)
			{
				switch(this.m_args.length)
				{
				case 1:
					this.m_funct(this.m_args[0]);
					break;
				case 2:
					this.m_funct(this.m_args[0], this.m_args[1]);
					break;
				case 3:
					this.m_funct(this.m_args[0], this.m_args[1], this.m_args[2]);
					break;
				case 4:
					this.m_funct(this.m_args[0], this.m_args[1], this.m_args[2], this.m_args[3]);
					break;
				case 5:
					this.m_funct(this.m_args[0], this.m_args[1], this.m_args[2], this.m_args[3], this.m_args[4]);
					break;
				case 6:
					this.m_funct(this.m_args[0], this.m_args[1], this.m_args[2], this.m_args[3], this.m_args[4], this.m_args[5]);
					break;
				default:
					alert("Too many arguments");
					break;
				}
			}
			else
				this.m_funct();
		}
	}

	/* Set actions for div
	this.m_c.onmouseover = function ()
	{
		this.m_btnh.changeState("over");
	}
	
	this.m_c.onmouseout = function ()
	{
		this.m_btnh.changeState("out");
	}
	this.m_c.m_funct = funct;
	this.m_c.m_args = args;
	this.m_c.onclick = function ()
	{
		if (typeof this.m_funct == "string")
			eval(this.m_funct);
		else
		{
			if (this.m_args)
			{
				switch(this.m_args.length)
			{
				case 1:
					this.m_funct(this.m_args[0]);
					break;
				case 2:
					this.m_funct(this.m_args[0], this.m_args[1]);
					break;
				case 3:
					this.m_funct(this.m_args[0], this.m_args[1], this.m_args[2]);
					break;
				case 4:
					this.m_funct(this.m_args[0], this.m_args[1], this.m_args[2], this.m_args[3]);
					break;
				}
			}
			else
				this.m_funct();
		}
	}
	*/

	this.m_table = table;
	
	this.changeState("out");
}

CButton.prototype.changeState = function (state)
{
	/*
	switch (state)
	{
	case 'over':
		ALib.Dom.styleSetClass(this.m_tl, "CButtonTopLeft_"+this.m_scheme+"Over");
		ALib.Dom.styleSetClass(this.m_tc, "CButtonTopCenter_"+this.m_scheme+"Over");
		ALib.Dom.styleSetClass(this.m_tr, "CButtonTopRight_"+this.m_scheme+"Over");
		ALib.Dom.styleSetClass(this.m_l, "CButtonBodyLeft_"+this.m_scheme+"Over");
		ALib.Dom.styleSetClass(this.m_c, "CButtonBody_"+this.m_scheme+"Over");
		ALib.Dom.styleSetClass(this.m_r, "CButtonBodyRight_"+this.m_scheme+"Over");
		ALib.Dom.styleSetClass(this.m_bl, "CButtonBottomLeft_"+this.m_scheme+"Over");
		ALib.Dom.styleSetClass(this.m_bc, "CButtonBottomCenter_"+this.m_scheme+"Over");
		ALib.Dom.styleSetClass(this.m_br, "CButtonBottomRight_"+this.m_scheme+"Over");	
		break;
	case 'out':
		ALib.Dom.styleSetClass(this.m_tl, "CButtonTopLeft_"+this.m_scheme);
		ALib.Dom.styleSetClass(this.m_tc, "CButtonTopCenter_"+this.m_scheme);
		ALib.Dom.styleSetClass(this.m_tr, "CButtonTopRight_"+this.m_scheme);
		ALib.Dom.styleSetClass(this.m_l, "CButtonBodyLeft_"+this.m_scheme);
		ALib.Dom.styleSetClass(this.m_c, "CButtonBody_"+this.m_scheme);
		ALib.Dom.styleSetClass(this.m_r, "CButtonBodyRight_"+this.m_scheme);
		ALib.Dom.styleSetClass(this.m_bl, "CButtonBottomLeft_"+this.m_scheme);
		ALib.Dom.styleSetClass(this.m_bc, "CButtonBottomCenter_"+this.m_scheme);
		ALib.Dom.styleSetClass(this.m_br, "CButtonBottomRight_"+this.m_scheme);
		break;
	}
	*/
}

CButton.prototype.disable = function()
{
	this.m_main.disabled = true;
	ALib.Dom.styleRemoveClass(this.m_main, this.m_scheme);
}
CButton.prototype.enable= function()
{
	this.m_main.disabled = false;
}

CButton.prototype.getButton = function ()
{
	return this.m_main;
}

CButton.prototype.print = function(con)
{
	con.appendChild(this.m_main);
}

CButton.prototype.getTable = function ()
{
	return this.m_table;
}
