/*  Wizard */
jQuery(function($) {
    "use strict";
    var form = $("#wrapped");

    $('.b_1').hide(400);
    $('.b_2').hide(400);
    $('.b_3').hide(400);
    $('.b_4').hide(400);
    $('.b_5').hide(400);
    $('.b_6').hide(400);
    $('.b_7').hide(400);
    $('.b_8').hide(400);

  
    $(".dateInfinity").datepicker({
        format: "mm/dd/yyyy",
        altFormat: "YYYY-MM-DD",
        changeMonth: true,
        changeYear: true,
         autoclose: true
    }).on('changeDate', function(e) {
        $(".dateInfinity").datepicker('hide');
    });

    $("#wizard_container").wizard({
        stepsWrapper: "#wrapped",
        submit: ".submit",
        unidirectional: false,
        beforeSelect: function(event, state) {
            if ($('input#website').val().length != 0) {
                return false;
            }
            if (!state.isMovingForward)
                return true;
            var inputs = $(this).wizard('state').step.find(':input');
           console.log(!!inputs.valid())
            return !inputs.length || !!inputs.valid();
        },
    }).validate({
        errorPlacement: function(error, element) {
            console.log(error, element)
            if (element.is(':radio') || element.is(':checkbox') && element.is(':input')){
                error.insertBefore(element.next());
            } else {
                error.insertAfter(element);
            }
        }
    });
    //  progress bar
    $("#progressbar").progressbar();
    $("#wizard_container").wizard({
        afterSelect: function(event, state) {
             // console.log(event, state)
            $("#progressbar").progressbar("value", state.percentComplete);
            $("#location").text("" + state.stepsComplete + " of " + state.stepsPossible + " completed");
        }
    });

    //beneficiares
    $('#fO8LwZrQ').change(function() {
        var x = $(this).val();
        if (x == 0) {
            $('.b_1').hide(400);
            $('.b_2').hide(400);
            $('.b_3').hide(400);
            $('.b_4').hide(400);
            $('.b_5').hide(400);
            $('.b_6').hide(400);
            $('.b_7').hide(400);
            $('.b_8').hide(400);

            var cero = $(".beneficiaries").find(".inner_form");
            cero.removeClass("required");
        }
        if (x == 1) {
            $('.b_1').show(400);
            $('.b_2').hide(400);
            $('.b_3').hide(400);
            $('.b_4').hide(400);
            $('.b_5').hide(400);
            $('.b_6').hide(400);
            $('.b_7').hide(400);
            $('.b_8').hide(400);

            var uno = $('.beneficiaries>.b_1').find('.inner_form');
            uno.addClass('required');
            var dos = $('.beneficiaries>.b_2').find('.inner_form');
            dos.removeClass('required');
            var tres = $('.beneficiaries>.b_3').find('.inner_form');
            tres.removeClass('required');
            var cuatro = $('.beneficiaries>.b_4').find('.inner_form');
            cuatro.removeClass('required');
            var cinco = $('.beneficiaries>.b_5').find('.inner_form');
            cinco.removeClass('required');
            var seis = $('.beneficiaries>.b_6').find('.inner_form');
            seis.removeClass('required');

        } else if (x == 2) {
            $('.b_1').show(400);
            $('.b_2').show(400);
            $('.b_3').hide(400);
            $('.b_4').hide(400);
            $('.b_5').hide(400);
            $('.b_6').hide(400);
            $('.b_7').hide(400);
            $('.b_8').hide(400);

            var uno = $('.beneficiaries>.b_1').find('.inner_form');
            uno.addClass('required');
            var dos = $('.beneficiaries>.b_2').find('.inner_form');
            dos.addClass('required');
            var tres = $('.beneficiaries>.b_3').find('.inner_form');
            tres.removeClass('required');
            var cuatro = $('.beneficiaries>.b_4').find('.inner_form');
            cuatro.removeClass('required');
            var cinco = $('.beneficiaries>.b_5').find('.inner_form');
            cinco.removeClass('required');
            var seis = $('.beneficiaries>.b_6').find('.inner_form');
            seis.removeClass('required');
        } else if (x == 3) {
            $('.b_1').show(400);
            $('.b_2').show(400);
            $('.b_3').show(400);
            $('.b_4').hide(400);
            $('.b_5').hide(400);
            $('.b_6').hide(400);
            $('.b_7').hide(400);
            $('.b_8').hide(400);

            var uno = $('.beneficiaries>.b_1').find('.inner_form');
            uno.addClass('required');
            var dos = $('.beneficiaries>.b_2').find('.inner_form');
            dos.addClass('required');
            var tres = $('.beneficiaries>.b_3').find('.inner_form');
            tres.addClass('required');
            var cuatro = $('.beneficiaries>.b_4').find('.inner_form');
            cuatro.removeClass('required');
            var cinco = $('.beneficiaries>.b_5').find('.inner_form');
            cinco.removeClass('required');
            var seis = $('.beneficiaries>.b_6').find('.inner_form');
            seis.removeClass('required');
        } else if (x == 4) {
            $('.b_1').show(400);
            $('.b_2').show(400);
            $('.b_3').show(400);
            $('.b_4').show(400);
            $('.b_5').hide(400);
            $('.b_6').hide(400);
            $('.b_7').hide(400);
            $('.b_8').hide(400);

            var uno = $('.beneficiaries>.b_1').find('.inner_form');
            uno.addClass('required');
            var dos = $('.beneficiaries>.b_2').find('.inner_form');
            dos.addClass('required');
            var tres = $('.beneficiaries>.b_3').find('.inner_form');
            tres.addClass('required');
            var cuatro = $('.beneficiaries>.b_4').find('.inner_form');
            cuatro.addClass('required');
            var cinco = $('.beneficiaries>.b_5').find('.inner_form');
            cinco.removeClass('required');
            var seis = $('.beneficiaries>.b_6').find('.inner_form');
            seis.removeClass('required');
        } else if (x == 5) {
            $('.b_1').show(400);
            $('.b_2').show(400);
            $('.b_3').show(400);
            $('.b_4').show(400);
            $('.b_5').show(400);
            $('.b_6').hide(400);
            $('.b_7').hide(400);
            $('.b_8').hide(400);

            var uno = $('.beneficiaries>.b_1').find('.inner_form');
            uno.addClass('required');
            var dos = $('.beneficiaries>.b_2').find('.inner_form');
            dos.addClass('required');
            var tres = $('.beneficiaries>.b_3').find('.inner_form');
            tres.addClass('required');
            var cuatro = $('.beneficiaries>.b_4').find('.inner_form');
            cuatro.addClass('required');
            var cinco = $('.beneficiaries>.b_5').find('.inner_form');
            cinco.addClass('required');
            var seis = $('.beneficiaries>.b_6').find('.inner_form');
            seis.removeClass('required');
        } else if (x == 6) {
            $('.b_1').show(400);
            $('.b_2').show(400);
            $('.b_3').show(400);
            $('.b_4').show(400);
            $('.b_5').show(400);
            $('.b_6').show(400);
            $('.b_7').hide(400);
            $('.b_8').hide(400);

            var uno = $('.beneficiaries>.b_1').find('.inner_form');
            uno.addClass('required');
            var dos = $('.beneficiaries>.b_2').find('.inner_form');
            dos.addClass('required');
            var tres = $('.beneficiaries>.b_3').find('.inner_form');
            tres.addClass('required');
            var cuatro = $('.beneficiaries>.b_4').find('.inner_form');
            cuatro.addClass('required');
            var cinco = $('.beneficiaries>.b_5').find('.inner_form');
            cinco.addClass('required');
            var seis = $('.beneficiaries>.b_6').find('.inner_form');
            seis.addClass('required');

        } else if (x == 7) {
            $('.b_1').show(400);
            $('.b_2').show(400);
            $('.b_3').show(400);
            $('.b_4').show(400);
            $('.b_5').show(400);
            $('.b_6').show(400);
            $('.b_7').show(400);
            $('.b_8').hide(400);
        } else if (x == 8) {
            $('.b_1').show(400);
            $('.b_2').show(400);
            $('.b_3').show(400);
            $('.b_4').show(400);
            $('.b_5').show(400);
            $('.b_6').show(400);
            $('.b_7').show(400);
            $('.b_8').show(400);
        } else {
            $('.b_1').hide(400);
            $('.b_2').hide(400);
            $('.b_3').hide(400);
            $('.b_4').hide(400);
            $('.b_5').hide(400);
            $('.b_6').hide(400);
            $('.b_7').hide(400);
            $('.b_8').hide(400);
        }
    });

    //Pets
    $('.pets').change(function() {
        var x = $(this).val();
        if (x == 0) {
            $('.mascota_0').hide(400);
            $('.mascota_1').hide(400);
            $('.mascota_2').hide(400);
            $('.mascota_3').hide(400);
            $('.mascota_4').hide(400);
            $('.mascota_5').hide(400);

            var cero = $(".pets_row").find(".each");
            cero.removeClass("required");
        } 
        else if (x == 1) {
            $('.mascota_0').show(400);
            $('.mascota_1').hide(400);
            $('.mascota_2').hide(400);
            $('.mascota_3').hide(400);
            $('.mascota_4').hide(400);
            $('.mascota_5').hide(400);

            var uno = $('.pets_row>.mascota_0').find('.each');
            // uno.addClass('required');
            var dos = $('.pets_row>.mascota_1').find('.each');
            dos.removeClass('required');
            var tres = $('.pets_row>.mascota_2').find('.each');
            tres.removeClass('required');
            var cuatro = $('.pets_row>.mascota_3').find('.each');
            cuatro.removeClass('required');
            var cinco = $('.pets_row>.mascota_4').find('.each');
            cinco.removeClass('required');
            var seis = $('.pets_row>.mascota_5').find('.each');
            seis.removeClass('required');

        } else if (x == 2) {
            $('.mascota_0').show(400);
            $('.mascota_1').show(400);
            $('.mascota_2').hide(400);
            $('.mascota_3').hide(400);
            $('.mascota_4').hide(400);
            $('.mascota_5').hide(400);

            var uno = $('.pets_row>.mascota_0').find('.each');
            // uno.addClass('required');
            var dos = $('.pets_row>.mascota_1').find('.each');
            // dos.addClass('required');
            var tres = $('.pets_row>.mascota_2').find('.each');
            tres.removeClass('required');
            var cuatro = $('.pets_row>.mascota_3').find('.each');
            cuatro.removeClass('required');
            var cinco = $('.pets_row>.mascota_4').find('.each');
            cinco.removeClass('required');
            var seis = $('.pets_row>.mascota_5').find('.each');
            seis.removeClass('required');
        } else if (x == 3) {
            $('.mascota_0').show(400);
            $('.mascota_1').show(400);
            $('.mascota_2').show(400);
            $('.mascota_3').hide(400);
            $('.mascota_4').hide(400);
            $('.mascota_5').hide(400);

            var uno = $('.pets_row>.mascota_0').find('.each');
            uno.addClass('required');
            var dos = $('.pets_row>.mascota_1').find('.each');
            dos.addClass('required');
            var tres = $('.pets_row>.mascota_2').find('.each');
            tres.addClass('required');
            var cuatro = $('.pets_row>.mascota_3').find('.each');
            cuatro.removeClass('required');
            var cinco = $('.pets_row>.mascota_4').find('.each');
            cinco.removeClass('required');
            var seis = $('.pets_row>.mascota_5').find('.each');
            seis.removeClass('required');

        } else if (x == 4) {
            $('.mascota_0').show(400);
            $('.mascota_1').show(400);
            $('.mascota_2').show(400);
            $('.mascota_3').show(400);
            $('.mascota_4').hide(400);
            $('.mascota_5').hide(400);

            var uno = $('.pets_row>.mascota_0').find('.each');
            uno.addClass('required');
            var dos = $('.pets_row>.mascota_1').find('.each');
            dos.addClass('required');
            var tres = $('.pets_row>.mascota_2').find('.each');
            tres.addClass('required');
            var cuatro = $('.pets_row>.mascota_3').find('.each');
            cuatro.addClass('required');
            var cinco = $('.pets_row>.mascota_4').find('.each');
            cinco.removeClass('required');
            var seis = $('.pets_row>.mascota_5').find('.each');
            seis.removeClass('required');

        } else if (x == 5) {
            $('.mascota_0').show(400);
            $('.mascota_1').show(400);
            $('.mascota_2').show(400);
            $('.mascota_3').show(400);
            $('.mascota_4').show(400);
            $('.mascota_5').hide(400);

            var uno = $('.pets_row>.mascota_0').find('.each');
            uno.addClass('required');
            var dos = $('.pets_row>.mascota_1').find('.each');
            dos.addClass('required');
            var tres = $('.pets_row>.mascota_2').find('.each');
            tres.addClass('required');
            var cuatro = $('.pets_row>.mascota_3').find('.each');
            cuatro.addClass('required');
            var cinco = $('.pets_row>.mascota_4').find('.each');
            cinco.addClass('required');
            var seis = $('.pets_row>.mascota_5').find('.each');
            seis.removeClass('required');

        } else {
            $('.mascota_0').show(400);
            $('.mascota_1').show(400);
            $('.mascota_2').show(400);
            $('.mascota_3').show(400);
            $('.mascota_4').show(400);
            $('.mascota_5').show(400);

            var uno = $('.pets_row>.mascota_0').find('.each');
            uno.addClass('required');
            var dos = $('.pets_row>.mascota_1').find('.each');
            dos.addClass('required');
            var tres = $('.pets_row>.mascota_2').find('.each');
            tres.addClass('required');
            var cuatro = $('.pets_row>.mascota_3').find('.each');
            cuatro.addClass('required');
            var cinco = $('.pets_row>.mascota_4').find('.each');
            cinco.addClass('required');
            var seis = $('.pets_row>.mascota_5').find('.each');
            seis.addClass('required');
        }
    });

    $(".card-number input[type='password']").keyup(function(event) {
        var len = $(this).val().toString().length;

        if (len == 4) {
            $(this).next().focus();
        }
    });

    $(document).on('keyup', '.ccc', function(e) {
        var cc1 = $("input[name='cc1']").val(),
            cc2 = $("input[name='cc2']").val(),
            cc3 = $("input[name='cc3']").val(),
            cc4 = $("input[name='cc4']").val(),
            ccc1 = $("input[name='ccc1']").val(),
            ccc2 = $("input[name='ccc2']").val(),
            ccc3 = $("input[name='ccc3']").val(),
            ccc4 = $("input[name='ccc4']").val();
        var credit_card = cc1 + ' ' + cc2 + ' ' + cc3 + ' ' + cc4;
        var confir_credit_card = ccc1 + ' ' + ccc2 + ' ' + ccc3 + ' ' + ccc4;
        if (credit_card != confir_credit_card) {
            $('#msgE').html("<span><i class=la la-remove' style='color:#f00'></i> <b style='color:#f00'>The credit card numbers do not match</b></span>");
            return false;
        } else {
            $('#msgE').html("");
            return true;
        }
        return true;
    });

    $(document).on('change', 'input:radio[class^="plan"]', function(event) {
        var price = $(this).attr('data-price');
        var annualPrice = price * 12;
        var fee = 0;
        var paymentMethod = $('input:radio[class^="paymentMethod"]:checked').attr("data-method");
        var paymentToday = (price * paymentMethod) + fee;
        $('.services_price').val(price);
        $('.annual_price').val(annualPrice);
        $('.fee').val(fee);
        $('.payment_today').val(paymentToday);
        //console.log('price' + price + 'annualPrice' + annualPrice + 'fee' + fee + 'paymentMethod' + paymentMethod + 'paymentToday' + paymentToday);
    });

    $(document).on('change', 'input:radio[class^="paymentMethod"]', function(event) {
        var name = $(this).val();
        var price = $('input:radio[class^="plan"]:checked').attr("data-price");
        //console.log('price >>>' + price + '<<<');
        if (price !== undefined) {
            var paymentMethod = $(this).attr('data-method');
            var annualPrice = price * 12;
            var fee = 0;
            var paymentToday = (price * paymentMethod) + fee;
            $('.services_price').val(price);
            $('.annual_price').val(annualPrice);
            $('.fee').val(fee);
        }

        $('.payment_today').val(paymentToday);
        //console.log('price' + price + 'annualPrice' + annualPrice + 'fee' + fee + 'paymentMethod' + paymentMethod + 'paymentToday' + paymentToday);

    });
    $('#tab_each').click(function() {
        $(".each").each(function() {
            var $value = $(this).val();
            var $class = this.id;
            if ($(this).hasClass('cn') && $(this).val() !== '') {
                var $card_number = $(this).val();
                $card_number = ' ****' + ' ****' + ' **** ' + $card_number;
                //console.log($card_number);
                $('.div_0LjyxHPo').text($card_number);

            }
            if ($value != '' && $class != '') {
                if ($value == 'choice') {
                    $value = '';
                }
                $('.' + $class + '').text($value);
            }

        });

        // Radio Payment Method
        if ($("input[name='radio_wLd0YIza']:checked").val()) {
            var $radio_1 = $("input[name='radio_wLd0YIza']:checked").val();
            console.log($radio_1)
            $('.radio_wLd0YIza').text($radio_1);
        } else if (!$("input[name='radio_wLd0YIza']:checked").val()) {
            $radio_1 = '';
            $('.radio_wLd0YIza').text($radio_1);
        }

        // Radio Type of Plan
        if ($("input[name='radio_l1w3Ynka']:checked").val()) {
            var $radio_1 = $("input[name='radio_l1w3Ynka']:checked").val();
            $('.radio_l1w3Ynka').text($radio_1);
        } else if (!$("input[name='radio_l1w3Ynka']:checked").val()) {
            $radio_1 = '';
            $('.radio_l1w3Ynka').text($radio_1);
        }
    });

    $('.check_show').change(function() {

        if ($('.check_show').is(':checked')) {
            $('#div_Y4WWrrM4').show(400);
            $('#div_AsP3myzc').show(400);
            $('#div_B7KptoTp').show(400);
            $('#div_QNgwp7lK').show(400);
            $('#div_cI9Qfhzl').show(400);
            $('#div_fYMwPZ3n').show(400);
            $('#div_M2VhsxH7').show(400);
            $('#div_8XT1hius').show(400);
            $('#div_rmWYVTUE').show(400);
            $('#div_QK04wfG3').show(400);
            $('#div_wwKVgWXw').show(400);
        } else {
            $('#div_Y4WWrrM4').hide();
            $('#div_AsP3myzc').hide();
            $('#div_B7KptoTp').hide();
            $('#div_QNgwp7lK').hide();
            $('#div_cI9Qfhzl').hide();
            $('#div_fYMwPZ3n').hide();
            $('#div_M2VhsxH7').hide();
            $('#div_8XT1hius').hide();
            $('#div_rmWYVTUE').hide();
            $('#div_QK04wfG3').hide();
            $('#div_wwKVgWXw').show();
        }
    });

    $('.question_1').change(function() {
        if ($('input:radio[name=question_1]:checked').val() == 'Yes') {
            $('.who_1').show(400);

           var allDiv = $(".be");
           var items = [];
           var super_array = [];
           var uno = '', dos = '', tres = '', cuatro = '', cinco = '', seis = '', siete = '', ocho = '';
          
           for ( var i=0; i < allDiv.length; i++) {
                // use allDiv[i] for accessing each one
                if(allDiv[i]['id'].indexOf('_1') > -1){
                    uno = (allDiv[0]['value'].concat(' ', allDiv[1]['value']));
                }                
                if(allDiv[i]['id'].indexOf('_2') > -1){
                    dos = (allDiv[2]['value'].concat(' ', allDiv[3]['value']));
                }
                if(allDiv[i]['id'].indexOf('_3') > -1){
                    tres = (allDiv[4]['value'].concat(' ', allDiv[5]['value']));
                }
                if(allDiv[i]['id'].indexOf('_4') > -1){
                    cuatro = (allDiv[6]['value'].concat(' ', allDiv[7]['value']));
                }
                if(allDiv[i]['id'].indexOf('_5') > -1){
                    cinco = (allDiv[8]['value'].concat(' ', allDiv[9]['value']));
                }
                if(allDiv[i]['id'].indexOf('_6') > -1){
                    seis = (allDiv[10]['value'].concat(' ', allDiv[11]['value']));
                }
                if(allDiv[i]['id'].indexOf('_7') > -1){
                    siete = (allDiv[12]['value'].concat(' ', allDiv[13]['value']));
                }
                if(allDiv[i]['id'].indexOf('_8') > -1){
                    ocho = (allDiv[14]['value'].concat(' ', allDiv[15]['value']));
                }
            }
            items.push(uno, dos, tres, cuatro, cinco, seis, siete, ocho);
            $('#listBeneficiaries1').html('');
            for (var $i = 0; $i < items.length; $i++) {
                 console.log(items[$i])
                if (items === items) {
                    $('#listBeneficiaries1').append('<option value="' + items[$i] + '">' + items[$i] + '</option>');
                    $('#listBeneficiaries1').val(items);
                }
            }
        } else if ($('input:radio[name=question_1]:checked').val() == 'No') {
            $('.who_1').hide();
            $('#listBeneficiaries1').html('');
        }
    });
    $('.question_2').change(function() {
        if ($('input:radio[name=question_2]:checked').val() == 'Yes') {
            $('.who_2').show(400);
            var allDiv = $(".be");
            var items = [];
            var super_array = [];
            var uno = '', dos = '', tres = '', cuatro = '', cinco = '', seis = '', siete = '', ocho = '';
          
            for ( var i=0; i < allDiv.length; i++) {
                // use allDiv[i] for accessing each one
                if(allDiv[i]['id'].indexOf('_1') > -1){
                    uno = (allDiv[0]['value'].concat(' ', allDiv[1]['value']));
                }                
                if(allDiv[i]['id'].indexOf('_2') > -1){
                    dos = (allDiv[2]['value'].concat(' ', allDiv[3]['value']));
                }
                if(allDiv[i]['id'].indexOf('_3') > -1){
                    tres = (allDiv[4]['value'].concat(' ', allDiv[5]['value']));
                }
                if(allDiv[i]['id'].indexOf('_4') > -1){
                    cuatro = (allDiv[6]['value'].concat(' ', allDiv[7]['value']));
                }
                if(allDiv[i]['id'].indexOf('_5') > -1){
                    cinco = (allDiv[8]['value'].concat(' ', allDiv[9]['value']));
                }
                if(allDiv[i]['id'].indexOf('_6') > -1){
                    seis = (allDiv[10]['value'].concat(' ', allDiv[11]['value']));
                }
                if(allDiv[i]['id'].indexOf('_7') > -1){
                    siete = (allDiv[12]['value'].concat(' ', allDiv[13]['value']));
                }
                if(allDiv[i]['id'].indexOf('_8') > -1){
                    ocho = (allDiv[14]['value'].concat(' ', allDiv[15]['value']));
                }
            }
            items.push(uno, dos, tres, cuatro, cinco, seis, siete, ocho);
            $('#listBeneficiaries2').html('');
            for (var $i = 0; $i < items.length; $i++) {
                 console.log(items[$i])
                if (items === items) {
                    $('#listBeneficiaries2').append('<option value="' + items[$i] + '">' + items[$i] + '</option>');
                    $('#listBeneficiaries2').val(items);
                }
            }
        } else if ($('input:radio[name=question_2]:checked').val() == 'No') {
            $('.who_2').hide();
            $('#listBeneficiaries2').html('');
        }
    });
    $('.question_3').change(function() {
        if ($('input:radio[name=question_3]:checked').val() == 'Yes') {
            $('.who_3').show(400);
             var allDiv = $(".be");
            var items = [];
            var super_array = [];
            var uno = '', dos = '', tres = '', cuatro = '', cinco = '', seis = '', siete = '', ocho = '';
          
            for ( var i=0; i < allDiv.length; i++) {
                // use allDiv[i] for accessing each one
                if(allDiv[i]['id'].indexOf('_1') > -1){
                    uno = (allDiv[0]['value'].concat(' ', allDiv[1]['value']));
                }                
                if(allDiv[i]['id'].indexOf('_2') > -1){
                    dos = (allDiv[2]['value'].concat(' ', allDiv[3]['value']));
                }
                if(allDiv[i]['id'].indexOf('_3') > -1){
                    tres = (allDiv[4]['value'].concat(' ', allDiv[5]['value']));
                }
                if(allDiv[i]['id'].indexOf('_4') > -1){
                    cuatro = (allDiv[6]['value'].concat(' ', allDiv[7]['value']));
                }
                if(allDiv[i]['id'].indexOf('_5') > -1){
                    cinco = (allDiv[8]['value'].concat(' ', allDiv[9]['value']));
                }
                if(allDiv[i]['id'].indexOf('_6') > -1){
                    seis = (allDiv[10]['value'].concat(' ', allDiv[11]['value']));
                }
                if(allDiv[i]['id'].indexOf('_7') > -1){
                    siete = (allDiv[12]['value'].concat(' ', allDiv[13]['value']));
                }
                if(allDiv[i]['id'].indexOf('_8') > -1){
                    ocho = (allDiv[14]['value'].concat(' ', allDiv[15]['value']));
                }
            }
            items.push(uno, dos, tres, cuatro, cinco, seis, siete, ocho);
            $('#listBeneficiaries3').html('');
            for (var $i = 0; $i < items.length; $i++) {
                 console.log(items[$i])
                if (items === items) {
                    $('#listBeneficiaries3').append('<option value="' + items[$i] + '">' + items[$i] + '</option>');
                    $('#listBeneficiaries3').val(items);
                }
            }
        } else if ($('input:radio[name=question_3]:checked').val() == 'No') {
            $('.who_3').hide();
            $('#listBeneficiaries3').html('');
        }
    });
    
});

// Input name and email value
function getVals(formControl, controlType) {
    switch (controlType) {

        case 'name_field':
            // Get the value for input
            var value = $(formControl).val();
            $("#name_field").text(value);
            break;

        case 'email_field':
            // Get the value for input
            var value = $(formControl).val();
            $("#email_field").text(value);
            break;
    }
}