
var Mailto = Class.create();

Mailto.prototype = {
	initialize: function() {
		var target = $$('span[rel^=mailto]');
		for(i = 0; i < target.length; i++)
		{
			var span = target[i];
			var text = span.innerHTML;
			var href = "mailto:" + text.replace(' [at] ', '@').replace(' [dot] ', '.');
			span.innerHTML = '<a href="' + href + '">' + text + '</a>';
		}
    }
}

document.observe('dom:loaded', function () { new Mailto(); });
