Modified showHidePopover to toggle the popover if already visible.  Added click handlers, in addition to touchend, for showing/hiding the popover.
Added rapid-click protection that could cause the popover to get stuck without the ability to close