Hacking at javascript to make tags work