namespace the click and dblclick events and unbind the old handlers (if they exist) before (re)binding the new ones.