/**
 * File customizer.js.
 *
 * Theme Customizer enhancements for a better user experience.
 *
 * Contains handlers to make Theme Customizer preview reload changes asynchronously.
 */

(function() {

	wp.customize.bind( 'ready', function() {	
		wp.customize.control( 'megapress_banner_type', function( control ) {
			control.setting.bind(function (value) {
				switch (value) {
					case 'static':
						wp.customize.control('megapress_static_image').activate();
						wp.customize.control('megapress_slideshow').deactivate();
						break;
					case 'slideshow':
						wp.customize.control('megapress_static_image').deactivate();
						wp.customize.control('megapress_slideshow').activate();
						break;
				}
			} );
			
		});
	});

})( jQuery );
