If you're using jQuery, you can add new selectors to your objects. If you add this to your $(document).ready(...):
$.expr[':'].external = function(obj){ return !obj.href.match(/^mailto:/) && (obj.hostname != document.location.hostname); };
Then you can do things like $(a:external) and operate only on external links. Selectors in jQuery are very powerful and it's great to see it's very simple to add your own ones, which is not suprising, since lots of powerful things are easy in jQuery.
Comments !