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

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

			// Global Color Setting

			if ( id === 'timber_work_first_color' || id === 'timber_work_heading_color' || id === 'timber_work_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-timber_work_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'timber_work_scroll_hide' || id === 'timber_work_preloader_hide' || id === 'timber_work_sticky_header' || id === 'timber_work_products_per_row' || id === 'timber_work_scroll_top_position' || id === 'timber_work_products_per_row' || id === 'timber_work_width_option' || id === 'timber_work_nav_menu_text_transform')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-timber_work_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

			if ( id === 'timber_work_theme_color' || id === 'background_color' || id === 'background_image' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-timber_work_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-timber_work_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

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


			// Banner

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

			// Products

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

			// Footer

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

			// Post Settings

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

			// Single Post Settings

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

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

		// Global Color Setting
		timber_work_customizer_label( 'timber_work_first_color', 'Global Color' );
		timber_work_customizer_label( 'timber_work_heading_color', 'Heading Typography' );
		timber_work_customizer_label( 'timber_work_paragraph_color', 'Paragraph Typography' );

		// General Setting
		timber_work_customizer_label( 'timber_work_preloader_hide', 'Preloader' );
		timber_work_customizer_label( 'timber_work_scroll_hide', 'Scroll To Top' );
		timber_work_customizer_label( 'timber_work_scroll_top_position', 'Scroll to top Position' );
		timber_work_customizer_label( 'timber_work_products_per_row', 'woocommerce Setting' );
		timber_work_customizer_label( 'timber_work_width_option', 'Site Width Layouts' );
		timber_work_customizer_label( 'timber_work_nav_menu_text_transform', 'Nav Menus Text Transform' );

		// Colors
		timber_work_customizer_label( 'timber_work_theme_color', 'Theme Color' );
		timber_work_customizer_label( 'background_color', 'Colors' );
		timber_work_customizer_label( 'background_image', 'Image' );

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

		// Header 
		timber_work_customizer_label( 'timber_work_header_search_setting', 'Search' );
		timber_work_customizer_label( 'timber_work_header_btn_text', 'Header Button' );

		//Slider
		timber_work_customizer_label( 'timber_work_banner_section_setting', 'Banner' );
		timber_work_customizer_label( 'timber_work_banner_review_head', 'Client Review' );

		//Products
		timber_work_customizer_label( 'timber_work_service_section', 'Service Section' );

		//Footer
		timber_work_customizer_label( 'timber_work_footer_widget_content_alignment', 'Footer' );
		timber_work_customizer_label( 'timber_work_show_hide_copyright', 'Copyright' );

		//Post setting
		timber_work_customizer_label( 'timber_work_post_page_title', 'Post Settings' );

		//Single post setting
		timber_work_customizer_label( 'timber_work_single_post_page_content', 'Single Post Settings' );
	

	});

})( jQuery );
