(function(d, s) {
    var isBaseUrl = function (url) {
        url = url.substring(url.indexOf('://') + 3);
        var nextSlash = url.indexOf('/');
        return (nextSlash === -1) || (nextSlash === (url.length - 1));
    };

    var e = d.createElement(s);
    var r = window.parent.location.href;

    if ((window.self === window.top) && (!r || (r.substr(0, 4) !== 'http') || isBaseUrl(r))) {
        r = document.URL;
        console.log('Reload Go: Unable to retrieve page href, using document.URL instead: ' + r);
    }

    e.type  = 'application/javascript';
    e.async = true;
    e.src   = '//puredwts.us.intellitxt.com/go?ipid=28208&referer=' + encodeURIComponent(r) + '&script=r';

    d.getElementsByTagName(s)[0].parentNode.appendChild(e);
})(document, 'script');
