var EOIR = EOIR ? EOIR : function()
{
	var obj = 
	{
	};
	
	return obj;
} ();

EOIR.MenuBtn = function (o)
{
	var divMenuBtn = document.createElement("div");
	if(o.className)
	{
		divMenuBtn.className = o.className;
	}
	if(o.text)
	{
		divMenuBtn.innerHTML = o.text;
	}
	if(o.id)
	{
		divMenuBtn.id = o.id;
	}

	this._element = divMenuBtn;
	this._enabled = (o.enabled == null);
	this._canBeEnabled = true;
	this._selected = false;

	if(this._enabled == false)
	{
		divMenuBtn.setAttribute("disabled", "disabled");
	}

	this.getEnabled = function()
	{
		return this._enabled;
	}

	this.setEnabled = function(b)
	{
		if(!b)
		{
	        divMenuBtn.setAttribute("disabled", "disabled");
	        this._enabled = b;
        }
		else
		{
		    if(this._canBeEnabled)
		    {
		        divMenuBtn.removeAttribute("disabled");
		        this._enabled = true;
            }
		}
	}

	this.setCanBeEnabled = function(b)
	{
	    this._canBeEnabled = b;
	    if(!b)
	    {
	        this.setEnabled(false);
	    }
	}

	this.getSelected = function()
	{
		return this._selected;
	}

	this.setSelected = function(bSelected)
	{
	    this._selected = bSelected;
		if(bSelected)
		{
			divMenuBtn.setAttribute("selected", "selected");
		}
		else
		{
			divMenuBtn.removeAttribute("selected");
		}
	}

	this.getElement = function()
	{
		return this._element;
	}
}

// This really returns an ImageButton (see imagebuttons.js)
EOIR.MenuBtn.createImageMenuBtn = function(el, fnOnClicked, strDefaultSrc, strRolloverSrc, strPressedSrc, strDisabledSrc, strPulsedSrc)
{
	return ImageButton.createImageButtonFromElement(el, fnOnClicked, strDefaultSrc, strRolloverSrc, strPressedSrc, strDisabledSrc, strPulsedSrc)
}

EOIR.MenuBtn.createMenuBtn = function(o)
{
	return new EOIR.MenuBtn(o);
}
