working mainpage js