var f = 1;
var mfa = 0;
var mfs = 0;
function fotoAnterior() {
	if (mfs == 0) {
		mfa++;
		actual = (actual + 1) % cant;
		var foto = $('#foto' + actual);
		foto.animate({
			left: ((f>0)?'+=150':'-=150')
		}, 200, function() {
			foto.css('z-index', foto.css('z-index') + cant);
			foto.animate({
				left: '0'
			}, 200, function() {
				mfa--;
			});
		});
		f *= -1;
	}
}
function fotoSiguiente() {
	if (mfa == 0) {
		mfs++;
		var foto = $('#foto' + actual);
		foto.animate({
			left: ((f>0)?'+=150':'-=150')
		}, 200, function() {
			for(i=0; i<cant; i++) {
				$('#foto' + i).css('z-index', $('#foto' + i).css('z-index') + 1);
			}
			foto.css('z-index', 0);
			foto.animate({
				left: '0'
			}, 200, function() {
				mfs--;
			});
		});
		actual = (actual + (cant-1)) % cant;
		f *= -1;
	}
}
function fotoAnteriorHover()
{
	$('#fotoAnteriorOut').hide();
	$('#fotoAnteriorHover').show();
}
function fotoAnteriorOut()
{
	$('#fotoAnteriorHover').hide();
	$('#fotoAnteriorOut').show();
}
function fotoSiguienteHover()
{
	$('#fotoSiguienteOut').hide();
	$('#fotoSiguienteHover').show();
}
function fotoSiguienteOut()
{
	$('#fotoSiguienteHover').hide();
	$('#fotoSiguienteOut').show();
}
