/* UTILISATION
 * 
 * Création d'un lien
 * <span onclick="link(lien_encodee);" >LINK</span>
 * 
 * Pour obtenir lien_encodee à partir de lien
 * lien_encodee = encode(lien);
 * 
 * EXEMPLE
 * On veut créer un lien sur ce span vers 'ceci/est/le/lien/vers/me_creer_une_alerte.php'
 * console.log(encode('../ceci/est/le/lien/vers/me_creer_une_alerte.php'));
 * -> 112fhfl2hvw2oh2olhq2yhuv2phbfuhhubxqhbdohuwh1sks
 * 
 * Le span devient :
 * <span class="highlight" onclick="link('112fhfl2hvw2oh2olhq2yhuv2phbfuhhubxqhbdohuwh1sks');" >Me créer une alerte</span>
 * window.location.href = decode(l);
 */

function link(l){
	window.location.href = l;
}

function decode(l){
	var nl = "";
	for(var i = 0; i < l.length; i++){
		nl += String.fromCharCode(l.charCodeAt(i) - 3);
	}
	return nl;
}

function encode(l){
	var nl = "";
	for(var i = 0; i < l.length; i++){
		nl += String.fromCharCode(l.charCodeAt(i) + 3);
	}
	return nl;
}

