function Footer() {
	this.obj = $('#footer').get(0);
	this.labelObj = $('.label',this.obj).get(0);
	this.labelObj.innerHTML = "";
	
	this.fit = function() {
		var newWidth = $(window).width();
		var newTop = $(window).height()-$(this.obj).outerHeight();
		$(this.obj).css('width',newWidth).css('top',newTop);
		this.reloadLabel();
	}
	
	this.getLastLabel = function() {
		return $('.label > div:not(.removing,.spacer):last').get(0);
	}
	
	this.removeLastLabel = function() {
		$lastLabel = $('.label > div:not(.removing,.spacer):last').addClass('removing');
		$lastLabel.prev('.spacer').andSelf().stop().animate({opacity:0},300,"easeOutQuad",function(){$(this).remove();});
	}
	
	this.addLabel = function(txt,id) {
		if ($('div > div',this.labelObj).length > 0) Cufon($('<div class="spacer">/</div>').css('opacity',0).appendTo(this.labelObj).animate({'opacity':1},300,"easeOutQuad").get(0));
		$newLabel = $('<div><div>'+txt+'</div></div>').appendTo(this.labelObj).children('div').css('opacity',0).css('top',-100);
		Cufon($newLabel.get(0),cufonOptions);
		$newLabel.attr('idLink',id);
		$newLabel.bind('click',function(){
			window.location.hash = '/' + project.language + '/' + $(this).attr('idLink') + '/';
		});
		$newLabel.css('left',-$newLabel.width()).css('top',0).css('opacity',1).animate({'left':0},300,"easeOutQuad").attr('origText',txt);
	}
	
	this.changeLabel = function(obj,txt,id) {
		$childDiv = $(obj).children('div').css('top',-100).html(txt).attr('idLink',id).attr('origText',txt);
		Cufon($childDiv,cufonOptions);
		$childDiv.css('left',-$childDiv.width()).css('top',0).css('opacity',1).animate({'left':0},300,"easeOutQuad");
	}
	
	this.setLabels = function(labels) {
		$allLabels = $('.label > div:not(.removing,.spacer)');
		var j = $allLabels.length;
		for (i=0; i<labels.length; i++) {
			if (i<j) {
				var $label = $allLabels.eq(i);
				if ($label.children('div').attr('origText')!=labels[i].text) {
					this.changeLabel($label,labels[i].text,labels[i].id);
				}
			} else {
				this.addLabel(labels[i].text,labels[i].id);
			}
		}
		for (i=labels.length; i<j; i++) {
			this.removeLastLabel();
		}
		this.reloadLabel();
	}
	
	this.reloadLabel = function() {	
		var labelsWidth = 0;
		var spacersWidth = ($('.label > div:not(.removing)').each(function(){labelsWidth+=$(this).outerWidth();}).length - 1);
		
		var newLeft = ($(this.obj).width() - labelsWidth) / 2;
		$(this.labelObj).stop().animate({left:newLeft},400,"easeOutExpo");
	}
	
	this.refreshLangButton = function(state) {
		var langButton = $('.language',this.obj).get(0);
		langButton.href = langButton.rel + '?anchor=' + state;
	}
}