function confirmer(adresse) {
	if (confirm("Voulez vous vraiment supprimer ?"))
		window.location.href = adresse ;
}
function gebi(id) {
	//if(document.getElementById(id)) return document.getElementById(id);
	return document.getElementById(id);
	//return false;
}

function ouvrepopup(lien,titre,option){
	//'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=no, width=350, height=350'
	window.open(lien,titre,option);	
}

function ouvrirAide(nom_fichier) {
	option = 'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=yes, scrollbars=yes, width=400, height=600';
	window.open(nom_fichier,"Aide",option);
}

// Lire un cookie d'apres son nom - retour de la valeur sinon null
function lireCookie(nom){
	var cookie = document.cookie;
	var pos = cookie.indexOf(nom+'=');
	if(pos != -1) {
		var start = pos + nom.length + 1;
		var end = cookie.indexOf(";",start);
		if(end == -1) end = cookie.length;
		var value = cookie.substring(start,end);
		value = unescape(value);
		return value;
		//alert(start + '-' + value);
	} else {
		//alert(cookie);
		return null;
	}
}

// Ecrire un cookie
function ecrireCookie(nom,valeur){
	document.cookie = nom + "=" + escape(valeur);
}

// on sélectionne le bouton radio correspondant au cookie
function initialiseRedirection(page){
	var cookie = lireCookie('volorio[' + page + ']');
	if(cookie > 0) {
		document.form1.redirection[cookie].checked = true;
	}
}

// afficher / masquer un objet
function afficherMasquer(objet){
	var id = document.getElementById(objet);
	if(id.style.display == "none" || id.style.display == "") {id.style.display = "block";} else {id.style.display = "none";}
}
