A simple javascript dialog manager