
function animatops(){
   $(document).ready(function() { cambiotop(); });
}

function cambiotop(){
  var spcontrol=document.getElementById('nexttopcol');
  var nexttopc=$(spcontrol).attr('title');
  var ids=nexttopc.split(':');
  var divorig=document.getElementById('top_'+ids[ids[0]]);
  ids[0]=parseInt(ids[0])+1;
  if(ids[0]==ids.length) ids[0]=1;
  var nwtitle='';
  for(x=0;x<ids.length;x++){ nwtitle+=ids[x]+(x<ids.length-1?':':''); }
  spcontrol.setAttribute("title",nwtitle);
  var divdest=document.getElementById('topsuper');
  var contenido=divorig.innerHTML;
  $('#topsuper').fadeOut('slow',function(){
    divdest.innerHTML=contenido;
    $('#topsuper').fadeIn('slow');
  });
  setTimeout(cambiotop,12000);
}

function topactual(idtop){
  var divorig=document.getElementById('top_'+idtop);
  var divdest=document.getElementById('topsuper');
  var contenido=divorig.innerHTML;
  var spcontrol=document.getElementById('nexttopcol');
  var nexttopc=$(spcontrol).attr('title');
  var ids=nexttopc.split(':');
  var nwtitle='';
  for(x=1;x<ids.length;x++){ if(ids[x]==idtop){ ids[0]=(x+1); break; } }
  if(ids[0]==ids.length) ids[0]=1;
  for(x=0;x<ids.length;x++){ nwtitle+=ids[x]+(x<ids.length-1?':':''); }
  spcontrol.setAttribute("title",nwtitle);
  divdest.innerHTML=contenido;
}
