(function($) {
	
	$.fn.gestion_carousel = function (params) {
		//alert('#'+params.id_control_left);
		var slide_index = 1;
		var dist = null;
		$('#'+params.id_control_left).on('click', function(){alert($('.carousel-inner > .item.active').attr('class'));
			$('.carousel-inner > .item.active').toggleClass('left').toggleClass('active left');
			$('.carousel-inner > .item').toggleClass('active');
			//dist = $('#'+params.id_carousel_inner).position().left - $($('.'+params.class_slide).get(0)).innerWidth(); alert(dist);
			//$('#'+params.id_carousel_inner).animate({left: dist+'px'});
		});
		/*
		id_carousel
		mode_slider
		
		id_list_indicators
		class_indicator
		class_indicator_active
		target_indicator
		
		id_carousel_inner
		class_slide
		class_slide_active
		
		id_control_left
		id_control_right
		*/
	};

	$.fn.set_filters = function (params) {
		$('#'+params.id_input_filter).on("keyup", function() {
			var value = $(this).val().toLowerCase(); $('#btn_imp_save').text(value);
			$('#'+params.id_parent+' .inbox-item').filter(function(index) {//alert(index);
				var id_elt=params.id_parent+'_inbox-item'+index;
				$(this).attr('id', id_elt);
				$(this).find(".inbox-item-author").each(
					function()
					{
						$('#'+id_elt).toggle($(this).text().toLowerCase().indexOf(value) > -1);
					}
				)
			});
	    });
	};      

	
})(jQuery);
