updated javascript so that you can unselect a tab