Sorry, I could be able to read source code, but I could not debug and understand it…
JRA describe too, when the change of the button happens.

Today I deleted some cache folder of Firefox especially the one from flash player. Then P2 started only without loading osm-data and displayed all buttons and icons right.

After I deleted the cache with Firefox menue P2 started with osm-data and changes button as JRA describes.

Maybe this helps at debugging.

Cheers.