Publication javascript stuff.