
 	if (typeof pageTracker != 'undefined') {
 	    // Outbound Links
	    $('a').each(function() {
	        var href = $(this).attr('href');
	        if( href.match('http://|https://') && href.indexOf(window.location.hostname) == -1) {
	            $(this).bind('click', function() {
    	            pageTracker._trackEvent('Outbound Link', $(this).attr('href'), window.location.pathname);
	            });
	        }
	    });
	    
	    // Downloads
        $('a.download').each(function() {
    		if($(this).attr('href').match(/[.](\w+)$/)) { 
				$(this).bind('click', function(event) {
					pageTracker._trackEvent('Downloads', $(this).attr('href'), $(this).text());
				});
    		}
        });
        
        // Copy Keyboard Shortcut
        function trackCopyEvent(type, selection) {
           pageTracker._trackEvent('Copy', type, selection);
        }
        
    	$(document).bind('keypress', function(event) { // Safari and Firefox
            if( (event.charCode == 99 && (event.metaKey || event.ctrlKey) ) && window.getSelection ) {
                var selection = String(window.getSelection() + '').substring(0,60);
    	        trackCopyEvent('text', selection);
    	    }
    	});
    	$(document).bind('keyup', function(event) { // Opera Windows and Internet Explorer
            if( event.keyCode == 67 && event.ctrlKey ) {
                if( document.getSelection ) { // Opera Windows
    	            var selection = document.getSelection().substring(0,60);
        	        trackCopyEvent('text', selection);
    	        } else if( document.selection ) { // Internet Explorer
    	            var selection = document.selection.createRange().text.substring(0,60);
        	        trackCopyEvent('text', selection);
    	        } 
    	    }
    	});
    	
    	// Context Menu
    	$(document).bind('contextmenu', function(event) {
    	    if(event.target.nodeName == 'img' || $(event.target).hasClass('img')) {
    	        var image = $(event.target).attr('src') || $(event.target).css('background-image').replace('url(', '').replace(')', '');
    	        trackCopyEvent('image', image.replace('/"/g', ''));
    	    }
    	});
        
        // Browser Dimensions
	    pageTracker._trackEvent('Browser Dimensions', 'load', $(window).width() + 'x' + $(window).height(), $(window).width());
        $(window).resize(function () {
            if ($(this).data('gatimer')) {
                clearTimeout($(this).data('gatimer'));
                $(this).data('gatimer', null);
            }

            $(this).data('gatimer', 
                setTimeout(function () {
                    pageTracker._trackEvent('Browser Dimensions', 'resize', $(window).width() + 'x' + $(window).height(), $(window).width());
                }, 500)
            );
        });
	}
	


