/*! Copyright (c) 2009 Nick Tomkin (http://www.2gen.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.0
 */

$.fn.deobfuscate = function(options) {
	var defaults = {
		delimiter: ':'
	}
	
	var opts = $.extend(defaults, options);
	
	return this.each(function () {
		var currentEmailAddress = $(this).html();
		currentEmailAddress = currentEmailAddress.replace(defaults.delimiter, '@');
		currentEmailAddress = currentEmailAddress.replace(defaults.delimiter, '.');
		
		$(this).wrapInner('<a href=\"mailto:' + currentEmailAddress + '\">' + currentEmailAddress + '</a>');
	});
};

$.fn.deobfuscate.defaults = {
	delimiter: ':'
};

