/*
 * jQuery To Obscure Email Address
 */
//$(document).ready(function() {
//		
//	$(function(){
//	
//		var spt = $("a:contains('dot com')");
//		var at = / at /;
//		var dot = / dot /g;
//		var addr = $(spt).text().replace(at,"@").replace(dot,".");
//		
//		$(spt).after('<a href="mailto:'+addr+'" title="Send an email">'+ addr +'</a>')
//		.hover(function(){window.status="Send a letter!";}, function(){window.status="";});
//		$(spt).remove();
//	});
//	$(function(){
//		var spt = $("a:contains('dot org')");
//		var at = / at /;
//		var dot = / dot /g;
//		var addr = $(spt).text().replace(at,"@").replace(dot,".");
//		
//		$(spt).after('<a href="mailto:'+addr+'" title="Send an email">'+ addr +'</a>')
//		.hover(function(){window.status="Send a letter!";}, function(){window.status="";});
//		$(spt).remove();
//	});
//
//});
$(document).ready(function() {

                        

jQuery.fn.mailme = function() {

    var at = / at /;

    var dot = / dot /g;

    this.each( function() {

        var addr = jQuery(this).text().replace(at,"@").replace(dot,".");

        var title = jQuery(this).attr('title')

        $(this)

            .after('<a href="mailto:'+addr+'" title="'+title+'">'+ addr +'</a>')

            .remove();

    });

};

 

//the line below will look for “a href” tags that contain .org and then it will use the function above to change the email.

            $("a:contains('dot org')").mailme();

            $("a:contains('dot com')").mailme();

});
