var Bollonzo = function(containerName, width, height, color,radius){

	this.canvasContainer = $(containerName);
	this.initCanvas(color);
	this.canvas.width = width;
	this.canvas.height = height;
	this.canvas.center = new Object();
	this.canvas.center.x = width*.5;
	this.canvas.center.y = height*.5;
	this.canvas.graphics.fillStyle = color;
	this.radius = radius;
	this.Tweener = getJSTweener();
};

Bollonzo.prototype.initCanvas = function(color){

	this.canvas = new Element('canvas').inject(this.canvasContainer);
	this.canvas.graphics = this.canvas.getContext('2d');
};

Bollonzo.prototype.draw = function(){

	this.canvas.graphics.clearRect(0, 0, this.canvas.width, this.canvas.height);
	this.canvas.graphics.beginPath();
	this.canvas.graphics.arc(this.canvas.center.x, this.canvas.center.y, this.radius, 0, Math.PI * 2, true);
	this.canvas.graphics.fill();
};

Bollonzo.prototype.animate = function(radius, time, callback){

	this.Tweener.addTween(this, {
		time: time,
		transition: 'easeInOutExpo',
		onComplete: function() {
			callback && callback();
		},
		onUpdate: this.draw.bind(this),
		radius: radius,
	}, true);

};
