/** Ajoute des éléments au select des communes pour form (index)
		en fonction du departement sélectionné **/
function findCities(id_departement) {
//alert(this);
	jQuery.ajax({
	  type: 'POST',
	  url: '/cities-json',
	  data: {'id_departement': id_departement},
	  success: function(json) {
			cities = eval('(' + json + ')');
			var allOptions = jQuery('#ajaxCities');
			allOptions.empty();
			
			if(cities.length == 0) {
				jQuery('#ajaxCities').hide();
				return;	
			}
			
			for(var key in cities) {
				var aCity = cities[key];

				var temp = aCity.split("#");
				var anOption = '<option value="'+temp[0]+'" style="width:165px;">'+temp[1]+'</option>';
				//var anOption = new Element('option',{'value':temp[0],'text':temp[1]+" ["+temp[2]+"]",'selected':"selected"});

				jQuery('#ajaxCities').append(anOption);
			}
		
			jQuery('#ajaxCities').show();
	  },
	  dataType: 'JSON'
	});
/*
	var req = new Request.JSON({
		// url
		'url'		:'/cities-json',
		// complete action
		'onComplete':function(cities){
			
			// On vide la liste
			
			v
		}
	});
		
	req.post({
		// post parameter
		'id_departement': selectList.value
	});
*/
}	

