fixed PDF attachment stuff, hacked a fix in for a non trivial to fix JS problem that has developed across different versions of firefox :( fuck javascript.