jQuery(document).ready(function($) {

	jQuery('input[name="lp_eu_status"]').click(function(e){
     var checkbox = $(this).serialize();
     var post_id = $("#post_eid").val();
     $('.cookie_switch').css('display','none');
	 $("#cookie_loader").addClass('dashicons-update').addClass('spin');
   
     
     //console.log(checkbox)
     var data = {
		'action': 'uc_c_my_action',
		'checkbox': checkbox ,
		'post_id': post_id     // We pass php values differently!
	};
	// We can also pass the url value separately from ajaxurl for front end AJAX implementations
	jQuery.post(ajax_object.ajax_url, data, function(response) {
		$("#cookie_loader").removeClass('dashicons-update').removeClass('spin');
		$('.cookie_switch').css('display','inline-block');
	});
});




	jQuery('input[name="lp-is_adult_page"]').click(function(e){
     var checkbox = $(this).serialize();
     var post_id = $("#post_aid").val();
		$('.adult_switch').css('display','none');
		$("#adult_loader").addClass('dashicons-update').addClass('spin');
     
     //console.log(checkbox)
     var data = {
		'action': 'uc_c_my_adult',
		'checkbox': checkbox ,
		'post_id': post_id     // We pass php values differently!
	};
	// We can also pass the url value separately from ajaxurl for front end AJAX implementations
	jQuery.post(ajax_object.ajax_url, data, function(response) {
		$("#adult_loader").removeClass('dashicons-update').removeClass('spin');
		$('.adult_switch').css('display','inline-block');

	});
});
	
});

