// send cloaked email
//
// Input:
//    x1 = mailbox name
//    x2 = domain name
//    x3 = optional text (if not displayed, use email address)
//    x4 = optional style
//
// Action:
//    display mailto link with properly formed email address
//
// Example:
// <script language="JavaScript" type="text/javascript">cloak_mail('joe','mail.com','Joe','mailstyle')</script> 

function cloak_mail(x1, x2, x3, x4) {
  if (x3 == null) {
    x3 = x1 + "@" + x2;
  }
  
  if (x4 == null) {
    document.write('<a href="' + 'ma' + 'ilto:' + x1 + '@' + x2 + '">' + x3 + '</a>')
  } else {
    document.write('<a class="' + x4 + '" href="' + 'ma' + 'ilto:' + x1 + '@' + x2 + '">' + x3 + '</a>')
  }
}
