﻿jQuery(document).ready(function(){
    $("a").each(function(){
        var $a = jQuery(this); var href = this.href; var host = window.location.host.replace(/^(([^\/]+?\.)*)([^\.]{4,})((\.[a-z]{1,4})*)$/, '$3$4');
        if (this.href != null && !$a.is(".exempt") && $a.attr("target").length==0) {
            if (((this.href.match(/^http/)) && (! this.href.match(host)) && (! this.href.match(/ohiorc.org/)) && (! this.href.match(/^javascript/))) || ((this.href.match(/^\/redirect/)) || (this.href.match(/ohiorc.org\/redirect/))) ) {
                $a.attr('target','_blank'); $a.attr('title','Opens in new window');
            }
        }
    });
});
