/* 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: "*"
		}, options);

		return this.each(function() {
			var address = $(this).attr("href");
			var formatedAddress = address.replace(settings.atsign, "@");
			//hack around mangoblog adding forward slash
			if (formatedAddress.charAt(0) == "/") {
				formatedAddress = formatedAddress.substr(1,formatedAddress.length);
			}
			$(this).attr("href", "mailto:" + formatedAddress);
		});
	};
})(jQuery);

$(document).ready(function() {
	$(".mailto").emailencode();
});
