// 2020Technologies - Google Analytics integration
// v1.0 2011-08-16 - initial version
jQuery(document).ready(function() {
    // outbound links tracking (except addthis and other social interactions)
    jQuery('a[href^="http"]:not([href*="addthis.com"]):not([href*="//' + location.host + '"]):not([class="column3"])').live('click', function(e) {
        _gaq.push(['_trackEvent', 'outbound', 'click', this.href.replace(/^.*\/\//, '')]);
    });

    // mailto links tracking
    jQuery('a[href^="mailto"]').live('click', function(e) {
        _gaq.push(['_trackSocial', 'mailto', this.href.replace(/^.*\/\//, '')]);
    });

    // media links tracking
    jQuery('a[href^="/~/media/"]').live('click', function(e) {
        _gaq.push(['_trackPageview', this.href]);
    });

    // Track Social "Let's interact" in footer
    jQuery('.column3 a').live('click', function() {
        _gaq.push(['_trackSocial', jQuery(this).attr('class'), 'subscribe']);
    });

    // addThis Track Social
    typeof addthis != "undefined" && addthis.addEventListener('addthis.menu.share', function (e) {
        _gaq.push(['_trackSocial', 'addthis', e.data.service, e.data.url]);
    });

});
