jQuery(document).ready(function($) {
    $.expr[':'].regex = function(e, i, m) {
        var mP = m[3].split(','),
            l = /^(data|css):/,
            a = {
                method: mP[0].match(l) ? mP[0].split(':')[0] : 'attr',
                property: mP.shift().replace(l, '')
            },
            r = new RegExp(mP.join('').replace(/^\s+|\s+$/g, ''), 'ig');
        return r.test($(e)[a.method](a.property));
    };

    $('a:regex(href,.*\/flash\/prospekt_kamp\/[A-Za-z0-9_-]+\.[A-Za-z]+)').live('click', function(e) {
        _gaq.push(['_trackEvent', 'Brosura', 'pregled', this.href.replace(/^.*\/\//, '')]);
    });
});

jQuery(document).ready(function($) {
    $('a[href^="mailto"]').live('click', function(e) {
        _gaq.push(['_trackEvent', 'Email', 'poslano', this.href.replace(/^mailto:/i, '')]);
    });
});
