revised the info box javascript to add closure