/* 
= Find external links on the page and add the rel=external attribute
* Version: 1.0
* URL: elbone.com.au
*/
// The regular expression
var a = new RegExp('/' + window.location.host + '/'); // url
var e = new RegExp('@'); // emails addresses
var c = new RegExp('callto:'); // phone numbers
jQuery('a').each(function() {
	if(!a.test(this.href) && !e.test(this.href) && !c.test(this.href)) {
		jQuery(this).attr('rel', 'external');;
		jQuery(this).click(function(event) {
	       event.preventDefault();
	       event.stopPropagation();
	       window.open(this.href, '_blank'); // Open in new tab/window
        });
    }
});

// Style like this in css
// a[rel="external"]:after { content: "\0020\279D\0020"; }