jquery to handle multiple types of search