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

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

			// Global Color Setting

			if ( id === 'camping_zone_first_color' || id === 'camping_zone_heading_color' || id === 'camping_zone_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-camping_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'camping_zone_scroll_hide' || id === 'camping_zone_preloader_hide' || id === 'camping_zone_sticky_header' || id === 'camping_zone_products_per_row'  || id === 'camping_zone_width_option' )  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-camping_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

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

			// Header Image

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

			// Social Icon

			if ( id === 'camping_zone_facebook_icon' || id === 'camping_zone_twitter_icon' || id === 'camping_zone_intagram_icon'|| id === 'camping_zone_linkedin_icon'|| id === 'camping_zone_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-camping_zone_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			//  Header

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


			// Slider

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

			// Services

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

			// Footer

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

			// Post Settings

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

			// Single Post Settings

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

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

		// Global Color Setting
		camping_zone_customizer_label( 'camping_zone_first_color', 'Global Color' );
		camping_zone_customizer_label( 'camping_zone_heading_color', 'Heading Typography' );
		camping_zone_customizer_label( 'camping_zone_paragraph_color', 'Paragraph Typography' );

		// General Setting
		camping_zone_customizer_label( 'camping_zone_preloader_hide', 'Preloader' );
		camping_zone_customizer_label( 'camping_zone_sticky_header', 'Sticky Header' );
		camping_zone_customizer_label( 'camping_zone_scroll_hide', 'Scroll To Top' );
		camping_zone_customizer_label( 'camping_zone_scroll_top_position', 'Scroll to top Position' );
		camping_zone_customizer_label( 'camping_zone_products_per_row', 'woocommerce Setting' );
		camping_zone_customizer_label( 'camping_zone_width_option', 'Site Width Layouts' );

		// Colors
		camping_zone_customizer_label( 'camping_zone_theme_color', 'Theme Color' );
		camping_zone_customizer_label( 'background_color', 'Colors' );
		camping_zone_customizer_label( 'background_image', 'Image' );

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

		camping_zone_customizer_label( 'camping_zone_post_layout', 'Post Layouts Settings' );

		camping_zone_customizer_label( 'camping_zone_404_page_main_heading', '404 Page Settings' );

		// Social Icon
		camping_zone_customizer_label( 'camping_zone_facebook_icon', 'Facebook' );
		camping_zone_customizer_label( 'camping_zone_twitter_icon', 'Twitter' );
		camping_zone_customizer_label( 'camping_zone_intagram_icon', 'Intagram' );
		camping_zone_customizer_label( 'camping_zone_linkedin_icon', 'Linkedin' );
		camping_zone_customizer_label( 'camping_zone_pintrest_icon', 'Pintrest' );

		// Header
		camping_zone_customizer_label( 'camping_zone_header_button_text', 'Header Option' );

		//Slider
		camping_zone_customizer_label( 'camping_zone_slider_background_image', 'Slider' );

		//Services
		camping_zone_customizer_label( 'camping_zone_services_heading', 'Services' );

		//Footer
		camping_zone_customizer_label( 'camping_zone_footer_widget_content_alignment', 'Footer' );
		camping_zone_customizer_label( 'camping_zone_show_hide_copyright', 'Copyright' );

		//Post setting
		camping_zone_customizer_label( 'camping_zone_post_page_title', 'Post Settings' );

		//Single post setting
		camping_zone_customizer_label( 'camping_zone_single_post_thumb', 'Single Post Settings' );
	

	});

})( jQuery );
