var footerN = 0;
var footerW = 305;

$(document).ready(function() {

	var n = $('#footerMask > ul > li').length;
	var footer = $('#footerMask > ul').get(0);
	
	footer.style.marginLeft = 0;
	footer.style.width = n*footerW + 'px';
	
	document.getElementById('footerSliderLeft').onclick = function() {
		scrollFooter(-1)
	}
	
	document.getElementById('footerSliderRight').onclick = function() {
		scrollFooter(1)
	}
	
	$('#header ul li a.mask').each(function(k, el) {
		el.style.width = el.parentNode.offsetWidth + 'px';
		el.style.height = el.parentNode.offsetHeight + 'px';
	})

});

function scrollFooter(where) {
	var dts = $('#footerMask > ul > li');
	var ultimo = dts.length - 3;
	
	footerN += where;

	if(footerN < 0)
		footerN = 0;
		
	if(footerN > ultimo)
		footerN = ultimo;	
	
	$('#footerMask > ul').animate({
		'margin-left': (-footerW*footerN) + 'px'
	});

}
