var main = function(){
  var dropdownToggle = $('.dropdown-toggle');
  
  // Event Handler
  dropdownToggle.on('click', function(){
    $('.dropdown-menu').toggle();
  });
  
  // Event Handler
  $('.arrow-prev').click(function(){
    var currentSlide = $('.active-slide'),
        prevSlide    = currentSlide.prev(),
        currentDot   = $('.active-dot');
        prevDot      = currentDot.prev();
    
    if( prevSlide.length == 0 ) {
      var prevSlide = $('.slide').last(),
          prevDot   = $('.dot').last();
    }
    
    currentSlide.fadeOut(600).removeClass('active-slide');
    prevSlide.fadeIn(600).addClass('active-slide');
    
    currentDot.removeClass('active-dot');
    prevDot.addClass('active-dot');
  });
  
  // Event Handler
  $('.arrow-next').click(function(){
    var currentSlide = $('.active-slide'),
        nextSlide    = currentSlide.next(),
        currentDot   = $('.active-dot'),
        nextDot      = currentDot.next();
    
    if(nextSlide.length == 0){
      nextSlide = $('.slide').first();
      nextDot   = $('.dot').first();
    }
    
    currentSlide.fadeOut(600).removeClass('active-slide');
    nextSlide.fadeIn(600).addClass('active-slide');
    
    // Change de dots when a click in buttons arrow.
    currentDot.removeClass('active-dot');
    nextDot.addClass('active-dot');
  });
  
};

$(document).ready(main);