﻿// rel="external" does not validate against XHTML Strict, this script sorts out validation issue
// and if JS is disabled it will open page in current window not new window.
// To use in HTML replace target="_blank" with rel="external"

function externalLinks() {
    if (!document.getElementsByTagName) return;

    var anchors = document.getElementsByTagName("a");

    for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
            anchor.target = "_blank";
            
	   // if (anchor.href.indexOf("thompsons.law.co.uk") != -1) {
           //     anchor.href += "?utm_source=TTUL";
          //  }
        }
    }
}
window.onload = externalLinks;


