function move(start,end){
	i = 0;
	$("#mensajes_empresas .aviso").each(function(){					
		if(i >= start && i < end){$(this).animate({ opacity: 'show' }, 'slow');}
		else{$(this).hide();}
		i++;
	});
	if(start == 0) {$("#mensajes_empresas #next").hide();}
	else $("#mensajes_empresas #next").show();
	if(end >= i) {$("#mensajes_empresas #back").hide();}
	else $("#mensajes_empresas #back").show();				 
}

$(document).ready(function(){

	n = 1;
	start = 0;
	end = start + n;
	move(start,end);

	$("#mensajes_empresas #next").click(function(){
		end = start;
		start -= n;				
		move(start,end);
	});
	$("#mensajes_empresas #back").click(function(){
		start = end;
		end += n;
		move(start,end);
	});				
	
	$("#slide").innerfade({ speed: 'slow', timeout: 4000, type: 'sequence', containerheight: '160px' }); 
});