sync with official plurk javascript code