function refresh_votre_espace() {
	jsload('votre-espace', '/moncompte/ajax/votre_espace/', true);
}

function refresh_vos_recherches() {
	jsload('vos-recherches', '/moncompte/ajax/vos_recherches/', true);
}

function refresh_vos_selections() {
	jsload('vos-selections', '/moncompte/ajax/vos_selections/', true);
}

function refresh_pied_dynamique() {
	jsload('contenu_pied_gauche', '/moncompte/ajax/pied_dynamique/', true);
}

var uid_bien_selection = null;

function ajouter_selection(type_selection, uid) {
	if (uid_bien_selection) return;
	uid_bien_selection = uid; // verrou pour empêche les appels concurrents
	var obj_ajout_selection;
	obj_ajout_selection = new PIMENTECH.util.LoadHTML('obj_ajout_selection', 'selection_retour', '/' + type_selection + '/ajax/ajout_selection/' + uid + '/');
	obj_ajout_selection.afterLoad = function () {
		var code_retour = document.getElementById('selection_retour');
		if (code_retour.innerHTML == 'ok') {
			document.getElementById('selection-lien-ajout-' + uid_bien_selection).style.display = 'none';
			document.getElementById('selection-lien-suppr-' + uid_bien_selection).style.display = 'inline';
			refresh_vos_selections();
		} else if (code_retour.innerHTML == 'redirect_login') {
			uid_bien_selection = null;
			window.location = '/moncompte/login/';
		}
		uid_bien_selection = null;
	}
	obj_ajout_selection.setSilence();
	obj_ajout_selection.load();
}

function suppr_selection(type_selection, uid) {
	if (uid_bien_selection) return;
	uid_bien_selection = uid; // verrou pour empêche les appels concurrents
	var obj_suppr_selection;
	obj_suppr_selection = new PIMENTECH.util.LoadHTML('obj_suppr_selection', 'selection_retour', '/' + type_selection + '/ajax/suppr_selection/' + uid + '/');
	obj_suppr_selection.afterLoad = function () {
		var code_retour = document.getElementById('selection_retour');
		if (code_retour.innerHTML == 'ok') {
			document.getElementById('selection-lien-ajout-' + uid_bien_selection).style.display = 'inline';
			document.getElementById('selection-lien-suppr-' + uid_bien_selection).style.display = 'none';
			refresh_vos_selections();
		} else if (code_retour.innerHTML == 'redirect_login') {
			uid_bien_selection = null;
			window.location = '/moncompte/';
		}
		uid_bien_selection = null;
	}
	obj_suppr_selection.setSilence();
	obj_suppr_selection.load();
}


function openWin(url) {
	var w = window.open(url);
	w.document.close();
	w.focus();
	return false;
}
