be more definsive about holding onto something from a document in our closepanel function.  also close the panel on enter