	
	function Button (sId, sName, sAction, bActiveMemory) {
		
		this.id = sId;
		this.name = sName;
		this.action = sAction;
		this.activeMemory = bActiveMemory;
		this.active = false;
		this.borderColorDefault = '003C74';
		this.borderColorMouseOver = '7777ff';
		
		OnLoadObject (this);
		
	}
	
	
	Button.prototype.init = function () {
		
		this.iconBorderElem = document.getElementById ('buttonIconBorder' + this.id);
		this.boxOutsideElem = document.getElementById ('buttonBoxOutsideBorder' + this.id);
		this.boxElem = document.getElementById ('buttonBox' + this.id);
		this.iconImageElem = document.getElementById ('buttonIconImage' + this.id);
	}
	
	
	Button.prototype.mouseOver = function () {
		this.boxElem.style.border = '1px solid #' + this.borderColorMouseOver;
		
	}
	
	
	Button.prototype.mouseOut = function () {
		
		this.boxElem.style.border = '1px solid #' + this.borderColorDefault;
		this.defaultState ();
		
	}
	
	
	Button.prototype.mouseDown = function () {
		
		this.boxOutsideElem.style.filter = 'progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr="#E4E4FF", EndColorStr="#ffffff")';
		
	}
	
	
	Button.prototype.mouseUp = function () {
		
		if (this.activeMemory) {
			
			if (this.active)
				this.active = false;
			else
				this.active = true;
			
		}

		this.defaultState ();
		
	}
	
	
	Button.prototype.defaultState = function () {
		
		if (this.active) {
			this.boxOutsideElem.style.filter = 'progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr="#CCCCFF", EndColorStr="#ffffff")';
		} else {
			this.boxOutsideElem.style.filter = 'progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr="#ffffff", EndColorStr="#E4E4FF")';
		}
		
	}
	
	
	
	Button.prototype.executeAction = function () {
		
		eval (this.action);
		
	}
