( function( $ ) {
    var formId =gf_stla_localize_current_form.formId;
	wp.customize.bind('ready', function () {
    // Show background-color when theme is custom.
        wp.customize('gf_stla_form_id_tooltips_' + formId + '[tooltips][tooltip-theme]', function(setting) {
            wp.customize.control('gf_stla_form_id_tooltips_' + formId + '[tooltips][background-color]', function(control) {
                var visibility = function() {
                    if ('custom-'+formId === setting.get()) {
                        control.container.slideDown(180);
                    } else {
                        control.container.slideUp(180);
                    }
                };
                visibility();
                setting.bind(visibility);
            });
        });
    // Show font-size when theme is custom.
        wp.customize('gf_stla_form_id_tooltips_' + formId + '[tooltips][tooltip-theme]', function(setting) {
            wp.customize.control('gf_stla_form_id_tooltips_' + formId + '[tooltips][font-size]', function(control) {
                var visibility = function() {
                    if ('custom-'+formId === setting.get()) {
                        control.container.slideDown(180);
                    } else {
                        control.container.slideUp(180);
                    }
                };
                visibility();
                setting.bind(visibility);
            });
        });
    // Show font-color when theme is custom.
        wp.customize('gf_stla_form_id_tooltips_' + formId + '[tooltips][tooltip-theme]', function(setting) {
            wp.customize.control('gf_stla_form_id_tooltips_' + formId + '[tooltips][font-color]', function(control) {
                var visibility = function() {
                    if ('custom-'+formId === setting.get()) {
                        control.container.slideDown(180);
                    } else {
                        control.container.slideUp(180);
                    }
                };
                visibility();
                setting.bind(visibility);
            });
        });
    // Show border-size when theme is custom.
        wp.customize('gf_stla_form_id_tooltips_' + formId + '[tooltips][tooltip-theme]', function(setting) {
            wp.customize.control('gf_stla_form_id_tooltips_' + formId + '[tooltips][border-size]', function(control) {
                var visibility = function() {
                    if ('custom-'+formId === setting.get()) {
                        control.container.slideDown(180);
                    } else {
                        control.container.slideUp(180);
                    }
                };
                visibility();
                setting.bind(visibility);
            });
        });
    // Show border-radius when theme is custom.
        wp.customize('gf_stla_form_id_tooltips_' + formId + '[tooltips][tooltip-theme]', function(setting) {
            wp.customize.control('gf_stla_form_id_tooltips_' + formId + '[tooltips][border-radius]', function(control) {
                var visibility = function() {
                    if ('custom-'+formId === setting.get()) {
                        control.container.slideDown(180);
                    } else {
                        control.container.slideUp(180);
                    }
                };
                visibility();
                setting.bind(visibility);
            });
        });
         // Show border-color when theme is custom.
         wp.customize('gf_stla_form_id_tooltips_' + formId + '[tooltips][tooltip-theme]', function(setting) {
            wp.customize.control('gf_stla_form_id_tooltips_' + formId + '[tooltips][border-color]', function(control) {
                var visibility = function() {
                    if ('custom-'+formId === setting.get()) {
                        control.container.slideDown(180);
                    } else {
                        control.container.slideUp(180);
                    }
                };
                visibility();
                setting.bind(visibility);
            });
        });
    // Show arrow-color when theme is custom.
        wp.customize('gf_stla_form_id_tooltips_' + formId + '[tooltips][tooltip-theme]', function(setting) {
            wp.customize.control('gf_stla_form_id_tooltips_' + formId + '[tooltips][arrow-color]', function(control) {
                var visibility = function() {
                    if ('custom-'+formId === setting.get()) {
                        control.container.slideDown(180);
                    } else {
                        control.container.slideUp(180);
                    }
                };
                visibility();
                setting.bind(visibility);
            });
        });

	});
	
} )( jQuery );