function setOptions(selector,data,selected,all) {
	// console.log(data);
	var $el = $(selector);
	$el.empty(); // remove old options
	if (all) {
		$el.append($("<option></option>").attr("value",'').text('Tous'));
	}
	$.each(data, function(key, name) {
		console.log(name);
		if (key != null) {
			if (key == selected) {
				$el.append($("<option selected='selected'></option>").attr("value", key).text(name));
			} else {
				$el.append($("<option></option>").attr("value", key).text(name));
			}
		}
	});	
}
