(function( $ ) {
	wp.customize.bind( 'ready', function() {

		var optPrefix = '#customize-control-diet_consultant_options-';
		
		// Label
		function diet_consultant_customizer_label( id, title ) {

			// Site Identity

			if ( id === 'custom_logo' || id === 'site_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Global Color Setting

			if ( id === 'diet_consultant_global_color' || id === 'diet_consultant_heading_color' || id === 'diet_consultant_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'diet_consultant_scroll_hide' || id === 'diet_consultant_preloader_hide' || id === 'diet_consultant_sticky_header' || id === 'diet_consultant_products_per_row' || id === 'diet_consultant_width_option' )  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

			if ( id === 'diet_consultant_theme_color' || id === 'background_color' || id === 'background_image' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Header Image

			if ( id === 'header_image' || id === 'diet_consultant_post_layout' || id === 'diet_consultant_404_page_main_heading' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			//  Header

			if ( id === 'diet_consultant_topbar_phone_text' || id === 'diet_consultant_topbar_text' || id === 'diet_consultant_topbar_mail_text' || id === 'diet_consultant_header_button_text' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Slider

			if ( id === 'diet_consultant_banner_main_heading' || id === 'diet_consultant_banner_main_text' || id === 'diet_consultant_banner_center_image' || id === 'diet_consultant_banner_right_heading' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// About Us

			if ( id === 'diet_consultant_about_us_image1' || id === 'diet_consultant_about_us_heading' || id === 'diet_consultant_about_us_list_heading0' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Footer

			if ( id === 'diet_consultant_show_hide_copyright' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Post Setting

			if ( id === 'diet_consultant_post_page_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Single Post Setting

			if ( id === 'diet_consultant_single_post_thumb' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-diet_consultant_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			
		}

	    // Site Identity
		diet_consultant_customizer_label( 'custom_logo', 'Logo Setup' );
		diet_consultant_customizer_label( 'site_icon', 'Favicon' );

		// Global Color Setting
		diet_consultant_customizer_label( 'diet_consultant_global_color', 'Global Color' );
		diet_consultant_customizer_label( 'diet_consultant_heading_color', 'Heading Typography' );
		diet_consultant_customizer_label( 'diet_consultant_paragraph_color', 'Paragraph Typography' );

		// General Setting
		diet_consultant_customizer_label( 'diet_consultant_preloader_hide', 'Preloader' );
		diet_consultant_customizer_label( 'diet_consultant_sticky_header', 'Sticky Header' );
		diet_consultant_customizer_label( 'diet_consultant_scroll_hide', 'Scroll To Top' );
		diet_consultant_customizer_label( 'diet_consultant_scroll_top_position', 'Scroll to top Position' );
		diet_consultant_customizer_label( 'diet_consultant_products_per_row', 'woocommerce Setting' );
		diet_consultant_customizer_label( 'diet_consultant_width_option', 'Site Width Layouts' );

		// Colors
		diet_consultant_customizer_label( 'diet_consultant_theme_color', 'Theme Color' );
		diet_consultant_customizer_label( 'background_color', 'Colors' );
		diet_consultant_customizer_label( 'background_image', 'Image' );

		//Header Image
		diet_consultant_customizer_label( 'header_image', 'Header Image' );

		diet_consultant_customizer_label( 'diet_consultant_post_layout', 'Post Layouts Settings' );

		diet_consultant_customizer_label( 'diet_consultant_404_page_main_heading', '404 Page Settings' );

		// Header
		diet_consultant_customizer_label( 'diet_consultant_topbar_text', 'Topbar Text' );
		diet_consultant_customizer_label( 'diet_consultant_topbar_phone_text', 'Phone Number' );
		diet_consultant_customizer_label( 'diet_consultant_topbar_mail_text', 'Email Address' );
		diet_consultant_customizer_label( 'diet_consultant_header_button_text', 'Header Button' );

		//Slider
		diet_consultant_customizer_label( 'diet_consultant_banner_main_heading', 'Banner Content' );
		diet_consultant_customizer_label( 'diet_consultant_banner_main_text', 'Banner Left' );
		diet_consultant_customizer_label( 'diet_consultant_banner_center_image', 'Banner Center Image' );
		diet_consultant_customizer_label( 'diet_consultant_banner_right_heading', 'Banner Right' );

		//About Us
		diet_consultant_customizer_label( 'diet_consultant_about_us_image1', 'About Us Images' );
		diet_consultant_customizer_label( 'diet_consultant_about_us_heading', 'About Us Contents' );
		diet_consultant_customizer_label( 'diet_consultant_about_us_list_heading0', 'About Us Details Box' );

		//Footer
		diet_consultant_customizer_label( 'diet_consultant_show_hide_copyright', 'Footer' );
	
		// Post Setting
		diet_consultant_customizer_label( 'diet_consultant_post_page_title', 'Post Setting' );

		//Single Post Setting
		diet_consultant_customizer_label( 'diet_consultant_single_post_thumb', 'Single Post Setting' );
	});

})( jQuery );
