$(function() {
    $('#header_color').wheelColorPicker('preview', true);
    $('#header_text_color').wheelColorPicker('preview', true);
    $('#header_links_color').wheelColorPicker('preview', true);

    $('#header_color').on('colorchange', function () {
        $('.navbar').css('background-color', '#' + $('#header_color').val())
    });

    $('#header_text_color').on('colorchange', function () {
        $('.navbar').css('color', '#' + $('#header_text_color').val())
    });
    $('#header_links_color').on('colorchange', function () {
        let color = '#' + $('#header_links_color').val();
        $('.not_active .headerHealthNumber .circle a, .not_active .headerHealthNumber .circle a:hover').css('color', color);
        $('.not_active .headerHealthNumber').css('color', color);
        $('.headerHealthNumber span.count, #headerHostNumber span.count').css('color', color);
        $('.navbar .dropdown-toggle i').css('color', color);
    });

    $('.reset-colors').click(function (e) {
        e.preventDefault();
        $('#header_color, #header_text_color, #header_links_color').val('');
        $('.customization-form').submit();
    });
});