var correspondancesIndiceKm = {0: 0, 1: 5, 2: 10, 3: 20, 4: 50, 5: 200, 6: 200};
var correspondancesKmIndice = {0: 0, 5: 1, 10: 2, 20: 3, 50: 4, 200: 6};
$(document).ready(function (s){
	$('.sliderProximite').slider({ steps: 6, min: 0, max: 6, range: true, change: coloreRange});


});


function coloreRange()
{
	
	$(this).find('.divValeur').removeClass('couleurHover');
	var currentIndex = $(this).slider("value");
	$(this).find('.divValeur').each(function (s){
		var tabid = $(this).attr('id').split('_');
		if (tabid[1]<=currentIndex)
		{
			$(this).addClass('couleurHover');
		}
	});
	
	var tabIdSlider = $(this).attr("id").split("_");

	if (tabIdSlider[1])
	{

		$("#"+tabIdSlider[1]).val(correspondancesIndiceKm[currentIndex]);
		
		
	}
	
}