 (function() {
        var hasSSL = %s;
        var path   = document.location.pathname;
        var proto  = (hasSSL || (document.location.protocol == 'https:'))
                     ? 'https:' : 'http:';
        if (path.match(/plain/)) {
          proto   = 'http:';
        }
        path      = path.replace(/\/+/, '/').replace(/\/$/, '');
        if (!path.match(/(?:\/|\/plain)$/)) {
          path   += '/';
        }
        var url   = proto + '//' + document.location.host + path;
        if (document