js class for create and use popup windows and demo