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

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

			// Global Color Setting

			if ( id === 'vr_games_global_color' || id === 'vr_games_heading_color' || id === 'vr_games_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vr_games_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'vr_games_scroll_hide' || id === 'vr_games_preloader_hide' || id === 'vr_games_sticky_header' || id === 'vr_games_products_per_row')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vr_games_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

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

			// Social Icon

			if ( id === 'vr_games_facebook_icon' || id === 'vr_games_twitter_icon' || id === 'vr_games_intagram_icon'|| id === 'vr_games_linkedin_icon'|| id === 'vr_games_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-vr_games_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			//  Header

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


			// Slider

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

			// About Us

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

			// Footer

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

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

		// Global Color Setting
		vr_games_customizer_label( 'vr_games_global_color', 'Global Color' );
		vr_games_customizer_label( 'vr_games_heading_color', 'Heading Typography' );
		vr_games_customizer_label( 'vr_games_paragraph_color', 'Paragraph Typography' );

		// General Setting
		vr_games_customizer_label( 'vr_games_preloader_hide', 'Preloader' );
		vr_games_customizer_label( 'vr_games_scroll_hide', 'Scroll To Top' );
		vr_games_customizer_label( 'vr_games_products_per_row', 'woocommerce Setting' );

		// Colors
		vr_games_customizer_label( 'vr_games_theme_color', 'Theme Color' );
		vr_games_customizer_label( 'background_color', 'Colors' );
		vr_games_customizer_label( 'background_image', 'Image' );

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

		// Social Icon
		vr_games_customizer_label( 'vr_games_facebook_icon', 'Facebook' );
		vr_games_customizer_label( 'vr_games_twitter_icon', 'Twitter' );
		vr_games_customizer_label( 'vr_games_intagram_icon', 'Intagram' );
		vr_games_customizer_label( 'vr_games_linkedin_icon', 'Linkedin' );
		vr_games_customizer_label( 'vr_games_pintrest_icon', 'Pintrest' );

		// Header
		vr_games_customizer_label( 'vr_games_header_search_setting', 'Header Search' );

		//Slider
		vr_games_customizer_label( 'vr_games_slider_section_setting', 'Slider' );

		//About Us
		vr_games_customizer_label( 'vr_games_activities_section_setting', 'About Us' );

		//Footer
		vr_games_customizer_label( 'vr_games_footer_text_setting', 'Footer' );
	

	});

})( jQuery );
