function dec(x) {
 z="";
 for (i=0;i<x.length/2;i++){
  y=parseInt(x.substr(i*2,2),16)^(i+1);
  z+=String.fromCharCode(y);
  }
  return(z);
}

function do_magic(id){
pref="6C636A6871693D";
node = id;
element = document.createElement('a');
url = dec(pref) + dec(node.firstChild.nodeValue);
element.setAttribute("href",url);
element.appendChild(document.createTextNode(dec(node.firstChild.nodeValue)));
node.removeChild(node.firstChild);
node.appendChild(element);
}

function run_magic(){
spans = document.getElementsByTagName("span");
for(j=0;j<spans.length;j++){
  if(spans[j].className=="magic"){
    do_magic(spans[j]);
    spans[j].style.visibility = "visible";
  }
}
}

