function Text()
{
}

Text.decryptDocument = function()
{
    var tags = document.getElementsByTagName("SPAN");
    for (var tag, i = 0, ix = tags.length; i < ix; ++i) {
        tag = tags[i];
        if (tag.className.match(/\bencrypted\b/)) {
            tag.innerHTML = Text.decrypt(tag.innerHTML);
            tag.className = tag.className.replace(/\bencrypted\b/, "");
        }
    }
    tags = document.getElementsByTagName("A");
    for (var email, i = 0, ix = tags.length; i < ix; ++i) {
        tag = tags[i];
        if (tag.className.match(/\bencrypted\b/)) {
            email = Text.decrypt(tag.innerHTML);
            // tag.href = "mailto:" + email;
            tag.href = "javascript:emailWIN('" + email + "');";
            tag.innerHTML = email;
            tag.className = tag.className.replace(/\bencrypted\b/, "");
        }
    }
}

Text.encrypt = function(plainText)
{
    var encryptedText = [];
    for (var i = plainText.length - 1; i >= 0; --i) {
        encryptedText.push(plainText.charCodeAt(i));
    }
    return encryptedText.join("-");
}

Text.decrypt = function(cryptText)
{
    cryptText = cryptText.split("-");
    plainText = "";
    for (var i = cryptText.length - 1; i >= 0; --i) {
        plainText += String.fromCharCode(cryptText[i]);
    }
    return plainText;
}
