(function($){  
	$.fn.openInANewWindow = function() {  
		
		return this.each(function() {  
			var links = $(this);
			
			// iterate over the jQuery object containing all the links 
			// on each one, append a message indicating that it will open the link in a new window
			links.each(function() {
				$(this).append(' <span class="notice-external-link">(opens in a new window)</span>');
			});
			
			// add an event listener to the jQuery object containing all the links
			// when it is clicked, open the link in a new window and prevent the browser from tring to follow the link in the current window
			links.click(function(event) {
				window.open(this, '_blank');
				event.preventDefault();
			});

		});  
	};  
})(jQuery);