jQuery.fn.unmask = function(settings) { 
	settings = jQuery.extend({link: true}, settings);
	var regex = /\b([A-Z0-9._%-]+)\([^)]+\)((?:[A-Z0-9- ]+\.)+[A-Z]{2,6})\b/gi;
	return this.each(function(){ 
		if ($(this).is("a[@href]")) {
			
			if ($(this).attr('href').indexOf('mailto:') != 0) {
				$(this).attr('href', $(this).attr('href').replace(regex, "mailto:$1@$2"));
			} else {
				$(this).attr('href', $(this).attr('href').replace(regex, "$1@$2"));
			}
			
		} else {
   			$(this).html($(this).html().replace(regex, settings.link ? '<a href="mailto:$1@$2">$1@$2</a>' : "$1@$2")); 
		}
	}); 
};


// Auto Load all 'a' tags
$(function () {
	$('.unmask').unmask();
	$('a').unmask();
});
