function trackEvent( _scope, _label, _evt ){	
	try{		
		pageTracker._trackEvent( _scope, _label, _evt );
	}catch(E){}	
}
$(document).ready(function(){						   
	$("a").click( function(){						   
		
		var isExternal = false;
		var domain = document.domain;
		var sliced = $(this).attr("href").slice(0,1);
		var external = $(this).attr("href").search( domain );
		
		if ( sliced != "/" && external<0 ){			
			
			if ( $(this).attr("href").search( "mailto:" )<0 ){
				trackEvent( "link", "external", $(this).attr("href") );
			}
			
		}else{
			
			if ( $(this).attr("href").search( "/hubs/" )>-1 ){				
				trackEvent( "link", "hubs", $(this).attr("href") );	
			}
						
		}		
		
		if ( $(this).attr("href").search( "mailto:" )>-1 ){				
			if ( $(this).attr("href").search( "@hull.ac.uk" )<0 ){
				trackEvent( "email", "internal", $(this).attr("href").replace("mailto:", "") );
			}else{
				trackEvent( "email", "external", $(this).attr("href").replace("mailto:", "") );
			}
		}
		
		//return false;
								   
	});						   
});
