jQuery plugin for handling selection