Javascript mailto links

I generate the mailto: link on my contact page using javascript. The intention is to make my address less visible to address-harvesting web crawlers. I have no idea how effective this is, but as I had never written any javascript before it seemed like a nice simple project to start with.

The function looks for elements with id attributes matching its argument list. For the script to make sense these elements should be anchor tags without href attributes. It replaces their contents with a link of the form argument@domain (domain should be set to something appropriate inside the script), so the original content of the tags should be the text to be displayed to user-agents that do not support javascript, so something like this: user [at] example [dot] com, perhaps.

 * Copyright 2005, Sam Pearson 
 * Available under the terms of the GNU Public License:

function write_mailto_links() {
  var at = '@';
  var domain = '';
  for  ( var i = 0 ; i < arguments.length; i++ ) {
    var user = arguments[i];
    var linktext = document.createTextNode( user + at + domain );
    if ( document.getElementById( user ) ) {
      var mlink = document.getElementById( user );
      var oldtext = mlink.firstChild;
      mlink.setAttribute('href', "mailto:" + user + at + domain);
      mlink.replaceChild( linktext, oldtext );

I'm sure that there's a better way to do this, but this works so I'm using it for the time being. I'd like to play around a bit more with javascript, but for various reasons I haven't had the time recently. Any feedback is appreciated.