﻿
//-----------------------
// begin encoding emails 
//-----------------------
// open the client email with the specified address
function showMailTo(encodedEmail)
{
  // do the mailto: link
  //location.href = "mailto:" + decodeEmail(encodedEmail);
  location.href = decodeEmail(encodedEmail);
}

function showEmail(encodedEmail)
{
  document.write (decodeEmail(encodedEmail));
}


// display the email address in the statusbar
function displayStatus(encodedEmail)
{
  //window.status = "mailto:" + decodeEmail(encodedEmail);
  window.status = decodeEmail(encodedEmail);
}

// clear the statusbar message
function clearStatus()
{
  window.status = "";
}

// return the decoded email address
function decodeEmail(encodedEmail)
{
  var email = "";

  for (i=0; i < encodedEmail.length;)
  {
    var letter = "";
    letter = encodedEmail.charAt(i) + encodedEmail.charAt(i+1)

    email += String.fromCharCode(parseInt(letter,16));
    i += 2;
  }
  
  return email;
}

//-----------------------
// einde encoding emails 
//-----------------------
