hides the pop-up task form (if it's currently active)
gantt.showQuickInfo(5); ... gantt.hideQuickInfo();
This method is defined in the Quick Info extension, so you need to activate the quick_info plugin.