attach mouse handlers to document