$(document).ready(function(){

  $(window).load(function(){
    
    $('#screens').cycle({
      fx: 'fade',
      timeout: 10000,
      prev: '.arrow_left img',
      next: '.arrow_right img',
      pause: 1,
      before: function(currSlideElement, nextSlideElement, options, forwardFlag) {
    
        var slide_curr_num = $(currSlideElement).attr('id').split('_')[2];
        var slide_next_num = $(nextSlideElement).attr('id').split('_')[2];
        
        $('#slide_text_'+slide_curr_num).fadeOut('fast', function(){
            $('#slide_text_'+slide_next_num).fadeIn('fast', function(){
              $('disable_slide_controls').val('0');  
            });
        });
        
      }
    });
    
  });
  
});
