/*

   $Header: eml.js  Revision:1.0  Saturday, January 07, 2006 10:54:36 AM  JohnB $

   $Log3: C:\Documents and Settings\Owner\My Documents\John\Computer Work\QVCS Archives\CodeLib\JavaScript\eml.kt $
   
     Yet Another Mailto Harvester Avoidance Script.
   
   Revision 1.0  by: JohnB  Rev date: 1/7/2006 10:58:12 AM
     Initial revision.
   
   $Endlog$

   This function is Yet Another Mailto Harvester Avoidance Script. Ultimately,
   of course, any client-side script is vulnerable to harvesting in the case
   that the spammer takes the trouble to program his spamBot to detect the
   function call and run the same code, but this one attempts to disguise it
   even more by breaking up the recognizable bits. You can also give the
   function another name if you want.

   The way it works is that you split up the email address into parts
   separated by punctuation (or anything else you want), and call the function
   with those parts plus a string containing the puncuation to put back in,
   all strung together. As the very first argument, pass the label you want
   the email address attached to, or just leave it blank to use the email
   address itself. For example:

      Simple example:
         Email address: user@company.com
         Call: eml( 'my email address', 'user', 'company', 'com', '@.' );

      Different number of arguments:
         Email address: me@thisplace.az.us
         Call: eml( '', 'me', 'thisplace', 'az', 'us', '@..' );

      Really tricky use (can you see what's happening?):
         Email address: myAddress1@yahoo.com
         Call: eml( '', 'my', 'ddress', 'ya', 'oo', 'com', 'A@h.' );

   Note that you can split the address into as many components as you want,
   because the function takes a variable number of arugments. The final
   argument must always contain two less than the number of arguments
   preceeding it.

*/

function eml() {
   argc = arguments.length - 1;
   result = '';
   for( i = 1; i < argc; ++i ) {
      result += arguments[i] + arguments[argc].substr(i-1,1);
   }
   result = '<a href="' + 'ma' + 'ilt' + 'o:' + result + '">'
            + ( arguments[0].length ? arguments[0] : result )
            + '</a>';
   document.write(result);
}