var first = 0;var speed = 500;var pause = 4000;
$(document).ready(function(){interval = setInterval(removeFirst, pause);});
function removeFirst(){
	first = $('ul#listaNoticias li:last').html();
	clase = $('ul#listaNoticias li:last').attr('class');
	$('ul#listaNoticias li:last').remove();
	addLast(first, clase);}	
function addLast(first, clase){
	last = '<li class="'+clase+'">'+first+'</li>';
	$('ul#listaNoticias').prepend(last);
	$('ul#listaNoticias li:first').animate({opacity: 1}, speed).fadeIn('slow');}
//Funcion que muestra en la portada las mayores subidas/bajadas
function mostrarGraficos(grafico) {		
	var idsCapas= new Array('GraficoIbex35','GraficoDowJones','GraficoNikkei');		
	for (i=0; i<idsCapas.length; i++) {
		document.getElementById(idsCapas[i]).style.display = 'none';			
		document.getElementById('Pestanna'+idsCapas[i]).className = '';
	}	
	document.getElementById(grafico).style.display = 'block';										
	document.getElementById('Pestanna'+grafico).className = 'current';		
} // Fin mostrarMasLeidos

function mostrarNoticias(desde){
	var param = "DESDE=" + desde;
	$.ajax({url: '/obtenerVideos.phtml',
		type: 'POST',
		data: param,
		dataType: 'html',
		success: function(resultado){
			$('#jsparrilla').fadeOut('fast', function() {
				$('#jsparrilla').html(resultado).fadeIn('fast');
			});
		}
	});
}
