$("a[href^='http://']").each(function(){
    var thehref = $(this).attr('href');
    if(!thehref.match(window.location.host)){
        $(this).attr('target', '_blank');
    }
});
