jQuery(document).ready(function ($) {
      
    slide_animation();

    function slide_animation() {

        var ti = 2000;
        var first = $('.wpwab-slide-item.1').css('left');
        var third = $('.wpwab-slide-item.3').css('left');
        var fourth = $('.wpwab-slide-item.4').css('left');
        if(third == '-100px') {
            ti=5000;
        }
        if(first == '-50px'){
            $(".wpwab-slide-item.4").css("left",-50)
        }
        if (fourth == '-150px') {
            $(".wpwab-slide-item:not(.4)").css("left",50)
        }
        $(".wpwab-slide-item").animate({
            left: "-=50",
            opacity: 1
        }, 500);
        setTimeout(slide_animation, ti);

    }

    $('body').on('click', '.wpwab-multi-contacts-open', function(e) {

        $(this).hide();
        $(this).closest('.wpwab-multi-outer-wrapper').find('.wpwab-multi-contacts-wrap').addClass('wpwab-multi-displayed');
        $(this).closest('.wpwab-multi-outer-wrapper').find(".wpwab-multi-contacts-close").show();

    });

    $('body').on('click', '.wpwab-multi-contacts-close', function(e) {

        $(this).hide();
        $(this).closest('.wpwab-multi-outer-wrapper').find('.wpwab-multi-contacts-wrap').removeClass('wpwab-multi-displayed');
        $(this).closest('.wpwab-multi-outer-wrapper').find(".wpwab-multi-contacts-open").show();

    });


});