﻿// open the client email with the specified address
function showCont(encodedCont)
{
  // do the mailto: link
  location.href = "mailto:" + decodeCont(encodedCont);
}

// display the email address in the statusbar
function displayStatus(encodedCont)
{
  window.status = "mailto:" + decodeCont(encodedCont);
}

// clear the statusbar message
function clearStatus()
{
  window.status = "";
}

// return the decoded email address
function decodeCont(encodedCont)
{
  var cont = "";
  for (i=0; i < encodedCont.length;)
  {
    // holds each letter (2 digits)
    var letter = "";
    letter = encodedCont.charAt(i) + encodedCont.charAt(i+1)

    // build the real email address
    cont += String.fromCharCode(parseInt(letter,16));
    i += 2;
  }
  
  return cont;
}
