window.addEvent('domready', function() {
    // modified from http://joesong.com/2009/11/external-links-in-new-window-passive-and-with-mootools/ 
    // to avoid using the 'target' attribute, which is not part of xhtml 1.0 strict
    var currentDomain = window.location.host;
    $(document.body).addEvent('click', function(evt) {
	var target = $(evt.target);
	if (target.get('tag') !== 'a') {
	    target = target.getParent();
	}
 
	if (target && target.get('tag') === 'a' && target.get('href').test('http') && !target.get('href').test(currentDomain)) {
	    window.open(target.get('href'), '_blank');
	    return false;
	}
    });
});
