( function( api ) {

	// Extends our custom "kindergarten-education" section.
	api.sectionConstructor['kindergarten-education'] = 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: 'kindergarten_education_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("kindergarten_education_first_color").set("#07809a");
			wp.customize.instance("kindergarten_education_second_color").set("#f8cf14");
            wp.customize.instance("kindergarten_education_third_color").set("#fcfe74");
            wp.customize.instance("kindergarten_education_fourth_color").set("#feffb5");
        }
    }

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