//generate email-sending function with the encoded email address
function sendEmail(encodedEmail) {
    // do the mailto: link
    location.href = "mailto:" + decodeEmail(encodedEmail);
}

// return the decoded email address
function decodeEmail(encodedEmail) {
    // holds the decoded email address
    var email = "";

    for (i = 0; i < encodedEmail.length; i += 2) {
        
        // holds each letter (2 digits)
        var letter = "";
        letter = encodedEmail.charAt(i) + encodedEmail.charAt(i + 1);

        // parse it to normal
        email += String.fromCharCode(parseInt(letter, 16));

    }

    return email;
}

// display the email address in the statusbar
function displayStatus(encodedEmail) {
    window.status = "mailto:" + decodeEmail(encodedEmail);
}
//clear the status bar
function clearStatus() {
    window.status = "";
}

