/*************************************************************
Javascript para el carrusel
**************************************************************/
enlace_activo = 0
function hacerScroll(elemento) {
  hCarousel.scrollTo(elemento); 
  return false;
}  
      
Event.observe(window, "load", function() {        
  if($('destacados_portada')) {
    hCarousel = new UI.Carousel('destacados_portada');  
    if(hCarousel.elements.length > 1)
      doTimer();     
  }
});

//Ahora ponemos el codigo para que el carrusel se ejecute cada 5 segundos
var c=0;
var t;
var timer_is_on=0;


function timedCount() { 
  var index = hCarousel.currentIndex();
  index++;
  hCarousel.scrollTo(index);
  t=setTimeout("timedCount()",5000);
}

function doTimer()  {
    if (!timer_is_on) {
    timer_is_on=1;  
    setTimeout("timedCount()",5000);
  }
}  


