$(function(){
   $('.box').append('<div class="shadow-1"></div><div class="shadow-2"></div>');
   $('#wrapper').append('<div class="shadow-3"></div><div class="shadow-4"></div>'); 
   var total = 0;
   var current = 0;
//
   $('.part').each(function(e){
       $(this).addClass('part-'+e); 
       total++;
   });
//   
   $('.participantes').find('.proximo').click(function(){
      if(current < total -1) {
          proximo = current + 1;
          $('.part-'+current).fadeOut(500, function() { $('.part-'+proximo).fadeIn('slow'); });
          current++;
      }
      return false; 
   });
//   
   $('.participantes').find('.anterior').click(function(){
       if(current > 0) {
             anterior = current - 1;
             $('.part-'+current).fadeOut(500, function() { $('.part-'+anterior).fadeIn('slow'); });
             current--;
         }
      return false; 
   });
   
   //  tabs video idiomas
   $('.nav-videos').find('a').each(function(e){
      $(this).click(function(){
         $('.nav-videos').find('a').each(function(){
             $(this).removeClass('flagged');
         });
         if($(this).addClass('flagged')) {
             var novoIframe = '<iframe src="'+ $(this).attr('href') +'" width="480" height="318" frameborder="no" scrolling="no" allowtransparency="true"></iframe>';
             $('.video-iframe').empty().html(novoIframe);
         }
         return false;
      });
   });
   
   
});