put map in attach state after closing the child window. Close child window when reload of parent window or closing it.