var FooterManager=new Class({
	opt:{
		footer:null,
		content:null,
		enj:0
	},
	initialize:function(f,p){
		this.opt.footer=$(f);
		this.opt.content=$(p);
		this.addListener();
		this.updateFooter();
	}
})
FooterManager.prototype.addListener=function()
{
	window.addEvent('resize',this.updateFooter.bind(this));
	window.addEvent('updating',this.startEnjine.bind(this));
	window.addEvent('updated',this.stopEnjine.bind(this));
}
FooterManager.prototype.updateFooter=function()
{
	var newY=this.opt.content.getSize().y;
	if((window.innerHeight-this.opt.footer.getSize().y)>newY){
		newY=window.innerHeight-this.opt.footer.getSize().y;
	}
	this.opt.footer.setStyles({
		'top':(newY+'px'),
		'position': 'absolute'
	});
}

FooterManager.prototype.startEnjine=function()
{
	this.opt.enj=this.updateFooter.periodical(10, this);
	this.updateFooter();
}
FooterManager.prototype.stopEnjine=function()
{
	this.opt.enj = $clear(this.opt.enj);
}

