bringing infobox definition within the scope of click listener