/* The thought here is simple: /if/ somebody has been to facebook,
   they might give a crap.  For everybody else, it's just an ugly
   annoying extra element on the page.

   I could have done this with CSS.  You're welcome JS blockers.
*/
(function () {
    if (!document.createElement) return;
    if (!document.getElementById) return;

    // purloined from http://www.merchantos.com/makebeta/tools/spyjax/
    function hasLinkBeenVisited(url) {
        var link = document.createElement('a');
        link.href = url;
        link.id = 'fbdetect';
        document.body.appendChild(link);
        if (link.currentStyle) {
            var color = link.currentStyle.color;
            if (color == '#ff0000')
                return true;
            return false;
        } else {
            link.setAttribute("href",url);
            link.setAttribute("id", 'fbdetect');
            var computed_style = document.defaultView.getComputedStyle( link, null );
            if (computed_style) {
                if (computed_style.color == 'rgb(255, 0, 0)')
                    return true;
            }
            return false;
        }
    }

    if (hasLinkBeenVisited('http://www.facebook.com/')) {
        var fbl = document.getElementById("offtoanothersite");
        fbl.style.visibility = "visible";
    }
})();
