/* Written by: Mark Woodward (January, 2002)
     Woody's JavaScripts at: woody.cowpi.com/javascripts.html

     The function writeEmailLink uses JavaScript to write your hidden
     email link within your HTML document.

     Pass the following arguments to writeEmailLink:
       address     = coded email address
       description = description of link as seen in browser
                     (can be text or <img> tag)

     To hide your email address, replace the @ symbol with $ and reverse the
     position of the username and domain name. For example,
     username@domain.com becomes domain.com$username             */

  function writeEmailLink(address,description) {
    var i = address.indexOf('$');
    var fixedEmail = address.substring(i+1,address.length) + String.fromCharCode(64) + address.substring(0,i);
    var prefix = 'mai' + 'lto:';  // Unicode for 'mai' + 'lto:'
    var linkStr = '<a href="' + prefix + fixedEmail + '" title="' + fixedEmail + '">';
    document.write(linkStr + description + '<\/a>');
    }
