Refactor table row select into a jquery plugin