AjaxProgress = function(obj) {
	this.init(obj);
}

AjaxProgress.prototype = {
	obj: null,
	animator: null,
	
	init: function(obj) {
		this.obj = obj;
		this.animator = (jQuery)(document.createElement('div'))
							.addClass('ajax-progress');
		this.obj.before(this.animator);
		var that = this;
		obj[0].showProgress = function(){
			that.start();
		}
		obj[0].hideProgress = function(){
			that.hide();
		}
	},
	
	_calcMargin: function() {
		return 0;
	},
	
	_calcWidth: function() {
		return this.obj.outerWidth();
	},
	
	_calcHeight: function() {
		return this.obj.outerHeight();
	},
	
	_initGUI: function() {
		this.animator.css({
			  	'margin': this._calcMargin(),
				'width': this._calcWidth(),
				'height': this._calcHeight()
			  });
	},
	
	start: function() {
		this._initGUI();
		this.animator.show();
	},
	
	hide: function() {
		this.animator.hide();
	}
	
}
