jQuery(document).ready(function($) {
    
    /* Event tracking for email clicks */
    $('a[href^="mailto:"]').live('click', function(event) {
        var href = $(this).attr('href');
        try {
            _gaq.push(['_trackEvent', 'email', 'click', href]);
        } catch(err) {}
    });
    
    /* Event tracking for CTA buttons */
    $('.cta-button').click(function(event) {
        event.preventDefault();
        var href = $(this).attr('href');
        try {
            _gaq.push(['_trackEvent', 'cta', 'click', href]);
            _gaq.push(function() {document.location = href;});
        } catch(err) {document.location = href;}
    });
    
    /* Event tracking for downloads */
    $('#downloads a').click(function(event) {
        event.preventDefault();
        var href = $(this).attr('href');
        try {
            _gaq.push(['_trackEvent', 'download', 'click', href]);
            _gaq.push(function() {document.location = href;});
        } catch(err) {document.location = href;}
    });
    
});

