Added onclose event for FF and Webkit