JavaScript toy problems