It’s hard to say without being able to play around with it. It looks like what might be happening is since you’re not creating a new variable inside the
MakeInfoWindow function you end up modifying a global
infobox each time the function is run.
Try changing it to
var infobox = new InfoBox instead of just
infobox = new InfoBox, maybe?