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

		var optPrefix = '#customize-control-academic_tutor_options-';
		
		// Label
		function academic_tutor_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-academic_tutor_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Global Color Setting

			if ( id === 'academic_tutor_first_color' || id === 'academic_tutor_heading_color' || id === 'academic_tutor_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-academic_tutor_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'academic_tutor_scroll_hide' || id === 'academic_tutor_preloader_hide' || id === 'academic_tutor_sticky_header' || id === 'academic_tutor_products_per_row' || id === 'academic_tutor_scroll_top_position' || id === 'academic_tutor_products_per_row' || id === 'academic_tutor_width_option' || id === 'academic_tutor_nav_menu_text_transform' || id === 'academic_tutor_woo_product_border_radius')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-academic_tutor_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Woocommerce product sale Setting

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

			// Colors

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

			// Header Image

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

			//  Header
			
			if ( id === 'academic_tutor_header_search_setting' || id === 'academic_tutor_header_btn_text') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-academic_tutor_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}


			// Banner

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

			// Products

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

			// Footer

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

			// Post Settings

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

			// Single Post Settings

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

			// Single Post Comment Setting

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

			// Single Post thumb Setting

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

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

		// Global Color Setting
		academic_tutor_customizer_label( 'academic_tutor_first_color', 'Global Color' );
		academic_tutor_customizer_label( 'academic_tutor_heading_color', 'Heading Typography' );
		academic_tutor_customizer_label( 'academic_tutor_paragraph_color', 'Paragraph Typography' );

		// General Setting
		academic_tutor_customizer_label( 'academic_tutor_preloader_hide', 'Preloader' );
		academic_tutor_customizer_label( 'academic_tutor_sticky_header', 'Sticky Header' );
		academic_tutor_customizer_label( 'academic_tutor_scroll_hide', 'Scroll To Top' );
		academic_tutor_customizer_label( 'academic_tutor_scroll_top_position', 'Scroll to top Position' );
		academic_tutor_customizer_label( 'academic_tutor_products_per_row', 'woocommerce Setting' );
		academic_tutor_customizer_label( 'academic_tutor_width_option', 'Site Width Layouts' );
		academic_tutor_customizer_label( 'academic_tutor_nav_menu_text_transform', 'Nav Menus Text Transform' );
		academic_tutor_customizer_label( 'academic_tutor_woo_product_border_radius', 'Woocommerce Product Border Radius' );
		academic_tutor_customizer_label( 'academic_tutor_woocommerce_product_sale', 'Woocommerce Product Sale' );
		academic_tutor_customizer_label( 'academic_tutor_related_product_display_setting', 'Woocommerce Related Products' );

		// Colors
		academic_tutor_customizer_label( 'academic_tutor_theme_color', 'Theme Color' );
		academic_tutor_customizer_label( 'background_color', 'Colors' );
		academic_tutor_customizer_label( 'background_image', 'Image' );

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

		// Header 
		academic_tutor_customizer_label( 'academic_tutor_header_search_setting', 'Search' );
		academic_tutor_customizer_label( 'academic_tutor_header_btn_text', 'Header Button' );

		//Slider
		academic_tutor_customizer_label( 'academic_tutor_banner_section_setting', 'Banner' );
		academic_tutor_customizer_label( 'academic_tutor_banner_review_head', 'Client Review' );

		//Products
		academic_tutor_customizer_label( 'academic_tutor_service_section', 'Service Section' );

		//Footer
		academic_tutor_customizer_label( 'academic_tutor_footer_widget_content_alignment', 'Footer' );
		academic_tutor_customizer_label( 'academic_tutor_show_hide_copyright', 'Copyright' );

		//Post setting
		academic_tutor_customizer_label( 'academic_tutor_post_page_title', 'Post Settings' );

		//Single post setting
		// academic_tutor_customizer_label( 'academic_tutor_single_post_page_content', 'Single Post Settings' );
		academic_tutor_customizer_label( 'academic_tutor_single_post_thumb', 'Single Post Setting' );
		academic_tutor_customizer_label( 'academic_tutor_single_post_comment_title', 'Single Post Comment' );
	

	});

})( jQuery );
