// ======= confirmer une suppression =======
function confirmed(msg){
 	if(!confirm("voulez vous r\351ellement supprimer cet \351l\351ment ?\n"+msg)) return false;
	else return true;
}

// ======= Décoder un mail =======
function mail_decode(st,lab,xk){
  var r="";for(i=0;i<st.length;i++)r+=String.fromCharCode(xk^st.charCodeAt(i));
	if (lab=='') lab = r;
  document.write ('<a href="mailto:'+r+'">'+lab+'</a>');
}

// ======= Copier dans le Presse Papier ======
function copy2Clipboard(obj)
{
 	window.clipboardData.setData('Text', obj);
}

// ======= Affiche une popup au centre de l'écran =======
function popupCentre(page,largeur,hauteur,options) {
	var top = (screen.height-hauteur)/2;
	var left = (screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

// ======= Fait clignoter le div toutes les x secondes =======
// Utilisation : <script language="javascript">var blink_interval = setInterval('Blink("legendAlertesDomaines", 3)', 500);</script>
var i_blink=0;
function Blink(layerName, nbrefois){
	
	if(i_blink%2==0){
		document.getElementById(layerName).style.visibility="visible";
	}
	else{
		document.getElementById(layerName).style.visibility="hidden";
	}
	
	if(nbrefois != 0)
	{
		if(i_blink > nbrefois*2-1){
			window.clearInterval(blink_interval);
		}
	}
	i_blink++;
}
