/**
 * newwindow.js - Use jQuery to cause all <a rel="external" ...> elements to
 * open their links in a new window.
 *
 * Done this way because target="_blank" is not valid XHTML.
 */

$(function() {
    $('a[rel="external"]').each(function() {
	$(this).click(function(e) {
	    // stop the browser's normal response to a link click
	    // otherwise the link would open in both the new and current window
	    e.preventDefault();
	    e.stopPropagation();

	    window.open(this.href, "_blank");
	});
    });
});
