﻿/* LiteTest email encode
* Version 0.9
* Author Jonas Hagstedt
* URI: http://www.litetest.com/Resources.aspx/EmailEncode
* Released with the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
(function($) {
    $.fn.emailencode = function(options) {
        var settings = jQuery.extend({
            atsign: " [at] "
        }, options);

        return this.each(function() {
            var address = $(this).attr("href");
            var formatedAddress = address.replace(settings.atsign, "@");
            $(this).attr("href", "mailto:" + formatedAddress);
            //alert($(this).attr("href"));
            if ($(this).attr("href") == "mailto:ncars@ncars.on.net") { $(this).text("ncars@ncars.on.net") };
        });
    };
})(jQuery);
