Update Javascript for Mybb 1.8

Okay, so I tried my hand at it again, and somehow got it working... I still need to check the rest of the project for javascript that would need to be converted, but I think it's all here. I'd appreciate some bug-checking though.

(Also, this was a copy-paste from notepad++, so formatting might be broken)