﻿
var ProcessMailtos = new Class({
	initialize: function(stringReplacementHash) {
		this.stringReplacementHash = stringReplacementHash;
		$$('a[href^=mailto]').addEvent('click', this.processMailto.bindWithEvent(this));
	},
	processMailto: function(e) {
		var anchor = $(e.target);
		this.stringReplacementHash.each(function(value, key) {
			if (anchor.getProperty('href').indexOf(key) > -1) return anchor.setProperty('href', anchor.getProperty('href').replace(key, value));
		});
		return true;
	}
});

