var current_about_slide = 1;
var change_in_progress = false;



$(document).ready(function() {

  $('.nav-right').click(function() {
      show_about_slide('next', this);
    });

  $('.nav-left').click(function() {
      show_about_slide('prev', this);
    });
});


function show_about_slide (direction, e)
{
  //if (change_in_progress) return false;

  //change_in_progress = true;
  
  if ($(e).hasClass('nav-disabled')) return false;
  
  $('#about-wrapper').fadeTo('slow', 0.01, function() {
    if (direction == 'next')
    {
      $('#about-wrapper').removeClass('slide-'+parseInt(current_about_slide));
      current_about_slide++;
      $('#current-slide').html(current_about_slide);
      $('#about-wrapper').addClass('slide-'+parseInt(current_about_slide));
      $('#about-wrapper').html($('#slide_'+parseInt(current_about_slide)).html());
      if (current_about_slide == 4)
      {
        $('.nav-right').addClass('nav-disabled');
      }
      else if (current_about_slide == 2)
      {
        $('.nav-left').removeClass('nav-disabled');
      }
      
      $('#about-wrapper').fadeTo('slow', 1, function() {});
    }
    else if (direction == 'prev')
    {
      $('#about-wrapper').removeClass('slide-'+parseInt(current_about_slide));
      current_about_slide--;
      $('#current-slide').html(current_about_slide);
      $('#about-wrapper').addClass('slide-'+parseInt(current_about_slide));
      $('#about-wrapper').html($('#slide_'+parseInt(current_about_slide)).html());
      if (current_about_slide == 1)
      {
        $('.nav-left').addClass('nav-disabled');
      }
      else if (current_about_slide == 3)
      {
        $('.nav-right').removeClass('nav-disabled');
      }
      
      $('#about-wrapper').fadeTo('slow', 1, function() {});
    }
  });
  
  
}
