/* This script is used to find and select
*  all links on the main site containing
*  the mobile m.bristolairport.com domain and
*  attach additional cross-domain tracking
*  events for Google Analytics [uses jQuery].
*/

/* This function checks all links on the
*  page for the mobile Bristol Airport domain,
*  and adds an onclick event for Google Analytics
*  cross-domain tracking.
*/
function addCrossDomainPageTracker() {
    $("a[href*='m.bristolairport.com']").click(function() {
        //console.log('Added link tracking: ' + $(this).attr('href'));
        pageTracker._link($(this).attr('href'));
        return false;
    });
}

$(document).ready(function() {
    addCrossDomainPageTracker();
});
