$(document).ready(function(){
  $("a").filter(function() {
	h = this.hostname.split(":");
    return h[0] && h[0] !== location.hostname;
  }).attr('target', '_blank');
});