﻿String.prototype.startsWith = function(str) {
    return (this.indexOf(str) === 0);
}

$(function() {
    $("a.emr").livequery(function() {
        var email = $(this).attr("href").replace("n@f", "@");
        if (!email.startsWith("mailto:")) {
            $(this).attr("href", "mailto:" + email);
            if ($(this).text() === "") {
                $(this).text(email);
            }
        }
    });
});
