//fonction pour décrypter les emails grâce à javascript pour détourner les spambots

function decryptMailLink(codelist, description, atagattr) {
	var thiscode, thischar;
	var CodeString = new String(codelist);
	var CodedArray = CodeString.split('|');
	var L = CodedArray.length;
	var AddrDecoded = '';
	for (var x=0; x < L; x++) {
		thiscode = CodedArray[x];
		thischar = String.fromCharCode( thiscode - L );
		AddrDecoded += thischar;
	}
	atagattr = atagattr ? ' ' + atagattr : '';
	if (!description) description = AddrDecoded; // if no description supplied, display email address
	var strOutput = '<a href=\"mailto:'+AddrDecoded+'\"' + atagattr+'>' + description + '</a>';
	document.write(strOutput);
}

/*
fonction de cryptage

function cryptMailLink(addr, description, atagattr) {
  var thiscode;
  var AddrEncoded = "";
  var L = addr.length;
  for (var x=0; x < L; x++) {
	thiscode = addr.charCodeAt(x) + L;
	AddrEncoded += thiscode;
	if (x < L - 1) AddrEncoded += "|";
  }
  var strPrompt = "<" + "script>decryptMailLink('" + AddrEncoded + "'";
  if (description || atagattr) strPrompt += ", '" + description + "'";
  if (atagattr) strPrompt += ", '" + atagattr + "'";
  strPrompt += ")<" + "/script>";
  window.prompt('Copy and paste this where you want your mailto link to appear!', strPrompt);
  return false;
}
*/
