Calculate which link was clicked