
function showNextEvent()
{
   var myLi=$('#eventsList li.showme');
   var nextLi=myLi.next('li');   
   if(nextLi.is('li'))
   {
      myLi.fadeOut('slow');      
      nextLi.hide();  
      nextLi.addClass('showme'); 
      nextLi.fadeIn('slow'); 
      myLi.removeClass('showme');      
   }
   else
   {
      myLi.fadeOut('slow');      
      $('#eventsList li:first').hide();      
      $('#eventsList li:first').addClass('showme');     
      $('#eventsList li:first').fadeIn('slow'); 
      myLi.removeClass('showme');   
   }
}

function showPreviousEvent()
{
   var myLi=$('#eventsList li.showme');
   var prevLi=myLi.prev('li');   
   if(prevLi.is('li'))
   {       
      myLi.fadeOut('slow');      
      prevLi.hide();  
      prevLi.addClass('showme'); 
      prevLi.fadeIn('slow'); 
      myLi.removeClass('showme');
   }
   else
   {     
      myLi.fadeOut('slow');      
      $('#eventsList li:last').hide();      
      $('#eventsList li:last').addClass('showme');     
      $('#eventsList li:last').fadeIn('slow'); 
      myLi.removeClass('showme');   
       
   }
}

function bindEvents()
{

  $('#eventsNavig li.next a').click(function () { 
      showNextEvent();
      $(this).blur();
      return false;   
    });
    
  $('#eventsNavig li.prev a').click(function () { 
      showPreviousEvent();
      $(this).blur();
      return false;   
    });
    
}




$(document).ready(function(){
   bindEvents();   
    $('#frase').hide();
    $('#frase').show(3000);   

  });
