jQuery('.panel-heading a').click(function() {
    jQuery(this).find(jQuery(".more-less")).toggleClass("fa-chevron-circle-down fa-chevron-circle-up");
    jQuery('.panel-heading').removeClass('active');

    if (!jQuery(this).closest('.panel').find('.panel-collapse').hasClass('in'))
        jQuery(this).parents('.panel-heading').addClass('active');
});

jQuery(function() {

    var price = {

        "he_basic_mn": "5.99",
        "he_basic_an": "59.99",
        "he_essential_mn": "7.99",
        "he_essential_an": "79.99",
        "he_essential_mn_boiler": "17.08",
        "he_essential_an_boiler": "179.98",
        "he_premium_mn": "9.99",
        "he_premium_an": "119.00",
        "he_premium_mn_boiler": "19.08",
        "he_premium_an_boiler": "218.99",

    };

    for (var val in price) {

        jQuery('.' + val + '_view').html('&pound' + price[val]);
        jQuery('.' + val + '_viewz').val(price[val]);
    }

    jQuery('.he_checkbox').change(function() {

        var new_val = jQuery(this).attr('data-checklist');
        var new_object_monthly = new_val + 'mn';
        var new_object_yearly = new_val + 'an';
        var new_object_boiler_monthly = new_val + 'mn_boiler';
        var new_object_boiler_yearly = new_val + 'an_boiler';

        if (jQuery(this).is(":checked") == true) {

            jQuery('.' + new_object_monthly + '_view').html('&pound' + price[new_object_boiler_monthly]);
            jQuery('.' + new_object_monthly + '_viewz').val(price[new_object_boiler_monthly]);
            jQuery('.' + new_object_yearly + '_view').html('&pound' + price[new_object_boiler_yearly]);
            jQuery('.' + new_object_yearly + '_viewz').val(price[new_object_boiler_yearly]);

        } else {

            jQuery('.' + new_object_monthly + '_view').html('&pound' + price[new_object_monthly]);
            jQuery('.' + new_object_monthly + '_viewz').val(price[new_object_monthly]);
            jQuery('.' + new_object_yearly + '_view').html('&pound' + price[new_object_yearly]);
            jQuery('.' + new_object_yearly + '_viewz').val(price[new_object_yearly]);
        }

    });
});