Project

General

Profile

1 989 aldus
2 991 Ruebenwurz
// $Id$
3 989 aldus
4
5
function mdcr(a,b) {
6
  location.href=sdcr(a,b);
7
}
8
9
function sdcr(a,f) {
10
  var b = a.charCodeAt(a.length-1) -97;
11
  var c=""; var e; var g;
12
13
  for(var d=a.length-2; d>-1; d--) {
14
    if(a.charCodeAt(d) < 97) {
15
      switch(a.charCodeAt(d)) {
16
        case 70: g=64; break;
17
        case 90: g=46; break;
18
        case 88: g=95; break;
19
        case 75: g=45; break;
20
        default: g=a.charCodeAt(d); break;
21
      }
22
      c+=String.fromCharCode(g)
23
    } else {
24
      e=(a.charCodeAt(d) - 97 - b) % 26;
25
      e+=(e<0 || e>25) ? +26 : 0;
26
      c+=String.fromCharCode(e+97);
27
    }
28
  }
29
  return "mailto:"+c+f;
30
}