$(function () {
	'use strict';

	var $swipeTabsContainer2 = $('.method-tabs'),
		$swipeTabs2 = $('.method-tab'),
		$swipeTabsContentContainer2 = $('.method-tabs-container'),
		currentIndex2 = 0,
		activeTabClassName2 = 'active-tab';

	$swipeTabsContainer2.on('init', function(event, slick) {
		$swipeTabsContentContainer2.removeClass('invisible');
		$swipeTabsContainer2.removeClass('invisible');

		currentIndex2 = slick.getCurrent();
		$swipeTabs2.removeClass(activeTabClassName2);
       	$('.method-tab[data-slick-index=' + currentIndex2 + ']').addClass(activeTabClassName2);
	});

	$swipeTabsContainer2.slick({
		slidesToShow: 2,
		slidesToScroll: 1,
		arrows: false,
		infinite: false,
		swipeToSlide: true,
		touchThreshold: 10
	});

	$swipeTabsContentContainer2.slick({
		asNavFor: $swipeTabsContainer2,
		slidesToShow: 1,
		slidesToScroll: 1,
		arrows: false,
		infinite: false,
		swipeToSlide: true,
    draggable: false,
		touchThreshold: 10
	});


	$swipeTabs2.on('click', function(event) {
        // gets index of clicked tab
        currentIndex2 = $(this).data('slick-index');
        $swipeTabs2.removeClass(activeTabClassName2);
        $('.method-tab[data-slick-index=' + currentIndex2 +']').addClass(activeTabClassName2);
        $swipeTabsContainer2.slick('slickGoTo', currentIndex2);
        $swipeTabsContentContainer2.slick('slickGoTo', currentIndex2);
    });

    //initializes slick navigation tabs swipe handler
    $swipeTabsContentContainer2.on('swipe', function(event, slick, direction) {
    	currentIndex2 = $(this).slick('slickCurrentSlide');
		$swipeTabs2.removeClass(activeTabClassName2);
		$('.method-tab[data-slick-index=' + currentIndex2 + ']').addClass(activeTabClassName2);
	});
});
