Create a file containing this piece of javascript.
if (Drupal.jsEnabled) { $(document).ready(function() { $("a[@href^=http]").each(function() { if(this.href.indexOf(location.hostname) == -1) { $(this).click(function(){window.open(this.href);return false;}); } }); }); }
<?php function _phptemplate_variables($hook, $vars) { if ($hook == 'page') { drupal_add_js(path_to_theme().'/js/scripts.js'); $vars['scripts'] = drupal_get_js(); return $vars; } return array(); } ?>