$(document).ready(function () {
    
        $('a').each(function () {
            var href = $(this).attr('href')
			if (typeof(href) == 'undefined') return true;

            if ((href.match(/^https?\:/i)) && (!href.match(document.domain))) {
                $(this).click(function () {
					 pageTracker._trackEvent('External', 'Click', href.replace(/^https?\:\/\//i, ''))
                    
                });
            }
            else if (href.match(/^mailto\:/i)) {
                $(this).click(function () {
					pageTracker._trackEvent('Email', 'Click', href.replace(/^mailto\:/i, ''))
                   
                })
            }
            else if (href.match(/\.(zip|exe|pdf|doc*|xls*|ppt*|wmv|mp*|rv|ra|wma)$/i)) {
                $(this).click(function () {
                    var extension = (/[.]/.exec(href)) ? /[^.]+$/.exec(href) : undefined
                    var filePath = href.replace(/^https?\:\/\/(www.)localhost\:1169\//i, '')
					  pageTracker._trackEvent('Download', 'Click - ' + extension, filePath)
                    
                })
            }
        })
    })

