//
//   jsMail, jsMailFull, jsMailShort
//
//   These three scripts can be used to help hide email addresses from spammers. 
//   Basically, you can use these scripts so any email address doesn't really show
//   in the code, but it will show up when an average user visits the page.
//
//   Basic premise is that spambots are not going to be parsing JavaScript because
//   of the load introduced.
//
//   Specific usage notes for each individual script are included below.
//
//   -----------------------------------------------------------------
//
//   jsMail(fake_address)
//
//   To use this script, call it as follows. Let's say the intended
//   recipient is joeblow@ee.washington.edu. You'd put the following
//   bit of code into your page:
//
//       <script language="JavaScript">
//       <!--
//       jsMail("joeblow_at_ee");
//       // -->
//       </script>
//
//   Note that this can be used for any "washington.edu" address. If the person's
//   e-mail was "janeblow@u.washington.edu", you'd use the string "jane_at_u" in the
//   obvious places in the code.
//

function jsMail(raw_address)
  {
  var this_address = raw_address.split("_at_");
  document.write("<a href=\"mailto:" + this_address[0] + "@" + this_address[1] +
    ".washington.edu\">" + this_address[0] + "@" + this_address[1] + ".washington.edu</a>");
  return;
  }

//
//   jsMailFull(fake_address)
//
//   To use this script, call it as follows. Let's say the intended
//   recipient is joeblow@comcast.net. You'd put the following
//   bit of code into your page:
//
//       <script language="JavaScript">
//       <!--
//       jsMail("joeblow_at_comcast_dot_net");
//       // -->
//       </script>
//       <noscript>
//       Sorry, e-mail address display requires JavaScript<br>
//       </noscript>
//
//   Note that this can be used for any normal e-mail address. If the person's
//   e-mail was "janeblow@u.washington.edu", you'd use the string "jane_at_u" in the
//   obvious places in the code.
//

function jsMailFull(raw_address)
  {
  var this_address = raw_address.split("_at_");
  var user_account = this_address[0];
  var domain_address = this_address[1].replace(/_dot_/g,".");
  document.write("<a href=\"mailto:" + user_account + "@" + domain_address +
    "\">" + user_account + "@" + domain_address + "</a>");
  return;
  }

//
//   jsMailShort(fake_address)
//
//   Only difference between this and jsMail is this one displays a "short"
//   version of the email address
//
//   To use this script, call it as follows. Let's say the intended
//   recipient is joeblow@ee.washington.edu. You'd put the following
//   bit of code into your page:
//
//       <script language="JavaScript">
//       <!--
//       jsMail("joeblow_at_ee");
//       // -->
//       </script>
//
//   Note that this can be used for any "washington.edu" address. If the person's
//   e-mail was "janeblow@u.washington.edu", you'd use the string "jane_at_u" in the
//   obvious places in the code.
//

function jsMailShort(raw_address)
  {
  var this_address = raw_address.split("_at_");
  document.write("<a href=\"mailto:" + this_address[0] + "@" + this_address[1] +
    ".washington.edu\">" + this_address[0] + "@" + this_address[1] + "</a>");
  return;
  }
