( function( api ) {

	// Extends our custom "swimming-pool-cleaning" section.
	api.sectionConstructor['swimming-pool-cleaning'] = api.Section.extend( {

		// No events for this type of section.
		attachEvents: function () {},

		// Always make the section active.
		isContextuallyActive: function () {
			return true;
		}
	} );

} )( wp.customize );

(function ($) {
    function ResetDemoSettings() {
        if (!confirm("Are you sure you want to reset demo import settings?")) return;

        $.post(ajaxurl, { action: 'swimming_pool_cleaning_reset_demo_import_settings' }, function () {
            location.reload();
        });
    }

    window.ResetDemoSettings = ResetDemoSettings;
})(jQuery);

(function ($, wp) {
    function ResetGlobalColor() {
        if (confirm("Are you sure you want to reset global color settings?")) {
            wp.customize.instance("swimming_pool_cleaning_first_color").set("#FFBB3B");
			wp.customize.instance("swimming_pool_cleaning_second_color").set("#2591EC");
        }
    }

    window.ResetGlobalColor = ResetGlobalColor;
})(jQuery, wp);
