jQuery to open external links in a new window

I need to open all external links in a site in a new window/tab. But I can’t trust the users to put a class or other data in the link. And I cannot trust them to add or remove the www. part of the domain name (if it’s even supposed to be there).

Javascript to the rescue!