if (typeof jQuery == 'function') {
    jQuery(function() {
        jQuery('a[href*="http://"]').click(function() {
            if (this.href.indexOf(document.domain) == -1) {
                _gaq.push(['pageTracker._trackEvent', 'click-exit', 'exit to ' + jQuery(this).attr('href')]);
            }
        });
    });
}
else {
    window.onload = function () {
    var links = document.getElementsByTagName('a');for (var x=0; x < links.length; x++) {links[x].onclick = function () {
        var mydomain = new RegExp(document.domain, 'i');
        if(!mydomain.test(this.getAttribute('href'))) {
            _gaq.push(['pageTracker._trackEvent', 'click-exit', 'exit to ' + jQuery(this).attr('href')]);
        }};
    }};
}
