Move some functions up since firefox is lame.