﻿$(document).ready(function() {
    $('#bd a:not(.popupwindow)').filter(function() {  
        var theHref = this;  
        if (theHref.hostname && theHref.hostname !== location.hostname) {  
            $(theHref).not(".noAutoIcon").addClass("offSite");  
            $(theHref).not(".noAutoLink").bind('click keypress', function(event) {  
                var code=event.charCode || event.keyCode;  
                if (!code || (code && code == 13)) {  
                    if(pageTracker){  
                        var fixedLink = this.href;  
                        fixedLink = fixedLink.replace(/https?:\/\/(.*)/,"$1");  
                        fixedLink = '/outgoing/' + fixedLink;  
                        pageTracker._trackPageview(fixedLink);  
                    };  
                };  
            });  
        };  
    });
});