/*
code to inject GA events into page using jQuery and selectors

created 29/07/2011 by antonyh aka dayuser1

note that there are two trackers, the b._trackEvent events are for the locale-specific tracker
and the _trackEvent events are for the roll-up analytics account covering all countries.

Always have an entry for each, and keep them in sync if you want the analytics to make sense.

*/ 

/*
This is a compromise. This logs:
Resource Download
Download from [url]
PDF download: Text [url url to file]
*/ 
$("a[href*='.pdf']").live('click',function(){
            _gaq.push(['_trackEvent', 'Resource Download', 'Download from ' + document.location, 
                'PDF download: ' + $(this).text() + " [" + $(this).attr("href") + "]"
                ]);
            _gaq.push(['b._trackEvent', 'Resource Download', 'Download from ' + document.location, 
                'PDF download: ' + $(this).text() + " [" + $(this).attr("href") + "]"
                ]);
});


$("a[href*='workingfor.robertwalters.com']").live('click',function(){
            _gaq.push(['_trackEvent',   'External Pages', 'Work for Robert Walters', 'Clicked on Work for Robert Walters']);
            _gaq.push(['b._trackEvent', 'External Pages', 'Work for Robert Walters', 'Clicked on Work for Robert Walters']);
});

$("a[onclick*='window.print()']").live('click',function(){
            _gaq.push(['_trackEvent',   'Vacancy Engagement', 'Print', 'Print Vacancy']);
            _gaq.push(['b._trackEvent', 'Vacancy Engagement', 'Print', 'Print Vacancy']);
});


