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

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

			// Global Color Setting

			if ( id === 'corporate_office_global_color' || id === 'corporate_office_heading_color' || id === 'corporate_office_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-corporate_office_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'corporate_office_scroll_hide' || id === 'corporate_office_preloader_hide' || id === 'corporate_office_sticky_header' || id === 'corporate_office_products_per_row' || id === 'corporate_office_width_option' || id === 'corporate_office_nav_menu_text_transform')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-corporate_office_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

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

			// Header Image

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

			// Social Icon

			if ( id === 'corporate_office_facebook_icon' || id === 'corporate_office_twitter_icon' || id === 'corporate_office_intagram_icon'|| id === 'corporate_office_linkedin_icon'|| id === 'corporate_office_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-corporate_office_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			//  Header

			if ( id === 'corporate_office_topbar_phone_text' || id === 'corporate_office_topbar_text' || id === 'corporate_office_topbar_mail_text' || id === 'corporate_office_header_button_text' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-corporate_office_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Slider

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

			// About Us

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

			// Footer

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

			// Post Setting

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

			// Single Post Setting

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

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

		// Global Color Setting
		corporate_office_customizer_label( 'corporate_office_global_color', 'Global Color' );
		corporate_office_customizer_label( 'corporate_office_heading_color', 'Heading Typography' );
		corporate_office_customizer_label( 'corporate_office_paragraph_color', 'Paragraph Typography' );

		// General Setting
		corporate_office_customizer_label( 'corporate_office_preloader_hide', 'Preloader' );
		corporate_office_customizer_label( 'corporate_office_sticky_header', 'Sticky Header' );
		corporate_office_customizer_label( 'corporate_office_scroll_hide', 'Scroll To Top' );
		corporate_office_customizer_label( 'corporate_office_products_per_row', 'woocommerce Setting' );
		corporate_office_customizer_label( 'corporate_office_width_option', 'Site Width Layouts' );
		corporate_office_customizer_label( 'corporate_office_nav_menu_text_transform', 'Nav Menus Text Transform' );

		// Colors
		corporate_office_customizer_label( 'corporate_office_theme_color', 'Theme Color' );
		corporate_office_customizer_label( 'background_color', 'Colors' );
		corporate_office_customizer_label( 'background_image', 'Image' );

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

		corporate_office_customizer_label( 'corporate_office_post_layout', 'Post Layouts Settings' );

		corporate_office_customizer_label( 'corporate_office_404_page_main_heading', '404 Page Settings' );

		// Social Icon
		corporate_office_customizer_label( 'corporate_office_facebook_icon', 'Facebook' );
		corporate_office_customizer_label( 'corporate_office_twitter_icon', 'Twitter' );
		corporate_office_customizer_label( 'corporate_office_intagram_icon', 'Intagram' );
		corporate_office_customizer_label( 'corporate_office_linkedin_icon', 'Linkedin' );
		corporate_office_customizer_label( 'corporate_office_pintrest_icon', 'Pintrest' );

		// Header
		corporate_office_customizer_label( 'corporate_office_topbar_text', 'Topbar Text' );
		corporate_office_customizer_label( 'corporate_office_topbar_phone_text', 'Phone Number' );
		corporate_office_customizer_label( 'corporate_office_topbar_mail_text', 'Email Address' );
		corporate_office_customizer_label( 'corporate_office_header_button_text', 'Header Button' );

		//Slider
		corporate_office_customizer_label( 'corporate_office_top_slider_page1', 'Slider' );
		corporate_office_customizer_label( 'corporate_office_services_box_icon1', 'Service' );

		//About Us
		corporate_office_customizer_label( 'corporate_office_about_us_left_images', 'About Us' );
		corporate_office_customizer_label( 'corporate_office_about_us_box_icon0', 'About Icon' );

		//Footer
		corporate_office_customizer_label( 'corporate_office_footer_bg_image', 'Footer' );
		corporate_office_customizer_label( 'corporate_office_show_hide_copyright', 'Copyright' );

		// Post Setting
		corporate_office_customizer_label( 'corporate_office_post_page_title', 'Post Setting' );

		//Single Post Setting
		corporate_office_customizer_label( 'corporate_office_single_post_thumb', 'Single Post Setting' );

	});

})( jQuery );
