var bgColor = "#111144";
var fgColor = "#F3F3FF";
var frameCount = 50;

function FadeButton(obj) {
	this.obj = obj;
	this.animator = new Animation(this.obj);
	
	this.init = function () {
		this.animator.setAttribute("backgroundColor", bgColor);
		this.animator.setAttribute("color", fgColor);
		
		var thisObj = this;
		this.obj.onmouseover = function () { thisObj.mouseover(); };
		this.obj.onmouseout = function () { thisObj.mouseout(); };
	}
	
	this.mouseover = function () {
		this.animator.setMovement("backgroundColor", fgColor, frameCount);
		this.animator.setMovement("color", bgColor, frameCount);
		this.animator.start();
	}
	
	this.mouseout = function () {
		this.animator.setMovement("backgroundColor", bgColor, frameCount);
		this.animator.setMovement("color", fgColor, frameCount);
		this.animator.start();
	}
	
	this.init();
}
